-
Notifications
You must be signed in to change notification settings - Fork 36
Damage
Damage is a collection of types and values for representing and handling damage. It is stored as IDamageData objects, typically in an array.
IDamageData: {
"type": DamageType;
"val": string | number;
"aoe"?: string | boolean;
"save"?: string | { stat: string; aoe?: boolean };
"save_half"?: boolean;
"ap"?: boolean;
"target"?: string;
}The type field indicates the type of damage being dealt. This must be one of the following strings:
KineticEnergyExplosiveHeatBurnVariable
The val field indicates the base damage value. This can be a number (e.g. 10) or a string representing a dice expression. A dice expression is a string of the form XdY+Z or XdY or Z, where:
-
Xis the number of dice (optional, defaults to 1) -
Yis the die type (eg. 6 for a d6, 20 for a d20) -
Zis a flat bonus (optional, defaults to 0)
Damage values can also contain special bonus strings that are interpreted by COMP/CON based on context. See Bonus Strings for more information.
Finally, damage values will be evaluated as normal arithmetic expressions, so you can use +, -, *, /, and parentheses to create more complex calculations (e.g. 2d6+4, (1d8+2)*2, 2+1d6+{agi} etc).
The aoe field indicates that the damage is area-of-effect. This can be a boolean (true/false) or a string representing the area of effect (e.g. burst 3). As COMP/CON does not handle positioning or grids, the aoe field is only used within Active Mode to show the multi-target input. If this is not supplied area-of-effect will be determined based on the parent object's range field, if applicable.
The save field indicates that the damage can be resisted with a saving throw. This can be a string representing the stat to save against (e.g. hull, agi, sys) or an object with a stat field and an optional aoe boolean field. If the aoe field is true, the save is considered to affect multiple targets and will display the multiple target UI in Active Mode.
If save_half is true, targets that succeed on their saving throw take half damage. If false or omitted, targets that succeed on their saving throw take no damage.
If ap is true, the damage ignores armor. If false or omitted, the damage is reduced by the target's armor value. If this is omitted, this field will be calculated based on the parent object's Tags.
The target field is used as a hint for default ordering of Active Mode target selection UI. This can be one of self, ally, enemy. If omitted, this defaults to enemy.