From 4efc2a75823dc93e50cf50b43490306b9499bdc6 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 3 Feb 2015 01:40:08 +0100 Subject: [PATCH] * Bestow - Fixed that a permanent card cast with bestow has the bestow ability as spell ability. --- Mage/src/mage/abilities/keyword/BestowAbility.java | 1 - Mage/src/mage/cards/Card.java | 1 + Mage/src/mage/cards/CardImpl.java | 6 ++++++ Mage/src/mage/game/stack/Spell.java | 8 +++++++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Mage/src/mage/abilities/keyword/BestowAbility.java b/Mage/src/mage/abilities/keyword/BestowAbility.java index 3e59a0c83a0..6f933711cc3 100644 --- a/Mage/src/mage/abilities/keyword/BestowAbility.java +++ b/Mage/src/mage/abilities/keyword/BestowAbility.java @@ -168,7 +168,6 @@ class BestowTypeChangingEffect extends ContinuousEffectImpl implements SourceEff permanent.getCardType().remove(CardType.CREATURE); permanent.getSubtype().clear(); if (!permanent.getSubtype().contains("Aura")) { - permanent.getSubtype().add("Aura"); } } diff --git a/Mage/src/mage/cards/Card.java b/Mage/src/mage/cards/Card.java index 006601129a6..d08f7796e04 100644 --- a/Mage/src/mage/cards/Card.java +++ b/Mage/src/mage/cards/Card.java @@ -53,6 +53,7 @@ public interface Card extends MageObject { void setOwnerId(UUID ownerId); void addAbility(Ability ability); void addWatcher(Watcher watcher); + void setSpellAbility(SpellAbility ability); SpellAbility getSpellAbility(); List getRules(); List getWatchers(); diff --git a/Mage/src/mage/cards/CardImpl.java b/Mage/src/mage/cards/CardImpl.java index c37202f14ba..a157a59e86b 100644 --- a/Mage/src/mage/cards/CardImpl.java +++ b/Mage/src/mage/cards/CardImpl.java @@ -789,4 +789,10 @@ public abstract class CardImpl extends MageObjectImpl implements Card { public void setZone(Zone zone, Game game) { game.setZone(getId(), zone); } + + @Override + public void setSpellAbility(SpellAbility ability) { + spellAbility = ability; + } + } diff --git a/Mage/src/mage/game/stack/Spell.java b/Mage/src/mage/game/stack/Spell.java index 36788c92a6a..1a2ac5e69df 100644 --- a/Mage/src/mage/game/stack/Spell.java +++ b/Mage/src/mage/game/stack/Spell.java @@ -235,7 +235,8 @@ public class Spell implements StackObject, Card { // TODO: Find a better way to prevent bestow creatures from being effected by creature affecting abilities Permanent permanent = game.getPermanent(card.getId()); if (permanent != null && permanent instanceof PermanentCard) { - ((PermanentCard) permanent).getCard().getCardType().add(CardType.CREATURE); + permanent.setSpellAbility(ability); // otherwise spell ability without bestow will be set + ((PermanentCard) permanent).getCard().getCardType().add(CardType.CREATURE); } card.getCardType().add(CardType.CREATURE); } @@ -1009,4 +1010,9 @@ public class Spell implements StackObject, Card { card.setZone(zone, game); } + @Override + public void setSpellAbility(SpellAbility ability) { + throw new UnsupportedOperationException("Not supported."); + } + }