diff options
| author | troido <troido@protonmail.com> | 2020-03-03 18:06:02 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-03-03 18:06:02 +0100 |
| commit | 986c82723cf9a4adada02287309999f4ebbf94e3 (patch) | |
| tree | acc26dfd3cb604c959d16f4291db2f6f21d242f9 /src/systems/useitem.rs | |
| parent | 9954b5cbaab27aaffcafa8723dcd5d1c99fa811f (diff) | |
randomise attack damage
Diffstat (limited to 'src/systems/useitem.rs')
| -rw-r--r-- | src/systems/useitem.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/systems/useitem.rs b/src/systems/useitem.rs index 1a50865..ab147b7 100644 --- a/src/systems/useitem.rs +++ b/src/systems/useitem.rs @@ -15,7 +15,8 @@ use crate::{ Position, Inventory, AttackInbox, - AttackMessage + AttackMessage, + AttackType }, resources::{NewEntities}, components::item::ItemAction::{None, Build, Eat}, @@ -45,7 +46,7 @@ impl <'a> System<'a> for Use { inventory.items.remove(*rank); } Eat(health_diff) => { - AttackInbox::add_message(&mut attacked, ent, AttackMessage::new(-*health_diff)); + AttackInbox::add_message(&mut attacked, ent, AttackMessage{typ: AttackType::Heal(*health_diff), attacker: Option::None}); inventory.items.remove(*rank); } None => {} |
