fix electrocute reflect

This commit is contained in:
Mashy 2019-10-02 12:37:11 +10:00
parent 86b73fc71a
commit 85ec220511

View File

@ -299,7 +299,16 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
.find(|e| e.effect == Effect::Electric).unwrap().clone(); .find(|e| e.effect == Effect::Electric).unwrap().clone();
match meta { match meta {
Some(EffectMeta::Skill(s)) => { Some(EffectMeta::Skill(s)) => {
// Gurad against reflect overflow
if !(source.affected(Effect::Reflect) && target.affected(Effect::Reflect)) {
// Check reflect don't bother if electrocute is procing on death
if source.affected(Effect::Reflect) && !target.is_ko() {
resolutions.push(Resolution::new(&target, &source).event(Event::Reflection { skill: s }).stages(EventStages::EndPost));
resolutions = electrocute(&mut source, &mut target, resolutions, s);
} else {
resolutions = electrocute(&mut target, &mut source, resolutions, s); resolutions = electrocute(&mut target, &mut source, resolutions, s);
}
}
}, },
_ => panic!("no electrify skill"), _ => panic!("no electrify skill"),
}; };