From 40e4e9e7a7e2c59a5659d8d4bd2ecfafed967299 Mon Sep 17 00:00:00 2001 From: troido Date: Fri, 28 Feb 2020 12:40:52 +0100 Subject: added cooldowns for moving and fighting --- src/componentwrapper.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/componentwrapper.rs') 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}}; ); -- cgit