[CLB] Implemented Ghastly Death Tyrant

This commit is contained in:
Evan Kranzler 2022-05-31 18:56:05 -04:00
parent f650067be8
commit 0c407d30e5
2 changed files with 95 additions and 0 deletions

View file

@ -0,0 +1,94 @@
package mage.cards.g;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterEnchantmentPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class GhastlyDeathTyrant extends CardImpl {
private static final FilterPermanent filter
= new FilterEnchantmentPermanent("enchantment an opponent controls");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public GhastlyDeathTyrant(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}");
this.subtype.add(SubType.BEHOLDER);
this.subtype.add(SubType.SKELETON);
this.power = new MageInt(6);
this.toughness = new MageInt(5);
// When Ghastly Death Tyrant enters the battlefield, choose one
// Disintegration Ray Destroy target enchantment an opponent controls. You lose life equal to its mana value.
Ability ability = new EntersBattlefieldTriggeredAbility(new GhastlyDeathTyrantEffect());
ability.addTarget(new TargetPermanent(filter));
ability.withFirstModeFlavorWord("Disintegration Ray");
// Death Ray Creatures you control gain deathtouch until end of turn.
ability.addMode(new Mode(new GainAbilityAllEffect(
DeathtouchAbility.getInstance(), Duration.EndOfTurn,
StaticFilters.FILTER_CONTROLLED_CREATURES
)).withFlavorWord("Death Ray"));
this.addAbility(ability);
}
private GhastlyDeathTyrant(final GhastlyDeathTyrant card) {
super(card);
}
@Override
public GhastlyDeathTyrant copy() {
return new GhastlyDeathTyrant(this);
}
}
class GhastlyDeathTyrantEffect extends OneShotEffect {
GhastlyDeathTyrantEffect() {
super(Outcome.Benefit);
staticText = "destroy target enchantment an opponent controls. You lose life equal to its mana value";
}
private GhastlyDeathTyrantEffect(final GhastlyDeathTyrantEffect effect) {
super(effect);
}
@Override
public GhastlyDeathTyrantEffect copy() {
return new GhastlyDeathTyrantEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (player == null || permanent == null) {
return false;
}
permanent.destroy(source, game);
player.loseLife(permanent.getManaValue(), game, source, false);
return true;
}
}

View file

@ -140,6 +140,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet {
cards.add(new SetCardInfo("Gate Colossus", 315, Rarity.UNCOMMON, mage.cards.g.GateColossus.class));
cards.add(new SetCardInfo("Genasi Enforcers", 177, Rarity.COMMON, mage.cards.g.GenasiEnforcers.class));
cards.add(new SetCardInfo("Geode Golem", 316, Rarity.UNCOMMON, mage.cards.g.GeodeGolem.class));
cards.add(new SetCardInfo("Ghastly Death Tyrant", 127, Rarity.COMMON, mage.cards.g.GhastlyDeathTyrant.class));
cards.add(new SetCardInfo("Ghost Lantern", 128, Rarity.UNCOMMON, mage.cards.g.GhostLantern.class));
cards.add(new SetCardInfo("Giant Ankheg", 233, Rarity.UNCOMMON, mage.cards.g.GiantAnkheg.class));
cards.add(new SetCardInfo("Githzerai Monk", 20, Rarity.UNCOMMON, mage.cards.g.GithzeraiMonk.class));