Formatting edit

This commit is contained in:
Zzooouhh 2017-11-18 00:11:56 +01:00 committed by GitHub
parent d6f63b3393
commit a7bcad4868
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -126,33 +126,33 @@ class BalduvianWarlordUnblockEffect extends OneShotEffect {
// Choose new creature to block // Choose new creature to block
if (permanent.isCreature()) { if (permanent.isCreature()) {
TargetAttackingCreature target = new TargetAttackingCreature(1, 1, new FilterAttackingCreature(), true); TargetAttackingCreature target = new TargetAttackingCreature(1, 1, new FilterAttackingCreature(), true);
if (target.canChoose(source.getSourceId(), controller.getId(), game)) { if (target.canChoose(source.getSourceId(), controller.getId(), game)) {
while (!target.isChosen() && target.canChoose(controller.getId(), game) && controller.canRespond()) { while (!target.isChosen() && target.canChoose(controller.getId(), game) && controller.canRespond()) {
controller.chooseTarget(outcome, target, source, game); controller.chooseTarget(outcome, target, source, game);
}
} else {
return true;
} }
Permanent chosenPermanent = game.getPermanent(target.getFirstTarget()); } else {
if (chosenPermanent != null && permanent != null && chosenPermanent.isCreature() && controller != null) { return true;
CombatGroup chosenGroup = game.getCombat().findGroup(chosenPermanent.getId()); }
if (chosenGroup != null) { Permanent chosenPermanent = game.getPermanent(target.getFirstTarget());
// Relevant ruling for Balduvian Warlord: if (chosenPermanent != null && permanent != null && chosenPermanent.isCreature() && controller != null) {
// 7/15/2006 If an attacking creature has an ability that triggers When this creature becomes blocked, CombatGroup chosenGroup = game.getCombat().findGroup(chosenPermanent.getId());
// it triggers when a creature blocks it due to the Warlords ability only if it was unblocked at that point. if (chosenGroup != null) {
// 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 Warlords ability only if it was unblocked at that point.
boolean notYetBlocked = true; boolean notYetBlocked = true;
if (!chosenGroup.getBlockers().isEmpty()) { if (!chosenGroup.getBlockers().isEmpty()) {
notYetBlocked = false; notYetBlocked = false;
}
chosenGroup.addBlocker(permanent.getId(), controller.getId(), game);
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()));
} }
chosenGroup.addBlocker(permanent.getId(), controller.getId(), game);
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()));
} }
}
return true; return true;
} }
} }