pub enum ItemUseResult<I: Copy + Eq + Hash + Debug> {
Applied {
consume: bool,
message_key: Option<String>,
},
NoEffect,
Caught,
Failed,
EvolutionTriggered {
item: I,
message_key: Option<String>,
},
MoveLearned {
consume: bool,
message_key: Option<String>,
},
}Expand description
Neutral result of an item-use attempt, returned by
ItemProvider::apply_effect and
propagated by use_item.
The driver consumes one unit of the item only on ItemUseResult::Applied
with consume: true, or on ItemUseResult::Caught.
Variants§
Applied
The effect was applied. consume tells the driver whether to remove one
unit from the bag (consumables vs. reusable tools). message_key is an
opaque, game-defined message identifier (the engine never reads it).
Fields
NoEffect
The item was applicable but produced no effect (e.g. Potion at full HP -> “It won’t have any effect”). Not consumed.
Caught
A capture device succeeded (battle context). Consumed.
Failed
The attempt failed (e.g. a ball that broke free, or the item could not be used here). Not consumed.
EvolutionTriggered
The item triggered an evolution sequence (e.g. Thunderstone, Rare Candy, or any evolution-inducing item). The driver should NOT consume the item until the evolution is confirmed/completed.
Fields
item: IThe item that triggered the evolution (may be consumed later upon evolution confirmation).
MoveLearned
The item taught a new move to the target (e.g. TM/HM). The driver
should consume the item if consume is true (TMs are consumed in
Gen 1-4; HMs are never consumed).
Implementations§
Trait Implementations§
Source§impl<I: Clone + Copy + Eq + Hash + Debug> Clone for ItemUseResult<I>
impl<I: Clone + Copy + Eq + Hash + Debug> Clone for ItemUseResult<I>
Source§fn clone(&self) -> ItemUseResult<I>
fn clone(&self) -> ItemUseResult<I>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more