post_resolve

This commit is contained in:
Mashy 2019-11-13 19:05:10 +10:00
parent c99f189c69
commit b6ce6a5277

View File

@ -299,8 +299,8 @@ 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_target, event, stages: _ } in resolutions.clone() {
let mut source = game.construct_by_id(source.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 {
@ -353,7 +353,7 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
};
if target.is_ko() && event_target.green == 0 {
// Check target is actually ko if sending ko event
// Make sure target ko is from this event
target.effects.clear();
resolutions.push(Resolution::new(&source, &target).event(Event::Ko()).stages(EventStages::PostOnly));
}