Some more functionality for battling, check if choice is valid, implement target resolvers.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-06-14 19:11:24 +02:00
parent 8746f03500
commit a33369afcc
8 changed files with 305 additions and 10 deletions

View File

@@ -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)
}