diff --git a/Mage/src/mage/abilities/keyword/MorphAbility.java b/Mage/src/mage/abilities/keyword/MorphAbility.java index c7c667ff2f..f277df9163 100644 --- a/Mage/src/mage/abilities/keyword/MorphAbility.java +++ b/Mage/src/mage/abilities/keyword/MorphAbility.java @@ -142,6 +142,7 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost super(ability); this.alternateCosts.addAll(ability.alternateCosts); this.zoneChangeCounter = ability.zoneChangeCounter; + this.ruleText = ability.ruleText; } private static Costs createCosts(Cost cost) { @@ -224,6 +225,11 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost } } + @Override + public String getRule(boolean all) { + return getRule(); + } + @Override public String getRule() { return ruleText; @@ -292,8 +298,13 @@ class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implements Sour permanent.getColor().setColor(new ObjectColor()); break; case AbilityAddingRemovingEffects_6: + Card card = game.getCard(permanent.getId()); // List abilities = new ArrayList<>(); for (Ability ability : permanent.getAbilities()) { + if (card != null && !card.getAbilities().contains(ability)) { + // gained abilities from other sources won't be removed + continue; + } // TODO: Add flag "works also face down" to ability and use it to control ability removement instead of instanceof check if (ability.getWorksFaceDown()) { ability.setRuleVisible(false); diff --git a/Mage/src/mage/cards/CardImpl.java b/Mage/src/mage/cards/CardImpl.java index c60f3d9adb..8f5af4267c 100644 --- a/Mage/src/mage/cards/CardImpl.java +++ b/Mage/src/mage/cards/CardImpl.java @@ -213,7 +213,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card { @Override public List getRules() { try { - List rules = abilities.getRules(this.name); + List rules = abilities.getRules(this.getLogName()); if (info != null) { for (String data : info.values()) { rules.add(data); diff --git a/Mage/src/mage/game/permanent/PermanentImpl.java b/Mage/src/mage/game/permanent/PermanentImpl.java index 77d6748efa..2b3f2348d2 100644 --- a/Mage/src/mage/game/permanent/PermanentImpl.java +++ b/Mage/src/mage/game/permanent/PermanentImpl.java @@ -51,6 +51,7 @@ import mage.abilities.keyword.LifelinkAbility; import mage.abilities.keyword.ProtectionAbility; import mage.abilities.keyword.ShroudAbility; import mage.abilities.keyword.WitherAbility; +import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.AsThoughEffectType; import mage.constants.CardType; @@ -798,18 +799,23 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { @Override public boolean destroy(UUID sourceId, Game game, boolean noRegen) { //20091005 - 701.6 - //TODO: handle noRegen - if(abilities.containsKey(IndestructibleAbility.getInstance().getId())) { return false; } if (!game.replaceEvent(GameEvent.getEvent(EventType.DESTROY_PERMANENT, objectId, sourceId, controllerId, noRegen ? 1 : 0))) { if (moveToZone(Zone.GRAVEYARD, sourceId, game, false)) { - if (this.getCardType().contains(CardType.CREATURE)) { - game.informPlayers(new StringBuilder(this.getLogName()).append(" died").toString()); + String logName; + Card card = game.getCard(this.getId()); + if (card != null) { + logName = card.getLogName(); } else { - game.informPlayers(new StringBuilder(this.getLogName()).append(" was destroyed").toString()); + logName = this.getLogName(); + } + if (this.getCardType().contains(CardType.CREATURE)) { + game.informPlayers(logName +" died"); + } else { + game.informPlayers(logName + " was destroyed"); } game.fireEvent(GameEvent.getEvent(EventType.DESTROYED_PERMANENT, objectId, sourceId, controllerId)); return true;