From af42c2dd4cbc475bfb3cac30d85231df7b833061 Mon Sep 17 00:00:00 2001 From: L_J Date: Sat, 17 Feb 2018 13:45:08 +0000 Subject: [PATCH] Updated False Orders to better handle banding --- Mage.Sets/src/mage/cards/f/FalseOrders.java | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/cards/f/FalseOrders.java b/Mage.Sets/src/mage/cards/f/FalseOrders.java index 8d35c683fa..f1b4a1cd2f 100644 --- a/Mage.Sets/src/mage/cards/f/FalseOrders.java +++ b/Mage.Sets/src/mage/cards/f/FalseOrders.java @@ -175,20 +175,35 @@ class FalseOrdersUnblockEffect extends OneShotEffect { // Relevant ruling for Balduvian Warlord: // 7/15/2006 If an attacking creature has an ability that triggers “When this creature becomes blocked,” // it triggers when a creature blocks it due to the Warlord’s ability only if it was unblocked at that point. - boolean notYetBlocked = chosenGroup.getBlockers().isEmpty(); - chosenGroup.addBlocker(permanent.getId(), controller.getId(), game); + chosenGroup.addBlockerToGroup(permanent.getId(), controller.getId(), game); + game.getCombat().addBlockingGroup(permanent.getId(), chosenPermanent.getId(), controller.getId(), game); // 702.21h if (notYetBlocked) { game.fireEvent(GameEvent.getEvent(GameEvent.EventType.CREATURE_BLOCKED, chosenPermanent.getId(), null)); } game.fireEvent(GameEvent.getEvent(GameEvent.EventType.BLOCKER_DECLARED, chosenPermanent.getId(), permanent.getId(), permanent.getControllerId())); } + CombatGroup blockGroup = findBlockingGroup(permanent, game); // a new blockingGroup is formed, so it's necessary to find it again + if (blockGroup != null) { + blockGroup.pickAttackerOrder(permanent.getControllerId(), game); + } } } - } + } return true; } } return false; } + + private CombatGroup findBlockingGroup(Permanent blocker, Game game) { + if (game.getCombat().blockingGroupsContains(blocker.getId())) { // if (blocker.getBlocking() > 1) { + for (CombatGroup group : game.getCombat().getBlockingGroups()) { + if (group.getBlockers().contains(blocker.getId())) { + return group; + } + } + } + return null; + } }