From aa6be2f4da6669f18fada2019aa7ec822330f33a Mon Sep 17 00:00:00 2001 From: LevelX2 <ludwig.hirth@gmail.com> Date: Tue, 19 Nov 2013 08:11:34 +0100 Subject: [PATCH] * Commander - Allow activated abilities from command zone, card going back fom exile zone after commander mulligan are no longer face down in library. --- .../src/mage/game/CommanderDuel.java | 1 + Mage/src/mage/cards/CardImpl.java | 3 +++ Mage/src/mage/game/command/Commander.java | 13 +++++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Game.CommanderDuel/src/mage/game/CommanderDuel.java b/Mage.Server.Plugins/Mage.Game.CommanderDuel/src/mage/game/CommanderDuel.java index 7eaf10bc32..a0d7fee1c8 100644 --- a/Mage.Server.Plugins/Mage.Game.CommanderDuel/src/mage/game/CommanderDuel.java +++ b/Mage.Server.Plugins/Mage.Game.CommanderDuel/src/mage/game/CommanderDuel.java @@ -171,6 +171,7 @@ public class CommanderDuel extends GameImpl<CommanderDuel> { if(player != null && mulliganedCards.containsKey(playerId)){ for(Card card : mulliganedCards.get(playerId).getCards(this)){ if(card != null){ + card.setFaceDown(false); card.moveToZone(Zone.LIBRARY, null, this, false); } } diff --git a/Mage/src/mage/cards/CardImpl.java b/Mage/src/mage/cards/CardImpl.java index 46c74aa0d3..9ce5329783 100644 --- a/Mage/src/mage/cards/CardImpl.java +++ b/Mage/src/mage/cards/CardImpl.java @@ -468,6 +468,9 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T> game.getExile().removeCard(this, game); removed = true; break; + case COMMAND: + removed = true; + break; case PICK: removed = true; break; diff --git a/Mage/src/mage/game/command/Commander.java b/Mage/src/mage/game/command/Commander.java index cc12e56ee8..23aa9a24aa 100644 --- a/Mage/src/mage/game/command/Commander.java +++ b/Mage/src/mage/game/command/Commander.java @@ -34,11 +34,13 @@ import mage.ObjectColor; import mage.abilities.Abilities; import mage.abilities.AbilitiesImpl; import mage.abilities.Ability; +import mage.abilities.ActivatedAbility; import mage.abilities.common.CastCommanderAbility; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; import mage.cards.Card; import mage.constants.CardType; +import mage.constants.Zone; import mage.game.Game; /** @@ -49,13 +51,20 @@ import mage.game.Game; public class Commander implements CommandObject{ - private Card card; - private Abilities<Ability> abilites = new AbilitiesImpl<Ability>(); + private final Card card; + private final Abilities<Ability> abilites = new AbilitiesImpl<Ability>(); public Commander(Card card){ this.card = card; abilites.add(new CastCommanderAbility(card)); + for (Ability ability : card.getAbilities()) { + if (ability instanceof ActivatedAbility && ability.getZone().equals(Zone.COMMAND)) { + Ability newAbility = ability.copy(); + newAbility.setRuleVisible(false); + abilites.add(newAbility); + } + } } private Commander(Commander copy) {