mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
* Fixed that non creature spells with morph could not be countered with Remove if cast with morph.
This commit is contained in:
parent
8d06c23602
commit
cec9d00a59
3 changed files with 15 additions and 8 deletions
|
@ -100,7 +100,7 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost
|
|||
protected static final String ABILITY_KEYWORD = "Morph";
|
||||
protected static final String ABILITY_KEYWORD_MEGA = "Megamorph";
|
||||
protected static final String REMINDER_TEXT = "<i>(You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)</i>";
|
||||
protected static final String REMINDER_TEXT_MEGA = "<i>(You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its megamorph cost and put a +1/+1 counter on it.)</i>";
|
||||
protected static final String REMINDER_TEXT_MEGA = "<i>(You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its megamorph cost and put a +1/+1 counter on it.)</i>";
|
||||
protected String ruleText;
|
||||
protected AlternativeCost2Impl alternateCosts = new AlternativeCost2Impl(ABILITY_KEYWORD, REMINDER_TEXT, new GenericManaCost(3));
|
||||
protected Costs<Cost> morphCosts;
|
||||
|
@ -194,7 +194,8 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost
|
|||
|
||||
@Override
|
||||
public boolean isAvailable(Ability source, Game game) {
|
||||
return true;
|
||||
return game.isMainPhase() && game.getActivePlayerId().equals(source.getControllerId())
|
||||
&& (game.getStack().isEmpty() || (game.getStack().size() == 1 && game.getStack().getFirst().getSourceId().equals(source.getSourceId())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -282,10 +283,7 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost
|
|||
|
||||
@Override
|
||||
public String getCastMessageSuffix(Game game) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int position = 0;
|
||||
sb.append(alternateCosts.getCastSuffixMessage(position));
|
||||
return sb.toString();
|
||||
return alternateCosts.getCastSuffixMessage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -432,6 +432,13 @@ public class Spell extends StackObjImpl implements Card {
|
|||
|
||||
@Override
|
||||
public String getLogName() {
|
||||
if (faceDown) {
|
||||
if (getCardType().contains(CardType.CREATURE)) {
|
||||
return "face down creature spell";
|
||||
} else {
|
||||
return "face down spell";
|
||||
}
|
||||
}
|
||||
return GameLog.getColoredObjectIdName(card);
|
||||
}
|
||||
|
||||
|
@ -451,7 +458,7 @@ public class Spell extends StackObjImpl implements Card {
|
|||
|
||||
@Override
|
||||
public List<CardType> getCardType() {
|
||||
if (this.getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.FACE_DOWN_CREATURE)) {
|
||||
if (faceDown) {
|
||||
List<CardType> cardTypes = new ArrayList<>();
|
||||
cardTypes.add(CardType.CREATURE);
|
||||
return cardTypes;
|
||||
|
|
|
@ -2768,7 +2768,9 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
case STATIC:
|
||||
if (card.getCardType().contains(CardType.LAND) && ability instanceof AlternativeSourceCosts) {
|
||||
if (canLandPlayAlternateSourceCostsAbility(card, available, ability, game)) { // e.g. Land with Morph
|
||||
playable.add(card.getId());
|
||||
if (game.canPlaySorcery(getId())) {
|
||||
playable.add(card.getId());
|
||||
}
|
||||
break Abilities;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue