diff --git a/Mage.Sets/src/mage/sets/newphyrexia/NornsAnnex.java b/Mage.Sets/src/mage/sets/newphyrexia/NornsAnnex.java index f3c673928c4..095aa694b59 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/NornsAnnex.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/NornsAnnex.java @@ -52,7 +52,9 @@ public class NornsAnnex extends CardImpl { public NornsAnnex(UUID ownerId) { super(ownerId, 17, "Norn's Annex", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}{WP}{WP}"); this.expansionSetCode = "NPH"; - this.color.setWhite(true); + + // {WP} ({WP} can be paid with either or 2 life.) + // Creatures can't attack you or a planeswalker you control unless their controller pays for each of those creatures. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NornsAnnexReplacementEffect())); } @@ -87,29 +89,24 @@ class NornsAnnexReplacementEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - if (event.getType() == GameEvent.EventType.DECLARE_ATTACKER) { - if (event.getTargetId().equals(source.getControllerId()) ) { - return true; - } - // planeswalker - Permanent permanent = game.getPermanent(event.getTargetId()); - if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) - && permanent.getCardType().contains(CardType.PLANESWALKER)) { - return true; - } + if (event.getTargetId().equals(source.getControllerId()) ) { + return true; } - return false; + // planeswalker + Permanent permanent = game.getPermanent(event.getTargetId()); + return permanent != null && permanent.getControllerId().equals(source.getControllerId()) + && permanent.getCardType().contains(CardType.PLANESWALKER); } @Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player player = game.getPlayer(event.getPlayerId()); - if (player != null && event.getTargetId().equals(source.getControllerId())) { + if (player != null) { ManaCostsImpl propagandaTax = new ManaCostsImpl("{WP}"); if (propagandaTax.canPay(source, source.getSourceId(), event.getPlayerId(), game) && player.chooseUse(Outcome.Benefit, "Pay {WP} to declare attacker?", game)) { - if (propagandaTax.payOrRollback(source, game, this.getId(), event.getPlayerId())) { + if (propagandaTax.payOrRollback(source, game, source.getSourceId(), event.getPlayerId())) { return false; } } @@ -125,5 +122,3 @@ class NornsAnnexReplacementEffect extends ReplacementEffectImpl { } } - - diff --git a/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java b/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java index bfefe86b774..aca1bd6b376 100644 --- a/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java +++ b/Mage/src/mage/abilities/costs/mana/ManaCostsImpl.java @@ -139,12 +139,12 @@ public class ManaCostsImpl extends ArrayList implements M * @param ability * @param game * @param sourceId - * @param controllerId + * @param payingPlayerId * @return true if the cost was paid */ - public boolean payOrRollback(Ability ability, Game game, UUID sourceId, UUID controllerId) { + public boolean payOrRollback(Ability ability, Game game, UUID sourceId, UUID payingPlayerId) { int bookmark = game.bookmarkState(); - if (pay(ability, game, sourceId, controllerId, false)) { + if (pay(ability, game, sourceId, payingPlayerId, false)) { game.removeBookmark(bookmark); return true; } diff --git a/Mage/src/mage/game/events/GameEvent.java b/Mage/src/mage/game/events/GameEvent.java index d93ee6f92f3..7862334c565 100644 --- a/Mage/src/mage/game/events/GameEvent.java +++ b/Mage/src/mage/game/events/GameEvent.java @@ -148,7 +148,16 @@ public class GameEvent implements Serializable { COUNTER, COUNTERED, DECLARING_ATTACKERS, DECLARED_ATTACKERS, - DECLARE_ATTACKER, ATTACKER_DECLARED, + DECLARE_ATTACKER, + + /* ATTACKER_DECLARED + targetId id of the defending player or planeswalker attacked + sourceId id of the attacking creature + playerId player defining the attacking creatures + amount not used for this event + flag not used for this event + */ + ATTACKER_DECLARED, /* DECLARING_BLOCKERS targetId attackerId