From 60bc03e2843219bc5dcb59f7c33c798b9ac97a0b Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 9 Feb 2016 12:37:20 +0100 Subject: [PATCH] [SOI] Fixed to Skulk and Investigate. Some minor tweaks to SOI cards. --- .../DuskwatchRecruiter.java | 20 +++---- .../sets/shadowsoverinnistrad/ExposeEvil.java | 4 +- .../FurtiveHomunculus.java | 2 +- .../HoundOfTheFarbogs.java | 12 ++-- .../KrallenhordeHowler.java | 6 +- .../StructuralDistortion.java | 57 ++++--------------- .../condition/common/DeliriumCondition.java | 6 +- .../effects/keyword/InvestigateEffect.java | 12 +--- .../mage/abilities/keyword/SkulkAbility.java | 5 +- .../mage/game/permanent/token/DevilToken.java | 8 +-- 10 files changed, 44 insertions(+), 88 deletions(-) diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/DuskwatchRecruiter.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/DuskwatchRecruiter.java index 21b390a9ce..3f074a1102 100644 --- a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/DuskwatchRecruiter.java +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/DuskwatchRecruiter.java @@ -44,19 +44,13 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.TargetController; import mage.constants.Zone; -import mage.filter.FilterCard; -import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.common.FilterCreatureCard; /** * * @author fireshoes */ public class DuskwatchRecruiter extends CardImpl { - - private static final FilterCard filter = new FilterCard("a creature card"); - static { - filter.add(new CardTypePredicate(CardType.CREATURE)); - } public DuskwatchRecruiter(UUID ownerId) { super(ownerId, 203, "Duskwatch Recruiter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); @@ -64,19 +58,19 @@ public class DuskwatchRecruiter extends CardImpl { this.subtype.add("Human"); this.subtype.add("Warrior"); this.subtype.add("Werewolf"); - + this.canTransform = true; this.secondSideCard = new KrallenhordeHowler(ownerId); - + this.power = new MageInt(2); this.toughness = new MageInt(2); - // {2}{G}: Look at the top three cards of your library. You may reveal a creature card from among them and put it into your hand. + // {2}{G}: Look at the top three cards of your library. You may reveal a creature card from among them and put it into your hand. // Put the rest on the bottom of your library in any order. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, - new LookLibraryAndPickControllerEffect(new StaticValue(3), false, new StaticValue(1), filter, false), + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, + new LookLibraryAndPickControllerEffect(new StaticValue(3), false, new StaticValue(1), new FilterCreatureCard("a creature card"), false), new ManaCostsImpl("{2}{G}"))); - + // At the beginning of each upkeep, if no spells were cast last turn, transform Duskwatch Recruiter. this.addAbility(new TransformAbility()); TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(true), TargetController.ANY, false); diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ExposeEvil.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ExposeEvil.java index 95b07808b5..cd335b1eb2 100644 --- a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ExposeEvil.java +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/ExposeEvil.java @@ -48,8 +48,8 @@ public class ExposeEvil extends CardImpl { // Tap up to two target creatures. this.getSpellAbility().addEffect(new TapTargetEffect()); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); - - // Investigate. + + // Investigate (Put a colorless Clue artifact token onto the battlefield with \"{2}, Sacrifice this artifact: Draw a card.\") this.getSpellAbility().addEffect(new InvestigateEffect()); } diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/FurtiveHomunculus.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/FurtiveHomunculus.java index ad04a1c856..2487e22f6f 100644 --- a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/FurtiveHomunculus.java +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/FurtiveHomunculus.java @@ -47,7 +47,7 @@ public class FurtiveHomunculus extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); - // Skulk + // Skulk (This creature can't be blocked by creatures with greater power.) this.addAbility(new SkulkAbility()); } diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/HoundOfTheFarbogs.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/HoundOfTheFarbogs.java index 3390f3c6cb..05a2fa8d44 100644 --- a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/HoundOfTheFarbogs.java +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/HoundOfTheFarbogs.java @@ -29,12 +29,14 @@ package mage.sets.shadowsoverinnistrad; import java.util.UUID; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.DeliriumCondition; import mage.abilities.decorator.ConditionalContinuousEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; import mage.abilities.keyword.MenaceAbility; import mage.cards.CardImpl; +import mage.constants.AbilityWord; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; @@ -45,8 +47,8 @@ import mage.constants.Zone; * @author fireshoes */ public class HoundOfTheFarbogs extends CardImpl { - - final static private String rule = "{this} has menace as long as there are four or more card types among cards in your graveyard"; + + final static private String RULE = "{this} has menace as long as there are four or more card types among cards in your graveyard"; public HoundOfTheFarbogs(UUID ownerId) { super(ownerId, 117, "Hound of the Farbogs", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); @@ -57,8 +59,10 @@ public class HoundOfTheFarbogs extends CardImpl { this.toughness = new MageInt(3); // Delirium — Hound of the Farborgs has menace as long as there are four or more card types among cards in your graveyard. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, - new ConditionalContinuousEffect(new GainAbilitySourceEffect(new MenaceAbility(), Duration.WhileOnBattlefield), new DeliriumCondition(), rule))); + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinuousEffect(new GainAbilitySourceEffect(new MenaceAbility(), Duration.WhileOnBattlefield), new DeliriumCondition(), RULE)); + ability.setAbilityWord(AbilityWord.DELIRIUM); + this.addAbility(ability); } public HoundOfTheFarbogs(final HoundOfTheFarbogs card) { diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/KrallenhordeHowler.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/KrallenhordeHowler.java index e90d7fe011..b870c41f65 100644 --- a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/KrallenhordeHowler.java +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/KrallenhordeHowler.java @@ -52,10 +52,10 @@ import mage.filter.predicate.mageobject.CardTypePredicate; */ public class KrallenhordeHowler extends CardImpl { - private static final FilterCard filter = new FilterCard("Creature spells"); + private static final FilterCard FILTER = new FilterCard("Creature spells"); static { - filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE))); + FILTER.add(Predicates.or(new CardTypePredicate(CardType.CREATURE))); } public KrallenhordeHowler(UUID ownerId) { @@ -71,7 +71,7 @@ public class KrallenhordeHowler extends CardImpl { this.canTransform = true; // Creature spells you cast cost {1} less to cast. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionControllerEffect(filter, 1))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionControllerEffect(FILTER, 1))); // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Krallenhorde Howler. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(new TransformSourceEffect(false), TargetController.ANY, false); diff --git a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/StructuralDistortion.java b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/StructuralDistortion.java index d4b29686dc..6923b04900 100644 --- a/Mage.Sets/src/mage/sets/shadowsoverinnistrad/StructuralDistortion.java +++ b/Mage.Sets/src/mage/sets/shadowsoverinnistrad/StructuralDistortion.java @@ -28,19 +28,15 @@ package mage.sets.shadowsoverinnistrad; import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DamageTargetControllerEffect; +import mage.abilities.effects.common.ExileTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Rarity; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.CardTypePredicate; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.Target; import mage.target.TargetPermanent; /** @@ -48,11 +44,11 @@ import mage.target.TargetPermanent; * @author fireshoes */ public class StructuralDistortion extends CardImpl { - - private static final FilterPermanent filter = new FilterPermanent("artifact or land"); - + + private static final FilterPermanent FILTER = new FilterPermanent("artifact or land"); + static { - filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT),new CardTypePredicate(CardType.LAND))); + FILTER.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.LAND))); } public StructuralDistortion(UUID ownerId) { @@ -60,9 +56,11 @@ public class StructuralDistortion extends CardImpl { this.expansionSetCode = "SOI"; // Exile target artifact or land. Structural Distortion deals 2 damage to that permanent's controller. - this.getSpellAbility().addEffect(new StructuralDistortionEffect()); - Target target = new TargetPermanent(filter); - this.getSpellAbility().addTarget(target); + this.getSpellAbility().addEffect(new ExileTargetEffect()); + Effect effect = new DamageTargetControllerEffect(2); + effect.setText("{this} deals 2 damage to that permanent's controller"); + this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addTarget(new TargetPermanent(FILTER)); } public StructuralDistortion(final StructuralDistortion card) { @@ -74,34 +72,3 @@ public class StructuralDistortion extends CardImpl { return new StructuralDistortion(this); } } - -class StructuralDistortionEffect extends OneShotEffect { - - public StructuralDistortionEffect() { - super(Outcome.DestroyPermanent); - this.staticText = "Exile target artifact or land. {this} deals 2 damage to that permanent's controller"; - } - - public StructuralDistortionEffect(final StructuralDistortionEffect effect) { - super(effect); - } - - @Override - public StructuralDistortionEffect copy() { - return new StructuralDistortionEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source)); - if (permanent != null) { - permanent.moveToExile(source.getSourceId(), null, source.getSourceId(), game); - Player permController = game.getPlayer(permanent.getControllerId()); - if (permController != null) { - permController.damage(2, source.getSourceId(), game, false, true); - return true; - } - } - return false; - } -} diff --git a/Mage/src/main/java/mage/abilities/condition/common/DeliriumCondition.java b/Mage/src/main/java/mage/abilities/condition/common/DeliriumCondition.java index 75c826dd14..0740f26ad2 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/DeliriumCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/DeliriumCondition.java @@ -38,14 +38,14 @@ import mage.players.Player; /** * * - * @author fireshoes + * @author fireshoes */ public class DeliriumCondition implements Condition { - private static DeliriumCondition fInstance = new DeliriumCondition(); + private final static DeliriumCondition INSTANCE = new DeliriumCondition(); public static Condition getInstance() { - return fInstance; + return INSTANCE; } @Override diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/InvestigateEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/InvestigateEffect.java index 24f1385a9a..bd29fc5820 100644 --- a/Mage/src/main/java/mage/abilities/effects/keyword/InvestigateEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/keyword/InvestigateEffect.java @@ -9,22 +9,20 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.constants.CardType; -import mage.constants.Outcome; import mage.constants.Zone; -import mage.game.Game; import mage.game.permanent.token.Token; /** * * @author LevelX2 */ -public class InvestigateEffect extends OneShotEffect { +public class InvestigateEffect extends CreateTokenEffect { public InvestigateEffect() { - super(Outcome.PutCreatureInPlay); + super(new ClueArtifactToken()); this.staticText = "Investigate. (Put a colorless Clue artifact token onto the battlefield with \"{2}, Sacrifice this artifact: Draw a card.\")"; } @@ -37,10 +35,6 @@ public class InvestigateEffect extends OneShotEffect { return new InvestigateEffect(this); } - @Override - public boolean apply(Game game, Ability source) { - return false; - } } class ClueArtifactToken extends Token { diff --git a/Mage/src/main/java/mage/abilities/keyword/SkulkAbility.java b/Mage/src/main/java/mage/abilities/keyword/SkulkAbility.java index d23e521637..a0ac7de35d 100644 --- a/Mage/src/main/java/mage/abilities/keyword/SkulkAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/SkulkAbility.java @@ -52,13 +52,12 @@ class SkulkEffect extends RestrictionEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - return !permanent.getControllerId().equals(source.getControllerId()); + return permanent.getId().equals(source.getSourceId()); } @Override public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { - return blocker.getId().equals(source.getSourceId()) - && blocker.getPower().getValue() >= attacker.getPower().getValue(); + return blocker.getPower().getValue() <= attacker.getPower().getValue(); } @Override diff --git a/Mage/src/main/java/mage/game/permanent/token/DevilToken.java b/Mage/src/main/java/mage/game/permanent/token/DevilToken.java index 0bb7dd10d3..5072881c9b 100644 --- a/Mage/src/main/java/mage/game/permanent/token/DevilToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/DevilToken.java @@ -27,8 +27,7 @@ */ package mage.game.permanent.token; -import java.util.ArrayList; -import java.util.List; +import java.util.Arrays; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.DiesTriggeredAbility; @@ -43,17 +42,16 @@ import mage.target.common.TargetCreatureOrPlayer; */ public class DevilToken extends Token { - final static private List tokenImageSets = new ArrayList<>(); - public DevilToken() { super("Devil", "1/1 red Devil creature with \"When this creature dies, it deals 1 damage to target creature or player.\""); + availableImageSetCodes.addAll(Arrays.asList("SOI")); cardType.add(CardType.CREATURE); subtype.add("Devil"); color.setRed(true); power = new MageInt(1); toughness = new MageInt(1); Effect effect = new DamageTargetEffect(1); - effect.setText("When {this} dies, it deals 1 damage to target creature or player"); + effect.setText("it deals 1 damage to target creature or player"); Ability ability = new DiesTriggeredAbility(effect); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability);