[DSK] Implement Valgavoth's Onslaught

This commit is contained in:
theelk801 2024-09-09 12:04:01 -04:00
parent be0fac2e6d
commit 176c4369a1
2 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,77 @@
package mage.cards.v;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.keyword.ManifestDreadEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.util.CardUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ValgavothsOnslaught extends CardImpl {
public ValgavothsOnslaught(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{G}");
// Manifest dread X times, then put X +1/+1 counters on each of those creatures.
this.getSpellAbility().addEffect(new ValgavothsOnslaughtEffect());
}
private ValgavothsOnslaught(final ValgavothsOnslaught card) {
super(card);
}
@Override
public ValgavothsOnslaught copy() {
return new ValgavothsOnslaught(this);
}
}
class ValgavothsOnslaughtEffect extends OneShotEffect {
ValgavothsOnslaughtEffect() {
super(Outcome.Benefit);
staticText = "manifest dread X times, then put X +1/+1 counters on each of those creatures";
}
private ValgavothsOnslaughtEffect(final ValgavothsOnslaughtEffect effect) {
super(effect);
}
@Override
public ValgavothsOnslaughtEffect copy() {
return new ValgavothsOnslaughtEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
int amount = CardUtil.getSourceCostsTag(game, source, "X", 0);
if (player == null || amount < 1) {
return false;
}
List<Permanent> permanents = new ArrayList<>();
for (int i = 0; i < amount; i++) {
permanents.add(ManifestDreadEffect.doManifestDread(player, source, game));
game.processAction();
}
permanents.removeIf(Objects::isNull);
for (Permanent permanent : permanents) {
permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game);
}
return true;
}
}

View file

@ -144,6 +144,7 @@ public final class DuskmournHouseOfHorror extends ExpansionSet {
cards.add(new SetCardInfo("Unwilling Vessel", 81, Rarity.UNCOMMON, mage.cards.u.UnwillingVessel.class));
cards.add(new SetCardInfo("Valgavoth's Faithful", 121, Rarity.UNCOMMON, mage.cards.v.ValgavothsFaithful.class));
cards.add(new SetCardInfo("Valgavoth's Lair", 271, Rarity.RARE, mage.cards.v.ValgavothsLair.class));
cards.add(new SetCardInfo("Valgavoth's Onslaught", 204, Rarity.RARE, mage.cards.v.ValgavothsOnslaught.class));
cards.add(new SetCardInfo("Vanish from Sight", 82, Rarity.COMMON, mage.cards.v.VanishFromSight.class));
cards.add(new SetCardInfo("Vengeful Possession", 162, Rarity.UNCOMMON, mage.cards.v.VengefulPossession.class));
cards.add(new SetCardInfo("Veteran Survivor", 40, Rarity.UNCOMMON, mage.cards.v.VeteranSurvivor.class));