[JOU] Added 11 cards.

This commit is contained in:
LevelX2 2014-04-14 15:25:27 +02:00
parent db3d40b7a6
commit 56056170e0
19 changed files with 1347 additions and 41 deletions

View file

@ -28,19 +28,13 @@
package mage.sets.bornofthegods;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.choices.ChoiceColor;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.permanent.token.Token;
import mage.sets.bornofthegods.TokenAndCounters.GoldToken;
import mage.target.common.TargetCreaturePermanent;
/**
@ -73,17 +67,3 @@ public class Gild extends CardImpl<Gild> {
return new Gild(this);
}
}
class GoldToken extends Token {
public GoldToken() {
super("Gold", "colorless artifact token named Gold onto the battlefield. It has \"Sacrifice this artifact: Add one mana of any color to your mana pool.\"");
this.setOriginalExpansionSetCode("BNG");
cardType.add(CardType.ARTIFACT);
subtype.add("Gold");
Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new SacrificeSourceCost());
ability.addChoice(new ChoiceColor());
this.addAbility(ability);
}
}

View file

@ -0,0 +1,56 @@
/*
* 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.bornofthegods.TokenAndCounters;
import mage.abilities.Ability;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.common.AddManaOfAnyColorEffect;
import mage.abilities.mana.SimpleManaAbility;
import mage.choices.ChoiceColor;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.game.permanent.token.Token;
/**
*
* @author LevelX2
*/
public class GoldToken extends Token {
public GoldToken() {
super("Gold", "colorless artifact token named Gold onto the battlefield. It has \"Sacrifice this artifact: Add one mana of any color to your mana pool.\"");
this.setOriginalExpansionSetCode("BNG");
cardType.add(CardType.ARTIFACT);
subtype.add("Gold");
Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new SacrificeSourceCost());
ability.addChoice(new ChoiceColor());
this.addAbility(ability);
}
}

View file

@ -0,0 +1,54 @@
/*
* 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.futuresight;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author LevelX2
*/
public class RiddleOfLightning extends mage.sets.journeyintonyx.RiddleOfLightning {
public RiddleOfLightning(UUID ownerId) {
super(ownerId);
this.cardNumber = 105;
this.expansionSetCode = "FUT";
this.rarity = Rarity.COMMON;
}
public RiddleOfLightning(final RiddleOfLightning card) {
super(card);
}
@Override
public RiddleOfLightning copy() {
return new RiddleOfLightning(this);
}
}

View file

