mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
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:
@@ -94,14 +94,10 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlay() {
|
public boolean canPlay() {
|
||||||
//Lands do not have SpellPermanents.
|
sourceCard.setState(CardCharacteristicName.FaceDown);
|
||||||
if (sourceCard.isLand()) {
|
boolean success = super.canPlay();
|
||||||
return (sourceCard.getGame().getZoneOf(sourceCard).is(ZoneType.Hand) || sourceCard.hasKeyword("May be played"))
|
sourceCard.setState(CardCharacteristicName.Original);
|
||||||
&& sourceCard.getController().canCastSorcery();
|
return success;
|
||||||
}
|
|
||||||
else {
|
|
||||||
return sourceCard.getSpellPermanent().canPlay();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
|
import forge.card.CardCharacteristicName;
|
||||||
import forge.card.mana.ManaCostShard;
|
import forge.card.mana.ManaCostShard;
|
||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.ability.AbilityUtils;
|
import forge.game.ability.AbilityUtils;
|
||||||
@@ -38,6 +39,7 @@ public class ManaCostAdjustment {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean isStateChangeToFaceDown = false;
|
||||||
if (sa.isSpell()) {
|
if (sa.isSpell()) {
|
||||||
if (sa.isDelve()) {
|
if (sa.isDelve()) {
|
||||||
final Player pc = originalCard.getController();
|
final Player pc = originalCard.getController();
|
||||||
@@ -52,6 +54,10 @@ public class ManaCostAdjustment {
|
|||||||
}
|
}
|
||||||
else if (sa.getHostCard().hasKeyword("Convoke")) {
|
else if (sa.getHostCard().hasKeyword("Convoke")) {
|
||||||
adjustCostByConvoke(cost, sa);
|
adjustCostByConvoke(cost, sa);
|
||||||
|
} else if (((Spell) sa).isCastFaceDown()) {
|
||||||
|
// Turn face down to apply cost modifiers correctly
|
||||||
|
originalCard.setState(CardCharacteristicName.FaceDown);
|
||||||
|
isStateChangeToFaceDown = true;
|
||||||
}
|
}
|
||||||
} // isSpell
|
} // isSpell
|
||||||
|
|
||||||
@@ -97,7 +103,13 @@ public class ManaCostAdjustment {
|
|||||||
for (final StaticAbility stAb : setAbilities) {
|
for (final StaticAbility stAb : setAbilities) {
|
||||||
applyAbility(stAb, "SetCost", sa, cost);
|
applyAbility(stAb, "SetCost", sa, cost);
|
||||||
}
|
}
|
||||||
} // GetSpellCostChange
|
|
||||||
|
// Reset card state (if changed)
|
||||||
|
if (isStateChangeToFaceDown) {
|
||||||
|
originalCard.setState(CardCharacteristicName.Original);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// GetSpellCostChange
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ public abstract class Spell extends SpellAbility implements java.io.Serializable
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// for uncastables like lotus bloom, check if manaCost is blank
|
// for uncastables like lotus bloom, check if manaCost is blank (except for morph spells)
|
||||||
if (isBasicSpell() && card.getManaCost().isNoCost()) {
|
if (!isCastFaceDown() && isBasicSpell() && card.getManaCost().isNoCost()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user