Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

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.

Registrymanifold:damage-type
Filesdata/damage_types/*.ron, *.update.ron, *.final.ron
Sidesboth: the server and every client load it, and the handshake’s data hash covers it
Readsnothing
ContractGameplay framework, data stage

Entry

A record, written DamageType(..); the name before the parentheses is optional.

FieldTypeRequiredDefaultDescription
idstringyesThe damage type’s key, <mod-id>:<name>.
tagslist of stringnononeTags 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.
elementstring or Nonenomanifold:genericThe element (manifold:element key).
formulastring or Nonenothe gameplay config’s default_formulaA formula that replaces the world’s default (manifold:damage-formula key).
immunityImmunity or Nonenoby Owner, 10 ticksThe window in which one attacker cannot hit the same victim again.
knockbackKnockback or NonenononeKnockback a hit gives.
hit_cuestring or Nonenothe element’sThe cue a hit plays (manifold:cue key).
death_messagestring or NonenononeThe 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 (..).

FieldTypeRequiredDefaultDescription
byImmunityKeyingnoOwnerWhose hits share a window.
groupstring or NonenononeA tag naming a separate window, so hits of another group still land.
ticksu16no10The window’s length in ticks.

ImmunityKeying

Whose hits share an immunity window.

VariantWrittenDescription
OwnerOwnerThe attacker’s owner (melee): a pet’s bite shares its owner’s window.
AttackerAttackerThe attacker itself.
HitHitThe hit itself: each projectile or sweep hits each target once.
NoneNoneNo window (damage over time, falls).

Knockback

Knockback.

A record: Knockback(..) or (..).

FieldTypeRequiredDefaultDescription
horizontalf32yesHorizontal speed change, m/s.
verticalf32yesVertical speed change, m/s.
fromKnockbackFromnoAttackerThe point the push comes from.

KnockbackFrom

The point knockback pushes away from.

VariantWrittenDescription
AttackerAttackerThe attacker.
DirectDirectThe direct source (an arrow).
EventPositionEventPositionThe event’s position (an explosion’s centre).