This commit is contained in:
LoneFox 2015-06-18 10:32:43 +03:00
commit 689cbee59d
79 changed files with 3036 additions and 183 deletions

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.archenemy;
import java.util.UUID;
/**
*
* @author ilcartographer
*/
public class Fertilid extends mage.sets.commander.Fertilid {
public Fertilid(UUID ownerId) {
super(ownerId);
this.cardNumber = 54;
this.expansionSetCode = "ARC";
}
public Fertilid(final Fertilid card) {
super(card);
}
@Override
public Fertilid copy() {
return new Fertilid(this);
}
}

View file

@ -27,7 +27,6 @@
*/
package mage.sets.avacynrestored;
import java.util.ArrayList;
import java.util.UUID;
import mage.constants.CardType;
@ -42,11 +41,10 @@ import mage.cards.CardsImpl;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicate;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.util.CardUtil;
/**
*
@ -59,7 +57,6 @@ public class DescendantsPath extends CardImpl {
super(ownerId, 173, "Descendants' Path", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
this.expansionSetCode = "AVR";
// At the beginning of your upkeep, reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library.
Ability ability = new BeginningOfUpkeepTriggeredAbility(new DescendantsPathEffect(), TargetController.YOU, false);
this.addAbility(ability);
@ -93,36 +90,39 @@ class DescendantsPathEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
if (player.getLibrary().size() > 0) {
Card card = player.getLibrary().getFromTop(game);
player.revealCards("DescendantsPath", new CardsImpl(card), game);
if (card.getCardType().contains(CardType.CREATURE)) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
if (controller.getLibrary().size() > 0) {
Card card = controller.getLibrary().getFromTop(game);
if (card == null) {
return false;
}
controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);
if (card.getCardType().contains(CardType.CREATURE)) {
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
ArrayList<Predicate<MageObject>> subtypes = new ArrayList<>();
for (String subtype: card.getSubtype()) {
subtypes.add(new SubtypePredicate(subtype));
boolean found = false;
for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) {
if (CardUtil.shareSubtypes(card, permanent)) {
found = true;
break;
}
}
filter.add(Predicates.or(subtypes));
int count = game.getBattlefield().getAllActivePermanents(filter, player.getId(), game).size();
if (count > 0) {
game.informPlayers("DescendantsPath: Found a creature that shares a creature type with the revealed card.");
if (player.chooseUse(Outcome.Benefit, "Cast the card?", game)) {
player.cast(card.getSpellAbility(), game, true);
if (found) {
game.informPlayers(sourceObject.getLogName() + ": Found a creature that shares a creature type with the revealed card.");
if (controller.chooseUse(Outcome.Benefit, "Cast the card?", game)) {
controller.cast(card.getSpellAbility(), game, true);
} else {
game.informPlayers("DescendantsPath: " + player.getLogName() + " canceled casting the card.");
player.getLibrary().putOnBottom(card, game);
game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " canceled casting the card.");
controller.getLibrary().putOnBottom(card, game);
}
} else {
game.informPlayers("DescendantsPath: No creature that shares a creature type with the revealed card.");
player.getLibrary().putOnBottom(card, game);
game.informPlayers(sourceObject.getLogName() + ": No creature that shares a creature type with the revealed card.");
controller.getLibrary().putOnBottom(card, game);
}
} else {
game.informPlayers("DescendantsPath: put " + card.getName() + " on the bottom.");
player.getLibrary().putOnBottom(card, game);
game.informPlayers(sourceObject.getLogName() + ": Put " + card.getLogName() + " on the bottom.");
controller.getLibrary().putOnBottom(card, game);
}
return true;

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.commander;
import java.util.UUID;
/**
*
* @author anonymous
*/
public class DreambornMuse extends mage.sets.legions.DreambornMuse {
public DreambornMuse(UUID ownerId) {
super(ownerId);
this.cardNumber = 44;
this.expansionSetCode = "CMD";
}
public DreambornMuse(final DreambornMuse card) {
super(card);
}
@Override
public DreambornMuse copy() {
return new DreambornMuse(this);
}
}

View file

@ -0,0 +1,80 @@
/*
* 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.commander;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayTargetPlayerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterBasicLandCard;
import mage.target.TargetPlayer;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author ilcartographer
*/
public class Fertilid extends CardImpl {
public Fertilid(UUID ownerId) {
super(ownerId, 154, "Fertilid", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.expansionSetCode = "CMD";
this.subtype.add("Elemental");
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// Fertilid enters the battlefield with two +1/+1 counters on it.
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), "with two +1/+1 counters on it"));
// {1}{G}, Remove a +1/+1 counter from Fertilid: Target player searches his or her library for a basic land card and puts it onto the battlefield tapped. Then that player shuffles his or her library.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new SearchLibraryPutInPlayTargetPlayerEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true, true), new ManaCostsImpl("{1}{G}"));
ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance(1)));
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}
public Fertilid(final Fertilid card) {
super(card);
}
@Override
public Fertilid copy() {
return new Fertilid(this);
}
}

View file

