ActionAst

Enum ActionAst 

Source
pub enum ActionAst {
Show 43 variants Show(String), AddSpinnerWedge { spinner: String, width: usize, text: String, }, AddFlag(String), AddSeqFlag { name: String, end: Option<u8>, }, AwardPoints { amount: i64, reason: String, }, RemoveFlag(String), ReplaceItem { old_sym: String, new_sym: String, }, ReplaceDropItem { old_sym: String, new_sym: String, }, ModifyItem { item: String, patch: ItemPatchAst, }, ModifyRoom { room: String, patch: RoomPatchAst, }, ModifyNpc { npc: String, patch: NpcPatchAst, }, SpawnItemIntoRoom { item: String, room: String, }, DespawnItem(String), DespawnNpc(String), ResetFlag(String), AdvanceFlag(String), SetBarredMessage { exit_from: String, exit_to: String, msg: String, }, RevealExit { exit_from: String, exit_to: String, direction: String, }, LockExit { from_room: String, direction: String, }, UnlockExit { from_room: String, direction: String, }, LockItem(String), UnlockItemAction(String), PushPlayerTo(String), GiveItemToPlayer { npc: String, item: String, }, SpawnItemInInventory(String), SpawnItemCurrentRoom(String), SpawnItemInContainer { item: String, container: String, }, SpawnNpcIntoRoom { npc: String, room: String, }, SetItemDescription { item: String, text: String, }, NpcSays { npc: String, quote: String, }, NpcSaysRandom { npc: String, }, NpcRefuseItem { npc: String, reason: String, }, SetNpcActive { npc: String, active: bool, }, SetNpcState { npc: String, state: String, }, DenyRead(String), RestrictItem(String), SetContainerState { item: String, state: Option<String>, }, SpinnerMessage { spinner: String, }, ScheduleIn { turns_ahead: usize, actions: Vec<ActionStmt>, note: Option<String>, }, ScheduleOn { on_turn: usize, actions: Vec<ActionStmt>, note: Option<String>, }, ScheduleInIf { turns_ahead: usize, condition: Box<ConditionAst>, on_false: Option<OnFalseAst>, actions: Vec<ActionStmt>, note: Option<String>, }, ScheduleOnIf { on_turn: usize, condition: Box<ConditionAst>, on_false: Option<OnFalseAst>, actions: Vec<ActionStmt>, note: Option<String>, }, Conditional { condition: Box<ConditionAst>, actions: Vec<ActionStmt>, },
}
Expand description

Minimal action variants.

Variants§

§

Show(String)

Show a message to the player.

§

AddSpinnerWedge

Add a weighted wedge to a spinner

Fields

§spinner: String
§width: usize
§text: String
§

AddFlag(String)

Add a simple flag by name.

§

AddSeqFlag

Add a sequence flag by name with optional limit (end)

Fields

§name: String
§end: Option<u8>
§

AwardPoints

Award points to the player’s score with a reason string.

Fields

§amount: i64
§reason: String
§

RemoveFlag(String)

Remove a flag by name.

§

ReplaceItem

Replace an item instance by symbol with another

Fields

§old_sym: String
§new_sym: String
§

ReplaceDropItem

Replace an item when dropped with another symbol

Fields

§old_sym: String
§new_sym: String
§

ModifyItem

Apply an item patch to mutate fields atomically.

Fields

§item: String
§

ModifyRoom

Apply a room patch to mutate room fields atomically.

Fields

§room: String
§

ModifyNpc

Apply an NPC patch to mutate npc fields atomically.

Fields

§

SpawnItemIntoRoom

Spawn an item into a room.

Fields

§item: String
§room: String
§

DespawnItem(String)

Despawn an item.

§

DespawnNpc(String)

Despawn an NPC

§

ResetFlag(String)

Reset a sequence flag to step 0.

§

AdvanceFlag(String)

Advance a sequence flag by one step.

§

SetBarredMessage

Set a barred message for an exit between rooms

Fields

§exit_from: String
§exit_to: String
§

RevealExit

Reveal an exit in a room in a direction to another room.

Fields

§exit_from: String
§exit_to: String
§direction: String
§

LockExit

Lock or unlock exits and items

Fields

§from_room: String
§direction: String
§

UnlockExit

Fields

§from_room: String
§direction: String
§

LockItem(String)

§

UnlockItemAction(String)

§

PushPlayerTo(String)

Push player to a room.

§

GiveItemToPlayer

NPC gives an item to the player

Fields

§item: String
§

SpawnItemInInventory(String)

Spawns

§

SpawnItemCurrentRoom(String)

§

SpawnItemInContainer

Fields

§item: String
§container: String
§

SpawnNpcIntoRoom

Fields

§room: String
§

SetItemDescription

Set description for an item by symbol.

Fields

§item: String
§text: String
§

NpcSays

Fields

§quote: String
§

NpcSaysRandom

Fields

§

NpcRefuseItem

NPC refuses an item with a reason

Fields

§reason: String
§

SetNpcActive

Set NPC active/inactive for movement

Fields

§active: bool
§

SetNpcState

Fields

§state: String
§

DenyRead(String)

§

RestrictItem(String)

§

SetContainerState

Set container state for an item by symbol; omit state to clear

Fields

§item: String
§

SpinnerMessage

Show a random message from a spinner

Fields

§spinner: String
§

ScheduleIn

Schedules without conditions

Fields

§turns_ahead: usize
§actions: Vec<ActionStmt>
§

ScheduleOn

Fields

§on_turn: usize
§actions: Vec<ActionStmt>
§

ScheduleInIf

Schedule actions at turns ahead if a condition holds.

Fields

§turns_ahead: usize
§condition: Box<ConditionAst>
§on_false: Option<OnFalseAst>
§actions: Vec<ActionStmt>
§

ScheduleOnIf

Schedule actions on an absolute turn if a condition holds.

Fields

§on_turn: usize
§condition: Box<ConditionAst>
§on_false: Option<OnFalseAst>
§actions: Vec<ActionStmt>
§

Conditional

Conditionally execute nested actions when the condition evaluates true at runtime.

Fields

§condition: Box<ConditionAst>
§actions: Vec<ActionStmt>

Trait Implementations§

Source§

impl Clone for ActionAst

Source§

fn clone(&self) -> ActionAst

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 ActionAst

Source§

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

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

impl PartialEq for ActionAst

Source§

fn eq(&self, other: &ActionAst) -> 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 ActionAst

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.