Merge branch 'release/1.8.3' of ssh://git.mnml.gg:40022/~/mnml into release/1.8.3
This commit is contained in:
+5
-9
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user