@ -0,0 +1,106 @@
/*
* 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 mage.sets.darksteel;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.SacrificeEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
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.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author wanderer120
*/
public class GreaterHarvester extends CardImpl {
public static final FilterPermanent filter = new FilterPermanent("a permanent");
static {
filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.ENCHANTMENT),
new CardTypePredicate(CardType.PLANESWALKER),
new CardTypePredicate(CardType.LAND)));
}
public GreaterHarvester(UUID ownerId) {
super(ownerId, 44, "Greater Harvester", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}{B}");
this.expansionSetCode = "DST";
this.subtype.add("Horror");
this.power = new MageInt(5);
this.toughness = new MageInt(6);
// At the beginning of your upkeep, sacrifice a permanent.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeEffect(filter, 1, ""), TargetController.YOU, false));
//Whenever Greater Harvester deals combat damage to a player, that player sacrifices two permanents.
this.addAbility(new GreaterHarvesterAbility());
}
public GreaterHarvester(final GreaterHarvester card) {
super(card);
}
@Override
public GreaterHarvester copy() {
return new GreaterHarvester(this);
}
}
class GreaterHarvesterAbility extends TriggeredAbilityImpl {
public GreaterHarvesterAbility() {
super(Zone.BATTLEFIELD, new SacrificeEffect(new FilterPermanent(), 2, ""));
}
public GreaterHarvesterAbility(final GreaterHarvesterAbility ability) {
super(ability);
}
@Override
public GreaterHarvesterAbility copy() {
return new GreaterHarvesterAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return EventType.DAMAGED_PLAYER.equals(event.getType());
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
return true;
}
return false;
}
@Override
public String getRule() {
return "Whenever {this} deals combat damage to a player, that player sacrifices two permanent.";
}
}

View file

@ -0,0 +1,105 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.dissension;
import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
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.target.targetpointer.FixedTarget;
/**
*
* @author ilcartographer
*/
public class PainMagnification extends CardImpl {
public PainMagnification(UUID ownerId) {
super(ownerId, 121, "Pain Magnification", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{R}");
this.expansionSetCode = "DIS";
// Whenever an opponent is dealt 3 or more damage by a single source, that player discards a card.
this.addAbility(new PainMagnificationTriggeredAbility());
}
public PainMagnification(final PainMagnification card) {
super(card);
}
@Override
public PainMagnification copy() {
return new PainMagnification(this);
}
}
class PainMagnificationTriggeredAbility extends TriggeredAbilityImpl {
public PainMagnificationTriggeredAbility() {
super(Zone.BATTLEFIELD, new DiscardTargetEffect(1), false);
}
public PainMagnificationTriggeredAbility(final PainMagnificationTriggeredAbility ability) {
super(ability);
}
@Override
public PainMagnificationTriggeredAbility copy() {
return new PainMagnificationTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
// If the damaged player is an opponent
if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) {
if(event.getAmount() >= 3) {
// If at least 3 damage is dealt, set the opponent as the Discard target
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever an opponent is dealt 3 or more damage by a single source, that player discards a card.";
}
}

View file

@ -100,16 +100,19 @@ class TeysaEnvoyOfGhostsTriggeredAbility extends TriggeredAbilityImpl {
return new TeysaEnvoyOfGhostsTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event instanceof DamagedPlayerEvent) {
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
Permanent p = game.getPermanent(event.getSourceId());
if (damageEvent.getPlayerId().equals(controllerId) && damageEvent.isCombatDamage() && p != null && p.getCardType().contains(CardType.CREATURE)) {
game.getState().setValue(sourceId.toString(), p.getControllerId());
getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId()));
return true;
}
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
Permanent sourcePermanent = game.getPermanent(event.getSourceId());
if (damageEvent.getPlayerId().equals(getControllerId()) && damageEvent.isCombatDamage() && sourcePermanent != null && sourcePermanent.getCardType().contains(CardType.CREATURE)) {
game.getState().setValue(sourceId.toString(), sourcePermanent.getControllerId());
getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId()));
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.exodus;
import java.util.UUID;
/**
*
* @author ilcartographer
*/
public class ElvishBerserker extends mage.sets.ninthedition.ElvishBerserker {
public ElvishBerserker(UUID ownerId) {
super(ownerId);
this.cardNumber = 110;
this.expansionSetCode = "EXO";
}
public ElvishBerserker(final ElvishBerserker card) {
super(card);
}
@Override
public ElvishBerserker copy() {
return new ElvishBerserker(this);
}
}

View file

