mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
457bc29b34
40 changed files with 1576 additions and 287 deletions
|
|
@ -55,9 +55,6 @@ public class SpellboundDragon extends CardImpl {
|
|||
super(ownerId, 90, "Spellbound Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{R}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Dragon");
|
||||
|
||||
|
||||
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue;
|
|||
import mage.abilities.effects.common.AddManaInAnyCombinationEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
|
|
@ -57,11 +58,11 @@ public class DreadshipReef extends CardImpl {
|
|||
// {tap}: Add {C} to your mana pool.
|
||||
this.addAbility(new ColorlessManaAbility());
|
||||
// {1}, {tap}: Put a storage counter on Dreadship Reef.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance()),new GenericManaCost(1));
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance()), new GenericManaCost(1));
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
// {1}, Remove X storage counters from Dreadship Reef: Add X mana in any combination of {U} and/or {B} to your mana pool.
|
||||
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
ability = new SimpleManaAbility(Zone.BATTLEFIELD,
|
||||
new AddManaInAnyCombinationEffect(new RemovedCountersForCostValue(), ColoredManaSymbol.U, ColoredManaSymbol.B),
|
||||
new GenericManaCost(1));
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance()));
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue;
|
|||
import mage.abilities.effects.common.AddManaInAnyCombinationEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
|
|
@ -58,12 +59,12 @@ public class FungalReaches extends CardImpl {
|
|||
this.addAbility(new ColorlessManaAbility());
|
||||
|
||||
// {1}, {tap}: Put a storage counter on Fungal Reaches.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance()),new GenericManaCost(1));
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance()), new GenericManaCost(1));
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
|
||||
// {1}, Remove X storage counters from Fungal Reaches: Add X mana in any combination of {R} and/or {G} to your mana pool.
|
||||
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
ability = new SimpleManaAbility(Zone.BATTLEFIELD,
|
||||
new AddManaInAnyCombinationEffect(new RemovedCountersForCostValue(), ColoredManaSymbol.R, ColoredManaSymbol.G),
|
||||
new GenericManaCost(1));
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance()));
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue;
|
|||
import mage.abilities.effects.common.AddManaInAnyCombinationEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
|
|
@ -57,11 +58,11 @@ public class MoltenSlagheap extends CardImpl {
|
|||
// {tap}: Add {C} to your mana pool.
|
||||
this.addAbility(new ColorlessManaAbility());
|
||||
// {1}, {tap}: Put a storage counter on Molten Slagheap.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance()),new GenericManaCost(1));
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance()), new GenericManaCost(1));
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
// {1}, Remove X storage counters from Molten Slagheap: Add X mana in any combination of {B} and/or {R} to your mana pool.
|
||||
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
ability = new SimpleManaAbility(Zone.BATTLEFIELD,
|
||||
new AddManaInAnyCombinationEffect(new RemovedCountersForCostValue(), ColoredManaSymbol.B, ColoredManaSymbol.R),
|
||||
new GenericManaCost(1));
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance()));
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue;
|
|||
import mage.abilities.effects.common.AddManaInAnyCombinationEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
|
|
@ -57,11 +58,11 @@ public class SaltcrustedSteppe extends CardImpl {
|
|||
// {tap}: Add {C} to your mana pool.
|
||||
this.addAbility(new ColorlessManaAbility());
|
||||
// {1}, {tap}: Put a storage counter on Saltcrusted Steppe.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance()),new GenericManaCost(1));
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance()), new GenericManaCost(1));
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
// {1}, Remove X storage counters from Saltcrusted Steppe: Add X mana in any combination of {G} and/or {W} to your mana pool.
|
||||
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
ability = new SimpleManaAbility(Zone.BATTLEFIELD,
|
||||
new AddManaInAnyCombinationEffect(new RemovedCountersForCostValue(), ColoredManaSymbol.G, ColoredManaSymbol.W),
|
||||
new GenericManaCost(1));
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance()));
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class BalanceOfPowerEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
Player opponent = game.getPlayer(source.getFirstTarget());
|
||||
|
||||
if (opponent != null || player != null && opponent.getHand().size() > player.getHand().size()) {
|
||||
if (opponent != null && player != null && opponent.getHand().size() > player.getHand().size()) {
|
||||
player.drawCards(opponent.getHand().size() - player.getHand().size(), game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,19 +31,20 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import static mage.Mana.WhiteMana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivationInfo;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
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.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -60,11 +61,11 @@ public class FarrelitePriest extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// {1}: Add {W} to your mana pool. If this ability has been activated four or more times this turn, sacrifice Farrelite Priest at the beginning of the next end step.
|
||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
SimpleManaAbility ability = new SimpleManaAbility(Zone.BATTLEFIELD,
|
||||
new BasicManaEffect(WhiteMana(1)),
|
||||
new ManaCostsImpl("{1}"));
|
||||
ability.addEffect(new FarrelitePriestEffect());
|
||||
this.addAbility(ability);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public FarrelitePriest(final FarrelitePriest card) {
|
||||
|
|
@ -76,6 +77,7 @@ public class FarrelitePriest extends CardImpl {
|
|||
return new FarrelitePriest(this);
|
||||
}
|
||||
}
|
||||
|
||||
class FarrelitePriestEffect extends OneShotEffect {
|
||||
|
||||
public FarrelitePriestEffect() {
|
||||
|
|
@ -94,46 +96,13 @@ class FarrelitePriestEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Integer amount = (Integer) game.getState().getValue(source.getSourceId().toString() + "FarrelitePriest");
|
||||
if (amount == null) {
|
||||
amount = 0;
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new FarrelitePriestResetEffect());
|
||||
ActivationInfo activationInfo = ActivationInfo.getInstance(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
activationInfo.addActivation(game);
|
||||
if (activationInfo.getActivationCounter() == 4) {
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeSourceEffect());
|
||||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
}
|
||||
amount++;
|
||||
game.getState().setValue(source.getSourceId().toString() + "FarrelitePriest", amount);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class FarrelitePriestResetEffect extends OneShotEffect {
|
||||
|
||||
public FarrelitePriestResetEffect() {
|
||||
super(Outcome.Neutral);
|
||||
this.staticText = "If this ability has been activated four or more times this turn, sacrifice {this} at the beginning of the next end step";
|
||||
}
|
||||
|
||||
public FarrelitePriestResetEffect(final FarrelitePriestResetEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FarrelitePriestResetEffect copy() {
|
||||
return new FarrelitePriestResetEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Integer amount = (Integer) game.getState().getValue(source.getSourceId().toString() + "FarrelitePriest");
|
||||
if (amount != null && amount >= 4) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
game.getState().setValue(source.getSourceId().toString() + "FarrelitePriest", null);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -31,19 +31,20 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import static mage.Mana.BlackMana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivationInfo;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.BasicManaEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
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.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -59,11 +60,11 @@ public class InitiatesOfTheEbonHand extends CardImpl {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
// {1}: Add {B} to your mana pool. If this ability has been activated four or more times this turn, sacrifice Initiates of the Ebon Hand at the beginning of the next end step.
|
||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
SimpleManaAbility ability = new SimpleManaAbility(Zone.BATTLEFIELD,
|
||||
new BasicManaEffect(BlackMana(1)),
|
||||
new ManaCostsImpl("{1}"));
|
||||
ability.addEffect(new InitiatesOfTheEbonHandEffect());
|
||||
this.addAbility(ability);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public InitiatesOfTheEbonHand(final InitiatesOfTheEbonHand card) {
|
||||
|
|
@ -94,46 +95,13 @@ class InitiatesOfTheEbonHandEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Integer amount = (Integer) game.getState().getValue(source.getSourceId().toString() + "InitiatesOfTheEbonHand");
|
||||
if (amount == null) {
|
||||
amount = 0;
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new InitiatesOfTheEbonHandResetEffect());
|
||||
ActivationInfo activationInfo = ActivationInfo.getInstance(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
activationInfo.addActivation(game);
|
||||
if (activationInfo.getActivationCounter() == 4) {
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeSourceEffect());
|
||||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
}
|
||||
amount++;
|
||||
game.getState().setValue(source.getSourceId().toString() + "InitiatesOfTheEbonHand", amount);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class InitiatesOfTheEbonHandResetEffect extends OneShotEffect {
|
||||
|
||||
public InitiatesOfTheEbonHandResetEffect() {
|
||||
super(Outcome.Neutral);
|
||||
this.staticText = "If this ability has been activated four or more times this turn, sacrifice {this} at the beginning of the next end step";
|
||||
}
|
||||
|
||||
public InitiatesOfTheEbonHandResetEffect(final InitiatesOfTheEbonHandResetEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InitiatesOfTheEbonHandResetEffect copy() {
|
||||
return new InitiatesOfTheEbonHandResetEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Integer amount = (Integer) game.getState().getValue(source.getSourceId().toString() + "InitiatesOfTheEbonHand");
|
||||
if (amount != null && amount >= 4) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
game.getState().setValue(source.getSourceId().toString() + "InitiatesOfTheEbonHand", null);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -49,7 +49,6 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.PermanentToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
|
@ -188,8 +187,7 @@ class BrainMaggotReturnExiledCardEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (sourceObject != null && controller != null) {
|
||||
int zoneChangeCounter = (sourceObject instanceof PermanentToken) ? source.getSourceObjectZoneChangeCounter() : source.getSourceObjectZoneChangeCounter() - 1;
|
||||
ExileZone exile = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), zoneChangeCounter));
|
||||
ExileZone exile = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()));
|
||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (exile != null && sourcePermanent != null) {
|
||||
controller.moveCards(exile, Zone.HAND, source, game);
|
||||
|
|
|
|||
121
Mage.Sets/src/mage/sets/judgment/PrismaticStrands.java
Normal file
121
Mage.Sets/src/mage/sets/judgment/PrismaticStrands.java
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
* 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.judgment;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.common.TapTargetCost;
|
||||
import mage.abilities.effects.PreventionEffectImpl;
|
||||
import mage.abilities.keyword.FlashbackAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.choices.ChoiceColor;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TimingRule;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||
*/
|
||||
public class PrismaticStrands extends CardImpl {
|
||||
|
||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped white creature you control");
|
||||
static {
|
||||
filter.add(Predicates.not(new TappedPredicate()));
|
||||
filter.add(new ColorPredicate(ObjectColor.WHITE));
|
||||
}
|
||||
|
||||
public PrismaticStrands(UUID ownerId) {
|
||||
super(ownerId, 18, "Prismatic Strands", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}");
|
||||
this.expansionSetCode = "JUD";
|
||||
|
||||
// Prevent all damage that sources of the color of your choice would deal this turn.
|
||||
this.getSpellAbility().addEffect(new PrismaticStrandsEffect(Duration.EndOfTurn, Integer.MAX_VALUE, false));
|
||||
this.getSpellAbility().addChoice(new ChoiceColor());
|
||||
|
||||
// Flashback-Tap an untapped white creature you control.
|
||||
this.addAbility(new FlashbackAbility(new TapTargetCost(new TargetControlledCreaturePermanent(1,1,filter,false)), TimingRule.INSTANT));
|
||||
}
|
||||
|
||||
public PrismaticStrands(final PrismaticStrands card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrismaticStrands copy() {
|
||||
return new PrismaticStrands(this);
|
||||
}
|
||||
}
|
||||
|
||||
class PrismaticStrandsEffect extends PreventionEffectImpl {
|
||||
|
||||
public PrismaticStrandsEffect(Duration duration, int amount, boolean onlyCombat) {
|
||||
super(duration, amount, onlyCombat, false);
|
||||
this.staticText = "Prevent all damage that sources of the color of your choice would deal this turn";
|
||||
}
|
||||
|
||||
public PrismaticStrandsEffect(PrismaticStrandsEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (super.applies(event, source, game)) {
|
||||
if (event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER)
|
||||
|| event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE)
|
||||
|| event.getType().equals(GameEvent.EventType.DAMAGE_PLANESWALKER)) {
|
||||
ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
|
||||
MageObject sourceObject = game.getObject(event.getSourceId());
|
||||
if (sourceObject != null && choice != null && sourceObject.getColor(game).shares(choice.getColor())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrismaticStrandsEffect copy() {
|
||||
return new PrismaticStrandsEffect(this);
|
||||
}
|
||||
}
|
||||
162
Mage.Sets/src/mage/sets/lorwyn/EgoErasure.java
Normal file
162
Mage.Sets/src/mage/sets/lorwyn/EgoErasure.java
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.lorwyn;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.keyword.ChangelingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.repository.CardRepository;
|
||||
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.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public class EgoErasure extends CardImpl {
|
||||
|
||||
public EgoErasure(UUID ownerId) {
|
||||
super(ownerId, 59, "Ego Erasure", Rarity.UNCOMMON, new CardType[]{CardType.TRIBAL, CardType.INSTANT}, "{2}{U}");
|
||||
this.expansionSetCode = "LRW";
|
||||
this.subtype.add("Shapeshifter");
|
||||
|
||||
// Changeling
|
||||
this.addAbility(ChangelingAbility.getInstance());
|
||||
|
||||
//Creatures target player controls get -2/+0 and lose all creature types until end of turn.
|
||||
this.getSpellAbility().addEffect(new EgoErasureBoostEffect());
|
||||
this.getSpellAbility().addEffect(new EgoErasureLoseEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
}
|
||||
|
||||
public EgoErasure(final EgoErasure card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EgoErasure copy() {
|
||||
return new EgoErasure(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EgoErasureLoseEffect extends ContinuousEffectImpl {
|
||||
|
||||
public EgoErasureLoseEffect() {
|
||||
super(Duration.EndOfTurn, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Neutral);
|
||||
staticText = "and lose all creature types until end of turn";
|
||||
}
|
||||
|
||||
public EgoErasureLoseEffect(final EgoErasureLoseEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EgoErasureLoseEffect copy() {
|
||||
return new EgoErasureLoseEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
if (this.affectedObjectsSet) {
|
||||
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget(), game);
|
||||
for (Permanent creature : creatures) {
|
||||
affectedObjectList.add(new MageObjectReference(creature, game));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) {
|
||||
Permanent permanent = it.next().getPermanent(game);
|
||||
if (permanent != null) {
|
||||
permanent.getSubtype().retainAll(CardRepository.instance.getLandTypes());
|
||||
} else {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class EgoErasureBoostEffect extends ContinuousEffectImpl {
|
||||
|
||||
public EgoErasureBoostEffect() {
|
||||
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.Benefit);
|
||||
staticText = "Creatures target player controls get -2/+0";
|
||||
}
|
||||
|
||||
public EgoErasureBoostEffect(final EgoErasureBoostEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EgoErasureBoostEffect copy() {
|
||||
return new EgoErasureBoostEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
if (this.affectedObjectsSet) {
|
||||
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget(), game);
|
||||
for (Permanent creature : creatures) {
|
||||
affectedObjectList.add(new MageObjectReference(creature, game));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) {
|
||||
Permanent permanent = it.next().getPermanent(game);
|
||||
if (permanent != null) {
|
||||
permanent.addPower(-2);
|
||||
} else {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -29,18 +29,13 @@ package mage.sets.lorwyn;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ClashEffect;
|
||||
import mage.abilities.effects.common.DoIfClashWonEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -60,8 +55,8 @@ public class Ringskipper extends CardImpl {
|
|||
//Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
//When Ringskipper is put into graveyard from play, clash with an opponent. If you win return Ringskipper to its owner's hand
|
||||
this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new RingskipperEffect()));
|
||||
//When {this} is put into graveyard from play, clash with an opponent. If you win return {this} to its owner's hand
|
||||
this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DoIfClashWonEffect(new ReturnToHandSourceEffect())));
|
||||
}
|
||||
|
||||
public Ringskipper(final Ringskipper card) {
|
||||
|
|
@ -73,34 +68,3 @@ public class Ringskipper extends CardImpl {
|
|||
return new Ringskipper(this);
|
||||
}
|
||||
}
|
||||
|
||||
class RingskipperEffect extends OneShotEffect {
|
||||
|
||||
public RingskipperEffect() {
|
||||
super(Outcome.ReturnToHand);
|
||||
this.staticText = "clash with an opponent. If you win return Ringskipper to its owner's hand";
|
||||
}
|
||||
|
||||
public RingskipperEffect(final RingskipperEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RingskipperEffect copy() {
|
||||
return new RingskipperEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (ClashEffect.getInstance().apply(game, source)) {
|
||||
ReturnToHandSourceEffect effect = new ReturnToHandSourceEffect();
|
||||
effect.apply(game, source);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
160
Mage.Sets/src/mage/sets/lorwyn/ShieldsOfVelisVel.java
Normal file
160
Mage.Sets/src/mage/sets/lorwyn/ShieldsOfVelisVel.java
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.lorwyn;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.keyword.ChangelingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public class ShieldsOfVelisVel extends CardImpl {
|
||||
|
||||
public ShieldsOfVelisVel(UUID ownerId) {
|
||||
super(ownerId, 39, "Shields of Velis Vel", Rarity.COMMON, new CardType[]{CardType.TRIBAL, CardType.INSTANT}, "{W}");
|
||||
this.expansionSetCode = "LRW";
|
||||
this.subtype.add("Shapeshifter");
|
||||
|
||||
// Changeling
|
||||
this.addAbility(ChangelingAbility.getInstance());
|
||||
|
||||
//Creatures target player controls get +0/+1 and gain all creature types until end of turn.
|
||||
this.getSpellAbility().addEffect(new ShieldsOfVelisVelBoostEffect());
|
||||
this.getSpellAbility().addEffect(new ShieldsOfVelisVelGainEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
|
||||
}
|
||||
|
||||
public ShieldsOfVelisVel(final ShieldsOfVelisVel card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShieldsOfVelisVel copy() {
|
||||
return new ShieldsOfVelisVel(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ShieldsOfVelisVelGainEffect extends ContinuousEffectImpl {
|
||||
|
||||
public ShieldsOfVelisVelGainEffect() {
|
||||
super(Duration.EndOfTurn, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Neutral);
|
||||
staticText = "and gain all creature types until end of turn";
|
||||
}
|
||||
|
||||
public ShieldsOfVelisVelGainEffect(final ShieldsOfVelisVelGainEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShieldsOfVelisVelGainEffect copy() {
|
||||
return new ShieldsOfVelisVelGainEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
if (this.affectedObjectsSet) {
|
||||
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget(), game);
|
||||
for (Permanent creature : creatures) {
|
||||
affectedObjectList.add(new MageObjectReference(creature, game));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) {
|
||||
Permanent permanent = it.next().getPermanent(game);
|
||||
if (permanent != null) {
|
||||
permanent.addAbility(ChangelingAbility.getInstance(), source.getSourceId(), game, false);
|
||||
} else {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class ShieldsOfVelisVelBoostEffect extends ContinuousEffectImpl {
|
||||
|
||||
public ShieldsOfVelisVelBoostEffect() {
|
||||
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
|
||||
staticText = "Creatures target player controls get +0/+1";
|
||||
}
|
||||
|
||||
public ShieldsOfVelisVelBoostEffect(final ShieldsOfVelisVelBoostEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShieldsOfVelisVelBoostEffect copy() {
|
||||
return new ShieldsOfVelisVelBoostEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
if (this.affectedObjectsSet) {
|
||||
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget(), game);
|
||||
for (Permanent creature : creatures) {
|
||||
affectedObjectList.add(new MageObjectReference(creature, game));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) {
|
||||
Permanent permanent = it.next().getPermanent(game);
|
||||
if (permanent != null) {
|
||||
permanent.addToughness(1);
|
||||
} else {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
72
Mage.Sets/src/mage/sets/lorwyn/SpringjackKnight.java
Normal file
72
Mage.Sets/src/mage/sets/lorwyn/SpringjackKnight.java
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.lorwyn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.effects.common.DoIfClashWonEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.DoubleStrikeAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public class SpringjackKnight extends CardImpl {
|
||||
|
||||
public SpringjackKnight(UUID ownerId) {
|
||||
super(ownerId, 41, "Springjack Knight", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}");
|
||||
this.expansionSetCode = "LRW";
|
||||
this.subtype.add("Kithkin");
|
||||
this.subtype.add("Knight");
|
||||
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
//Whenever {this} attacks, clash with an opponent. If you win, target creature gains double strike until end of turn.
|
||||
Ability ability = new AttacksTriggeredAbility(new DoIfClashWonEffect(new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn)), false);
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public SpringjackKnight(final SpringjackKnight card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpringjackKnight copy() {
|
||||
return new SpringjackKnight(this);
|
||||
}
|
||||
}
|
||||
71
Mage.Sets/src/mage/sets/lorwyn/TurtleshellChangeling.java
Normal file
71
Mage.Sets/src/mage/sets/lorwyn/TurtleshellChangeling.java
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.lorwyn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.continuous.SwitchPowerToughnessSourceEffect;
|
||||
import mage.abilities.keyword.ChangelingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public class TurtleshellChangeling extends CardImpl {
|
||||
|
||||
public TurtleshellChangeling(UUID ownerId) {
|
||||
super(ownerId, 94, "Turtleshell Changeling", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}");
|
||||
this.expansionSetCode = "LRW";
|
||||
this.subtype.add("Shapesifter");
|
||||
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
//Changeling
|
||||
this.addAbility(ChangelingAbility.getInstance());
|
||||
|
||||
//{1}{U}: Switch {this}'s power and toughness until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SwitchPowerToughnessSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{1}{U}")));
|
||||
}
|
||||
|
||||
public TurtleshellChangeling(final TurtleshellChangeling card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TurtleshellChangeling copy() {
|
||||
return new TurtleshellChangeling(this);
|
||||
}
|
||||
}
|
||||
83
Mage.Sets/src/mage/sets/lorwyn/WellgabberApothecary.java
Normal file
83
Mage.Sets/src/mage/sets/lorwyn/WellgabberApothecary.java
Normal 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.lorwyn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.PreventDamageToTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public class WellgabberApothecary extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("target tapped Merfolk or Kithkin creature this turn");
|
||||
|
||||
static {
|
||||
filter.add(new TappedPredicate());
|
||||
filter.add(Predicates.or(new SubtypePredicate("Merfolk"), new SubtypePredicate("Kithkin")));
|
||||
}
|
||||
|
||||
public WellgabberApothecary(UUID ownerId) {
|
||||
super(ownerId, 47, "Wellgabber Apothecary", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}");
|
||||
this.expansionSetCode = "LRW";
|
||||
this.subtype.add("Merfolk");
|
||||
this.subtype.add("Cleric");
|
||||
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// {1}{W} : Prevent all damage that would be dealt to target tapped Merfolk or Kithkin creatuer this turn
|
||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, Integer.MAX_VALUE), new ManaCostsImpl("{1}{W}"));
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
this.addAbility(ability);
|
||||
|
||||
}
|
||||
|
||||
public WellgabberApothecary(final WellgabberApothecary card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WellgabberApothecary copy() {
|
||||
return new WellgabberApothecary(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -30,11 +30,13 @@ package mage.sets.magic2010;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivationInfo;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -44,7 +46,6 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -60,7 +61,10 @@ public class DragonWhelp extends CardImpl {
|
|||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// {R}: Dragon Whelp gets +1/+0 until end of turn. If this ability has been activated four or more times this turn, sacrifice Dragon Whelp at the beginning of the next end step.
|
||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new BoostSourceEffect(1, 0, Duration.EndOfTurn),
|
||||
new ManaCostsImpl("{R}"));
|
||||
|
|
@ -96,46 +100,13 @@ class DragonWhelpEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Integer amount = (Integer) game.getState().getValue(source.getSourceId().toString() + "DragonWhelp");
|
||||
if (amount == null) {
|
||||
amount = 0;
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new DragonWhelpDelayedEffect());
|
||||
ActivationInfo activationInfo = ActivationInfo.getInstance(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
activationInfo.addActivation(game);
|
||||
if (activationInfo.getActivationCounter() == 4) {
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeSourceEffect());
|
||||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
}
|
||||
amount++;
|
||||
game.getState().setValue(source.getSourceId().toString() + "DragonWhelp", amount);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class DragonWhelpDelayedEffect extends OneShotEffect {
|
||||
|
||||
public DragonWhelpDelayedEffect() {
|
||||
super(Outcome.Damage);
|
||||
this.staticText = "If this ability has been activated four or more times this turn, sacrifice {this} at the beginning of the next end step";
|
||||
}
|
||||
|
||||
public DragonWhelpDelayedEffect(final DragonWhelpDelayedEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DragonWhelpDelayedEffect copy() {
|
||||
return new DragonWhelpDelayedEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Integer amount = (Integer) game.getState().getValue(source.getSourceId().toString() + "DragonWhelp");
|
||||
if (amount != null && amount >= 4) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
game.getState().setValue(source.getSourceId().toString() + "DragonWhelp", null);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ package mage.sets.magic2015;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
|
|
@ -152,8 +151,6 @@ class AvacynGuardianAngelPreventToPlayerEffect extends PreventionEffectImpl {
|
|||
super(effect);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class ActivatedLoyaltyAbilityWatcher extends Watcher {
|
|||
return new ActivatedLoyaltyAbilityWatcher(this);
|
||||
}
|
||||
|
||||
public boolean activatedLayaltyAbility(UUID playerId) {
|
||||
public boolean activatedLoyaltyAbility(UUID playerId) {
|
||||
return playerIds.contains(playerId);
|
||||
}
|
||||
}
|
||||
|
|
@ -177,7 +177,7 @@ class TheChainVeilCondition implements Condition {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
ActivatedLoyaltyAbilityWatcher watcher = (ActivatedLoyaltyAbilityWatcher) game.getState().getWatchers().get("ActivatedLoyaltyAbilityWatcher");
|
||||
if (watcher != null) {
|
||||
if (!watcher.activatedLayaltyAbility(source.getControllerId())) {
|
||||
if (!watcher.activatedLoyaltyAbility(source.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
81
Mage.Sets/src/mage/sets/nemesis/VolrathTheFallen.java
Normal file
81
Mage.Sets/src/mage/sets/nemesis/VolrathTheFallen.java
Normal 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.nemesis;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.DiscardCardCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.common.DiscardCostCardConvertedMana;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||
*/
|
||||
public class VolrathTheFallen extends CardImpl {
|
||||
|
||||
public VolrathTheFallen(UUID ownerId) {
|
||||
super(ownerId, 75, "Volrath the Fallen", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}");
|
||||
this.expansionSetCode = "NMS";
|
||||
this.supertype.add("Legendary");
|
||||
this.subtype.add("Shapeshifter");
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// {1}{B}, Discard a creature card:
|
||||
// Volrath the Fallen gets +X/+X until end of turn, where X is the discarded card's converted mana cost.
|
||||
Effect effect = new BoostSourceEffect(new DiscardCostCardConvertedMana(),new DiscardCostCardConvertedMana(),Duration.EndOfTurn);
|
||||
effect.setText("{this} gets +X/+X until end of turn, where X is the discarded card's converted mana cost");
|
||||
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
effect,
|
||||
new ManaCostsImpl("{1}{B}"));
|
||||
ability.addCost(new DiscardCardCost(new FilterCreatureCard()));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public VolrathTheFallen(final VolrathTheFallen card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VolrathTheFallen copy() {
|
||||
return new VolrathTheFallen(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -137,7 +137,8 @@ class VileRedeemerNonTokenCreaturesDiedWatcher extends Watcher {
|
|||
if (zEvent.isDiesEvent() && zEvent.getTarget() != null
|
||||
&& zEvent.getTarget().getCardType().contains(CardType.CREATURE)
|
||||
&& !(zEvent.getTarget() instanceof PermanentToken)) {
|
||||
int count = amountOfCreaturesThatDied.containsKey(zEvent.getTarget().getControllerId()) ? amountOfCreaturesThatDied.get(zEvent.getTarget().getControllerId()) : 0;
|
||||
int count = amountOfCreaturesThatDied.containsKey(zEvent.getTarget().getControllerId())
|
||||
? amountOfCreaturesThatDied.get(zEvent.getTarget().getControllerId()) : 0;
|
||||
amountOfCreaturesThatDied.put(zEvent.getTarget().getControllerId(), ++count);
|
||||
}
|
||||
}
|
||||
|
|
@ -145,6 +146,7 @@ class VileRedeemerNonTokenCreaturesDiedWatcher extends Watcher {
|
|||
|
||||
@Override
|
||||
public void reset() {
|
||||
super.reset();
|
||||
amountOfCreaturesThatDied.clear();
|
||||
}
|
||||
|
||||
|
|
|
|||
124
Mage.Sets/src/mage/sets/prophecy/CalmingVerse.java
Normal file
124
Mage.Sets/src/mage/sets/prophecy/CalmingVerse.java
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
/*
|
||||
* 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.prophecy;
|
||||
|
||||
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.constants.TargetController;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledEnchantmentPermanent;
|
||||
import mage.filter.common.FilterEnchantmentPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||
*/
|
||||
public class CalmingVerse extends CardImpl {
|
||||
|
||||
public CalmingVerse(UUID ownerId) {
|
||||
super(ownerId, 110, "Calming Verse", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{G}");
|
||||
this.expansionSetCode = "PCY";
|
||||
|
||||
// Destroy all enchantments you don't control. Then, if you control an untapped land, destroy all enchantments you control.
|
||||
this.getSpellAbility().addEffect(new CalmingVerseEffect());
|
||||
|
||||
}
|
||||
|
||||
public CalmingVerse(final CalmingVerse card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CalmingVerse copy() {
|
||||
return new CalmingVerse(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CalmingVerseEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterPermanent untappedLandFilter = new FilterPermanent("If you control an untapped land");
|
||||
static {
|
||||
untappedLandFilter.add(new CardTypePredicate(CardType.LAND));
|
||||
untappedLandFilter.add(Predicates.not(new TappedPredicate()));
|
||||
}
|
||||
|
||||
private static final FilterEnchantmentPermanent opponentEnchantmentsFilter = new FilterEnchantmentPermanent("enchantments you don't control");
|
||||
static {
|
||||
opponentEnchantmentsFilter.add(new ControllerPredicate(TargetController.OPPONENT));
|
||||
}
|
||||
|
||||
private static final FilterControlledEnchantmentPermanent controlledEnchantmentsFilter = new FilterControlledEnchantmentPermanent("enchantments you control");
|
||||
|
||||
|
||||
public CalmingVerseEffect() {
|
||||
super(Outcome.Detriment);
|
||||
this.staticText = "Destroy all enchantments you don't control. Then, if you control an untapped land, destroy all enchantments you control";
|
||||
}
|
||||
|
||||
public CalmingVerseEffect(final CalmingVerseEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CalmingVerseEffect copy() {
|
||||
return new CalmingVerseEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
// Destroy all other enchantments
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(opponentEnchantmentsFilter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
permanent.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
|
||||
// Then if you control an untapped land, destroy all own enchantments
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
|
||||
if (game.getState().getBattlefield().countAll(untappedLandFilter, controller.getId(), game) > 0) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(controlledEnchantmentsFilter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
permanent.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -29,12 +29,18 @@ package mage.sets.shadowsoverinnistrad;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -57,7 +63,7 @@ public class DemonPossessedWitch extends CardImpl {
|
|||
this.nightCard = true;
|
||||
|
||||
// When this creature transforms into Demon-Possessed Witch, you may destroy target creature.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new InfoEffect(rule)));
|
||||
this.addAbility(new DemonPossessedWitchAbility());
|
||||
}
|
||||
|
||||
public DemonPossessedWitch(final DemonPossessedWitch card) {
|
||||
|
|
@ -69,3 +75,42 @@ public class DemonPossessedWitch extends CardImpl {
|
|||
return new DemonPossessedWitch(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DemonPossessedWitchAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public DemonPossessedWitchAbility() {
|
||||
super(Zone.BATTLEFIELD, new DestroyTargetEffect(), true);
|
||||
Target target = new TargetPermanent(new FilterCreaturePermanent());
|
||||
this.addTarget(target);
|
||||
}
|
||||
|
||||
public DemonPossessedWitchAbility(final DemonPossessedWitchAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DemonPossessedWitchAbility copy() {
|
||||
return new DemonPossessedWitchAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.TRANSFORMED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getTargetId().equals(sourceId)) {
|
||||
Permanent permanent = game.getPermanent(sourceId);
|
||||
if (permanent != null && permanent.isTransformed()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "When this creature transforms into Demon-Possessed Witch, you may destroy target creature.";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,23 +29,15 @@ package mage.sets.shadowsoverinnistrad;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.condition.common.DeliriumCondition;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalActivatedAbility;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.effects.common.TransformSourceEffect;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -67,9 +59,6 @@ public class KindlyStranger extends CardImpl {
|
|||
this.addAbility(new TransformAbility());
|
||||
this.addAbility(new ConditionalActivatedAbility(Zone.BATTLEFIELD,
|
||||
new TransformSourceEffect(true), new ManaCostsImpl<>("{2}{B}"), DeliriumCondition.getInstance()));
|
||||
|
||||
// When this creature transforms into Demon-Possessed Witch, you may destroy target creature.
|
||||
this.addAbility(new DemonPossessedWitchAbility());
|
||||
}
|
||||
|
||||
public KindlyStranger(final KindlyStranger card) {
|
||||
|
|
@ -81,44 +70,3 @@ public class KindlyStranger extends CardImpl {
|
|||
return new KindlyStranger(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DemonPossessedWitchAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public DemonPossessedWitchAbility() {
|
||||
super(Zone.BATTLEFIELD, new DestroyTargetEffect(), true);
|
||||
Target target = new TargetPermanent(new FilterCreaturePermanent());
|
||||
this.addTarget(target);
|
||||
// Rule only shown on the night side
|
||||
this.setRuleVisible(false);
|
||||
}
|
||||
|
||||
public DemonPossessedWitchAbility(final DemonPossessedWitchAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DemonPossessedWitchAbility copy() {
|
||||
return new DemonPossessedWitchAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.TRANSFORMED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getTargetId().equals(sourceId)) {
|
||||
Permanent permanent = game.getPermanent(sourceId);
|
||||
if (permanent != null && permanent.isTransformed()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "When this creature transforms into Demon-Possessed Witch, you may destroy target creature.";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
52
Mage.Sets/src/mage/sets/thedark/Preacher.java
Normal file
52
Mage.Sets/src/mage/sets/thedark/Preacher.java
Normal 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.thedark;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public class Preacher extends mage.sets.mastersedition.Preacher {
|
||||
|
||||
public Preacher(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 89;
|
||||
this.expansionSetCode = "DRK";
|
||||
}
|
||||
|
||||
public Preacher(final Preacher card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Preacher copy() {
|
||||
return new Preacher(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -37,6 +37,7 @@ import mage.abilities.dynamicvalue.common.RemovedCountersForCostValue;
|
|||
import mage.abilities.effects.common.AddManaInAnyCombinationEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.abilities.mana.SimpleManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
|
|
@ -57,11 +58,11 @@ public class CalciformPools extends CardImpl {
|
|||
// {tap}: Add {C} to your mana pool.
|
||||
this.addAbility(new ColorlessManaAbility());
|
||||
// {1}, {tap}: Put a storage counter on Calciform Pools.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance()),new GenericManaCost(1));
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.STORAGE.createInstance()), new GenericManaCost(1));
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
// {1}, Remove X storage counters from Calciform Pools: Add X mana in any combination of {W} and/or {U} to your mana pool.
|
||||
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
ability = new SimpleManaAbility(Zone.BATTLEFIELD,
|
||||
new AddManaInAnyCombinationEffect(new RemovedCountersForCostValue(), ColoredManaSymbol.W, ColoredManaSymbol.U),
|
||||
new GenericManaCost(1));
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.STORAGE.createInstance()));
|
||||
|
|
|
|||
128
Mage.Sets/src/mage/sets/urzassaga/WildDogs.java
Normal file
128
Mage.Sets/src/mage/sets/urzassaga/WildDogs.java
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.urzassaga;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||
import mage.abilities.keyword.CyclingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||
*/
|
||||
public class WildDogs extends CardImpl {
|
||||
|
||||
public WildDogs(UUID ownerId) {
|
||||
super(ownerId, 284, "Wild Dogs", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}");
|
||||
this.expansionSetCode = "USG";
|
||||
this.subtype.add("Hound");
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// At the beginning of your upkeep, if a player has more life than each other player, the player with the most life gains control of Wild Dogs.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new WildDogsEffect(), TargetController.YOU, false));
|
||||
|
||||
// Cycling {2}
|
||||
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}")));
|
||||
}
|
||||
|
||||
public WildDogs(final WildDogs card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WildDogs copy() {
|
||||
return new WildDogs(this);
|
||||
}
|
||||
}
|
||||
|
||||
class WildDogsEffect extends OneShotEffect {
|
||||
|
||||
public WildDogsEffect() {
|
||||
super(Outcome.GainControl);
|
||||
this.staticText = "the player with the most life gains control of {this}";
|
||||
}
|
||||
|
||||
public WildDogsEffect(final WildDogsEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WildDogsEffect copy() {
|
||||
return new WildDogsEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent != null) {
|
||||
Player newController = null;
|
||||
int lowLife = Integer.MIN_VALUE;
|
||||
boolean tie = false;
|
||||
for (UUID playerID : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
Player player = game.getPlayer(playerID);
|
||||
if (player != null) {
|
||||
if (player.getLife() > lowLife) {
|
||||
lowLife = player.getLife();
|
||||
newController = player;
|
||||
tie = false;
|
||||
} else if (player.getLife() == lowLife) {
|
||||
tie = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!controller.equals(newController) && !tie && newController != null) {
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, newController.getId());
|
||||
effect.setTargetPointer(new FixedTarget(sourcePermanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,205 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package org.mage.test.cards.abilities.other;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class LimitedCountedActivationsTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Tests usage of ActivationInfo class
|
||||
*/
|
||||
@Test
|
||||
public void testDragonWhelpActivatedThreeTimes() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
|
||||
// Flying
|
||||
// {R}: Dragon Whelp gets +1/+0 until end of turn. If this ability has been activated four or more times this turn, sacrifice Dragon Whelp at the beginning of the next end step.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Dragon Whelp", 1); // 3/3
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
|
||||
|
||||
attack(1, playerA, "Dragon Whelp");
|
||||
|
||||
setStopAt(2, PhaseStep.UPKEEP);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Dragon Whelp", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 15);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDragonWhelpActivatedFourTimes() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
|
||||
// Flying
|
||||
// {R}: Dragon Whelp gets +1/+0 until end of turn. If this ability has been activated four or more times this turn, sacrifice Dragon Whelp at the beginning of the next end step.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Dragon Whelp", 1); // 3/3
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
|
||||
|
||||
attack(1, playerA, "Dragon Whelp");
|
||||
|
||||
setStopAt(2, PhaseStep.UPKEEP);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Dragon Whelp", 0);
|
||||
assertGraveyardCount(playerA, "Dragon Whelp", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 14);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDragonWhelpActivatedFiveTimes() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
|
||||
// Flying
|
||||
// {R}: Dragon Whelp gets +1/+0 until end of turn. If this ability has been activated four or more times this turn, sacrifice Dragon Whelp at the beginning of the next end step.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Dragon Whelp", 1); // 3/3
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{R}: ");
|
||||
|
||||
attack(1, playerA, "Dragon Whelp");
|
||||
|
||||
setStopAt(2, PhaseStep.UPKEEP);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Dragon Whelp", 0);
|
||||
assertGraveyardCount(playerA, "Dragon Whelp", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 13);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDragonWhelpTwoObjects() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
|
||||
// Flying
|
||||
// {R}: Dragon Whelp gets +1/+0 until end of turn. If this ability has been activated four or more times this turn, sacrifice Dragon Whelp at the beginning of the next end step.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Dragon Whelp", 1); // 3/3
|
||||
// Put target creature card from a graveyard onto the battlefield under your control. You lose life equal to its converted mana cost.
|
||||
addCard(Zone.HAND, playerA, "Reanimate", 1);
|
||||
// Target creature gains haste until end of turn.
|
||||
addCard(Zone.HAND, playerA, "Unnatural Speed", 1);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2);
|
||||
// Destroy target nonartifact, nonblack creature. It can't be regenerated.
|
||||
addCard(Zone.HAND, playerB, "Terror", 1); // {1}{B}
|
||||
|
||||
activateAbility(1, PhaseStep.UPKEEP, playerA, "{R}: ");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Terror", "Dragon Whelp");
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reanimate", "Dragon Whelp");
|
||||
castSpell(1, PhaseStep.BEGIN_COMBAT, playerA, "Unnatural Speed", "Dragon Whelp");
|
||||
|
||||
activateAbility(1, PhaseStep.DECLARE_ATTACKERS, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.DECLARE_ATTACKERS, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.DECLARE_ATTACKERS, playerA, "{R}: ");
|
||||
|
||||
attack(1, playerA, "Dragon Whelp");
|
||||
|
||||
setStopAt(2, PhaseStep.UPKEEP);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Unnatural Speed", 1);
|
||||
assertGraveyardCount(playerA, "Reanimate", 1);
|
||||
|
||||
assertGraveyardCount(playerB, "Terror", 1);
|
||||
|
||||
assertPermanentCount(playerA, "Dragon Whelp", 1);
|
||||
assertPowerToughness(playerA, "Dragon Whelp", 2, 3);
|
||||
assertGraveyardCount(playerA, "Dragon Whelp", 0);
|
||||
|
||||
assertLife(playerA, 16);
|
||||
assertLife(playerB, 15);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDragonWhelpDontSacrificeNewObject() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 8);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
|
||||
// Flying
|
||||
// {R}: Dragon Whelp gets +1/+0 until end of turn. If this ability has been activated four or more times this turn, sacrifice Dragon Whelp at the beginning of the next end step.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Dragon Whelp", 1); // 3/3
|
||||
// Put target creature card from a graveyard onto the battlefield under your control. You lose life equal to its converted mana cost.
|
||||
addCard(Zone.HAND, playerA, "Reanimate", 1);
|
||||
// Target creature gains haste until end of turn.
|
||||
addCard(Zone.HAND, playerA, "Unnatural Speed", 1);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2);
|
||||
// Destroy target nonartifact, nonblack creature. It can't be regenerated.
|
||||
addCard(Zone.HAND, playerB, "Terror", 1); // {1}{B}
|
||||
|
||||
activateAbility(1, PhaseStep.UPKEEP, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.UPKEEP, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.UPKEEP, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.UPKEEP, playerA, "{R}: ");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Terror", "Dragon Whelp");
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reanimate", "Dragon Whelp");
|
||||
castSpell(1, PhaseStep.BEGIN_COMBAT, playerA, "Unnatural Speed", "Dragon Whelp");
|
||||
|
||||
activateAbility(1, PhaseStep.DECLARE_ATTACKERS, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.DECLARE_ATTACKERS, playerA, "{R}: ");
|
||||
activateAbility(1, PhaseStep.DECLARE_ATTACKERS, playerA, "{R}: ");
|
||||
|
||||
attack(1, playerA, "Dragon Whelp");
|
||||
|
||||
setStopAt(2, PhaseStep.UPKEEP);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Unnatural Speed", 1);
|
||||
assertGraveyardCount(playerA, "Reanimate", 1);
|
||||
|
||||
assertGraveyardCount(playerB, "Terror", 1);
|
||||
|
||||
assertPermanentCount(playerA, "Dragon Whelp", 1);
|
||||
assertPowerToughness(playerA, "Dragon Whelp", 2, 3);
|
||||
assertGraveyardCount(playerA, "Dragon Whelp", 0);
|
||||
|
||||
assertLife(playerA, 16);
|
||||
assertLife(playerB, 15);
|
||||
}
|
||||
}
|
||||
|
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package org.mage.test.cards.abilities.other;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
|
|
@ -39,20 +38,18 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
|
|||
*/
|
||||
public class NecromancyTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Necromancy
|
||||
* Enchantment, 2B (3)
|
||||
* You may cast Necromancy as though it had flash. If you cast it any time a
|
||||
* sorcery couldn't have been cast, the controller of the permanent it
|
||||
* becomes sacrifices it at the beginning of the next cleanup step.
|
||||
* When Necromancy enters the battlefield, if it's on the battlefield, it
|
||||
* becomes an Aura with "enchant creature put onto the battlefield with
|
||||
* Necromancy." Put target creature card from a graveyard onto the
|
||||
* battlefield under your control and attach Necromancy to it. When
|
||||
* Necromancy leaves the battlefield, that creature's controller sacrifices it.
|
||||
/**
|
||||
* Necromancy Enchantment, 2B (3) You may cast Necromancy as though it had
|
||||
* flash. If you cast it any time a sorcery couldn't have been cast, the
|
||||
* controller of the permanent it becomes sacrifices it at the beginning of
|
||||
* the next cleanup step. When Necromancy enters the battlefield, if it's on
|
||||
* the battlefield, it becomes an Aura with "enchant creature put onto the
|
||||
* battlefield with Necromancy." Put target creature card from a graveyard
|
||||
* onto the battlefield under your control and attach Necromancy to it. When
|
||||
* Necromancy leaves the battlefield, that creature's controller sacrifices
|
||||
* it.
|
||||
*
|
||||
*/
|
||||
|
||||
@Test
|
||||
public void testNecromancy() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||
|
|
@ -60,7 +57,7 @@ public class NecromancyTest extends CardTestPlayerBase {
|
|||
addCard(Zone.GRAVEYARD, playerA, "Craw Wurm");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Necromancy");
|
||||
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
|
|
@ -77,7 +74,7 @@ public class NecromancyTest extends CardTestPlayerBase {
|
|||
addCard(Zone.GRAVEYARD, playerA, "Craw Wurm");
|
||||
|
||||
castSpell(1, PhaseStep.UPKEEP, playerA, "Necromancy");
|
||||
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
|
|
@ -87,14 +84,20 @@ public class NecromancyTest extends CardTestPlayerBase {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Necromancy is sacrificed if cast as instant and if the
|
||||
* reanimated creature will be sacrificed.
|
||||
*/
|
||||
@Test
|
||||
public void testNecromancyFlashSacrifice() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||
// If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step.
|
||||
// When Necromancy leaves the battlefield, that creature's controller sacrifices it.
|
||||
addCard(Zone.HAND, playerA, "Necromancy");
|
||||
addCard(Zone.GRAVEYARD, playerA, "Craw Wurm");
|
||||
addCard(Zone.GRAVEYARD, playerA, "Craw Wurm"); // 6/4
|
||||
|
||||
castSpell(1, PhaseStep.UPKEEP, playerA, "Necromancy");
|
||||
|
||||
|
||||
setStopAt(2, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
|
|
@ -114,7 +117,7 @@ public class NecromancyTest extends CardTestPlayerBase {
|
|||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Necromancy"); // enchanting the Craw Wurm
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Disenchant", "Necromancy"); // if Necromancy leaves, the enchanted creature has to leave too
|
||||
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
|
|
@ -124,5 +127,5 @@ public class NecromancyTest extends CardTestPlayerBase {
|
|||
assertGraveyardCount(playerA, "Necromancy", 1);
|
||||
assertGraveyardCount(playerA, "Craw Wurm", 1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,4 +97,41 @@ public class SpendOtherManaTest extends CardTestPlayerBase {
|
|||
|
||||
assertPermanentCount(playerA, "Chandra, Flamecaller", 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* I was unable to cast Nissa, Voice of Zendikar using black mana with Oath
|
||||
* of Nissa in play. Pretty sure Oath is working usually, so here were the
|
||||
* conditions in my game:
|
||||
*
|
||||
* -Cast Dark Petition with spell mastery -Attempt to cast Nissa, Voice of
|
||||
* Zendikar using the triple black mana from Dark Petition
|
||||
*/
|
||||
@Test
|
||||
public void testOathOfNissaWithDarkPetition() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||
// When Oath of Nissa enters the battlefield, look at the top three cards of your library. You may reveal a creature, land, or planeswalker card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
|
||||
// You may spend mana as though it were mana of any color to cast planeswalker spells.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Oath of Nissa");
|
||||
addCard(Zone.GRAVEYARD, playerA, "Lightning Bolt", 2);
|
||||
|
||||
// Search your library for a card and put that card into your hand. Then shuffle your library.
|
||||
// <i>Spell mastery</i> - If there are two or more instant and/or sorcery cards in your graveyard, add {B}{B}{B} to your mana pool.
|
||||
addCard(Zone.HAND, playerA, "Dark Petition"); // {3}{B}{B}
|
||||
|
||||
// +1: Put a 0/1 green Plant creature token onto the battlefield.
|
||||
// -2: Put a +1/+1 counter on each creature you control.
|
||||
// -7: You gain X life and draw X cards, where X is the number of lands you control.
|
||||
addCard(Zone.LIBRARY, playerA, "Nissa, Voice of Zendikar"); // {1}{G}{G}
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dark Petition");
|
||||
setChoice(playerA, "Nissa, Voice of Zendikar");
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nissa, Voice of Zendikar");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Dark Petition", 1);
|
||||
assertHandCount(playerA, "Nissa, Voice of Zendikar", 0);
|
||||
assertPermanentCount(playerA, "Nissa, Voice of Zendikar", 1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class BrainMaggotTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* When Brain Maggot enters the battlefield, target opponent reveals his or her hand and
|
||||
* you choose a nonland card from it. Exile that card until Brain Maggot leaves the battlefield.
|
||||
*
|
||||
* When Brain Maggot enters the battlefield, target opponent reveals his or
|
||||
* her hand and you choose a nonland card from it. Exile that card until
|
||||
* Brain Maggot leaves the battlefield.
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
public void testCardFromHandWillBeExiled() {
|
||||
|
|
@ -61,10 +61,10 @@ public class BrainMaggotTest extends CardTestPlayerBase {
|
|||
assertExileCount("Bloodflow Connoisseur", 1);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testCardFromHandWillBeExiledAndReturn() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
|
||||
// When Brain Maggot enters the battlefield, target opponent reveals his or her hand and you choose a nonland card from it. Exile that card until Brain Maggot leaves the battlefield.
|
||||
addCard(Zone.HAND, playerA, "Brain Maggot", 2);
|
||||
|
||||
addCard(Zone.HAND, playerB, "Bloodflow Connoisseur", 1);
|
||||
|
|
@ -105,4 +105,4 @@ public class BrainMaggotTest extends CardTestPlayerBase {
|
|||
assertHandCount(playerB, "Bloodflow Connoisseur", 1);
|
||||
assertExileCount("Bloodflow Connoisseur", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1191,8 +1191,6 @@ public abstract class AbilityImpl implements Ability {
|
|||
public void setSourceObject(MageObject sourceObject, Game game) {
|
||||
if (sourceObject == null) {
|
||||
this.sourceObject = game.getObject(sourceId);
|
||||
// if permanent get card /permanent instead of spell
|
||||
|
||||
} else {
|
||||
this.sourceObject = sourceObject;
|
||||
}
|
||||
|
|
|
|||
77
Mage/src/main/java/mage/abilities/ActivationInfo.java
Normal file
77
Mage/src/main/java/mage/abilities/ActivationInfo.java
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.abilities;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
* The ActivationInfo class holds the information how often an ability of an
|
||||
* object was activated during a turn. It handles the check, if the object is
|
||||
* still the same, so for example if a permanent left battlefield and returns,
|
||||
* the counting of activations happens for each object.
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ActivationInfo {
|
||||
|
||||
protected int turnNum;
|
||||
protected int activationCounter;
|
||||
|
||||
public static ActivationInfo getInstance(Game game, UUID sourceId) {
|
||||
return ActivationInfo.getInstance(game, sourceId, game.getState().getZoneChangeCounter(sourceId));
|
||||
}
|
||||
|
||||
public static ActivationInfo getInstance(Game game, UUID sourceId, int zoneChangeCounter) {
|
||||
String key = "ActivationInfo" + sourceId.toString() + zoneChangeCounter;
|
||||
ActivationInfo activationInfo = (ActivationInfo) game.getState().getValue(key);
|
||||
if (activationInfo == null) {
|
||||
activationInfo = new ActivationInfo(game);
|
||||
game.getState().setValue(key, activationInfo);
|
||||
}
|
||||
return activationInfo;
|
||||
}
|
||||
|
||||
protected ActivationInfo(Game game) {
|
||||
this.turnNum = game.getTurnNum();
|
||||
this.activationCounter = 0;
|
||||
}
|
||||
|
||||
public void addActivation(Game game) {
|
||||
if (game.getTurnNum() != turnNum) {
|
||||
activationCounter = 1;
|
||||
turnNum = game.getTurnNum();
|
||||
} else {
|
||||
activationCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
public int getActivationCounter() {
|
||||
return activationCounter;
|
||||
}
|
||||
}
|
||||
|
|
@ -70,7 +70,9 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
|
|||
public void trigger(Game game, UUID controllerId) {
|
||||
//20091005 - 603.4
|
||||
if (checkInterveningIfClause(game)) {
|
||||
setSourceObject(null, game);
|
||||
if (!(this instanceof DelayedTriggeredAbility)) {
|
||||
setSourceObject(null, game);
|
||||
}
|
||||
game.addTriggeredAbility(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ import mage.game.ExileZone;
|
|||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.PermanentToken;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
|
|
@ -107,8 +106,7 @@ class ReturnExiledPermanentsEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (sourceObject != null && controller != null) {
|
||||
int zoneChangeCounter = (sourceObject instanceof PermanentToken) ? source.getSourceObjectZoneChangeCounter() : source.getSourceObjectZoneChangeCounter() - 1;
|
||||
UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), zoneChangeCounter);
|
||||
UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
if (exileZone != null) {
|
||||
ExileZone exile = game.getExile().getExileZone(exileZone);
|
||||
if (exile != null) {
|
||||
|
|
|
|||
|
|
@ -48,6 +48,14 @@ public class SourceHasRemainedInSameZoneCondition implements Condition {
|
|||
this.idToCheck = idToCheck;
|
||||
this.timesChangedZones = -1;
|
||||
}
|
||||
|
||||
public SourceHasRemainedInSameZoneCondition(UUID idToCheck, Game game) {
|
||||
this.idToCheck = idToCheck;
|
||||
this.timesChangedZones = -1;
|
||||
if (this.idToCheck != null && game != null && game.getCard(this.idToCheck) != null) {
|
||||
this.timesChangedZones = game.getState().getZoneChangeCounter(this.idToCheck);
|
||||
}
|
||||
}
|
||||
|
||||
public SourceHasRemainedInSameZoneCondition getInstance(UUID cardId) {
|
||||
return new SourceHasRemainedInSameZoneCondition(cardId);
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
/*
|
||||
* 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
|
||||
|
|
@ -20,12 +20,11 @@
|
|||
* 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;
|
||||
|
|
@ -34,6 +33,7 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.stack.Spell;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -58,6 +58,15 @@ public class SacrificeSourceEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
MageObject sourceObject = source.getSourceObjectIfItStillExists(game);
|
||||
if (sourceObject == null) {
|
||||
// Check if the effect was installed by the spell the source was cast by (e.g. Necromancy), if not don't sacrifice the permanent
|
||||
if (source.getSourceObject(game) instanceof Spell) {
|
||||
sourceObject = game.getPermanent(source.getSourceId());
|
||||
if (sourceObject.getZoneChangeCounter(game) > source.getSourceObjectZoneChangeCounter() + 1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sourceObject instanceof Permanent) {
|
||||
Permanent permanent = (Permanent) sourceObject;
|
||||
// you can only sacrifice a permanent you control
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ public class GameEvent implements Serializable {
|
|||
public enum EventType {
|
||||
|
||||
//Game events
|
||||
//Game events
|
||||
BEGINNING,
|
||||
PREVENT_DAMAGE, PREVENTED_DAMAGE,
|
||||
//Turn-based events
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
/*
|
||||
* 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
|
||||
|
|
@ -20,13 +20,17 @@
|
|||
* 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.game.permanent.token;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
|
|
@ -36,13 +40,19 @@ import mage.constants.CardType;
|
|||
import mage.constants.Zone;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class ClueArtifactToken extends Token {
|
||||
|
||||
final static private List<String> tokenImageSets = new ArrayList<>();
|
||||
|
||||
static {
|
||||
tokenImageSets.addAll(Arrays.asList("SOI", "EDM"));
|
||||
}
|
||||
|
||||
public ClueArtifactToken() {
|
||||
super("Clue", "colorless Clue artifact token onto the battlefield with \"{2}, Sacrifice this artifact: Draw a card.\"");
|
||||
this.setOriginalExpansionSetCode("SOI");
|
||||
availableImageSetCodes = tokenImageSets;
|
||||
cardType.add(CardType.ARTIFACT);
|
||||
subtype.add("Clue");
|
||||
|
||||
|
|
@ -53,4 +63,25 @@ public class ClueArtifactToken extends Token {
|
|||
ability.addCost(cost);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setExpansionSetCodeForImage(String code) {
|
||||
super.setExpansionSetCodeForImage(code);
|
||||
if (getOriginalExpansionSetCode().equals("SOI")) {
|
||||
this.setTokenType(new Random().nextInt(6) + 1); // 6 different images
|
||||
}
|
||||
if (getOriginalExpansionSetCode().equals("EDM")) {
|
||||
this.setTokenType(new Random().nextInt(6) + 1); // 6 different images
|
||||
}
|
||||
}
|
||||
|
||||
public ClueArtifactToken(final ClueArtifactToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClueArtifactToken copy() {
|
||||
return new ClueArtifactToken(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.events.ManaEvent;
|
||||
import mage.game.stack.Spell;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -130,7 +131,10 @@ public class ManaPool implements Serializable {
|
|||
for (ManaPoolItem mana : manaItems) {
|
||||
if (filter != null) {
|
||||
if (!filter.match(mana.getSourceObject(), game)) {
|
||||
continue;
|
||||
// Prevent that cost reduction by convoke is filtered out
|
||||
if (!(mana.getSourceObject() instanceof Spell) || ability.getSourceId().equals(mana.getSourceId())) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!manaType.equals(unlockedManaType) && autoPayment && autoPaymentRestricted && mana.count() == mana.getStock()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue