[CMR] Implemented Volcanic Torrent

This commit is contained in:
Evan Kranzler 2020-11-06 23:58:08 -05:00
parent 25913e8eee
commit 09bf1e0855
2 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1,74 @@
package mage.cards.v;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageAllEffect;
import mage.abilities.keyword.CascadeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreatureOrPlaneswalkerPermanent;
import mage.game.Game;
import mage.watchers.common.CastSpellLastTurnWatcher;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class VolcanicTorrent extends CardImpl {
private static final FilterPermanent filter
= new FilterCreatureOrPlaneswalkerPermanent("creature and planeswalker your opponents control");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public VolcanicTorrent(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{R}");
// Cascade
this.addAbility(new CascadeAbility());
// Volcanic Torrent deals X damage to each creature and planeswalker your opponents control, where X is the number of spells you've cast this turn.
this.getSpellAbility().addEffect(new DamageAllEffect(VolcanicTorrentValue.instance, filter));
}
private VolcanicTorrent(final VolcanicTorrent card) {
super(card);
}
@Override
public VolcanicTorrent copy() {
return new VolcanicTorrent(this);
}
}
enum VolcanicTorrentValue implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
return watcher == null ? 0 : watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(sourceAbility.getControllerId());
}
@Override
public VolcanicTorrentValue copy() {
return instance;
}
@Override
public String getMessage() {
return "the number of spells you've cast this turn";
}
@Override
public String toString() {
return "X";
}
}

View file

@ -496,6 +496,7 @@ public final class CommanderLegends extends ExpansionSet {
cards.add(new SetCardInfo("Vivid Grove", 501, Rarity.UNCOMMON, mage.cards.v.VividGrove.class));
cards.add(new SetCardInfo("Volcanic Dragon", 207, Rarity.UNCOMMON, mage.cards.v.VolcanicDragon.class));
cards.add(new SetCardInfo("Volcanic Fallout", 418, Rarity.UNCOMMON, mage.cards.v.VolcanicFallout.class));
cards.add(new SetCardInfo("Volcanic Torrent", 208, Rarity.UNCOMMON, mage.cards.v.VolcanicTorrent.class));
cards.add(new SetCardInfo("Vow of Duty", 54, Rarity.UNCOMMON, mage.cards.v.VowOfDuty.class));
cards.add(new SetCardInfo("Vow of Flight", 105, Rarity.UNCOMMON, mage.cards.v.VowOfFlight.class));
cards.add(new SetCardInfo("Vow of Lightning", 209, Rarity.UNCOMMON, mage.cards.v.VowOfLightning.class));