[DGM] Bred for the Hunt, Mirko Vosk Mind Dringer, Lavinia of the Tenth

This commit is contained in:
LevelX2 2013-04-11 23:53:48 +02:00
parent 145f25e96d
commit 660a335b3c
3 changed files with 326 additions and 0 deletions

View file

@ -0,0 +1,104 @@
/*
* 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.sets.dragonsmaze;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/**
*
* @author LevelX2
*/
public class BredForTheHunt extends CardImpl<BredForTheHunt> {
public BredForTheHunt(UUID ownerId) {
super(ownerId, 59, "Bred for the Hunt", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{U}");
this.expansionSetCode = "DGM";
this.color.setGreen(true);
this.color.setBlue(true);
// Whenever a creature you control with a +1/+1 counter on it deals combat damage to a player, you may draw a card.
this.addAbility(new BredForTheHuntTriggeredAbility());
}
public BredForTheHunt(final BredForTheHunt card) {
super(card);
}
@Override
public BredForTheHunt copy() {
return new BredForTheHunt(this);
}
}
class BredForTheHuntTriggeredAbility extends TriggeredAbilityImpl<BredForTheHuntTriggeredAbility> {
public BredForTheHuntTriggeredAbility() {
super(Zone.BATTLEFIELD, new DrawCardControllerEffect(1));
this.optional = true;
}
public BredForTheHuntTriggeredAbility(final BredForTheHuntTriggeredAbility ability) {
super(ability);
}
@Override
public BredForTheHuntTriggeredAbility copy() {
return new BredForTheHuntTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && ((DamagedPlayerEvent) event).isCombatDamage()) {
Permanent creature = game.getPermanent(event.getSourceId());
if (creature != null && creature.getControllerId().equals(getControllerId()) && creature.getCounters().getCount(CounterType.P1P1) > 0) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever a creature you control with a +1/+1 counter on it deals combat damage to a player, you may draw a card.";
}
}

View file

@ -0,0 +1,94 @@
/*
* 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.sets.dragonsmaze;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.DetainAllEffect;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterObject;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
/**
*
* @author LevelX2
*/
public class LaviniaOfTheTenth extends CardImpl<LaviniaOfTheTenth> {
private static final FilterObject filter = new FilterObject("red");
private static final FilterPermanent filterDetain = new FilterPermanent("each nonland permanent your opponents control with converted mana cost 4 or less");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
filterDetain.add(new ControllerPredicate(Constants.TargetController.OPPONENT));
filterDetain.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
filterDetain.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 5));
}
public LaviniaOfTheTenth (UUID ownerId) {
super(ownerId, 80, "Lavinia of the Tenth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{U}");
this.expansionSetCode = "DGM";
this.subtype.add("Human");
this.subtype.add("Soldier");
this.supertype.add("Legendary");
this.color.setBlue(true);
this.color.setBlack(true);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Protection from red
this.addAbility(new ProtectionAbility(filter));
// When Lavinia of the Tenth enters the battlefield, detain each nonland permanent your opponents control with converted mana cost 4 or less.
this.addAbility(new EntersBattlefieldTriggeredAbility(new DetainAllEffect(filterDetain)));
}
public LaviniaOfTheTenth (final LaviniaOfTheTenth card) {
super(card);
}
@Override
public LaviniaOfTheTenth copy() {
return new LaviniaOfTheTenth(this);
}
}

View file

@ -0,0 +1,128 @@
/*
* 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.sets.dragonsmaze;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class MirkoVoskMindDrinker extends CardImpl<MirkoVoskMindDrinker> {
public MirkoVoskMindDrinker (UUID ownerId) {
super(ownerId, 85, "Mirko Vosk, Mind Drinker", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{B}");
this.expansionSetCode = "DGM";
this.subtype.add("Vampire");
this.supertype.add("Legendary");
this.color.setBlue(true);
this.color.setBlack(true);
this.power = new MageInt(2);
this.toughness = new MageInt(4);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever Mirko Vosk, Mind Drinker deals combat damage to a player, that player reveals cards from the top of his or her library until he or she reveals four land cards, then puts those cards into his or her graveyard.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new MirkoVoskMindDrinkerEffect(), false, true));
}
public MirkoVoskMindDrinker (final MirkoVoskMindDrinker card) {
super(card);
}
@Override
public MirkoVoskMindDrinker copy() {
return new MirkoVoskMindDrinker(this);
}
}
class MirkoVoskMindDrinkerEffect extends OneShotEffect<MirkoVoskMindDrinkerEffect> {
public MirkoVoskMindDrinkerEffect() {
super(Outcome.Benefit);
this.staticText = "that player reveals cards from the top of his or her library until he or she reveals four land cards, then puts those cards into his or her graveyard";
}
public MirkoVoskMindDrinkerEffect(final MirkoVoskMindDrinkerEffect effect) {
super(effect);
}
@Override
public MirkoVoskMindDrinkerEffect copy() {
return new MirkoVoskMindDrinkerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
Card sourceCard = game.getCard(source.getSourceId());
if (player == null || sourceCard == null) {
return false;
}
int landsToReveal = 4;
Cards cards = new CardsImpl();
while(player.getLibrary().size() > 0){
Card card = player.getLibrary().removeFromTop(game);
if (card != null) {
cards.add(card);
if(card.getCardType().contains(CardType.LAND)){
--landsToReveal;
if (landsToReveal < 1) {
break;
}
}
}
}
player.revealCards(new StringBuilder("by ").append(sourceCard.getName()).append(" from ").append(player.getName()).toString(), cards, game);
for(Card card : cards.getCards(game)){
if(card != null){
card.moveToZone(Zone.GRAVEYARD, source.getSourceId(), game, false);
}
}
return true;
}
}