QtCraft API C++ classes QML types Handbook

QcMobCramming Namespace

The damage of crammed cells (game rule maxEntityCramming, decision E-401): creatures in a cell with more than the limit are hurt while it still holds more (counting those that died this tick), each only in every phases-th tick, staggered by its id. More...

Header: #include <server/mobs/QcMobCramming.h>

Classes

struct Hurt

Variables

const double damage
const int phases

Functions

QList<QcMobCramming::Hurt> apply(QcMobManager &mobs, int limit, quint64 tick)

Detailed Description

QcServerCreatures adds the sounds and the loot; the measurements call it on the creatures alone.

Classes

class Hurt

A creature cramming hurt: its kind, where it stood and its drops when it died. More...

Variable Documentation

const double QcMobCramming::damage

Damage of one cramming hit, as in the reference. Like any hit it respects the creature's invulnerability after a hurt (QcHurtWindow, game rule mobInvulnerabilityTicks): inside the window it does nothing unless it is stronger than the strongest hit of the window.

const int QcMobCramming::phases

A crammed creature is hurt only in every this many ticks, staggered by its id: the reference's chance of one in four per tick, made deterministic. Deaths spread over a few ticks, so a crowd shrinks to about the limit instead of dying all at once.

Function Documentation

QList<QcMobCramming::Hurt> QcMobCramming::apply(QcMobManager &mobs, int limit, quint64 tick)

Hurts the creatures of mobs crammed beyond limit whose turn it is in tick tick (the crowd as the last creature tick counted it) and returns them.