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: ObjectiveIdThe objective to complete (resolved at the stage-5 boundary).
SetFlag
Sets a campaign flag (DSL v0.4), mirroring Verb::SetFlag.
SetTime
Cuts the world time (DSL v0.5), mirroring Verb::SetTime.
SetWeather
Cuts the weather (DSL v0.5), mirroring Verb::SetWeather.
Fields
weather: WorldWeatherThe 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
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.
Implementations§
Source§impl DialogueEffect
impl DialogueEffect
Sourcepub fn v05_effect(&self) -> Option<&'static str>
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).
Sourcepub fn v06_effect(&self) -> Option<&'static str>
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).
Sourcepub fn spawn_npc(&self) -> Option<&NpcId>
pub fn spawn_npc(&self) -> Option<&NpcId>
The NPC id if this is a v0.6 spawn-npc dialogue effect.
Sourcepub fn body_entry(&self) -> Option<&str>
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.
Sourcepub fn set_checkpoint(&self) -> Option<(&AnchorId, &[QuestEffect])>
pub fn set_checkpoint(&self) -> Option<(&AnchorId, &[QuestEffect])>
(anchor, on_respawn) if this is a v0.6 set-checkpoint dialogue effect.
Sourcepub fn set_checkpoint_on_respawn(&self) -> Option<&[QuestEffect]>
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.
Sourcepub fn set_checkpoint_on_respawn_mut(&mut self) -> Option<&mut [QuestEffect]>
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
impl DialogueEffect
Sourcepub fn set_flag(&self) -> Option<&FlagId>
pub fn set_flag(&self) -> Option<&FlagId>
The set-flag flag id if this is a v0.4 set-flag dialogue effect.
Sourcepub fn v04_effect(&self) -> Option<&'static str>
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).
Sourcepub fn set_time(&self) -> Option<WorldTime>
pub fn set_time(&self) -> Option<WorldTime>
The target time if this is a v0.5 set-time dialogue effect.
Sourcepub fn set_weather(&self) -> Option<WorldWeather>
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
impl Clone for DialogueEffect
Source§impl Debug for DialogueEffect
impl Debug for DialogueEffect
Source§impl<'de> Deserialize<'de> for DialogueEffect
impl<'de> Deserialize<'de> for DialogueEffect
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for DialogueEffect
impl JsonSchema for DialogueEffect
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more