Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

data/items/

An item kind: what an item is. It gives the item’s name, the model a held or dropped item shows, what it grants while equipped (abilities, stat modifiers, damage hooks), and the block it is, for items that are also blocks. Loot entries, loadouts and the equipment component name item kinds.

Registrymanifold:item-kind
Filesdata/items/*.ron, *.update.ron, *.final.ron
Sidesboth: the server and every client load it, and the handshake’s data hash covers it
Readsmanifold:predicate, manifold:stat
ContractGameplay framework, data stage

Entry

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

FieldTypeRequiredDefaultDescription
idstringyesThe item kind’s key, <mod-id>:<name>.
nameKey or Noneno<mod>.item.<id>.nameThe name’s message key, written Key("<key>") or as a string; the mod’s catalog must define it, or the data stage reports DATA010.
modelstring or Nonenothe drop archetype’s modelThe model a held or dropped item shows (a model recipe: flagship:weapons/m14).
grantsGrantsnonothingWhat it grants while equipped.
blockstring or NonenononeThe block key of an item that is also a block: what a pickup puts in a block inventory.

Example

From game/flagship-game/data/items/creature_drops.ron:

ItemKind(id: "flagship-game:leather")

Types

Key

A message key.

Written Key(..) around string, or as the bare value.

Grants

What an item grants while equipped.

A record: Grants(..) or (..).

FieldTypeRequiredDefaultDescription
abilitieslist of stringnononeAbilities (manifold:ability keys); unequipping cancels any that run.
stat_modifierslist of GrantedModifiernononeConstant stat modifiers.
damage_hookslist of DamageHooknononeDamage hooks, ordered after effects’ by slot.

GrantedModifier

A stat modifier granted while its source lasts: an item while equipped, or an ability while granted.

A record: GrantedModifier(..) or (..).

FieldTypeRequiredDefaultDescription
statstringyesThe stat (manifold:stat key). Not a resource: modify its maximum.
opModOpyesHow it combines.
valuenumberyesThe amount: a constant. A value that scales with its holder is a derived stat.
scopecondition or Nonenoalways countsA condition in the damage context: the modifier counts only when the stat is read while a hit is resolved and the condition holds (“+100 against undead”).

ModOp

How a stat modifier combines with the stat’s other modifiers. A stat’s value is (base + Σ Flat) × (1 + Σ Increased) × Π (1 + More) + Σ Final, then the last Override, then the stat’s clamp and rounding.

VariantWrittenDescription
FlatFlatAdded to the base.
IncreasedIncreasedSummed with the other Increased modifiers, then multiplies.
MoreMoreMultiplies on its own (0.5 is +50%, -0.5 is half).
FinalFinalAdded after the multipliers.
OverrideOverrideReplaces the value; the last applied wins.

DamageHook

A data hook on the damage pipeline, evaluated in the damage context (This is the victim; v.damage_amount is the stage’s amount). Within a stage, hooks run by priority, then side, then source, then list order.

A record: DamageHook(..) or (..).

FieldTypeRequiredDefaultDescription
stageDamageStageyesThe pipeline stage it runs at, which limits its actions.
sideHookSideyesWhich participant carries it: an Attacker hook on a sword’s effect runs when its holder attacks, a Victim hook on a shield’s when its holder is hit.
priorityi16no0Higher runs first, -32768 to 32767.
whencondition or NonenoalwaysA condition that must hold.
actionDamageActionyesWhat it does.

DamageStage

A stage of the damage pipeline.

VariantWrittenDescription
AdmitAdmitBefore anything: Cancel.
GatherGatherThe attacker’s part: Add, Multiply, Set, AddContextTag.
ConvertConvertBetween elements: Convert.
MitigateMitigateThe victim’s part: Add, Multiply, Set.
PreApplyPreApplyLast changes (blocks, parries, shields): all of the above and Cancel.
PreDeathPreDeathA killing hit only: Cancel (the victim survives), ApplyEffect.
PostHitPostHitAfter the hit: ApplyEffect, Reflect, Leech, Knockback, Cue.
PostKillPostKillAfter a kill: as PostHit.

HookSide

The participant a hook belongs to.

VariantWrittenDescription
AttackerAttackerThe attacker.
DirectDirectThe direct source (an arrow).
OwnerOwnerThe attacker’s owner.
VictimVictimThe victim.

DamageAction

What a hook does. Actions may also be written positionally, in field order (Cancel("x:cancel.blocked")); Add, Multiply and Set take (<value>) or (<element>, <value>).

VariantWrittenDescription
AddAdd(value: .., element: ..)Adds to an element’s amount.
MultiplyMultiply(value: .., element: ..)Multiplies by 1 + value, on one element or all of them.
SetSet(value: .., element: ..)Sets one element’s amount, or the total (rescaling the elements).
ConvertConvert(from: .., to: .., fraction: ..)Moves a fraction of one element’s amount into another.
CancelCancel(reason: ..)Stops the hit, with a reason tag (manifold:cancel.* or the game’s).
AddContextTagAddContextTag(tag: ..)Adds a tag to the hit’s context tags.
ApplyEffectApplyEffect(to: .., effect: .., level: ..)Applies an effect to a participant, with the hook’s holder as source.
ReflectReflect(fraction: .., damage_type: ..)Thorns: deals a fraction of the applied amount back to the attacker as a new hit (never more than two levels deep).
LeechLeech(fraction: .., resource: ..)Lifesteal: heals the attacker by a fraction of the applied amount.
KnockbackKnockback(add: ..)Adds to the hit’s horizontal knockback, m/s.
CueCue(cue: ..)Plays a cue at the hit.

Add fields:

FieldTypeRequiredDefaultDescription
valuenumberyesThe amount, a number.
elementstring or Nonenothe hit’s primary elementThe element (manifold:element key).

Multiply fields:

FieldTypeRequiredDefaultDescription
valuenumberyesThe change (-0.5 halves).
elementstring or Nonenoevery elementThe element.

Set fields:

FieldTypeRequiredDefaultDescription
valuenumberyesThe amount.
elementstring or Nonenothe totalThe element.

Convert fields:

FieldTypeRequiredDefaultDescription
fromstringyesThe element taken from.
tostringyesThe element given to.
fractionnumberyesThe fraction, clamped to 0..=1.

Cancel fields:

FieldTypeRequiredDefaultDescription
reasonstringyesThe reason tag.

AddContextTag fields:

FieldTypeRequiredDefaultDescription
tagstringyesThe tag.

ApplyEffect fields:

FieldTypeRequiredDefaultDescription
tosubjectyesThe participant.
effectstringyesThe effect (manifold:effect key).
levelnumbernothe holding effect’sThe effect’s level.

Reflect fields:

FieldTypeRequiredDefaultDescription
fractionnumberyesThe fraction.
damage_typestringyesThe reflected hit’s damage type.

Leech fields:

FieldTypeRequiredDefaultDescription
fractionnumberyesThe fraction.
resourcestringnomanifold:healthThe resource healed (manifold:stat key).

Knockback fields:

FieldTypeRequiredDefaultDescription
addnumberyesThe speed added.

Cue fields:

FieldTypeRequiredDefaultDescription
cuestringyesThe cue (manifold:cue key).

Value forms used here: condition, number, subject.