Skip to main content

EffectRootOwner

Enum EffectRootOwner 

Source
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

§quest: &'a Quest

The owning quest.

§objective: &'a str

The objective whose completion fires the bundle.

§

QuestComplete

A quest’s on_complete — fires at the quest’s completion step. Forced.

Fields

§quest: &'a Quest

The owning quest.

§

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>

Source

pub fn kind(&self) -> EffectRootKind

Which root this is. The one place a root’s owner is mapped to its kind.

Source

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.

Source

pub fn quest(&self) -> Option<&'a Quest>

The quest this root belongs to, if it has a DAG position at all.

Trait Implementations§

Source§

impl<'a> Clone for EffectRootOwner<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for EffectRootOwner<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for EffectRootOwner<'a>

§

impl<'a> RefUnwindSafe for EffectRootOwner<'a>

§

impl<'a> Send for EffectRootOwner<'a>

§

impl<'a> Sync for EffectRootOwner<'a>

§

impl<'a> Unpin for EffectRootOwner<'a>

§

impl<'a> UnsafeUnpin for EffectRootOwner<'a>

§

impl<'a> UnwindSafe for EffectRootOwner<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.