1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-10 09:11:04 -09:00

Fixed Desolation Angel.

This commit is contained in:
magenoxx 2011-09-14 00:35:59 +04:00
parent cc415c586d
commit 62748c511b

View file

@ -42,28 +42,28 @@ import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.KickerAbility; import mage.abilities.keyword.KickerAbility;
import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
/** /**
*
* @author Loki * @author Loki
*/ */
public class DesolationAngel extends CardImpl<DesolationAngel> { public class DesolationAngel extends CardImpl<DesolationAngel> {
public DesolationAngel (UUID ownerId) { public DesolationAngel(UUID ownerId) {
super(ownerId, 38, "Desolation Angel", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); super(ownerId, 38, "Desolation Angel", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
this.expansionSetCode = "APC"; this.expansionSetCode = "APC";
this.subtype.add("Angel"); this.subtype.add("Angel");
this.color.setBlack(true); this.color.setBlack(true);
this.power = new MageInt(5); this.power = new MageInt(5);
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
this.getSpellAbility().addOptionalCost(new ManaCostsImpl("{W}{W}")); this.getSpellAbility().addOptionalCost(new ManaCostsImpl("{W}{W}"));
this.addAbility(new EntersBattlefieldTriggeredAbility(new DesolationAngelEntersBattlefieldEffect())); this.addAbility(new EntersBattlefieldTriggeredAbility(new DesolationAngelEntersBattlefieldEffect()));
} }
public DesolationAngel (final DesolationAngel card) { public DesolationAngel(final DesolationAngel card) {
super(card); super(card);
} }
@ -105,26 +105,28 @@ class DesolationAngelEntersBattlefieldEffect extends OneShotEffect<DesolationAng
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent p = game.getPermanent(source.getSourceId()); Card p = game.getCard(source.getSourceId());
boolean kicked = false;
if (p != null) { if (p != null) {
boolean kicked = false; for (Object cost : p.getSpellAbility().getOptionalCosts()) {
for (Object cost: p.getSpellAbility().getOptionalCosts()) {
if (cost instanceof ManaCost) { if (cost instanceof ManaCost) {
if (((ManaCost)cost).isPaid()) { if (((ManaCost) cost).isPaid()) {
kicked = true; kicked = true;
} }
} }
} }
for (Permanent permanent : game.getBattlefield().getAllActivePermanents()) { }
if (permanent.getCardType().contains(CardType.LAND)) {
if ((!kicked && permanent.getControllerId() == source.getControllerId()) || kicked) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents()) {
permanent.destroy(source.getSourceId(), game, false); if (permanent.getCardType().contains(CardType.LAND)) {
} if ((!kicked && permanent.getControllerId() == source.getControllerId()) || kicked) {
permanent.destroy(source.getSourceId(), game, false);
} }
} }
return true;
} }
return false;
return true;
} }
@Override @Override