diff --git a/sim.cpp b/sim.cpp index 78ae1c92..e8e52891 100644 --- a/sim.cpp +++ b/sim.cpp @@ -602,7 +602,7 @@ void evaluate_skills(Field* fd, CardStatus* status, const std::vector { _DEBUG_ASSERT(status); unsigned num_actions(1); - for (unsigned action_index(0); action_index < num_actions; ++ action_index) + for (action_index = 0; action_index < num_actions; ++ action_index) { fd->prepare_action(); _DEBUG_ASSERT(fd->skill_queue.size() == 0); @@ -774,6 +774,11 @@ 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); } @@ -1056,6 +1061,10 @@ void turn_end_phase(Field* fd) //---------------------- $50 attack by assault card implementation ------------- // Counter damage dealt to the attacker (att) by defender (def) // pre-condition: only valid if m_card->m_counter > 0 + +// APN - Global Access to check if flurry is active for on attacked +unsigned action_index{0}; + inline unsigned counter_damage(Field* fd, CardStatus* att, CardStatus* def) { _DEBUG_ASSERT(att->m_card->m_type == CardType::assault); @@ -1741,8 +1750,15 @@ inline bool skill_predicate(Field* fd, CardStatus* src, CardStatu if (__builtin_expect((fd->tapi == src->m_player), true)) { return is_active_next_turn(dst); } + // APN - On-Attacked/Death don't target the attacking card + // inactive player performs Weaken (inverted case (on-death activation)) - return is_active(dst) && !has_attacked(dst); + 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); } template<> diff --git a/sim.h b/sim.h index b0a9aac0..9dde96de 100644 --- a/sim.h +++ b/sim.h @@ -20,6 +20,7 @@ class Field; class Achievement; extern unsigned turn_limit; +extern unsigned action_index; //---------------------- Represent Simulation Results ---------------------------- template