fix ko electrify (effect removal in post effect)

This commit is contained in:
Mashy 2019-08-19 18:21:01 +10:00
parent a06f3a75ae
commit d995e936ad
3 changed files with 8 additions and 16 deletions

View File

@ -599,11 +599,6 @@ impl Construct {
}
}
if self.is_ko() {
events.push(Event::Ko ());
self.effects.clear();
}
return events;
}
@ -677,12 +672,6 @@ impl Construct {
}
};
if self.is_ko() {
events.push(Event::Ko ());
self.effects.clear();
}
return events;
}
@ -752,11 +741,6 @@ impl Construct {
}
};
if self.is_ko() {
events.push(Event::Ko ());
self.effects.clear();
}
return events;
}

View File

@ -1165,6 +1165,9 @@ mod tests {
let x_construct = x_player.constructs[0].clone();
let y_construct = y_player.constructs[0].clone();
// one shot the target construct (should still get debuffed)
game.player_by_id(y_player.id).unwrap().construct_by_id(y_construct.id).unwrap().red_power.force(1000000000);
game.construct_by_id(x_construct.id).unwrap().learn_mut(Skill::Electrify);
while game.construct_by_id(x_construct.id).unwrap().skill_on_cd(Skill::Electrify).is_some() {

View File

@ -344,6 +344,11 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
_ => (),
};
if target.is_ko() {
resolutions.push(Resolution::new(&source, &target).event(Event::Ko()));
target.effects.clear();
}
game.update_construct(&mut source);
game.update_construct(&mut target);
};