Remove dedicated land-morph special casing

This commit is contained in:
Steven Knipe 2023-09-18 06:11:11 -07:00
parent f379319162
commit 3f44e8e0e9

View file

@ -1227,34 +1227,16 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override
public boolean playLand(Card card, Game game, boolean ignoreTiming) {
// Check for alternate casting possibilities: e.g. land with Morph
if (card == null) {
return false;
}
ActivatedAbility playLandAbility = null;
boolean foundAlternative = false;
for (Ability ability : card.getAbilities(game)) {
// if cast for noMana no Alternative costs are allowed
if ((ability instanceof AlternativeSourceCosts)
|| (ability instanceof OptionalAdditionalSourceCosts)) {
foundAlternative = true;
}
if (ability instanceof PlayLandAbility) {
playLandAbility = (ActivatedAbility) ability;
}
}
// try alternative cast (face down)
if (foundAlternative) {
SpellAbility spellAbility = new SpellAbility(null, "",
game.getState().getZone(card.getId()), SpellAbilityType.FACE_DOWN_CREATURE);
spellAbility.setControllerId(this.getId());
spellAbility.setSourceId(card.getId());
if (cast(spellAbility, game, false, null)) {
return true;
}
}
if (playLandAbility == null) {
return false;
}