Fixed commander cast test.

This commit is contained in:
LevelX2 2015-05-29 17:29:14 +02:00
parent 8783a633a1
commit 4f4ade61d5
3 changed files with 3 additions and 3 deletions

View file

@ -39,7 +39,6 @@ import org.mage.test.serverside.base.CardTestCommanderDuelBase;
*/
public class CastCommanderTest extends CardTestCommanderDuelBase {
@Test
@Ignore
public void testFirstAbility() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);

View file

@ -83,9 +83,10 @@ public abstract class GameCommanderImpl extends GameImpl {
if (player != null){
if (player.getSideboard().size() > 0){
Card commander = getCard((UUID)player.getSideboard().toArray()[0]);
if (commander != null) {
if (commander != null) {
player.setCommanderId(commander.getId());
commander.moveToZone(Zone.COMMAND, null, this, true);
commander.getAbilities().setControllerId(player.getId());
ability.addEffect(new CommanderReplacementEffect(commander.getId(), alsoHand, alsoLibrary));
ability.addEffect(new CommanderCostModification(commander.getId()));
ability.addEffect(new CommanderManaReplacementEffect(player.getId(), CardUtil.getColorIdentity(commander)));

View file

@ -2454,7 +2454,7 @@ public abstract class PlayerImpl implements Player, Serializable {
for (CommandObject commandObject : game.getState().getCommand()) {
for (ActivatedAbility ability : commandObject.getAbilities().getActivatedAbilities(Zone.COMMAND)) {
if (ability.getControllerId().equals(getId())
&& ability.getAbilityType().equals(AbilityType.ACTIVATED)
&& ability instanceof ActivatedAbility
&& canPlay(ability, availableMana, game.getObject(ability.getSourceId()), game)) {
playableActivated.put(ability.toString(), ability);
}