[JUD] Implemented Wormfang Behemoth

This commit is contained in:
Evan Kranzler 2022-03-01 20:00:08 -05:00
parent 456e833f0c
commit 9fad271f63
2 changed files with 83 additions and 0 deletions

View file

@ -0,0 +1,82 @@
package mage.cards.w;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnFromExileForSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.util.CardUtil;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class WormfangBehemoth extends CardImpl {
public WormfangBehemoth(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.subtype.add(SubType.NIGHTMARE);
this.subtype.add(SubType.FISH);
this.subtype.add(SubType.BEAST);
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// When Wormfang Behemoth enters the battlefield, exile all cards from your hand.
this.addAbility(new EntersBattlefieldTriggeredAbility(new WormfangBehemothEffect()));
// When Wormfang Behemoth leaves the battlefield, return the exiled cards to their owner's hand.
this.addAbility(new LeavesBattlefieldTriggeredAbility(
new ReturnFromExileForSourceEffect(Zone.HAND), false
));
}
private WormfangBehemoth(final WormfangBehemoth card) {
super(card);
}
@Override
public WormfangBehemoth copy() {
return new WormfangBehemoth(this);
}
}
class WormfangBehemothEffect extends OneShotEffect {
WormfangBehemothEffect() {
super(Outcome.Benefit);
staticText = "exile all cards from your hand";
}
private WormfangBehemothEffect(final WormfangBehemothEffect effect) {
super(effect);
}
@Override
public WormfangBehemothEffect copy() {
return new WormfangBehemothEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null || player.getHand().isEmpty()) {
return false;
}
return player.moveCardsToExile(
player.getHand().getCards(game), source, game, true,
CardUtil.getExileZoneId(game, source),
CardUtil.getSourceName(game, source)
);
}
}

View file

@ -162,6 +162,7 @@ public final class Judgment extends ExpansionSet {
cards.add(new SetCardInfo("Web of Inertia", 53, Rarity.UNCOMMON, mage.cards.w.WebOfInertia.class));
cards.add(new SetCardInfo("Wonder", 54, Rarity.UNCOMMON, mage.cards.w.Wonder.class));
cards.add(new SetCardInfo("Worldgorger Dragon", 103, Rarity.RARE, mage.cards.w.WorldgorgerDragon.class));
cards.add(new SetCardInfo("Wormfang Behemoth", 55, Rarity.RARE, mage.cards.w.WormfangBehemoth.class));
cards.add(new SetCardInfo("Wormfang Drake", 57, Rarity.COMMON, mage.cards.w.WormfangDrake.class));
cards.add(new SetCardInfo("Wormfang Manta", 58, Rarity.RARE, mage.cards.w.WormfangManta.class));
cards.add(new SetCardInfo("Wormfang Newt", 59, Rarity.COMMON, mage.cards.w.WormfangNewt.class));