From 34f16e3202dc86aacd455fec9383c54cbd8eebd8 Mon Sep 17 00:00:00 2001 From: APN-Pucky Date: Thu, 21 Sep 2017 20:27:05 +0200 Subject: [PATCH] Reorganized Flurry-Bug-Fix --- sim.cpp | 15 +++------------ tyrant.h | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/sim.cpp b/sim.cpp index e8e52891..25866ca2 100644 --- a/sim.cpp +++ b/sim.cpp @@ -23,6 +23,7 @@ inline bool is_alive(CardStatus* c) { return (c->m_hp > 0); } inline bool can_act(CardStatus* c) { return is_alive(c) && !c->m_jammed; } inline bool is_active(CardStatus* c) { return can_act(c) && (c->m_delay == 0); } inline bool is_active_next_turn(CardStatus* c) { return can_act(c) && (c->m_delay <= 1); } +inline bool will_activate_this_turn(CardStatus* c) { return is_active(c) && ((c->m_step == CardStep::none) || (c->m_step == CardStep::attacking && c->has_skill(Skill::flurry) && action_index < c->skill_base_value(Skill::flurry)));} // Can be healed / repaired inline bool can_be_healed(CardStatus* c) { return is_alive(c) && (c->m_hp < c->max_hp()); } // Strange Transmission [Gilians] features @@ -774,12 +775,7 @@ inline bool skill_check(Field* fd, CardStatus* c, CardStatus* ref) { return is_active_next_turn(c); } // inactive player performs Jam - if (is_active(c) && c->m_step == CardStep::attacking && c->has_skill(Skill::flurry) && action_index < c->skill_base_value(Skill::flurry)) - { - _DEBUG_MSG(2,"**APN** targetable due to flurry\n") - return true; - } - return is_active(c) && (c->m_step == CardStep::none); + return will_activate_this_turn(c); } template<> @@ -1753,12 +1749,7 @@ inline bool skill_predicate(Field* fd, CardStatus* src, CardStatu // APN - On-Attacked/Death don't target the attacking card // inactive player performs Weaken (inverted case (on-death activation)) - if (is_active(dst) && dst->m_step == CardStep::attacking && dst->has_skill(Skill::flurry) && action_index < dst->skill_base_value(Skill::flurry)) - { - _DEBUG_MSG(2,"**APN** targetable due to flurry\n") - return true; - } - return is_active(dst) && (dst->m_step == CardStep::none); + return will_activate_this_turn(dst); } template<> diff --git a/tyrant.h b/tyrant.h index 2bacc644..e1df2b26 100644 --- a/tyrant.h +++ b/tyrant.h @@ -1,7 +1,7 @@ #ifndef TYRANT_H_INCLUDED #define TYRANT_H_INCLUDED -#define TYRANT_OPTIMIZER_VERSION "2.54.4" +#define TYRANT_OPTIMIZER_VERSION "2.54.5" #include #include