diff options
| author | troido <troido@protonmail.com> | 2020-04-12 22:27:33 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-04-12 22:27:33 +0200 |
| commit | 883e56e07a48dc0d4916614abc33e40dde1d1d66 (patch) | |
| tree | e66ec69204b61a8df62f515c5f4857232aafe396 /src | |
| parent | ba09108692a694dd832f38ef6ea447135f418b73 (diff) | |
removed mortal component
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/mod.rs | 3 | ||||
| -rw-r--r-- | src/componentwrapper.rs | 1 | ||||
| -rw-r--r-- | src/room.rs | 2 | ||||
| -rw-r--r-- | src/systems/die.rs | 7 |
4 files changed, 4 insertions, 9 deletions
diff --git a/src/components/mod.rs b/src/components/mod.rs index cb28c4b..412dc2e 100644 --- a/src/components/mod.rs +++ b/src/components/mod.rs @@ -186,9 +186,6 @@ pub struct Home { pub home: Pos } -#[derive(Component, Debug, Clone, Default)] -pub struct Mortal; - #[derive(Component, Debug, Clone)] #[storage(HashMapStorage)] pub struct Spawner { diff --git a/src/componentwrapper.rs b/src/componentwrapper.rs index 4b9401a..2d3c102 100644 --- a/src/componentwrapper.rs +++ b/src/componentwrapper.rs @@ -164,7 +164,6 @@ components!( Volatile (delay: Int) {Volatile{delay, end_time: None}}; Autofight () {Autofight::default()}; MonsterAI (move_chance: Float, homesickness: Float, view_distance: Int); - Mortal; Spawner (amount: Int, delay: Int, clan: String, template: Template, initial_spawn: Bool) { Spawner{ amount: amount as usize, diff --git a/src/room.rs b/src/room.rs index 94d5f00..c8a0dac 100644 --- a/src/room.rs +++ b/src/room.rs @@ -118,7 +118,7 @@ impl <'a, 'b>Room<'a, 'b> { world.insert(NewEntities::new(encyclopedia)); register_insert!( world, - (Position, Visible, Controller, Movable, New, Removed, Moved, Player, Inventory, Health, Serialise, RoomExit, Entered, Dead, Trap, Fighter, Healing, Volatile, ControlCooldown, Autofight, MonsterAI, Home, Mortal, AttackInbox, Item, Spawner, Clan, Faction, Interactable, Loot, Grow, Equipment, CreationTime, Flags, Ear), + (Position, Visible, Controller, Movable, New, Removed, Moved, Player, Inventory, Health, Serialise, RoomExit, Entered, Dead, Trap, Fighter, Healing, Volatile, ControlCooldown, Autofight, MonsterAI, Home, AttackInbox, Item, Spawner, Clan, Faction, Interactable, Loot, Grow, Equipment, CreationTime, Flags, Ear), (Ground, Input, Output, Size, Spawn, Players, Emigration, Time) ); diff --git a/src/systems/die.rs b/src/systems/die.rs index fd953e0..e9fb127 100644 --- a/src/systems/die.rs +++ b/src/systems/die.rs @@ -9,7 +9,7 @@ use specs::{ }; use crate::{ - components::{Mortal, Dead, Removed, Player}, + components::{Dead, Removed, Player}, resources::Emigration, purgatory, playerstate::RoomPos @@ -20,15 +20,14 @@ pub struct Die; impl <'a> System<'a> for Die { type SystemData = ( Entities<'a>, - ReadStorage<'a, Mortal>, ReadStorage<'a, Dead>, WriteStorage<'a, Removed>, Write<'a, Emigration>, ReadStorage<'a, Player> ); - fn run(&mut self, (entities, mortals, deads, mut removeds, mut emigration, players): Self::SystemData) { + fn run(&mut self, (entities, deads, mut removeds, mut emigration, players): Self::SystemData) { // npcs etc get removed when dead - for (entity, _, _) in (&entities, &mortals, &deads).join() { + for (entity, _, _) in (&entities, &deads, !&players).join() { removeds.insert(entity, Removed).unwrap(); } // players move to purgatory when dead |
