summaryrefslogtreecommitdiff
path: root/src/componentwrapper.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-02-28 12:40:52 +0100
committertroido <troido@protonmail.com>2020-02-28 12:40:52 +0100
commit40e4e9e7a7e2c59a5659d8d4bd2ecfafed967299 (patch)
treefa2c2bb9b293781a871ca64915b5c0149e36fd6c /src/componentwrapper.rs
parent481e03e04b055cebaf230b3a3cdce3446418c68c (diff)
added cooldowns for moving and fighting
Diffstat (limited to 'src/componentwrapper.rs')
-rw-r--r--src/componentwrapper.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/componentwrapper.rs b/src/componentwrapper.rs
index 4812b0b..2fe114a 100644
--- a/src/componentwrapper.rs
+++ b/src/componentwrapper.rs
@@ -8,7 +8,7 @@ use crate::{
Sprite,
playerstate::RoomPos,
attack::Attack,
- components::{Visible, Blocking, Player, Floor, Item, Inventory, Health, Serialise, RoomExit, Trap, Fighter, Healing, Volatile},
+ components::{Visible, Movable, Blocking, Player, Floor, Item, Inventory, Health, Serialise, RoomExit, Trap, Fighter, Healing, Volatile},
parameter::{Parameter, ParameterType}
};
@@ -97,6 +97,7 @@ components!(
name
}
};
+ Movable (cooldown: Int) {Movable {cooldown}};
Blocking () {Blocking};
Floor () {Floor};
Player (name: String) {Player::new(PlayerId{name})};
@@ -115,7 +116,7 @@ components!(
}
};
Trap (damage: Int) {Trap{attack: Attack::new(damage)}};
- Fighter (damage: Int) {Fighter{attack: Attack::new(damage)}};
+ Fighter (damage: Int, cooldown: Int) {Fighter{attack: Attack::new(damage), cooldown}};
Healing (delay: Int, health: Int) {Healing{delay, health, next_heal: None}};
Volatile (delay: Int) {Volatile{delay, end_time: None}};
);