* Bestow Ability - Fixed that a card cast with Bestow will be recognized as Aura for cost reduction (e.g. Hero of Iroas).

This commit is contained in:
LevelX2 2014-12-09 23:53:49 +01:00
parent 72fabb13ac
commit 68fed320f7
4 changed files with 14 additions and 6 deletions

View file

@ -94,10 +94,10 @@ class HornetNestDealDamageEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
int amount = (Integer) getValue("damage");
if (amount > 0) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if (player != null) { if (player != null) {
int amount = (Integer) getValue("damage");
if (amount > 0) {
return new CreateTokenEffect(new HornetNestInsectToken(), amount).apply(game, source); return new CreateTokenEffect(new HornetNestInsectToken(), amount).apply(game, source);
} }
} }

View file

@ -48,7 +48,7 @@ import mage.target.common.TargetCardInYourGraveyard;
*/ */
public class LoyalRetainers extends CardImpl { public class LoyalRetainers extends CardImpl {
private static final FilterCreatureCard filter = new FilterCreatureCard("legendary creature card"); private static final FilterCreatureCard filter = new FilterCreatureCard("legendary creature card from your graveyard");
static { static {
filter.add(new SupertypePredicate("Legendary")); filter.add(new SupertypePredicate("Legendary"));

View file

@ -57,7 +57,7 @@ public class DealtDamageToSourceTriggeredAbility extends TriggeredAbilityImpl {
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) { if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
if (event.getTargetId().equals(this.sourceId)) { if (event.getTargetId().equals(getSourceId())) {
for (Effect effect : this.getEffects()) { for (Effect effect : this.getEffects()) {
effect.setValue("damage", event.getAmount()); effect.setValue("damage", event.getAmount());
} }

View file

@ -572,6 +572,14 @@ public class Spell implements StackObject, Card {
@Override @Override
public boolean hasSubtype(String subtype) { public boolean hasSubtype(String subtype) {
if (this.getSpellAbility() instanceof BestowAbility) { // workaround for Bestow (don't like it)
List<String> subtypes = new ArrayList<>();
subtypes.addAll(card.getSubtype());
subtypes.add("Aura");
if (subtypes.contains(subtype)) {
return true;
}
}
return card.hasSubtype(subtype); return card.hasSubtype(subtype);
} }