Skip to content

Damager

Deals damage to characters that come into contact with them. Damagers typically use fixed values.

Damager = {
-- Attributes
Damage: std.Attribute<Damage>,
DamageMeasurement: std.Attribute<DamageMeasurement>,
Poison: std.Attribute<boolean>,
}
Damager.Damage: std.Attribute<Damage>

Amount of Damage that should be dealt. See the Damage type.

Damager.DamageMeasurement: std.Attribute<DamageMeasurement>

The measurement of damage to be dealt. See the DamageMeasurement type.

Damager.Poison: std.Attribute<boolean>

Whether damage should be dealt overtime as poison.

export type Damage = number | "Normal" | "Double" | "Quadruple" | "Lethal"

Defines the amounts of Damage to be dealt. Positive number can be used to define variable damage values. Otherwise, the following is used:

NameAmount
"Normal"10
"Double"20
"Quadruple"40
"Lethal"Infinite
export type DamageMeasurement = "Raw" | "RelativeToMaxHealth"

The measurement of damage to be dealt. Raw is treated as raw health, while RelativeToMaxHealth is treated as a percentage of the player’s maximum health.