From 3c8d43d609102e59ee8ad9aee8c84f4052699428 Mon Sep 17 00:00:00 2001 From: North Date: Sun, 25 Sep 2011 22:14:45 +0300 Subject: [PATCH] Small changes (usage of SpiritWhiteToken, removed unused imports) --- .../src/mage/sets/mirrodin/LuminousAngel.java | 16 +--- .../sets/shadowmoor/SpectralProcession.java | 21 +----- Mage.Sets/src/mage/sets/tenth/Distress.java | 1 + .../src/mage/sets/zendikar/NimbusWings.java | 73 +++---------------- .../abilities/mana/ColorlessManaAbility.java | 1 - .../mage/filter/common/FilterNonlandCard.java | 2 +- 6 files changed, 17 insertions(+), 97 deletions(-) diff --git a/Mage.Sets/src/mage/sets/mirrodin/LuminousAngel.java b/Mage.Sets/src/mage/sets/mirrodin/LuminousAngel.java index 92a65b8f5e..e773d84cd1 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/LuminousAngel.java +++ b/Mage.Sets/src/mage/sets/mirrodin/LuminousAngel.java @@ -37,7 +37,7 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.SpiritWhiteToken; /** * @@ -53,7 +53,7 @@ public class LuminousAngel extends CardImpl { this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new SpiritToken(), 1), Constants.TargetController.YOU, true)); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new SpiritWhiteToken(), 1), Constants.TargetController.YOU, true)); } public LuminousAngel(final LuminousAngel card) { @@ -65,15 +65,3 @@ public class LuminousAngel extends CardImpl { return new LuminousAngel(this); } } - -class SpiritToken extends Token { - public SpiritToken() { - super("Spirit", "a 1/1 white Spirit creature token with flying"); - cardType.add(CardType.CREATURE); - color.setWhite(true); - subtype.add("Spirit"); - power = new MageInt(1); - toughness = new MageInt(1); - this.addAbility(FlyingAbility.getInstance()); - } -} diff --git a/Mage.Sets/src/mage/sets/shadowmoor/SpectralProcession.java b/Mage.Sets/src/mage/sets/shadowmoor/SpectralProcession.java index 8c37119647..a8539da111 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/SpectralProcession.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/SpectralProcession.java @@ -30,11 +30,9 @@ package mage.sets.shadowmoor; import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.MageInt; import mage.abilities.effects.common.CreateTokenEffect; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.game.permanent.token.Token; +import mage.game.permanent.token.SpiritWhiteToken; /** * @@ -49,7 +47,7 @@ public class SpectralProcession extends CardImpl { this.color.setWhite(true); // Put three 1/1 white Spirit creature tokens with flying onto the battlefield. - this.getSpellAbility().addEffect(new CreateTokenEffect(new SpiritToken(), 3)); + this.getSpellAbility().addEffect(new CreateTokenEffect(new SpiritWhiteToken(), 3)); } public SpectralProcession(final SpectralProcession card) { @@ -61,18 +59,3 @@ public class SpectralProcession extends CardImpl { return new SpectralProcession(this); } } - -class SpiritToken extends Token { - - public SpiritToken() { - super("Spirit", "a 1/1 white Spirit creature token with flying"); - cardType.add(CardType.CREATURE); - subtype.add("Spirit"); - - color.setWhite(true); - power = new MageInt(1); - toughness = new MageInt(1); - - this.addAbility(FlyingAbility.getInstance()); - } -} diff --git a/Mage.Sets/src/mage/sets/tenth/Distress.java b/Mage.Sets/src/mage/sets/tenth/Distress.java index bacaa2c397..1b62b01480 100644 --- a/Mage.Sets/src/mage/sets/tenth/Distress.java +++ b/Mage.Sets/src/mage/sets/tenth/Distress.java @@ -101,6 +101,7 @@ class DistressEffect extends OneShotEffect { } } } + return true; } return false; } diff --git a/Mage.Sets/src/mage/sets/zendikar/NimbusWings.java b/Mage.Sets/src/mage/sets/zendikar/NimbusWings.java index 96c0e174dc..9cbbb8260c 100644 --- a/Mage.Sets/src/mage/sets/zendikar/NimbusWings.java +++ b/Mage.Sets/src/mage/sets/zendikar/NimbusWings.java @@ -30,20 +30,19 @@ package mage.sets.zendikar; import java.util.UUID; -import mage.Constants; +import mage.Constants.AttachmentType; import mage.Constants.CardType; import mage.Constants.Duration; +import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.Constants.Zone; -import mage.abilities.Ability; +import mage.abilities.common.AttacksEachTurnStaticAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continious.BoostEnchantedEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; import mage.abilities.keyword.EnchantAbility; -import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -59,12 +58,15 @@ public class NimbusWings extends CardImpl { this.subtype.add("Aura"); this.color.setWhite(true); + // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment)); - Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // Enchanted creature gets +1/+2 and has flying. + SimpleStaticAbility ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 2, Duration.WhileOnBattlefield)); + ability.addEffect(new GainAbilityAttachedEffect(new AttacksEachTurnStaticAbility(), AttachmentType.AURA)); this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NimbusWingsEffect())); } public NimbusWings (final NimbusWings card) { @@ -76,56 +78,3 @@ public class NimbusWings extends CardImpl { return new NimbusWings(this); } } - -class NimbusWingsEffect extends ContinuousEffectImpl { - - public NimbusWingsEffect() { - super(Duration.WhileOnBattlefield, Constants.Outcome.Benefit); - staticText = "Enchanted creature gets +1/+2 and has flying"; - } - - public NimbusWingsEffect(final NimbusWingsEffect effect) { - super(effect); - } - - @Override - public boolean apply(Constants.Layer layer, Constants.SubLayer sublayer, Ability source, Game game) { - Permanent enchantment = game.getPermanent(source.getSourceId()); - if (enchantment != null && enchantment.getAttachedTo() != null) { - Permanent creature = game.getPermanent(enchantment.getAttachedTo()); - if (creature != null) { - switch (layer) { - case PTChangingEffects_7: - if (sublayer == Constants.SubLayer.ModifyPT_7c) { - creature.addPower(1); - creature.addToughness(2); - } - break; - case AbilityAddingRemovingEffects_6: - if (sublayer == Constants.SubLayer.NA) { - creature.addAbility(FlyingAbility.getInstance()); - } - break; - } - return true; - } - } - return false; - } - - @Override - public boolean apply(Game game, Ability source) { - return false; - } - - @Override - public boolean hasLayer(Constants.Layer layer) { - return layer == Constants.Layer.AbilityAddingRemovingEffects_6 || layer == layer.PTChangingEffects_7; - } - - @Override - public NimbusWingsEffect copy() { - return new NimbusWingsEffect(this); - } - -} diff --git a/Mage/src/mage/abilities/mana/ColorlessManaAbility.java b/Mage/src/mage/abilities/mana/ColorlessManaAbility.java index 7485a99502..86cd4d1ca9 100644 --- a/Mage/src/mage/abilities/mana/ColorlessManaAbility.java +++ b/Mage/src/mage/abilities/mana/ColorlessManaAbility.java @@ -30,7 +30,6 @@ package mage.abilities.mana; import mage.Mana; import mage.abilities.effects.common.BasicManaEffect; -import mage.abilities.effects.common.ManaEffect; /** * diff --git a/Mage/src/mage/filter/common/FilterNonlandCard.java b/Mage/src/mage/filter/common/FilterNonlandCard.java index 2050341824..75e73d154d 100644 --- a/Mage/src/mage/filter/common/FilterNonlandCard.java +++ b/Mage/src/mage/filter/common/FilterNonlandCard.java @@ -38,7 +38,7 @@ import mage.filter.FilterCard; public class FilterNonlandCard extends FilterCard { public FilterNonlandCard() { - this("non-land card"); + this("nonland card"); } public FilterNonlandCard(String name) {