[DMU] Implemented Extinguish the Light

This commit is contained in:
Daniel Bomar 2022-08-25 10:36:27 -05:00
parent 9bd2ace6b2
commit b5a6f34d3b
No known key found for this signature in database
GPG key ID: C86C8658F4023918
2 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,72 @@
package mage.cards.e;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreatureOrPlaneswalker;
/**
*
* @author weirddan455
*/
public final class ExtinguishTheLight extends CardImpl {
public ExtinguishTheLight(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}{B}");
// Destroy target creature or planeswalker. If its mana value was 3 or less, you gain 3 life.
this.getSpellAbility().addEffect(new ExtinguishTheLightEffect());
this.getSpellAbility().addTarget(new TargetCreatureOrPlaneswalker());
}
private ExtinguishTheLight(final ExtinguishTheLight card) {
super(card);
}
@Override
public ExtinguishTheLight copy() {
return new ExtinguishTheLight(this);
}
}
class ExtinguishTheLightEffect extends OneShotEffect {
public ExtinguishTheLightEffect() {
super(Outcome.DestroyPermanent);
this.staticText = "Destroy target creature or planeswalker. If its mana value was 3 or less, you gain 3 life.";
}
private ExtinguishTheLightEffect(final ExtinguishTheLightEffect effect) {
super(effect);
}
@Override
public ExtinguishTheLightEffect copy() {
return new ExtinguishTheLightEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
int manaValue = permanent.getManaValue();
permanent.destroy(source, game);
if (manaValue <= 3) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
controller.gainLife(3, game, source);
}
}
return true;
}
}

View file

@ -62,6 +62,7 @@ public final class DominariaUnited extends ExpansionSet {
cards.add(new SetCardInfo("Elas il-Kor, Sadistic Pilgrim", 198, Rarity.UNCOMMON, mage.cards.e.ElasIlKorSadisticPilgrim.class));
cards.add(new SetCardInfo("Electrostatic Infantry", 122, Rarity.UNCOMMON, mage.cards.e.ElectrostaticInfantry.class));
cards.add(new SetCardInfo("Evolved Sleeper", 93, Rarity.RARE, mage.cards.e.EvolvedSleeper.class));
cards.add(new SetCardInfo("Extinguish the Light", 94, Rarity.COMMON, mage.cards.e.ExtinguishTheLight.class));
cards.add(new SetCardInfo("Fires of Victory", 123, Rarity.UNCOMMON, mage.cards.f.FiresOfVictory.class));
cards.add(new SetCardInfo("Forest", 274, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Frostfist Strider", 51, Rarity.UNCOMMON, mage.cards.f.FrostfistStrider.class));