* Bestow - Fixed that a permanent card cast with bestow has the bestow ability as spell ability.

This commit is contained in:
LevelX2 2015-02-03 01:40:08 +01:00
parent 6e45f70335
commit 4efc2a7582
4 changed files with 14 additions and 2 deletions

View file

@ -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");
}
}

View file

@ -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<String> getRules();
List<Watcher> getWatchers();

View file

@ -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;
}
}

View file

@ -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.");
}
}