mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
Merge branch 'master' of https://github.com/magefree/mage
This commit is contained in:
commit
bfd337a808
26 changed files with 1196 additions and 921 deletions
|
@ -31,11 +31,10 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LandfallAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -43,9 +42,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -94,16 +91,10 @@ class AkoumStonewakerEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Token token = new AkoumStonewakerElementalToken();
|
||||
if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) {
|
||||
for (UUID tokenId : token.getLastAddedTokenIds()) {
|
||||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||
if (tokenPermanent != null) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect();
|
||||
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
|
||||
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source);
|
||||
}
|
||||
}
|
||||
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new AkoumStonewakerElementalToken());
|
||||
if(effect.apply(game, source)) {
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -106,7 +106,8 @@ class AllHallowsEveEffect extends OneShotEffect {
|
|||
if (allHallowsEve.getCounters(game).getCount(CounterType.SCREAM) == 0) {
|
||||
allHallowsEve.moveToZone(Zone.GRAVEYARD, source.getId(), game, false);
|
||||
Cards creatures = new CardsImpl();
|
||||
for (Player player : game.getPlayers().values()) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
for (Card creatureCard : player.getGraveyard().getCards(new FilterCreatureCard(), game)) {
|
||||
creatures.add(creatureCard);
|
||||
|
|
|
@ -29,11 +29,9 @@ package mage.cards.c;
|
|||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.PayVariableLoyaltyCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
|
@ -41,20 +39,15 @@ import mage.abilities.effects.Effect;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.DamageAllEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.game.permanent.token.ElementalToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -108,16 +101,9 @@ class ChandraElementalEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new ChandraElementalElementalToken(), 2);
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new ElementalToken("OGW", 1, true), 2);
|
||||
effect.apply(game, source);
|
||||
for (UUID tokenId : effect.getLastAddedTokenIds()) {
|
||||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||
if (tokenPermanent != null) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD);
|
||||
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
|
||||
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source);
|
||||
}
|
||||
}
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -125,22 +111,6 @@ class ChandraElementalEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
|
||||
class ChandraElementalElementalToken extends Token {
|
||||
|
||||
public ChandraElementalElementalToken() {
|
||||
super("Elemental", "3/1 red Elemental creature tokens with haste");
|
||||
setTokenType(1);
|
||||
setOriginalExpansionSetCode("OGW");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setRed(true);
|
||||
subtype.add("Elemental");
|
||||
power = new MageInt(3);
|
||||
toughness = new MageInt(1);
|
||||
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
}
|
||||
}
|
||||
|
||||
class ChandraDrawEffect extends OneShotEffect {
|
||||
|
||||
ChandraDrawEffect() {
|
||||
|
|
138
Mage.Sets/src/mage/cards/d/DiviningWitch.java
Normal file
138
Mage.Sets/src/mage/cards/d/DiviningWitch.java
Normal file
|
@ -0,0 +1,138 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.cards.d;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.DiscardTargetCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.*;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.choices.Choice;
|
||||
import mage.choices.ChoiceImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author maxlebedev
|
||||
*/
|
||||
public class DiviningWitch extends CardImpl {
|
||||
|
||||
public DiviningWitch(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
|
||||
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Spellshaper");
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// {1}{B}, {tap}, Discard a card: Name a card. Exile the top six cards of your library. Reveal cards from the top of your library until you reveal the named card, then put that card into your hand. Exile all other cards revealed this way.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DiviningWitchEffect(), new ManaCostsImpl("{1}{B}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new DiscardTargetCost(new TargetCardInHand()));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public DiviningWitch(final DiviningWitch card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DiviningWitch copy() {
|
||||
return new DiviningWitch(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DiviningWitchEffect extends OneShotEffect {
|
||||
|
||||
DiviningWitchEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "Name a card. Exile the top six cards of your library. Reveal cards from the top of your library until you reveal the named card, then put that card into your hand. Exile all other cards revealed this way";
|
||||
}
|
||||
|
||||
DiviningWitchEffect(final DiviningWitchEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DiviningWitchEffect copy() {
|
||||
return new DiviningWitchEffect(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) {
|
||||
// Name a card.
|
||||
Choice choice = new ChoiceImpl();
|
||||
choice.setChoices(CardRepository.instance.getNames());
|
||||
while (!controller.choose(Outcome.Benefit, choice, game)) {
|
||||
if (!controller.canRespond()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
String name = choice.getChoice();
|
||||
game.informPlayers("Card named: " + name);
|
||||
|
||||
// Exile the top six cards of your library,
|
||||
controller.moveCards(controller.getLibrary().getTopCards(game, 6), Zone.EXILED, source, game);
|
||||
|
||||
// then reveal cards from the top of your library until you reveal the named card.
|
||||
Cards cardsToReaveal = new CardsImpl();
|
||||
Card cardToHand = null;
|
||||
while (controller.getLibrary().hasCards()) {
|
||||
Card card = controller.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
cardsToReaveal.add(card);
|
||||
// Put that card into your hand
|
||||
if (card.getName().equals(name)) {
|
||||
cardToHand = card;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
controller.moveCards(cardToHand, Zone.HAND, source, game);
|
||||
controller.revealCards(sourceObject.getIdName(), cardsToReaveal, game);
|
||||
cardsToReaveal.remove(cardToHand);
|
||||
controller.moveCards(cardsToReaveal, Zone.EXILED, source, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -28,28 +28,24 @@
|
|||
package mage.cards.e;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.condition.LockedInCondition;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.decorator.ConditionalContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -100,19 +96,15 @@ class ElementalAppealEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
ElementalToken token = new ElementalToken();
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
|
||||
for (UUID tokenId : token.getLastAddedTokenIds()) {
|
||||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||
if (tokenPermanent != null) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect();
|
||||
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
|
||||
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source);
|
||||
}
|
||||
}
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new ElementalToken());
|
||||
if(effect.apply(game, source))
|
||||
{
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
class ElementalToken extends Token {
|
||||
|
||||
|
|
|
@ -32,11 +32,10 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
|
@ -51,7 +50,6 @@ import mage.game.permanent.Permanent;
|
|||
import mage.game.permanent.token.Token;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -73,7 +71,6 @@ public class ElementalMastery extends CardImpl {
|
|||
// Enchanted creature has "{tap}: create X 1/1 red Elemental creature tokens with haste, where X is this creature's power. Exile them at the beginning of the next end step."
|
||||
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ElementalMasteryEffect(), new TapSourceCost());
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ability2, AttachmentType.AURA)));
|
||||
|
||||
}
|
||||
|
||||
public ElementalMastery(final ElementalMastery card) {
|
||||
|
@ -108,19 +105,12 @@ class ElementalMasteryEffect extends OneShotEffect {
|
|||
if (creatureAttached != null) {
|
||||
int power = creatureAttached.getPower().getValue();
|
||||
if (power > 0) {
|
||||
ElementalToken token = new ElementalToken();
|
||||
token.putOntoBattlefield(power, game, creatureAttached.getId(), creatureAttached.getControllerId());
|
||||
for (UUID tokenId : token.getLastAddedTokenIds()) {
|
||||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||
if (tokenPermanent != null) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect();
|
||||
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
|
||||
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source);
|
||||
}
|
||||
}
|
||||
}
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new ElementalToken(), power);
|
||||
effect.apply(game, source);
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,23 +28,16 @@
|
|||
package mage.cards.f;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.game.permanent.token.ElementalToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -90,33 +83,12 @@ class FeralLightningEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new FeralLightningElementalToken(), 3);
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new ElementalToken("CON", 1, true), 3);
|
||||
effect.apply(game, source);
|
||||
for (UUID tokenId : effect.getLastAddedTokenIds()) {
|
||||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||
if (tokenPermanent != null) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD);
|
||||
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
|
||||
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source);
|
||||
}
|
||||
}
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class FeralLightningElementalToken extends Token {
|
||||
|
||||
public FeralLightningElementalToken() {
|
||||
super("Elemental", "3/1 red Elemental creature tokens with haste");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setRed(true);
|
||||
subtype.add("Elemental");
|
||||
power = new MageInt(3);
|
||||
toughness = new MageInt(1);
|
||||
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,19 +31,16 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.HexproofAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.AngelToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
* @author Loki
|
||||
|
@ -88,17 +85,11 @@ class GeistOfSaintTraftEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
AngelToken token = new AngelToken();
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new AngelToken(), 1, true, true);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId(), true, true)) {
|
||||
for (UUID tokenId : token.getLastAddedTokenIds()) {
|
||||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||
if (tokenPermanent != null) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect();
|
||||
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
|
||||
game.addDelayedTriggeredAbility(new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect), source);
|
||||
}
|
||||
}
|
||||
|
||||
if (controller != null && effect.apply(game, source)) {
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -30,9 +30,8 @@ package mage.cards.g;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.ConspireAbility;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -40,9 +39,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -89,16 +86,10 @@ class GiantbaitingEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Token token = new GiantWarriorToken();
|
||||
if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) {
|
||||
for (UUID tokenId : token.getLastAddedTokenIds()) {
|
||||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||
if (tokenPermanent != null) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect();
|
||||
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
|
||||
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source);
|
||||
}
|
||||
}
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new GiantWarriorToken());
|
||||
if(effect.apply(game, source))
|
||||
{
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -31,10 +31,9 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -44,12 +43,10 @@ import mage.constants.CardType;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.AngelToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -97,17 +94,10 @@ class InvocationOfSaintTraftEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
AngelToken token = new AngelToken();
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new AngelToken(), 1, true, true);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId(), true, true)) {
|
||||
for (UUID tokenId : token.getLastAddedTokenIds()) {
|
||||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||
if (tokenPermanent != null) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect();
|
||||
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
|
||||
game.addDelayedTriggeredAbility(new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect), source);
|
||||
}
|
||||
}
|
||||
if (controller != null && (effect.apply(game, source))) {
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -31,9 +31,8 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -41,10 +40,8 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -94,17 +91,10 @@ class KariZevSkyshipRaiderEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
RagavanToken token = new RagavanToken();
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new RagavanToken(), 1, true, true);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId(), true, true)) {
|
||||
for (UUID tokenId : token.getLastAddedTokenIds()) {
|
||||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||
if (tokenPermanent != null) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect();
|
||||
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
|
||||
game.addDelayedTriggeredAbility(new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect), source);
|
||||
}
|
||||
}
|
||||
if (controller != null && effect.apply(game, source)) {
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
122
Mage.Sets/src/mage/cards/k/KeldonFirebombers.java
Normal file
122
Mage.Sets/src/mage/cards/k/KeldonFirebombers.java
Normal file
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.cards.k;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class KeldonFirebombers extends CardImpl {
|
||||
|
||||
public KeldonFirebombers(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{R}");
|
||||
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Soldier");
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// When Keldon Firebombers enters the battlefield, each player sacrifices all lands he or she controls except for three.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new KeldonFirebombersEffect()));
|
||||
|
||||
}
|
||||
|
||||
public KeldonFirebombers(final KeldonFirebombers card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KeldonFirebombers copy() {
|
||||
return new KeldonFirebombers(this);
|
||||
}
|
||||
}
|
||||
|
||||
class KeldonFirebombersEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent();
|
||||
|
||||
public KeldonFirebombersEffect() {
|
||||
super(Outcome.AIDontUseIt);
|
||||
this.staticText = "each player sacrifices all lands he or she controls except for three";
|
||||
}
|
||||
|
||||
public KeldonFirebombersEffect(final KeldonFirebombersEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KeldonFirebombersEffect copy() {
|
||||
return new KeldonFirebombersEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
List<Permanent> landsToSacrifice = new ArrayList<>();
|
||||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
int amount = game.getBattlefield().getAllActivePermanents(filter, playerId, game).size() - 3;
|
||||
if (amount > 0) {
|
||||
FilterLandPermanent playerFilter = filter.copy();
|
||||
playerFilter.add(new ControllerIdPredicate(playerId));
|
||||
Target target = new TargetLandPermanent(amount, amount, playerFilter, true);
|
||||
player.choose(outcome.Sacrifice, target, source.getSourceId(), game);
|
||||
for (UUID landId : target.getTargets()) {
|
||||
Permanent land = game.getPermanent(landId);
|
||||
if (land != null) {
|
||||
landsToSacrifice.add(land);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Permanent land : landsToSacrifice) {
|
||||
land.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -47,12 +47,12 @@ import mage.players.PlayerList;
|
|||
import mage.target.Target;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public class KynaiosAndTiroOfMeletis extends CardImpl {
|
||||
|
@ -100,7 +100,6 @@ class KynaiosAndTirosEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (controller != null) {
|
||||
controller.drawCards(1, game);
|
||||
PlayerList playerList = game.getState().getPlayerList().copy();
|
||||
|
@ -111,7 +110,7 @@ class KynaiosAndTirosEffect extends OneShotEffect {
|
|||
Player currentPlayer = game.getPlayer(playerList.get());
|
||||
UUID firstInactivePlayer = null;
|
||||
Target target = new TargetCardInHand(filter);
|
||||
HashMap<UUID, Boolean> noLandPlayers = new HashMap<>();
|
||||
ArrayList<UUID> noLandPlayers = new ArrayList<>();
|
||||
|
||||
while (controller.canRespond()) {
|
||||
if (currentPlayer != null && currentPlayer.canRespond() && game.getState().getPlayersInRange(controller.getId(), game).contains(currentPlayer.getId())) {
|
||||
|
@ -130,7 +129,7 @@ class KynaiosAndTirosEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
if (!playedLand && !Objects.equals(currentPlayer, controller)) {
|
||||
noLandPlayers.put(currentPlayer.getId(), playedLand);
|
||||
noLandPlayers.add(currentPlayer.getId());
|
||||
}
|
||||
}
|
||||
// get next player
|
||||
|
@ -142,7 +141,7 @@ class KynaiosAndTirosEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
|
||||
for (UUID playerId : noLandPlayers.keySet()) {
|
||||
for (UUID playerId : noLandPlayers) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
if (player.chooseUse(outcome.DrawCard, "Draw a card?", source, game)) {
|
||||
|
|
|
@ -50,7 +50,7 @@ import mage.game.Game;
|
|||
public class MisthollowGriffin extends CardImpl {
|
||||
|
||||
public MisthollowGriffin(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
|
||||
this.subtype.add("Griffin");
|
||||
|
||||
this.power = new MageInt(3);
|
||||
|
@ -97,7 +97,8 @@ class MisthollowGriffinPlayEffect extends AsThoughEffectImpl {
|
|||
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
|
||||
if (sourceId.equals(source.getSourceId())) {
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (card != null && card.getOwnerId().equals(source.getControllerId()) && game.getState().getZone(source.getSourceId()) == Zone.EXILED) {
|
||||
if (card != null && card.getOwnerId().equals(affectedControllerId)
|
||||
&& game.getState().getZone(source.getSourceId()) == Zone.EXILED) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
101
Mage.Sets/src/mage/cards/n/NoeticScales.java
Normal file
101
Mage.Sets/src/mage/cards/n/NoeticScales.java
Normal file
|
@ -0,0 +1,101 @@
|
|||
/*
|
||||
* 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.cards.n;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class NoeticScales extends CardImpl {
|
||||
|
||||
public NoeticScales(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
|
||||
|
||||
// At the beginning of each player's upkeep, return to its owner's hand each creature that player controls with power greater than the number of cards in his or her hand.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new NoeticScalesEffect(), TargetController.ANY, false, true));
|
||||
}
|
||||
|
||||
public NoeticScales(final NoeticScales card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NoeticScales copy() {
|
||||
return new NoeticScales(this);
|
||||
}
|
||||
}
|
||||
|
||||
class NoeticScalesEffect extends OneShotEffect {
|
||||
|
||||
public NoeticScalesEffect() {
|
||||
super(Outcome.ReturnToHand);
|
||||
this.staticText = "return to its owner's hand each creature that player controls with power greater than the number of cards in his or her hand";
|
||||
}
|
||||
|
||||
public NoeticScalesEffect(final NoeticScalesEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NoeticScalesEffect copy() {
|
||||
return new NoeticScalesEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (player != null) {
|
||||
int numberOfCardsInHand = player.getHand().size();
|
||||
for (Permanent creature : game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) {
|
||||
if (creature.getPower().getValue() > numberOfCardsInHand) {
|
||||
if (creature.moveToZone(Zone.HAND, source.getId(), game, false)) {
|
||||
game.informPlayers(player.getLogName() + " moves " + creature.getLogName() + " from the battlefield to their hand.");
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
64
Mage.Sets/src/mage/cards/o/OgreLeadfoot.java
Normal file
64
Mage.Sets/src/mage/cards/o/OgreLeadfoot.java
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* 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.cards.o;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.BecomesBlockedByCreatureTriggeredAbility;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.common.FilterArtifactCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class OgreLeadfoot extends CardImpl {
|
||||
|
||||
public OgreLeadfoot(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}");
|
||||
|
||||
this.subtype.add("Ogre");
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Whenever Ogre Leadfoot becomes blocked by an artifact creature, destroy that creature.
|
||||
this.addAbility(new BecomesBlockedByCreatureTriggeredAbility(new DestroyTargetEffect(), new FilterArtifactCreaturePermanent("an artifact creature"), false));
|
||||
}
|
||||
|
||||
public OgreLeadfoot(final OgreLeadfoot card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OgreLeadfoot copy() {
|
||||
return new OgreLeadfoot(this);
|
||||
}
|
||||
}
|
|
@ -31,11 +31,10 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.costs.common.DiscardCardCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -45,10 +44,8 @@ import mage.constants.Duration;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -103,16 +100,10 @@ class RakdosGuildmageEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Token token = new RakdosGuildmageGoblinToken();
|
||||
if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) {
|
||||
for (UUID tokenId : token.getLastAddedTokenIds()) {
|
||||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||
if (tokenPermanent != null) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect();
|
||||
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
|
||||
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source);
|
||||
}
|
||||
}
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new RakdosGuildmageGoblinToken());
|
||||
if (effect.apply(game, source))
|
||||
{
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -32,9 +32,8 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
@ -43,14 +42,11 @@ import mage.constants.CardType;
|
|||
import mage.constants.CostModificationType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.AttackingPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
|
@ -138,18 +134,14 @@ class StoneIdolTrapEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
StoneTrapIdolToken token = new StoneTrapIdolToken();
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
for (UUID tokenId : token.getLastAddedTokenIds()) {
|
||||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||
if (tokenPermanent != null) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect();
|
||||
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
|
||||
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(Zone.ALL, exileEffect, TargetController.YOU), source);
|
||||
}
|
||||
}
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new StoneTrapIdolToken());
|
||||
if(effect.apply(game, source))
|
||||
{
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class StoneTrapIdolToken extends Token {
|
||||
|
|
|
@ -30,9 +30,8 @@ package mage.cards.t;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.DefenderAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.ReplicateAbility;
|
||||
|
@ -41,9 +40,7 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -88,16 +85,9 @@ class ThunderheadsEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Token token = new WeirdToken();
|
||||
if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) {
|
||||
for (UUID tokenId : token.getLastAddedTokenIds()) {
|
||||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||
if (tokenPermanent != null) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect();
|
||||
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
|
||||
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source);
|
||||
}
|
||||
}
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new WeirdToken());
|
||||
if (effect.apply(game, source)) {
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -27,15 +27,15 @@
|
|||
*/
|
||||
package mage.cards.z;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LandfallAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
|
@ -46,11 +46,7 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -97,18 +93,15 @@ class ZektarShrineExpeditionEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
ElementalToken token = new ElementalToken();
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
for (UUID tokenId : token.getLastAddedTokenIds()) {
|
||||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||
if (tokenPermanent != null) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect();
|
||||
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
|
||||
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source);
|
||||
}
|
||||
}
|
||||
|
||||
CreateTokenEffect effect = new CreateTokenEffect(new ElementalToken());
|
||||
if(effect.apply(game, source))
|
||||
{
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static class ElementalToken extends Token {
|
||||
|
||||
|
|
|
@ -186,6 +186,7 @@ public class Mirrodin extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Nim Shrieker", 73, Rarity.COMMON, mage.cards.n.NimShrieker.class));
|
||||
cards.add(new SetCardInfo("Nuisance Engine", 221, Rarity.UNCOMMON, mage.cards.n.NuisanceEngine.class));
|
||||
cards.add(new SetCardInfo("Oblivion Stone", 222, Rarity.RARE, mage.cards.o.OblivionStone.class));
|
||||
cards.add(new SetCardInfo("Ogre Leadfoot", 102, Rarity.COMMON, mage.cards.o.OgreLeadfoot.class));
|
||||
cards.add(new SetCardInfo("Omega Myr", 223, Rarity.COMMON, mage.cards.o.OmegaMyr.class));
|
||||
cards.add(new SetCardInfo("One Dozen Eyes", 126, Rarity.UNCOMMON, mage.cards.o.OneDozenEyes.class));
|
||||
cards.add(new SetCardInfo("Ornithopter", 224, Rarity.UNCOMMON, mage.cards.o.Ornithopter.class));
|
||||
|
|
|
@ -72,6 +72,7 @@ public class Nemesis extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Death Pit Offering", 56, Rarity.RARE, mage.cards.d.DeathPitOffering.class));
|
||||
cards.add(new SetCardInfo("Defender en-Vec", 5, Rarity.COMMON, mage.cards.d.DefenderEnVec.class));
|
||||
cards.add(new SetCardInfo("Defiant Falcon", 6, Rarity.COMMON, mage.cards.d.DefiantFalcon.class));
|
||||
cards.add(new SetCardInfo("Divining Witch", 57, Rarity.RARE, mage.cards.d.DiviningWitch.class));
|
||||
cards.add(new SetCardInfo("Dominate", 31, Rarity.UNCOMMON, mage.cards.d.Dominate.class));
|
||||
cards.add(new SetCardInfo("Downhill Charge", 79, Rarity.COMMON, mage.cards.d.DownhillCharge.class));
|
||||
cards.add(new SetCardInfo("Ensnare", 32, Rarity.UNCOMMON, mage.cards.e.Ensnare.class));
|
||||
|
|
|
@ -94,6 +94,7 @@ public class Prophecy extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Jolrael, Empress of Beasts", 115, Rarity.RARE, mage.cards.j.JolraelEmpressOfBeasts.class));
|
||||
cards.add(new SetCardInfo("Jolrael's Favor", 116, Rarity.COMMON, mage.cards.j.JolraelsFavor.class));
|
||||
cards.add(new SetCardInfo("Keldon Arsonist", 92, Rarity.UNCOMMON, mage.cards.k.KeldonArsonist.class));
|
||||
cards.add(new SetCardInfo("Keldon Firebombers", 94, Rarity.RARE, mage.cards.k.KeldonFirebombers.class));
|
||||
cards.add(new SetCardInfo("Latulla, Keldon Overseer", 95, Rarity.RARE, mage.cards.l.LatullaKeldonOverseer.class));
|
||||
cards.add(new SetCardInfo("Lesser Gargadon", 97, Rarity.UNCOMMON, mage.cards.l.LesserGargadon.class));
|
||||
cards.add(new SetCardInfo("Living Terrain", 117, Rarity.UNCOMMON, mage.cards.l.LivingTerrain.class));
|
||||
|
|
|
@ -221,6 +221,7 @@ public class UrzasSaga extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Mountain", 345, Rarity.LAND, mage.cards.basiclands.Mountain.class, new CardGraphicInfo(null, true)));
|
||||
cards.add(new SetCardInfo("Mountain", 346, Rarity.LAND, mage.cards.basiclands.Mountain.class, new CardGraphicInfo(null, true)));
|
||||
cards.add(new SetCardInfo("No Rest for the Wicked", 142, Rarity.UNCOMMON, mage.cards.n.NoRestForTheWicked.class));
|
||||
cards.add(new SetCardInfo("Noetic Scales", 304, Rarity.RARE, mage.cards.n.NoeticScales.class));
|
||||
cards.add(new SetCardInfo("Okk", 204, Rarity.RARE, mage.cards.o.Okk.class));
|
||||
cards.add(new SetCardInfo("Opal Archangel", 23, Rarity.RARE, mage.cards.o.OpalArchangel.class));
|
||||
cards.add(new SetCardInfo("Opal Caryatid", 24, Rarity.COMMON, mage.cards.o.OpalCaryatid.class));
|
||||
|
|
|
@ -79,7 +79,9 @@ public class BecomesBlockedByCreatureTriggeredAbility extends TriggeredAbilityIm
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever {this} becomes blocked by a " + filter.getMessage() + ", " + super.getRule();
|
||||
return "Whenever {this} becomes blocked by "
|
||||
+ (filter.getMessage().startsWith("an ") ? "" : "a ")
|
||||
+ filter.getMessage() + ", " + super.getRule();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue