Fixed handling of Werewolf Ransacker triggered ability introduced with last rule text fix of it.

This commit is contained in:
LevelX2 2013-05-24 14:51:14 +02:00
parent 4f8fe8c510
commit b68d3bc6bc
2 changed files with 10 additions and 13 deletions

View file

@ -31,26 +31,15 @@ import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.NoSpellsWereCastLastTurnCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetPermanent;
/**
*
@ -71,6 +60,11 @@ public class AfflictedDeserter extends CardImpl<AfflictedDeserter> {
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// Whenever this creature transforms into Werewolf Ransacker, you may destroy target artifact. If that artifact is put into a graveyard this way, Werewolf Ransacker deals 3 damage to that artifact's controller.
Ability ability1 = new WerewolfRansackerAbility();
ability1.setRuleVisible(false); // rule will be shown only on the other face of the card but triggers only on this side
this.addAbility(ability1);
// At the beginning of each upkeep, if no spells were cast last turn, transform Afflicted Deserter.
this.addAbility(new TransformAbility());
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), Constants.TargetController.ANY, false);

View file

@ -36,6 +36,8 @@ import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.EmptyEffect;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.TwoOrMoreSpellsWereCastLastTurnCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
@ -70,7 +72,7 @@ public class WerewolfRansacker extends CardImpl<WerewolfRansacker> {
this.toughness = new MageInt(4);
// Whenever this creature transforms into Werewolf Ransacker, you may destroy target artifact. If that artifact is put into a graveyard this way, Werewolf Ransacker deals 3 damage to that artifact's controller.
this.addAbility(new WerewolfRansackerAbility());
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new EmptyEffect(WerewolfRansackerAbility.RULE_TEXT)));
// At the beginning of each upkeep, if a player cast two or more spells last turn, transform Werewolf Ransacker.
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), Constants.TargetController.ANY, false);
@ -90,6 +92,7 @@ public class WerewolfRansacker extends CardImpl<WerewolfRansacker> {
class WerewolfRansackerAbility extends TriggeredAbilityImpl<WerewolfRansackerAbility> {
private static final FilterPermanent filter = new FilterPermanent("artifact");
public static final String RULE_TEXT = "Whenever this creature transforms into Werewolf Ransacker, you may destroy target artifact. If that artifact is put into a graveyard this way, Werewolf Ransacker deals 3 damage to that artifact's controller";
static {
filter.add(new CardTypePredicate(CardType.ARTIFACT));
@ -125,7 +128,7 @@ class WerewolfRansackerAbility extends TriggeredAbilityImpl<WerewolfRansackerAbi
@Override
public String getRule() {
return "Whenever this creature transforms into Werewolf Ransacker, you may destroy target artifact. If that artifact is put into a graveyard this way, Werewolf Ransacker deals 3 damage to that artifact's controller.";
return RULE_TEXT + '.';
}
}