Can't attack or block alone

I'm currently trying to get "CARDNAME can't attack or block alone." keyword working but need some rules clarification. So far the basic setup is this (in GameAction.checkStateEffects):
Edit: Then another issue I'm not sure of is that if all other attackers or blockers are removed during the Play Instants and Abilities steps, the Flunkies are also removed from combat. Is that correct or is it as I suspect that they should only be removed during the Declare Attackers/Blockers step? I know that two Flunkies could attack or block together legally so they can't be removed as valid choices in CombatUtil.canAttack etc (unless you control no other creatures).
- Code: Select all
// Handles removing cards like Mogg Flunkies from combat
if (c.hasKeyword("CARDNAME can't attack or block alone.")) {
if (c.isAttacking()) {
if (AllZone.getCombat().getAttackers().size() < 2
&& Singletons.getModel().getGameState().getPhaseHandler().is(PhaseType.COMBAT_DECLARE_ATTACKERS_INSTANT_ABILITY)) {
AllZone.getCombat().removeFromCombat(c);
checkAgain = true;
}
}
if (c.isBlocking()) {
if (AllZone.getCombat().getAllBlockers().size() < 2
&& Singletons.getModel().getGameState().getPhaseHandler().is(PhaseType.COMBAT_DECLARE_BLOCKERS_INSTANT_ABILITY)) {
AllZone.getCombat().removeFromCombat(c);
checkAgain = true;
}
}
}
Edit: Then another issue I'm not sure of is that if all other attackers or blockers are removed during the Play Instants and Abilities steps, the Flunkies are also removed from combat. Is that correct or is it as I suspect that they should only be removed during the Declare Attackers/Blockers step? I know that two Flunkies could attack or block together legally so they can't be removed as valid choices in CombatUtil.canAttack etc (unless you control no other creatures).