Small changes (usage of SpiritWhiteToken, removed unused imports)

This commit is contained in:
North 2011-09-25 22:14:45 +03:00
parent 025c6b924f
commit 3c8d43d609
6 changed files with 17 additions and 97 deletions

View file

@ -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<LuminousAngel> {
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<LuminousAngel> {
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());
}
}

View file

@ -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<SpectralProcession> {
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<SpectralProcession> {
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());
}
}

View file

@ -101,6 +101,7 @@ class DistressEffect extends OneShotEffect<DistressEffect> {
}
}
}
return true;
}
return false;
}

View file

@ -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<NimbusWings> {
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<NimbusWings> {
return new NimbusWings(this);
}
}
class NimbusWingsEffect extends ContinuousEffectImpl<NimbusWingsEffect> {
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);
}
}

View file

@ -30,7 +30,6 @@ package mage.abilities.mana;
import mage.Mana;
import mage.abilities.effects.common.BasicManaEffect;
import mage.abilities.effects.common.ManaEffect;
/**
*

View file

@ -38,7 +38,7 @@ import mage.filter.FilterCard;
public class FilterNonlandCard extends FilterCard<FilterNonlandCard> {
public FilterNonlandCard() {
this("non-land card");
this("nonland card");
}
public FilterNonlandCard(String name) {