Added Infernal Tudor, Hanna Ships Navigator, Hazezon Tamar.

This commit is contained in:
LevelX2 2014-04-06 17:26:54 +02:00
parent 93b968d92a
commit 126d628d63
9 changed files with 389 additions and 14 deletions

View file

@ -0,0 +1,126 @@
/*
* 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.dissension;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.condition.common.HellbentCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCardInHand;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author LevelX2
*/
public class InfernalTutor extends CardImpl<InfernalTutor> {
public InfernalTutor(UUID ownerId) {
super(ownerId, 46, "Infernal Tutor", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{B}");
this.expansionSetCode = "DIS";
this.color.setBlack(true);
// Reveal a card from your hand. Search your library for a card with the same name as that card, reveal it, put it into your hand, then shuffle your library.
this.getSpellAbility().addEffect(new InfernalTutorEffect());
// Hellbent - If you have no cards in hand, instead search your library for a card, put it into your hand, then shuffle your library.
Effect effect = new ConditionalOneShotEffect(
new SearchLibraryPutInHandEffect(new TargetCardInLibrary(new FilterCard()), false, true),
HellbentCondition.getInstance(),
"<br/><br/><i>Hellbent</i> - If you have no cards in hand, instead search your library for a card, put it into your hand, then shuffle your library");
this.getSpellAbility().addEffect(effect);
}
public InfernalTutor(final InfernalTutor card) {
super(card);
}
@Override
public InfernalTutor copy() {
return new InfernalTutor(this);
}
}
class InfernalTutorEffect extends OneShotEffect<InfernalTutorEffect> {
public InfernalTutorEffect() {
super(Outcome.Benefit);
this.staticText = "Reveal a card from your hand. Search your library for a card with the same name as that card, reveal it, put it into your hand, then shuffle your library";
}
public InfernalTutorEffect(final InfernalTutorEffect effect) {
super(effect);
}
@Override
public InfernalTutorEffect copy() {
return new InfernalTutorEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Card sourceCard = game.getCard(source.getSourceId());
if (controller != null) {
if (controller.getHand().size() > 0) {
Card cardToReveal = null;
if (controller.getHand().size() > 1) {
Target target = new TargetCardInHand(new FilterCard());
target.setRequired(true);
target.setNotTarget(true);
if (controller.chooseTarget(outcome, target, source, game)) {
cardToReveal = game.getCard(target.getFirstTarget());
}
} else {
cardToReveal = controller.getHand().getRandom(game);
}
if (cardToReveal != null) {
controller.revealCards(sourceCard.getName(), new CardsImpl(cardToReveal), game);
FilterCard filterCard = new FilterCard(new StringBuilder("card named ").append(cardToReveal.getName()).toString());
return new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filterCard), true, true).apply(game, source);
}
}
return true;
}
return false;
}
}

View file

