Merge pull request #962 from lunaskyrise/master

Add 18 new cards + change set package name
This commit is contained in:
LevelX2 2015-05-12 01:31:56 +02:00
commit e3cb007848
45 changed files with 3649 additions and 11 deletions

View file

@ -0,0 +1,92 @@
/*
* 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.arabiannights;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
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.Token;
/**
*
* @author anonymous
*/
public class RukhEgg extends CardImpl {
public RukhEgg(UUID ownerId) {
super(ownerId, 52, "Rukh Egg", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.expansionSetCode = "ARN";
this.subtype.add("Bird");
this.power = new MageInt(0);
this.toughness = new MageInt(3);
// When Rukh Egg dies, put a 4/4 red Bird creature token with flying onto the battlefield at the beginning of the next end step.
Effect effect = new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new CreateTokenEffect(new BirdToken())));
effect.setText("put a 4/4 red Bird creature token with flying onto the battlefield at the beginning of the next end step");
Ability ability = new DiesTriggeredAbility(effect);
this.addAbility(ability);
}
public RukhEgg(final RukhEgg card) {
super(card);
}
@Override
public RukhEgg copy() {
return new RukhEgg(this);
}
}
class BirdToken extends Token {
public BirdToken() {
this("ARN"); //there is no such token in either ARN, 8ED or 9ED
}
public BirdToken(String setCode) {
super("Bird", "4/4 red Bird creature token with flying");
this.setOriginalExpansionSetCode(setCode);
cardType.add(CardType.CREATURE);
color.setRed(true);
subtype.add("Bird");
power = new MageInt(4);
toughness = new MageInt(4);
addAbility(FlyingAbility.getInstance());
}
}

View file

