mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 19:11:59 -08:00
* Commander - Allow activated abilities from command zone, card going back fom exile zone after commander mulligan are no longer face down in library.
This commit is contained in:
parent
408a66ee42
commit
aa6be2f4da
3 changed files with 15 additions and 2 deletions
|
|
@ -171,6 +171,7 @@ public class CommanderDuel extends GameImpl<CommanderDuel> {
|
||||||
if(player != null && mulliganedCards.containsKey(playerId)){
|
if(player != null && mulliganedCards.containsKey(playerId)){
|
||||||
for(Card card : mulliganedCards.get(playerId).getCards(this)){
|
for(Card card : mulliganedCards.get(playerId).getCards(this)){
|
||||||
if(card != null){
|
if(card != null){
|
||||||
|
card.setFaceDown(false);
|
||||||
card.moveToZone(Zone.LIBRARY, null, this, false);
|
card.moveToZone(Zone.LIBRARY, null, this, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -468,6 +468,9 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
|
||||||
game.getExile().removeCard(this, game);
|
game.getExile().removeCard(this, game);
|
||||||
removed = true;
|
removed = true;
|
||||||
break;
|
break;
|
||||||
|
case COMMAND:
|
||||||
|
removed = true;
|
||||||
|
break;
|
||||||
case PICK:
|
case PICK:
|
||||||
removed = true;
|
removed = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -34,11 +34,13 @@ import mage.ObjectColor;
|
||||||
import mage.abilities.Abilities;
|
import mage.abilities.Abilities;
|
||||||
import mage.abilities.AbilitiesImpl;
|
import mage.abilities.AbilitiesImpl;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.ActivatedAbility;
|
||||||
import mage.abilities.common.CastCommanderAbility;
|
import mage.abilities.common.CastCommanderAbility;
|
||||||
import mage.abilities.costs.mana.ManaCost;
|
import mage.abilities.costs.mana.ManaCost;
|
||||||
import mage.abilities.costs.mana.ManaCosts;
|
import mage.abilities.costs.mana.ManaCosts;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -49,13 +51,20 @@ import mage.game.Game;
|
||||||
|
|
||||||
public class Commander implements CommandObject{
|
public class Commander implements CommandObject{
|
||||||
|
|
||||||
private Card card;
|
private final Card card;
|
||||||
private Abilities<Ability> abilites = new AbilitiesImpl<Ability>();
|
private final Abilities<Ability> abilites = new AbilitiesImpl<Ability>();
|
||||||
|
|
||||||
|
|
||||||
public Commander(Card card){
|
public Commander(Card card){
|
||||||
this.card = card;
|
this.card = card;
|
||||||
abilites.add(new CastCommanderAbility(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) {
|
private Commander(Commander copy) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue