mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
commit
c4c9285668
11 changed files with 386 additions and 110 deletions
|
@ -73,7 +73,7 @@ class ManaCryptEffect extends OneShotEffect {
|
|||
|
||||
ManaCryptEffect() {
|
||||
super(Outcome.Damage);
|
||||
staticText = "flip a coin. If you lose the flip, {this} Crypt deals 3 damage to you";
|
||||
staticText = "flip a coin. If you lose the flip, {this} deals 3 damage to you";
|
||||
}
|
||||
|
||||
ManaCryptEffect(final ManaCryptEffect effect) {
|
||||
|
|
|
@ -55,7 +55,7 @@ import mage.target.TargetPermanent;
|
|||
public class MistOfStagnation extends CardImpl {
|
||||
|
||||
public MistOfStagnation(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}");
|
||||
|
||||
// Permanents don't untap during their controllers' untap steps.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepAllEffect(Duration.WhileOnBattlefield, TargetController.ANY, new FilterPermanent("permanents"))));
|
||||
|
|
|
@ -52,7 +52,7 @@ import mage.watchers.Watcher;
|
|||
public class MoltenPsyche extends CardImpl {
|
||||
|
||||
public MoltenPsyche(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}{R}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{R}");
|
||||
|
||||
// Each player shuffles the cards from his or her hand into his or her library, then draws that many cards.
|
||||
// Metalcraft - If you control three or more artifacts, Molten Psyche deals damage to each opponent equal to the number of cards that player has drawn this turn.
|
||||
|
@ -106,10 +106,6 @@ class MoltenPsycheEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.drawCards(cardsToDraw.get(playerId), game);
|
||||
if (MetalcraftCondition.instance.apply(game, source) && !playerId.equals(source.getControllerId())) {
|
||||
MoltenPsycheWatcher watcher = (MoltenPsycheWatcher) game.getState().getWatchers().get(MoltenPsycheWatcher.class.getSimpleName());
|
||||
player.damage(watcher.getDraws(playerId), source.getSourceId(), game, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (MetalcraftCondition.instance.apply(game, source)) {
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
*/
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.LeavesBattlefieldTriggeredAbility;
|
||||
|
@ -46,17 +48,16 @@ import mage.constants.Zone;
|
|||
import mage.counters.Counter;
|
||||
import mage.counters.Counters;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterEnchantmentPermanent;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -64,14 +65,12 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public class TawnossCoffin extends CardImpl {
|
||||
|
||||
public Counters godHelpMe = null;
|
||||
|
||||
public TawnossCoffin(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
|
||||
|
||||
// You may choose not to untap Tawnos's Coffin during your untap step.
|
||||
this.addAbility(new SkipUntapOptionalAbility());
|
||||
// {3}, {tap}: Exile target creature and all Auras attached to it. Note the number and kind of counters that were on that creature.
|
||||
// {3}, {T}: Exile target creature and all Auras attached to it. Note the number and kind of counters that were on that creature.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TawnossCoffinEffect(), new TapSourceCost());
|
||||
ability.addCost(new ManaCostsImpl("{3}"));
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
|
@ -114,7 +113,7 @@ class TawnossCoffinTriggeredAbility extends LeavesBattlefieldTriggeredAbility {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.UNTAPPED) {
|
||||
return event.getTargetId().equals(sourceId);
|
||||
return event.getTargetId().equals(getSourceId());
|
||||
} else {
|
||||
return super.checkTrigger(event, game);
|
||||
}
|
||||
|
@ -151,40 +150,25 @@ class TawnossCoffinEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
// Exile enchanted creature and all Auras attached to it.
|
||||
Permanent enchantment = game.getPermanent(source.getSourceId());
|
||||
if (enchantment == null) {
|
||||
enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
|
||||
}
|
||||
UUID targetId = source.getFirstTarget();
|
||||
|
||||
if (targetId == null) {
|
||||
return false; // if previous scan somehow failed, simply quit
|
||||
}
|
||||
if (enchantment != null) { //back to code (mostly) copied from Flickerform
|
||||
Permanent enchantedCreature = game.getPermanent(targetId);
|
||||
Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && sourceObject != null) {
|
||||
Permanent enchantedCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (enchantedCreature != null) {
|
||||
UUID exileZoneId = source.getSourceId();
|
||||
enchantedCreature.moveToExile(exileZoneId, enchantment.getName(), source.getSourceId(), game);
|
||||
UUID exileZoneId = CardUtil.getCardExileZoneId(game, source);
|
||||
Set<Card> toExile = new HashSet<>();
|
||||
toExile.add(enchantedCreature);
|
||||
for (UUID attachementId : enchantedCreature.getAttachments()) {
|
||||
Permanent attachment = game.getPermanent(attachementId);
|
||||
if (attachment != null && filter.match(attachment, game)) {
|
||||
attachment.moveToExile(exileZoneId, enchantment.getName(), source.getSourceId(), game);
|
||||
if (attachment != null && attachment.hasSubtype(SubType.AURA, game)) {
|
||||
toExile.add(attachment);
|
||||
}
|
||||
}
|
||||
|
||||
//((TawnossCoffin)enchantment.getMainCard()).godHelpMe = enchantedCreature.getCounters(game); //why doesn't work? should return the same card, no?
|
||||
((TawnossCoffin) game.getCard(source.getSourceId())).godHelpMe = enchantedCreature.getCounters(game).copy();
|
||||
|
||||
if (!(enchantedCreature instanceof Token)) {
|
||||
|
||||
// If you do, return the other cards exiled this way to the battlefield under their owners' control attached to that creature
|
||||
/*LeavesBattlefieldTriggeredAbility triggeredAbility = new LeavesBattlefieldTriggeredAbility(
|
||||
new TawnossCoffinReturnEffect(), false);
|
||||
enchantment.addAbility(triggeredAbility, source.getSourceId(), game);
|
||||
*/
|
||||
}
|
||||
return true;
|
||||
controller.moveCardsToExile(toExile, source, game, true, exileZoneId, sourceObject.getIdName());
|
||||
game.getState().setValue(exileZoneId.toString() + "NotedCounters", enchantedCreature.getCounters(game).copy());
|
||||
game.getState().setValue(exileZoneId.toString() + "EnchantedCreature", enchantedCreature.getId());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -193,17 +177,9 @@ class TawnossCoffinEffect extends OneShotEffect {
|
|||
|
||||
class TawnossCoffinReturnEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterCard filterAura = new FilterCard();
|
||||
|
||||
static {
|
||||
filterAura.add(new CardTypePredicate(CardType.ENCHANTMENT));
|
||||
filterAura.add(new SubtypePredicate(SubType.AURA));
|
||||
}
|
||||
|
||||
public TawnossCoffinReturnEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "return the exiled card to the battlefield under its owner's control tapped with the noted number and kind of counters on it. If you do, return the exiled Aura cards to the battlefield under their owner's control attached to that permanent";
|
||||
|
||||
}
|
||||
|
||||
public TawnossCoffinReturnEffect(final TawnossCoffinReturnEffect effect) {
|
||||
|
@ -217,57 +193,66 @@ class TawnossCoffinReturnEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
ExileZone exileZone = game.getExile().getExileZone(source.getSourceId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
UUID exileZoneId = CardUtil.getCardExileZoneId(game, source);
|
||||
ExileZone exileZone = game.getExile().getExileZone(exileZoneId);
|
||||
if (exileZone == null) {
|
||||
return true;
|
||||
}
|
||||
FilterCard filter = new FilterCard();
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
//There should be only 1 there, but the for each loop seems the most practical to get to it
|
||||
for (Card enchantedCard : exileZone.getCards(filter, game)) {
|
||||
if (enchantedCard == null) {
|
||||
continue;
|
||||
}
|
||||
enchantedCard.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), enchantedCard.getOwnerId());
|
||||
Permanent newPermanent = game.getPermanent(enchantedCard.getId());
|
||||
if (newPermanent != null) {
|
||||
newPermanent.tap(game);
|
||||
for (Card enchantment : exileZone.getCards(game)) {
|
||||
if (filterAura.match(enchantment, game)) {
|
||||
boolean canTarget = false;
|
||||
for (Target target : enchantment.getSpellAbility().getTargets()) {
|
||||
Filter filter2 = target.getFilter();
|
||||
if (filter2.match(newPermanent, game)) {
|
||||
canTarget = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!canTarget) {
|
||||
// Aura stays exiled
|
||||
continue;
|
||||
}
|
||||
game.getState().setValue("attachTo:" + enchantment.getId(), newPermanent);
|
||||
}
|
||||
if (enchantment.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), enchantment.getOwnerId())) {
|
||||
if (filterAura.match(enchantment, game)) {
|
||||
newPermanent.addAttachment(enchantment.getId(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
Card oubliette = game.getCard(source.getSourceId());
|
||||
if (oubliette == null) {
|
||||
return false;//1st stab at getting those counters back
|
||||
}
|
||||
for (Counter c : ((TawnossCoffin) oubliette).godHelpMe.values()) { //would be nice if could just use that copy function to set the whole field
|
||||
UUID enchantedCreatureId = (UUID) game.getState().getValue(exileZoneId.toString() + "EnchantedCreature");
|
||||
if (enchantedCreatureId == null) {
|
||||
return false;
|
||||
}
|
||||
if (!exileZone.contains(enchantedCreatureId)) {
|
||||
return true; // Card was removed from exile meanwhile, other card sstay in exile
|
||||
}
|
||||
Card enchantedCreature = game.getCard(enchantedCreatureId);
|
||||
if (enchantedCreature == null) {
|
||||
return false;
|
||||
}
|
||||
controller.moveCards(enchantedCreature, Zone.BATTLEFIELD, source, game, true, false, true, null);
|
||||
Permanent newPermanent = game.getPermanent(enchantedCreature.getId());
|
||||
if (newPermanent != null) {
|
||||
// Add the noted counters
|
||||
Counters notedCounters = (Counters) game.getState().getValue(exileZoneId.toString() + "NotedCounters");
|
||||
if (notedCounters != null) {
|
||||
for (Counter c : notedCounters.values()) { //would be nice if could just use that copy function to set the whole field
|
||||
if (c != null) {
|
||||
newPermanent.getCounters(game).addCounter(c);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
// Return the exiled auras
|
||||
Set<Card> returningAuras = new HashSet<>();
|
||||
for (Card enchantment : exileZone.getCards(game)) {
|
||||
if (enchantment.hasSubtype(SubType.AURA, game)) {
|
||||
boolean canTarget = false;
|
||||
for (Target target : enchantment.getSpellAbility().getTargets()) {
|
||||
Filter filter2 = target.getFilter();
|
||||
if (filter2.match(newPermanent, game)) {
|
||||
canTarget = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!canTarget) {
|
||||
// Aura stays exiled
|
||||
continue;
|
||||
}
|
||||
returningAuras.add(enchantment);
|
||||
game.getState().setValue("attachTo:" + enchantment.getId(), newPermanent);
|
||||
}
|
||||
}
|
||||
controller.moveCards(returningAuras, Zone.BATTLEFIELD, source, game, false, false, true, null);
|
||||
for (Card enchantment : returningAuras) {
|
||||
Permanent permanent = game.getPermanent(enchantment.getId());
|
||||
if (permanent != null) {
|
||||
newPermanent.addAttachment(permanent.getId(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public class TemporalDistortion extends CardImpl {
|
|||
}
|
||||
|
||||
public TemporalDistortion(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}");
|
||||
|
||||
// Whenever a creature or land becomes tapped, put an hourglass counter on it.
|
||||
Effect effect = new AddCountersTargetEffect(CounterType.HOURGLASS.createInstance());
|
||||
|
|
84
Mage.Sets/src/mage/cards/t/TishanaVoiceOfThunder.java
Normal file
84
Mage.Sets/src/mage/cards/t/TishanaVoiceOfThunder.java
Normal file
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.CardsInControllerHandCount;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public class TishanaVoiceOfThunder extends CardImpl {
|
||||
|
||||
public TishanaVoiceOfThunder(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}{U}");
|
||||
|
||||
addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add("Merfolk");
|
||||
this.subtype.add("Shaman");
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
|
||||
// Tishana, Voice of Thunder's power and toughness are each equal to the number of cards in your hand.
|
||||
DynamicValue xValue = new CardsInControllerHandCount();
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(xValue, Duration.EndOfGame)));
|
||||
|
||||
// You have no maximum hand size.
|
||||
Effect effect = new MaximumHandSizeControllerEffect(Integer.MAX_VALUE, Duration.WhileOnBattlefield, MaximumHandSizeControllerEffect.HandSizeModification.SET);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||
|
||||
// When Tishana enters the battlefield, draw a card for each creature you control.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()))));
|
||||
}
|
||||
|
||||
public TishanaVoiceOfThunder(final TishanaVoiceOfThunder card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TishanaVoiceOfThunder copy() {
|
||||
return new TishanaVoiceOfThunder(this);
|
||||
}
|
||||
}
|
64
Mage.Sets/src/mage/cards/t/TocatliHonorGuard.java
Normal file
64
Mage.Sets/src/mage/cards/t/TocatliHonorGuard.java
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public class TocatliHonorGuard extends CardImpl {
|
||||
|
||||
public TocatliHonorGuard(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}");
|
||||
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Soldier");
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Creatures entering the battlefield don't cause abilities to trigger.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TorporOrbEffect()));
|
||||
}
|
||||
|
||||
public TocatliHonorGuard(final TocatliHonorGuard card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TocatliHonorGuard copy() {
|
||||
return new TocatliHonorGuard(this);
|
||||
}
|
||||
}
|
|
@ -56,6 +56,8 @@ public class Ixalan extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Sun-Crowned Hunters", 164, Rarity.COMMON, mage.cards.s.SunCrownedHunters.class));
|
||||
cards.add(new SetCardInfo("Sunpetal Grove", 257, Rarity.RARE, mage.cards.s.SunpetalGrove.class));
|
||||
cards.add(new SetCardInfo("Tishana's Wayfinder", 211, Rarity.COMMON, mage.cards.t.TishanasWayfinder.class));
|
||||
cards.add(new SetCardInfo("Tishana, Voice of Thunder", 230, Rarity.MYTHIC, mage.cards.t.TishanaVoiceOfThunder.class));
|
||||
cards.add(new SetCardInfo("Tocatli Honor Guard", 42, Rarity.RARE, mage.cards.t.TocatliHonorGuard.class));
|
||||
cards.add(new SetCardInfo("Treasure Cove", 1250, Rarity.RARE, mage.cards.t.TreasureCove.class));
|
||||
cards.add(new SetCardInfo("Treasure Map", 250, Rarity.RARE, mage.cards.t.TreasureMap.class));
|
||||
cards.add(new SetCardInfo("Unclaimed Territory", 258, Rarity.UNCOMMON, mage.cards.u.UnclaimedTerritory.class));
|
||||
|
|
|
@ -0,0 +1,145 @@
|
|||
/*
|
||||
* 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.oneshot.exile;
|
||||
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ExileAndReturnTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testExileAndReturn() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 7);
|
||||
// You may choose not to untap Tawnos's Coffin during your untap step.
|
||||
// {3}, {T}: Exile target creature and all Auras attached to it. Note the number and kind of counters that were on that creature.
|
||||
// When Tawnos's Coffin leaves the battlefield or becomes untapped, return the exiled card to the battlefield under
|
||||
// its owner's control tapped with the noted number and kind of counters on it, and if you do, return the exiled Aura
|
||||
// cards to the battlefield under their owner's control attached to that permanent.
|
||||
addCard(Zone.HAND, playerA, "Tawnos's Coffin"); // Artifact {4}
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tawnos's Coffin");
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3},{T}", "Silvercoat Lion");
|
||||
|
||||
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Tawnos's Coffin", 1);
|
||||
assertTapped("Tawnos's Coffin", false);
|
||||
|
||||
assertPermanentCount(playerB, "Silvercoat Lion", 1);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExileAndReturnWithCounters() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 7);
|
||||
// You may choose not to untap Tawnos's Coffin during your untap step.
|
||||
// {3}, {T}: Exile target creature and all Auras attached to it. Note the number and kind of counters that were on that creature.
|
||||
// When Tawnos's Coffin leaves the battlefield or becomes untapped, return the exiled card to the battlefield under
|
||||
// its owner's control tapped with the noted number and kind of counters on it, and if you do, return the exiled Aura
|
||||
// cards to the battlefield under their owner's control attached to that permanent.
|
||||
addCard(Zone.HAND, playerA, "Tawnos's Coffin"); // Artifact {4}
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
|
||||
// Put a +1/+1 counter on target creature.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Forest", 1);
|
||||
addCard(Zone.HAND, playerB, "Battlegrowth"); // Instant {G}
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tawnos's Coffin");
|
||||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Battlegrowth", "Silvercoat Lion");
|
||||
activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "{3},{T}", "Silvercoat Lion");
|
||||
|
||||
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Tawnos's Coffin", 1);
|
||||
assertTapped("Tawnos's Coffin", false);
|
||||
assertGraveyardCount(playerB, "Battlegrowth", 1);
|
||||
assertPermanentCount(playerB, "Silvercoat Lion", 1);
|
||||
assertPowerToughness(playerB, "Silvercoat Lion", 3, 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExileAndReturnWithCountersAndAuras() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 7);
|
||||
// You may choose not to untap Tawnos's Coffin during your untap step.
|
||||
// {3}, {T}: Exile target creature and all Auras attached to it. Note the number and kind of counters that were on that creature.
|
||||
// When Tawnos's Coffin leaves the battlefield or becomes untapped, return the exiled card to the battlefield under
|
||||
// its owner's control tapped with the noted number and kind of counters on it, and if you do, return the exiled Aura
|
||||
// cards to the battlefield under their owner's control attached to that permanent.
|
||||
addCard(Zone.HAND, playerA, "Tawnos's Coffin"); // Artifact {4}
|
||||
|
||||
// Whenever an Aura becomes attached to Bramble Elemental, put two 1/1 green Saproling creature tokens onto the battlefield.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Bramble Elemental"); // Creature 4/4
|
||||
// Put a +1/+1 counter on target creature.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Forest", 5);
|
||||
addCard(Zone.HAND, playerB, "Battlegrowth"); // Instant {G}
|
||||
// Enchant creature (Target a creature as you cast this. This card enters the battlefield attached to that creature.)
|
||||
// Enchanted creature gets +1/+1 for each Forest you control.
|
||||
addCard(Zone.HAND, playerB, "Blanchwood Armor"); // Enchantment Aura {2}{G}
|
||||
// Enchant creature
|
||||
// When Frog Tongue enters the battlefield, draw a card.
|
||||
// Enchanted creature has reach. (It can block creatures with flying.)
|
||||
addCard(Zone.HAND, playerB, "Frog Tongue"); // Enchantment Aura {G}
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tawnos's Coffin");
|
||||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Battlegrowth", "Bramble Elemental");
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Blanchwood Armor", "Bramble Elemental");
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Frog Tongue", "Bramble Elemental");
|
||||
activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "{3},{T}", "Bramble Elemental");
|
||||
|
||||
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Tawnos's Coffin", 1);
|
||||
assertTapped("Tawnos's Coffin", false);
|
||||
assertGraveyardCount(playerB, "Battlegrowth", 1);
|
||||
assertPermanentCount(playerB, "Bramble Elemental", 1);
|
||||
assertGraveyardCount(playerB, "Blanchwood Armor", 0);
|
||||
assertPermanentCount(playerB, "Blanchwood Armor", 1);
|
||||
assertGraveyardCount(playerB, "Frog Tongue", 0);
|
||||
assertPermanentCount(playerB, "Frog Tongue", 1);
|
||||
assertPermanentCount(playerB, "Saproling", 8);
|
||||
assertPowerToughness(playerB, "Bramble Elemental", 10, 10);
|
||||
assertAbility(playerB, "Bramble Elemental", ReachAbility.getInstance(), true);
|
||||
|
||||
assertHandCount(playerB, 3); // 1 from Turn 2 and 2 from Frog Tongue
|
||||
}
|
||||
}
|
|
@ -69,22 +69,22 @@ public final class StaticFilters {
|
|||
|
||||
public static final FilterPermanent FILTER_ATTACKING_CREATURES = new FilterCreaturePermanent("attacking creatures");
|
||||
|
||||
public static final FilterPermanent FILTER_AURA = new FilterPermanent();
|
||||
public static final FilterPermanent FILTER_EQUIPMENT = new FilterPermanent();
|
||||
public static final FilterPermanent FILTER_FORTIFICATION = new FilterPermanent();
|
||||
public static final FilterPermanent FILTER_LEGENDARY = new FilterPermanent();
|
||||
public static final FilterPermanent FILTER_PERMANENT_AURA = new FilterPermanent();
|
||||
public static final FilterPermanent FILTER_PERMANENT_EQUIPMENT = new FilterPermanent();
|
||||
public static final FilterPermanent FILTER_PERMANENT_FORTIFICATION = new FilterPermanent();
|
||||
public static final FilterPermanent FILTER_PERMANENT_LEGENDARY = new FilterPermanent();
|
||||
|
||||
static {
|
||||
FILTER_AURA.add(new CardTypePredicate(CardType.ENCHANTMENT));
|
||||
FILTER_AURA.add(new SubtypePredicate(SubType.AURA));
|
||||
FILTER_PERMANENT_AURA.add(new CardTypePredicate(CardType.ENCHANTMENT));
|
||||
FILTER_PERMANENT_AURA.add(new SubtypePredicate(SubType.AURA));
|
||||
|
||||
FILTER_EQUIPMENT.add(new CardTypePredicate(CardType.ARTIFACT));
|
||||
FILTER_EQUIPMENT.add(new SubtypePredicate(SubType.EQUIPMENT));
|
||||
FILTER_PERMANENT_EQUIPMENT.add(new CardTypePredicate(CardType.ARTIFACT));
|
||||
FILTER_PERMANENT_EQUIPMENT.add(new SubtypePredicate(SubType.EQUIPMENT));
|
||||
|
||||
FILTER_FORTIFICATION.add(new CardTypePredicate(CardType.ARTIFACT));
|
||||
FILTER_FORTIFICATION.add(new SubtypePredicate(SubType.FORTIFICATION));
|
||||
FILTER_PERMANENT_FORTIFICATION.add(new CardTypePredicate(CardType.ARTIFACT));
|
||||
FILTER_PERMANENT_FORTIFICATION.add(new SubtypePredicate(SubType.FORTIFICATION));
|
||||
|
||||
FILTER_LEGENDARY.add(new SupertypePredicate(SuperType.LEGENDARY));
|
||||
FILTER_PERMANENT_LEGENDARY.add(new SupertypePredicate(SuperType.LEGENDARY));
|
||||
}
|
||||
|
||||
static {
|
||||
|
|
|
@ -1774,7 +1774,7 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
if (perm.isWorld()) {
|
||||
worldEnchantment.add(perm);
|
||||
}
|
||||
if (StaticFilters.FILTER_AURA.match(perm, this)) {
|
||||
if (StaticFilters.FILTER_PERMANENT_AURA.match(perm, this)) {
|
||||
//20091005 - 704.5n, 702.14c
|
||||
if (perm.getAttachedTo() == null) {
|
||||
Card card = this.getCard(perm.getId());
|
||||
|
@ -1852,10 +1852,10 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (this.getState().isLegendaryRuleActive() && StaticFilters.FILTER_LEGENDARY.match(perm, this)) {
|
||||
if (this.getState().isLegendaryRuleActive() && StaticFilters.FILTER_PERMANENT_LEGENDARY.match(perm, this)) {
|
||||
legendary.add(perm);
|
||||
}
|
||||
if (StaticFilters.FILTER_EQUIPMENT.match(perm, this)) {
|
||||
if (StaticFilters.FILTER_PERMANENT_EQUIPMENT.match(perm, this)) {
|
||||
//20091005 - 704.5p, 702.14d
|
||||
if (perm.getAttachedTo() != null) {
|
||||
Permanent attachedTo = getPermanent(perm.getAttachedTo());
|
||||
|
@ -1880,7 +1880,7 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (StaticFilters.FILTER_FORTIFICATION.match(perm, this)) {
|
||||
if (StaticFilters.FILTER_PERMANENT_FORTIFICATION.match(perm, this)) {
|
||||
if (perm.getAttachedTo() != null) {
|
||||
Permanent land = getPermanent(perm.getAttachedTo());
|
||||
if (land == null || !land.getAttachments().contains(perm.getId())) {
|
||||
|
|
Loading…
Reference in a new issue