Skip to main content

DialogueEffect

Enum DialogueEffect 

Source
pub enum DialogueEffect {
    CompleteObjective {
        objective: ObjectiveId,
    },
    SetFlag {
        flag: FlagId,
    },
    SetTime {
        time: WorldTime,
    },
    SetWeather {
        weather: WorldWeather,
    },
    SetCheckpoint {
        anchor: AnchorId,
        on_respawn: Vec<QuestEffect>,
    },
    SpawnNpc {
        npc: NpcId,
    },
}
Expand description

Effect fired by a dialogue option. complete-objective (v0.2) and, from DSL v0.4, set-flag (mirrors the quest effect — sets a campaign flag from a dialogue choice, enabling flag-gated options/objectives/triggers).

Variants§

§

CompleteObjective

Marks a stage-5 objective complete.

Fields

§objective: ObjectiveId

The objective to complete (resolved at the stage-5 boundary).

§

SetFlag

Sets a campaign flag (DSL v0.4), mirroring Verb::SetFlag.

Fields

§flag: FlagId

The flag to set.

§

SetTime

Cuts the world time (DSL v0.5), mirroring Verb::SetTime.

Fields

§time: WorldTime

The time state to cut to.

§

SetWeather

Cuts the weather (DSL v0.5), mirroring Verb::SetWeather.

Fields

§weather: WorldWeather

The weather state to cut to.

§

SetCheckpoint

Sets the party-wide respawn checkpoint (DSL v0.6, spec-0012), mirroring Verb::SetCheckpoint — usable from a dialogue outcome.

Fields

§anchor: AnchorId

The prefab checkpoint anchor the party respawns at.

§on_respawn: Vec<QuestEffect>

Per-player effects re-run on respawn while this checkpoint is active (scene reset). Empty = no hook.

§

SpawnNpc

Summons a deferred stage-2 NPC (DSL v0.6), mirroring Verb::SpawnNpc — a character who walks in mid-conversation.

Fields

§npc: NpcId

The NPC (stage-2 ref) to summon.

Implementations§

Source§

impl DialogueEffect

Source

pub fn v05_effect(&self) -> Option<&'static str>

The v0.5 effect name if this dialogue effect is one introduced in DSL v0.5 (set-time/set-weather, spec-0010).

Source

pub fn v06_effect(&self) -> Option<&'static str>

The v0.6 effect name if this dialogue effect is one introduced in DSL v0.6 (set-checkpoint, spec-0012; spawn-npc).

Source

pub fn spawn_npc(&self) -> Option<&NpcId>

The NPC id if this is a v0.6 spawn-npc dialogue effect.

Source

pub fn body_entry(&self) -> Option<&str>

The body this dialogue effect puts into the world, by id — the dialogue half of QuestEffect::body_entry.

A body can enter the world from a conversation as well as from a quest bundle, and a rule about what is standing where has to enumerate every entry point or it is a gate with a door beside it. This enum carries no exit at all: nothing a dialogue option does removes a body.

Source

pub fn set_checkpoint(&self) -> Option<(&AnchorId, &[QuestEffect])>

(anchor, on_respawn) if this is a v0.6 set-checkpoint dialogue effect.

Source

pub fn set_checkpoint_on_respawn(&self) -> Option<&[QuestEffect]>

The on_respawn bundle of a v0.6 set-checkpoint dialogue effect — effect root 5 (crate::effects). Named separately from Self::set_checkpoint so the root walk and its mutable mirror name the same accessor modulo mutability, which is what lets one macro body generate both.

Source

pub fn set_checkpoint_on_respawn_mut(&mut self) -> Option<&mut [QuestEffect]>

The on_respawn bundle of a v0.6 set-checkpoint dialogue effect, exposed mutably so the localization pass can rewrite the player-visible strings nested inside it. Lockstep sibling of Self::set_checkpoint — the bundle is a plain Vec<QuestEffect> that emission really lowers, so every scan that reaches it read-only needs a way to reach it writable too.

Source§

impl DialogueEffect

Source

pub fn set_flag(&self) -> Option<&FlagId>

The set-flag flag id if this is a v0.4 set-flag dialogue effect.

Source

pub fn v04_effect(&self) -> Option<&'static str>

The v0.4 effect name if this dialogue effect is one introduced in DSL v0.4 (set-flag).

Source

pub fn set_time(&self) -> Option<WorldTime>

The target time if this is a v0.5 set-time dialogue effect.

Source

pub fn set_weather(&self) -> Option<WorldWeather>

The target weather if this is a v0.5 set-weather dialogue effect.

Trait Implementations§

Source§

impl Clone for DialogueEffect

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 Debug for DialogueEffect

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DialogueEffect

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for DialogueEffect

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for DialogueEffect

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for DialogueEffect

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DialogueEffect

Auto Trait Implementations§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.