From 68fed320f79a43a4af21ed9238b7659df53a008e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 9 Dec 2014 23:53:49 +0100 Subject: [PATCH] * Bestow Ability - Fixed that a card cast with Bestow will be recognized as Aura for cost reduction (e.g. Hero of Iroas). --- Mage.Sets/src/mage/sets/magic2015/HornetNest.java | 8 ++++---- .../src/mage/sets/portalthreekingdoms/LoyalRetainers.java | 2 +- .../common/DealtDamageToSourceTriggeredAbility.java | 2 +- Mage/src/mage/game/stack/Spell.java | 8 ++++++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magic2015/HornetNest.java b/Mage.Sets/src/mage/sets/magic2015/HornetNest.java index 6093d44701..dea38df950 100644 --- a/Mage.Sets/src/mage/sets/magic2015/HornetNest.java +++ b/Mage.Sets/src/mage/sets/magic2015/HornetNest.java @@ -94,10 +94,10 @@ class HornetNestDealDamageEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - int amount = (Integer) getValue("damage"); - if (amount > 0) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + int amount = (Integer) getValue("damage"); + if (amount > 0) { return new CreateTokenEffect(new HornetNestInsectToken(), amount).apply(game, source); } } diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/LoyalRetainers.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/LoyalRetainers.java index 6b38de6a3e..c1bafe8b01 100644 --- a/Mage.Sets/src/mage/sets/portalthreekingdoms/LoyalRetainers.java +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/LoyalRetainers.java @@ -48,7 +48,7 @@ import mage.target.common.TargetCardInYourGraveyard; */ 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 { filter.add(new SupertypePredicate("Legendary")); diff --git a/Mage/src/mage/abilities/common/DealtDamageToSourceTriggeredAbility.java b/Mage/src/mage/abilities/common/DealtDamageToSourceTriggeredAbility.java index 931f2094af..2ce35dfac6 100644 --- a/Mage/src/mage/abilities/common/DealtDamageToSourceTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DealtDamageToSourceTriggeredAbility.java @@ -57,7 +57,7 @@ public class DealtDamageToSourceTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) { - if (event.getTargetId().equals(this.sourceId)) { + if (event.getTargetId().equals(getSourceId())) { for (Effect effect : this.getEffects()) { effect.setValue("damage", event.getAmount()); } diff --git a/Mage/src/mage/game/stack/Spell.java b/Mage/src/mage/game/stack/Spell.java index 61d6de99bf..7ce5a47cf5 100644 --- a/Mage/src/mage/game/stack/Spell.java +++ b/Mage/src/mage/game/stack/Spell.java @@ -572,6 +572,14 @@ public class Spell implements StackObject, Card { @Override public boolean hasSubtype(String subtype) { + if (this.getSpellAbility() instanceof BestowAbility) { // workaround for Bestow (don't like it) + List subtypes = new ArrayList<>(); + subtypes.addAll(card.getSubtype()); + subtypes.add("Aura"); + if (subtypes.contains(subtype)) { + return true; + } + } return card.hasSubtype(subtype); }