From 34442ca00aa5d01dba7be617c4566d419f0c24c4 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 2 Oct 2016 17:42:59 +0200 Subject: [PATCH] Removed unused object. --- .../mage/sets/lorwyn/AshlingsPrerogative.java | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/Mage.Sets/src/mage/sets/lorwyn/AshlingsPrerogative.java b/Mage.Sets/src/mage/sets/lorwyn/AshlingsPrerogative.java index a53b8f7cf44..8b9790c465f 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/AshlingsPrerogative.java +++ b/Mage.Sets/src/mage/sets/lorwyn/AshlingsPrerogative.java @@ -32,6 +32,7 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.ModeChoiceSourceCondition; +import mage.abilities.effects.common.ChooseModeEffect; import mage.abilities.effects.common.PermanentsEnterBattlefieldTappedEffect; import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.abilities.keyword.HasteAbility; @@ -45,29 +46,26 @@ import mage.game.Game; import mage.game.events.EntersTheBattlefieldEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; -import mage.abilities.effects.common.ChooseModeEffect; /** * * @author Eirkei */ -public class AshlingsPrerogative extends CardImpl { +public class AshlingsPrerogative extends CardImpl { - private final static FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("creature"); - public AshlingsPrerogative(UUID ownerId) { super(ownerId, 150, "Ashling's Prerogative", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); this.expansionSetCode = "LRW"; // As Ashling's Prerogative enters the battlefield, choose odd or even. this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Odd or even?", "Odd", "Even"), null, "As {this} enters the battlefield, choose odd or even. (Zero is even.)", "")); - + // Each creature with converted mana cost of the chosen value has haste. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AshlingsPrerogativeCorrectOddityEffect())); // Each creature without converted mana cost of the chosen value enters the battlefield tapped. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AshlingsPrerogativeIncorrectOddityEffect())); - + } public AshlingsPrerogative(final AshlingsPrerogative card) { @@ -81,51 +79,50 @@ public class AshlingsPrerogative extends CardImpl { } class AshlingsPrerogativeIncorrectOddityEffect extends PermanentsEnterBattlefieldTappedEffect { + private static final FilterCreaturePermanent creaturefilter = new FilterCreaturePermanent("Each creature without converted mana cost of the chosen value"); private static final ModeChoiceSourceCondition oddCondition = new ModeChoiceSourceCondition("Odd"); - - public AshlingsPrerogativeIncorrectOddityEffect(){ + + public AshlingsPrerogativeIncorrectOddityEffect() { super(creaturefilter); staticText = "Each creature without converted mana cost of the chosen value enters the battlefield tapped."; } - + @Override public boolean applies(GameEvent event, Ability source, Game game) { int incorrectModResult; - - if (oddCondition.apply(game, source)){ + + if (oddCondition.apply(game, source)) { incorrectModResult = 0; } else { incorrectModResult = 1; } - + Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget(); - + return permanent != null && creaturefilter.match(permanent, game) && permanent.getConvertedManaCost() % 2 == incorrectModResult; } } -class AshlingsPrerogativeCorrectOddityEffect extends GainAbilityAllEffect{ +class AshlingsPrerogativeCorrectOddityEffect extends GainAbilityAllEffect { + private static final FilterCreaturePermanent creaturefilter = new FilterCreaturePermanent("Each creature with converted mana cost of the chosen value"); private static final ModeChoiceSourceCondition oddCondition = new ModeChoiceSourceCondition("Odd"); - - + public AshlingsPrerogativeCorrectOddityEffect() { super(HasteAbility.getInstance(), Duration.WhileOnBattlefield, creaturefilter); staticText = "Each creature with converted mana cost of the chosen value has haste."; } - + @Override protected boolean selectedByRuntimeData(Permanent permanent, Ability source, Game game) { int correctModResult; - - if (oddCondition.apply(game, source)){ + if (oddCondition.apply(game, source)) { correctModResult = 1; } else { correctModResult = 0; } - return permanent != null && creaturefilter.match(permanent, game) && permanent.getConvertedManaCost() % 2 == correctModResult; } - -} \ No newline at end of file + +}