@ -0,0 +1,144 @@
/*
* 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.journeyintonyx;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continious.LoseCreatureTypeSourceEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.other.OwnerPredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetOpponent;
/**
*
* @author LevelX2
*/
public class AthreosGodOfPassage extends CardImpl<AthreosGodOfPassage> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature you own");
static {
filter.add(new AnotherPredicate());
filter.add(new OwnerPredicate(TargetController.YOU));
}
public AthreosGodOfPassage(UUID ownerId) {
super(ownerId, 146, "Athreos, God of Passage", Rarity.MYTHIC, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{1}{W}{B}");
this.expansionSetCode = "JOU";
this.supertype.add("Legendary");
this.subtype.add("God");
this.color.setBlack(true);
this.color.setWhite(true);
this.power = new MageInt(5);
this.toughness = new MageInt(4);
// Indestructible
this.addAbility(IndestructibleAbility.getInstance());
// As long as your devotion to white and black is less than seven, Athreos isn't a creature.
Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ColoredManaSymbol.W, ColoredManaSymbol.B), 7);
effect.setText("As long as your devotion to white and black is less than seven, Athreos isn't a creature");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
// Whenever another creature you own dies, return it to your hand unless target opponent pays 3 life.
Ability ability = new DiesCreatureTriggeredAbility(new AthreosGodOfPassageReturnEffect(), false, filter, true);
ability.addTarget(new TargetOpponent(true));
this.addAbility(ability);
}
public AthreosGodOfPassage(final AthreosGodOfPassage card) {
super(card);
}
@Override
public AthreosGodOfPassage copy() {
return new AthreosGodOfPassage(this);
}
}
class AthreosGodOfPassageReturnEffect extends OneShotEffect<AthreosGodOfPassageReturnEffect> {
public AthreosGodOfPassageReturnEffect() {
super(Outcome.Benefit);
this.staticText = "return it to your hand unless target opponent pays 3 life";
}
public AthreosGodOfPassageReturnEffect(final AthreosGodOfPassageReturnEffect effect) {
super(effect);
}
@Override
public AthreosGodOfPassageReturnEffect copy() {
return new AthreosGodOfPassageReturnEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Permanent creature = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
if (creature != null) {
Player opponent = game.getPlayer(source.getFirstTarget());
boolean paid = false;
if (opponent != null) {
if (opponent.chooseUse(outcome, new StringBuilder("Pay 3 live or ").append(creature.getName()).append(" returns to ").append(controller.getName()).append("'s hand?").toString(), game)) {
Cost cost = new PayLifeCost(3);
if (!cost.pay(source, game, source.getSourceId(), opponent.getId(), false)) {
paid = true;
}
}
}
if (opponent == null || !paid) {
controller.moveCardToHandWithInfo(creature, source.getSourceId(), game, null);
}
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,116 @@
/*
* 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.journeyintonyx;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.BecomesMonstrousSourceTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.MonstrosityAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.game.permanent.token.Token;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class HydraBroodmaster extends CardImpl<HydraBroodmaster> {
public HydraBroodmaster(UUID ownerId) {
super(ownerId, 128, "Hydra Broodmaster", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}{G}");
this.expansionSetCode = "JOU";
this.subtype.add("Hydra");
this.color.setGreen(true);
this.power = new MageInt(7);
this.toughness = new MageInt(7);
// {X}{X}{G}: Monstrosity X
this.addAbility(new MonstrosityAbility("{X}{X}{G}", Integer.MAX_VALUE));
// When Hydra Broodmaster becomes monstrous, put X X/X green Hydra creature tokens onto the battlefield.
this.addAbility(new BecomesMonstrousSourceTriggeredAbility(new HydraBroodmasterEffect()));
}
public HydraBroodmaster(final HydraBroodmaster card) {
super(card);
}
@Override
public HydraBroodmaster copy() {
return new HydraBroodmaster(this);
}
}
class HydraBroodmasterEffect extends OneShotEffect<HydraBroodmasterEffect> {
public HydraBroodmasterEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "put X X/X green Hydra creature tokens onto the battlefield";
}
public HydraBroodmasterEffect(final HydraBroodmasterEffect effect) {
super(effect);
}
@Override
public HydraBroodmasterEffect copy() {
return new HydraBroodmasterEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
int xValue = ((BecomesMonstrousSourceTriggeredAbility) source).getMonstrosityValue();
return new CreateTokenEffect(new HydraBroodmasterToken(xValue, xValue), xValue).apply(game, source);
}
return false;
}
}
class HydraBroodmasterToken extends Token {
public HydraBroodmasterToken(int power, int toughness) {
super("Hydra", "green Hydra creature token");
this.setOriginalExpansionSetCode("JOU");
cardType.add(CardType.CREATURE);
color = ObjectColor.GREEN;
subtype.add("Hydra");
this.power = new MageInt(power);
this.toughness = new MageInt(toughness);
}
}

View file

@ -0,0 +1,93 @@
/*
* 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.journeyintonyx;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.InspiredAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.sets.bornofthegods.TokenAndCounters.GoldToken;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class KingMacarTheGoldCursed extends CardImpl<KingMacarTheGoldCursed> {
public KingMacarTheGoldCursed(UUID ownerId) {
super(ownerId, 74, "King Macar, the Gold-Cursed", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}");
this.expansionSetCode = "JOU";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.color.setBlack(true);
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// Inspired - Whenever King Macar, the Gold-Cursed becomes untapped, you may exile target creature. If you do, put a colorless artifact token named Gold onto the battlefield. It has "Sacrifice this artifact: Add one mana of any color to your mana pool."
Ability ability = new InspiredAbility(new ExileTargetEffect(), true);
ability.addTarget(new TargetCreaturePermanent(true));
Effect effect = new CreateTokenEffect(new GoldToken());
effect.setText("If you do, put a colorless artifact token named Gold onto the battlefield. It has \"Sacrifice this artifact: Add one mana of any color to your mana pool.\"");
ability.addEffect(effect);
this.addAbility(ability);
}
public KingMacarTheGoldCursed(final KingMacarTheGoldCursed card) {
super(card);
}
@Override
public KingMacarTheGoldCursed copy() {
return new KingMacarTheGoldCursed(this);
}
}
//
//class GoldToken extends Token {
//
// public GoldToken() {
// super("Gold", "colorless artifact token named Gold onto the battlefield. It has \"Sacrifice this artifact: Add one mana of any color to your mana pool.\"");
// this.setOriginalExpansionSetCode("BNG");
// cardType.add(CardType.ARTIFACT);
// subtype.add("Gold");
//
// Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(), new SacrificeSourceCost());
// ability.addChoice(new ChoiceColor());
// this.addAbility(ability);
// }
//}

View file

@ -45,8 +45,6 @@ public class ManaConfluence extends CardImpl<ManaConfluence> {
super(ownerId, 163, "Mana Confluence", Rarity.RARE, new CardType[]{CardType.LAND}, "");
this.expansionSetCode = "JOU";
this.color.setGreen(true);
// {T}, Pay 1 life: Add one mana of any color to your mana pool.
Ability ability = new AnyColorManaAbility();
ability.addCost(new PayLifeCost(1));

View file

@ -0,0 +1,69 @@
/*
* 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.journeyintonyx;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.common.DrawCardAllEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
/**
*
* @author LevelX2
*/
public class MasterOfTheFeast extends CardImpl<MasterOfTheFeast> {
public MasterOfTheFeast(UUID ownerId) {
super(ownerId, 75, "Master of the Feast", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{1}{B}{B}");
this.expansionSetCode = "JOU";
this.subtype.add("Demon");
this.color.setBlack(true);
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// Flying
this.addAbility(FlyingAbility.getInstance());
// At the beginning of your upkeep, each opponent draws a card.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DrawCardAllEffect(1, TargetController.OPPONENT), TargetController.YOU, false));
}
public MasterOfTheFeast(final MasterOfTheFeast card) {
super(card);
}
@Override
public MasterOfTheFeast copy() {
return new MasterOfTheFeast(this);
}
}

View file

@ -0,0 +1,143 @@
/*
* 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.journeyintonyx;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.DevotionCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continious.LoseCreatureTypeSourceEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.permanent.token.Token;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCardInGraveyard;
/**
*
* @author LevelX2
*/
public class PharikaGodOfAffliction extends CardImpl<PharikaGodOfAffliction> {
public PharikaGodOfAffliction(UUID ownerId) {
super(ownerId, 154, "Pharika, God of Affliction", Rarity.MYTHIC, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{1}{B}{G}");
this.expansionSetCode = "JOU";
this.supertype.add("Legendary");
this.subtype.add("God");
this.color.setGreen(true);
this.color.setBlack(true);
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// Indestructible
this.addAbility(IndestructibleAbility.getInstance());
// As long as your devotion to black and green is less than seven, Pharika isn't a creature.
Effect effect = new LoseCreatureTypeSourceEffect(new DevotionCount(ColoredManaSymbol.B, ColoredManaSymbol.G), 7);
effect.setText("As long as your devotion to black and green is less than seven, Pharika isn't a creature");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
// BG: Exile target creature card from a graveyard. It's owner puts a 1/1 black and green Snake enchantment creature token with deathtouch onto the battlefield.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PharikaExileEffect(), new ManaCostsImpl("{B}{G}"));
Target target = new TargetCardInGraveyard(new FilterCreatureCard("a creature card from a graveyard"));
target.setRequired(true);
ability.addTarget(target);
this.addAbility(ability);
}
public PharikaGodOfAffliction(final PharikaGodOfAffliction card) {
super(card);
}
@Override
public PharikaGodOfAffliction copy() {
return new PharikaGodOfAffliction(this);
}
}
class PharikaExileEffect extends OneShotEffect<PharikaExileEffect> {
public PharikaExileEffect() {
super(Outcome.PutCreatureInPlay);
staticText = "Exile target creature card from a graveyard. It's owner puts a 1/1 black and green Snake enchantment creature token with deathtouch onto the battlefield";
}
public PharikaExileEffect(final PharikaExileEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Card targetCard = game.getCard(source.getFirstTarget());
if (targetCard != null) {
Player tokenController = game.getPlayer(targetCard.getOwnerId());
if (tokenController != null) {
return new PharikaSnakeToken().putOntoBattlefield(1, game, source.getSourceId(), tokenController.getId());
}
}
return false;
}
@Override
public PharikaExileEffect copy() {
return new PharikaExileEffect(this);
}
}
class PharikaSnakeToken extends Token {
public PharikaSnakeToken() {
super("Snake", "1/1 black and green Snake enchantment creature token with deathtouch");
this.setOriginalExpansionSetCode("JOU");
cardType.add(CardType.ENCHANTMENT);
cardType.add(CardType.CREATURE);
subtype.add("Snake");
color.setBlack(true);
color.setGreen(true);
power.setValue(1);
toughness.setValue(1);
this.addAbility(DeathtouchAbility.getInstance());
}
}

View file

@ -60,7 +60,7 @@ public class PheresBandWarchief extends CardImpl<PheresBandWarchief> {
}
public PheresBandWarchief(UUID ownerId) {
super(ownerId, 135, "Pheres Band Warchief", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}");
super(ownerId, 135, "Pheres-Band Warchief", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.expansionSetCode = "JOU";
this.subtype.add("Centaur");
this.subtype.add("Warrior");

View file

@ -0,0 +1,115 @@
/*
* 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.journeyintonyx;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.abilityword.StriveAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CopyPermanentEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
import mage.util.functions.EmptyApplyToPermanent;
/**
*
* @author LevelX2
*/
public class PolymorphousRush extends CardImpl<PolymorphousRush> {
public PolymorphousRush(UUID ownerId) {
super(ownerId, 46, "Polymorphous Rush", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{U}");
this.expansionSetCode = "JOU";
this.color.setBlue(true);
// Strive - Polymorphous Rush costs {1}{U} more to cast for each target beyond the first.
this.addAbility(new StriveAbility("{1}{U}"));
// Choose a creature on the battlefield. Any number of target creatures you control each become a copy of that creature until end of turn.
Target target = new TargetCreaturePermanent(new FilterCreaturePermanent(""));
target.setNotTarget(true);
target.setTargetName("a creature on the battlefield (creature to copy)");
this.getSpellAbility().addTarget(target);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE));
this.getSpellAbility().addEffect(new PolymorphousRushCopyEffect());
}
public PolymorphousRush(final PolymorphousRush card) {
super(card);
}
@Override
public PolymorphousRush copy() {
return new PolymorphousRush(this);
}
}
class PolymorphousRushCopyEffect extends OneShotEffect<PolymorphousRushCopyEffect> {
public PolymorphousRushCopyEffect() {
super(Outcome.Copy);
this.staticText = "Choose a creature on the battlefield. Any number of target creatures you control each become a copy of that creature until end of turn";
}
public PolymorphousRushCopyEffect(final PolymorphousRushCopyEffect effect) {
super(effect);
}
@Override
public PolymorphousRushCopyEffect copy() {
return new PolymorphousRushCopyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Permanent copyFromCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
if (copyFromCreature != null) {
for (UUID copyToId: source.getTargets().get(1).getTargets()) {
Permanent copyToCreature = game.getPermanent(copyToId);
if (copyToCreature != null) {
game.copyPermanent(Duration.EndOfTurn, copyFromCreature, copyToCreature, source, new EmptyApplyToPermanent());
}
}
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,176 @@
/*
* 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.journeyintonyx;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.PhaseStep;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.turn.Step;
import mage.players.Library;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class PropheticFlamespeaker extends CardImpl<PropheticFlamespeaker> {
public PropheticFlamespeaker(UUID ownerId) {
super(ownerId, 165, "Prophetic Flamespeaker", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{1}{R}{R}");
this.expansionSetCode = "JOU";
this.subtype.add("Human");
this.subtype.add("Shaman");
this.color.setRed(true);
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// Double strike
this.addAbility(DoubleStrikeAbility.getInstance());
// Trample
this.addAbility(TrampleAbility.getInstance());
// Whenever Prophetic Flamespeaker deals combat damage to a player, exile the top card of your library. You may play it this turn.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new PropheticFlamespeakerExileEffect(), false));
}
public PropheticFlamespeaker(final PropheticFlamespeaker card) {
super(card);
}
@Override
public PropheticFlamespeaker copy() {
return new PropheticFlamespeaker(this);
}
}
class PropheticFlamespeakerExileEffect extends OneShotEffect<PropheticFlamespeakerExileEffect> {
public PropheticFlamespeakerExileEffect() {
super(Outcome.Detriment);
this.staticText = "Exile the top card of your library. You may play it this turn";
}
public PropheticFlamespeakerExileEffect(final PropheticFlamespeakerExileEffect effect) {
super(effect);
}
@Override
public PropheticFlamespeakerExileEffect copy() {
return new PropheticFlamespeakerExileEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (sourcePermanent != null && controller != null && controller.getLibrary().size() > 0) {
Library library = controller.getLibrary();
Card card = library.removeFromTop(game);
if (card != null) {
String exileName = new StringBuilder(sourcePermanent.getName()).append(" <this card may be played the turn it was exiled>").toString();
controller.moveCardToExileWithInfo(card, source.getSourceId(), exileName, source.getSourceId(), game, Zone.LIBRARY);
game.addEffect(new PropheticFlamespeakerCastFromExileEffect(card.getId()), source);
}
return true;
}
return false;
}
}
class PropheticFlamespeakerCastFromExileEffect extends AsThoughEffectImpl<PropheticFlamespeakerCastFromExileEffect> {
private final UUID cardId;
public PropheticFlamespeakerCastFromExileEffect(UUID cardId) {
super(AsThoughEffectType.CAST, Duration.EndOfTurn, Outcome.Benefit);
staticText = "You may play card from exile";
this.cardId = cardId;
}
public PropheticFlamespeakerCastFromExileEffect(final PropheticFlamespeakerCastFromExileEffect effect) {
super(effect);
cardId = effect.cardId;
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public PropheticFlamespeakerCastFromExileEffect copy() {
return new PropheticFlamespeakerCastFromExileEffect(this);
}
@Override
public boolean applies(UUID sourceId, Ability source, Game game) {
if (sourceId.equals(this.cardId)) {
Card card = game.getCard(this.cardId);
if (card != null && game.getState().getZone(this.cardId) == Zone.EXILED) {
Player player = game.getPlayer(source.getControllerId());
if (player != null ) {
if (card.getCardType().contains(CardType.LAND)) {
// If the revealed card is a land, you can play it only if it's your turn and you haven't yet played a land this turn.
if (player.canPlayLand()
&& game.getActivePlayerId().equals(player.getId())
&& game.getStack().isEmpty()
&& (game.getStep().getType().equals(PhaseStep.PRECOMBAT_MAIN) || game.getStep().getType().equals(PhaseStep.POSTCOMBAT_MAIN))
&& player.chooseUse(Outcome.Benefit, "Play this card?", game)) {
return player.playLand(card, game);
}
} else {
Ability ability = card.getSpellAbility();
if (ability != null && ability instanceof SpellAbility
&& ((SpellAbility)ability).spellCanBeActivatedRegularlyNow(player.getId(), game)
&& player.chooseUse(Outcome.Benefit, "Play this card?", game)) {
return player.cast((SpellAbility) ability, game, false);
}
}
}
}
}
return false;
}
}

View file

@ -0,0 +1,115 @@
/*
* 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.journeyintonyx;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ScryEffect;
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.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreatureOrPlayer;
/**
*
* @author LevelX2
*/
public class RiddleOfLightning extends CardImpl<RiddleOfLightning> {
public RiddleOfLightning(UUID ownerId) {
super(ownerId, 107, "Riddle of Lightning", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{R}{R}");
this.expansionSetCode = "JOU";
this.color.setRed(true);
// Choose target creature or player. Scry 3, then reveal the top card of your library. Riddle of Lightning deals damage equal to that card's converted mana cost to that creature or player.
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer(true));
Effect effect = new ScryEffect(3);
effect.setText("Choose target creature or player. Scry 3");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addEffect(new RiddleOfLightningEffect());
}
public RiddleOfLightning(final RiddleOfLightning card) {
super(card);
}
@Override
public RiddleOfLightning copy() {
return new RiddleOfLightning(this);
}
}
class RiddleOfLightningEffect extends OneShotEffect<RiddleOfLightningEffect> {
public RiddleOfLightningEffect() {
super(Outcome.Damage);
this.staticText = ", then reveal the top card of your library. {this} deals damage equal to that card's converted mana cost to that creature or player";
}
public RiddleOfLightningEffect(final RiddleOfLightningEffect effect) {
super(effect);
}
@Override
public RiddleOfLightningEffect copy() {
return new RiddleOfLightningEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Card sourceCard = game.getCard(source.getSourceId());
if (sourceCard != null && controller != null) {
if (controller.getLibrary().size() > 0) {
Card card = controller.getLibrary().getFromTop(game);
controller.revealCards(sourceCard.getName(), new CardsImpl(card), game);
Permanent targetCreature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
if (targetCreature != null) {
targetCreature.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, true, false);
return true;
}
Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (targetPlayer != null) {
targetPlayer.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true);
return true;
}
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,81 @@
/*
* 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.journeyintonyx;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ReturnToHandChosenControlledPermanentEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
* @author LevelX2
*/
public class RiptideChimera extends CardImpl<RiptideChimera> {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("an enchanment you control");
static {
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
public RiptideChimera(UUID ownerId) {
super(ownerId, 48, "Riptide Chimera", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{2}{U}");
this.expansionSetCode = "JOU";
this.subtype.add("Chimera");
this.color.setBlue(true);
this.power = new MageInt(3);
this.toughness = new MageInt(4);
// Flying
this.addAbility(FlyingAbility.getInstance());
// At the beginning of your upkeep, return an enchanment you control to its owner's hand.
Effect effect = new ReturnToHandChosenControlledPermanentEffect(filter, 1);
effect.setText("return an enchanment you control to its owner's hand");
this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false));
}
public RiptideChimera(final RiptideChimera card) {
super(card);
}
@Override
public RiptideChimera copy() {
return new RiptideChimera(this);
}
}

View file

@ -0,0 +1,122 @@
/*
* 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.journeyintonyx;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.abilityword.StriveAbility;
import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EmptyToken;
import mage.players.Player;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
/**
*
* @author LevelX2
*/
public class Twinflame extends CardImpl<Twinflame> {
public Twinflame(UUID ownerId) {
super(ownerId, 115, "Twinflame", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{R}");
this.expansionSetCode = "JOU";
this.color.setRed(true);
// Strive - Twinflame costs 2R more to cast for each target beyond the first.
this.addAbility(new StriveAbility("{2}{R}"));
// Choose any number of target creatures you control. For each of them, put a token that's a copy of that creature onto the battlefield. Those tokens have haste. Exile them at the beginning of the next end step.
this.getSpellAbility().addEffect(new TwinflameCopyEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent(0, Integer.MAX_VALUE, new FilterControlledCreaturePermanent(), false));
}
public Twinflame(final Twinflame card) {
super(card);
}
@Override
public Twinflame copy() {
return new Twinflame(this);
}
}
class TwinflameCopyEffect extends OneShotEffect<TwinflameCopyEffect> {
public TwinflameCopyEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "Choose any number of target creatures you control. For each of them, put a token that's a copy of that creature onto the battlefield. Those tokens have haste. Exile them at the beginning of the next end step";
}
public TwinflameCopyEffect(final TwinflameCopyEffect effect) {
super(effect);
}
@Override
public TwinflameCopyEffect copy() {
return new TwinflameCopyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
for(UUID creatureId: this.getTargetPointer().getTargets(game, source)) {
Permanent creature = game.getPermanentOrLKIBattlefield(creatureId);
if (creature != null) {
EmptyToken token = new EmptyToken();
CardUtil.copyTo(token).from(creature);
token.addAbility(HasteAbility.getInstance());
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
ExileTargetEffect exileEffect = new ExileTargetEffect();
exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
game.addDelayedTriggeredAbility(delayedAbility);
}
}
return true;
}
return false;
}
}

View file

@ -45,7 +45,6 @@ import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.HasteAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;

View file

@ -133,7 +133,7 @@ class PolukranosWorldEaterEffect extends OneShotEffect<PolukranosWorldEaterEffec
public boolean apply(Game game, Ability source) {
if (source.getTargets().size() > 0) {
Target multiTarget = source.getTargets().get(0);
Set<Permanent> permanents = new HashSet<Permanent>();
Set<Permanent> permanents = new HashSet<>();
for (UUID target: multiTarget.getTargets()) {
Permanent permanent = game.getPermanent(target);
if (permanent != null) {

View file

@ -87,13 +87,18 @@ class StriveCostIncreasementEffect extends CostModificationEffectImpl<StriveCost
@Override
public boolean apply(Game game, Ability source, Ability abilityToModify) {
Target target = abilityToModify.getTargets().get(0);
// Target target = abilityToModify.getTargets().get(0);
for (Target target : abilityToModify.getTargets()) {
if (target.getMaxNumberOfTargets() == Integer.MAX_VALUE) {
int additionalTargets = target.getTargets().size() - 1;
for (int i = 0; i < additionalTargets; i++) {
abilityToModify.getManaCostsToPay().add(striveCosts.copy());
}
return true;
}
}
return false;
}
@Override
public boolean applies(Ability abilityToModify, Ability source, Game game) {

View file

@ -34,6 +34,7 @@ import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.game.Game;
import mage.players.Player;
import mage.util.CardUtil;
@ -44,22 +45,32 @@ import mage.util.CardUtil;
*/
public class DrawCardAllEffect extends OneShotEffect<DrawCardAllEffect> {
private TargetController targetController;
protected DynamicValue amount;
public DrawCardAllEffect(int amount) {
this(new StaticValue(amount));
this(amount, TargetController.ANY);
}
public DrawCardAllEffect(DynamicValue amount) {
this(amount, TargetController.ANY);
}
public DrawCardAllEffect(int amount, TargetController targetController) {
this(new StaticValue(amount), targetController);
}
public DrawCardAllEffect(DynamicValue amount, TargetController targetController) {
super(Outcome.DrawCard);
this.amount = amount;
staticText = "Each player draws " + CardUtil.numberToText(amount.toString()) + " card" + (amount.toString().equals("1")?"":"s");
this.targetController = targetController;
staticText = setText();
}
public DrawCardAllEffect(final DrawCardAllEffect effect) {
super(effect);
this.amount = effect.amount;
this.targetController = effect.targetController;
}
@Override
@ -69,15 +80,44 @@ public class DrawCardAllEffect extends OneShotEffect<DrawCardAllEffect> {
@Override
public boolean apply(Game game, Ability source) {
Player sourcePlayer = game.getPlayer(source.getControllerId());
switch(targetController) {
case ANY:
for (UUID playerId: sourcePlayer.getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null) {
player.drawCards(amount.calculate(game, source), game);
}
}
break;
case OPPONENT:
for (UUID playerId: game.getOpponents(sourcePlayer.getId())) {
Player player = game.getPlayer(playerId);
if (player != null) {
player.drawCards(amount.calculate(game, source), game);
}
}
break;
}
return true;
}
private String setText() {
StringBuilder sb = new StringBuilder("Each ");
switch(targetController) {
case ANY:
sb.append("player");
break;
case OPPONENT:
sb.append("opponent");
break;
default:
throw new UnsupportedOperationException("Not supported value for targetController");
}
sb.append(" draws ");
sb.append(CardUtil.numberToText(amount.toString(),"a"));
sb.append(" card");
sb.append(amount.toString().equals("1")?"":"s");
return sb.toString();
}
}