This commit is contained in:
ntr 2019-12-11 18:47:19 +10:00
parent 145302d8da
commit 9fefb508f9
2 changed files with 10 additions and 4 deletions

View File

@ -947,6 +947,14 @@ impl Construct {
return removals;
}
pub fn on_ko(&mut self, _cast: &Cast, _event: &Event) -> Vec<Cast> {
self.effects.clear();
self.green_life.value = 0;
self.red_life.value = 0;
self.blue_life.value = 0;
return vec![];
}
pub fn damage_trigger_casts(&mut self, cast: &Cast, event: &Event) -> Vec<Cast> {
if self.is_ko() { return vec![] }

View File

@ -588,11 +588,9 @@ impl Game {
let casts = match event {
Event::Damage { construct, colour, amount, mitigation, display: _ } =>
self.construct_by_id(*construct).unwrap().damage_trigger_casts(cast, event),
Event::Ko { construct } =>{
self.construct_by_id(*construct).unwrap().effects.clear();
vec![]
},
// Event::Cast {} => set_cooldown()
Event::Ko { construct } =>
self.construct_by_id(*construct).unwrap().on_ko(cast, event),
_ => vec![],
};