Merge origin/master

This commit is contained in:
LevelX2 2015-07-01 01:57:23 +02:00
commit 5f5513f4ed
12 changed files with 768 additions and 116 deletions

View file

@ -29,14 +29,11 @@
package mage.sets.magic2011;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
import mage.filter.FilterCard;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterInstantOrSorceryCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetCardInYourGraveyard;
/**

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.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.game.permanent.token.ThopterColorlessToken;
/**
*
* @author fireshoes
*/
public class AspiringAeronaut extends CardImpl {
public AspiringAeronaut(UUID ownerId) {
super(ownerId, 46, "Aspiring Aeronaut", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.expansionSetCode = "ORI";
this.subtype.add("Human");
this.subtype.add("Artificer");
this.power = new MageInt(1);
this.toughness = new MageInt(2);
// Flying
this.addAbility(FlyingAbility.getInstance());
// When Aspiring Aeronaut enters the battlefield, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield.
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken("ORI"))));
}
public AspiringAeronaut(final AspiringAeronaut card) {
super(card);
}
@Override
public AspiringAeronaut copy() {
return new AspiringAeronaut(this);
}
}

View file

@ -0,0 +1,61 @@
/*
* 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.magicorigins;
import java.util.UUID;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.common.CounterUnlessPaysEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.target.TargetSpell;
/**
*
* @author fireshoes
*/
public class ClashOfWills extends CardImpl {
public ClashOfWills(UUID ownerId) {
super(ownerId, 49, "Clash of Wills", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{X}{U}");
this.expansionSetCode = "ORI";
// Counter target spell unless its controller pays {X}.
this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new ManacostVariableValue()));
this.getSpellAbility().addTarget(new TargetSpell());
}
public ClashOfWills(final ClashOfWills card) {
super(card);
}
@Override
public ClashOfWills copy() {
return new ClashOfWills(this);
}
}

View file

@ -0,0 +1,107 @@
/*
* 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.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ExileFromGraveCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.CounterUnlessPaysEffect;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
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.FilterInstantOrSorceryCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetSpell;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author fireshoes
*/
public class DiscipleOfTheRing extends CardImpl {
private static final FilterSpell filterSpell = new FilterSpell("noncreature spell");
static {
filterSpell.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
}
public DiscipleOfTheRing(UUID ownerId) {
super(ownerId, 53, "Disciple of the Ring", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{U}{U}");
this.expansionSetCode = "ORI";
this.subtype.add("Human");
this.subtype.add("Wizard");
this.power = new MageInt(3);
this.toughness = new MageInt(4);
// {1}, Exile an instant or sorcery card from your graveyard: Choose one - Counter target noncreature spell unless its controller pay {2};
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new GenericManaCost(2)), new GenericManaCost(1));
ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(1, new FilterInstantOrSorceryCard("an instant or sorcery card from your graveyard"))));
ability.addTarget(new TargetSpell(filterSpell));
// or Disciple of the Ring gets +1/+1 until end of turn;
Mode mode = new Mode();
mode.getEffects().add(new BoostSourceEffect(1, 1, Duration.EndOfTurn));
ability.addMode(mode);
// or Tap target creature;
mode = new Mode();
mode.getEffects().add(new TapTargetEffect());
mode.getTargets().add(new TargetCreaturePermanent());
ability.addMode(mode);
// or Untap target creature.
mode = new Mode();
mode.getEffects().add(new UntapTargetEffect());
mode.getTargets().add(new TargetCreaturePermanent());
ability.addMode(mode);
this.addAbility(ability);
}
public DiscipleOfTheRing(final DiscipleOfTheRing card) {
super(card);
}
@Override
public DiscipleOfTheRing copy() {
return new DiscipleOfTheRing(this);
}
}

View file

@ -0,0 +1,120 @@
/*
* 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.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.dynamicvalue.common.CountersCount;
import mage.abilities.effects.EntersBattlefieldEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.ThopterColorlessToken;
/**
*
* @author fireshoes
*/
public class HangarbackWalker extends CardImpl {
public HangarbackWalker(UUID ownerId) {
super(ownerId, 229, "Hangarback Walker", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{X}{X}");
this.expansionSetCode = "ORI";
this.subtype.add("Construct");
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// Hangarback Walker enters the battlefield with X +1/+1 counters on it.
this.addAbility(new EntersBattlefieldAbility(new HangarbackWalkerEffect(), "with X +1/+1 counters on it"));
// When Hangarback Walker dies, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield for each +1/+1 counter on Hangarback Walker.
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken("ORI"), new CountersCount(CounterType.P1P1)), false));
// {1}, {t}: Put a +1/+1 counter on Hangarback Walker.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new GenericManaCost(1));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
public HangarbackWalker(final HangarbackWalker card) {
super(card);
}
@Override
public HangarbackWalker copy() {
return new HangarbackWalker(this);
}
}
class HangarbackWalkerEffect extends OneShotEffect {
public HangarbackWalkerEffect() {
super(Outcome.BoostCreature);
staticText = "{this} enters the battlefield with X +1/+1 counters on it";
}
public HangarbackWalkerEffect(final HangarbackWalkerEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
Object obj = getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
if (obj != null && obj instanceof SpellAbility) {
int amount = ((SpellAbility)obj).getManaCostsToPay().getX();
if (amount > 0) {
permanent.addCounters(CounterType.P1P1.createInstance(amount), game);
}
}
}
return true;
}
@Override
public HangarbackWalkerEffect copy() {
return new HangarbackWalkerEffect(this);
}
}

