[MOM] Implement Bloated Processor

This commit is contained in:
theelk801 2023-04-06 09:00:31 -04:00
parent 80a66ee824
commit 310039cd84
2 changed files with 84 additions and 0 deletions

View file

@ -0,0 +1,83 @@
package mage.cards.b;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.keyword.IncubateEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class BloatedProcessor extends CardImpl {
private static final FilterControlledPermanent filter
= new FilterControlledPermanent(SubType.PHYREXIAN, "another Phyrexian");
static {
filter.add(AnotherPredicate.instance);
}
public BloatedProcessor(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}");
this.subtype.add(SubType.PHYREXIAN);
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// Sacrifice another Phyrexian: Put a +1/+1 counter on Bloated Processor.
this.addAbility(new SimpleActivatedAbility(
new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new SacrificeTargetCost(filter)
));
// When Bloated Processor dies, incubate X, where X is its power.
this.addAbility(new DiesSourceTriggeredAbility(new BloatedProcessorEffect()));
}
private BloatedProcessor(final BloatedProcessor card) {
super(card);
}
@Override
public BloatedProcessor copy() {
return new BloatedProcessor(this);
}
}
class BloatedProcessorEffect extends OneShotEffect {
BloatedProcessorEffect() {
super(Outcome.Benefit);
staticText = "incubate X, where X is its power";
}
private BloatedProcessorEffect(final BloatedProcessorEffect effect) {
super(effect);
}
@Override
public BloatedProcessorEffect copy() {
return new BloatedProcessorEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = source.getSourcePermanentOrLKI(game);
return permanent != null && new IncubateEffect(permanent.getPower().getValue()).apply(game, source);
}
}

View file

@ -39,6 +39,7 @@ public final class MarchOfTheMachine extends ExpansionSet {
cards.add(new SetCardInfo("Beamtown Beatstick", 131, Rarity.COMMON, mage.cards.b.BeamtownBeatstick.class));
cards.add(new SetCardInfo("Bladed Battle-Fan", 91, Rarity.COMMON, mage.cards.b.BladedBattleFan.class));
cards.add(new SetCardInfo("Blighted Burgeoning", 177, Rarity.COMMON, mage.cards.b.BlightedBurgeoning.class));
cards.add(new SetCardInfo("Bloated Processor", 93, Rarity.RARE, mage.cards.b.BloatedProcessor.class));
cards.add(new SetCardInfo("Bloodfell Caves", 267, Rarity.COMMON, mage.cards.b.BloodfellCaves.class));
cards.add(new SetCardInfo("Blossoming Sands", 268, Rarity.COMMON, mage.cards.b.BlossomingSands.class));
cards.add(new SetCardInfo("Bonded Herdbeast", 178, Rarity.COMMON, mage.cards.b.BondedHerdbeast.class));