* Celestial Dawn - Fixed that it was not possible to pay colorless costs with non white mana.

This commit is contained in:
LevelX2 2017-04-04 15:32:39 +02:00
parent 989250c7f6
commit 45818f3a51
5 changed files with 77 additions and 10 deletions

View file

@ -27,6 +27,7 @@
*/ */
package mage.cards.c; package mage.cards.c;
import java.util.UUID;
import mage.MageObject; import mage.MageObject;
import mage.ObjectColor; import mage.ObjectColor;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -49,8 +50,6 @@ import mage.players.ManaPoolItem;
import mage.players.Player; import mage.players.Player;
import mage.sets.Commander; import mage.sets.Commander;
import java.util.UUID;
/** /**
* *
* @author LevelX2 * @author LevelX2
@ -267,8 +266,8 @@ class CelestialDawnSpendColorlessManaEffect extends AsThoughEffectImpl implement
@Override @Override
public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) { public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) {
if (mana.getWhite() == 0 && ManaType.COLORLESS != manaType) { if (mana.getWhite() == 0) {
return null; return ManaType.COLORLESS;
} }
return manaType; return manaType;
} }

View file

@ -28,10 +28,6 @@
package mage.cards.l; package mage.cards.l;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -41,6 +37,9 @@ import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
@ -64,7 +63,7 @@ public class LordOfLineage extends CardImpl {
this.power = new MageInt(5); this.power = new MageInt(5);
this.toughness = new MageInt(5); this.toughness = new MageInt(5);
// this card is the second face of double-faced card // this card is the second face of double-faced card Bloodline Keeper
this.nightCard = true; this.nightCard = true;
this.transformable = true; this.transformable = true;

View file

@ -29,6 +29,7 @@ package org.mage.test.cards.mana;
import mage.constants.PhaseStep; import mage.constants.PhaseStep;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test; import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase; import org.mage.test.serverside.base.CardTestPlayerBase;
@ -69,4 +70,63 @@ public class SpendManaAsThoughItWereManaOfAnyColorTest extends CardTestPlayerBas
} }
/**
* Celestial Dawn does not allow spending of off-color mana for any purpose.
* Had a Black Market down, was trying to cast Darksteel Forge, could not
* spend the black mana on the forge.
*/
@Test
public void testCelestialDawn() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 8);
// Lands you control are Plains.
// Nonland cards you own that aren't on the battlefield, spells you control, and nonland permanents you control are white.
// You may spend white mana as though it were mana of any color.
// You may spend other mana only as though it were colorless mana.
addCard(Zone.BATTLEFIELD, playerA, "Celestial Dawn", 1);
// Whenever a creature dies, put a charge counter on Black Market.
// At the beginning of your precombat main phase, add {B} to your mana pool for each charge counter on Black Market.
addCard(Zone.BATTLEFIELD, playerA, "Black Market", 1);
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1);
// Artifacts you control are indestructible.
addCard(Zone.HAND, playerA, "Darksteel Forge", 1); // Artifact {9}
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
addCard(Zone.HAND, playerB, "Lightning Bolt", 1);
castSpell(1, PhaseStep.UPKEEP, playerB, "Lightning Bolt", "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Darksteel Forge");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Silvercoat Lion", 1);
assertGraveyardCount(playerB, "Lightning Bolt", 1);
assertCounterCount("Black Market", CounterType.CHARGE, 1);
assertPermanentCount(playerA, "Darksteel Forge", 1);
}
@Test
public void testCelestialDawnAny() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
// Lands you control are Plains.
// Nonland cards you own that aren't on the battlefield, spells you control, and nonland permanents you control are white.
// You may spend white mana as though it were mana of any color.
// You may spend other mana only as though it were colorless mana.
addCard(Zone.BATTLEFIELD, playerA, "Celestial Dawn", 1);
addCard(Zone.HAND, playerA, "Vedalken Mastermind", 1); // Creature {U}{U}
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Vedalken Mastermind");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Vedalken Mastermind", 1);
}
} }

View file

@ -40,6 +40,15 @@ import mage.players.ManaPoolItem;
public interface AsThoughManaEffect extends AsThoughEffect { public interface AsThoughManaEffect extends AsThoughEffect {
// return a mana type that can be used to pay a mana cost instead of the normally needed mana type // return a mana type that can be used to pay a mana cost instead of the normally needed mana type
/**
*
* @param manaType type of mana with which the player wants to pay the cost
* @param mana mana pool item to pay from the cost
* @param affectedControllerId
* @param source
* @param game
* @return
*/
ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game); ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game);
} }

View file

@ -118,7 +118,7 @@ public class ManaPool implements Serializable {
return false; return false;
} }
if (autoPayment && autoPaymentRestricted && !wasManaAddedBeyondStock() && manaType != unlockedManaType) { if (autoPayment && autoPaymentRestricted && !wasManaAddedBeyondStock() && manaType != unlockedManaType) {
// if automatic restricted payment and there is laready mana in the pool // if automatic restricted payment and there is already mana in the pool
// and the needed mana type was not unlocked, nothing will be paid // and the needed mana type was not unlocked, nothing will be paid
return false; return false;
} }