pub enum NpcState {
Bored,
Happy,
Mad,
Normal,
Sad,
Tired,
Custom(String),
}Expand description
Represents the demeanor of an ‘Npc’, which may affect default dialogue and behavior.
NPC states affect which dialogue lines are given in response to a TalkTo command. They
can also be used as trigger conditions, and state can be changed by triggers. Room
overlays can also change according to NPC presence / state. Custom states allow for
other “moods” and can be used to pin selections of dialogue to particular game states.
Ex: player does something -> puzzle advanced to puzzle#2 -> trigger sets custom NPC state
“player_at_puzzle_step_2” which has specific dialogue.
Variants§
Implementations§
Source§impl NpcState
impl NpcState
pub fn is_bored(&self) -> bool
pub fn is_not_bored(&self) -> bool
pub fn and_bored(self, and: Self) -> Self
pub fn or_bored(self, or: Self) -> Self
pub fn is_happy(&self) -> bool
pub fn is_not_happy(&self) -> bool
pub fn and_happy(self, and: Self) -> Self
pub fn or_happy(self, or: Self) -> Self
pub fn is_mad(&self) -> bool
pub fn is_not_mad(&self) -> bool
pub fn and_mad(self, and: Self) -> Self
pub fn or_mad(self, or: Self) -> Self
pub fn is_normal(&self) -> bool
pub fn is_not_normal(&self) -> bool
pub fn and_normal(self, and: Self) -> Self
pub fn or_normal(self, or: Self) -> Self
pub fn is_sad(&self) -> bool
pub fn is_not_sad(&self) -> bool
pub fn and_sad(self, and: Self) -> Self
pub fn or_sad(self, or: Self) -> Self
pub fn is_tired(&self) -> bool
pub fn is_not_tired(&self) -> bool
pub fn and_tired(self, and: Self) -> Self
pub fn or_tired(self, or: Self) -> Self
pub fn custom(self) -> Option<String>
pub fn custom_ref(&self) -> Option<&String>
pub fn custom_mut(&mut self) -> Option<&mut String>
pub fn custom_or<E>(self, or: E) -> Result<String, E>
pub fn custom_or_else<E, F: FnOnce() -> E>( self, or_else: F, ) -> Result<String, E>
pub fn custom_ref_or<E>(&self, or: E) -> Result<&String, E>
pub fn custom_mut_or<E>(&mut self, or: E) -> Result<&mut String, E>
pub fn custom_ref_or_else<E, F: FnOnce() -> E>( &self, or_else: F, ) -> Result<&String, E>
pub fn custom_mut_or_else<E, F: FnOnce() -> E>( &mut self, or_else: F, ) -> Result<&mut String, E>
pub fn and_then_custom<F: FnOnce(String) -> String>(self, and_then: F) -> Self
pub fn expect_custom(self, msg: &str) -> String
pub fn ok_custom(self) -> Option<String>
Please use the derived NpcState::custom method instead. This method will be removed in 1.0.0 or next pre-stable minor bump.
pub fn ok_or_custom<E>(self, or: E) -> Result<String, E>
Please use the derived NpcState::custom_or method instead. This method will be removed in 1.0.0 or next pre-stable minor bump.
pub fn ok_or_else_custom<E, F: FnOnce() -> E>( self, or_else: F, ) -> Result<String, E>
Please use the derived NpcState::custom_or_else method instead. This method will be removed in 1.0.0 or next pre-stable minor bump.
pub fn or_else_custom<F: FnOnce() -> String>(self, or_else: F) -> Self
pub fn unwrap_custom(self) -> String
pub fn unwrap_or_custom(self, or: String) -> String
pub fn unwrap_or_else_custom<F: FnOnce() -> String>(self, or_else: F) -> String
pub fn is_custom(&self) -> bool
pub fn is_not_custom(&self) -> bool
pub fn and_custom(self, and: Self) -> Self
pub fn or_custom(self, or: Self) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NpcState
impl<'de> Deserialize<'de> for NpcState
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>,
impl Eq for NpcState
impl StructuralPartialEq for NpcState
Auto Trait Implementations§
impl Forget for NpcState
impl Freeze for NpcState
impl Move for NpcState
impl RefUnwindSafe for NpcState
impl Send for NpcState
impl Sync for NpcState
impl Unpin for NpcState
impl UnsafeUnpin for NpcState
impl UnwindSafe for NpcState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.