[ONE] Implement Bloated Contaminator

This commit is contained in:
theelk801 2023-01-14 12:12:24 -05:00
parent c1d425ba09
commit 4acd7d6604
5 changed files with 95 additions and 0 deletions

View file

@ -0,0 +1,46 @@
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.common.counter.ProliferateEffect;
import mage.constants.SubType;
import mage.abilities.keyword.TrampleAbility;
import mage.abilities.keyword.ToxicAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
/**
* @author TheElk801
*/
public final class BloatedContaminator extends CardImpl {
public BloatedContaminator(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.subtype.add(SubType.PHYREXIAN);
this.subtype.add(SubType.BEAST);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Trample
this.addAbility(TrampleAbility.getInstance());
// Toxic 1
this.addAbility(new ToxicAbility(1));
// Whenever Bloated Contaminator deals combat damage to a player, proliferate.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ProliferateEffect(), false));
}
private BloatedContaminator(final BloatedContaminator card) {
super(card);
}
@Override
public BloatedContaminator copy() {
return new BloatedContaminator(this);
}
}

View file

@ -21,6 +21,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet {
this.hasBoosters = false; // temporary
cards.add(new SetCardInfo("Blackcleave Cliffs", 248, Rarity.RARE, mage.cards.b.BlackcleaveCliffs.class));
cards.add(new SetCardInfo("Bloated Contaminator", 159, Rarity.RARE, mage.cards.b.BloatedContaminator.class));
cards.add(new SetCardInfo("Blue Sun's Twilight", 43, Rarity.RARE, mage.cards.b.BlueSunsTwilight.class));
cards.add(new SetCardInfo("Copperline Gorge", 249, Rarity.RARE, mage.cards.c.CopperlineGorge.class));
cards.add(new SetCardInfo("Dragonwing Glider", 126, Rarity.RARE, mage.cards.d.DragonwingGlider.class));

View file

@ -0,0 +1,40 @@
package mage.abilities.keyword;
import mage.abilities.MageSingleton;
import mage.abilities.StaticAbility;
import mage.abilities.icon.abilities.InfectAbilityIcon;
import mage.constants.Zone;
import java.io.ObjectStreamException;
/**
* @author TheElk801
*/
public class ToxicAbility extends StaticAbility {
private final int amount;
public ToxicAbility(int amount) {
super(Zone.BATTLEFIELD, null);
this.amount = amount;
}
private ToxicAbility(final ToxicAbility ability) {
super(ability);
this.amount = ability.amount;
}
@Override
public String getRule() {
return "toxic " + amount + " <i>(Players dealt combat damage by this creature also get a poison counter.)</i>";
}
@Override
public ToxicAbility copy() {
return new ToxicAbility(this);
}
public int getAmount() {
return amount;
}
}

View file

@ -2178,6 +2178,13 @@ public abstract class PlayerImpl implements Player, Serializable {
player.gainLife(actualDamage, game, source);
}
}
if (combatDamage && sourceAbilities != null && sourceAbilities.containsClass(ToxicAbility.class)) {
int counters = CardUtil
.castStream(sourceAbilities.stream(), ToxicAbility.class)
.mapToInt(ToxicAbility::getAmount)
.sum();
addCounters(CounterType.POISON.createInstance(counters), sourceControllerId, source, game);
}
// Unstable ability - Earl of Squirrel
if (sourceAbilities != null && sourceAbilities.containsKey(SquirrellinkAbility.getInstance().getId())) {
Player player = game.getPlayer(sourceControllerId);

View file

@ -116,6 +116,7 @@ Suspend|number, cost, card|
Swampcycling|cost|
Swampwalk|new|
Totem armor|new|
Toxic|number|
Training|new|
Trample|instance|
Tribute|number|