* Commander format - Fixed that the commanders color identity was not correctly set for the mana replacement effect. Mana symbols from the rule text were not taken into account.

This commit is contained in:
LevelX2 2015-01-25 22:46:55 +01:00
parent 4127d2b358
commit de92c50944
4 changed files with 57 additions and 58 deletions

View file

@ -33,7 +33,6 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.EmptyEffect;
import mage.abilities.common.SimpleStaticAbility;
@ -52,8 +51,8 @@ import mage.filter.FilterCard;
import mage.game.turn.TurnMod;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
import mage.util.CardUtil;
import mage.watchers.common.CommanderCombatDamageWatcher;
import org.apache.log4j.Logger;
public abstract class GameCommanderImpl extends GameImpl {
@ -87,14 +86,7 @@ public abstract class GameCommanderImpl extends GameImpl {
commander.moveToZone(Zone.COMMAND, null, this, true);
ability.addEffect(new CommanderReplacementEffect(commander.getId(), alsoLibrary));
ability.addEffect(new CommanderCostModification(commander.getId()));
Mana commanderMana;
if (commander.getSpellAbility().getManaCosts() == null) {
Logger.getLogger(GameCommanderImpl.class).warn("Got commander without Mana costs: " + commander.getName());
commanderMana = new Mana();
} else {
commanderMana = commander.getSpellAbility().getManaCosts().getMana();
}
ability.addEffect(new CommanderManaReplacementEffect(player.getId(), commanderMana));
ability.addEffect(new CommanderManaReplacementEffect(player.getId(), CardUtil.getColorIdentity(commander)));
getState().setValue(commander.getId() + "_castCount", 0);
CommanderCombatDamageWatcher watcher = new CommanderCombatDamageWatcher(commander.getId());
getState().getWatchers().add(watcher);