735 lines
29 KiB
Rust
735 lines
29 KiB
Rust
use construct::{Stat, Colours};
|
|
use util::{IntPct};
|
|
|
|
#[derive(Debug,Clone,Serialize,Deserialize)]
|
|
pub struct SpecBonus {
|
|
pub req: Colours,
|
|
pub bonus: usize,
|
|
}
|
|
|
|
impl SpecBonus {
|
|
pub fn get_bonus(&self, c: &Colours) -> usize {
|
|
if c.red >= self.req.red && c.blue >= self.req.blue && c.green >= self.req.green {
|
|
return self.bonus;
|
|
}
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
#[derive(Debug,Clone,Serialize,Deserialize)]
|
|
pub struct SpecValues {
|
|
pub base: usize,
|
|
pub bonuses: Vec<SpecBonus>,
|
|
}
|
|
|
|
impl SpecValues {
|
|
pub fn max_value (&self, c: &Colours) -> usize {
|
|
self.bonuses.iter().fold(self.base, |acc, s| acc + s.get_bonus(c))
|
|
}
|
|
|
|
pub fn base (self) -> usize {
|
|
self.base
|
|
}
|
|
}
|
|
|
|
|
|
#[derive(Debug,Copy,Clone,Serialize,Deserialize,PartialEq,PartialOrd,Ord,Eq)]
|
|
pub enum Spec {
|
|
Speed,
|
|
SpeedRR,
|
|
SpeedBB,
|
|
SpeedGG,
|
|
SpeedRG,
|
|
SpeedGB,
|
|
SpeedRB,
|
|
|
|
SpeedRRPlus,
|
|
SpeedBBPlus,
|
|
SpeedGGPlus,
|
|
SpeedRGPlus,
|
|
SpeedGBPlus,
|
|
SpeedRBPlus,
|
|
|
|
SpeedRRPlusPlus,
|
|
SpeedBBPlusPlus,
|
|
SpeedGGPlusPlus,
|
|
SpeedRGPlusPlus,
|
|
SpeedGBPlusPlus,
|
|
SpeedRBPlusPlus,
|
|
|
|
Life,
|
|
LifeGG,
|
|
LifeRR,
|
|
LifeBB,
|
|
LifeRG,
|
|
LifeGB,
|
|
LifeRB,
|
|
LifeGGPlus,
|
|
LifeRRPlus,
|
|
LifeBBPlus,
|
|
LifeRGPlus,
|
|
LifeGBPlus,
|
|
LifeRBPlus,
|
|
LifeGGPlusPlus,
|
|
LifeRRPlusPlus,
|
|
LifeBBPlusPlus,
|
|
LifeRGPlusPlus,
|
|
LifeGBPlusPlus,
|
|
LifeRBPlusPlus,
|
|
|
|
Power,
|
|
PowerRR,
|
|
PowerGG,
|
|
PowerBB,
|
|
PowerRG,
|
|
PowerGB,
|
|
PowerRB,
|
|
PowerRRPlus,
|
|
PowerGGPlus,
|
|
PowerBBPlus,
|
|
PowerRGPlus,
|
|
PowerGBPlus,
|
|
PowerRBPlus,
|
|
PowerRRPlusPlus,
|
|
PowerGGPlusPlus,
|
|
PowerBBPlusPlus,
|
|
PowerRGPlusPlus,
|
|
PowerGBPlusPlus,
|
|
PowerRBPlusPlus,
|
|
|
|
}
|
|
|
|
impl Spec {
|
|
pub fn affects(&self) -> Vec<Stat> {
|
|
match *self {
|
|
Spec::Power => vec![Stat::BluePower, Stat::RedPower, Stat::GreenPower],
|
|
Spec::PowerRR => vec![Stat::RedPower],
|
|
Spec::PowerGG => vec![Stat::GreenPower],
|
|
Spec::PowerBB => vec![Stat::BluePower],
|
|
Spec::PowerRG => vec![Stat::GreenPower, Stat::RedPower],
|
|
Spec::PowerGB => vec![Stat::GreenPower, Stat::BluePower],
|
|
Spec::PowerRB => vec![Stat::RedPower, Stat::BluePower],
|
|
Spec::PowerRRPlus => vec![Stat::RedPower],
|
|
Spec::PowerGGPlus => vec![Stat::GreenPower],
|
|
Spec::PowerBBPlus => vec![Stat::BluePower],
|
|
Spec::PowerRGPlus => vec![Stat::GreenPower, Stat::RedPower],
|
|
Spec::PowerGBPlus => vec![Stat::GreenPower, Stat::BluePower],
|
|
Spec::PowerRBPlus => vec![Stat::RedPower, Stat::BluePower],
|
|
Spec::PowerRRPlusPlus => vec![Stat::RedPower],
|
|
Spec::PowerGGPlusPlus => vec![Stat::GreenPower],
|
|
Spec::PowerBBPlusPlus => vec![Stat::BluePower],
|
|
Spec::PowerRGPlusPlus => vec![Stat::GreenPower, Stat::RedPower],
|
|
Spec::PowerGBPlusPlus => vec![Stat::GreenPower, Stat::BluePower],
|
|
Spec::PowerRBPlusPlus => vec![Stat::RedPower, Stat::BluePower],
|
|
|
|
Spec::Speed => vec![Stat::Speed],
|
|
Spec::SpeedRR => vec![Stat::Speed],
|
|
Spec::SpeedBB => vec![Stat::Speed],
|
|
Spec::SpeedGG => vec![Stat::Speed],
|
|
Spec::SpeedRG => vec![Stat::Speed],
|
|
Spec::SpeedGB => vec![Stat::Speed],
|
|
Spec::SpeedRB => vec![Stat::Speed],
|
|
Spec::SpeedRRPlus => vec![Stat::Speed],
|
|
Spec::SpeedBBPlus => vec![Stat::Speed],
|
|
Spec::SpeedGGPlus => vec![Stat::Speed],
|
|
Spec::SpeedRGPlus => vec![Stat::Speed],
|
|
Spec::SpeedGBPlus => vec![Stat::Speed],
|
|
Spec::SpeedRBPlus => vec![Stat::Speed],
|
|
Spec::SpeedRRPlusPlus => vec![Stat::Speed],
|
|
Spec::SpeedBBPlusPlus => vec![Stat::Speed],
|
|
Spec::SpeedGGPlusPlus => vec![Stat::Speed],
|
|
Spec::SpeedRGPlusPlus => vec![Stat::Speed],
|
|
Spec::SpeedGBPlusPlus => vec![Stat::Speed],
|
|
Spec::SpeedRBPlusPlus => vec![Stat::Speed],
|
|
|
|
Spec::Life => vec![Stat::GreenLife],
|
|
Spec::LifeRR => vec![Stat::RedLife],
|
|
Spec::LifeBB => vec![Stat::BlueLife],
|
|
Spec::LifeGG => vec![Stat::GreenLife],
|
|
Spec::LifeRG => vec![Stat::GreenLife, Stat::RedLife],
|
|
Spec::LifeGB => vec![Stat::GreenLife, Stat::BlueLife],
|
|
Spec::LifeRB => vec![Stat::BlueLife, Stat::RedLife],
|
|
Spec::LifeRRPlus => vec![Stat::RedLife],
|
|
Spec::LifeBBPlus => vec![Stat::BlueLife],
|
|
Spec::LifeGGPlus => vec![Stat::GreenLife],
|
|
Spec::LifeRGPlus => vec![Stat::GreenLife, Stat::RedLife],
|
|
Spec::LifeGBPlus => vec![Stat::GreenLife, Stat::BlueLife],
|
|
Spec::LifeRBPlus => vec![Stat::BlueLife, Stat::RedLife],
|
|
Spec::LifeRRPlusPlus => vec![Stat::RedLife],
|
|
Spec::LifeBBPlusPlus => vec![Stat::BlueLife],
|
|
Spec::LifeGGPlusPlus => vec![Stat::GreenLife],
|
|
Spec::LifeRGPlusPlus => vec![Stat::GreenLife, Stat::RedLife],
|
|
Spec::LifeGBPlusPlus => vec![Stat::GreenLife, Stat::BlueLife],
|
|
Spec::LifeRBPlusPlus => vec![Stat::BlueLife, Stat::RedLife],
|
|
}
|
|
}
|
|
|
|
pub fn values(&self) -> SpecValues {
|
|
match *self {
|
|
Spec::Power => SpecValues {
|
|
base: 10,
|
|
bonuses: vec![]
|
|
},
|
|
|
|
Spec::PowerRR=> SpecValues {
|
|
base: 10,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 0 }, bonus: 5 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 0 }, bonus: 9 },
|
|
SpecBonus { req: Colours { red: 20, green: 0, blue: 0 }, bonus: 13 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerGG=> SpecValues {
|
|
base: 10,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 0 }, bonus: 5 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 0 }, bonus: 9 },
|
|
SpecBonus { req: Colours { red: 0, green: 20, blue: 0 }, bonus: 13 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerBB=> SpecValues {
|
|
base: 10,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 5 }, bonus: 5 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 10 }, bonus: 9 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 20 }, bonus: 13 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerRG=> SpecValues {
|
|
base: 10,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 2, blue: 0 }, bonus: 3 },
|
|
SpecBonus { req: Colours { red: 5, green: 5, blue: 0 }, bonus: 6 },
|
|
SpecBonus { req: Colours { red: 10, green: 10, blue: 0 }, bonus: 9 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerGB=> SpecValues {
|
|
base: 10,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 2, blue: 2 }, bonus: 3 },
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 5 }, bonus: 6 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 10 }, bonus: 9 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerRB=> SpecValues {
|
|
base: 10,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 0, blue: 2 }, bonus: 3 },
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 5 }, bonus: 6 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 10 }, bonus: 9 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerRRPlus => SpecValues {
|
|
base: 15,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 0 }, bonus: 6 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 0 }, bonus: 12 },
|
|
SpecBonus { req: Colours { red: 20, green: 0, blue: 0 }, bonus: 18 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerGGPlus => SpecValues {
|
|
base: 15,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 0 }, bonus: 6 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 0 }, bonus: 12 },
|
|
SpecBonus { req: Colours { red: 0, green: 20, blue: 0 }, bonus: 18 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerBBPlus => SpecValues {
|
|
base: 15,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 5 }, bonus: 6 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 10 }, bonus: 12 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 20 }, bonus: 18 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerRGPlus => SpecValues {
|
|
base: 15,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 2, blue: 0 }, bonus: 4 },
|
|
SpecBonus { req: Colours { red: 5, green: 5, blue: 0 }, bonus: 8 },
|
|
SpecBonus { req: Colours { red: 10, green: 10, blue: 0 }, bonus: 12 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerGBPlus => SpecValues {
|
|
base: 15,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 2, blue: 2 }, bonus: 4 },
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 5 }, bonus: 8 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 10 }, bonus: 12 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerRBPlus => SpecValues {
|
|
base: 15,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 0, blue: 2 }, bonus: 4 },
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 5 }, bonus: 8 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 10 }, bonus: 12 }
|
|
],
|
|
},
|
|
Spec::PowerRRPlusPlus => SpecValues {
|
|
base: 25,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 0 }, bonus: 8 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 0 }, bonus: 16 },
|
|
SpecBonus { req: Colours { red: 20, green: 0, blue: 0 }, bonus: 24 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerGGPlusPlus => SpecValues {
|
|
base: 25,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 0 }, bonus: 8 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 0 }, bonus: 16 },
|
|
SpecBonus { req: Colours { red: 0, green: 20, blue: 0 }, bonus: 24 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerBBPlusPlus => SpecValues {
|
|
base: 25,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 5 }, bonus: 8 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 10 }, bonus: 16 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 20 }, bonus: 24 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerRGPlusPlus => SpecValues {
|
|
base: 25,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 2, blue: 0 }, bonus: 5 },
|
|
SpecBonus { req: Colours { red: 5, green: 5, blue: 0 }, bonus: 10 },
|
|
SpecBonus { req: Colours { red: 10, green: 10, blue: 0 }, bonus: 15 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerGBPlusPlus => SpecValues {
|
|
base: 25,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 2, blue: 2 }, bonus: 5 },
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 5 }, bonus: 10 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 10 }, bonus: 15 }
|
|
],
|
|
},
|
|
|
|
Spec::PowerRBPlusPlus => SpecValues {
|
|
base: 25,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 0, blue: 2 }, bonus: 5 },
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 5 }, bonus: 10 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 10 }, bonus: 15 }
|
|
],
|
|
},
|
|
|
|
Spec::Speed => SpecValues {
|
|
base: 40,
|
|
bonuses: vec![]
|
|
},
|
|
|
|
Spec::SpeedRR=> SpecValues {
|
|
base: 80,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 0 }, bonus: 80 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 0 }, bonus: 80 },
|
|
SpecBonus { req: Colours { red: 20, green: 0, blue: 0 }, bonus: 80 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedGG=> SpecValues {
|
|
base: 80,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 0 }, bonus: 80 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 0 }, bonus: 80 },
|
|
SpecBonus { req: Colours { red: 0, green: 20, blue: 0 }, bonus: 80 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedBB=> SpecValues {
|
|
base: 80,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 5 }, bonus: 80 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 10 }, bonus: 80 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 20 }, bonus: 80 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedRG=> SpecValues {
|
|
base: 60,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 2, blue: 0 }, bonus: 60 },
|
|
SpecBonus { req: Colours { red: 5, green: 5, blue: 0 }, bonus: 60 },
|
|
SpecBonus { req: Colours { red: 10, green: 10, blue: 0 }, bonus: 60 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedGB=> SpecValues {
|
|
base: 60,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 2, blue: 2 }, bonus: 60 },
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 5 }, bonus: 60 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 10 }, bonus: 60 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedRB=> SpecValues {
|
|
base: 60,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 0, blue: 2 }, bonus: 60 },
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 5 }, bonus: 60 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 10 }, bonus: 60 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedRRPlus => SpecValues {
|
|
base: 120,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 0 }, bonus: 120 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 0 }, bonus: 120 },
|
|
SpecBonus { req: Colours { red: 20, green: 0, blue: 0 }, bonus: 120 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedGGPlus => SpecValues {
|
|
base: 120,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 0 }, bonus: 120 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 0 }, bonus: 120 },
|
|
SpecBonus { req: Colours { red: 0, green: 20, blue: 0 }, bonus: 120 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedBBPlus => SpecValues {
|
|
base: 120,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 5 }, bonus: 120 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 10 }, bonus: 120 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 20 }, bonus: 120 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedRGPlus => SpecValues {
|
|
base: 80,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 2, blue: 0 }, bonus: 80 },
|
|
SpecBonus { req: Colours { red: 5, green: 5, blue: 0 }, bonus: 80 },
|
|
SpecBonus { req: Colours { red: 10, green: 10, blue: 0 }, bonus: 80 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedGBPlus => SpecValues {
|
|
base: 80,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 2, blue: 2 }, bonus: 80 },
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 5 }, bonus: 80 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 10 }, bonus: 80 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedRBPlus => SpecValues {
|
|
base: 80,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 0, blue: 2 }, bonus: 80 },
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 5 }, bonus: 80 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 10 }, bonus: 80 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedRRPlusPlus => SpecValues {
|
|
base: 160,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 0 }, bonus: 160 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 0 }, bonus: 160 },
|
|
SpecBonus { req: Colours { red: 20, green: 0, blue: 0 }, bonus: 160 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedGGPlusPlus => SpecValues {
|
|
base: 160,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 0 }, bonus: 160 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 0 }, bonus: 160 },
|
|
SpecBonus { req: Colours { red: 0, green: 20, blue: 0 }, bonus: 160 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedBBPlusPlus => SpecValues {
|
|
base: 160,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 5 }, bonus: 160 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 10 }, bonus: 160 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 20 }, bonus: 160 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedRGPlusPlus => SpecValues {
|
|
base: 120,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 2, blue: 0 }, bonus: 120 },
|
|
SpecBonus { req: Colours { red: 5, green: 5, blue: 0 }, bonus: 120 },
|
|
SpecBonus { req: Colours { red: 10, green: 10, blue: 0 }, bonus: 120 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedGBPlusPlus => SpecValues {
|
|
base: 120,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 2, blue: 2 }, bonus: 120 },
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 5 }, bonus: 120 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 10 }, bonus: 120 }
|
|
],
|
|
},
|
|
|
|
Spec::SpeedRBPlusPlus => SpecValues {
|
|
base: 120,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 0, blue: 2 }, bonus: 120 },
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 5 }, bonus: 120 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 10 }, bonus: 120 }
|
|
],
|
|
},
|
|
|
|
Spec::Life => SpecValues {
|
|
base: 125,
|
|
bonuses: vec![]},
|
|
|
|
Spec::LifeRR=> SpecValues {
|
|
base: 275,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 0 }, bonus: 75 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 0 }, bonus: 125 },
|
|
SpecBonus { req: Colours { red: 20, green: 0, blue: 0 }, bonus: 175 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeGG=> SpecValues {
|
|
base: 225,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 0 }, bonus: 50 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 0 }, bonus: 75 },
|
|
SpecBonus { req: Colours { red: 0, green: 20, blue: 0 }, bonus: 125 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeBB=> SpecValues {
|
|
base: 275,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 5 }, bonus: 75 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 10 }, bonus: 125 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 20 }, bonus: 175 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeRG=> SpecValues {
|
|
base: 125,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 2, blue: 0 }, bonus: 50 },
|
|
SpecBonus { req: Colours { red: 5, green: 5, blue: 0 }, bonus: 75 },
|
|
SpecBonus { req: Colours { red: 10, green: 10, blue: 0 }, bonus: 125 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeGB=> SpecValues {
|
|
base: 125,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 2, blue: 2 }, bonus: 50 },
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 5 }, bonus: 75 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 10 }, bonus: 125 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeRB=> SpecValues {
|
|
base: 175,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 0, blue: 2 }, bonus: 50 },
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 5 }, bonus: 75 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 10 }, bonus: 125 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeRRPlus => SpecValues {
|
|
base: 500,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 0 }, bonus: 125 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 0 }, bonus: 225 },
|
|
SpecBonus { req: Colours { red: 20, green: 0, blue: 0 }, bonus: 300 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeGGPlus => SpecValues {
|
|
base: 400,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 0 }, bonus: 90 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 0 }, bonus: 130 },
|
|
SpecBonus { req: Colours { red: 0, green: 20, blue: 0 }, bonus: 225 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeBBPlus => SpecValues {
|
|
base: 500,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 5 }, bonus: 125 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 10 }, bonus: 225 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 20 }, bonus: 300 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeRGPlus => SpecValues {
|
|
base: 225,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 2, blue: 0 }, bonus: 100 },
|
|
SpecBonus { req: Colours { red: 5, green: 5, blue: 0 }, bonus: 150 },
|
|
SpecBonus { req: Colours { red: 10, green: 10, blue: 0 }, bonus: 225 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeGBPlus => SpecValues {
|
|
base: 225,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 2, blue: 2 }, bonus: 100 },
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 5 }, bonus: 150 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 10 }, bonus: 225 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeRBPlus => SpecValues {
|
|
base: 350,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 0, blue: 2 }, bonus: 100 },
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 5 }, bonus: 150 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 10 }, bonus: 225 }
|
|
],
|
|
},
|
|
Spec::LifeRRPlusPlus => SpecValues {
|
|
base: 875,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 0 }, bonus: 225 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 0 }, bonus: 400 },
|
|
SpecBonus { req: Colours { red: 20, green: 0, blue: 0 }, bonus: 525 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeGGPlusPlus => SpecValues {
|
|
base: 475,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 0 }, bonus: 130 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 0 }, bonus: 225 },
|
|
SpecBonus { req: Colours { red: 0, green: 20, blue: 0 }, bonus: 300 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeBBPlusPlus => SpecValues {
|
|
base: 875,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 5 }, bonus: 225 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 10 }, bonus: 400 },
|
|
SpecBonus { req: Colours { red: 0, green: 0, blue: 20 }, bonus: 525 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeRGPlusPlus => SpecValues {
|
|
base: 400,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 2, blue: 0 }, bonus: 175 },
|
|
SpecBonus { req: Colours { red: 5, green: 5, blue: 0 }, bonus: 275 },
|
|
SpecBonus { req: Colours { red: 10, green: 10, blue: 0 }, bonus: 400 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeGBPlusPlus => SpecValues {
|
|
base: 625,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 0, green: 2, blue: 2 }, bonus: 175 },
|
|
SpecBonus { req: Colours { red: 0, green: 5, blue: 5 }, bonus: 275 },
|
|
SpecBonus { req: Colours { red: 0, green: 10, blue: 10 }, bonus: 400 }
|
|
],
|
|
},
|
|
|
|
Spec::LifeRBPlusPlus => SpecValues {
|
|
base: 400,
|
|
bonuses: vec![
|
|
SpecBonus { req: Colours { red: 2, green: 0, blue: 2 }, bonus: 175 },
|
|
SpecBonus { req: Colours { red: 5, green: 0, blue: 5 }, bonus: 275 },
|
|
SpecBonus { req: Colours { red: 10, green: 0, blue: 10 }, bonus: 400 }
|
|
],
|
|
},
|
|
}
|
|
}
|
|
|
|
pub fn apply(&self, modified: usize, base: usize, player_colours: &Colours) -> usize {
|
|
match *self {
|
|
// Percentage multipliers based on base value
|
|
Spec::Power |
|
|
Spec::Speed => modified + base.pct(self.values().base),
|
|
Spec::PowerRR|
|
|
Spec::PowerGG|
|
|
Spec::PowerBB|
|
|
Spec::PowerRG|
|
|
Spec::PowerGB|
|
|
Spec::PowerRB|
|
|
Spec::PowerRRPlus |
|
|
Spec::PowerGGPlus |
|
|
Spec::PowerBBPlus |
|
|
Spec::PowerRGPlus |
|
|
Spec::PowerGBPlus |
|
|
Spec::PowerRBPlus |
|
|
Spec::PowerRRPlusPlus |
|
|
Spec::PowerGGPlusPlus |
|
|
Spec::PowerBBPlusPlus |
|
|
Spec::PowerRGPlusPlus |
|
|
Spec::PowerGBPlusPlus |
|
|
Spec::PowerRBPlusPlus |
|
|
|
|
Spec::SpeedRR|
|
|
Spec::SpeedGG|
|
|
Spec::SpeedBB|
|
|
Spec::SpeedRG|
|
|
Spec::SpeedGB|
|
|
Spec::SpeedRB|
|
|
Spec::SpeedRRPlus |
|
|
Spec::SpeedGGPlus |
|
|
Spec::SpeedBBPlus |
|
|
Spec::SpeedRGPlus |
|
|
Spec::SpeedGBPlus |
|
|
Spec::SpeedRBPlus |
|
|
Spec::SpeedRRPlusPlus |
|
|
Spec::SpeedGGPlusPlus |
|
|
Spec::SpeedBBPlusPlus |
|
|
Spec::SpeedRGPlusPlus |
|
|
Spec::SpeedGBPlusPlus |
|
|
Spec::SpeedRBPlusPlus => modified + base.pct(self.values().max_value(player_colours)),
|
|
|
|
// Flat bonus
|
|
Spec::Life => modified + self.values().base,
|
|
Spec::LifeRR|
|
|
Spec::LifeGG|
|
|
Spec::LifeBB|
|
|
Spec::LifeRG|
|
|
Spec::LifeGB|
|
|
Spec::LifeRB|
|
|
Spec::LifeRRPlus |
|
|
Spec::LifeGGPlus |
|
|
Spec::LifeBBPlus |
|
|
Spec::LifeRGPlus |
|
|
Spec::LifeGBPlus |
|
|
Spec::LifeRBPlus |
|
|
Spec::LifeRRPlusPlus |
|
|
Spec::LifeGGPlusPlus |
|
|
Spec::LifeBBPlusPlus |
|
|
Spec::LifeRGPlusPlus |
|
|
Spec::LifeGBPlusPlus |
|
|
Spec::LifeRBPlusPlus => modified + self.values().max_value(player_colours),
|
|
}
|
|
}
|
|
}
|