fixed Phyrexian Purge text

This commit is contained in:
Evan Kranzler 2017-11-17 20:38:00 -05:00
parent 7292683604
commit b2e4c2cc9d

View file

@ -32,6 +32,7 @@ import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.common.DestroyMultiTargetEffect;
import mage.abilities.effects.common.InfoEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -44,17 +45,17 @@ import mage.target.common.TargetCreaturePermanent;
* @author escplan9 - Derek Monturo
*/
public class PhyrexianPurge extends CardImpl {
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));
this.getSpellAbility().addEffect(new DestroyMultiTargetEffect());
this.getSpellAbility().addEffect(new InfoEffect("<br><br>{this} costs 3 life more to cast for each target"));
}
@Override
public void adjustCosts(Ability ability, Game game) {
int numTargets = ability.getTargets().get(0).getTargets().size();
@ -62,17 +63,17 @@ public class PhyrexianPurge extends CardImpl {
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));
}
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);
}
@ -81,4 +82,4 @@ public class PhyrexianPurge extends CardImpl {
public PhyrexianPurge copy() {
return new PhyrexianPurge(this);
}
}
}