[DRC] Rampaging Aetherhood

This commit is contained in:
jmlundeen 2025-03-21 22:56:14 -05:00
parent 7cda312d93
commit 1c71c5b477
2 changed files with 101 additions and 0 deletions

View file

@ -0,0 +1,99 @@
package mage.cards.r;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.PayEnergyCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.abilities.keyword.TrampleAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.keyword.WardAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author Jmlundeen
*/
public final class RampagingAetherhood extends CardImpl {
private static final String energyText = "you get an amount of {E} equal to this creature's power.";
public RampagingAetherhood(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}");
this.subtype.add(SubType.SNAKE);
this.subtype.add(SubType.HYDRA);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Trample
this.addAbility(TrampleAbility.getInstance());
// Ward {2}
this.addAbility(new WardAbility(new ManaCostsImpl<>("{2}")));
// At the beginning of your upkeep, you get an amount of {E} equal to this creature's power. Then you may pay one or more {E}. If you do, put that many +1/+1 counters on this creature.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new RampagingAetherhoodEffect()));
}
private RampagingAetherhood(final RampagingAetherhood card) {
super(card);
}
@Override
public RampagingAetherhood copy() {
return new RampagingAetherhood(this);
}
}
class RampagingAetherhoodEffect extends OneShotEffect {
public RampagingAetherhoodEffect() {
super(Outcome.Benefit);
this.staticText = "you get an amount of {E} equal to this creature's power. " +
"Then you may pay one or more {E}. If you do, put that many +1/+1 counters on this creature.";
}
public RampagingAetherhoodEffect(final RampagingAetherhoodEffect effect) {
super(effect);
}
@Override
public RampagingAetherhoodEffect copy() {
return new RampagingAetherhoodEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
Player controller = game.getPlayer(source.getControllerId());
if (permanent == null || controller == null) {
return false;
}
int amount = permanent.getPower().getValue();
controller.addCounters(CounterType.ENERGY.createInstance(amount), source.getControllerId(), source, game);
int totalEnergy = controller.getCountersCount(CounterType.ENERGY);
if (totalEnergy > 0) {
if (controller.chooseUse(Outcome.Benefit, "Pay one or more {E}? Put that many +1/+1 counters on this creature", source, game)) {
int energyToPay = controller.getAmount(1, totalEnergy, "Pay one or more {E}", game);
Cost cost = new PayEnergyCost(energyToPay);
if (cost.pay(source, game, source, controller.getId(), true)) {
new AddCountersSourceEffect(CounterType.P1P1.createInstance(energyToPay), true).apply(game, source);
return true;
}
}
}
return false;
}
}

View file

@ -131,6 +131,8 @@ public final class AetherdriftCommander extends ExpansionSet {
cards.add(new SetCardInfo("Priest of the Crossing", 22, Rarity.RARE, mage.cards.p.PriestOfTheCrossing.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Prophet of the Scarab", 9, Rarity.RARE, mage.cards.p.ProphetOfTheScarab.class));
cards.add(new SetCardInfo("Pull from Tomorrow", 81, Rarity.RARE, mage.cards.p.PullFromTomorrow.class));
cards.add(new SetCardInfo("Rampaging Aetherhood", 15, Rarity.RARE, mage.cards.r.RampagingAetherhood.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Rampaging Aetherhood", 31, Rarity.RARE, mage.cards.r.RampagingAetherhood.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Reality Shift", 39, Rarity.UNCOMMON, mage.cards.r.RealityShift.class));
cards.add(new SetCardInfo("Reckless Fireweaver", 106, Rarity.COMMON, mage.cards.r.RecklessFireweaver.class));
cards.add(new SetCardInfo("Retrofitter Foundry", 136, Rarity.RARE, mage.cards.r.RetrofitterFoundry.class));