Expand description
Native ports for the event category — effect scripts (run via
run_event, returning Vec<OverlordEvent>).
Effect scripts are arbitrary per-effect programs that read Entity.attributes
and push events (and, for the combat ones, call ctx.* fight primitives).
Like start_cast_ability they can consume the authoritative RNG (the game
Random).
Scope (per the effect run_event call site): Entity, Fight, Random,
CurrentTick, FightDurationTicks, and the caller Event.
Structs§
- Event
Ctx - Inputs available to an
event(effect) native fn — the effectrun_eventscope plus config/lookups the combat primitives need.
Functions§
- bloodleak_
tick - RNG-free; only used by
test_effects::test_effect_with_interval. - dot_
tick - Port of the damage-over-time (DoT) tick — the damage sibling of
hot_tick. Same 5-slot rolling schedule (effect.dot.nextcursor +effect.dot.tick.<i>amounts); on a populated slot it advances the cursor, zeroes the slot, and dealsdamage_entitywith{dot, no_hit_anim}custom data. Unlike HoT this CONSUMES rng (damage_entityrolls oneblockstat_throw). - effect_
tick_ stun - Port of the Shield + Stun effect tick. Both deployed
.scripts have the identical bodyctx.tick_entity_effect(Entity, "stun")(plus a test-onlyResultarray-drain we deliberately don’t replicate — it never runs on the productionEventVecpath). - empower_
duration_ decrement - hot_
tick - Port of the heal-over-time (HoT) tick. The effect stores a rolling 5-slot
schedule:
effect.hot.nextis the slot index to consume this tick, andeffect.hot.tick.<i>holds each slot’s heal amount. Each tick: if the current slot is empty (absent), reset the cursor to 0; otherwise advance the cursor (wrapping 5→1), zero the consumed slot, and heal by its amount.set_entity_attr/add_entity_attrpushIncrAttributes;heal_entityis RNG-free (no draw), so this needs no RNG snapshot. - low_
hp_ heal_ on_ damage - Port of the test “heal when about to die” effect (
3b136901-...), subscribed RNG-free; only used bytest_effects::test_effect_with_subscribe. - protection_
duration_ decrement - regeneration_
tick - Port of the regeneration tick: heal the entity by its
regeneration_ratestat.get_entity_statreads the stat (base + bonus + mod);heal_entitypushes aHealevent clamped to missing HP (no RNG). - register
- Register this category’s native fns.
- sleep_
wake_ tick - Port of the sleep tick: if the entity already woke (
sleepattr absent), remove thewake_up_delayentirely; otherwise decrementwake_up_delayby 1 and, when it reaches 1 or less, clear thesleepattr. - spawn_
two_ on_ death - Port of the test “spawn two enemies on death” effect (
39f135d2-...), Each spawn draws a random uuid from the authoritative RNG (in order, like the - test_
effect_ tick - Port of the
[TEST] Test effecttick: bump atest_effect_tickscounter by one. RNG-free; only used by the effect’s own unit test. - tutorial_
buff_ tick - Port of the tutorial damage buff: when THIS entity is the one that took
damage (the effect subscribes to
Damage, and the script guards onEvent.entity_id == Entity.id), scale crit chance and damage-reduction by fraction of HP lost and push the four attribute deltas. RNG-free. - vulnerability_
duration_ decrement - weakness_
duration_ decrement
Type Aliases§
- EventFn
- Signature of an
event(effect) native fn.