Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Add a coffee item, that increase Attack speed #14

Merged
merged 1 commit into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/ids.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
27 changes: 27 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we decide to keep the item but have a cooldown, this is where we should set it. :)

false,
vec![],
vec![(Items::Coffee, 1,UseMode::Consume)],
vec![
Effectors::DoubleAttackSpeed,
],
),
]);
world.insert(skill_definitions);

Expand All @@ -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);

Expand All @@ -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);

Expand Down