From 27c0795fb70739ce5609a0f424d80491d4a8c5a1 Mon Sep 17 00:00:00 2001 From: troido Date: Mon, 2 Mar 2020 12:02:54 +0100 Subject: added monster ai --- src/componentwrapper.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/componentwrapper.rs') diff --git a/src/componentwrapper.rs b/src/componentwrapper.rs index 54c0daa..29bf39d 100644 --- a/src/componentwrapper.rs +++ b/src/componentwrapper.rs @@ -23,7 +23,8 @@ use crate::{ Healing, Volatile, AttackMessage, - Autofight + Autofight, + MonsterAI }, parameter::{Parameter, ParameterType} }; @@ -132,10 +133,11 @@ components!( } }; Trap (damage: Int) {Trap{attack: AttackMessage::new(damage)}}; - Fighter (damage: Int, cooldown: Int) {Fighter{attack: AttackMessage::new(damage), cooldown}}; + Fighter (damage: Int, cooldown: Int) {Fighter{attack: AttackMessage::new(damage), cooldown, range: 1}}; Healing (delay: Int, health: Int) {Healing{delay, health, next_heal: None}}; Volatile (delay: Int) {Volatile{delay, end_time: None}}; Autofight () {Autofight::default()}; + MonsterAI (move_chance: Float, homesickness: Float, view_distance: Int) {MonsterAI{move_chance, homesickness, view_distance}}; ); -- cgit