@ -31,6 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EndOfCombatTriggeredAbility;
import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.ContinuousEffect;
@ -77,7 +78,7 @@ public class TheWretched extends CardImpl {
this.toughness = new MageInt(5);
// At end of combat, gain control of all creatures blocking The Wretched for as long as you control The Wretched.
this.addAbility(new EndOfAnyCombatTriggeredAbility(), new BlockedAttackerWatcher());
this.addAbility(new EndOfCombatTriggeredAbility(new TheWretchedEffect(), false), new BlockedAttackerWatcher());
}
@ -91,37 +92,6 @@ public class TheWretched extends CardImpl {
}
}
class EndOfAnyCombatTriggeredAbility extends TriggeredAbilityImpl {
EndOfAnyCombatTriggeredAbility() {
super(Zone.BATTLEFIELD, new TheWretchedEffect(), false);
}
EndOfAnyCombatTriggeredAbility(final EndOfAnyCombatTriggeredAbility ability) {
super(ability);
}
@Override
public EndOfAnyCombatTriggeredAbility copy() {
return new EndOfAnyCombatTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.END_COMBAT_STEP_PRE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return true;
}
@Override
public String getRule() {
return "At the end of combat, gain control of all creatures blocking {this} for as long as you control {this}.";
}
}
class TheWretchedEffect extends OneShotEffect {
TheWretchedEffect() {

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.legions;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.dynamicvalue.common.CardsInTargetPlayerHandCount;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
/**
*
* @author cbrianhill
*/
public class DreambornMuse extends CardImpl {
public DreambornMuse(UUID ownerId) {
super(ownerId, 36, "Dreamborn Muse", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
this.expansionSetCode = "LGN";
this.subtype.add("Spirit");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// At the beginning of each player's upkeep, that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand.
PutLibraryIntoGraveTargetEffect effect = new PutLibraryIntoGraveTargetEffect(new CardsInTargetPlayerHandCount());
effect.setText("that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand.");
this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, false));
}
public DreambornMuse(final DreambornMuse card) {
super(card);
}
@Override
public DreambornMuse copy() {
return new DreambornMuse(this);
}
}

View file

@ -0,0 +1,112 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.lorwyn;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetLandPermanent;
/**
*
* @author ilcartographer
*/
public class AquitectsWill extends CardImpl {
public AquitectsWill(UUID ownerId) {
super(ownerId, 52, "Aquitect's Will", Rarity.COMMON, new CardType[]{CardType.TRIBAL, CardType.SORCERY}, "{U}");
this.expansionSetCode = "LRW";
this.subtype.add("Merfolk");
// Put a flood counter on target land.
this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.FLOOD.createInstance()));
this.getSpellAbility().addTarget(new TargetLandPermanent());
// That land is an Island in addition to its other types for as long as it has a flood counter on it.
this.getSpellAbility().addEffect(new AquitectsWillEffect(Duration.Custom, false, false, "Island"));
// If you control a Merfolk, draw a card.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DrawCardSourceControllerEffect(1),
new PermanentsOnTheBattlefieldCondition(new FilterControlledCreaturePermanent("Merfolk", "Merfolk")),
"If you control a Merfolk, draw a card"));
}
public AquitectsWill(final AquitectsWill card) {
super(card);
}
@Override
public AquitectsWill copy() {
return new AquitectsWill(this);
}
}
class AquitectsWillEffect extends BecomesBasicLandTargetEffect {
public AquitectsWillEffect(Duration duration, boolean chooseLandType, boolean loseType, String... landNames) {
super(duration, chooseLandType, loseType, landNames);
staticText = "That land is an Island in addition to its other types for as long as it has a flood counter on it";
}
public AquitectsWillEffect(final AquitectsWillEffect effect) {
super(effect);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent land = game.getPermanent(this.targetPointer.getFirst(game, source));
if (land == null) {
// if permanent left battlefield the effect can be removed because it was only valid for that object
this.discard();
} else if (land.getCounters().getCount(CounterType.FLOOD) > 0) {
// only if Flood counter is on the object it becomes an Island.(it would be possible to remove and return the counters with e.g. Fate Transfer if the land becomes a creature too)
super.apply(layer, sublayer, source, game);
}
return true;
}
@Override
public AquitectsWillEffect copy() {
return new AquitectsWillEffect(this);
}
}

View file