@ -0,0 +1,128 @@
/*
* 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.coldsnap;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.costs.common.DiscardTargetCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetControlledPermanent;
/**
*
* @author anonymous
*/
public class BlizzardSpecter extends CardImpl {
public BlizzardSpecter(UUID ownerId) {
super(ownerId, 126, "Blizzard Specter", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{U}{B}");
this.expansionSetCode = "CSP";
this.supertype.add("Snow");
this.subtype.add("Specter");
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever Blizzard Specter deals combat damage to a player, choose one - That player returns a permanent he or she controls to its owner's hand; or that player discards a card.
Ability ability2 = new DealsCombatDamageToAPlayerTriggeredAbility(new ReturnToHandEffect(), false);
Mode mode2 = new Mode();
mode2.getEffects().add(new DiscardTargetEffect(1, false));
ability2.addMode(mode2);
this.addAbility(ability2);
}
public BlizzardSpecter(final BlizzardSpecter card) {
super(card);
}
@Override
public BlizzardSpecter copy() {
return new BlizzardSpecter(this);
}
}
class ReturnToHandEffect extends OneShotEffect {
public ReturnToHandEffect() {
super(Outcome.ReturnToHand);
staticText = "That player returns a permanent he or she controls to its owner's hand";
}
public ReturnToHandEffect(final ReturnToHandEffect effect) {
super(effect);
}
@Override
public ReturnToHandEffect copy() {
return new ReturnToHandEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
boolean result = false;
Player player = game.getPlayer(targetPointer.getFirst(game, source));
if (player == null) {
return false;
}
Target target = new TargetControlledPermanent(1, 1, new FilterControlledPermanent(), true);
if (target.canChoose(player.getId(), game)) {
while (player.isInGame() && !target.isChosen() && target.canChoose(player.getId(), game)) {
player.chooseTarget(Outcome.ReturnToHand, target, source, game);
}
for (UUID targetId: target.getTargets()) {
Permanent permanent = game.getPermanent(targetId);
if (permanent != null) {
result |= permanent.moveToZone(Zone.HAND, source.getSourceId(), game, false);
}
}
}
return result;
}
}

View file

@ -0,0 +1,104 @@
/*
* 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.eighthedition;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BecomesColorTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author anonymous
*/
public class DistortingLens extends CardImpl {
public DistortingLens(UUID ownerId) {
super(ownerId, 299, "Distorting Lens", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}");
this.expansionSetCode = "8ED";
// {tap}: Target permanent becomes the color of your choice until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ChangeColorEffect(), new TapSourceCost());
ability.addTarget(new TargetPermanent());
this.addAbility(ability);
}
public DistortingLens(final DistortingLens card) {
super(card);
}
@Override
public DistortingLens copy() {
return new DistortingLens(this);
}
}
class ChangeColorEffect extends OneShotEffect {
public ChangeColorEffect() {
super(Outcome.Neutral);
staticText = "Target permanent becomes the color of your choice until end of turn";
}
public ChangeColorEffect(final ChangeColorEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
Permanent chosen = game.getPermanent(targetPointer.getFirst(game, source));
if (player != null && permanent != null) {
ContinuousEffect effect = new BecomesColorTargetEffect(null, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(chosen.getId()));
game.addEffect(effect, source);
return true;
}
return false;
}
@Override
public ChangeColorEffect copy() {
return new ChangeColorEffect(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.eighthedition;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class EmperorCrocodile extends mage.sets.ninthedition.EmperorCrocodile {
public EmperorCrocodile(UUID ownerId) {
super(ownerId);
this.cardNumber = 246;
this.expansionSetCode = "8ED";
}
public EmperorCrocodile(final EmperorCrocodile card) {
super(card);
}
@Override
public EmperorCrocodile copy() {
return new EmperorCrocodile(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.eighthedition;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class OrcishSpy extends mage.sets.fallenempires.OrcishSpy {
public OrcishSpy(UUID ownerId) {
super(ownerId);
this.cardNumber = 208;
this.expansionSetCode = "8ED";
}
public OrcishSpy(final OrcishSpy card) {
super(card);
}
@Override
public OrcishSpy copy() {
return new OrcishSpy(this);
}
}

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.eighthedition;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author anonymous
*/
public class RukhEgg extends mage.sets.arabiannights.RukhEgg {
public RukhEgg(UUID ownerId) {
super(ownerId);
this.cardNumber = 216;
this.expansionSetCode = "8ED";
this.rarity = Rarity.RARE;
}
public RukhEgg(final RukhEgg card) {
super(card);
}
@Override
public RukhEgg copy() {
return new RukhEgg(this);
}
}

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.eighthedition;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author anonymous
*/
public class ShiftingSky extends mage.sets.planeshift.ShiftingSky {
public ShiftingSky(UUID ownerId) {
super(ownerId);
this.cardNumber = 100;
this.expansionSetCode = "8ED";
this.rarity = Rarity.RARE;
}
public ShiftingSky(final ShiftingSky card) {
super(card);
}
@Override
public ShiftingSky copy() {
return new ShiftingSky(this);
}
}

View file

@ -0,0 +1,236 @@
/*
* 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.eighthedition;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.Mana;
import mage.abilities.Abilities;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTappedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.mana.ManaAbility;
import mage.cards.CardImpl;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author anonymous
*/
public class StarCompass extends CardImpl {
public StarCompass(UUID ownerId) {
super(ownerId, 315, "Star Compass", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{2}");
this.expansionSetCode = "8ED";
// Star Compass enters the battlefield tapped.
this.addAbility(new EntersBattlefieldTappedAbility());
// {tap}: Add to your mana pool one mana of any color that a basic land you control could produce.
this.addAbility(new StarCompassManaAbility());
}
public StarCompass(final StarCompass card) {
super(card);
}
@Override
public StarCompass copy() {
return new StarCompass(this);
}
}
class StarCompassManaAbility extends ManaAbility {
public StarCompassManaAbility() {
super(Zone.BATTLEFIELD, new StarCompassManaEffect(),new TapSourceCost());
}
public StarCompassManaAbility(final StarCompassManaAbility ability) {
super(ability);
}
@Override
public StarCompassManaAbility copy() {
return new StarCompassManaAbility(this);
}
@Override
public List<Mana> getNetMana(Game game) {
return ((StarCompassManaEffect)getEffects().get(0)).getNetMana(game, this);
}
}
class StarCompassManaEffect extends ManaEffect {
private static final FilterControlledPermanent filter = new FilterControlledLandPermanent();
static {
filter.add(new SupertypePredicate("Basic"));
}
public StarCompassManaEffect() {
super();
staticText = "Add to your mana pool one mana of any type that a basic land you control could produce";
}
public StarCompassManaEffect(final StarCompassManaEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Mana types = getManaTypes(game, source);
Choice choice = new ChoiceImpl(false);
choice.setMessage("Pick a mana color");
if (types.getBlack() > 0) {
choice.getChoices().add("Black");
}
if (types.getRed() > 0) {
choice.getChoices().add("Red");
}
if (types.getBlue() > 0) {
choice.getChoices().add("Blue");
}
if (types.getGreen() > 0) {
choice.getChoices().add("Green");
}
if (types.getWhite() > 0) {
choice.getChoices().add("White");
}
if (types.getColorless() > 0) {
choice.getChoices().add("Colorless");
}
if (types.getAny() > 0) {
choice.getChoices().add("Black");
choice.getChoices().add("Red");
choice.getChoices().add("Blue");
choice.getChoices().add("Green");
choice.getChoices().add("White");
choice.getChoices().add("Colorless");
}
if (choice.getChoices().size() > 0) {
Player player = game.getPlayer(source.getControllerId());
if (choice.getChoices().size() == 1) {
choice.setChoice(choice.getChoices().iterator().next());
} else {
player.choose(outcome, choice, game);
}
if (choice.getChoice() != null) {
Mana mana = new Mana();
switch (choice.getChoice()) {
case "Black":
mana.setBlack(1);
break;
case "Blue":
mana.setBlue(1);
break;
case "Red":
mana.setRed(1);
break;
case "Green":
mana.setGreen(1);
break;
case "White":
mana.setWhite(1);
break;
case "Colorless":
mana.setColorless(1);
break;
}
checkToFirePossibleEvents(mana, game, source);
player.getManaPool().addMana(mana, game, source);
return true;
}
return false;
}
return true;
}
public List<Mana> getNetMana(Game game, Ability source) {
List<Mana> netManas = new ArrayList<>();
Mana types = getManaTypes(game, source);
if (types.getBlack() > 0) {
netManas.add(new Mana(ColoredManaSymbol.B));
}
if (types.getRed() > 0) {
netManas.add(new Mana(ColoredManaSymbol.R));
}
if (types.getBlue() > 0) {
netManas.add(new Mana(ColoredManaSymbol.U));
}
if (types.getGreen() > 0) {
netManas.add(new Mana(ColoredManaSymbol.G));
}
if (types.getWhite() > 0) {
netManas.add(new Mana(ColoredManaSymbol.W));
}
if (types.getColorless() > 0) {
netManas.add(new Mana(0,0,0,0,0,1,0));
}
return netManas;
}
private Mana getManaTypes(Game game, Ability source) {
List<Permanent> lands = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game);
Mana types = new Mana();
for (Permanent land : lands) {
Abilities<ManaAbility> manaAbilities = land.getAbilities().getManaAbilities(Zone.BATTLEFIELD);
for (ManaAbility ability : manaAbilities) {
if (!ability.equals(source) && ability.definesMana()) {
for (Mana netMana: ability.getNetMana(game)) {
types.add(netMana);
}
}
}
}
return types;
}
@Override
public Mana getMana(Game game, Ability source) {
return null;
}
@Override
public StarCompassManaEffect copy() {
return new StarCompassManaEffect(this);
}
}

View file

@ -0,0 +1,68 @@
/*
* 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.fallenempires;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.LookLibraryTopCardTargetPlayerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author anonymous
*/
public class OrcishSpy extends CardImpl {
public OrcishSpy(UUID ownerId) {
super(ownerId, 124, "Orcish Spy", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}");
this.expansionSetCode = "FEM";
this.subtype.add("Orc");
this.subtype.add("Rogue");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {tap}: Look at the top three cards of target player's library.
Ability ability = new SimpleActivatedAbility(Zone.LIBRARY, new LookLibraryTopCardTargetPlayerEffect(3), new TapSourceCost());
this.addAbility(ability);
}
public OrcishSpy(final OrcishSpy card) {
super(card);
}
@Override
public OrcishSpy copy() {
return new OrcishSpy(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.fifthedition;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class ChubToad extends mage.sets.iceage.ChubToad {
public ChubToad(UUID ownerId) {
super(ownerId);
this.cardNumber = 145;
this.expansionSetCode = "5ED";
}
public ChubToad(final ChubToad card) {
super(card);
}
@Override
public ChubToad copy() {
return new ChubToad(this);
}
}

View file

@ -0,0 +1,220 @@
/*
* 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.fifthedition;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.ActivateIfConditionActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.MyTurnCondition;
import mage.abilities.costs.Cost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.UntapEnchantedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.AsThoughEffectType;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.util.CardUtil;
/**
*
* @author anonymous
*/
public class InstillEnergy extends CardImpl {
public InstillEnergy(UUID ownerId) {
super(ownerId, 166, "Instill Energy", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}");
this.expansionSetCode = "5ED";
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature can attack as though it had haste.
Ability asThough = new SimpleStaticAbility(Zone.BATTLEFIELD, new CanAttackAsThoughItHadHasteEnchantedEffect(Duration.WhileOnBattlefield));
Ability haste = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(asThough, AttachmentType.AURA, Duration.WhileOnBattlefield, "Enchanted creature can attack as though it had haste."));
this.addAbility(haste);
// {0}: Untap enchanted creature. Activate this ability only during your turn and only once each turn.
Ability gainedAbility = new LimitedTimesIfConditionActivatedAbility(Zone.BATTLEFIELD, new UntapEnchantedEffect(), new GenericManaCost(0), MyTurnCondition.getInstance(), 1);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield, "{0}: Untap enchanted creature. Activate this ability only during your turn and only once each turn.")));
}
public InstillEnergy(final InstillEnergy card) {
super(card);
}
@Override
public InstillEnergy copy() {
return new InstillEnergy(this);
}
}
class CanAttackAsThoughItHadHasteEnchantedEffect extends AsThoughEffectImpl {
public CanAttackAsThoughItHadHasteEnchantedEffect(Duration duration) {
super(AsThoughEffectType.ATTACK, duration, Outcome.Benefit);
staticText = "Enchanted creature can attack as though it had haste";
}
public CanAttackAsThoughItHadHasteEnchantedEffect(final CanAttackAsThoughItHadHasteEnchantedEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public CanAttackAsThoughItHadHasteEnchantedEffect copy() {
return new CanAttackAsThoughItHadHasteEnchantedEffect(this);
}
@Override
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
Permanent enchantment = game.getPermanent(source.getSourceId());
return enchantment != null && enchantment.getAttachedTo() != null && enchantment.getAttachedTo() == objectId;
}
}
class LimitedTimesIfConditionActivatedAbility extends ActivateIfConditionActivatedAbility {
class ActivationInfo {
public int turnNum;
public int activationCounter;
public ActivationInfo(int turnNum, int activationCounter) {
this.turnNum = turnNum;
this.activationCounter = activationCounter;
}
}
private int maxActivationsPerTurn;
public LimitedTimesIfConditionActivatedAbility(Zone zone, Effect effect, Cost cost, Condition condition) {
this(zone, effect, cost, condition, 1);
}
public LimitedTimesIfConditionActivatedAbility(Zone zone, Effect effect, Cost cost, Condition condition, int maxActivationsPerTurn) {
super(zone, effect, cost, condition);
this.maxActivationsPerTurn = maxActivationsPerTurn;
}
public LimitedTimesIfConditionActivatedAbility(LimitedTimesIfConditionActivatedAbility ability) {
super(ability);
this.maxActivationsPerTurn = ability.maxActivationsPerTurn;
}
@Override
public boolean canActivate(UUID playerId, Game game) {
if (super.canActivate(playerId, game)) {
ActivationInfo activationInfo = getActivationInfo(game);
return activationInfo == null || activationInfo.turnNum != game.getTurnNum() || activationInfo.activationCounter < maxActivationsPerTurn;
}
return false;
}
@Override
public boolean activate(Game game, boolean noMana) {
if (canActivate(this.controllerId, game)) {
if (super.activate(game, noMana)) {
ActivationInfo activationInfo = getActivationInfo(game);
if (activationInfo == null) {
activationInfo = new ActivationInfo(game.getTurnNum(), 1);
} else if (activationInfo.turnNum != game.getTurnNum()) {
activationInfo.turnNum = game.getTurnNum();
activationInfo.activationCounter = 1;
} else {
activationInfo.activationCounter++;
}
setActivationInfo(activationInfo, game);
return true;
}
}
return false;
}
@Override
public boolean resolve(Game game) {
return super.resolve(game);
}
@Override
public String getRule() {
StringBuilder sb = new StringBuilder(super.getRule());
sb.replace(sb.length() - 1, sb.length() - 1, " and "); //suppress super()'s final period
switch (maxActivationsPerTurn) {
case 1:
sb.append("only once");
break;
case 2:
sb.append("no more than twice");
break;
default:
sb.append("no more than ").append(CardUtil.numberToText(maxActivationsPerTurn)).append(" times");
}
sb.append(" each turn.");
return sb.toString();
}
@Override
public LimitedTimesIfConditionActivatedAbility copy() {
return new LimitedTimesIfConditionActivatedAbility(this);
}
private ActivationInfo getActivationInfo(Game game) {
Integer turnNum = (Integer) game.getState().getValue(CardUtil.getCardZoneString("activationsTurn", sourceId, game));
Integer activationCount = (Integer) game.getState().getValue(CardUtil.getCardZoneString("activationsCount", sourceId, game));
if (turnNum == null || activationCount == null) {
return null;
}
return new ActivationInfo(turnNum, activationCount);
}
private void setActivationInfo(ActivationInfo activationInfo, Game game) {
game.getState().setValue(CardUtil.getCardZoneString("activationsTurn", sourceId, game), activationInfo.turnNum);
game.getState().setValue(CardUtil.getCardZoneString("activationsCount", sourceId, game), activationInfo.activationCounter);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.fifthedition;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class SeaSpirit extends mage.sets.masterseditionii.SeaSpirit {
public SeaSpirit(UUID ownerId) {
super(ownerId);
this.cardNumber = 119;
this.expansionSetCode = "5ED";
}
public SeaSpirit(final SeaSpirit card) {
super(card);
}
@Override
public SeaSpirit copy() {
return new SeaSpirit(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.fourthedition;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class InstillEnergy extends mage.sets.fifthedition.InstillEnergy {
public InstillEnergy(UUID ownerId) {
super(ownerId);
this.cardNumber = 136;
this.expansionSetCode = "4ED";
}
public InstillEnergy(final InstillEnergy card) {
super(card);
}
@Override
public InstillEnergy copy() {
return new InstillEnergy(this);
}
}

View file

@ -0,0 +1,178 @@
/*
* 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.MageInt;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.DiscardSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.keyword.CyclingAbility;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.constants.TimingRule;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author anonymous
*/
public class HomingSliver extends CardImpl {
private static final FilterCard filter = new FilterCard("Sliver card");
static {
filter.add(new SubtypePredicate("Sliver"));
}
public HomingSliver(UUID ownerId) {
super(ownerId, 118, "Homing Sliver", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}");
this.expansionSetCode = "FUT";
this.subtype.add("Sliver");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Each Sliver card in each player's hand has slivercycling {3}.
Ability ability = new CyclingAbility(new ManaCostsImpl("{3}"), filter, "Slivercycling");
ability.addCost(new DiscardSourceCost());
this.addAbility(new SimpleStaticAbility(Zone.HAND, new HomingSliverEffect()));
// Slivercycling {3}
this.addAbility(ability);
/**
* 01/02/2009 Slivercycling is a form of cycling. Any ability that
* triggers on a card being cycled also triggers on Slivercycling this
* card. Any ability that stops a cycling ability from being activated
* also stops Plainscycling from being activated.
*/
/**
* 01/02/2009 Slivercycling is an activated ability. Effects that
* interact with activated abilities (such as Stifle or Rings of
* Brighthearth) will interact with Slivercycling. Effects that interact
* with spells (such as Remove Soul or Faerie Tauntings) will not.
*/
/**
* 01/02/2009 You can choose to find any card with the Sliver creature
* type, even if it isn't a creature card. This includes, for example,
* Tribal cards with the Changeling ability. You can also choose not to
* find a card, even if there is a Sliver card in your graveyard.
*
*/
}
public HomingSliver(final HomingSliver card) {
super(card);
}
@Override
public HomingSliver copy() {
return new HomingSliver(this);
}
}
class HomingSliverEffect extends ContinuousEffectImpl {
private static final FilterCard filter2 = new FilterCard("Sliver card");
static {
filter2.add(new SubtypePredicate("Sliver"));
}
public HomingSliverEffect() {
super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
this.staticText = "Each Sliver card in each player's hand has slivercycling {3}";
}
public HomingSliverEffect(final HomingSliverEffect effect) {
super(effect);
}
@Override
public HomingSliverEffect copy() {
return new HomingSliverEffect(this);
}
@Override
public void init(Ability source, Game game) {
super.init(source, game);
if (this.affectedObjectsSet) {
for (UUID p : game.getPlayerList()) {
Player player = game.getPlayer(p);
if (player != null) {
for (UUID cardId : player.getHand()) {
Card card = game.getCard(cardId);
if (card.getSubtype().contains("Sliver")) {
affectedObjectList.add(new MageObjectReference(card, game));
}
}
}
}
}
}
@Override
public boolean apply(Game game, Ability source) {
for (UUID p : game.getPlayerList()) {
Player player = game.getPlayer(p);
if (player != null) {
for (UUID cardId : player.getHand()) {
if (affectedObjectList.contains(new MageObjectReference(cardId, game))) {
Card card = game.getCard(cardId);
CyclingAbility ability = null;
if (card.hasSubtype("Sliver")) {
ability = new CyclingAbility(new ManaCostsImpl("{3}"), filter2, "Slivercycling");
}
if (ability != null) {
ability.setSourceId(cardId);
ability.setControllerId(card.getOwnerId());
game.getState().addOtherAbility(card, ability);
}
}
}
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,87 @@
/*
* 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.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.PreventionEffectImpl;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
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;
/**
*
* @author anonymous
*/
public class LymphSliver extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sliver", "All Sliver creatures");
public LymphSliver(UUID ownerId) {
super(ownerId, 26, "Lymph Sliver", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}");
this.expansionSetCode = "FUT";
this.subtype.add("Sliver");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// All Sliver creatures have absorb 1.
Ability absorb = new SimpleStaticAbility(Zone.BATTLEFIELD, new SliverAbsorbEffect());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(absorb, Duration.WhileOnBattlefield, filter, "absorb 1. <i>(If a source would deal damage to a Sliver, prevent 1 of that damage.)</i>")));
}
public LymphSliver(final LymphSliver card) {
super(card);
}
@Override
public LymphSliver copy() {
return new LymphSliver(this);
}
}
class SliverAbsorbEffect extends PreventionEffectImpl {
public SliverAbsorbEffect() {
super(Duration.WhileOnBattlefield, 1, false, false);
this.staticText = "If a source would deal damage to a Sliver, prevent 1 of that damage";
}
public SliverAbsorbEffect(SliverAbsorbEffect effect) {
super(effect);
}
@Override
public SliverAbsorbEffect copy() {
return new SliverAbsorbEffect(this);
}
}

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.iceage;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
/**
*
* @author anonymous
*/
public class ChubToad extends CardImpl {
public ChubToad(UUID ownerId) {
super(ownerId, 117, "Chub Toad", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.expansionSetCode = "ICE";
this.subtype.add("Frog");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Whenever Chub Toad blocks or becomes blocked, it gets +2/+2 until end of turn.
Effect effect = new BoostSourceEffect(+1, +1, Duration.EndOfTurn);
effect.setText("it gets +2/+2 until end of turn");
Ability ability = new BlocksOrBecomesBlockedTriggeredAbility(effect, false);
this.addAbility(ability);
}
public ChubToad(final ChubToad card) {
super(card);
}
@Override
public ChubToad copy() {
return new ChubToad(this);
}
}

View file

@ -0,0 +1,205 @@
/*
* 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.iceage;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.PutCardIntoGraveFromAnywhereAllTriggeredAbility;
import mage.abilities.common.PutIntoGraveFromBattlefieldAllTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
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.Layer;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author anonymous
*/
public class EnduringRenewal extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("a creature");
public EnduringRenewal(UUID ownerId) {
super(ownerId, 247, "Enduring Renewal", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}");
this.expansionSetCode = "ICE";
// Play with your hand revealed.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PlayWithHandRevealedEffect()));
// If you would draw a card, reveal the top card of your library instead. If it's a creature card, put it into your graveyard. Otherwise, draw a card.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new EnduringRenewalReplacementEffect()));
// Whenever a creature is put into your graveyard from the battlefield, return it to your hand.
this.addAbility(new PutIntoGraveFromBattlefieldAllTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect(), false, filter, true, true));
}
public EnduringRenewal(final EnduringRenewal card) {
super(card);
}
@Override
public EnduringRenewal copy() {
return new EnduringRenewal(this);
}
}
class EnduringRenewalReplacementEffect extends ReplacementEffectImpl {
public EnduringRenewalReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "If you would draw a card, reveal the top card of your library instead. If it's a creature card, put it into your graveyard. Otherwise, draw a card";
}
public EnduringRenewalReplacementEffect(final EnduringRenewalReplacementEffect effect) {
super(effect);
}
@Override
public EnduringRenewalReplacementEffect copy() {
return new EnduringRenewalReplacementEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Player you = game.getPlayer(source.getControllerId());
if (you == null) {
return false;
} else if (you.getLibrary().size() > 0){
Card top = you.getLibrary().getFromTop(game);
Cards cards = new CardsImpl();
cards.add(top);
you.revealCards("Top card of " + you.getName() + "'s library", cards, game);
if (top.getCardType().contains(CardType.CREATURE)) {
you.moveCardToGraveyardWithInfo(top, source.getSourceId(), game, Zone.LIBRARY);
} else {
you.moveCardToHandWithInfo(top, source.getSourceId(), game, Zone.LIBRARY);
}
return true;
}
return false;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DRAW_CARD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return event.getPlayerId().equals(source.getControllerId());
}
}
class PlayWithHandRevealedEffect extends ContinuousEffectImpl {
public PlayWithHandRevealedEffect() {
super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.Detriment);
staticText = "Play with your hand revealed";
}
public PlayWithHandRevealedEffect(final PlayWithHandRevealedEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && sourceObject != null) {
controller.revealCards(controller.getName(), controller.getHand(), game, false);
return true;
}
return false;
}
@Override
public PlayWithHandRevealedEffect copy() {
return new PlayWithHandRevealedEffect(this);
}
}
class EnduringRenewalEffect extends OneShotEffect {
public EnduringRenewalEffect() {
super(Outcome.ReturnToHand);
staticText = "return it to your hand";
}
public EnduringRenewalEffect(final EnduringRenewalEffect effect) {
super(effect);
}
@Override
public EnduringRenewalEffect copy() {
return new EnduringRenewalEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
UUID creatureId = (UUID) getValue("returningCreature");
Permanent creature = game.getPermanent(creatureId);
if (creature != null) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
creature.moveToZone(Zone.HAND, source.getSourceId(), game, false);
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.iceage;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class SeaSpirit extends mage.sets.masterseditionii.SeaSpirit {
public SeaSpirit(UUID ownerId) {
super(ownerId);
this.cardNumber = 95;
this.expansionSetCode = "ICE";
}
public SeaSpirit(final SeaSpirit card) {
super(card);
}
@Override
public SeaSpirit copy() {
return new SeaSpirit(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.limitedalpha;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class InstillEnergy extends mage.sets.fifthedition.InstillEnergy {
public InstillEnergy(UUID ownerId) {
super(ownerId);
this.cardNumber = 111;
this.expansionSetCode = "LEA";
}
public InstillEnergy(final InstillEnergy card) {
super(card);
}
@Override
public InstillEnergy copy() {
return new InstillEnergy(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.limitedbeta;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class InstillEnergy extends mage.sets.fifthedition.InstillEnergy {
public InstillEnergy(UUID ownerId) {
super(ownerId);
this.cardNumber = 111;
this.expansionSetCode = "LEB";
}
public InstillEnergy(final InstillEnergy card) {
super(card);
}
@Override
public InstillEnergy copy() {
return new InstillEnergy(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.mastersedition;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class ChubToad extends mage.sets.iceage.ChubToad {
public ChubToad(UUID ownerId) {
super(ownerId);
this.cardNumber = 116;
this.expansionSetCode = "MED";
}
public ChubToad(final ChubToad card) {
super(card);
}
@Override
public ChubToad copy() {
return new ChubToad(this);
}
}

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.masterseditionii;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
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;
/**
*
* @author anonymous
*/
public class SeaSpirit extends CardImpl {
public SeaSpirit(UUID ownerId) {
super(ownerId, 65, "Sea Spirit", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}");
this.expansionSetCode = "ME2";
this.subtype.add("Elemental");
this.subtype.add("Spirit");
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// {U}: Sea Spirit gets +1/+0 until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(+1, +0, Duration.EndOfTurn), new ManaCostsImpl("{U}"));
this.addAbility(ability);
}
public SeaSpirit(final SeaSpirit card) {
super(card);
}
@Override
public SeaSpirit copy() {
return new SeaSpirit(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.masterseditioniv;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class InstillEnergy extends mage.sets.fifthedition.InstillEnergy {
public InstillEnergy(UUID ownerId) {
super(ownerId);
this.cardNumber = 157;
this.expansionSetCode = "ME4";
}
public InstillEnergy(final InstillEnergy card) {
super(card);
}
@Override
public InstillEnergy copy() {
return new InstillEnergy(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.mercadianmasques;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class DistortingLens extends mage.sets.eighthedition.DistortingLens {
public DistortingLens(UUID ownerId) {
super(ownerId);
this.cardNumber = 293;
this.expansionSetCode = "MMQ";
}
public DistortingLens(final DistortingLens card) {
super(card);
}
@Override
public DistortingLens copy() {
return new DistortingLens(this);
}
}

View file

@ -0,0 +1,99 @@
/*
* 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.ninthedition;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.StateTriggeredAbility;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
/**
*
* @author anonymous
*/
public class EmperorCrocodile extends CardImpl {
public EmperorCrocodile(UUID ownerId) {
super(ownerId, 241, "Emperor Crocodile", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.expansionSetCode = "9ED";
this.subtype.add("Crocodile");
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// When you control no other creatures, sacrifice Emperor Crocodile.
// 704.1
this.addAbility(new EmperorCrocodileStateTriggeredAbility());
}
public EmperorCrocodile(final EmperorCrocodile card) {
super(card);
}
@Override
public EmperorCrocodile copy() {
return new EmperorCrocodile(this);
}
}
class EmperorCrocodileStateTriggeredAbility extends StateTriggeredAbility {
public EmperorCrocodileStateTriggeredAbility() {
super(Zone.BATTLEFIELD, new SacrificeSourceEffect());
}
public EmperorCrocodileStateTriggeredAbility(final EmperorCrocodileStateTriggeredAbility ability) {
super(ability);
}
@Override
public EmperorCrocodileStateTriggeredAbility copy() {
return new EmperorCrocodileStateTriggeredAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
for (Permanent perm : game.getBattlefield().getAllActivePermanents(controllerId)) {
if (!perm.getId().equals(this.getSourceId()) && perm.getCardType().contains(CardType.CREATURE)) {
return false;
}
}
return true;
}
@Override
public String getRule() {
return "When you control no other creatures, sacrifice {this}.";
}
}

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.ninthedition;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author anonymous
*/
public class RukhEgg extends mage.sets.arabiannights.RukhEgg {
public RukhEgg(UUID ownerId) {
super(ownerId);
this.cardNumber = 214;
this.expansionSetCode = "9ED";
this.rarity = Rarity.RARE;
}
public RukhEgg(final RukhEgg card) {
super(card);
}
@Override
public RukhEgg copy() {
return new RukhEgg(this);
}
}

View file

@ -0,0 +1,149 @@
/*
* 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.planeshift;
import java.util.UUID;
import mage.MageObject;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ChooseColorEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
* @author anonymous
*/
public class ShiftingSky extends CardImpl {
public ShiftingSky(UUID ownerId) {
super(ownerId, 32, "Shifting Sky", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}");
this.expansionSetCode = "PLS";
// As Shifting Sky enters the battlefield, choose a color.
Ability ability = new EntersBattlefieldTriggeredAbility(new ChooseColorEffect(Outcome.Benefit));
this.addAbility(ability);
// All nonland permanents are the chosen color.
Ability ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new ShiftingSkyEffect());
this.addAbility(ability2);
}
public ShiftingSky(final ShiftingSky card) {
super(card);
}
@Override
public ShiftingSky copy() {
return new ShiftingSky(this);
}
}
class ShiftingSkyEffect extends OneShotEffect {
private static final FilterPermanent filter = new FilterPermanent("All nonland permanents");
static {
filter.add(
Predicates.not(
new CardTypePredicate(CardType.LAND)
)
);
}
public ShiftingSkyEffect() {
super(Outcome.Benefit);
staticText = "All nonland permanents are the chosen color";
}
public ShiftingSkyEffect(final ShiftingSkyEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (player != null && permanent != null) {
ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
if (color == null) {
return false;
}
String colorString = color.toString();
for (UUID playerId : player.getInRange()) {
Player p = game.getPlayer(playerId);
if (p != null) {
for (Permanent chosen : game.getBattlefield().getAllActivePermanents(filter, playerId, game)) {
setObject(chosen, colorString);
}
}
}
return true;
}
return false;
}
@Override
public ShiftingSkyEffect copy() {
return new ShiftingSkyEffect(this);
}
private void setObject(Permanent chosen, String colorString) {
switch (colorString) {
case "W":
chosen.getColor().setWhite(true);
break;
case "B":
chosen.getColor().setBlack(true);
break;
case "U":
chosen.getColor().setBlue(true);
break;
case "G":
chosen.getColor().setGreen(true);
break;
case "R":
chosen.getColor().setRed(true);
break;
}
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.planeshift;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class StarCompass extends mage.sets.eighthedition.StarCompass {
public StarCompass(UUID ownerId) {
super(ownerId);
this.cardNumber = 134;
this.expansionSetCode = "PLS";
}
public StarCompass(final StarCompass card) {
super(card);
}
@Override
public StarCompass copy() {
return new StarCompass(this);
}
}

View file

@ -0,0 +1,63 @@
/*
* 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.portalsecondage;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*
* @author anonymous
*/
public class SylvanBasilisk extends CardImpl {
public SylvanBasilisk(UUID ownerId) {
super(ownerId, 86, "Sylvan Basilisk", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
this.expansionSetCode = "PO2";
this.subtype.add("Basilisk");
this.power = new MageInt(2);
this.toughness = new MageInt(4);
// Whenever Sylvan Basilisk becomes blocked by a creature, destroy that creature.
this.addAbility(new BecomesBlockedByCreatureTriggeredAbility(new DestroyTargetEffect(), false));
}
public SylvanBasilisk(final SylvanBasilisk card) {
super(card);
}
@Override
public SylvanBasilisk copy() {
return new SylvanBasilisk(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.revisededition;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class InstillEnergy extends mage.sets.fifthedition.InstillEnergy {
public InstillEnergy(UUID ownerId) {
super(ownerId);
this.cardNumber = 110;
this.expansionSetCode = "3ED";
}
public InstillEnergy(final InstillEnergy card) {
super(card);
}
@Override
public InstillEnergy copy() {
return new InstillEnergy(this);
}
}

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.shadowmoor;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.DiscardTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
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.Filter;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.game.Game;
import mage.target.common.TargetCardInHand;
import mage.target.common.TargetCreatureOrPlayer;
/**
*
* @author anonymous
*/
public class KnollspineInvocation extends CardImpl {
private static final FilterCard filter = new FilterCard("a card with converted mana cost X");
public KnollspineInvocation(UUID ownerId) {
super(ownerId, 99, "Knollspine Invocation", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}{R}");
this.expansionSetCode = "SHM";
// {X}, Discard a card with converted mana cost X: Knollspine Invocation deals X damage to target creature or player.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue(), true), new ManaCostsImpl<>("{X}"));
ability.addCost(new DiscardTargetCost(new TargetCardInHand(filter)));
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
}
@Override
public void adjustCosts(Ability ability, Game game) {
if (ability instanceof SimpleActivatedAbility) {
int xValue = ability.getManaCostsToPay().getX();
for (Cost cost : ability.getCosts()) {
if (cost instanceof DiscardTargetCost) {
DiscardTargetCost discardCost = (DiscardTargetCost) cost;
discardCost.getTargets().clear();
FilterCard adjustedFilter = filter.copy(); // don't use it directly, it's static!!!!
adjustedFilter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, xValue));
discardCost.addTarget(new TargetCardInHand(adjustedFilter));
return;
}
}
}
}
public KnollspineInvocation(final KnollspineInvocation card) {
super(card);
}
@Override
public KnollspineInvocation copy() {
return new KnollspineInvocation(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.starter1999;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class SylvanBasilisk extends mage.sets.portalsecondage.SylvanBasilisk {
public SylvanBasilisk(UUID ownerId) {
super(ownerId);
this.cardNumber = 145;
this.expansionSetCode = "S99";
}
public SylvanBasilisk(final SylvanBasilisk card) {
super(card);
}
@Override
public SylvanBasilisk copy() {
return new SylvanBasilisk(this);
}
}

View file

@ -0,0 +1,72 @@
/*
* 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.tempest;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
/**
*
* @author anonymous
*/
public class FlailingDrake extends CardImpl {
public FlailingDrake(UUID ownerId) {
super(ownerId, 121, "Flailing Drake", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.expansionSetCode = "TMP";
this.subtype.add("Drake");
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Whenever Flailing Drake blocks or becomes blocked by a creature, that creature gets +1/+1 until end of turn.
Effect effect = new BoostTargetEffect(+1, +1, Duration.EndOfTurn);
effect.setText("that creature gets +1/+1 until end of turn");
Ability ability = new BlocksOrBecomesBlockedByCreatureTriggeredAbility(effect, false);
this.addAbility(ability);
}
public FlailingDrake(final FlailingDrake card) {
super(card);
}
@Override
public FlailingDrake copy() {
return new FlailingDrake(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.tenthedition;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class NoRestForTheWicked extends mage.sets.urzassaga.NoRestForTheWicked {
public NoRestForTheWicked(UUID ownerId) {
super(ownerId);
this.cardNumber = 165;
this.expansionSetCode = "10E";
}
public NoRestForTheWicked(final NoRestForTheWicked card) {
super(card);
}
@Override
public NoRestForTheWicked copy() {
return new NoRestForTheWicked(this);
}
}

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.tenthedition;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author anonymous
*/
public class SylvanBasilisk extends mage.sets.portalsecondage.SylvanBasilisk {
public SylvanBasilisk(UUID ownerId) {
super(ownerId);
this.cardNumber = 301;
this.expansionSetCode = "10E";
this.rarity = Rarity.UNCOMMON;
}
public SylvanBasilisk(final SylvanBasilisk card) {
super(card);
}
@Override
public SylvanBasilisk copy() {
return new SylvanBasilisk(this);
}
}

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.timeshifted;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author anonymous
*/
public class EnduringRenewal extends mage.sets.iceage.EnduringRenewal {
public EnduringRenewal(UUID ownerId) {
super(ownerId);
this.cardNumber = 7;
this.expansionSetCode = "TSB";
this.rarity = Rarity.SPECIAL;
}
public EnduringRenewal(final EnduringRenewal card) {
super(card);
}
@Override
public EnduringRenewal copy() {
return new EnduringRenewal(this);
}
}

View file

@ -0,0 +1,97 @@
/*
* 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.torment;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.condition.common.CardsInControllerGraveCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageEverythingEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.target.common.TargetLandPermanent;
/**
*
* @author anonymous
*/
public class RancidEarth extends CardImpl {
public RancidEarth(UUID ownerId) {
super(ownerId, 78, "Rancid Earth", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{B}{B}");
this.expansionSetCode = "TOR";
// Destroy target land.
// Threshold - If seven or more cards are in your graveyard, instead destroy that land and Rancid Earth deals 1 damage to each creature and each player.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new RancidEarthEffect(),
new DestroyTargetEffect(),
new CardsInControllerGraveCondition(7),
"Destroy target land.<br/><br/><i>Threshold<i/> - If seven or more cards are in your graveyard, instead destroy that land and Rancid Earth deals 1 damage to each creature and each player."));
this.getSpellAbility().addTarget(new TargetLandPermanent());
}
public RancidEarth(final RancidEarth card) {
super(card);
}
@Override
public RancidEarth copy() {
return new RancidEarth(this);
}
}
class RancidEarthEffect extends OneShotEffect {
public RancidEarthEffect() {
super(Outcome.DestroyPermanent);
this.staticText = "destroy that land and Rancid Earth deals 1 damage to each creature and each player";
}
public RancidEarthEffect(final RancidEarthEffect effect) {
super(effect);
}
@Override
public RancidEarthEffect copy() {
return new RancidEarthEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Effect effect1 = new DestroyTargetEffect("destroy that land");
effect1.apply(game, source);
return new DamageEverythingEffect(1).apply(game, source);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.unlimitededition;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class InstillEnergy extends mage.sets.fifthedition.InstillEnergy {
public InstillEnergy(UUID ownerId) {
super(ownerId);
this.cardNumber = 111;
this.expansionSetCode = "2ED";
}
public InstillEnergy(final InstillEnergy card) {
super(card);
}
@Override
public InstillEnergy copy() {
return new InstillEnergy(this);
}
}

View file

@ -0,0 +1,52 @@
/*
* 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.urzasdestiny;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class EmperorCrocodile extends mage.sets.ninthedition.EmperorCrocodile {
public EmperorCrocodile(UUID ownerId) {
super(ownerId);
this.cardNumber = 105;
this.expansionSetCode = "UDS";
}
public EmperorCrocodile(final EmperorCrocodile card) {
super(card);
}
@Override
public EmperorCrocodile copy() {
return new EmperorCrocodile(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.urzassaga;
import java.util.ArrayList;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.players.Player;
import mage.watchers.Watcher;
/**
*
* @author anonymous
*/
public class NoRestForTheWicked extends CardImpl {
public NoRestForTheWicked(UUID ownerId) {
super(ownerId, 142, "No Rest for the Wicked", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
this.expansionSetCode = "USG";
// Sacrifice No Rest for the Wicked: Return to your hand all creature cards in your graveyard that were put there from the battlefield this turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new NoRestForTheWickedEffect(), new SacrificeSourceCost());
Watcher watcher = new NoRestForTheWickedWatcher();
addAbility(ability, watcher);
}
public NoRestForTheWicked(final NoRestForTheWicked card) {
super(card);
}
@Override
public NoRestForTheWicked copy() {
return new NoRestForTheWicked(this);
}
}
class NoRestForTheWickedEffect extends OneShotEffect {
NoRestForTheWickedEffect() {
super(Outcome.Sacrifice);
staticText = "Return to your hand all creature cards in your graveyard that were put there from the battlefield this turn";
}
NoRestForTheWickedEffect(final NoRestForTheWickedEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
NoRestForTheWickedWatcher watcher = (NoRestForTheWickedWatcher) game.getState().getWatchers().get("NoRestForTheWickedWatcher");
if (watcher != null) {
for (UUID cardId : watcher.cards) {
Card c = game.getCard(cardId);
if (c != null) {
if (game.getState().getZone(cardId) == Zone.GRAVEYARD
&& c.getCardType().contains(CardType.CREATURE)
&& c.getOwnerId().equals(source.getControllerId())) {
//400.3
Player p = game.getPlayer(source.getControllerId());
if (p != null) {
p.moveCardToHandWithInfo(c, source.getSourceId(), game, Zone.GRAVEYARD);
}
return false;
}
}
}
return true;
}
return false;
}
@Override
public NoRestForTheWickedEffect copy() {
return new NoRestForTheWickedEffect(this);
}
}
class NoRestForTheWickedWatcher extends Watcher {
ArrayList<UUID> cards;
public NoRestForTheWickedWatcher() {
super("NoRestForTheWickedWatcher", WatcherScope.GAME);
this.cards = new ArrayList();
}
public NoRestForTheWickedWatcher(final NoRestForTheWickedWatcher watcher) {
super(watcher);
this.cards = new ArrayList();
this.cards.addAll(watcher.cards);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE
&& ((ZoneChangeEvent) event).isDiesEvent()) {
//400.3 Intercept only the controller's events
cards.add(event.getTargetId());
}
}
@Override
public NoRestForTheWickedWatcher copy() {
return new NoRestForTheWickedWatcher(this);
}
@Override
public void reset() {
super.reset();
cards.clear();
}
}

View file

@ -0,0 +1,58 @@
package org.mage.test.cards.single;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
*
* @author anonymous
*
* Whenever Flailing Drake blocks or becomes blocked by a creature, that creature gets +1/+1 until end of turn.
*/
public class FlailingDrakeTest extends CardTestPlayerBase {
@Test
public void testIncreaseBlocker() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
addCard(Zone.BATTLEFIELD, playerA, "Flailing Drake", 1);
addCard(Zone.BATTLEFIELD, playerB, "Forest", 3);
addCard(Zone.BATTLEFIELD, playerB, "Island", 3);
addCard(Zone.BATTLEFIELD, playerB, "Snapping Drake", 1);
attack(3, playerA, "Flailing Drake");
block(3, playerB, "Snapping Drake", "Flailing Drake");
setStopAt(3, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertGraveyardCount(playerA, "Flailing Drake", 1);
//Snapping Drake 4/3
assertPowerToughness(playerB, "Snapping Drake", 4, 3);
}
@Test
public void testIncreaseBlocked() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
addCard(Zone.BATTLEFIELD, playerA, "Flailing Drake", 1);
addCard(Zone.BATTLEFIELD, playerB, "Forest", 3);
addCard(Zone.BATTLEFIELD, playerB, "Island", 3);
addCard(Zone.BATTLEFIELD, playerB, "Snapping Drake", 1);
attack(4, playerB, "Snapping Drake");
block(4, playerA, "Flailing Drake", "Snapping Drake");
setStopAt(4, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertGraveyardCount(playerA, "Flailing Drake", 1);
//Snapping Drake 4/3
assertPowerToughness(playerB, "Snapping Drake", 4, 3);
}
}

View file

@ -0,0 +1,128 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.mage.test.cards.single;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author anonymous
*/
public class NoRestForTheWickedTest extends CardTestPlayerBase {
/**
* Checks that all playerA creatures are back to playerA's hand
*/
//@Test
public void testSacrifice() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
addCard(Zone.HAND, playerA, "No Rest for the Wicked");
addCard(Zone.BATTLEFIELD, playerA, "Memnite");
addCard(Zone.BATTLEFIELD, playerA, "Royal Assassin");
addCard(Zone.BATTLEFIELD, playerA, "Sengir Vampire");
addCard(Zone.BATTLEFIELD, playerB, "Island");
addCard(Zone.BATTLEFIELD, playerB, "Flowering Lumberknot");
addCard(Zone.BATTLEFIELD, playerB, "Moorland Inquisitor");
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "No Rest for the Wicked");
attack(3, playerA, "Memnite");
attack(3, playerA, "Royal Assassin");
attack(3, playerA, "Sengin Vampire");
block(3, playerB, "Moorland Inquisitor", "Memnite");
activateAbility(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Sacrifice {this}: Return to your hand all creature cards in your graveyard that were put there from the battlefield this turn.");
setStopAt(3, PhaseStep.END_TURN);
execute();
assertGraveyardCount(playerA, 1); //No Rest only
assertGraveyardCount(playerA, "No Rest for the Wicked", 1);
assertGraveyardCount(playerA, "Memnite", 0);
assertHandCount(playerA, "Memnite", 1);
}
/**
* Checks that all playerA creatures sacrificed prior to playing
* No Rest for the Wicked are back to playerA's hand
*/
//@Test
public void testSacrificeAfterDying() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
addCard(Zone.HAND, playerA, "No Rest for the Wicked");
addCard(Zone.BATTLEFIELD, playerA, "Memnite");
addCard(Zone.BATTLEFIELD, playerA, "Royal Assassin");
addCard(Zone.BATTLEFIELD, playerA, "Sengir Vampire");
addCard(Zone.BATTLEFIELD, playerB, "Island");
addCard(Zone.BATTLEFIELD, playerB, "Flowering Lumberknot");
addCard(Zone.BATTLEFIELD, playerB, "Moorland Inquisitor");
attack(3, playerA, "Memnite");
attack(3, playerA, "Royal Assassin");
attack(3, playerA, "Sengin Vampire");
block(3, playerB, "Moorland Inquisitor", "Memnite");
castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "No Rest for the Wicked");
activateAbility(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Sacrifice {this}: Return to your hand all creature cards in your graveyard that were put there from the battlefield this turn.");
setStopAt(3, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "No Rest for the Wicked", 0);
assertGraveyardCount(playerA, 1); //No Rest only
assertGraveyardCount(playerA, "No Rest for the Wicked", 1);
assertGraveyardCount(playerA, "Memnite", 0);
assertHandCount(playerA, "Memnite", 1);
}
/**
* Take ownership of a creature from playerB and destroy it.
* Checks that after sacrificing No Rest for the Wicked it is on playerB's
* graveyard, and that it's not on either player's hand.
* 400.3
*/
@Test
public void testTakeControlThenSacrifice() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 7);
addCard(Zone.HAND, playerA, "No Rest for the Wicked");
addCard(Zone.HAND, playerA, "Beacon of Unrest");
addCard(Zone.BATTLEFIELD, playerA, "Moorland Inquisitor");
addCard(Zone.BATTLEFIELD, playerB, "Moorland Inquisitor");
addCard(Zone.BATTLEFIELD, playerB, "Memnite");
castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, "No Rest for the Wicked");
attack(4, playerB, "Memnite");
block(4, playerA, "Moorland Inquisitor", "Memnite");
castSpell(5, PhaseStep.POSTCOMBAT_MAIN, playerA, "Beacon of Unrest", "Memnite");
attack(7, playerA, "Memnite");
block(7, playerB, "Moorland Inquisitor", "Memnite");
activateAbility(7, PhaseStep.POSTCOMBAT_MAIN, playerA, "Sacrifice {this}: Return to your hand all creature cards in your graveyard that were put there from the battlefield this turn.");
setStopAt(7, PhaseStep.END_TURN);
execute();
assertGraveyardCount(playerB, "Memnite", 1);
assertHandCount(playerB, "Memnite", 0);
assertPermanentCount(playerA, "No Rest for the Wicked", 0);
assertGraveyardCount(playerA, 1); //No Rest only
assertGraveyardCount(playerA, "No Rest for the Wicked", 1);
assertGraveyardCount(playerA, "Memnite", 0);
assertHandCount(playerA, "Memnite", 0);
}
}

View file

@ -30,26 +30,34 @@ package mage.abilities.effects.common;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
import mage.util.CardUtil;
/**
*
* @author LevelX2
*/
public class LookLibraryTopCardTargetPlayerEffect extends OneShotEffect {
public LookLibraryTopCardTargetPlayerEffect() {
protected int amount;
public LookLibraryTopCardTargetPlayerEffect(int amount) {
super(Outcome.Benefit);
this.staticText = "look at the top card of target player's library";
this.amount = amount;
setText();
}
public LookLibraryTopCardTargetPlayerEffect() {
this(1);
}
public LookLibraryTopCardTargetPlayerEffect(final LookLibraryTopCardTargetPlayerEffect effect) {
super(effect);
amount = effect.amount;
}
@Override
@ -63,14 +71,24 @@ public class LookLibraryTopCardTargetPlayerEffect extends OneShotEffect {
Player targetPlayer = game.getPlayer(source.getFirstTarget());
MageObject sourceObject = game.getObject(source.getSourceId());
if (player != null && targetPlayer != null && sourceObject != null) {
Card card = targetPlayer.getLibrary().getFromTop(game);
if (card != null) {
CardsImpl cards = new CardsImpl();
cards.add(card);
player.lookAtCards(sourceObject.getName(), cards, game);
}
Cards cards = new CardsImpl();
cards.addAll(targetPlayer.getLibrary().getTopCards(game, amount));
player.lookAtCards(sourceObject.getName(), cards, game);
return true;
}
return false;
}
private void setText() {
StringBuilder sb = new StringBuilder("look at the top ");
if (amount > 1) {
sb.append(CardUtil.numberToText(amount));
sb.append(" cards ");
}
else {
sb.append(" card ");
}
sb.append("of target player's library");
this.staticText = sb.toString();
}
}

View file

@ -0,0 +1,100 @@
/*
* 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.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.util.CardUtil;
/**
*
* @author anonymous
*/
public class RevealTargetPlayerLibraryEffect extends OneShotEffect {
private DynamicValue amountCards;
public RevealTargetPlayerLibraryEffect(int amountCards) {
this(new StaticValue(amountCards));
}
public RevealTargetPlayerLibraryEffect(DynamicValue amountCards) {
super(Outcome.Neutral);
this.amountCards = amountCards;
this.staticText = setText();
}
public RevealTargetPlayerLibraryEffect(final RevealTargetPlayerLibraryEffect effect) {
super(effect);
this.amountCards = effect.amountCards;
}
@Override
public RevealTargetPlayerLibraryEffect copy() {
return new RevealTargetPlayerLibraryEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Player targetPlayer = game.getPlayer(source.getFirstTarget());
if (player == null || targetPlayer == null) {
return false;
}
Cards cards = new CardsImpl(Zone.LIBRARY);
int count = Math.min(targetPlayer.getLibrary().size(), amountCards.calculate(game, source, this));
for (int i = 0; i < count; i++) {
Card card = targetPlayer.getLibrary().removeFromTop(game);
if (card != null) {
cards.add(card);
}
}
player.lookAtCards("Top " + amountCards.toString() + "cards of " + targetPlayer.getName() + "\'s library", cards, game);
return true;
}
private String setText() {
StringBuilder sb = new StringBuilder("Reveal the top ");
sb.append(CardUtil.numberToText(amountCards.toString())).append(" cards of target player's library.");
return sb.toString();
}
}

View file

@ -116,7 +116,7 @@ Starter 2000|starter2000|
Stronghold|stronghold|
Tempest|tempest|
Tempest Remastered|tempestremastered|
Tenth Edition|tenth|
Tenth Edition|tenthedition|
The Dark|thedark|
Theros|theros|
Time Spiral "Timeshifted"|timeshifted|