From 16d319c7061dbf9a1998ee016b977043461975df Mon Sep 17 00:00:00 2001 From: Mashy Date: Wed, 2 Oct 2019 14:39:36 +1000 Subject: [PATCH] reflect no longer triggers on ticks --- WORKLOG.md | 1 + server/src/skill.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/WORKLOG.md b/WORKLOG.md index 4c2aa9e2..ddf6f124 100644 --- a/WORKLOG.md +++ b/WORKLOG.md @@ -51,6 +51,7 @@ - click in to scroll * elo + leaderboards + * reflect event stages (for animations) * mnml tv ## LATER diff --git a/server/src/skill.rs b/server/src/skill.rs index 85f67625..787e5c61 100644 --- a/server/src/skill.rs +++ b/server/src/skill.rs @@ -78,7 +78,7 @@ pub fn resolve(skill: Skill, source: &mut Construct, target: &mut Construct, mut return resolutions; } - if target.affected(Effect::Reflect) && skill.colours().contains(&Colour::Blue) { + if target.affected(Effect::Reflect) && skill.colours().contains(&Colour::Blue) && !skill.is_tick() { // guard against overflow if source.affected(Effect::Reflect) { return resolutions; @@ -303,7 +303,8 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) -> 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.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);