@ -37,7 +37,7 @@ public class CatacombSlug extends mage.sets.returntoravnica.CatacombSlug {
public CatacombSlug(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 998;
this.expansionSetCode = "ORI";
}

View file

@ -37,7 +37,7 @@ public class ChandrasFury extends mage.sets.magic2013.ChandrasFury {
public ChandrasFury(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 997;
this.expansionSetCode = "ORI";
}

View file

@ -37,7 +37,7 @@ public class ChargingGriffin extends mage.sets.magic2014.ChargingGriffin {
public ChargingGriffin(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 996;
this.expansionSetCode = "ORI";
}

View file

@ -37,7 +37,7 @@ public class Claustrophobia extends mage.sets.innistrad.Claustrophobia {
public Claustrophobia(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 995;
this.expansionSetCode = "ORI";
}

View file

@ -37,7 +37,7 @@ public class Cobblebrute extends mage.sets.returntoravnica.Cobblebrute {
public Cobblebrute(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 994;
this.expansionSetCode = "ORI";
}

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.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
import mage.target.TargetPermanent;
/**
*
* @author emerald000
*/
public class ConclaveNaturalists extends CardImpl {
public ConclaveNaturalists(UUID ownerId) {
super(ownerId, 171, "Conclave Naturalists", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}");
this.expansionSetCode = "ORI";
this.subtype.add("Dryad");
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// When Conclave Naturalists enters the battlefield, you may destroy target artifact or enchantment.
Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true);
ability.addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent()));
this.addAbility(ability);
}
public ConclaveNaturalists(final ConclaveNaturalists card) {
super(card);
}
@Override
public ConclaveNaturalists copy() {
return new ConclaveNaturalists(this);
}
}

View file

@ -37,7 +37,7 @@ public class CruelRevival extends mage.sets.onslaught.CruelRevival {
public CruelRevival(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 993;
this.expansionSetCode = "ORI";
}

View file

@ -37,7 +37,7 @@ public class Disperse extends mage.sets.scarsofmirrodin.Disperse {
public Disperse(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 992;
this.expansionSetCode = "ORI";
}

View file

@ -37,7 +37,7 @@ public class ElvishVisionary extends mage.sets.shardsofalara.ElvishVisionary {
public ElvishVisionary(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 991;
this.expansionSetCode = "ORI";
}

View file

@ -37,7 +37,7 @@ public class FieryConclusion extends mage.sets.ravnica.FieryConclusion {
public FieryConclusion(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 990;
this.expansionSetCode = "ORI";
}

View file

@ -0,0 +1,194 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.RequirementEffect;
import mage.abilities.effects.common.PreventAllDamageToSourceEffect;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.TurnPhase;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class GideonBattleForged extends CardImpl {
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent();
static {
filter.add(new ControllerPredicate(TargetController.OPPONENT));
}
public GideonBattleForged(UUID ownerId) {
super(ownerId, 23, "Gideon, Battle-Forged", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "");
this.expansionSetCode = "ORI";
this.subtype.add("Gideon");
this.color.setWhite(true);
this.nightCard = true;
this.canTransform = true;
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
// +2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able.
LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new GideonBattleForgedAttacksIfAbleTargetEffect(Duration.Custom), 2);
loyaltyAbility.addTarget(new TargetCreaturePermanent(0,1,filter, false));
this.addAbility(loyaltyAbility);
// +1: Until your next turn, target creature gains indestructible. Untap that creature.
Effect effect = new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.UntilYourNextTurn);
effect.setText("Until your next turn, target creature gains indestructible");
loyaltyAbility = new LoyaltyAbility(effect, 1);
effect = new UntapTargetEffect();
effect.setText("Untap that creature");
loyaltyAbility.addEffect(effect);
this.addAbility(loyaltyAbility);
// 0: Until end of turn, Gideon, Battle-Forged becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.
LoyaltyAbility ability3 = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonBattleForgedToken(), "planeswalker", Duration.EndOfTurn), 0);
effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn);
effect.setText("Prevent all damage that would be dealt to him this turn");
ability3.addEffect(effect);
this.addAbility(ability3);
}
public GideonBattleForged(final GideonBattleForged card) {
super(card);
}
@Override
public GideonBattleForged copy() {
return new GideonBattleForged(this);
}
}
class GideonBattleForgedToken extends Token {
public GideonBattleForgedToken() {
super("", "4/4 Human Soldier creature with indestructible");
cardType.add(CardType.CREATURE);
subtype.add("Human");
subtype.add("Soldier");
power = new MageInt(4);
toughness = new MageInt(4);
this.addAbility(IndestructibleAbility.getInstance());
}
}
class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect {
int nextTurnTargetController = 0;
protected MageObjectReference targetPermanentReference;
public GideonBattleForgedAttacksIfAbleTargetEffect(Duration duration) {
super(duration);
staticText = "Up to one target creature an opponent controls attacks {this} during its controller's next turn if able";
}
public GideonBattleForgedAttacksIfAbleTargetEffect(final GideonBattleForgedAttacksIfAbleTargetEffect effect) {
super(effect);
this.nextTurnTargetController = effect.nextTurnTargetController;
this.targetPermanentReference = effect.targetPermanentReference;
}
@Override
public GideonBattleForgedAttacksIfAbleTargetEffect copy() {
return new GideonBattleForgedAttacksIfAbleTargetEffect(this);
}
@Override
public boolean isInactive(Ability source, Game game) {
Permanent targetPermanent = targetPermanentReference.getPermanent(game);
if (targetPermanent == null) {
return false;
}
if (nextTurnTargetController == 0 && startingTurn != game.getTurnNum() && game.getActivePlayerId().equals(targetPermanent.getControllerId())) {
nextTurnTargetController = game.getTurnNum();
}
return game.getPhase().getType() == TurnPhase.END && game.getTurnNum() > nextTurnTargetController;
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(getTargetPointer().getFirst(game, source))) {
if (game.getActivePlayerId().equals(permanent.getControllerId())) {
Permanent planeswalker = game.getPermanent(source.getSourceId());
if (planeswalker != null) {
if (planeswalker.getCardType().contains(CardType.CREATURE)) {
return true;
}
} else {
discard();
}
}
}
return false;
}
@Override
public UUID mustAttackDefender(Ability source, Game game) {
return source.getSourceId();
}
@Override
public boolean mustAttack(Game game) {
return true;
}
@Override
public boolean mustBlock(Game game) {
return false;
}
}

View file

@ -37,7 +37,7 @@ public class GoldForgedSentinel extends mage.sets.journeyintonyx.GoldForgedSenti
public GoldForgedSentinel(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 989;
this.expansionSetCode = "ORI";
}

View file

@ -0,0 +1,138 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magicorigins;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class GraspOfTheHieromancer extends CardImpl {
public GraspOfTheHieromancer(UUID ownerId) {
super(ownerId, 15, "Grasp of the Hieromancer", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
this.expansionSetCode = "ORI";
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 gets +1/+1 and has "Whenever this creature attacks, tap target creature defending player controls."
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield));
Ability gainedAbility = new GraspOfTheHieromancerTriggeredAbility(new TapTargetEffect(), false);
gainedAbility.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA);
effect.setText("and has \"Whenever this creature attacks, tap target creature defending player controls.\"");
ability.addEffect(effect);
this.addAbility(ability);
}
public GraspOfTheHieromancer(final GraspOfTheHieromancer card) {
super(card);
}
@Override
public GraspOfTheHieromancer copy() {
return new GraspOfTheHieromancer(this);
}
}
class GraspOfTheHieromancerTriggeredAbility extends TriggeredAbilityImpl {
public GraspOfTheHieromancerTriggeredAbility(Effect effect, boolean optional) {
super(Zone.BATTLEFIELD, effect, optional);
}
public GraspOfTheHieromancerTriggeredAbility(final GraspOfTheHieromancerTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DECLARED_ATTACKERS;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (game.getCombat().getAttackers().contains(getSourceId()) ) {
UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(getSourceId(), game);
if (defendingPlayerId != null) {
this.getTargets().clear();
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
UUID defenderId = game.getCombat().getDefenderId(getSourceId());
filter.add(new ControllerIdPredicate(defenderId));
TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
this.addTarget(target);
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever {this} attacks, tap target creature defending player controls.";
}
@Override
public GraspOfTheHieromancerTriggeredAbility copy() {
return new GraspOfTheHieromancerTriggeredAbility(this);
}
}

View file

@ -0,0 +1,77 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.TapTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LevelX2
*/
public class HeavyInfantry extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls");
static {
filter.add(new ControllerPredicate(TargetController.OPPONENT));
}
public HeavyInfantry(UUID ownerId) {
super(ownerId, 18, "Heavy Infantry", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}");
this.expansionSetCode = "ORI";
this.subtype.add("Human");
this.subtype.add("Soldier");
this.power = new MageInt(3);
this.toughness = new MageInt(4);
// When Heavy Infantry enters the battlefield, tap target creature an opponent controls.
Ability ability = new EntersBattlefieldTriggeredAbility(new TapTargetEffect());
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);
}
public HeavyInfantry(final HeavyInfantry card) {
super(card);
}
@Override
public HeavyInfantry copy() {
return new HeavyInfantry(this);
}
}

