Fix cost changes and play restrictions on morphs.

Dream Chisel now works on all morphs (including Zoetic Cavern), and cards like Meddling Mage don't prohibit the named card to be cast face down.
This commit is contained in:
elcnesh
2014-06-09 20:10:48 +00:00
parent 9807361a39
commit 537a792dcc
3 changed files with 19 additions and 11 deletions

View File

@@ -94,14 +94,10 @@ public class CardFactoryUtil {
@Override
public boolean canPlay() {
//Lands do not have SpellPermanents.
if (sourceCard.isLand()) {
return (sourceCard.getGame().getZoneOf(sourceCard).is(ZoneType.Hand) || sourceCard.hasKeyword("May be played"))
&& sourceCard.getController().canCastSorcery();
}
else {
return sourceCard.getSpellPermanent().canPlay();
}
sourceCard.setState(CardCharacteristicName.FaceDown);
boolean success = super.canPlay();
sourceCard.setState(CardCharacteristicName.Original);
return success;
}
};

View File

@@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils;
import com.google.common.collect.Lists;
import forge.card.CardCharacteristicName;
import forge.card.mana.ManaCostShard;
import forge.game.Game;
import forge.game.ability.AbilityUtils;
@@ -38,6 +39,7 @@ public class ManaCostAdjustment {
return;
}
boolean isStateChangeToFaceDown = false;
if (sa.isSpell()) {
if (sa.isDelve()) {
final Player pc = originalCard.getController();
@@ -52,6 +54,10 @@ public class ManaCostAdjustment {
}
else if (sa.getHostCard().hasKeyword("Convoke")) {
adjustCostByConvoke(cost, sa);
} else if (((Spell) sa).isCastFaceDown()) {
// Turn face down to apply cost modifiers correctly
originalCard.setState(CardCharacteristicName.FaceDown);
isStateChangeToFaceDown = true;
}
} // isSpell
@@ -97,7 +103,13 @@ public class ManaCostAdjustment {
for (final StaticAbility stAb : setAbilities) {
applyAbility(stAb, "SetCost", sa, cost);
}
} // GetSpellCostChange
// Reset card state (if changed)
if (isStateChangeToFaceDown) {
originalCard.setState(CardCharacteristicName.Original);
}
}
// GetSpellCostChange
/**

View File

@@ -89,8 +89,8 @@ public abstract class Spell extends SpellAbility implements java.io.Serializable
return false;
}
// for uncastables like lotus bloom, check if manaCost is blank
if (isBasicSpell() && card.getManaCost().isNoCost()) {
// for uncastables like lotus bloom, check if manaCost is blank (except for morph spells)
if (!isCastFaceDown() && isBasicSpell() && card.getManaCost().isNoCost()) {
return false;
}