summaryrefslogtreecommitdiff
path: root/src/systems/attacking.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/systems/attacking.rs')
-rw-r--r--src/systems/attacking.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/systems/attacking.rs b/src/systems/attacking.rs
index 4b47f11..d28e301 100644
--- a/src/systems/attacking.rs
+++ b/src/systems/attacking.rs
@@ -9,7 +9,7 @@ use specs::{
};
use crate::{
- components::{Health, Attacked, Dying, Removed, Position},
+ components::{Health, AttackInbox, Dying, Removed, Position},
resources::NewEntities,
Template,
util
@@ -20,17 +20,17 @@ pub struct Attacking;
impl <'a> System<'a> for Attacking {
type SystemData = (
Entities<'a>,
- WriteStorage<'a, Attacked>,
+ WriteStorage<'a, AttackInbox>,
WriteStorage<'a, Health>,
WriteStorage<'a, Dying>,
WriteStorage<'a, Removed>,
ReadStorage<'a, Position>,
Write<'a, NewEntities>
);
- fn run(&mut self, (entities, mut victims, mut healths, mut deads, mut removals, positions, mut new): Self::SystemData) {
- for (ent, health, attacked) in (&entities, &mut healths, &mut victims).join() {
+ fn run(&mut self, (entities, mut attackeds, mut healths, mut deads, mut removals, positions, mut new): Self::SystemData) {
+ for (ent, health, attacked) in (&entities, &mut healths, &mut attackeds).join() {
let mut wounded = false;
- for attack in attacked.attacks.drain(..) {
+ for attack in attacked.messages.drain(..) {
health.health -= attack.damage;
if attack.damage > 0 {
wounded = true;
@@ -47,7 +47,7 @@ impl <'a> System<'a> for Attacking {
}
}
}
- victims.clear();
+ attackeds.clear();
}
}