[KTK] Added 7 multicolor cards.

This commit is contained in:
LevelX2 2014-09-10 22:38:09 +02:00
parent b2fc6923b9
commit 141cdb0e8b
11 changed files with 877 additions and 38 deletions

View file

@ -27,21 +27,16 @@
*/ */
package mage.sets.conflux; package mage.sets.conflux;
import mage.constants.CardType; import java.util.UUID;
import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.UntapAllControllerEffect;
import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.effects.common.continious.BoostControlledEffect;
import mage.abilities.keyword.BasicLandcyclingAbility; import mage.abilities.keyword.BasicLandcyclingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Rarity;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/** /**
* *
@ -57,7 +52,8 @@ public class GleamOfResistance extends CardImpl {
// Creatures you control get +1/+2 until end of turn. Untap those creatures. // Creatures you control get +1/+2 until end of turn. Untap those creatures.
this.getSpellAbility().addEffect(new BoostControlledEffect(1, 2, Duration.EndOfTurn)); this.getSpellAbility().addEffect(new BoostControlledEffect(1, 2, Duration.EndOfTurn));
this.getSpellAbility().addEffect(new GleamOfResistanceEffect()); this.getSpellAbility().addEffect(new UntapAllControllerEffect(new FilterCreaturePermanent(),"Untap those creatures"));
// Basic landcycling {1}{W}({1}{W}, Discard this card: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library.)
this.addAbility(new BasicLandcyclingAbility(new ManaCostsImpl("{1}{W}"))); this.addAbility(new BasicLandcyclingAbility(new ManaCostsImpl("{1}{W}")));
} }
@ -70,29 +66,3 @@ public class GleamOfResistance extends CardImpl {
return new GleamOfResistance(this); return new GleamOfResistance(this);
} }
} }
class GleamOfResistanceEffect extends OneShotEffect {
GleamOfResistanceEffect() {
super(Outcome.Untap);
staticText = "Untap those creatures";
}
GleamOfResistanceEffect(final GleamOfResistanceEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
for (Permanent perm: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) {
if (perm.isTapped()) {
perm.untap(game);
}
}
return true;
}
@Override
public GleamOfResistanceEffect copy() {
return new GleamOfResistanceEffect(this);
}
}

View file

@ -0,0 +1,151 @@
/*
* 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.khansoftarkir;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.LifelinkAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author LevelX2
*/
public class ButcherOfTheHorde extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature");
static {
filter.add(new AnotherPredicate());
}
public ButcherOfTheHorde(UUID ownerId) {
super(ownerId, 168, "Butcher of the Horde", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{W}{B}");
this.expansionSetCode = "KTK";
this.subtype.add("Demon");
this.color.setRed(true);
this.color.setBlack(true);
this.color.setWhite(true);
this.power = new MageInt(5);
this.toughness = new MageInt(4);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Sacrifice another creature: Butcher of the Horde gains your choice of vigilance, lifelink, or haste until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new ButcherOfTheHordeEffect(), new SacrificeTargetCost(new TargetControlledCreaturePermanent(1,1,filter, false))));
}
public ButcherOfTheHorde(final ButcherOfTheHorde card) {
super(card);
}
@Override
public ButcherOfTheHorde copy() {
return new ButcherOfTheHorde(this);
}
}
class ButcherOfTheHordeEffect extends OneShotEffect {
ButcherOfTheHordeEffect() {
super(Outcome.AddAbility);
staticText = "{this} gains your choice of vigilance, lifelink, or haste until end of turn";
}
ButcherOfTheHordeEffect(final ButcherOfTheHordeEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player playerControls = game.getPlayer(source.getControllerId());
if (playerControls != null) {
Choice abilityChoice = new ChoiceImpl();
abilityChoice.setMessage("Choose an ability to add");
Set<String> abilities = new HashSet<>();
abilities.add(VigilanceAbility.getInstance().getRule());
abilities.add(LifelinkAbility.getInstance().getRule());
abilities.add(HasteAbility.getInstance().getRule());
abilityChoice.setChoices(abilities);
while (!abilityChoice.isChosen()) {
playerControls.choose(Outcome.AddAbility, abilityChoice, game);
if (!playerControls.isInGame()) {
return false;
}
}
String chosen = abilityChoice.getChoice();
Ability ability = null;
if (VigilanceAbility.getInstance().getRule().equals(chosen)) {
ability = VigilanceAbility.getInstance();
} else if (LifelinkAbility.getInstance().getRule().equals(chosen)) {
ability = LifelinkAbility.getInstance();
} else if (HasteAbility.getInstance().getRule().equals(chosen)) {
ability = HasteAbility.getInstance();
}
if (ability != null) {
ContinuousEffect effect = new GainAbilitySourceEffect(ability, Duration.EndOfTurn);
game.addEffect(effect, source);
return true;
}
}
return false;
}
@Override
public ButcherOfTheHordeEffect copy() {
return new ButcherOfTheHordeEffect(this);
}
}

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.khansoftarkir;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continious.BoostTargetEffect;
import mage.abilities.keyword.MorphAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author LevelX2
*/
public class EfreetWeaponmaster extends CardImpl {
public EfreetWeaponmaster(UUID ownerId) {
super(ownerId, 175, "Efreet Weaponmaster", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{R}{W}");
this.expansionSetCode = "KTK";
this.subtype.add("Efreet");
this.subtype.add("Monk");
this.color.setRed(true);
this.color.setBlue(true);
this.color.setWhite(true);
this.power = new MageInt(4);
this.toughness = new MageInt(3);
// First strike
this.addAbility(FirstStrikeAbility.getInstance());
// When Efreet Weaponmaster enters the battlefield or is turned face up, another target creature you control gets +3/+0 until end of turn.
this.addAbility(new EfreetWeaponmasterAbility());
// Morph {2}{U}{R}{W}
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}{U}{R}{W}")));
}
public EfreetWeaponmaster(final EfreetWeaponmaster card) {
super(card);
}
@Override
public EfreetWeaponmaster copy() {
return new EfreetWeaponmaster(this);
}
}
class EfreetWeaponmasterAbility extends TriggeredAbilityImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another target creature you control");
static {
filter.add(new AnotherPredicate());
}
public EfreetWeaponmasterAbility() {
super(Zone.BATTLEFIELD, new BoostTargetEffect(3,0, Duration.EndOfTurn), false);
this.addTarget(new TargetControlledCreaturePermanent(filter));
this.setWorksFaceDown(true);
}
public EfreetWeaponmasterAbility(final EfreetWeaponmasterAbility ability) {
super(ability);
}
@Override
public EfreetWeaponmasterAbility copy() {
return new EfreetWeaponmasterAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.TURNEDFACEUP && event.getTargetId().equals(this.getSourceId())) {
return true;
}
if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD && event.getTargetId().equals(this.getSourceId()) ) {
return true;
}
return false;
}
@Override
public String getRule() {
return "When {this} enters the battlefield or is turned face up, " + super.getRule();
}
}

