Merge pull request #1162 from LoneFox78/master

New stuff again
This commit is contained in:
LevelX2 2015-07-30 10:47:11 +02:00
commit 71a13b6e77
36 changed files with 1853 additions and 392 deletions

View file

@ -33,20 +33,20 @@ import java.util.UUID;
*
* @author fireshoes
*/
public class Astrolabe extends mage.sets.masterseditioniii.Astrolabe {
public class Astrolabe1 extends mage.sets.masterseditioniii.Astrolabe {
public Astrolabe(UUID ownerId) {
public Astrolabe1(UUID ownerId) {
super(ownerId);
this.cardNumber = 159;
this.expansionSetCode = "ALL";
}
public Astrolabe(final Astrolabe card) {
public Astrolabe1(final Astrolabe1 card) {
super(card);
}
@Override
public Astrolabe copy() {
return new Astrolabe(this);
public Astrolabe1 copy() {
return new Astrolabe1(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.alliances;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public class Astrolabe2 extends mage.sets.masterseditioniii.Astrolabe {
public Astrolabe2(UUID ownerId) {
super(ownerId);
this.cardNumber = 160;
this.expansionSetCode = "ALL";
}
public Astrolabe2(final Astrolabe2 card) {
super(card);
}
@Override
public Astrolabe2 copy() {
return new Astrolabe2(this);
}
}

View file

@ -33,20 +33,20 @@ import java.util.UUID;
*
* @author fireshoes
*/
public class FeastOrFamine extends mage.sets.izzetvsgolgari.FeastOrFamine {
public class FeastOrFamine1 extends mage.sets.izzetvsgolgari.FeastOrFamine {
public FeastOrFamine(UUID ownerId) {
public FeastOrFamine1(UUID ownerId) {
super(ownerId);
this.cardNumber = 8;
this.expansionSetCode = "ALL";
}
public FeastOrFamine(final FeastOrFamine card) {
public FeastOrFamine1(final FeastOrFamine1 card) {
super(card);
}
@Override
public FeastOrFamine copy() {
return new FeastOrFamine(this);
public FeastOrFamine1 copy() {
return new FeastOrFamine1(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.alliances;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public class FeastOrFamine2 extends mage.sets.izzetvsgolgari.FeastOrFamine {
public FeastOrFamine2(UUID ownerId) {
super(ownerId);
this.cardNumber = 9;
this.expansionSetCode = "ALL";
}
public FeastOrFamine2(final FeastOrFamine2 card) {
super(card);
}
@Override
public FeastOrFamine2 copy() {
return new FeastOrFamine2(this);
}
}

View file

@ -50,9 +50,9 @@ import mage.target.TargetPermanent;
*
* @author fireshoes
*/
public class GorillaShaman extends CardImpl {
public class GorillaShaman1 extends CardImpl {
public GorillaShaman(UUID ownerId) {
public GorillaShaman1(UUID ownerId) {
super(ownerId, 106, "Gorilla Shaman", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}");
this.expansionSetCode = "ALL";
this.subtype.add("Ape");
@ -79,12 +79,12 @@ public class GorillaShaman extends CardImpl {
}
}
public GorillaShaman(final GorillaShaman card) {
public GorillaShaman1(final GorillaShaman1 card) {
super(card);
}
@Override
public GorillaShaman copy() {
return new GorillaShaman(this);
public GorillaShaman1 copy() {
return new GorillaShaman1(this);
}
}

View file

@ -0,0 +1,53 @@
/*
* 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.alliances;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author fireshoes
*/
public class GorillaShaman2 extends GorillaShaman1 {
public GorillaShaman2(UUID ownerId) {
super(ownerId);
this.cardNumber = 107;
this.rarity = Rarity.UNCOMMON;
}
public GorillaShaman2(final GorillaShaman2 card) {
super(card);
}
@Override
public GorillaShaman2 copy() {
return new GorillaShaman2(this);
}
}

View file

@ -31,6 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageControllerEffect;
import mage.abilities.effects.common.SacrificeTargetEffect;
import mage.cards.CardImpl;
@ -43,9 +44,9 @@ import mage.target.common.TargetControlledPermanent;
*
* @author fireshoes
*/
public class PhyrexianWarBeast extends CardImpl {
public class PhyrexianWarBeast1 extends CardImpl {
public PhyrexianWarBeast(UUID ownerId) {
public PhyrexianWarBeast1(UUID ownerId) {
super(ownerId, 169, "Phyrexian War Beast", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
this.expansionSetCode = "ALL";
this.subtype.add("Beast");
@ -53,18 +54,22 @@ public class PhyrexianWarBeast extends CardImpl {
this.toughness = new MageInt(4);
// When Phyrexian War Beast leaves the battlefield, sacrifice a land and Phyrexian War Beast deals 1 damage to you.
Ability ability = new LeavesBattlefieldTriggeredAbility(new SacrificeTargetEffect(), false);
ability.addEffect(new DamageControllerEffect(1));
Effect effect = new SacrificeTargetEffect();
effect.setText("sacrifice a land");
Ability ability = new LeavesBattlefieldTriggeredAbility(effect, false);
effect = new DamageControllerEffect(1);
effect.setText("and {this} deals 1 damage to you");
ability.addEffect(effect);
ability.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent()));
this.addAbility(ability);
}
public PhyrexianWarBeast(final PhyrexianWarBeast card) {
public PhyrexianWarBeast1(final PhyrexianWarBeast1 card) {
super(card);
}
@Override
public PhyrexianWarBeast copy() {
return new PhyrexianWarBeast(this);
public PhyrexianWarBeast1 copy() {
return new PhyrexianWarBeast1(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.alliances;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author fireshoes
*/
public class PhyrexianWarBeast2 extends PhyrexianWarBeast1 {
public PhyrexianWarBeast2(UUID ownerId) {
super(ownerId);
this.cardNumber = 170;
}
public PhyrexianWarBeast2(final PhyrexianWarBeast2 card) {
super(card);
}
@Override
public PhyrexianWarBeast2 copy() {
return new PhyrexianWarBeast2(this);
}
}

View file

@ -0,0 +1,83 @@
/*
* 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.apocalypse;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
import mage.abilities.effects.common.EnvoyEffect;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.ChosenSubtypePredicate;
/**
*
* @author LoneFox
*/
public class BrassHerald extends CardImpl {
public BrassHerald(UUID ownerId) {
super(ownerId, 133, "Brass Herald", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}");
this.expansionSetCode = "APC";
this.subtype.add("Golem");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// As Brass Herald enters the battlefield, choose a creature type.
this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.BoostCreature)));
// When Brass Herald enters the battlefield, reveal the top four cards of your library. Put all creature cards of the chosen type revealed this way into your hand and the rest on the bottom of your library in any order.
FilterCard filter = new FilterCard("creature cards of the chosen type");
filter.add(new ChosenSubtypePredicate(this.getId()));
this.addAbility(new EntersBattlefieldTriggeredAbility(new EnvoyEffect(filter, 4)));
// Creatures of the chosen type get +1/+1.
FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creatures of the chosen type");
filter2.add(new ChosenSubtypePredicate(this.getId()));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield,
filter2, false)));
}
public BrassHerald(final BrassHerald card) {
super(card);
}
@Override
public BrassHerald copy() {
return new BrassHerald(this);
}
}

View file

@ -0,0 +1,68 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.apocalypse;
import java.util.UUID;
import mage.abilities.effects.common.PreventAllDamageToAllEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
/**
*
* @author LoneFox
*/
public class DivineLight extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
static {
filter.add(new ControllerPredicate(TargetController.YOU));
}
public DivineLight(UUID ownerId) {
super(ownerId, 8, "Divine Light", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{W}");
this.expansionSetCode = "APC";
// Prevent all damage that would be dealt this turn to creatures you control.
this.getSpellAbility().addEffect(new PreventAllDamageToAllEffect(Duration.EndOfTurn, filter));
}
public DivineLight(final DivineLight card) {
super(card);
}
@Override
public DivineLight copy() {
return new DivineLight(this);
}
}

View file

@ -29,29 +29,32 @@ package mage.sets.apocalypse;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.EnvoyEffect;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author fireshoes
*/
public class EnlistmentOfficer extends CardImpl {
private static final FilterCard filter = new FilterCard("Soldier cards");
static {
filter.add(new SubtypePredicate("Soldier"));
}
public EnlistmentOfficer(UUID ownerId) {
super(ownerId, 9, "Enlistment Officer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{W}");
this.expansionSetCode = "APC";
@ -64,7 +67,7 @@ public class EnlistmentOfficer extends CardImpl {
// First strike
this.addAbility(FirstStrikeAbility.getInstance());
// When Enlistment Officer enters the battlefield, reveal the top four cards of your library. Put all Soldier cards revealed this way into your hand and the rest on the bottom of your library in any order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new EnlistmentOfficerEffect()));
this.addAbility(new EntersBattlefieldTriggeredAbility(new EnvoyEffect(filter, 4)));
}
public EnlistmentOfficer(final EnlistmentOfficer card) {
@ -76,45 +79,3 @@ public class EnlistmentOfficer extends CardImpl {
return new EnlistmentOfficer(this);
}
}
class EnlistmentOfficerEffect extends OneShotEffect {
private static final FilterCard filter = new FilterCard("Soldier");
static {
filter.add(new SubtypePredicate("Soldier"));
}
public EnlistmentOfficerEffect() {
super(Outcome.DrawCard);
this.staticText = "reveal the top four cards of your library. Put all Soldier cards revealed this way into your hand and the rest on the bottom of your library in any order";
}
public EnlistmentOfficerEffect(final EnlistmentOfficerEffect effect) {
super(effect);
}
@Override
public EnlistmentOfficerEffect copy() {
return new EnlistmentOfficerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller == null || sourceObject == null) {
return false;
}
Cards cards = new CardsImpl();
cards.addAll(controller.getLibrary().getTopCards(game, 4));
controller.revealCards(sourceObject.getName(), cards, game);
for (Card card: cards.getCards(game)) {
if (filter.match(card, game)) {
controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
cards.remove(card);
}
}
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
return true;
}
}

View file

@ -29,23 +29,19 @@ package mage.sets.apocalypse;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.EnvoyEffect;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
/**
*
@ -53,6 +49,12 @@ import mage.players.Player;
*/
public class GoblinRingleader extends CardImpl {
private static final FilterCard filter = new FilterCard("Goblin cards");
static {
filter.add(new SubtypePredicate("Goblin"));
}
public GoblinRingleader(UUID ownerId) {
super(ownerId, 62, "Goblin Ringleader", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.expansionSetCode = "APC";
@ -64,7 +66,7 @@ public class GoblinRingleader extends CardImpl {
// Haste
this.addAbility(HasteAbility.getInstance());
// When Goblin Ringleader enters the battlefield, reveal the top four cards of your library. Put all Goblin cards revealed this way into your hand and the rest on the bottom of your library in any order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new GoblinRingleaderEffect()));
this.addAbility(new EntersBattlefieldTriggeredAbility(new EnvoyEffect(filter, 4)));
}
public GoblinRingleader(final GoblinRingleader card) {
@ -76,45 +78,3 @@ public class GoblinRingleader extends CardImpl {
return new GoblinRingleader(this);
}
}
class GoblinRingleaderEffect extends OneShotEffect {
private static final FilterCard filter = new FilterCard("Goblin");
static {
filter.add(new SubtypePredicate("Goblin"));
}
public GoblinRingleaderEffect() {
super(Outcome.DrawCard);
this.staticText = "reveal the top four cards of your library. Put all Goblin cards revealed this way into your hand and the rest on the bottom of your library in any order";
}
public GoblinRingleaderEffect(final GoblinRingleaderEffect effect) {
super(effect);
}
@Override
public GoblinRingleaderEffect copy() {
return new GoblinRingleaderEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller == null || sourceObject == null) {
return false;
}
Cards cards = new CardsImpl();
cards.addAll(controller.getLibrary().getTopCards(game, 4));
controller.revealCards(sourceObject.getName(), cards, game);
for (Card card: cards.getCards(game)) {
if (filter.match(card, game)) {
controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
cards.remove(card);
}
}
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
return true;
}
}

View file

@ -0,0 +1,76 @@
/*
* 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.apocalypse;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.RegenerateSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.EnvoyEffect;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author LoneFox
*/
public class GraveDefiler extends CardImpl {
private static final FilterCard filter = new FilterCard("Zombie cards");
static {
filter.add(new SubtypePredicate("Zombie"));
}
public GraveDefiler(UUID ownerId) {
super(ownerId, 40, "Grave Defiler", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.expansionSetCode = "APC";
this.subtype.add("Zombie");
this.power = new MageInt(2);
this.toughness = new MageInt(1);
// When Grave Defiler enters the battlefield, reveal the top four cards of your library. Put all Zombie cards revealed this way into your hand and the rest on the bottom of your library in any order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new EnvoyEffect(filter, 4)));
// {1}{B}: Regenerate Grave Defiler.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{1}{B}"))); }
public GraveDefiler(final GraveDefiler card) {
super(card);
}
@Override
public GraveDefiler copy() {
return new GraveDefiler(this);
}
}

View file

@ -29,29 +29,31 @@ package mage.sets.apocalypse;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.Card;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.EnvoyEffect;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author fireshoes
*/
public class KavuHowler extends CardImpl {
private static final FilterCard filter = new FilterCard("Kavu cards");
static {
filter.add(new SubtypePredicate("Kavu"));
}
public KavuHowler(UUID ownerId) {
super(ownerId, 79, "Kavu Howler", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}{G}");
this.expansionSetCode = "APC";
@ -61,8 +63,7 @@ public class KavuHowler extends CardImpl {
this.toughness = new MageInt(5);
// When Kavu Howler enters the battlefield, reveal the top four cards of your library. Put all Kavu cards revealed this way into your hand and the rest on the bottom of your library in any order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new KavuHowlerEffect()));
this.addAbility(new EntersBattlefieldTriggeredAbility(new EnvoyEffect(filter, 4)));
}
public KavuHowler(final KavuHowler card) {
@ -74,45 +75,3 @@ public class KavuHowler extends CardImpl {
return new KavuHowler(this);
}
}
class KavuHowlerEffect extends OneShotEffect {
private static final FilterCard filter = new FilterCard("Kavu");
static {
filter.add(new SubtypePredicate("Kavu"));
}
public KavuHowlerEffect() {
super(Outcome.DrawCard);
this.staticText = "reveal the top four cards of your library. Put all Kavu cards revealed this way into your hand and the rest on the bottom of your library in any order";
}
public KavuHowlerEffect(final KavuHowlerEffect effect) {
super(effect);
}
@Override
public KavuHowlerEffect copy() {
return new KavuHowlerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller == null || sourceObject == null) {
return false;
}
Cards cards = new CardsImpl();
cards.addAll(controller.getLibrary().getTopCards(game, 4));
controller.revealCards(sourceObject.getName(), cards, game);
for (Card card: cards.getCards(game)) {
if (filter.match(card, game)) {
controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
cards.remove(card);
}
}
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
return true;
}
}

View file

@ -0,0 +1,144 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.apocalypse;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LoseLifeAllPlayersEffect;
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.GameEvent.EventType;
import mage.game.events.GameEvent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author LoneFox
*/
public class PutridWarrior extends CardImpl {
public PutridWarrior(UUID ownerId) {
super(ownerId, 117, "Putrid Warrior", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}{B}");
this.expansionSetCode = "APC";
this.subtype.add("Zombie");
this.subtype.add("Soldier");
this.subtype.add("Warrior");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Whenever Putrid Warrior deals damage, choose one - Each player loses 1 life; or each player gains 1 life.
Ability ability = new PutridWarriorDealsDamageTriggeredAbility(new LoseLifeAllPlayersEffect(1));
Mode mode = new Mode();
mode.getEffects().add(new PutridWarriorGainLifeEffect());
ability.addMode(mode);
this.addAbility(ability);
}
public PutridWarrior(final PutridWarrior card) {
super(card);
}
@Override
public PutridWarrior copy() {
return new PutridWarrior(this);
}
}
class PutridWarriorDealsDamageTriggeredAbility extends TriggeredAbilityImpl {
public PutridWarriorDealsDamageTriggeredAbility(Effect effect) {
super(Zone.BATTLEFIELD, effect, false);
}
public PutridWarriorDealsDamageTriggeredAbility(final PutridWarriorDealsDamageTriggeredAbility ability) {
super(ability);
}
@Override
public PutridWarriorDealsDamageTriggeredAbility copy() {
return new PutridWarriorDealsDamageTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.DAMAGED_PLAYER || event.getType() == EventType.DAMAGED_CREATURE
|| event.getType() == EventType.DAMAGED_PLANESWALKER;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getSourceId().equals(this.sourceId);
}
@Override
public String getRule() {
return "Whenever {this} deals damage, " + super.getRule();
}
}
class PutridWarriorGainLifeEffect extends OneShotEffect {
public PutridWarriorGainLifeEffect() {
super(Outcome.GainLife);
staticText = "Each player gains 1 life.";
}
public PutridWarriorGainLifeEffect(final PutridWarriorGainLifeEffect effect) {
super(effect);
}
@Override
public PutridWarriorGainLifeEffect copy() {
return new PutridWarriorGainLifeEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
for(UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) {
Player player = game.getPlayer(playerId);
if(player != null) {
player.gainLife(1, game);
}
}
return true;
}
}

View file

@ -0,0 +1,95 @@
/*
* 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.apocalypse;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author LoneFox
*/
public class SqueesRevenge extends CardImpl {
public SqueesRevenge(UUID ownerId) {
super(ownerId, 123, "Squee's Revenge", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{1}{U}{R}");
this.expansionSetCode = "APC";
// Choose a number. Flip a coin that many times or until you lose a flip, whichever comes first. If you win all the flips, draw two cards for each flip.
this.getSpellAbility().addEffect(new SqueesRevengeEffect());
}
public SqueesRevenge(final SqueesRevenge card) {
super(card);
}
@Override
public SqueesRevenge copy() {
return new SqueesRevenge(this);
}
}
class SqueesRevengeEffect extends OneShotEffect {
public SqueesRevengeEffect() {
super(Outcome.DrawCard);
staticText = "Choose a number. Flip a coin that many times or until you lose a flip, whichever comes first. If you win all the flips, draw two cards for each flip.";
}
public SqueesRevengeEffect(final SqueesRevengeEffect effect) {
super(effect);
}
public SqueesRevengeEffect copy() {
return new SqueesRevengeEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if(player != null) {
int number = player.announceXMana(0, Integer.MAX_VALUE, "Choose how many times to flip a coin", game, source);
game.informPlayers(player.getLogName() + " chooses " + number + ".");
for(int i = 0; i < number; i++) {
if(!player.flipCoin(game)) {
return true;
}
}
player.drawCards(2 * number, game);
return true;
}
return false;
}
}

View file

@ -29,29 +29,32 @@ package mage.sets.apocalypse;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.EnvoyEffect;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class SylvanMessenger extends CardImpl {
private static final FilterCard filter = new FilterCard("Elf cards");
static {
filter.add(new SubtypePredicate("Elf"));
}
public SylvanMessenger(UUID ownerId) {
super(ownerId, 87, "Sylvan Messenger", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}");
this.expansionSetCode = "APC";
@ -63,8 +66,7 @@ public class SylvanMessenger extends CardImpl {
// Trample
this.addAbility(TrampleAbility.getInstance());
// When Sylvan Messenger enters the battlefield, reveal the top four cards of your library. Put all Elf cards revealed this way into your hand and the rest on the bottom of your library in any order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SylvanMessengerEffect()));
this.addAbility(new EntersBattlefieldTriggeredAbility(new EnvoyEffect(filter, 4)));
}
public SylvanMessenger(final SylvanMessenger card) {
@ -76,45 +78,3 @@ public class SylvanMessenger extends CardImpl {
return new SylvanMessenger(this);
}
}
class SylvanMessengerEffect extends OneShotEffect {
private static final FilterCard filter = new FilterCard("Elf");
static {
filter.add(new SubtypePredicate("Elf"));
}
public SylvanMessengerEffect() {
super(Outcome.DrawCard);
this.staticText = "reveal the top four cards of your library. Put all Elf cards revealed this way into your hand and the rest on the bottom of your library in any order";
}
public SylvanMessengerEffect(final SylvanMessengerEffect effect) {
super(effect);
}
@Override
public SylvanMessengerEffect copy() {
return new SylvanMessengerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller == null || sourceObject == null) {
return false;
}
Cards cards = new CardsImpl();
cards.addAll(controller.getLibrary().getTopCards(game, 4));
controller.revealCards(sourceObject.getName(), cards, game);
for (Card card: cards.getCards(game)) {
if (filter.match(card, game)) {
controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
cards.remove(card);
}
}
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
return true;
}
}

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.apocalypse;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.EnvoyEffect;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author LoneFox
*/
public class TidalCourier extends CardImpl {
private static final FilterCard filter = new FilterCard("Merfolk cards");
static {
filter.add(new SubtypePredicate("Merfolk"));
}
public TidalCourier(UUID ownerId) {
super(ownerId, 31, "Tidal Courier", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.expansionSetCode = "APC";
this.subtype.add("Merfolk");
this.power = new MageInt(1);
this.toughness = new MageInt(2);
// When Tidal Courier enters the battlefield, reveal the top four cards of your library. Put all Merfolk cards revealed this way into your hand and the rest on the bottom of your library in any order.
this.addAbility(new EntersBattlefieldTriggeredAbility(new EnvoyEffect(filter, 4)));
// {3}{U}: Tidal Courier gains flying until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(),
Duration.EndOfTurn), new ManaCostsImpl("{3}{U}")));
}
public TidalCourier(final TidalCourier card) {
super(card);
}
@Override
public TidalCourier copy() {
return new TidalCourier(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.apocalypse;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect;
import mage.cards.CardImpl;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetLandPermanent;
/**
*
* @author LoneFox
*/
public class TundraKavu extends CardImpl {
public TundraKavu(UUID ownerId) {
super(ownerId, 71, "Tundra Kavu", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}");
this.expansionSetCode = "APC";
this.subtype.add("Kavu");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// {T}: Target land becomes a Plains or an Island until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TundraKavuEffect(), new TapSourceCost());
ability.addTarget(new TargetLandPermanent());
this.addAbility(ability);
}
public TundraKavu(final TundraKavu card) {
super(card);
}
@Override
public TundraKavu copy() {
return new TundraKavu(this);
}
}
class TundraKavuEffect extends BecomesBasicLandTargetEffect {
public TundraKavuEffect() {
super(Duration.EndOfTurn, false, true, "");
staticText = "Target land becomes a Plains or an Island until end of turn.";
}
public TundraKavuEffect(final TundraKavuEffect effect) {
super(effect);
}
public TundraKavuEffect copy() {
return new TundraKavuEffect(this);
}
@Override
public void init(Ability source, Game game) {
landTypes.clear();
Player controller = game.getPlayer(source.getControllerId());
if(controller != null) {
Set<String> choiceSet = new LinkedHashSet<>();
choiceSet.add("Island");
choiceSet.add("Plains");
ChoiceImpl choice = new ChoiceImpl(true);
choice.setChoices(choiceSet);
choice.setMessage("Choose a basic land type");
controller.choose(outcome, choice, game);
landTypes.add(choice.getChoice());
} else {
this.discard();
}
super.init(source, game);
}
}

View file

@ -0,0 +1,54 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.eighthedition;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class BrassHerald extends mage.sets.apocalypse.BrassHerald {
public BrassHerald(UUID ownerId) {
super(ownerId);
this.cardNumber = 293;
this.expansionSetCode = "8ED";
this.rarity = Rarity.RARE;
}
public BrassHerald(final BrassHerald card) {
super(card);
}
@Override
public BrassHerald copy() {
return new BrassHerald(this);
}
}

View file

@ -0,0 +1,75 @@
/*
* 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.invasion;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.cost.SpellsCostIncreasementControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author LoneFox
*/
public class AlabasterLeech extends CardImpl {
private static final FilterCard filter = new FilterCard("White spells");
static {
filter.add(new ColorPredicate(ObjectColor.WHITE));
}
public AlabasterLeech(UUID ownerId) {
super(ownerId, 1, "Alabaster Leech", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}");
this.expansionSetCode = "INV";
this.subtype.add("Leech");
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// White spells you cast cost {W} more to cast.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new SpellsCostIncreasementControllerEffect(filter, new ManaCostsImpl("{W}"))));
}
public AlabasterLeech(final AlabasterLeech card) {
super(card);
}
@Override
public AlabasterLeech copy() {
return new AlabasterLeech(this);
}
}

View file

@ -0,0 +1,81 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.invasion;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.cost.SpellsCostIncreasementControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author LoneFox
*/
public class AndraditeLeech extends CardImpl {
private static final FilterCard filter = new FilterCard("Black spells");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
public AndraditeLeech(UUID ownerId) {
super(ownerId, 93, "Andradite Leech", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}");
this.expansionSetCode = "INV";
this.subtype.add("Leech");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Black spells you cast cost {B} more to cast.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new SpellsCostIncreasementControllerEffect(filter, new ManaCostsImpl("{B}"))));
// {B}: Andradite Leech gets +1/+1 until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}")));
}
public AndraditeLeech(final AndraditeLeech card) {
super(card);
}
@Override
public AndraditeLeech copy() {
return new AndraditeLeech(this);
}
}

View file

@ -28,6 +28,7 @@
package mage.sets.invasion;
import java.util.UUID;
import mage.abilities.condition.LockedInCondition;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
@ -54,7 +55,7 @@ public class ExplosiveGrowth extends CardImpl {
// Target creature gets +2/+2 until end of turn. If Explosive Growth was kicked, that creature gets +5/+5 until end of turn instead.
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new BoostTargetEffect(5, 5, Duration.EndOfTurn),
new BoostTargetEffect(2, 2, Duration.EndOfTurn), KickedCondition.getInstance(),
new BoostTargetEffect(2, 2, Duration.EndOfTurn), new LockedInCondition(KickedCondition.getInstance()),
"Target creature gets +2/+2 until end of turn. If Explosive Growth was kicked, that creature gets +5/+5 until end of turn instead."));
}

View file

@ -0,0 +1,75 @@
/*
* 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.invasion;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.cost.SpellsCostIncreasementControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author LoneFox
*/
public class JadeLeech extends CardImpl {
private static final FilterCard filter = new FilterCard("Green spells");
static {
filter.add(new ColorPredicate(ObjectColor.GREEN));
}
public JadeLeech(UUID ownerId) {
super(ownerId, 190, "Jade Leech", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}");
this.expansionSetCode = "INV";
this.subtype.add("Leech");
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// Green spells you cast cost {G} more to cast.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new SpellsCostIncreasementControllerEffect(filter, new ManaCostsImpl("{G}"))));
}
public JadeLeech(final JadeLeech card) {
super(card);
}
@Override
public JadeLeech copy() {
return new JadeLeech(this);
}
}

View file

@ -0,0 +1,88 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.invasion;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.Filter;
import mage.filter.common.FilterArtifactPermanent;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.game.Game;
import mage.target.common.TargetArtifactPermanent;
/**
*
* @author LoneFox
*/
public class Overload extends CardImpl {
private static final FilterArtifactPermanent filter2 = new FilterArtifactPermanent("artifact if its converted mana cost is 2 or less");
private static final FilterArtifactPermanent filter5 = new FilterArtifactPermanent("artifact if its converted mana cost is 5 or less");
static {
filter2.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 3));
filter5.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 5));
}
public Overload(UUID ownerId) {
super(ownerId, 157, "Overload", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}");
this.expansionSetCode = "INV";
// Kicker {2}
this.addAbility(new KickerAbility("{2}"));
// Destroy target artifact if its converted mana cost is 2 or less. If Overload was kicked, destroy that artifact if its converted mana cost is 5 or less instead.
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetArtifactPermanent(filter5));
}
@Override
public void adjustTargets(Ability ability, Game game) {
if(ability instanceof SpellAbility) {
if(!KickedCondition.getInstance().apply(game, ability)) {
ability.getTargets().clear();
ability.getTargets().add(new TargetArtifactPermanent(filter2));
}
}
}
public Overload(final Overload card) {
super(card);
}
@Override
public Overload copy() {
return new Overload(this);
}
}

View file

@ -0,0 +1,78 @@
/*
* 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.invasion;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.cost.SpellsCostIncreasementControllerEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author LoneFox
*/
public class RubyLeech extends CardImpl {
private static final FilterCard filter = new FilterCard("Red spells");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
public RubyLeech(UUID ownerId) {
super(ownerId, 161, "Ruby Leech", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.expansionSetCode = "INV";
this.subtype.add("Leech");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// First strike
this.addAbility(FirstStrikeAbility.getInstance());
// Red spells you cast cost {R} more to cast.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new SpellsCostIncreasementControllerEffect(filter, new ManaCostsImpl("{R}"))));
}
public RubyLeech(final RubyLeech card) {
super(card);
}
@Override
public RubyLeech copy() {
return new RubyLeech(this);
}
}

View file

@ -0,0 +1,78 @@
/*
* 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.invasion;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.cost.SpellsCostIncreasementControllerEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
*
* @author LoneFox
*/
public class SapphireLeech extends CardImpl {
private static final FilterCard filter = new FilterCard("Blue spells");
static {
filter.add(new ColorPredicate(ObjectColor.BLUE));
}
public SapphireLeech(UUID ownerId) {
super(ownerId, 71, "Sapphire Leech", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.expansionSetCode = "INV";
this.subtype.add("Leech");
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Blue spells you cast cost {U} more to cast.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new SpellsCostIncreasementControllerEffect(filter, new ManaCostsImpl("{U}"))));
}
public SapphireLeech(final SapphireLeech card) {
super(card);
}
@Override
public SapphireLeech copy() {
return new SapphireLeech(this);
}
}

View file

@ -0,0 +1,79 @@
/*
* 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.invasion;
import java.util.UUID;
import mage.abilities.condition.LockedInCondition;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect;
import mage.abilities.decorator.ConditionalReplacementEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.replacement.DealtDamageToCreatureBySourceDies;
import mage.abilities.effects.common.ruleModifying.CantRegenerateTargetEffect;
import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.target.common.TargetCreatureOrPlayer;
import mage.watchers.common.DamagedByWatcher;
/**
*
* @author LoneFox
*/
public class ScorchingLava extends CardImpl {
public ScorchingLava(UUID ownerId) {
super(ownerId, 164, "Scorching Lava", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{R}");
this.expansionSetCode = "INV";
// Kicker {R}
this.addAbility(new KickerAbility("{R}"));
// Scorching Lava deals 2 damage to target creature or player. If Scorching Lava was kicked, that creature can't be regenerated this turn and if it would die this turn, exile it instead.
this.getSpellAbility().addEffect(new DamageTargetEffect(2));
this.getSpellAbility().addEffect(new ConditionalContinuousRuleModifyingEffect(
new CantRegenerateTargetEffect(Duration.EndOfTurn, "That creature"), new LockedInCondition(KickedCondition.getInstance())));
Effect effect = new ConditionalReplacementEffect(new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn),
new LockedInCondition(KickedCondition.getInstance()));
effect.setText("and if it would die this turn, exile it instead");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
this.getSpellAbility().addWatcher(new DamagedByWatcher());
}
public ScorchingLava(final ScorchingLava card) {
super(card);
}
@Override
public ScorchingLava copy() {
return new ScorchingLava(this);
}
}

View file

@ -0,0 +1,100 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.invasion;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetNonlandPermanent;
/**
*
* @author LoneFox
*/
public class Winnow extends CardImpl {
public Winnow(UUID ownerId) {
super(ownerId, 45, "Winnow", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{W}");
this.expansionSetCode = "INV";
// Destroy target nonland permanent if another permanent with the same name is on the battlefield.
this.getSpellAbility().addEffect(new WinnowEffect());
this.getSpellAbility().addTarget(new TargetNonlandPermanent());
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
}
public Winnow(final Winnow card) {
super(card);
}
@Override
public Winnow copy() {
return new Winnow(this);
}
}
class WinnowEffect extends DestroyTargetEffect {
public WinnowEffect() {
super();
staticText = "Destroy target nonland permanent if another permanent with the same name is on the battlefield.";
}
public WinnowEffect(final WinnowEffect effect) {
super(effect);
}
@Override
public WinnowEffect copy() {
return new WinnowEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent target = game.getPermanent(source.getFirstTarget());
if(target != null) {
FilterPermanent filter = new FilterPermanent();
filter.add(new NamePredicate(target.getName()));
if(new PermanentsOnBattlefieldCount(filter).calculate(game, source, this) > 1) {
super.apply(game, source);
}
return true;
}
return false;
}
}

View file

@ -27,24 +27,31 @@
*/
package mage.sets.magic2012;
import mage.constants.*;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.cards.CardImpl;
import mage.cards.repository.CardRepository;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
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.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.ChosenSubtypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
/**
* @author nantuko
*/
@ -59,11 +66,15 @@ public class AdaptiveAutomaton extends CardImpl {
this.toughness = new MageInt(2);
// As Adaptive Automaton enters the battlefield, choose a creature type.
this.addAbility(new AsEntersBattlefieldAbility(new AdaptiveAutomatonEffect()));
this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.BoostCreature)));
// Adaptive Automaton is the chosen type in addition to its other types.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AdaptiveAutomatonAddSubtypeEffect()));
// Other creatures you control of the chosen type get +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AdaptiveAutomatonBoostControlledEffect()));
FilterCreaturePermanent filter = new FilterCreaturePermanent("Other creatures you control of the chosen type");
filter.add(new ChosenSubtypePredicate(this.getId()));
filter.add(new AnotherPredicate());
filter.add(new ControllerPredicate(TargetController.YOU));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false)));
}
public AdaptiveAutomaton(final AdaptiveAutomaton card) {
@ -76,43 +87,6 @@ public class AdaptiveAutomaton extends CardImpl {
}
}
class AdaptiveAutomatonEffect extends OneShotEffect {
public AdaptiveAutomatonEffect() {
super(Outcome.BoostCreature);
staticText = "choose a creature type";
}
public AdaptiveAutomatonEffect(final AdaptiveAutomatonEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (player != null && permanent != null) {
Choice typeChoice = new ChoiceImpl(true);
typeChoice.setMessage("Choose creature type");
typeChoice.setChoices(CardRepository.instance.getCreatureTypes());
while (!player.choose(Outcome.BoostCreature, typeChoice, game)) {
if (!player.isInGame()) {
return false;
}
}
game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + typeChoice.getChoice());
game.getState().setValue(permanent.getId() + "_type", typeChoice.getChoice());
permanent.addInfo("chosen type", "<i>Chosen type: " + typeChoice.getChoice().toString() + "</i>", game);
}
return false;
}
@Override
public AdaptiveAutomatonEffect copy() {
return new AdaptiveAutomatonEffect(this);
}
}
class AdaptiveAutomatonAddSubtypeEffect extends ContinuousEffectImpl {
public AdaptiveAutomatonAddSubtypeEffect() {
@ -141,40 +115,3 @@ class AdaptiveAutomatonAddSubtypeEffect extends ContinuousEffectImpl {
return new AdaptiveAutomatonAddSubtypeEffect(this);
}
}
class AdaptiveAutomatonBoostControlledEffect extends ContinuousEffectImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
public AdaptiveAutomatonBoostControlledEffect() {
super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
staticText = "Other creatures you control of the chosen type get +1/+1";
}
public AdaptiveAutomatonBoostControlledEffect(final AdaptiveAutomatonBoostControlledEffect effect) {
super(effect);
}
@Override
public AdaptiveAutomatonBoostControlledEffect copy() {
return new AdaptiveAutomatonBoostControlledEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
String subtype = (String) game.getState().getValue(permanent.getId() + "_type");
if (subtype != null) {
for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
if (!perm.getId().equals(source.getSourceId()) && perm.hasSubtype(subtype)) {
perm.addPower(1);
perm.addToughness(1);
}
}
}
}
return true;
}
}

View file

@ -34,7 +34,7 @@ import mage.constants.Rarity;
*
* @author fireshoes
*/
public class PhyrexianWarBeast extends mage.sets.alliances.PhyrexianWarBeast {
public class PhyrexianWarBeast extends mage.sets.alliances.PhyrexianWarBeast1 {
public PhyrexianWarBeast(UUID ownerId) {
super(ownerId);

View file

@ -34,7 +34,7 @@ import mage.constants.Rarity;
*
* @author fireshoes
*/
public class GorillaShaman extends mage.sets.alliances.GorillaShaman {
public class GorillaShaman extends mage.sets.alliances.GorillaShaman1 {
public GorillaShaman(UUID ownerId) {
super(ownerId);

View file

@ -39,8 +39,7 @@ import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.filter.predicate.mageobject.ChosenSubtypePredicate;
/**
*
@ -55,9 +54,10 @@ public class SharedTriumph extends CardImpl {
// As Shared Triumph enters the battlefield, choose a creature type.
this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.BoostCreature)));
// Creatures of the chosen type get +1/+1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, new FilterSharedTriumph(), false)));
FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures of the chosen type");
filter.add(new ChosenSubtypePredicate(this.getId()));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false)));
}
public SharedTriumph(final SharedTriumph card) {
@ -69,31 +69,3 @@ public class SharedTriumph extends CardImpl {
return new SharedTriumph(this);
}
}
class FilterSharedTriumph extends FilterCreaturePermanent {
public FilterSharedTriumph() {
super("Creatures of the chosen type");
}
public FilterSharedTriumph(final FilterSharedTriumph filter) {
super(filter);
}
@Override
public FilterSharedTriumph copy() {
return new FilterSharedTriumph(this);
}
@Override
public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) {
if(super.match(permanent, sourceId, playerId, game)){
String subtype = (String) game.getState().getValue(sourceId + "_type");
if(subtype != null && !subtype.equals("") && permanent.hasSubtype(subtype)){
return true;
}
}
return false;
}
}

View file

@ -28,16 +28,18 @@
package mage.sets.urzaslegacy;
import java.util.UUID;
import mage.constants.*;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.filter.predicate.mageobject.ChosenSubtypePredicate;
/**
*
@ -53,7 +55,9 @@ public class EngineeredPlague extends CardImpl {
// As Engineered Plague enters the battlefield, choose a creature type.
this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.UnboostCreature)));
// All creatures of the chosen type get -1/-1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Duration.WhileOnBattlefield, new FilterEngineeredPlague(), false)));
FilterCreaturePermanent filter = new FilterCreaturePermanent("All creatures of the chosen type");
filter.add(new ChosenSubtypePredicate(this.getId()));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Duration.WhileOnBattlefield, filter, false)));
}
public EngineeredPlague(final EngineeredPlague card) {
@ -64,33 +68,4 @@ public class EngineeredPlague extends CardImpl {
public EngineeredPlague copy() {
return new EngineeredPlague(this);
}
class FilterEngineeredPlague extends FilterCreaturePermanent {
public FilterEngineeredPlague() {
super("All creatures of the chosen type");
}
public FilterEngineeredPlague(final FilterEngineeredPlague filter) {
super(filter);
}
@Override
public FilterEngineeredPlague copy() {
return new FilterEngineeredPlague(this);
}
@Override
public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) {
if(super.match(permanent, sourceId, playerId, game)){
String subtype = (String) game.getState().getValue(sourceId + "_type");
if(subtype != null && !subtype.equals("") && permanent.hasSubtype(subtype)){
return true;
}
}
return false;
}
}
}

View file

@ -0,0 +1,99 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.effects.common;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.util.CardUtil;
/**
*
* @author LoneFox
*/
public class EnvoyEffect extends OneShotEffect {
private final FilterCard filter;
private final int numCards;
public EnvoyEffect(FilterCard filter, int numCards) {
super(Outcome.DrawCard);
this.filter = filter;
this.numCards = numCards;
}
public EnvoyEffect(final EnvoyEffect effect) {
super(effect);
this.filter = effect.filter.copy();
this.numCards = effect.numCards;
}
@Override
public EnvoyEffect copy() {
return new EnvoyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if(controller == null || sourceObject == null) {
return false;
}
Cards cards = new CardsImpl();
cards.addAll(controller.getLibrary().getTopCards(game, numCards));
controller.revealCards(sourceObject.getName(), cards, game);
for(Card card: cards.getCards(game)) {
if(filter.match(card, game)) {
controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
cards.remove(card);
}
}
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
return true;
}
@Override
public String getText(Mode mode) {
if (staticText != null && !staticText.isEmpty()) {
return staticText;
}
return "Reveal the top " + CardUtil.numberToText(numCards) + " cards of your library. Put all "
+ filter.getMessage() + " revealed this way into your hand and the rest on the bottom of your library in any order.";
}
}

View file

@ -0,0 +1,57 @@
/*
* 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.filter.predicate.mageobject;
import java.util.UUID;
import mage.MageObject;
import mage.filter.predicate.Predicate;
import mage.game.Game;
/**
*
* @author LoneFox
*/
public class ChosenSubtypePredicate implements Predicate<MageObject> {
private final UUID cardID;
public ChosenSubtypePredicate(UUID cardID) {
this.cardID = cardID;
}
@Override
public boolean apply(MageObject input, Game game) {
String subtype = (String) game.getState().getValue(cardID + "_type");
return input.hasSubtype(subtype);
}
@Override
public String toString() {
return "Chosen subtype";
}
}