Merge branch 'release/1.8.3' of ssh://git.mnml.gg:40022/~/mnml into release/1.8.3

This commit is contained in:
ntr
2019-11-13 20:51:46 +11:00
3 changed files with 63 additions and 33 deletions
+5 -9
View File
@@ -299,9 +299,9 @@ pub fn resolve(skill: Skill, source: &mut Construct, target: &mut Construct, mut
}
fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) -> Resolutions {
for Resolution { source, target, event, stages: _ } in resolutions.clone() {
let mut source = game.construct_by_id(source.id).unwrap().clone();
let mut target = game.construct_by_id(target.id).unwrap().clone();
for Resolution { source: event_source, target: event_target, event, stages: _ } in resolutions.clone() {
let mut source = game.construct_by_id(event_source.id).unwrap().clone();
let mut target = game.construct_by_id(event_target.id).unwrap().clone();
match event {
Event::Damage { amount, skill, mitigation, colour: c } => {
@@ -352,18 +352,14 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
_ => (),
};
if target.is_ko() {
if target.is_ko() && event_target.green == 0 {
// Make sure target ko is from this event
target.effects.clear();
resolutions.push(Resolution::new(&source, &target).event(Event::Ko()).stages(EventStages::PostOnly));
}
game.update_construct(&mut source);
game.update_construct(&mut target);
if target.is_ko() {
// Don't loop for multiple resolutions which led to KO
break;
}
};
return resolutions;