View file

@ -1,95 +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.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledArtifactPermanent;
import mage.game.permanent.token.Token;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreatureOrPlayer;
/**
*
* @author LevelX2
*/
public class PiaAndKiranNalaar extends CardImpl {
public PiaAndKiranNalaar(UUID ownerId) {
super(ownerId, 157, "Pia and Kiran Nalaar", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
this.expansionSetCode = "ORI";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Artificer");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// When Pia and Kiran Nalaar enters the battlefield put 2 1/1 colorless Thopter artifact creature tokens with flying onto the battlefield.
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new PiaAndKiranNalaarThopterToken(), 2)));
// {2}{R}, Sacrifice an artifact: Pia and Kiran Nalaar deals 2 damage to target creature or player.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{2}{R}"));
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1,1, new FilterControlledArtifactPermanent("an artifact"),true)));
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
}
public PiaAndKiranNalaar(final PiaAndKiranNalaar card) {
super(card);
}
@Override
public PiaAndKiranNalaar copy() {
return new PiaAndKiranNalaar(this);
}
}
class PiaAndKiranNalaarThopterToken extends Token {
PiaAndKiranNalaarThopterToken() {
super("Thopter", "a 1/1 colorless Thopter artifact creature token with flying");
cardType.add(CardType.CREATURE);
cardType.add(CardType.ARTIFACT);
subtype.add("Thopter");
power = new MageInt(1);
toughness = new MageInt(1);
this.addAbility(FlyingAbility.getInstance());
}
/*
* 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.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledArtifactPermanent;
import mage.game.permanent.token.ThopterColorlessToken;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreatureOrPlayer;
/**
*
* @author LevelX2
*/
public class PiaAndKiranNalaar extends CardImpl {
public PiaAndKiranNalaar(UUID ownerId) {
super(ownerId, 157, "Pia and Kiran Nalaar", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
this.expansionSetCode = "ORI";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Artificer");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// When Pia and Kiran Nalaar enters the battlefield put 2 1/1 colorless Thopter artifact creature tokens with flying onto the battlefield.
this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new ThopterColorlessToken("ORI"), 2)));
// {2}{R}, Sacrifice an artifact: Pia and Kiran Nalaar deals 2 damage to target creature or player.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{2}{R}"));
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1,1, new FilterControlledArtifactPermanent("an artifact"),true)));
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
}
public PiaAndKiranNalaar(final PiaAndKiranNalaar card) {
super(card);
}
@Override
public PiaAndKiranNalaar copy() {
return new PiaAndKiranNalaar(this);
}
}

View file