View file

@ -0,0 +1,159 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
/**
*
* @author LevelX2
*/
public class HixusPrisonWarden extends CardImpl {
public HixusPrisonWarden(UUID ownerId) {
super(ownerId, 19, "Hixus, Prison Warden", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}");
this.expansionSetCode = "ORI";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Soldier");
this.power = new MageInt(4);
this.toughness = new MageInt(44);
// Flash
this.addAbility(FlashAbility.getInstance());
// Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.
this.addAbility(new HixusPrisonWardenTriggeredAbility(new HixusPrisonWardenExileEffect()));
}
public HixusPrisonWarden(final HixusPrisonWarden card) {
super(card);
}
@Override
public HixusPrisonWarden copy() {
return new HixusPrisonWarden(this);
}
}
class HixusPrisonWardenTriggeredAbility extends TriggeredAbilityImpl {
public HixusPrisonWardenTriggeredAbility(Effect effect) {
super(Zone.BATTLEFIELD, effect);
this.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()));
}
public HixusPrisonWardenTriggeredAbility(final HixusPrisonWardenTriggeredAbility ability) {
super(ability);
}
@Override
public HixusPrisonWardenTriggeredAbility copy() {
return new HixusPrisonWardenTriggeredAbility(this);
}
@Override
public boolean checkInterveningIfClause(Game game) {
MageObject mageObject = getSourceObject(game);
return (mageObject instanceof Permanent) && ((Permanent)mageObject).getTurnsOnBattlefield() ==1;
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
Permanent sourcePermanent = game.getPermanent(event.getSourceId());
if (damageEvent.getPlayerId().equals(getControllerId()) &&
damageEvent.isCombatDamage() &&
sourcePermanent != null &&
sourcePermanent.getCardType().contains(CardType.CREATURE)) {
getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId()));
return true;
}
return false;
}
@Override
public String getRule() {
return "Whenever a creature deals combat damage to you, if {this} entered the battlefield this turn, exile that creature until {this} leaves the battlefield.";
}
}
class HixusPrisonWardenExileEffect extends OneShotEffect {
public HixusPrisonWardenExileEffect() {
super(Outcome.Benefit);
this.staticText = "exile that creature until {this} leaves the battlefield";
}
public HixusPrisonWardenExileEffect(final HixusPrisonWardenExileEffect effect) {
super(effect);
}
@Override
public HixusPrisonWardenExileEffect copy() {
return new HixusPrisonWardenExileEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game);
// If Prison Warden leaves the battlefield before its triggered ability resolves,
// the target creature won't be exiled.
if (permanent != null) {
return new ExileTargetEffect(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), permanent.getIdName()).apply(game, source);
}
return false;
}
}

View file

@ -38,7 +38,7 @@ public class JayemdaeTome extends mage.sets.tenthedition.JayemdaeTome {
public JayemdaeTome(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 988;
this.expansionSetCode = "ORI";
this.rarity = Rarity.UNCOMMON;
}

View file

@ -0,0 +1,120 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.common.EndOfCombatTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.condition.Condition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect;
import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect.Gender;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.watchers.common.AttackedThisCombatWatcher;
/**
*
* @author LevelX2
*/
public class KytheonHeroOfAkros extends CardImpl {
public KytheonHeroOfAkros(UUID ownerId) {
super(ownerId, 23, "Kytheon, Hero of Akros", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{W}");
this.expansionSetCode = "ORI";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Soldier");
this.power = new MageInt(2);
this.toughness = new MageInt(1);
this.canTransform = true;
this.secondSideCard = new GideonBattleForged(ownerId);
// At end of combat, if Kytheon, Hero of Akros and at least two other creatures attacked this combat, exile Kytheon,
// then return him to the battlefield transformed under his owner's control.
this.addAbility(new TransformAbility());
this.addAbility(new ConditionalTriggeredAbility(new EndOfCombatTriggeredAbility(new ExileAndReturnTransformedSourceEffect(Gender.MALE), false),
new KytheonHeroOfAkrosCondition(), "At end of combat, if {this} and at least two other creatures attacked this combat, exile {this}, " +
"then return him to the battlefield transformed under his owner's control."), new AttackedThisCombatWatcher());
// {2}{W}: Kytheon gains indestructible until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl<>("{2}{W}")));
}
public KytheonHeroOfAkros(final KytheonHeroOfAkros card) {
super(card);
}
@Override
public KytheonHeroOfAkros copy() {
return new KytheonHeroOfAkros(this);
}
}
class KytheonHeroOfAkrosCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
Permanent sourceObject = game.getPermanent(source.getSourceId());
if (sourceObject != null) {
AttackedThisCombatWatcher watcher = (AttackedThisCombatWatcher) game.getState().getWatchers().get("AttackedThisCombat");
if (watcher != null) {
boolean sourceFound = false;
int number = 0;
for (MageObjectReference mor: watcher.getAttackedThisTurnCreatures()) {
if (mor.refersTo(sourceObject, game)) {
sourceFound = true;
} else {
number++;
}
}
return sourceFound && number >= 2;
}
}
return false;
}
@Override
public String toString() {
return "if {this} and at least two other creatures attacked this combat";
}
}

