[ONE] Implement Porcelain Zealot (#9984)

This commit is contained in:
Sean Walsh 2023-02-17 18:54:52 -06:00 committed by GitHub
parent a31a63e65e
commit 1caee038cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 88 additions and 0 deletions

View file

@ -0,0 +1,87 @@
package mage.cards.p;
import java.util.UUID;
import mage.MageInt;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.keyword.ToxicAbility;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author @stwalsh4118
*/
public final class PorcelainZealot extends CardImpl {
public PorcelainZealot(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.subtype.add(SubType.PHYREXIAN);
this.subtype.add(SubType.SOLDIER);
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// At the beginning of combat on your turn, target creature you control gets +1/+1 until end of turn. If that creature has toxic, instead it gets +2/+2 until end of turn.
Ability ability = new BeginningOfCombatTriggeredAbility(
new PorcelainZealotEffect(),
TargetController.YOU, false);
ability.addTarget(new TargetControlledCreaturePermanent(1, 1));
this.addAbility(ability);
}
private PorcelainZealot(final PorcelainZealot card) {
super(card);
}
@Override
public PorcelainZealot copy() {
return new PorcelainZealot(this);
}
}
class PorcelainZealotEffect extends OneShotEffect {
public PorcelainZealotEffect() {
super(Outcome.Benefit);
this.staticText = "target creature you control gets +1/+1 until end of turn. If that creature has toxic, instead it gets +2/+2 until end of turn.";
}
public PorcelainZealotEffect(final PorcelainZealotEffect effect) {
super(effect);
}
@Override
public PorcelainZealotEffect copy() {
return new PorcelainZealotEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent creature = game.getPermanent(source.getFirstTarget());
if (creature == null) {
return false;
}
Boolean targetHasToxic = creature.getAbilities().containsClass(ToxicAbility.class);
if(targetHasToxic) {
game.addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn), source);
} else {
game.addEffect(new BoostTargetEffect(1, 1, Duration.EndOfTurn), source);
}
return true;
}
}

View file

@ -163,6 +163,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet {
cards.add(new SetCardInfo("Plains", 272, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Planar Disruption", 28, Rarity.COMMON, mage.cards.p.PlanarDisruption.class));
cards.add(new SetCardInfo("Plated Onslaught", 29, Rarity.UNCOMMON, mage.cards.p.PlatedOnslaught.class));
cards.add(new SetCardInfo("Porcelain Zealot", 30, Rarity.UNCOMMON, mage.cards.p.PorcelainZealot.class));
cards.add(new SetCardInfo("Predation Steward", 180, Rarity.COMMON, mage.cards.p.PredationSteward.class));
cards.add(new SetCardInfo("Prologue to Phyresis", 65, Rarity.COMMON, mage.cards.p.PrologueToPhyresis.class));
cards.add(new SetCardInfo("Prophetic Prism", 238, Rarity.COMMON, mage.cards.p.PropheticPrism.class));