From 986c82723cf9a4adada02287309999f4ebbf94e3 Mon Sep 17 00:00:00 2001 From: troido Date: Tue, 3 Mar 2020 18:06:02 +0100 Subject: randomise attack damage --- src/systems/trapping.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/systems/trapping.rs') diff --git a/src/systems/trapping.rs b/src/systems/trapping.rs index 55b8bde..35c66d0 100644 --- a/src/systems/trapping.rs +++ b/src/systems/trapping.rs @@ -9,7 +9,7 @@ use specs::{ }; use crate::{ - components::{Health, AttackInbox, Moved, Entered, Trap, Position}, + components::{Health, AttackInbox, AttackMessage, Moved, Entered, Trap, Position}, resources::Ground }; @@ -31,7 +31,7 @@ impl <'a> System<'a> for Trapping { for (entity, _entered, trap, position) in (&entities, &entereds, &traps, &positions).join() { for ent in ground.cells.get(&position.pos).unwrap(){ if ent != &entity && moves.contains(*ent) && healths.contains(*ent) { - AttackInbox::add_message(&mut victims, *ent, trap.attack.clone()); + AttackInbox::add_message(&mut victims, *ent, AttackMessage{typ: trap.attack.clone(), attacker: Some(entity)}); } } } -- cgit