Expand description
Native ports for the fight_start category — a fight template’s
start_behavior (run via run_event, returning Vec<OverlordEvent>).
The deployed start_behaviors are dominated by a single shape:
ctx.init_fight(State, "<self template id>") — covered by
init_fight_self. A small tail additionally pushes a static attribute
increment on the player (and, when present, the party player) — covered by
init_fight_self_static_buff.
Unlike the combat event/start_cast_ability categories these scripts do
NOT consume the authoritative RNG (init_fight is RNG-free and the shipped
bodies never touch Random).
Structs§
- Fight
Start Ctx - Inputs available to a
fight_startnative fn — the fightstart_behaviorscope (Fight,State) plus the lookupsinit_fightneeds. The fight template id isfight.fight_id(the deployed scripts always pass the template’s own$.idtoinit_fight).
Functions§
- apply_
spawn_ on_ death_ to_ player - Port of the test fight
start_behaviorResult.push(OverlordEventEntityApplyEffect(Fight.player_id, uuid("39f135d2-...")));— applies the spawn-on-death effect to the player. RNG-free; used bytest_fighting::test_spawn_entity. - damage_
first_ entity_ 5 - Port of the test fight
start_behaviorResult.push(OverlordEventDamage(Fight.entities[0].id, unsigned(5), CustomEventData()))— damages the first fight entity by 5. RNG-free; used bytest_fighting::test_start_fight_script. - init_
fight_ self - Port of
ctx.init_fight(State, "<self template id>")— the dominant fightstart_behavior. Delegates to the already-nativefight::init_fightwithfight.fight_idas the template id (identical to passing$.id). - init_
fight_ self_ static_ buff - Port of the static-buff variant: the
init_fightcall followed byResult.push(OverlordEventEntityIncrAttribute(Fight.player_id, "static", 1))and the same forFight.party_player_idwhen it is set. Event order matches static). - noop
- No-op fight start: the equivalent of an empty
start_behavior(the program produces noResultevents). Used by test fight templates whosestart_behavioris"". - register
- Register this category’s native fns.
Type Aliases§
- Fight
Start Fn - Signature of a
fight_startnative fn.