Implemented Hollow Specter, Cabal Interrogator, and Bloodline Shaman.

This commit is contained in:
fireshoes 2016-10-18 11:58:27 -05:00
parent 89f4ad4582
commit 358cfdf0eb
7 changed files with 450 additions and 5 deletions

View file

@ -0,0 +1,141 @@
/*
* 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.b;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.cards.repository.CardRepository;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author fireshoes
*/
public class BloodlineShaman extends CardImpl {
public BloodlineShaman(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}");
this.subtype.add("Elf");
this.subtype.add("Wizard");
this.subtype.add("Shaman");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {tap}: Choose a creature type. Reveal the top card of your library. If that card is a creature card of the chosen type, put it into your hand.
// Otherwise, put it into your graveyard.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BloodlineShamanEffect(), new TapSourceCost()));
}
public BloodlineShaman(final BloodlineShaman card) {
super(card);
}
@Override
public BloodlineShaman copy() {
return new BloodlineShaman(this);
}
}
class BloodlineShamanEffect extends OneShotEffect {
public BloodlineShamanEffect() {
super(Outcome.Benefit);
this.staticText = "Choose a creature type. Reveal the top card of your library. If that card is a creature card of the chosen type, put it into your hand. "
+ "Otherwise, put it into your graveyard";
}
public BloodlineShamanEffect(final BloodlineShamanEffect effect) {
super(effect);
}
@Override
public BloodlineShamanEffect copy() {
return new BloodlineShamanEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null) {
// Choose a creature type.
Choice typeChoice = new ChoiceImpl(true);
typeChoice.setMessage("Choose a creature type:");
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
while (!controller.choose(outcome, typeChoice, game)) {
if (!controller.canRespond()) {
return false;
}
}
if (typeChoice.getChoice() != null) {
game.informPlayers(sourceObject.getLogName() + " chosen type: " + typeChoice.getChoice());
}
FilterCard filterSubtype = new FilterCard();
filterSubtype.add(new SubtypePredicate(typeChoice.getChoice()));
// Reveal the top card of your library.
if (controller.getLibrary().size() > 0) {
Card card = controller.getLibrary().getFromTop(game);
Cards cards = new CardsImpl(card);
controller.revealCards(sourceObject.getIdName(), cards, game);
if (card != null) {
// If that card is a creature card of the chosen type, put it into your hand.
if (filterSubtype.match(card, game)) {
controller.moveCards(card, Zone.HAND, source, game);
// Otherwise, put it into your graveyard.
} else {
controller.moveCards(card, Zone.GRAVEYARD, source, game);
}
}
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,150 @@
/*
* 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.c;
import java.util.List;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.TargetPlayer;
/**
*
* @author fireshoes
*/
public class CabalInterrogator extends CardImpl {
public CabalInterrogator(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.subtype.add("Zombie");
this.subtype.add("Wizard");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {X}{B}, {tap}: Target player reveals X cards from his or her hand and you choose one of them. That player discards that card.
// Activate this ability only any time you could cast a sorcery.
Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new CabalInterrogatorEffect(), new ManaCostsImpl("{X}{B}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}
public CabalInterrogator(final CabalInterrogator card) {
super(card);
}
@Override
public CabalInterrogator copy() {
return new CabalInterrogator(this);
}
}
class CabalInterrogatorEffect extends OneShotEffect {
public CabalInterrogatorEffect() {
super(Outcome.Discard);
this.staticText = "Target player reveals X cards from his or her hand and you choose one of them. That player discards that card";
}
public CabalInterrogatorEffect(final CabalInterrogatorEffect effect) {
super(effect);
}
@Override
public CabalInterrogatorEffect copy() {
return new CabalInterrogatorEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(source.getFirstTarget());
Player controller = game.getPlayer(source.getControllerId());
if (targetPlayer == null || controller == null) {
return false;
}
int amountToReveal = (new ManacostVariableValue()).calculate(game, source, this);
Cards revealedCards = new CardsImpl();
if (amountToReveal > 0 && targetPlayer.getHand().size() > amountToReveal) {
Cards cardsInHand = new CardsImpl();
cardsInHand.addAll(targetPlayer.getHand());
TargetCard target = new TargetCard(amountToReveal, Zone.HAND, new FilterCard());
if (targetPlayer.choose(Outcome.Discard, cardsInHand, target, game)) {
List<UUID> targets = target.getTargets();
for (UUID targetId : targets) {
Card card = game.getCard(targetId);
if (card != null) {
revealedCards.add(card);
}
}
}
} else {
revealedCards.addAll(targetPlayer.getHand());
}
TargetCard targetInHand = new TargetCard(Zone.HAND, new FilterCard("card to discard"));
if (!revealedCards.isEmpty()) {
targetPlayer.revealCards("Cabal Interrogator", revealedCards, game);
Card card = null;
if(revealedCards.size() > 1) {
controller.choose(Outcome.Discard, revealedCards, targetInHand, game);
card = revealedCards.get(targetInHand.getFirstTarget(), game);
} else {
card = revealedCards.getRandom(game);
}
if (card != null) {
targetPlayer.discard(card, source, game);
}
}
return true;
}
}

View file

@ -0,0 +1,145 @@
/*
* 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.h;
import java.util.List;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetCard;
/**
*
* @author fireshoes
*/
public class HollowSpecter extends CardImpl {
public HollowSpecter(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}");
this.subtype.add("Specter");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever Hollow Specter deals combat damage to a player, you may pay {X}.
// If you do, that player reveals X cards from his or her hand and you choose one of them. That player discards that card.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new HollowSpecterEffect(), false, true));
}
public HollowSpecter(final HollowSpecter card) {
super(card);
}
@Override
public HollowSpecter copy() {
return new HollowSpecter(this);
}
}
class HollowSpecterEffect extends OneShotEffect {
public HollowSpecterEffect() {
super(Outcome.Discard);
staticText = "you may pay {X}. If you do, that player reveals X cards from his or her hand and you choose one of them. That player discards that card";
}
public HollowSpecterEffect(final HollowSpecterEffect effect) {
super(effect);
}
@Override
public HollowSpecterEffect copy() {
return new HollowSpecterEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
Player controller = game.getPlayer(source.getControllerId());
if (targetPlayer != null && controller != null && controller.chooseUse(Outcome.BoostCreature, "Do you want to to pay {X}?", source, game)) {
int costX = controller.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
Cost cost = new GenericManaCost(costX);
int amountToReveal = costX;
Cards revealedCards = new CardsImpl();
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
if (amountToReveal > 0 && targetPlayer.getHand().size() > amountToReveal) {
Cards cardsInHand = new CardsImpl();
cardsInHand.addAll(targetPlayer.getHand());
TargetCard target = new TargetCard(amountToReveal, Zone.HAND, new FilterCard());
if (targetPlayer.choose(Outcome.Discard, cardsInHand, target, game)) {
List<UUID> targets = target.getTargets();
for (UUID targetId : targets) {
Card card = game.getCard(targetId);
if (card != null) {
revealedCards.add(card);
}
}
}
} else {
revealedCards.addAll(targetPlayer.getHand());
}
TargetCard targetInHand = new TargetCard(Zone.HAND, new FilterCard("card to discard"));
if (!revealedCards.isEmpty()) {
targetPlayer.revealCards("Hollow Specter", revealedCards, game);
Card card = null;
if(revealedCards.size() > 1) {
controller.choose(Outcome.Discard, revealedCards, targetInHand, game);
card = revealedCards.get(targetInHand.getFirstTarget(), game);
} else {
card = revealedCards.getRandom(game);
}
if (card != null) {
targetPlayer.discard(card, source, game);
}
}
}
return true;
}
return false;
}
}

View file

@ -66,7 +66,9 @@ public class ThievingSprite extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Thieving Sprite enters the battlefield, target player reveals X cards from his or her hand, where X is the number of Faeries you control. You choose one of those cards. That player discards that card.
// When Thieving Sprite enters the battlefield, target player reveals X cards from his or her hand, where X is the number of Faeries you control.
// You choose one of those cards. That player discards that card.
Ability ability = new EntersBattlefieldTriggeredAbility(new ThievingSpriteEffect(), false);
TargetPlayer target = new TargetPlayer();
ability.addTarget(target);
@ -88,7 +90,8 @@ class ThievingSpriteEffect extends OneShotEffect {
public ThievingSpriteEffect() {
super(Outcome.Discard);
this.staticText = "target player reveals X cards from his or her hand, where X is the number of Faeries you control. You choose one of those cards. That player discards that card";
this.staticText = "target player reveals X cards from his or her hand, where X is the number of Faeries you control. You choose one of those cards. "
+ "That player discards that card";
}
public ThievingSpriteEffect(final ThievingSpriteEffect effect) {
@ -127,11 +130,11 @@ class ThievingSpriteEffect extends OneShotEffect {
revealedCards.add(card);
}
}
}
}
} else {
revealedCards.addAll(targetPlayer.getHand());
}
TargetCard targetInHand = new TargetCard(Zone.HAND, new FilterCard("card to discard"));
if (!revealedCards.isEmpty()) {
@ -143,7 +146,7 @@ class ThievingSpriteEffect extends OneShotEffect {
} else {
card = revealedCards.getRandom(game);
}
if (card != null) {
targetPlayer.discard(card, source, game);
}

View file

@ -110,6 +110,7 @@ public class Legions extends ExpansionSet {
cards.add(new SetCardInfo("Goblin Turncoat", 72, Rarity.COMMON, mage.cards.g.GoblinTurncoat.class));
cards.add(new SetCardInfo("Graveborn Muse", 73, Rarity.RARE, mage.cards.g.GravebornMuse.class));
cards.add(new SetCardInfo("Havoc Demon", 74, Rarity.RARE, mage.cards.h.HavocDemon.class));
cards.add(new SetCardInfo("Hollow Specter", 75, Rarity.RARE, mage.cards.h.HollowSpecter.class));
cards.add(new SetCardInfo("Hundroog", 129, Rarity.COMMON, mage.cards.h.Hundroog.class));
cards.add(new SetCardInfo("Hunter Sliver", 102, Rarity.COMMON, mage.cards.h.HunterSliver.class));
cards.add(new SetCardInfo("Imperial Hellkite", 103, Rarity.RARE, mage.cards.i.ImperialHellkite.class));

View file

@ -53,8 +53,10 @@ public class Onslaught extends ExpansionSet {
cards.add(new SetCardInfo("Blackmail", 127, Rarity.UNCOMMON, mage.cards.b.Blackmail.class));
cards.add(new SetCardInfo("Blatant Thievery", 71, Rarity.RARE, mage.cards.b.BlatantThievery.class));
cards.add(new SetCardInfo("Blistering Firecat", 189, Rarity.RARE, mage.cards.b.BlisteringFirecat.class));
cards.add(new SetCardInfo("Bloodline Shaman", 249, Rarity.UNCOMMON, mage.cards.b.BloodlineShaman.class));
cards.add(new SetCardInfo("Bloodstained Mire", 313, Rarity.RARE, mage.cards.b.BloodstainedMire.class, new CardGraphicInfo(new ObjectColor("RB"), null,
false)));
cards.add(new SetCardInfo("Bloodline Shaman", 249, Rarity.UNCOMMON, mage.cards.b.BloodlineShaman.class));
cards.add(new SetCardInfo("Boneknitter", 128, Rarity.UNCOMMON, mage.cards.b.Boneknitter.class));
cards.add(new SetCardInfo("Brightstone Ritual", 191, Rarity.COMMON, mage.cards.b.BrightstoneRitual.class));
cards.add(new SetCardInfo("Broodhatch Nantuko", 250, Rarity.UNCOMMON, mage.cards.b.BroodhatchNantuko.class));
@ -300,6 +302,7 @@ public class Onslaught extends ExpansionSet {
cards.add(new SetCardInfo("Whipcorder", 60, Rarity.UNCOMMON, mage.cards.w.Whipcorder.class));
cards.add(new SetCardInfo("Windswept Heath", 328, Rarity.RARE, mage.cards.w.WindsweptHeath.class, new CardGraphicInfo(new ObjectColor("GW"), null,
false)));
cards.add(new SetCardInfo("Bloodline Shaman", 249, Rarity.UNCOMMON, mage.cards.b.BloodlineShaman.class));
cards.add(new SetCardInfo("Wirewood Elf", 301, Rarity.COMMON, mage.cards.w.WirewoodElf.class));
cards.add(new SetCardInfo("Wirewood Herald", 302, Rarity.COMMON, mage.cards.w.WirewoodHerald.class));
cards.add(new SetCardInfo("Wirewood Lodge", 329, Rarity.RARE, mage.cards.w.WirewoodLodge.class));
@ -307,6 +310,7 @@ public class Onslaught extends ExpansionSet {
cards.add(new SetCardInfo("Wirewood Savage", 304, Rarity.COMMON, mage.cards.w.WirewoodSavage.class));
cards.add(new SetCardInfo("Wooded Foothills", 330, Rarity.RARE, mage.cards.w.WoodedFoothills.class, new CardGraphicInfo(new ObjectColor("RG"), null,
false)));
cards.add(new SetCardInfo("Bloodline Shaman", 249, Rarity.UNCOMMON, mage.cards.b.BloodlineShaman.class));
cards.add(new SetCardInfo("Words of War", 244, Rarity.RARE, mage.cards.w.WordsOfWar.class));
cards.add(new SetCardInfo("Words of Wind", 122, Rarity.RARE, mage.cards.w.WordsOfWind.class));
cards.add(new SetCardInfo("Words of Worship", 61, Rarity.RARE, mage.cards.w.WordsOfWorship.class));

View file

@ -68,6 +68,7 @@ public class Scourge extends ExpansionSet {
cards.add(new SetCardInfo("Brain Freeze", 29, Rarity.UNCOMMON, mage.cards.b.BrainFreeze.class));
cards.add(new SetCardInfo("Break Asunder", 113, Rarity.COMMON, mage.cards.b.BreakAsunder.class));
cards.add(new SetCardInfo("Cabal Conditioning", 56, Rarity.RARE, mage.cards.c.CabalConditioning.class));
cards.add(new SetCardInfo("Cabal Interrogator", 57, Rarity.UNCOMMON, mage.cards.c.CabalInterrogator.class));
cards.add(new SetCardInfo("Call to the Grave", 58, Rarity.RARE, mage.cards.c.CallToTheGrave.class));
cards.add(new SetCardInfo("Carbonize", 83, Rarity.UNCOMMON, mage.cards.c.Carbonize.class));
cards.add(new SetCardInfo("Carrion Feeder", 59, Rarity.COMMON, mage.cards.c.CarrionFeeder.class));