modifications

This commit is contained in:
drmDev 2017-03-05 11:34:10 -05:00
parent c8e41bc002
commit bf5e55aef9

View file

@ -29,12 +29,14 @@ package mage.cards.p;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.common.DestroyMultiTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
/**
@ -43,12 +45,10 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class PhyrexianPurge extends CardImpl {
public int maxTargets = 0;
public PhyrexianPurge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}{R}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}{R}");
// Destroy any number of target creatures.
// Phyrexian Purge costs 3 life more to cast for each target.
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE));
@ -61,8 +61,18 @@ public class PhyrexianPurge extends CardImpl {
if (numTargets > 0) {
ability.getCosts().add(new PayLifeCost(numTargets * 3));
}
}
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability instanceof SpellAbility) {
ability.getTargets().clear();
Player you = game.getPlayer(ownerId);
int maxTargets = you.getLife() / 3;
ability.addTarget(new TargetCreaturePermanent(0, maxTargets));
}
}
public PhyrexianPurge(final PhyrexianPurge card) {
super(card);
}
@ -71,4 +81,4 @@ public class PhyrexianPurge extends CardImpl {
public PhyrexianPurge copy() {
return new PhyrexianPurge(this);
}
}
}