From 571be150c4457c04ac6539475df5928a4247fc5d Mon Sep 17 00:00:00 2001 From: grzi Date: Sun, 6 Dec 2020 22:30:24 +0100 Subject: [PATCH] Add a coffee item, that increase Attack speed --- src/ids.rs | 3 +++ src/main.rs | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/ids.rs b/src/ids.rs index aa788e8..81f33aa 100644 --- a/src/ids.rs +++ b/src/ids.rs @@ -18,14 +18,17 @@ pub enum Stats { pub enum Skills { AOE, DoubleDamage, + DoubleAttackSpeed } #[derive(PartialEq, Eq, Hash, Copy, Clone, Debug)] pub enum Items { TestItem, + Coffee } #[derive(PartialEq, Eq, Hash, Copy, Clone, Debug)] pub enum Effectors { DoubleDamage, + DoubleAttackSpeed } diff --git a/src/main.rs b/src/main.rs index d12dbc3..9407792 100644 --- a/src/main.rs +++ b/src/main.rs @@ -308,6 +308,19 @@ fn main() -> BError { Effectors::DoubleDamage, ], ), + SkillDefinition::new( + Skills::DoubleAttackSpeed, + String::from("Double Attack Speed"), + String::from("double_attack_speed"), + String::from("Double the attack speed."), + 0.0, + false, + vec![], + vec![(Items::Coffee, 1,UseMode::Consume)], + vec![ + Effectors::DoubleAttackSpeed, + ], + ), ]); world.insert(skill_definitions); @@ -317,6 +330,11 @@ fn main() -> BError { Some(0.0), vec![(Stats::Attack, EffectorType::MultiplicativeMultiplier(2.0))], ), + EffectorDefinition::new( + Effectors::DoubleAttackSpeed, + Some(5.0), + vec![(Stats::AttackSpeed, EffectorType::MultiplicativeMultiplier(2.0))], + ) ]); world.insert(effector_defs); @@ -330,6 +348,15 @@ fn main() -> BError { None, None, ), + ItemDefinition::new( + Items::Coffee, + (), + String::from("Coffee"), + String::from("coffee"), + String::from("A cup of coffee. Drinking this will double attack speed for 5 seconds."), + None, + None, + ), ]); world.insert(item_defs);