data/damage_types/
A damage type: what kind of hit this is (a sword swing, a fall, a boar’s charge). Every damage event names one. The type gives the hit its element, its tags (which can bypass armour or knockback), the per-attacker immunity window, knockback, the hit cue and the death message, and may override the world’s formula. The engine declares manifold:generic, manifold:command and manifold:kill.
| Registry | manifold:damage-type |
| Files | data/damage_types/*.ron, *.update.ron, *.final.ron |
| Sides | both: the server and every client load it, and the handshake’s data hash covers it |
| Reads | nothing |
| Contract | Gameplay framework, data stage |
Entry
A record, written DamageType(..); the name before the parentheses is optional.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | yes | The damage type’s key, <mod-id>:<name>. | |
tags | list of string | no | none | Tags hits of this type carry. The engine’s manifold:damage.* flag tags change the pipeline: bypasses_armor, bypasses_resistance, bypasses_immunity_window, bypasses_invulnerable, no_knockback, no_anger, can_self_harm, friendly_fire and no_hooks. |
element | string or None | no | manifold:generic | The element (manifold:element key). |
formula | string or None | no | the gameplay config’s default_formula | A formula that replaces the world’s default (manifold:damage-formula key). |
immunity | Immunity or None | no | by Owner, 10 ticks | The window in which one attacker cannot hit the same victim again. |
knockback | Knockback or None | no | none | Knockback a hit gives. |
hit_cue | string or None | no | the element’s | The cue a hit plays (manifold:cue key). |
death_message | string or None | no | none | The death message’s key (flagship-game.damage.boar_charge.death). |
Example
From game/flagship-game/data/damage_types/flagship.ron:
DamageType(id: "flagship-game:rifle",
tags: ["manifold:damage.is_projectile"],
immunity: (by: Hit, ticks: 10),
hit_cue: Some("flagship-game:cue.hit"))
Types
Immunity
A damage type’s immunity window.
A record: Immunity(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
by | ImmunityKeying | no | Owner | Whose hits share a window. |
group | string or None | no | none | A tag naming a separate window, so hits of another group still land. |
ticks | u16 | no | 10 | The window’s length in ticks. |
ImmunityKeying
Whose hits share an immunity window.
| Variant | Written | Description |
|---|---|---|
Owner | Owner | The attacker’s owner (melee): a pet’s bite shares its owner’s window. |
Attacker | Attacker | The attacker itself. |
Hit | Hit | The hit itself: each projectile or sweep hits each target once. |
None | None | No window (damage over time, falls). |
Knockback
Knockback.
A record: Knockback(..) or (..).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
horizontal | f32 | yes | Horizontal speed change, m/s. | |
vertical | f32 | yes | Vertical speed change, m/s. | |
from | KnockbackFrom | no | Attacker | The point the push comes from. |
KnockbackFrom
The point knockback pushes away from.
| Variant | Written | Description |
|---|---|---|
Attacker | Attacker | The attacker. |
Direct | Direct | The direct source (an arrow). |
EventPosition | EventPosition | The event’s position (an explosion’s centre). |