View file

@ -37,7 +37,7 @@ public class LeafGilder extends mage.sets.lorwyn.LeafGilder {
public LeafGilder(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 987;
this.expansionSetCode = "ORI";
}

View file

@ -0,0 +1,82 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magicorigins;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.ReachAbility;
import mage.cards.CardImpl;
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.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author emerald000
*/
public class MantleOfWebs extends CardImpl {
public MantleOfWebs(UUID ownerId) {
super(ownerId, 187, "Mantle of Webs", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
this.expansionSetCode = "ORI";
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 gets +1/+3 and has reach.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 3, Duration.WhileOnBattlefield)));
Effect effect = new GainAbilityAttachedEffect(ReachAbility.getInstance(), AttachmentType.AURA);
effect.setText("and has reach");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
}
public MantleOfWebs(final MantleOfWebs card) {
super(card);
}
@Override
public MantleOfWebs copy() {
return new MantleOfWebs(this);
}
}

View file

@ -37,7 +37,7 @@ public class MaritimeGuard extends mage.sets.magic2011.MaritimeGuard {
public MaritimeGuard(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 986;
this.expansionSetCode = "ORI";
}

View file

@ -37,7 +37,7 @@ public class Meteorite extends mage.sets.magic2015.Meteorite {
public Meteorite(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 985;
this.expansionSetCode = "ORI";
}

View file

@ -37,7 +37,7 @@ public class MightyLeap extends mage.sets.magic2011.MightyLeap {
public MightyLeap(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 984;
this.expansionSetCode = "ORI";
}

View file

@ -0,0 +1,198 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magicorigins;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
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.counters.CounterType;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
import mage.players.Player;
import mage.target.common.TargetLandPermanent;
/**
*
* @author emerald000
*/
public class NissaSageAnimist extends CardImpl {
public NissaSageAnimist(UUID ownerId) {
super(ownerId, 189, "Nissa, Sage Animist", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "");
this.expansionSetCode = "ORI";
this.subtype.add("Nissa");
this.color.setGreen(true);
this.nightCard = true;
this.canTransform = true;
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
// +1: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.
this.addAbility(new LoyaltyAbility(new NissaSageAnimistPlusOneEffect(), 1));
// -2: Put a legendary 4/4 green Elemental creature token named Ashaya, the Awoken World onto the battlefield.
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new NissaSageAnimistToken()), -2));
// -7: Untap up to six target lands. They become 6/6 Elemental creatures. They're still lands.
Ability ability = new LoyaltyAbility(new UntapTargetEffect(), -7);
ability.addTarget(new TargetLandPermanent(0, 6, new FilterLandPermanent("lands"), false));
ability.addEffect(new NissaSageAnimistMinusSevenEffect());
this.addAbility(ability);
}
public NissaSageAnimist(final NissaSageAnimist card) {
super(card);
}
@Override
public NissaSageAnimist copy() {
return new NissaSageAnimist(this);
}
}
class NissaSageAnimistPlusOneEffect extends OneShotEffect {
NissaSageAnimistPlusOneEffect() {
super(Outcome.Benefit);
this.staticText = "Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.";
}
NissaSageAnimistPlusOneEffect(final NissaSageAnimistPlusOneEffect effect) {
super(effect);
}
@Override
public NissaSageAnimistPlusOneEffect copy() {
return new NissaSageAnimistPlusOneEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && controller.getLibrary().size() > 0) {
Card card = controller.getLibrary().getFromTop(game);
if (card == null) {
return false;
}
CardsImpl cards = new CardsImpl();
cards.add(card);
controller.revealCards("Nissa, Sage Animist", cards, game);
if (card.getCardType().contains(CardType.LAND)) {
return controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
} else {
return controller.moveCards(card, Zone.LIBRARY, Zone.HAND, source, game);
}
}
return true;
}
}
class NissaSageAnimistToken extends Token {
NissaSageAnimistToken() {
super("Ashaya, the Awoken World", "legendary 4/4 green Elemental creature token named Ashaya, the Awoken World");
this.setOriginalExpansionSetCode("ORI");
this.getSupertype().add("Legendary");
this.getPower().initValue(4);
this.getToughness().initValue(4);
this.color.setGreen(true);
this.getSubtype().add("Elemental");
this.getCardType().add(CardType.CREATURE);
}
}
class NissaSageAnimistMinusSevenEffect extends ContinuousEffectImpl {
NissaSageAnimistMinusSevenEffect() {
super(Duration.EndOfGame, Outcome.BecomeCreature);
this.staticText = "They become 6/6 Elemental creatures. They're still lands";
}
NissaSageAnimistMinusSevenEffect(final NissaSageAnimistMinusSevenEffect effect) {
super(effect);
}
@Override
public NissaSageAnimistMinusSevenEffect copy() {
return new NissaSageAnimistMinusSevenEffect(this);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
for (UUID permanentId : this.getTargetPointer().getTargets(game, source)) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null) {
switch (layer) {
case TypeChangingEffects_4:
if (!permanent.getCardType().contains(CardType.CREATURE)) {
permanent.getCardType().add(CardType.CREATURE);
}
if (!permanent.getSubtype().contains("Elemental")) {
permanent.getSubtype().add("Elemental");
}
break;
case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) {
permanent.getToughness().setValue(6);
permanent.getPower().setValue(6);
}
}
}
}
return true;
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public boolean hasLayer(Layer layer) {
return layer == Layer.TypeChangingEffects_4 || layer == Layer.PTChangingEffects_7;
}
}

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.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect;
import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect.Gender;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterCard;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author emerald000
*/
public class NissaVastwoodSeer extends CardImpl {
private static final FilterCard filter = new FilterCard("basic Forest card");
static {
filter.add(new SupertypePredicate("Basic"));
filter.add(new SubtypePredicate("Forest"));
}
public NissaVastwoodSeer(UUID ownerId) {
super(ownerId, 189, "Nissa, Vastwood Seer", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.expansionSetCode = "ORI";
this.supertype.add("Legendary");
this.subtype.add("Elf");
this.subtype.add("Scout");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
this.canTransform = true;
this.secondSideCard = new NissaSageAnimist(ownerId);
// When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, filter), true, true), true));
// Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control.
this.addAbility(new TransformAbility());
this.addAbility(new ConditionalTriggeredAbility(
new EntersBattlefieldControlledTriggeredAbility(new ExileAndReturnTransformedSourceEffect(Gender.FEMAL), new FilterLandPermanent()),
new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent(), CountType.MORE_THAN, 6, true),
"Whenever a land enters the battlefield under your control, if you control seven or more lands, exile {this}, then return her to the battlefield transformed under her owner's control."));
}
public NissaVastwoodSeer(final NissaVastwoodSeer card) {
super(card);
}
@Override
public NissaVastwoodSeer copy() {
return new NissaVastwoodSeer(this);
}
}

