[ONE] Implement Charforger (#9986)

This commit is contained in:
Merlingilb 2023-02-17 23:36:34 +01:00 committed by GitHub
parent 64e438a7aa
commit 5a0fe1266a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 60 additions and 1 deletions

View file

@ -0,0 +1,58 @@
package mage.cards.c;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.PutIntoGraveFromBattlefieldAllTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCounterCost;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.permanent.token.PhyrexianBeastToxicToken;
import mage.game.permanent.token.PhyrexianGoblinToken;
import java.util.UUID;
public class Charforger extends CardImpl {
public Charforger(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{R}");
this.addSubType(SubType.PHYREXIAN);
this.addSubType(SubType.BEAST);
this.power = new MageInt(2);
this. toughness = new MageInt(3);
//When Charforger enters the battlefield, create a 1/1 red Phyrexian Goblin creature token.
this.addAbility(new EntersBattlefieldTriggeredAbility(
new CreateTokenEffect(new PhyrexianGoblinToken())
));
//Whenever another creature or artifact you control is put into a graveyard from the battlefield, put an oil counter on Charforger.
this.addAbility(new PutIntoGraveFromBattlefieldAllTriggeredAbility(
new AddCountersSourceEffect(CounterType.OIL.createInstance()), false,
StaticFilters.FILTER_CONTROLLED_ANOTHER_ARTIFACT_OR_CREATURE, false
));
//Remove three oil counters from Charforger: Exile the top card of your library. You may play that card this turn.
this.addAbility(new SimpleActivatedAbility(new ExileTopXMayPlayUntilEndOfTurnEffect(1)
.setText("Exile the top card of your library. You may play that card this turn"),
new RemoveCountersSourceCost(CounterType.OIL.createInstance(3))
));
}
private Charforger(final Charforger card) {
super(card);
}
@Override
public Charforger copy() {
return new Charforger(this);
}
}

View file

@ -52,6 +52,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet {
cards.add(new SetCardInfo("Cacophony Scamp", 124, Rarity.UNCOMMON, mage.cards.c.CacophonyScamp.class));
cards.add(new SetCardInfo("Cankerbloom", 161, Rarity.UNCOMMON, mage.cards.c.Cankerbloom.class));
cards.add(new SetCardInfo("Cephalopod Sentry", 198, Rarity.UNCOMMON, mage.cards.c.CephalopodSentry.class));
cards.add(new SetCardInfo("Charforger", 199, Rarity.UNCOMMON, mage.cards.c.Charforger.class));
cards.add(new SetCardInfo("Chimney Rabble", 126, Rarity.COMMON, mage.cards.c.ChimneyRabble.class));
cards.add(new SetCardInfo("Chittering Skitterling", 87, Rarity.UNCOMMON, mage.cards.c.ChitteringSkitterling.class));
cards.add(new SetCardInfo("Chrome Prowler", 45, Rarity.COMMON, mage.cards.c.ChromeProwler.class));

View file

@ -407,7 +407,7 @@ public final class StaticFilters {
FILTER_CONTROLLED_ARTIFACT_OR_OTHER_CREATURE.setLockedFilter(true);
}
public static final FilterControlledPermanent FILTER_CONTROLLED_ANOTHER_ARTIFACT_OR_CREATURE = new FilterControlledPermanent("another creature or artifact");
public static final FilterControlledPermanent FILTER_CONTROLLED_ANOTHER_ARTIFACT_OR_CREATURE = new FilterControlledPermanent("another creature or artifact you control");
static {
FILTER_CONTROLLED_ANOTHER_ARTIFACT_OR_CREATURE.add(AnotherPredicate.instance);