View file

@ -0,0 +1,89 @@
/*
* 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.khansoftarkir;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawDiscardControllerEffect;
import mage.abilities.effects.common.UntapAllControllerEffect;
import mage.abilities.effects.common.continious.BoostControlledEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.filter.FilterSpell;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetControlledCreaturePermanent;
/**
*
* @author LevelX2
*/
public class JeskaiAscendancy extends CardImpl {
private static final FilterSpell filterNonCreature = new FilterSpell("a noncreature spell");
static {
filterNonCreature.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
}
public JeskaiAscendancy(UUID ownerId) {
super(ownerId, 180, "Jeskai Ascendancy", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{U}{R}{W}");
this.expansionSetCode = "KTK";
this.color.setRed(true);
this.color.setBlue(true);
this.color.setWhite(true);
// Whenever you cast a noncreature spell, creatures you control get +1/+1 until end of turn. Untap those creatures.
Effect effect = new BoostControlledEffect(1,1,Duration.EndOfTurn);
Ability ability = new SpellCastControllerTriggeredAbility(effect, filterNonCreature, false);
effect = new UntapAllControllerEffect(new FilterCreaturePermanent(),"Untap those creatures");
ability.addEffect(effect);
this.addAbility(ability);
// Whenever you cast a noncreature spell, you may draw a card. If you do, discard a card.
effect = new DrawDiscardControllerEffect(1,1);
effect.setText("you may draw a card. If you do, discard a card");
ability = new SpellCastControllerTriggeredAbility(effect, filterNonCreature, true);
this.addAbility(ability);
}
public JeskaiAscendancy(final JeskaiAscendancy card) {
super(card);
}
@Override
public JeskaiAscendancy copy() {
return new JeskaiAscendancy(this);
}
}

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.khansoftarkir;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.PutOnLibraryTargetEffect;
import mage.abilities.effects.common.continious.BoostControlledEffect;
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetOpponent;
/**
*
* @author LevelX2
*/
public class JeskaiCharm extends CardImpl {
public JeskaiCharm(UUID ownerId) {
super(ownerId, 181, "Jeskai Charm", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{U}{R}{W}");
this.expansionSetCode = "KTK";
this.color.setRed(true);
this.color.setBlue(true);
this.color.setWhite(true);
// Choose one -
// - Put target creature on top of its owner's library.
this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
// - Jeskai Charm deals 4 damage to target opponent.
Mode mode = new Mode();
mode.getEffects().add(new DamageTargetEffect(4));
mode.getTargets().add(new TargetOpponent());
this.getSpellAbility().addMode(mode);
// - Creatures you control get +1/+1 and gain lifelink until end of turn.
mode = new Mode();
Effect effect = new BoostControlledEffect(1,1, Duration.EndOfTurn);
effect.setText("Creatures you control get +1/+1");
mode.getEffects().add(effect);
effect = new GainAbilityControlledEffect(LifelinkAbility.getInstance(), Duration.EndOfTurn, new FilterControlledCreaturePermanent());
effect.setText("and gain lifelink until end of turn");
mode.getEffects().add(effect);
this.getSpellAbility().addMode(mode);
}
public JeskaiCharm(final JeskaiCharm card) {
super(card);
}
@Override
public JeskaiCharm copy() {
return new JeskaiCharm(this);
}
}

View file

@ -0,0 +1,203 @@
/*
* 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.khansoftarkir;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author LevelX2
*/
public class KheruLichLord extends CardImpl {
public KheruLichLord(UUID ownerId) {
super(ownerId, 182, "Kheru Lich Lord", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{G}{U}");
this.expansionSetCode = "KTK";
this.subtype.add("Zombie");
this.subtype.add("Wizard");
this.color.setBlue(true);
this.color.setGreen(true);
this.color.setBlack(true);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// At the beginning of your upkeep, you may pay {2}{B}. If you do, return a creature card at random from your graveyard to the battlefield. It gains flying, trample, and haste. Exile that card at the beginning of the next end step. If that card would leave the battlefield, exile it instead of putting it anywhere else.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD,
new DoIfCostPaid(new KheruLichLordEffect(), new ManaCostsImpl("{2}{B}"), "Return creature card from your graveyard?"), TargetController.YOU, false));
}
public KheruLichLord(final KheruLichLord card) {
super(card);
}
@Override
public KheruLichLord copy() {
return new KheruLichLord(this);
}
}
class KheruLichLordEffect extends OneShotEffect {
public KheruLichLordEffect() {
super(Outcome.Benefit);
this.staticText = "return a creature card at random from your graveyard to the battlefield. It gains flying, trample, and haste. Exile that card at the beginning of the next end step. If that card would leave the battlefield, exile it instead of putting it anywhere else";
}
public KheruLichLordEffect(final KheruLichLordEffect effect) {
super(effect);
}
@Override
public KheruLichLordEffect copy() {
return new KheruLichLordEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Cards cards = new CardsImpl();
for (Card card : controller.getGraveyard().getCards(new FilterCreatureCard(), source.getSourceId(), source.getControllerId(), game)) {
cards.add(card.getId());
}
if (cards.size() > 0) {
Card card = cards.getRandom(game);
controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId());
Permanent permanent = game.getPermanent(card.getId());
if (permanent != null) {
ContinuousEffect effect = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent.getId()));
game.addEffect(effect, source);
effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent.getId()));
game.addEffect(effect, source);
effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent.getId()));
game.addEffect(effect, source);
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(permanent.getId()));
DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
KheruLichLordReplacementEffect replacementEffect = new KheruLichLordReplacementEffect();
replacementEffect.setTargetPointer(new FixedTarget(permanent.getId()));
game.addEffect(replacementEffect, source);
}
}
return true;
}
return false;
}
}
class KheruLichLordReplacementEffect extends ReplacementEffectImpl {
KheruLichLordReplacementEffect() {
super(Duration.EndOfTurn, Outcome.Exile);
staticText = "If that card would leave the battlefield, exile it instead of putting it anywhere else";
}
KheruLichLordReplacementEffect(final KheruLichLordReplacementEffect effect) {
super(effect);
}
@Override
public KheruLichLordReplacementEffect copy() {
return new KheruLichLordReplacementEffect(this);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (card != null) {
controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, null);
}
}
return true;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE
&& event.getTargetId().equals(getTargetPointer().getFirst(game, source))
&& ((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD)
&& !((ZoneChangeEvent) event).getToZone().equals(Zone.EXILED)) {
return true;
}
return false;
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
}

