Implemented Demonlord Belzenlok

This commit is contained in:
Evan Kranzler 2018-04-18 15:17:40 -04:00
parent 356ee9ac4e
commit 4d1418cd86
2 changed files with 128 additions and 0 deletions

View file

@ -0,0 +1,127 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.d;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author TheElk801
*/
public class DemonlordBelzenlok extends CardImpl {
public DemonlordBelzenlok(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.ELDER);
this.subtype.add(SubType.DEMON);
this.power = new MageInt(6);
this.toughness = new MageInt(6);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Trample
this.addAbility(TrampleAbility.getInstance());
// When Demonlord Belzenlok enters the battlefield, exile cards from the top of your library until you exile a nonland card, then put that card into your hand. If the card's converted mana cost is 4 or greater, repeat this process. Demonlord Belzenlok deals 1 damage to you for each card put into your hand this way.
this.addAbility(new EntersBattlefieldTriggeredAbility(new DemonlordBelzenlokEffect()));
}
public DemonlordBelzenlok(final DemonlordBelzenlok card) {
super(card);
}
@Override
public DemonlordBelzenlok copy() {
return new DemonlordBelzenlok(this);
}
}
class DemonlordBelzenlokEffect extends OneShotEffect {
public DemonlordBelzenlokEffect() {
super(Outcome.Benefit);
staticText = "exile cards from the top of your library until you exile a nonland card, then put that card into your hand. "
+ "If the card's converted mana cost is 4 or greater, repeat this process. "
+ "{this} deals 1 damage to you for each card put into your hand this way";
}
public DemonlordBelzenlokEffect(final DemonlordBelzenlokEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (controller == null || permanent == null) {
return false;
}
boolean cont = true;
int addedToHand = 0;
while (controller.getLibrary().hasCards() && controller.canRespond() && cont) {
Card card = controller.getLibrary().removeFromTop(game);
if (card != null) {
controller.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.LIBRARY, true);
if (!card.isLand()) {
if (card.getConvertedManaCost() < 4) {
cont = false;
}
card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
addedToHand++;
}
}
}
controller.damage(addedToHand, source.getSourceId(), game, false, true);
return true;
}
@Override
public DemonlordBelzenlokEffect copy() {
return new DemonlordBelzenlokEffect(this);
}
}

View file

@ -106,6 +106,7 @@ public class Dominaria extends ExpansionSet {
cards.add(new SetCardInfo("Deathbloom Thallid", 84, Rarity.COMMON, mage.cards.d.DeathbloomThallid.class));
cards.add(new SetCardInfo("Deep Freeze", 50, Rarity.COMMON, mage.cards.d.DeepFreeze.class));
cards.add(new SetCardInfo("Demonic Vigor", 85, Rarity.COMMON, mage.cards.d.DemonicVigor.class));
cards.add(new SetCardInfo("Demonlord Belzenlok", 86, Rarity.MYTHIC, mage.cards.d.DemonlordBelzenlok.class));
cards.add(new SetCardInfo("Diligent Excavator", 51, Rarity.UNCOMMON, mage.cards.d.DiligentExcavator.class));
cards.add(new SetCardInfo("Divest", 87, Rarity.COMMON, mage.cards.d.Divest.class));
cards.add(new SetCardInfo("Divination", 52, Rarity.COMMON, mage.cards.d.Divination.class));