Implemented Indulging Patrician

This commit is contained in:
Evan Kranzler 2020-06-06 16:48:10 -04:00
parent 218854becd
commit 25f8212aeb
2 changed files with 68 additions and 0 deletions

View file

@ -0,0 +1,67 @@
package mage.cards.i;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.game.Game;
import mage.watchers.common.PlayerGainedLifeWatcher;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class IndulgingPatrician extends CardImpl {
public IndulgingPatrician(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}{B}");
this.subtype.add(SubType.VAMPIRE);
this.subtype.add(SubType.NOBLE);
this.power = new MageInt(1);
this.toughness = new MageInt(4);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Lifelink
this.addAbility(LifelinkAbility.getInstance());
// At the beginning of your end step, if you gained 3 or more life this turn, each opponent loses 3 life.
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new BeginningOfEndStepTriggeredAbility(
new LoseLifeOpponentsEffect(3), TargetController.YOU, false
), IndulgingPatricianCondition.instance, "At the beginning of your end step, " +
"if you gained 3 or more life this turn, each opponent loses 3 life."
), new PlayerGainedLifeWatcher());
}
private IndulgingPatrician(final IndulgingPatrician card) {
super(card);
}
@Override
public IndulgingPatrician copy() {
return new IndulgingPatrician(this);
}
}
enum IndulgingPatricianCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
PlayerGainedLifeWatcher watcher = game.getState().getWatcher(PlayerGainedLifeWatcher.class);
return watcher != null && watcher.getLifeGained(source.getControllerId()) >= 3;
}
}

View file

@ -42,6 +42,7 @@ public final class CoreSet2021 extends ExpansionSet {
cards.add(new SetCardInfo("Fierce Empath", 181, Rarity.UNCOMMON, mage.cards.f.FierceEmpath.class));
cards.add(new SetCardInfo("Gadrak, the Crown-Scourge", 146, Rarity.RARE, mage.cards.g.GadrakTheCrownScourge.class));
cards.add(new SetCardInfo("Grim Tutor", 103, Rarity.MYTHIC, mage.cards.g.GrimTutor.class));
cards.add(new SetCardInfo("Indulging Patrician", 219, Rarity.UNCOMMON, mage.cards.i.IndulgingPatrician.class));
cards.add(new SetCardInfo("Island", 310, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Jeskai Elder", 53, Rarity.UNCOMMON, mage.cards.j.JeskaiElder.class));
cards.add(new SetCardInfo("Llanowar Visionary", 193, Rarity.COMMON, mage.cards.l.LlanowarVisionary.class));