pub enum EffectRootOwner<'a> {
ObjectiveComplete {
quest: &'a Quest,
objective: &'a str,
},
QuestComplete {
quest: &'a Quest,
},
Trigger(&'a EnvTrigger),
TrapPayload(&'a Trap),
DialogueRespawn,
ShortcutUnlock(&'a Shortcut),
OnDeath,
ShopOffer(&'a Shop),
OnKill(Fight<'a>),
AssemblyLand(&'a Assembly),
LoopCross(&'a Loop),
}Expand description
What a root hangs off, with the owning object attached.
This is what a consumer matches on when it needs to reason about when a
bundle fires (the completability model) or who gates it (a trigger’s or
trap’s requires_flags). Because the match is exhaustive at every such site,
an eighth root is a compile error everywhere the answer would have to change.
Variants§
ObjectiveComplete
A quest’s on_objective_complete[<objective>] — fires at that objective’s
critical_path step. Forced: completing the objective is the mainline.
Fields
QuestComplete
A quest’s on_complete — fires at the quest’s completion step. Forced.
Trigger(&'a EnvTrigger)
An environment triggers[].effects — proximity/interaction-fired, so it
has no step of its own. Carries the trigger, whose requires_flags gate
the whole bundle.
TrapPayload(&'a Trap)
A traps[].payload (spec-0022) — proximity/interaction-fired exactly like
a trigger, and optional: the party may never trip it. Carries the trap,
whose requires_flags gate the whole payload.
DialogueRespawn
A dialogue option’s set-checkpoint on_respawn bundle — re-run on death
while that checkpoint is active, so it is optional too (nobody is forced to
die). Carries no owning object: the npc, node and option are all named in
the site’s path, and no consumer needs to reach the tree itself.
ShortcutUnlock(&'a Shortcut)
A shortcuts[].on_unlock (spec-0016 §2) — fired once, by the far-side
interaction, and optional: Plan::build registers every shortcut gate
as sealed at step 0 precisely so the delve is proven completable with no
shortcut ever taken. Carries the shortcut; it declares no flag gate of its
own, so the whole bundle is ungated.
OnDeath
The campaign’s on_death (spec-0031) — fired at the moment a player dies,
so it has no step of its own and is optional in the strongest sense:
nobody is forced to die. Carries no owning object; there is exactly one
per campaign and its path is /content/on_death.
ShopOffer(&'a Shop)
A shops[].offers[].effects (spec-0032) — fired by the player pressing a
button, so it has no step of its own and is optional: nobody is forced
to buy anything. Carries the shop; the offer index is in the site’s path.
OnKill(Fight<'a>)
A wave’s or an actor’s on_kill (spec-0074) — fired by a player being
credited with a kill, so it has no step of its own and is optional:
nobody is forced to be credited with a kill (a body may fall, burn or be
cut down by another mob). Carries the fight.
AssemblyLand(&'a Assembly)
An assembly’s strike step on_land (spec-0082) — fired by the strike
machine while a player stands in the arming region, so it has no step
of its own and is optional: nobody is forced to stand where a blow
lands. Carries the assembly; the step index is in the site’s path.
LoopCross(&'a Loop)
A loops[].on_cross (spec-0086) — fired by a body crossing a holding
slab, so it has no objective step of its own; on the forced route it is
performed by the path’s exercise step, elsewhere it is optional.
Carries the loop.
Implementations§
Source§impl<'a> EffectRootOwner<'a>
impl<'a> EffectRootOwner<'a>
Sourcepub fn kind(&self) -> EffectRootKind
pub fn kind(&self) -> EffectRootKind
Which root this is. The one place a root’s owner is mapped to its kind.
Sourcepub fn runs_with_acting_player(&self) -> bool
pub fn runs_with_acting_player(&self) -> bool
Whether emission runs this site’s bundle with an acting player (@s).
EffectRootKind::runs_with_acting_player answers for the root class,
which is the right answer for six of the eight and was the right answer for
all of them until DSL v0.11. A trigger is now the exception: an
audience: presser click is dispatched by a
minecraft:player_interacted_with_entity advancement and therefore runs as
the player who pressed, while every other trigger is polled on the tick
with no executor. The distinction is per-declaration, so it is answered
where the declaration is reachable — here — and the kind-level answer stays
the class default that emit::root_audience is bound to.