View file

@ -0,0 +1,114 @@
/*
* 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.khansoftarkir;
import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continious.BoostControlledEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.other.FaceDownPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/**
*
* @author LevelX2
*/
public class SecretPlan extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Face-down creatures you control");
static {
filter.add(new FaceDownPredicate());
}
public SecretPlan(UUID ownerId) {
super(ownerId, 198, "Secret Plan", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}{U}");
this.expansionSetCode = "KTK";
this.color.setBlue(true);
this.color.setGreen(true);
// Face-down creatures you control get +0/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0,1, Duration.WhileOnBattlefield, filter)));
// Whenever a permanent you control is turned face up, draw a card.
this.addAbility(new SecretPlanTriggeredAbility(new DrawCardSourceControllerEffect(1), false));
}
public SecretPlan(final SecretPlan card) {
super(card);
}
@Override
public SecretPlan copy() {
return new SecretPlan(this);
}
}
class SecretPlanTriggeredAbility extends TriggeredAbilityImpl{
public SecretPlanTriggeredAbility(Effect effect, boolean optional) {
super(Zone.BATTLEFIELD, effect, optional);
}
public SecretPlanTriggeredAbility(final SecretPlanTriggeredAbility ability) {
super(ability);
}
@Override
public SecretPlanTriggeredAbility copy() {
return new SecretPlanTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.TURNEDFACEUP) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent.getControllerId().equals(this.controllerId)) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "When a permanent you control is turned face up, " + super.getRule();
}
}

