fix electrocute reflect
This commit is contained in:
parent
86b73fc71a
commit
85ec220511
@ -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)) => {
|
||||||
resolutions = electrocute(&mut target, &mut source, resolutions, 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
_ => panic!("no electrify skill"),
|
_ => panic!("no electrify skill"),
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user