ConditionAst

Enum ConditionAst 

Source
pub enum ConditionAst {
Show 33 variants Always, EnterRoom(String), TakeItem(String), TouchItem(String), TalkToNpc(String), OpenItem(String), LeaveRoom(String), LookAtItem(String), UseItem { item: String, ability: String, }, GiveToNpc { item: String, npc: String, }, UseItemOnItem { tool: String, target: String, interaction: String, }, Ingest { item: String, mode: IngestModeAst, }, ActOnItem { target: String, action: String, }, TakeFromNpc { item: String, npc: String, }, InsertItemInto { item: String, container: String, }, DropItem(String), UnlockItem(String), MissingFlag(String), HasFlag(String), HasItem(String), PlayerInRoom(String), HasVisited(String), MissingItem(String), FlagInProgress(String), FlagComplete(String), WithNpc(String), NpcHasItem { npc: String, item: String, }, NpcInState { npc: String, state: String, }, ContainerHasItem { container: String, item: String, }, Ambient { spinner: String, rooms: Option<Vec<String>>, }, ChancePercent(f64), All(Vec<ConditionAst>), Any(Vec<ConditionAst>),
}
Expand description

Trigger condition variants.

Variants§

§

Always

Event: trigger has no event; conditions only.

§

EnterRoom(String)

Event: player enters a room.

§

TakeItem(String)

Event: player takes an item.

§

TouchItem(String)

Event: player touches / presses an item

§

TalkToNpc(String)

Event: player talks to an NPC.

§

OpenItem(String)

Event: player opens an item.

§

LeaveRoom(String)

Event: player leaves a room.

§

LookAtItem(String)

Event: player looks at an item.

§

UseItem

Event: player uses an item with an ability.

Fields

§item: String
§ability: String
§

GiveToNpc

Event: player gives an item to an NPC.

Fields

§item: String
§

UseItemOnItem

Event: player uses one item on another item with an interaction.

Fields

§tool: String
§target: String
§interaction: String
§

Ingest

Event: player ingests an item using a specific mode (eat, drink, inhale).

Fields

§item: String
§

ActOnItem

Event: player performs an interaction on an item (tool-agnostic).

Fields

§target: String
§action: String
§

TakeFromNpc

Event: player takes an item from an NPC.

Fields

§item: String
§

InsertItemInto

Event: player inserts an item into a container item.

Fields

§item: String
§container: String
§

DropItem(String)

Event: player drops an item.

§

UnlockItem(String)

Event: player unlocks an item.

§

MissingFlag(String)

Require that a flag is missing (by name).

§

HasFlag(String)

Require that a flag is present (by name).

§

HasItem(String)

Require that the player has an item (by symbol id).

§

PlayerInRoom(String)

Require that the player is currently in a room (by symbol id).

§

HasVisited(String)

§

MissingItem(String)

§

FlagInProgress(String)

§

FlagComplete(String)

§

WithNpc(String)

§

NpcHasItem

Fields

§item: String
§

NpcInState

Fields

§state: String
§

ContainerHasItem

Fields

§container: String
§item: String
§

Ambient

Fields

§spinner: String
§

ChancePercent(f64)

Random chance in percent (0-100).

§

All(Vec<ConditionAst>)

All of the nested conditions must hold.

§

Any(Vec<ConditionAst>)

Any of the nested conditions may hold (not yet compilable for triggers).

Trait Implementations§

Source§

impl Clone for ConditionAst

Source§

fn clone(&self) -> ConditionAst

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ConditionAst

Source§

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

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

impl PartialEq for ConditionAst

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ConditionAst

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.