View file

@ -37,7 +37,7 @@ public class RunedServitor extends mage.sets.riseoftheeldrazi.RunedServitor {
public RunedServitor(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 983;
this.expansionSetCode = "ORI";
}

View file

@ -37,7 +37,7 @@ public class ScrapskinDrake extends mage.sets.avacynrestored.ScrapskinDrake {
public ScrapskinDrake(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 982;
this.expansionSetCode = "ORI";
}

View file

@ -0,0 +1,98 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FirstTargetPointer;
/**
*
* @author LevelX2
*/
public class SentinelOfTheEternalWatch extends CardImpl {
public SentinelOfTheEternalWatch(UUID ownerId) {
super(ownerId, 30, "Sentinel of the Eternal Watch", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{W}");
this.expansionSetCode = "ORI";
this.subtype.add("Giant");
this.subtype.add("Soldier");
this.power = new MageInt(4);
this.toughness = new MageInt(6);
// Vigilance
this.addAbility(VigilanceAbility.getInstance());
// At the beginning of combat on each opponent's turn, tap target creature that player controls.
this.addAbility(new BeginningOfCombatTriggeredAbility(Zone.BATTLEFIELD, new TapTargetEffect("target creature that player controls"), TargetController.OPPONENT, false, true));
}
public SentinelOfTheEternalWatch(final SentinelOfTheEternalWatch card) {
super(card);
}
@Override
public SentinelOfTheEternalWatch copy() {
return new SentinelOfTheEternalWatch(this);
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability instanceof BeginningOfCombatTriggeredAbility) {
for (Effect effect: ability.getEffects()) {
UUID opponentId = effect.getTargetPointer().getFirst(game, ability);
Player opponent = game.getPlayer(opponentId);
if (opponent != null) {
effect.setTargetPointer(new FirstTargetPointer());
FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature from the active opponent");
filter.add(new ControllerIdPredicate(opponentId));
Target target = new TargetCreaturePermanent(filter);
ability.addTarget(target);
}
}
}
}
}

View file

@ -37,7 +37,7 @@ public class TitanicGrowth extends mage.sets.magic2012.TitanicGrowth {
public TitanicGrowth(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 981;
this.expansionSetCode = "ORI";
}

View file

@ -37,7 +37,7 @@ public class TitansStrength extends mage.sets.theros.TitansStrength {
public TitansStrength(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 980;
this.expansionSetCode = "ORI";
}

View file

@ -37,7 +37,7 @@ public class TowerGeist extends mage.sets.darkascension.TowerGeist {
public TowerGeist(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 979;
this.expansionSetCode = "ORI";
}

View file

@ -37,7 +37,7 @@ public class VastwoodGorger extends mage.sets.zendikar.VastwoodGorger {
public VastwoodGorger(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 978;
this.expansionSetCode = "ORI";
}

View file

@ -0,0 +1,67 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magicorigins;
import java.util.UUID;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author emerald000
*/
public class VeteransSidearm extends CardImpl {
public VeteransSidearm(UUID ownerId) {
super(ownerId, 242, "Veteran's Sidearm", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}");
this.expansionSetCode = "ORI";
this.subtype.add("Equipment");
// Equipped creature gets +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1)));
// Equip {1}
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1)));
}
public VeteransSidearm(final VeteransSidearm card) {
super(card);
}
@Override
public VeteransSidearm copy() {
return new VeteransSidearm(this);
}
}

View file

@ -37,7 +37,7 @@ public class WeightOfTheUnderworld extends mage.sets.bornofthegods.WeightOfTheUn
public WeightOfTheUnderworld(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 977;
this.expansionSetCode = "ORI";
}

View file

@ -37,7 +37,7 @@ public class YevasForcemage extends mage.sets.magic2013.YevasForcemage {
public YevasForcemage(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 976;
this.expansionSetCode = "ORI";
}

View file

@ -37,7 +37,7 @@ public class YokedOx extends mage.sets.theros.YokedOx {
public YokedOx(UUID ownerId) {
super(ownerId);
this.cardNumber = 999;
this.cardNumber = 975;
this.expansionSetCode = "ORI";
}

View file

@ -28,7 +28,6 @@
package mage.sets.mirrodinbesieged;
import java.util.UUID;
import mage.Mana;
import mage.constants.CardType;
import mage.constants.Duration;
@ -46,7 +45,6 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.mana.ColorlessManaAbility;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.filter.common.FilterAttackingCreature;
import mage.game.Game;

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.morningtide;
import java.util.UUID;
/**
*
* @author ilcartographer
*/
public class Fertilid extends mage.sets.commander.Fertilid {
public Fertilid(UUID ownerId) {
super(ownerId);
this.cardNumber = 122;
this.expansionSetCode = "MOR";
}
public Fertilid(final Fertilid card) {
super(card);
}
@Override
public Fertilid copy() {
return new Fertilid(this);
}
}

View file

@ -0,0 +1,65 @@
/*
* 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.common.BecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
/**
*
* @author ilcartographer
*/
public class ElvishBerserker extends CardImpl {
public ElvishBerserker(UUID ownerId) {
super(ownerId, 237, "Elvish Berserker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}");
this.expansionSetCode = "9ED";
this.subtype.add("Elf");
this.subtype.add("Berserker");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Whenever Elvish Berserker becomes blocked, it gets +1/+1 until end of turn for each creature blocking it.
this.addAbility(new BecomesBlockedByCreatureTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), false));
}
public ElvishBerserker(final ElvishBerserker card) {
super(card);
}
@Override
public ElvishBerserker copy() {
return new ElvishBerserker(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.planechase;
import java.util.UUID;
/**
*
* @author ilcartographer
*/
public class Fertilid extends mage.sets.commander.Fertilid {
public Fertilid(UUID ownerId) {
super(ownerId);
this.cardNumber = 72;
this.expansionSetCode = "HOP";
}
public Fertilid(final Fertilid card) {
super(card);
}
@Override
public Fertilid copy() {
return new Fertilid(this);
}
}

View file

@ -38,6 +38,7 @@ import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.RequirementEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
@ -85,7 +86,9 @@ public class GideonJura extends CardImpl {
// 0: Until end of turn, Gideon Jura becomes a 6/6 Human Soldier creature that's still a planeswalker. Prevent all damage that would be dealt to him this turn.
LoyaltyAbility ability3 = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonJuraToken(), "planeswalker", Duration.EndOfTurn), 0);
ability3.addEffect(new PreventAllDamageToSourceEffect(Duration.EndOfTurn));
Effect effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn);
effect.setText("Prevent all damage that would be dealt to him this turn");
ability3.addEffect(effect);
this.addAbility(ability3);
}

View file

@ -32,6 +32,7 @@ import java.util.UUID;
import mage.constants.*;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
@ -54,7 +55,6 @@ public class SnakeUmbra extends CardImpl {
this.expansionSetCode = "ROE";
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
@ -63,11 +63,14 @@ public class SnakeUmbra extends CardImpl {
this.addAbility(ability);
// Enchanted creature gets +1/+1
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield)));
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield));
// and has "Whenever this creature deals damage to an opponent, you may draw a card."
Ability gainedAbility = new DealsDamageToOpponentTriggeredAbility(new DrawCardSourceControllerEffect(1), true);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA)));
Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA);
effect.setText("and has \"Whenever this creature deals damage to an opponent, you may draw a card.\"");
ability.addEffect(effect);
this.addAbility(ability);
// Totem armor
this.addAbility(new TotemArmorAbility());

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 DreambornMuse extends mage.sets.legions.DreambornMuse {
public DreambornMuse(UUID ownerId) {
super(ownerId);
this.cardNumber = 82;
this.expansionSetCode = "10E";
}
public DreambornMuse(final DreambornMuse card) {
super(card);
}
@Override
public DreambornMuse copy() {
return new DreambornMuse(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 ilcartographer
*/
public class ElvishBerserker extends mage.sets.ninthedition.ElvishBerserker {
public ElvishBerserker(UUID ownerId) {
super(ownerId);
this.cardNumber = 260;
this.expansionSetCode = "10E";
}
public ElvishBerserker(final ElvishBerserker card) {
super(card);
}
@Override
public ElvishBerserker copy() {
return new ElvishBerserker(this);
}
}

View file

@ -53,7 +53,11 @@ public class MantisEngine extends CardImpl {
this.subtype.add("Insect");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// {2}: Mantis Engine gains flying until end of turn. (It can't be blocked except by creatures with flying or reach.)
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(2)));
// {2}: Mantis Engine gains first strike until end of turn. (It deals combat damage before creatures without first strike.)
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(2)));
}

View file

@ -38,14 +38,10 @@ import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.target.TargetSpell;
import mage.target.targetpointer.FixedTarget;
/**
@ -91,9 +87,14 @@ class PyromancerAscensionQuestTriggeredAbility extends TriggeredAbilityImpl {
return new PyromancerAscensionQuestTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SPELL_CAST;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) {
if (event.getPlayerId().equals(this.getControllerId())) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (isControlledInstantOrSorcery(spell)) {
Card sourceCard = game.getCard(spell.getSourceId());
@ -138,10 +139,15 @@ class PyromancerAscensionCopyTriggeredAbility extends TriggeredAbilityImpl {
public PyromancerAscensionCopyTriggeredAbility copy() {
return new PyromancerAscensionCopyTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SPELL_CAST;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) {
if (event.getPlayerId().equals(this.getControllerId())) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (isControlledInstantOrSorcery(spell)) {
Permanent permanent = game.getBattlefield().getPermanent(this.getSourceId());