Some more functionality for battling, check if choice is valid, implement target resolvers.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -2,16 +2,16 @@ use crate::static_data::SecondaryEffect;
|
||||
use crate::StringKey;
|
||||
use std::collections::HashSet;
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum MoveCategory {
|
||||
Physical,
|
||||
Special,
|
||||
Status,
|
||||
Physical = 0,
|
||||
Special = 1,
|
||||
Status = 2,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum MoveTarget {
|
||||
Adjacent,
|
||||
Adjacent = 0,
|
||||
AdjacentAlly,
|
||||
AdjacentAllySelf,
|
||||
AdjacentOpponent,
|
||||
@@ -69,6 +69,36 @@ impl MoveData {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn name(&self) -> &StringKey {
|
||||
&self.name
|
||||
}
|
||||
pub fn move_type(&self) -> u8 {
|
||||
self.move_type
|
||||
}
|
||||
pub fn category(&self) -> MoveCategory {
|
||||
self.category
|
||||
}
|
||||
pub fn base_power(&self) -> u8 {
|
||||
self.base_power
|
||||
}
|
||||
pub fn accuracy(&self) -> u8 {
|
||||
self.accuracy
|
||||
}
|
||||
pub fn base_usages(&self) -> u8 {
|
||||
self.base_usages
|
||||
}
|
||||
pub fn target(&self) -> MoveTarget {
|
||||
self.target
|
||||
}
|
||||
|
||||
pub fn priority(&self) -> i8 {
|
||||
self.priority
|
||||
}
|
||||
|
||||
pub fn secondary_effect(&self) -> &SecondaryEffect {
|
||||
&self.secondary_effect
|
||||
}
|
||||
|
||||
pub fn has_flag(&self, key: &str) -> bool {
|
||||
self.flags.contains(key)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user