[ONE] Implement Feed the Infection

This commit is contained in:
theelk801 2023-01-21 10:48:01 -05:00
parent e3f342cd45
commit dcdd596e7d
2 changed files with 72 additions and 0 deletions

View file

@ -0,0 +1,71 @@
package mage.cards.f;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AbilityWord;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.counters.CounterType;
import mage.game.Game;
import mage.players.Player;
/**
* @author TheElk801
*/
public final class FeedTheInfection extends CardImpl {
public FeedTheInfection(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}");
// You draw three cards and lose 3 life.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3, "you"));
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(3).concatBy("and"));
// Corrupted -- Each opponent with three or more poison counters loses 3 life.
this.getSpellAbility().addEffect(new FeedTheInfectionEffect());
}
private FeedTheInfection(final FeedTheInfection card) {
super(card);
}
@Override
public FeedTheInfection copy() {
return new FeedTheInfection(this);
}
}
class FeedTheInfectionEffect extends OneShotEffect {
FeedTheInfectionEffect() {
super(Outcome.Benefit);
staticText = "<br>" + AbilityWord.CORRUPTED.formatWord() +
"Each opponent with three or more poison counters loses 3 life";
}
private FeedTheInfectionEffect(final FeedTheInfectionEffect effect) {
super(effect);
}
@Override
public FeedTheInfectionEffect copy() {
return new FeedTheInfectionEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
for (UUID playerId : game.getOpponents(source.getControllerId())) {
Player player = game.getPlayer(playerId);
if (player != null && player.getCounters().getCount(CounterType.POISON) >= 3) {
player.loseLife(3, game, source, false);
}
}
return true;
}
}

View file

@ -43,6 +43,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet {
cards.add(new SetCardInfo("Evolved Spinoderm", 166, Rarity.RARE, mage.cards.e.EvolvedSpinoderm.class));
cards.add(new SetCardInfo("Experimental Augury", 49, Rarity.COMMON, mage.cards.e.ExperimentalAugury.class));
cards.add(new SetCardInfo("Ezuri, Stalker of Spheres", 201, Rarity.RARE, mage.cards.e.EzuriStalkerOfSpheres.class));
cards.add(new SetCardInfo("Feed the Infection", 93, Rarity.UNCOMMON, mage.cards.f.FeedTheInfection.class));
cards.add(new SetCardInfo("Forest", 276, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Furnace Skullbomb", 228, Rarity.COMMON, mage.cards.f.FurnaceSkullbomb.class));
cards.add(new SetCardInfo("Graaz, Unstoppable Juggernaut", 229, Rarity.RARE, mage.cards.g.GraazUnstoppableJuggernaut.class));