Expand description
Native functions for the trigger category — the offer trigger_script
slot (OfferTemplate::trigger_script). A trigger script decides whether a
wrapper runs it as run_expression::<bool> with Event / CharacterState
/ Offer in scope (see should_give_new_offer in
logic/handler.rs).
offer is skipped — the effective outcome is “do not auto-give this offer”.
The single trivial native fn below mirrors that default by returning
false.
Follows the reference shape in [super::power]: a typed *Ctx, a *Fn
alias, a native impl, and a register.
Structs§
- Trigger
Ctx trigger_scriptsees: the firing event (Event), the player (CharacterState), and the candidate offer (Offer).configis carried for parity with the other categories’ contexts even though the trivial default does not read it.
Functions§
- always_
trigger - Native port of the
trigger_script: "true"content used by every offer that is meant to be auto-given the moment one of itsevents_subscribeevents fires. By the timeshould_give_new_offerruns, the candidate offer is already known to beenabledand to have the firing event in itsevents_subscribelist (seetry_give_new_offers), so the faithful decision for a subscribing offer is simply “give it” →true.
Type Aliases§
- Trigger
Fn - Signature of a
triggernative fn. Freefn(no captured state) so it isCopyand trivially stored in the registry; runtime context arrives via