View file

@ -0,0 +1,96 @@
/*
* 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.khansoftarkir;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.CantCounterAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.CantCounterControlledEffect;
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
import mage.abilities.keyword.FlashAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
* @author LevelX2
*/
public class SurrakDragonclaw extends CardImpl {
private static final FilterSpell filterTarget = new FilterSpell("Creature spells you control");
static {
filterTarget.add(new CardTypePredicate(CardType.CREATURE));
}
public SurrakDragonclaw(UUID ownerId) {
super(ownerId, 206, "Surrak Dragonclaw", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}{U}{R}");
this.expansionSetCode = "KTK";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Warrior");
this.color.setRed(true);
this.color.setBlue(true);
this.color.setGreen(true);
this.power = new MageInt(6);
this.toughness = new MageInt(6);
// Flash
this.addAbility(FlashAbility.getInstance());
// Surrak Dragonclaw can't be countered.
this.addAbility(new CantCounterAbility());
// Creature spells you control can't be countered.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantCounterControlledEffect(filterTarget, null, Duration.WhileOnBattlefield)));
// Other creatures you control have trample.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true)));
}
public SurrakDragonclaw(final SurrakDragonclaw card) {
super(card);
}
@Override
public SurrakDragonclaw copy() {
return new SurrakDragonclaw(this);
}
}

View file

@ -116,7 +116,7 @@ class GolemArtisanEffect extends OneShotEffect {
Choice abilityChoice = new ChoiceImpl(); Choice abilityChoice = new ChoiceImpl();
abilityChoice.setMessage("Choose an ability to add"); abilityChoice.setMessage("Choose an ability to add");
Set<String> abilities = new HashSet<String>(); Set<String> abilities = new HashSet<>();
abilities.add(FlyingAbility.getInstance().getRule()); abilities.add(FlyingAbility.getInstance().getRule());
abilities.add(TrampleAbility.getInstance().getRule()); abilities.add(TrampleAbility.getInstance().getRule());
abilities.add(HasteAbility.getInstance().getRule()); abilities.add(HasteAbility.getInstance().getRule());

View file

@ -118,6 +118,7 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost
public MorphAbility(Card card, Costs morphCosts) { public MorphAbility(Card card, Costs morphCosts) {
super(Zone.HAND, null); super(Zone.HAND, null);
card.setMorphCard(true); card.setMorphCard(true);
this.setWorksFaceDown(true);
name = ABILITY_KEYWORD; name = ABILITY_KEYWORD;
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(ABILITY_KEYWORD).append(" "); sb.append(ABILITY_KEYWORD).append(" ");

View file

@ -41,7 +41,6 @@ import mage.Mana;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.PlayLandAbility; import mage.abilities.PlayLandAbility;
import mage.abilities.SpellAbility; import mage.abilities.SpellAbility;
import mage.abilities.common.ZoneChangeAllTriggeredAbility;
import mage.abilities.mana.ManaAbility; import mage.abilities.mana.ManaAbility;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
@ -339,8 +338,10 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
} }
game.rememberLKI(objectId, event.getFromZone(), this); game.rememberLKI(objectId, event.getFromZone(), this);
} }
if (isFaceDown() && !event.getToZone().equals(Zone.BATTLEFIELD)) { // to battlefield is possible because of Morph if (isFaceDown() && !event.getToZone().equals(Zone.BATTLEFIELD)) { // to battlefield is possible because of Morph
setFaceDown(false); setFaceDown(false);
game.getCard(this.getId()).setFaceDown(false);
} }
updateZoneChangeCounter(); updateZoneChangeCounter();
switch (event.getToZone()) { switch (event.getToZone()) {