mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
Formatting edit
This commit is contained in:
parent
d6f63b3393
commit
a7bcad4868
1 changed files with 24 additions and 24 deletions
|
@ -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 Warlord’s 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 Warlord’s 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue