Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 6 additions & 28 deletions Mage.Sets/src/mage/cards/p/PhantasmalForm.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package mage.cards.p;

import mage.MageInt;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect;
import mage.abilities.keyword.FlyingAbility;
Expand All @@ -9,7 +8,7 @@
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.custom.CreatureToken;
import mage.target.common.TargetCreaturePermanent;

import java.util.UUID;
Expand All @@ -24,10 +23,11 @@ public PhantasmalForm(UUID ownerId, CardSetInfo setInfo) {

// Until end of turn, up to two target creatures each have base power and toughness 3/3, gain flying, and become blue Illusions in addition to their other colors and types.
this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(
new PhantasmalFormToken(), false, false, Duration.EndOfTurn
).withDurationRuleAtStart(true).setText("Until end of turn, up to two target creatures each have base power and toughness 3/3, " +
"gain flying, and become blue Illusions in addition to their other colors and types.")
);
new CreatureToken(3, 3, "", SubType.ILLUSION).withColor("U").withAbility(FlyingAbility.getInstance()),
false, false, Duration.EndOfTurn
).withDurationRuleAtStart(true).setText("Until end of turn, up to two target creatures each have base power and toughness 3/3, " +
"gain flying, and become blue Illusions in addition to their other colors and types."
));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2));

// Draw a card.
Expand All @@ -43,25 +43,3 @@ public PhantasmalForm copy() {
return new PhantasmalForm(this);
}
}

class PhantasmalFormToken extends TokenImpl {

PhantasmalFormToken() {
super("", "");
cardType.add(CardType.CREATURE);
subtype.add(SubType.ILLUSION);
color.setBlue(true);
power = new MageInt(3);
toughness = new MageInt(3);

addAbility(FlyingAbility.getInstance());
}

private PhantasmalFormToken(final PhantasmalFormToken token) {
super(token);
}

public PhantasmalFormToken copy() {
return new PhantasmalFormToken(this);
}
}
43 changes: 11 additions & 32 deletions Mage.Sets/src/mage/cards/p/PhantasmalSphere.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import mage.constants.Outcome;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.custom.CreatureToken;
import mage.players.Player;
import mage.target.common.TargetOpponent;
import mage.target.targetpointer.FixedTarget;
Expand All @@ -42,16 +42,15 @@ public PhantasmalSphere(UUID ownerId, CardSetInfo setInfo) {

// At the beginning of your upkeep, put a +1/+1 counter on Phantasmal Sphere, then sacrifice Phantasmal Sphere unless you pay {1} for each +1/+1 counter on it.
Ability ability = new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()));
Effect effect = new SacrificeSourceUnlessPaysEffect(new CountersSourceCount(CounterType.P1P1));
effect.setText("then sacrifice {this} unless you pay {1} for each +1/+1 counter on it.");
Effect effect = new SacrificeSourceUnlessPaysEffect(new CountersSourceCount(CounterType.P1P1))
.setText("then sacrifice {this} unless you pay {1} for each +1/+1 counter on it.");
ability.addEffect(effect);
this.addAbility(ability);

// When Phantasmal Sphere leaves the battlefield, target opponent puts an X/X blue Orb creature token with flying onto the battlefield, where X is the number of +1/+1 counters on Phantasmal Sphere.
Ability ability2 = new LeavesBattlefieldTriggeredAbility(new PhantasmalSphereEffect(), false);
ability2.addTarget(new TargetOpponent());
this.addAbility(ability2);

}

private PhantasmalSphere(final PhantasmalSphere card) {
Expand All @@ -69,8 +68,7 @@ class PhantasmalSphereEffect extends OneShotEffect {
PhantasmalSphereEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "target opponent creates an X/X blue Orb creature token "
+ "with flying, where X is the number "
+ "of +1/+1 counters on {this}";
+ "with flying, where X is the number of +1/+1 counters on {this}";
}

private PhantasmalSphereEffect(final PhantasmalSphereEffect effect) {
Expand All @@ -86,35 +84,16 @@ public PhantasmalSphereEffect copy() {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Player targetOpponent = game.getPlayer(source.getFirstTarget());
if (controller != null
&& targetOpponent != null) {
Effect effect = new CreateTokenTargetEffect(new PhantasmalSphereToken(
new CountersSourceCount(CounterType.P1P1).calculate(
game, source, null)));
if (controller != null && targetOpponent != null) {
int xValue = new CountersSourceCount(CounterType.P1P1).calculate(game, source, null);
Effect effect = new CreateTokenTargetEffect(
new CreatureToken(
xValue, xValue, "X/X blue Orb creature token with flying", SubType.ORB
).withColor("B").withAbility(FlyingAbility.getInstance())
);
effect.setTargetPointer(new FixedTarget(targetOpponent.getId()));
effect.apply(game, source);
}
return false;
}
}

class PhantasmalSphereToken extends TokenImpl {

public PhantasmalSphereToken(int xValue) {
super("Orb Token", "X/X blue Orb creature token with flying");
cardType.add(CardType.CREATURE);
color.setBlue(true);
subtype.add(SubType.ORB);
power = new MageInt(xValue);
toughness = new MageInt(xValue);
addAbility(FlyingAbility.getInstance());
}

private PhantasmalSphereToken(final PhantasmalSphereToken token) {
super(token);
}

public PhantasmalSphereToken copy() {
return new PhantasmalSphereToken(this);
}
}
37 changes: 11 additions & 26 deletions Mage.Sets/src/mage/cards/p/PhyrexianTotem.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package mage.cards.p;

import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealtDamageToSourceTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
Expand All @@ -19,7 +18,7 @@
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.custom.CreatureToken;

import java.util.UUID;

Expand All @@ -35,8 +34,16 @@ public PhyrexianTotem(UUID ownerId, CardSetInfo setInfo) {
this.addAbility(new BlackManaAbility());

// {2}{B}: {this} becomes a 5/5 black Horror artifact creature with trample until end of turn.
this.addAbility(new SimpleActivatedAbility(new BecomesCreatureSourceEffect(
new PhyrexianTotemToken(), CardType.ARTIFACT, Duration.EndOfTurn), new ManaCostsImpl<>("{2}{B}")));
this.addAbility(new SimpleActivatedAbility(
new BecomesCreatureSourceEffect(
new CreatureToken(
5, 5, "5/5 black Horror artifact creature with trample", SubType.HORROR
).withColor("B").withType(CardType.ARTIFACT).withAbility(TrampleAbility.getInstance()),
CardType.ARTIFACT,
Duration.EndOfTurn
),
new ManaCostsImpl<>("{2}{B}")
));

// Whenever {this} is dealt damage, if it's a creature, sacrifice that many permanents.
this.addAbility(new DealtDamageToSourceTriggeredAbility(
Expand All @@ -52,28 +59,6 @@ private PhyrexianTotem(final PhyrexianTotem card) {
public PhyrexianTotem copy() {
return new PhyrexianTotem(this);
}

private static class PhyrexianTotemToken extends TokenImpl {
PhyrexianTotemToken() {
super("Phyrexian Horror", "5/5 black Phyrexian Horror artifact creature with trample");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
color.setBlack(true);
this.subtype.add(SubType.PHYREXIAN);
this.subtype.add(SubType.HORROR);
power = new MageInt(5);
toughness = new MageInt(5);
this.addAbility(TrampleAbility.getInstance());
}

private PhyrexianTotemToken(final PhyrexianTotemToken token) {
super(token);
}

public PhyrexianTotemToken copy() {
return new PhyrexianTotemToken(this);
}
}
}

enum PhyrexianTotemCondition implements Condition {
Expand Down
37 changes: 10 additions & 27 deletions Mage.Sets/src/mage/cards/p/PrimalAdversary.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.custom.CreatureToken;
import mage.target.TargetPermanent;

import java.util.UUID;
Expand All @@ -45,7 +45,7 @@ public PrimalAdversary(UUID ownerId, CardSetInfo setInfo) {
// When you pay this cost one or more times, put that many +1/+1 counters on Primal Adversary,
// then up to that many target lands you control become 3/3 Wolf creatures with haste that are still lands.
this.addAbility(new EntersBattlefieldTriggeredAbility(new DoIfAnyNumberCostPaid(
new PrimalAdversaryEffect(), new ManaCostsImpl<>("{1}{G}")
new PrimalAdversaryEffect(), new ManaCostsImpl<>("{1}{G}")
)));
}

Expand All @@ -64,7 +64,7 @@ class PrimalAdversaryEffect extends OneShotEffect {
PrimalAdversaryEffect() {
super(Outcome.Benefit);
staticText = "put that many +1/+1 counters on {this}, " +
"then up to that many target lands you control become 3/3 Wolf creatures with haste that are still lands";
"then up to that many target lands you control become 3/3 Wolf creatures with haste that are still lands";
}

private PrimalAdversaryEffect(final PrimalAdversaryEffect effect) {
Expand All @@ -83,33 +83,16 @@ public boolean apply(Game game, Ability source) {
return false;
}
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(
new AddCountersSourceEffect(CounterType.P1P1.createInstance(timesPaid)),
false, staticText
new AddCountersSourceEffect(CounterType.P1P1.createInstance(timesPaid)),
false, staticText
);
ability.addEffect(new BecomesCreatureTargetEffect(new PrimalAdversaryToken(), false, true, Duration.Custom));
ability.addEffect(new BecomesCreatureTargetEffect(
new CreatureToken(3, 3, "3/3 Wolf creature with haste that's still a land", SubType.WOLF)
.withAbility(HasteAbility.getInstance()),
false, true, Duration.Custom
));
ability.addTarget(new TargetPermanent(0, timesPaid, StaticFilters.FILTER_CONTROLLED_PERMANENT_LANDS));
game.fireReflexiveTriggeredAbility(ability, source);
return true;
}
}

class PrimalAdversaryToken extends TokenImpl {

public PrimalAdversaryToken() {
super("", "3/3 Wolf creature with haste that's still a land");
this.cardType.add(CardType.CREATURE);
this.subtype.add(SubType.WOLF);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
this.addAbility(HasteAbility.getInstance());
}

private PrimalAdversaryToken(final PrimalAdversaryToken token) {
super(token);
}

@Override
public PrimalAdversaryToken copy() {
return new PrimalAdversaryToken(this);
}
}
31 changes: 8 additions & 23 deletions Mage.Sets/src/mage/cards/q/QuirionDruid.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package mage.cards.q;

import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
Expand All @@ -12,8 +11,7 @@
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.permanent.token.TokenImpl;
import mage.game.permanent.token.custom.CreatureToken;
import mage.target.common.TargetLandPermanent;

import java.util.UUID;
Expand All @@ -35,7 +33,13 @@ public QuirionDruid(UUID ownerId, CardSetInfo setInfo) {
this.toughness = new MageInt(2);

// {G}, {T}: Target land becomes a 2/2 green creature that’s still a land. <i>(This effect lasts indefinitely.)</i>
Ability ability = new SimpleActivatedAbility(new BecomesCreatureTargetEffect(new QuirionDruidToken(), false, true, Duration.Custom), new ManaCostsImpl<>("{G}"));
Ability ability = new SimpleActivatedAbility(
new BecomesCreatureTargetEffect(
new CreatureToken(2, 2, "2/2 green creature").withColor("G"),
false, true, Duration.Custom
),
new ManaCostsImpl<>("{G}")
);
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetLandPermanent());
this.addAbility(ability);
Expand All @@ -50,22 +54,3 @@ public QuirionDruid copy() {
return new QuirionDruid(this);
}
}

class QuirionDruidToken extends TokenImpl {

public QuirionDruidToken() {
super("", "2/2 green creature");
this.color.addColor(ObjectColor.GREEN);
this.cardType.add(CardType.CREATURE);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
}

private QuirionDruidToken(final QuirionDruidToken token) {
super(token);
}

public QuirionDruidToken copy() {
return new QuirionDruidToken(this);
}
}