pub enum MoveTarget {
Show 16 variants
AdjacentAlly,
AdjacentAllyOrUser,
AdjacentFoe,
All,
AllAdjacent,
AllAdjacentFoes,
Allies,
AllySide,
AllyTeam,
Any,
Field,
FoeSide,
Normal,
RandomNormal,
Scripted,
User,
}Expand description
The acceptable target(s) of a move.
In this enum, the following terms are used:
- “Adjacent” = A reachable Mon.
- “Ally” - A Mon on the same side.
- “Foe” - A Mon on the opposite side.
- “Side” - The side of a battle, not any particular Mon on that side.
- “Team” - All unfainted Mons on a team.
- “User” - The user of a move.
Variants§
AdjacentAlly
An adjacent ally.
AdjacentAllyOrUser
The user or its ally.
AdjacentFoe
An adjacent foe.
All
All Mons at once.
AllAdjacent
All adjacent mons (including allies).
AllAdjacentFoes
All adjacent foes.
Also known as a spread move.
Allies
All active Mons on the user’s team.
AllySide
The user’s side.
AllyTeam
All unfainted Mons on the user’s team.
Any
Any other active Mon.
Field
The field.
FoeSide
The foe’s side.
Normal
One adjacent Mon of the user’s choice.
Could also be called “Adjacent.”
RandomNormal
Any adjacent foe chosen at random.
Scripted
The for that damaged the user.
User
The user of the move.
Implementations§
Source§impl MoveTarget
impl MoveTarget
Sourcepub fn requires_target(&self) -> bool
pub fn requires_target(&self) -> bool
Does the move require a single target?
Sourcepub fn has_single_target(&self) -> bool
pub fn has_single_target(&self) -> bool
Does the move have a single target?
Sourcepub fn affects_mons_directly(&self) -> bool
pub fn affects_mons_directly(&self) -> bool
Does the move affect Mons directly?
Sourcepub fn can_target_user(&self) -> bool
pub fn can_target_user(&self) -> bool
Can the move target the user?
Sourcepub fn can_target_foes(&self) -> bool
pub fn can_target_foes(&self) -> bool
Can the move target foes?
Sourcepub fn is_adjacent_only(&self) -> bool
pub fn is_adjacent_only(&self) -> bool
Can the move only target adjacent Mons?
Sourcepub fn valid_target(&self, relative_target: isize, adjacency_reach: u8) -> bool
pub fn valid_target(&self, relative_target: isize, adjacency_reach: u8) -> bool
Validates the relative target position.
Sourcepub fn is_affected(&self, relative_target: isize, adjacency_reach: u8) -> bool
pub fn is_affected(&self, relative_target: isize, adjacency_reach: u8) -> bool
Checks if the Mon at the relative target is affected by the move.
Trait Implementations§
Source§impl Clone for MoveTarget
impl Clone for MoveTarget
Source§fn clone(&self) -> MoveTarget
fn clone(&self) -> MoveTarget
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MoveTarget
impl Debug for MoveTarget
Source§impl Default for MoveTarget
impl Default for MoveTarget
Source§fn default() -> MoveTarget
fn default() -> MoveTarget
Source§impl<'de> Deserialize<'de> for MoveTarget
impl<'de> Deserialize<'de> for MoveTarget
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 Display for MoveTarget
impl Display for MoveTarget
Source§impl FromStr for MoveTarget
impl FromStr for MoveTarget
Source§impl Hash for MoveTarget
impl Hash for MoveTarget
Source§impl PartialEq for MoveTarget
impl PartialEq for MoveTarget
Source§impl Serialize for MoveTarget
impl Serialize for MoveTarget
impl Copy for MoveTarget
impl Eq for MoveTarget
impl StructuralPartialEq for MoveTarget
Auto Trait Implementations§
impl Freeze for MoveTarget
impl RefUnwindSafe for MoveTarget
impl Send for MoveTarget
impl Sync for MoveTarget
impl Unpin for MoveTarget
impl UnsafeUnpin for MoveTarget
impl UnwindSafe for MoveTarget
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,
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.