Expand description
Trigger/Effect Stone combat runtime — the arithmetic and the bookkeeping
keys. The orchestration is crate::logic::stones.
Per-fight trigger state lives in the player entity’s attributes, the same
idiom as stun_until_tick and stagger_procs: the fight rebuilds its
entities, so the state resets by construction.
Keys are namespaced stone.* so they cannot collide with a stat code —
crate::mechanics::fight::get_entity_stat composes <code>,
<code>.bonus and <code>.mod.
Constants§
- AFTER_
SKILL 1between an original Skill Cast and the next Basic Attack (TR-C06).- CAST_
KIND - What the player is currently swinging:
CAST_KIND_BASICorCAST_KIND_SKILL,0before the first cast. - CAST_
KIND_ BASIC - CAST_
KIND_ SKILL - CAST_
RUN_ COUNT - CAST_
RUN_ SLOT - CAST_
RUN_ TICK TR-R04Wide Cast counts how many targets one original Skill reached.- CAST_
RUN_ WINDOW_ TICKS - How long one cast’s per-target events may take to arrive. Half a second — the shipped cast animation. Two separate casts of the same Skill are always further apart (ability cooldowns are tens of seconds), so the window cannot merge them into one oversized “wide” cast.
- CRIT_
STREAK - How many critical hits the player has landed in an unbroken row.
- DAMAGE_
BUFF - Timed outgoing bonuses, permyriad: all damage (
EF-L06) and original Skills only (EF-R03). Both land as derived damage on top of the real hit, so they can never re-enter a trigger. - DAMAGE_
FLOOR - While positive, Core damage may not take the player below 1 HP (
EF-L05). - DODGE_
RING - How many recent Core Dodges the runtime remembers, i.e. the largest
Na “N dodges within a window” condition can ask for. - GLOBAL_
COOLDOWN - Tick at which the whole build may fire again — one key, not one per slot.
A condition that comes true inside the window is lost, and the sequence
counter behind it restarts (
reset_sequence_counters). - GUARD_
CHARGES - Fully blocked hits with a retaliation behind them (
EF-E06): charges, plus the retaliation damage precomputed at arm time so the block site needs no lookup of the attacker. - GUARD_
RETALIATION - HIT_
REDUCTION - Incoming-damage reduction armed for the next hits taken, permyriad + charges
(
EF-C04). - HIT_
REDUCTION_ CHARGES - HP_
LOW_ WATER - Lowest HP the hero has been at this phase, in permyriad of Max HP
(
TR-E03). Absent reads as full health — seehp_low_water. - INCOMING_
REDUCTION - Timed incoming-damage reduction, permyriad (
EF-R04). Expiry is the scheduled inverse, like every other timed stone attribute. - LAST_
SKILL - Slot index + 1 of the previous original Skill;
0= none yet (TR-R05). - LIFESTEAL
- Share of landed Core damage healed back, permyriad, timed (
EF-R05). - NEXT_
ATTACK_ BONUS - Damage bonus armed for the caster’s next attacks, in permyriad
(
2_000= +20%). Consumed bycrate::mechanics::fight::attack, one charge per damaging swing. - NEXT_
ATTACK_ BONUS_ CHARGES - How many more attacks
NEXT_ATTACK_BONUSapplies to.EF-C05arms one,EF-R06three,EF-E07five. - NEXT_
ATTACK_ CRIT - Crit-chance bonus armed for the caster’s next attacks, in permyriad, with
its own charge count. Consumed by
crate::mechanics::fight::attack. - NEXT_
ATTACK_ CRIT_ CHARGES - NEXT_
ATTACK_ DERIVED - Derived hits added to the next Basic Attack (
EF-E02): permyriad of Attack per hit, and how many hits. - NEXT_
ATTACK_ DERIVED_ CHARGES - NEXT_
ATTACK_ EXTRA_ HITS - Extra swings armed for the caster’s next cast. Consumed by
crate::mechanics::fight::cast, which queues them through aProcsink. - NEXT_
ATTACK_ SPLASH - NEXT_
ATTACK_ SPLASH_ CHARGES - NEXT_
SKILL_ BONUS - One-shot original-Skill payload bonus, permyriad + charges (
EF-C08,EF-L08). - NEXT_
SKILL_ BONUS_ CHARGES - NEXT_
SKILL_ ECHO - Derived copies of the next original Skill (
EF-E01,EF-L02): the strong copy, the weak one, and how many copies are owed. - NEXT_
SKILL_ ECHO_ CHARGES - NEXT_
SKILL_ ECHO_ WEAK - NEXT_
SKILL_ SPLASH - Splash armed on the next original Skills (
EF-R08) and on the next Basic Attacks (EF-L03): permyriad of Attack dealt to every living enemy. - NEXT_
SKILL_ SPLASH_ CHARGES - NEXT_
SKILL_ SPLIT - Derived copies spread off the next original Skill onto a bounded number
of extra targets (
EF-E08): the share of that Skill’s own landed payload each copy carries, and how many additional targets it may reach. - NEXT_
SKILL_ SPLIT_ TARGETS - PAID_
MANA - Mana the resolving cast actually paid, in x100 fixed point PLUS ONE —
0means “no payment recorded”, so a genuinely free cast (1) is still distinguishable from a cast that never went through the pool at all. - PREV_
HIT_ CRIT 1while the previous Core hit the player landed was a critical one —TR-R06Corrected Aim needs “crit straight after non-crit”.- SEQUENCE_
COUNTERS - Every sequence counter, for the “an activation lost on cooldown restarts the count” rule (acceptance criterion #5).
- SEQ_
BASIC_ ATTACK - Sequence counters, one per condition family — the common tier counts events (“every 5th attack”) rather than reacting to each. A counter that completes while on cooldown restarts from zero rather than banking its activation.
- SEQ_
DEFEAT - SEQ_
HIT_ TAKEN - SEQ_
SKILL_ CAST - SEQ_
STAGE TR-L04Perfect Sequence is a three-step state machine: Skill → Basic Attack → different Skill, all inside one window.SEQ_STAGEis how far it has come (0/1/2),SEQ_STAGE_TICKwhen it started,SEQ_STAGE_SKILLwhich Skill opened it (so “another” can be checked).- SEQ_
STAGE_ SKILL - SEQ_
STAGE_ TICK - SKILLS_
WITHOUT_ DAMAGE - Original Skills cast in a row without taking Core damage (
TR-L05). - SKILL_
BUFF - SKILL_
SLOTS - How many equipped Skill slots the runtime remembers per phase. A build with fewer equipped Skills leaves the tail keys at zero.
- SPELLBOOK_
DONE 1once every equipped Skill has been cast at least once this phase (TR-L03). A latch, so the condition fires on the cast that completed the spellbook and not on every cast afterwards.
Functions§
- armed_
magnitude - The magnitude of a
(magnitude, charges)pair, orNonewhen it is spent. Reading is separate from spending because the fight primitives only see&Entity, while the stone runtime holds it mutably. - attr
- Raw attribute read; a missing key is zero.
- counter_
met - Whether an event counter of
countsatisfies “everyperiod-th”. - crit_
streak_ met - Whether a crit streak of
streaksatisfies “requiredcrits in a row”. - dodge_
tick_ key - Tick + 1 of the
index-th most recent Core Dodge (0= the current one);0means “no such dodge yet” (TR-L02). - effect_
magnitude - Effect strength for one fire: the template’s own scaling by upgrade level,
times the
(trigger tier × effect tier)coefficient. Every shipped cell of that matrix is1.0, so tier interaction stays a config edit. - hp_
low_ water - The phase’s low-water HP mark. An absent key means the mark has never been written, which is full health — not zero, which would read as “already dead” and disarm every HP threshold for the whole fight.
- hp_
permyriad - The hero’s HP as permyriad of Max HP.
- interval_
due_ key - BAL-027
Battle Rhythm: fight-clock tick at which the interval trigger in this socket fires next.0(absent) means “not armed yet” — the first sighting arms the metronome without firing. - reset_
sequence_ counters - Zeroes every sequence counter, called when a condition came true while the global cooldown was running.
- skill_
last_ cast_ key - Tick + 1 of the last cast of the player’s equipped Skill in slot
index;0= not cast this phase. - socketed_
stat_ bonuses - Every passive stat the character’s socketed stones grant, as
(attribute, value)pairs ready to fold into an attribute delta map.