From 222b74c8eaabaaa46bb094ead2d457191da30f4f Mon Sep 17 00:00:00 2001 From: Plopman Date: Mon, 5 Nov 2012 15:41:58 +0100 Subject: [PATCH] Fixed Double face cards triggerd ability and Moonscarred Werewolf. Issue #55 --- .../src/mage/sets/darkascension/MoonscarredWerewolf.java | 4 ++-- Mage/src/mage/abilities/TriggeredAbilities.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/sets/darkascension/MoonscarredWerewolf.java b/Mage.Sets/src/mage/sets/darkascension/MoonscarredWerewolf.java index 300f790cf4..f2e20df447 100644 --- a/Mage.Sets/src/mage/sets/darkascension/MoonscarredWerewolf.java +++ b/Mage.Sets/src/mage/sets/darkascension/MoonscarredWerewolf.java @@ -36,7 +36,6 @@ import mage.MageInt; import mage.Mana; import mage.abilities.TriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.condition.common.TwoOrMoreSpellsWereCastLastTurnCondition; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.decorator.ConditionalTriggeredAbility; @@ -44,6 +43,7 @@ import mage.abilities.effects.common.BasicManaEffect; import mage.abilities.effects.common.TransformSourceEffect; import mage.abilities.keyword.TransformAbility; import mage.abilities.keyword.VigilanceAbility; +import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; /** @@ -67,7 +67,7 @@ public class MoonscarredWerewolf extends CardImpl { this.addAbility(VigilanceAbility.getInstance()); // {tap}: Add {G}{G} to your mana pool. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.GreenMana(2)), new TapSourceCost())); + this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new BasicManaEffect(Mana.GreenMana(2)), new TapSourceCost())); // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Moonscarred Werewolf. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); this.addAbility(new ConditionalTriggeredAbility(ability, diff --git a/Mage/src/mage/abilities/TriggeredAbilities.java b/Mage/src/mage/abilities/TriggeredAbilities.java index 3f8afcc8c7..ba3fc39f1c 100644 --- a/Mage/src/mage/abilities/TriggeredAbilities.java +++ b/Mage/src/mage/abilities/TriggeredAbilities.java @@ -57,7 +57,7 @@ public class TriggeredAbilities extends HashMap { if (ability.isInUseableZone(game, null, true)) { MageObject object = getMageObject(event, game, ability); if (object != null) { - if (checkAbilityStillExists(ability, object)) { + if (checkAbilityStillExists(ability, event, object)) { if (object instanceof Permanent) { ability.setControllerId(((Permanent) object).getControllerId()); } @@ -71,14 +71,14 @@ public class TriggeredAbilities extends HashMap { } } - private boolean checkAbilityStillExists(TriggeredAbility ability, MageObject object) { + private boolean checkAbilityStillExists(TriggeredAbility ability, GameEvent event, MageObject object) { boolean exists = true; if (!object.getAbilities().contains(ability)) { exists = false; if (object instanceof PermanentCard) { PermanentCard permanent = (PermanentCard)object; - if (permanent.canTransform()) { - exists = permanent.getCard().getAbilities().contains(ability); + if (permanent.canTransform() && event.getType() == GameEvent.EventType.TRANSFORMED) { + exists = permanent.getCard().getAbilities().contains(ability); } } }