Initial commit, implements most of the static_data side.

This commit is contained in:
2021-01-30 22:29:59 +01:00
commit 2a08fb2645
33 changed files with 1237 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
use self::super::secondary_effect::SecondaryEffect;
use std::collections::HashSet;
#[derive(PartialEq, Debug)]
pub enum MoveCategory {
Physical,
Special,
Status,
}
#[derive(PartialEq, Debug)]
#[allow(dead_code)]
pub enum MoveTarget {
Adjacent,
AdjacentAlly,
AdjacentAllySelf,
AdjacentOpponent,
All,
AllAdjacent,
AllAdjacentOpponent,
AllAlly,
AllOpponent,
Any,
RandomOpponent,
SelfUse,
}
#[derive(PartialEq, Debug)]
pub struct MoveData {
name: String,
move_type: u8,
category: MoveCategory,
base_power: u8,
accuracy: u8,
base_usages: u8,
target: MoveTarget,
priority: i8,
secondary_effect: SecondaryEffect,
flags: HashSet<String>,
}
impl MoveData {
pub fn new(
name: String,
move_type: u8,
category: MoveCategory,
base_power: u8,
accuracy: u8,
base_usages: u8,
target: MoveTarget,
priority: i8,
secondary_effect: SecondaryEffect,
flags: HashSet<String>,
) -> MoveData {
MoveData {
name,
move_type,
category,
base_power,
accuracy,
base_usages,
target,
priority,
secondary_effect,
flags,
}
}
pub fn has_flag(&self, key: &str) -> bool {
self.flags.contains(key)
}
}