diff options
author | Daniel Schadt <kingdread@gmx.de> | 2018-05-01 00:14:36 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2018-05-01 00:14:36 +0200 |
commit | 6922b2bb7dbe0e421d702c40d812a46259a5c51c (patch) | |
tree | f50a7eb01fb68426141eead1e56bff47d8419f09 /src/statistics/gamedata.rs | |
parent | 1fe2fde9604db53e57996648d6d8627480391bab (diff) | |
download | evtclib-6922b2bb7dbe0e421d702c40d812a46259a5c51c.tar.gz evtclib-6922b2bb7dbe0e421d702c40d812a46259a5c51c.tar.bz2 evtclib-6922b2bb7dbe0e421d702c40d812a46259a5c51c.zip |
add boon data for some boons (exemplary)
Diffstat (limited to 'src/statistics/gamedata.rs')
-rw-r--r-- | src/statistics/gamedata.rs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/statistics/gamedata.rs b/src/statistics/gamedata.rs new file mode 100644 index 0000000..d7f0e0e --- /dev/null +++ b/src/statistics/gamedata.rs @@ -0,0 +1,38 @@ +//! This module contains some game data that is necessary to correctly calculate +//! some statistics. +use super::boon::{BoonQueue, BoonType}; + +/// Contains a boon. +/// +/// Fields: +/// * boon id +/// * name (english) (just for easier debugging) +/// * maximum number of stacks +/// * boon type (intensity or duration) +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Boon(pub u16, pub &'static str, pub u32, pub BoonType); + +impl Boon { + pub fn create_queue(&self) -> BoonQueue { + BoonQueue::new(self.2, self.3) + } +} + +/// A list of all boons (and conditions) +pub static BOONS: &[Boon] = &[ + // Standard boons. + // Queue size for duration based boons are wonky, more or less guess work. + Boon(717, "Protection", 5, BoonType::Duration), + Boon(718, "Regeneration", 5, BoonType::Duration), + Boon(719, "Swiftness", 5, BoonType::Duration), + Boon(725, "Fury", 5, BoonType::Duration), + Boon(726, "Vigor", 5, BoonType::Duration), + Boon(740, "Might", 25, BoonType::Intensity), + Boon(743, "Aegis", 5, BoonType::Duration), + Boon(1187, "Quickness", 5, BoonType::Duration), + Boon(30328, "Alacrity", 9, BoonType::Duration), +]; + +pub fn get_boon(boon_id: u16) -> Option<&'static Boon> { + BOONS.iter().find(|b| b.0 == boon_id) +} |