@ -29,11 +29,6 @@
package mage.sets.dissension;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -45,6 +40,10 @@ import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
@ -59,9 +58,19 @@ public class RakdosPitDragon extends CardImpl<RakdosPitDragon> {
this.color.setRed(true);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{R}{R}")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield), HellbentCondition.getInstance(), "Hellbent - Rakdos Pit Dragon has double strike as long as you have no cards in hand")));
// {R}{R}: Rakdos Pit Dragon gains flying until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn),
new ManaCostsImpl("{R}{R}")));
// {R}: Rakdos Pit Dragon gets +1/+0 until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new BoostSourceEffect(1, 0, Duration.EndOfTurn),
new ManaCostsImpl("{R}")));
// Hellbent Rakdos Pit Dragon has double strike as long as you have no cards in hand.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield),
HellbentCondition.getInstance(),
"Hellbent - Rakdos Pit Dragon has double strike as long as you have no cards in hand")));
}
public RakdosPitDragon (final RakdosPitDragon card) {

View file

@ -0,0 +1,88 @@
/*
* 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.invasion;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.other.OwnerPredicate;
import mage.target.common.TargetCardInYourGraveyard;
/**
*
* @author LevelX2
*/
public class HannaShipsNavigator extends CardImpl<HannaShipsNavigator> {
private static final FilterCard filter = new FilterCard("artifact or enchantment card from your graveyard");
static {
filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.ENCHANTMENT)));
filter.add(new OwnerPredicate(TargetController.YOU));
}
public HannaShipsNavigator(UUID ownerId) {
super(ownerId, 249, "Hanna, Ship's Navigator", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}{U}");
this.expansionSetCode = "INV";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Artificer");
this.color.setBlue(true);
this.color.setWhite(true);
this.power = new MageInt(1);
this.toughness = new MageInt(2);
// {1}{W}{U}, {tap}: Return target artifact or enchantment card from your graveyard to your hand.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToHandTargetEffect(), new ManaCostsImpl("{1}{W}{U}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCardInYourGraveyard(filter, true));
this.addAbility(ability);
}
public HannaShipsNavigator(final HannaShipsNavigator card) {
super(card);
}
@Override
public HannaShipsNavigator copy() {
return new HannaShipsNavigator(this);
}
}

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.sets.legends;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileAllEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.token.Token;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class HazezonTamar extends CardImpl<HazezonTamar> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sand Warriors");
static {
filter.add(new SubtypePredicate("Sand"));
filter.add(new SubtypePredicate("Warrior"));
}
public HazezonTamar(UUID ownerId) {
super(ownerId, 270, "Hazezon Tamar", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}{G}{W}");
this.expansionSetCode = "LEG";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Warrior");
this.color.setRed(true);
this.color.setGreen(true);
this.color.setWhite(true);
this.power = new MageInt(2);
this.toughness = new MageInt(4);
// When Hazezon Tamar enters the battlefield, put X 1/1 Sand Warrior creature tokens that are red, green, and white onto the battlefield at the beginning of your next upkeep, where X is the number of lands you control at that time.
this.addAbility(new EntersBattlefieldTriggeredAbility(new HazezonTamarEntersEffect(), false));
// When Hazezon leaves the battlefield, exile all Sand Warriors.
this.addAbility(new LeavesBattlefieldTriggeredAbility(new ExileAllEffect(filter), false));
}
public HazezonTamar(final HazezonTamar card) {
super(card);
}
@Override
public HazezonTamar copy() {
return new HazezonTamar(this);
}
}
class HazezonTamarEntersEffect extends OneShotEffect<HazezonTamarEntersEffect> {
public HazezonTamarEntersEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "put X 1/1 Sand Warrior creature tokens that are red, green, and white onto the battlefield at the beginning of your next upkeep, where X is the number of lands you control at that time";
}
public HazezonTamarEntersEffect(final HazezonTamarEntersEffect effect) {
super(effect);
}
@Override
public HazezonTamarEntersEffect copy() {
return new HazezonTamarEntersEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Effect effect = new CreateTokenEffect(new HazezonTamarSandWarrior(), new PermanentsOnBattlefieldCount(new FilterControlledLandPermanent()));
effect.setText("put X 1/1 Sand Warrior creature tokens that are red, green, and white onto the battlefield, where X is the number of lands you control at that time");
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}
return false;
}
}
class HazezonTamarSandWarrior extends Token {
public HazezonTamarSandWarrior() {
super("Sand Warrior", "1/1 Sand Warrior creature tokens that are red, green, and white");
cardType.add(CardType.CREATURE);
color.setRed(true);
color.setGreen(true);
color.setWhite(true);
subtype.add("Sand");
subtype.add("Warrior");
power = new MageInt(1);
toughness = new MageInt(1);
}
}

View file

@ -29,11 +29,11 @@
package mage.abilities.effects.common;
import java.util.UUID;
import mage.constants.Outcome;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.token.Token;
import mage.util.CardUtil;

View file

@ -33,9 +33,11 @@ import java.util.UUID;
import mage.constants.Outcome;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
@ -72,11 +74,17 @@ public class ExileAllEffect extends OneShotEffect<ExileAllEffect> {
@Override
public boolean apply(Game game, Ability source) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getId(), game);
for (Permanent permanent: permanents) {
permanent.moveToExile(exileId, exileZone, source.getSourceId(), game);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
for (Permanent permanent: permanents) {
controller.moveCardToExileWithInfo(permanent, exileId, exileZone, source.getSourceId(), game, Zone.BATTLEFIELD);
}
return true;
}
return true;
return false;
}
private void setText() {

View file

@ -95,7 +95,7 @@ public class SearchLibraryPutInHandEffect extends SearchEffect<SearchLibraryPutI
for (UUID cardId: target.getTargets()) {
Card card = player.getLibrary().remove(cardId, game);
if (card != null){
card.moveToZone(Zone.HAND, source.getId(), game, false);
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
if (revealCards) {
cards.add(card);
}

View file

@ -34,6 +34,7 @@ package mage.constants;
*/
public enum AbilityWord {
BLOODRUSH("Bloodrush"),
HELLBENT("Hellbent"),
HEROIC("Heroic"),
LANDFALL("Landfall"),
METALCRAFT("Metalcraft");

View file

@ -1622,10 +1622,12 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
//20091005 - 701.14c
Library searchedLibrary = null;
if (targetPlayerId.equals(playerId)) {
game.informPlayers(new StringBuilder(getName()).append(" searches his or her library").toString());
searchedLibrary = library;
} else {
Player targetPlayer = game.getPlayer(targetPlayerId);
if (targetPlayer != null) {
game.informPlayers(new StringBuilder(getName()).append(" searches the library of ").append(targetPlayer.getName()).toString());
searchedLibrary = targetPlayer.getLibrary();
}
}