@ -0,0 +1,155 @@
/*
* 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.magicorigins;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterArtifactPermanent;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.ThopterColorlessToken;
/**
*
* @author fireshoes
*/
public class ThopterSpyNetwork extends CardImpl {
public ThopterSpyNetwork(UUID ownerId) {
super(ownerId, 79, "Thopter Spy Network", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}");
this.expansionSetCode = "ORI";
// At the beginning of your upkeep, if you control an artifact, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield.
this.addAbility(new ThopterSpyNetworkUpkeepTriggeredAbility());
// Whenever one or more artifact creatures you control deals combat damage to a player, draw a card.
this.addAbility(new ThopterSpyNetworkDamageTriggeredAbility());
}
public ThopterSpyNetwork(final ThopterSpyNetwork card) {
super(card);
}
@Override
public ThopterSpyNetwork copy() {
return new ThopterSpyNetwork(this);
}
}
class ThopterSpyNetworkUpkeepTriggeredAbility extends TriggeredAbilityImpl {
public ThopterSpyNetworkUpkeepTriggeredAbility() {
super(Zone.BATTLEFIELD, new CreateTokenEffect(new ThopterColorlessToken("ORI"), 1), false);
}
public ThopterSpyNetworkUpkeepTriggeredAbility(final ThopterSpyNetworkUpkeepTriggeredAbility ability) {
super(ability);
}
@Override
public ThopterSpyNetworkUpkeepTriggeredAbility copy() {
return new ThopterSpyNetworkUpkeepTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getPlayerId().equals(this.controllerId);
}
@Override
public boolean checkInterveningIfClause(Game game) {
return game.getBattlefield().countAll(new FilterArtifactPermanent(), this.controllerId, game) >= 1;
}
@Override
public String getRule() {
return "At the beginning of your upkeep, if you control an artifact, put a 1/1 colorless Thopter artifact creature token with flying onto the battlefield";
}
}
class ThopterSpyNetworkDamageTriggeredAbility extends TriggeredAbilityImpl {
List<UUID> damagedPlayerIds = new ArrayList<>();
public ThopterSpyNetworkDamageTriggeredAbility() {
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), false);
}
public ThopterSpyNetworkDamageTriggeredAbility(final ThopterSpyNetworkDamageTriggeredAbility ability) {
super(ability);
}
@Override
public ThopterSpyNetworkDamageTriggeredAbility copy() {
return new ThopterSpyNetworkDamageTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|| event.getType() == GameEvent.EventType.END_COMBAT_STEP_POST;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
if (((DamagedPlayerEvent) event).isCombatDamage()) {
Permanent creature = game.getPermanent(event.getSourceId());
if (creature != null && creature.getControllerId().equals(controllerId)
&& creature.getCardType().contains(CardType.ARTIFACT) && !damagedPlayerIds.contains(event.getTargetId())) {
damagedPlayerIds.add(event.getTargetId());
return true;
}
}
}
if (event.getType().equals(GameEvent.EventType.END_COMBAT_STEP_POST)){
damagedPlayerIds.clear();
}
return false;
}
@Override
public String getRule() {
return "Whenever one or more artifact creatures you control deals combat damage to a player, draw a card";
}
}

View file

@ -0,0 +1,112 @@
/*
* 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.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
import mage.abilities.keyword.FlashbackAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.CostModificationType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.util.CardUtil;
/**
*
* @author fireshoes
*/
public class VrynWingmare extends CardImpl {
public VrynWingmare(UUID ownerId) {
super(ownerId, 40, "Vryn Wingmare", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.expansionSetCode = "ORI";
this.subtype.add("Pegasus");
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Noncreature spells cost {1} more to cast.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new VrynWingmareCostReductionEffect()));
}
public VrynWingmare(final VrynWingmare card) {
super(card);
}
@Override
public VrynWingmare copy() {
return new VrynWingmare(this);
}
}
class VrynWingmareCostReductionEffect extends CostModificationEffectImpl {
VrynWingmareCostReductionEffect ( ) {
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST);
staticText = "Noncreature spells cost {1} more to cast";
}
VrynWingmareCostReductionEffect(VrynWingmareCostReductionEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source, Ability abilityToModify) {
CardUtil.increaseCost(abilityToModify, 1);
return true;
}
@Override
public boolean applies(Ability abilityToModify, Ability source, Game game) {
if (abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility) {
Card card = game.getCard(abilityToModify.getSourceId());
if (card != null && !card.getCardType().contains(CardType.CREATURE)) {
return true;
}
}
return false;
}
@Override
public VrynWingmareCostReductionEffect copy() {
return new VrynWingmareCostReductionEffect(this);
}
}

View file

@ -43,7 +43,7 @@ import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.ThopterColorlessToken;
/**
*
@ -88,7 +88,7 @@ class ThopterAssemblyTriggeredAbility extends TriggeredAbilityImpl {
ThopterAssemblyTriggeredAbility() {
super(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true));
this.addEffect(new CreateTokenEffect(new ThopterToken(), 5));
this.addEffect(new CreateTokenEffect(new ThopterColorlessToken(), 5));
}
ThopterAssemblyTriggeredAbility(final ThopterAssemblyTriggeredAbility ability) {
@ -119,16 +119,4 @@ class ThopterAssemblyTriggeredAbility extends TriggeredAbilityImpl {
public String getRule() {
return "At the beginning of your upkeep, if you control no Thopters other than {this}, return {this} to its owner's hand and put five 1/1 colorless Thopter artifact creature tokens with flying onto the battlefield";
}
}
class ThopterToken extends Token {
ThopterToken() {
super("Thopter", "a 1/1 colorless Thopter artifact creature token with flying");
cardType.add(CardType.CREATURE);
cardType.add(CardType.ARTIFACT);
subtype.add("Thopter");
power = new MageInt(1);
toughness = new MageInt(1);
this.addAbility(FlyingAbility.getInstance());
}
}
}