From 2547753dcba12dbfe2358dcde741a02c29b514d0 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 23 Jun 2015 16:15:14 +0200 Subject: [PATCH] Added Sen Triplets (Alara Reborn = 100%). --- .../main/java/mage/client/cards/Cards.java | 2 +- .../mage/sets/alarareborn/SenTriplets.java | 191 ++++++++++++++++++ .../avacynrestored/MisthollowGriffin.java | 2 +- .../mage/sets/avacynrestored/StolenGoods.java | 2 +- .../betrayersofkamigawa/OrnateKanzashi.java | 2 +- .../sets/coldsnap/HaakonStromgaldScourge.java | 4 +- .../sets/commander/KaradorGhostChieftain.java | 2 +- .../sets/darkascension/FiendOfTheShadows.java | 2 +- .../mage/sets/darkascension/Gravecrawler.java | 2 +- .../mage/sets/darkascension/HavengulLich.java | 2 +- .../sets/dragonsoftarkir/CommuneWithLava.java | 2 +- .../sets/dragonsoftarkir/HedonistsTrove.java | 4 +- .../mage/sets/dragonsoftarkir/IreShaman.java | 2 +- .../dragonsoftarkir/RisenExecutioner.java | 2 +- .../sets/fatereforged/MarangRiverProwler.java | 2 +- .../mage/sets/fatereforged/OutpostSiege.java | 2 +- .../mage/sets/gatecrash/NightveilSpecter.java | 2 +- .../mage/sets/innistrad/SkaabRuinator.java | 2 +- .../journeyintonyx/PropheticFlamespeaker.java | 2 +- .../src/mage/sets/judgment/Spelljack.java | 2 +- .../khansoftarkir/KheruSpellsnatcher.java | 2 +- .../NarsetEnlightenedMaster.java | 2 +- .../sets/magic2014/ChandraPyromaster.java | 2 +- .../src/mage/sets/magic2015/ActOnImpulse.java | 2 +- .../modernmasters2015/WorldheartPhoenix.java | 2 +- .../mage/sets/newphyrexia/PraetorsGrasp.java | 2 +- .../sets/planarchaos/IntetTheDreamer.java | 2 +- .../src/mage/sets/ravnica/SinsOfThePast.java | 2 +- .../mage/sets/shadowmoor/KnacksawClique.java | 2 +- .../src/mage/sets/theros/DaxosOfMeletis.java | 2 +- .../mage/sets/theros/PsychicIntrusion.java | 2 +- .../mage/sets/timeshifted/GrinningTotem.java | 2 +- .../mage/sets/vintagemasters/MindsDesire.java | 2 +- .../sets/worldwake/ThadaAdelAcquisitor.java | 2 +- Mage/src/mage/abilities/PlayLandAbility.java | 5 +- Mage/src/mage/abilities/SpellAbility.java | 3 +- .../continuous/PlayTheTopCardEffect.java | 2 +- .../mage/constants/AsThoughEffectType.java | 2 +- Mage/src/mage/game/Revealed.java | 4 + Mage/src/mage/players/PlayerImpl.java | 23 ++- 40 files changed, 249 insertions(+), 51 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/alarareborn/SenTriplets.java diff --git a/Mage.Client/src/main/java/mage/client/cards/Cards.java b/Mage.Client/src/main/java/mage/client/cards/Cards.java index c6ee605bbb..14c7109b1b 100644 --- a/Mage.Client/src/main/java/mage/client/cards/Cards.java +++ b/Mage.Client/src/main/java/mage/client/cards/Cards.java @@ -69,7 +69,7 @@ public class Cards extends javax.swing.JPanel { private final Map cards = new LinkedHashMap<>(); private boolean dontDisplayTapped = false; - private static final int GAP_X = 0; + private static final int GAP_X = 5; // needed for marking cards with coloured fram (e.g. on hand) private String zone; private static final Border emptyBorder = new EmptyBorder(0,0,0,0); diff --git a/Mage.Sets/src/mage/sets/alarareborn/SenTriplets.java b/Mage.Sets/src/mage/sets/alarareborn/SenTriplets.java new file mode 100644 index 0000000000..394d3170ca --- /dev/null +++ b/Mage.Sets/src/mage/sets/alarareborn/SenTriplets.java @@ -0,0 +1,191 @@ +/* + * 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.alarareborn; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Layer; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.SubLayer; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +/** + * + * @author LevelX2 + */ +public class SenTriplets extends CardImpl { + + public SenTriplets(UUID ownerId) { + super(ownerId, 109, "Sen Triplets", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{2}{W}{U}{B}"); + this.expansionSetCode = "ARB"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // At the beginning of your upkeep, choose target opponent. + // This turn, that player can't cast spells or activate abilities and plays with his or her hand revealed. + // You may play cards from that player's hand this turn. + Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SenTripletsRuleModifyingEffect(), TargetController.YOU, false, false); + ability.addEffect(new SenTripletsOpponentRevealsHandEffect()); + ability.addEffect(new SenTripletsPlayFromOpponentsHandEffect()); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + } + + public SenTriplets(final SenTriplets card) { + super(card); + } + + @Override + public SenTriplets copy() { + return new SenTriplets(this); + } +} + +class SenTripletsRuleModifyingEffect extends ContinuousRuleModifyingEffectImpl { + + public SenTripletsRuleModifyingEffect() { + super(Duration.EndOfTurn, Outcome.Benefit); + staticText = "At the beginning of your upkeep, choose target opponent. This turn, that player can't cast spells or activate abilities"; + } + + public SenTripletsRuleModifyingEffect(final SenTripletsRuleModifyingEffect effect) { + super(effect); + } + + @Override + public SenTripletsRuleModifyingEffect copy() { + return new SenTripletsRuleModifyingEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public String getInfoMessage(Ability source, GameEvent event, Game game) { + Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); + MageObject mageObject = game.getObject(source.getSourceId()); + if (targetPlayer != null && mageObject != null) { + return "This turn you can't cast spells or activate abilities" + + " (" + mageObject.getLogName() + ")"; + } + return null; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.CAST_SPELL || event.getType() == GameEvent.EventType.ACTIVATE_ABILITY; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return event.getPlayerId().equals(getTargetPointer().getFirst(game, source)); + } +} + +class SenTripletsOpponentRevealsHandEffect extends ContinuousEffectImpl { + + public SenTripletsOpponentRevealsHandEffect() { + super(Duration.EndOfTurn, Layer.PlayerEffects, SubLayer.NA, Outcome.Detriment); + staticText = "and plays with his or her hand revealed"; + } + + public SenTripletsOpponentRevealsHandEffect(final SenTripletsOpponentRevealsHandEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); + if (player != null) { + player.revealCards(player.getName() + "'s hand cards", player.getHand(), game, false); + } + return true; + } + + @Override + public SenTripletsOpponentRevealsHandEffect copy() { + return new SenTripletsOpponentRevealsHandEffect(this); + } +} + +class SenTripletsPlayFromOpponentsHandEffect extends AsThoughEffectImpl { + + + public SenTripletsPlayFromOpponentsHandEffect() { + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + staticText = "You may play cards from that player's hand this turn"; + } + + public SenTripletsPlayFromOpponentsHandEffect(final SenTripletsPlayFromOpponentsHandEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public SenTripletsPlayFromOpponentsHandEffect copy() { + return new SenTripletsPlayFromOpponentsHandEffect(this); + } + + @Override + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + Card card = game.getCard(objectId); + return card != null && + card.getOwnerId().equals(getTargetPointer().getFirst(game, source)) && + game.getState().getZone(objectId).equals(Zone.HAND) && + affectedControllerId.equals(source.getControllerId()); + } + +} + + diff --git a/Mage.Sets/src/mage/sets/avacynrestored/MisthollowGriffin.java b/Mage.Sets/src/mage/sets/avacynrestored/MisthollowGriffin.java index 82b73f9be3..e8cf377ac8 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/MisthollowGriffin.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/MisthollowGriffin.java @@ -76,7 +76,7 @@ public class MisthollowGriffin extends CardImpl { class MisthollowGriffinPlayEffect extends AsThoughEffectImpl { public MisthollowGriffinPlayEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); staticText = "You may cast {this} from exile"; } diff --git a/Mage.Sets/src/mage/sets/avacynrestored/StolenGoods.java b/Mage.Sets/src/mage/sets/avacynrestored/StolenGoods.java index 0d1a260fe2..7709f8614f 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/StolenGoods.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/StolenGoods.java @@ -115,7 +115,7 @@ class StolenGoodsEffect extends OneShotEffect { class StolenGoodsCastFromExileEffect extends AsThoughEffectImpl { public StolenGoodsCastFromExileEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); staticText = "You may cast card from exile"; } diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/OrnateKanzashi.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/OrnateKanzashi.java index e18a544749..504916c8d7 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/OrnateKanzashi.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/OrnateKanzashi.java @@ -119,7 +119,7 @@ class OrnateKanzashiEffect extends OneShotEffect { class OrnateKanzashiCastFromExileEffect extends AsThoughEffectImpl { public OrnateKanzashiCastFromExileEffect(UUID cardId) { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); staticText = "You may play that card from exile this turn"; } diff --git a/Mage.Sets/src/mage/sets/coldsnap/HaakonStromgaldScourge.java b/Mage.Sets/src/mage/sets/coldsnap/HaakonStromgaldScourge.java index feb9190524..3905fb266a 100644 --- a/Mage.Sets/src/mage/sets/coldsnap/HaakonStromgaldScourge.java +++ b/Mage.Sets/src/mage/sets/coldsnap/HaakonStromgaldScourge.java @@ -90,7 +90,7 @@ public class HaakonStromgaldScourge extends CardImpl { class HaakonStromgaldScourgePlayEffect extends AsThoughEffectImpl { public HaakonStromgaldScourgePlayEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); staticText = "You may cast {this} from your graveyard"; } @@ -163,7 +163,7 @@ class HaakonStromgaldScourgePlayEffect2 extends ContinuousRuleModifyingEffectImp class HaakonPlayKnightsFromGraveyardEffect extends AsThoughEffectImpl { public HaakonPlayKnightsFromGraveyardEffect () { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit); staticText = "As long as {this} is on the battlefield, you may play Knight cards from your graveyard"; } diff --git a/Mage.Sets/src/mage/sets/commander/KaradorGhostChieftain.java b/Mage.Sets/src/mage/sets/commander/KaradorGhostChieftain.java index d466c65ca4..74aa3fba19 100644 --- a/Mage.Sets/src/mage/sets/commander/KaradorGhostChieftain.java +++ b/Mage.Sets/src/mage/sets/commander/KaradorGhostChieftain.java @@ -160,7 +160,7 @@ class KaradorGhostChieftainContinuousEffect extends ContinuousEffectImpl { class KaradorGhostChieftainCastFromGraveyardEffect extends AsThoughEffectImpl { KaradorGhostChieftainCastFromGraveyardEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); staticText = "You may cast one creature card from your graveyard"; } diff --git a/Mage.Sets/src/mage/sets/darkascension/FiendOfTheShadows.java b/Mage.Sets/src/mage/sets/darkascension/FiendOfTheShadows.java index 933b2050b9..42579afa73 100644 --- a/Mage.Sets/src/mage/sets/darkascension/FiendOfTheShadows.java +++ b/Mage.Sets/src/mage/sets/darkascension/FiendOfTheShadows.java @@ -95,7 +95,7 @@ class FiendOfTheShadowsEffect extends AsThoughEffectImpl { private final UUID exileId; public FiendOfTheShadowsEffect(UUID exileId) { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); this.exileId = exileId; staticText = "You may play that card for as long as it remains exiled"; } diff --git a/Mage.Sets/src/mage/sets/darkascension/Gravecrawler.java b/Mage.Sets/src/mage/sets/darkascension/Gravecrawler.java index 41db14c4d5..acaaa23dbb 100644 --- a/Mage.Sets/src/mage/sets/darkascension/Gravecrawler.java +++ b/Mage.Sets/src/mage/sets/darkascension/Gravecrawler.java @@ -87,7 +87,7 @@ class GravecrawlerPlayEffect extends AsThoughEffectImpl { } public GravecrawlerPlayEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); staticText = "You may cast {this} from your graveyard as long as you control a Zombie"; } diff --git a/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java b/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java index 61935aede9..2c0818761e 100644 --- a/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java +++ b/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java @@ -94,7 +94,7 @@ public class HavengulLich extends CardImpl { class HavengulLichPlayEffect extends AsThoughEffectImpl { public HavengulLichPlayEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); staticText = "You may cast target creature card in a graveyard this turn"; } diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/CommuneWithLava.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/CommuneWithLava.java index 1518ef2cc8..4487794cdf 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/CommuneWithLava.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/CommuneWithLava.java @@ -115,7 +115,7 @@ class CommuneWithLavaMayPlayEffect extends AsThoughEffectImpl { int castOnTurn = 0; public CommuneWithLavaMayPlayEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.Custom, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.Custom, Outcome.Benefit); this.staticText = "Until the end of your next turn, you may play that card."; } diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/HedonistsTrove.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/HedonistsTrove.java index ab7d60e272..4174deb76f 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/HedonistsTrove.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/HedonistsTrove.java @@ -118,7 +118,7 @@ class HedonistsTroveExileEffect extends OneShotEffect { class HedonistsTrovePlayLandEffect extends AsThoughEffectImpl { public HedonistsTrovePlayLandEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit); staticText = "You may play land cards exiled by {this}"; } @@ -157,7 +157,7 @@ class HedonistsTroveCastNonlandCardsEffect extends AsThoughEffectImpl { private UUID cardId; public HedonistsTroveCastNonlandCardsEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit); staticText = "You may cast nonland cards exiled with {this}. You can't cast more than one spell this way each turn"; } diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/IreShaman.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/IreShaman.java index 093bc8ae69..6f26e4f112 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/IreShaman.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/IreShaman.java @@ -125,7 +125,7 @@ class IreShamanExileEffect extends OneShotEffect { class IreShamanCastFromExileEffect extends AsThoughEffectImpl { public IreShamanCastFromExileEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); staticText = "You may play the card from exile"; } diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/RisenExecutioner.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/RisenExecutioner.java index a1b4f29bab..901c17b432 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/RisenExecutioner.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/RisenExecutioner.java @@ -100,7 +100,7 @@ public class RisenExecutioner extends CardImpl { class RisenExecutionerCastEffect extends AsThoughEffectImpl { RisenExecutionerCastEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); staticText = "You may cast {this} from your graveyard"; } diff --git a/Mage.Sets/src/mage/sets/fatereforged/MarangRiverProwler.java b/Mage.Sets/src/mage/sets/fatereforged/MarangRiverProwler.java index 5c4ddec9a4..3e87e84061 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/MarangRiverProwler.java +++ b/Mage.Sets/src/mage/sets/fatereforged/MarangRiverProwler.java @@ -92,7 +92,7 @@ class MarangRiverProwlerCastEffect extends AsThoughEffectImpl { } MarangRiverProwlerCastEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); staticText = "You may cast {this} from your graveyard as long as you control a black or green permanent"; } diff --git a/Mage.Sets/src/mage/sets/fatereforged/OutpostSiege.java b/Mage.Sets/src/mage/sets/fatereforged/OutpostSiege.java index 418d99d1e1..f49e7e15cc 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/OutpostSiege.java +++ b/Mage.Sets/src/mage/sets/fatereforged/OutpostSiege.java @@ -136,7 +136,7 @@ class OutpostSiegeExileEffect extends OneShotEffect { class CastFromNonHandZoneTargetEffect extends AsThoughEffectImpl { public CastFromNonHandZoneTargetEffect(Duration duration) { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, duration, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, duration, Outcome.Benefit); staticText = "until end of turn, you may play that card"; } diff --git a/Mage.Sets/src/mage/sets/gatecrash/NightveilSpecter.java b/Mage.Sets/src/mage/sets/gatecrash/NightveilSpecter.java index 25086caf89..3e5c8e6f90 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/NightveilSpecter.java +++ b/Mage.Sets/src/mage/sets/gatecrash/NightveilSpecter.java @@ -127,7 +127,7 @@ class NightveilSpecterExileEffect extends OneShotEffect { class NightveilSpecterEffect extends AsThoughEffectImpl { public NightveilSpecterEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); staticText = "You may play cards exiled with {this}"; } diff --git a/Mage.Sets/src/mage/sets/innistrad/SkaabRuinator.java b/Mage.Sets/src/mage/sets/innistrad/SkaabRuinator.java index d49ad5e7ed..067d091f72 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SkaabRuinator.java +++ b/Mage.Sets/src/mage/sets/innistrad/SkaabRuinator.java @@ -85,7 +85,7 @@ public class SkaabRuinator extends CardImpl { class SkaabRuinatorPlayEffect extends AsThoughEffectImpl { public SkaabRuinatorPlayEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfGame, Outcome.PutCreatureInPlay); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.PutCreatureInPlay); staticText = "You may cast {this} from your graveyard"; } diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/PropheticFlamespeaker.java b/Mage.Sets/src/mage/sets/journeyintonyx/PropheticFlamespeaker.java index 9d4da3d5a3..8a6a8ef222 100644 --- a/Mage.Sets/src/mage/sets/journeyintonyx/PropheticFlamespeaker.java +++ b/Mage.Sets/src/mage/sets/journeyintonyx/PropheticFlamespeaker.java @@ -122,7 +122,7 @@ class PropheticFlamespeakerExileEffect extends OneShotEffect { class PropheticFlamespeakerCastFromExileEffect extends AsThoughEffectImpl { public PropheticFlamespeakerCastFromExileEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); staticText = "You may play the card from exile"; } diff --git a/Mage.Sets/src/mage/sets/judgment/Spelljack.java b/Mage.Sets/src/mage/sets/judgment/Spelljack.java index 69b3746899..4c5f862cbe 100644 --- a/Mage.Sets/src/mage/sets/judgment/Spelljack.java +++ b/Mage.Sets/src/mage/sets/judgment/Spelljack.java @@ -118,7 +118,7 @@ class SpelljackEffect extends OneShotEffect { class SpelljackCastFromExileEffect extends AsThoughEffectImpl { SpelljackCastFromExileEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.Custom, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.Custom, Outcome.Benefit); staticText = "You may cast that card without paying its mana cost as long as it remains exiled"; } diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/KheruSpellsnatcher.java b/Mage.Sets/src/mage/sets/khansoftarkir/KheruSpellsnatcher.java index c0f15ac9e3..19cced0b3a 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/KheruSpellsnatcher.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/KheruSpellsnatcher.java @@ -131,7 +131,7 @@ class KheruSpellsnatcherEffect extends OneShotEffect { class KheruSpellsnatcherCastFromExileEffect extends AsThoughEffectImpl { KheruSpellsnatcherCastFromExileEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.Custom, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.Custom, Outcome.Benefit); staticText = "You may cast that card without paying its mana cost as long as it remains exiled"; } diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/NarsetEnlightenedMaster.java b/Mage.Sets/src/mage/sets/khansoftarkir/NarsetEnlightenedMaster.java index cd3ee2eee1..70d9517368 100644 --- a/Mage.Sets/src/mage/sets/khansoftarkir/NarsetEnlightenedMaster.java +++ b/Mage.Sets/src/mage/sets/khansoftarkir/NarsetEnlightenedMaster.java @@ -127,7 +127,7 @@ class NarsetEnlightenedMasterExileEffect extends OneShotEffect { class NarsetEnlightenedMasterCastFromExileEffect extends AsThoughEffectImpl { public NarsetEnlightenedMasterCastFromExileEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); staticText = "Until end of turn, you may cast noncreature cards exiled with {this} this turn without paying their mana costs"; } diff --git a/Mage.Sets/src/mage/sets/magic2014/ChandraPyromaster.java b/Mage.Sets/src/mage/sets/magic2014/ChandraPyromaster.java index 0323d02555..a9f736fb55 100644 --- a/Mage.Sets/src/mage/sets/magic2014/ChandraPyromaster.java +++ b/Mage.Sets/src/mage/sets/magic2014/ChandraPyromaster.java @@ -228,7 +228,7 @@ class ChandraPyromasterEffect2 extends OneShotEffect { class ChandraPyromasterCastFromExileEffect extends AsThoughEffectImpl { public ChandraPyromasterCastFromExileEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); staticText = "You may play the card from exile this turn"; } diff --git a/Mage.Sets/src/mage/sets/magic2015/ActOnImpulse.java b/Mage.Sets/src/mage/sets/magic2015/ActOnImpulse.java index 7779ef4b83..3034e346a4 100644 --- a/Mage.Sets/src/mage/sets/magic2015/ActOnImpulse.java +++ b/Mage.Sets/src/mage/sets/magic2015/ActOnImpulse.java @@ -119,7 +119,7 @@ class ActOnImpulseMayPlayExiledEffect extends AsThoughEffectImpl { public List cards = new ArrayList<>(); public ActOnImpulseMayPlayExiledEffect(List cards) { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); this.cards.addAll(cards); } diff --git a/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java b/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java index b5053cf16b..b9ca13546a 100644 --- a/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java +++ b/Mage.Sets/src/mage/sets/modernmasters2015/WorldheartPhoenix.java @@ -86,7 +86,7 @@ public class WorldheartPhoenix extends CardImpl { class WorldheartPhoenixPlayEffect extends AsThoughEffectImpl { public WorldheartPhoenixPlayEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); staticText = "You may cast {this} from your graveyard by paying {W}{U}{B}{R}{G} rather than paying its mana cost"; } diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PraetorsGrasp.java b/Mage.Sets/src/mage/sets/newphyrexia/PraetorsGrasp.java index 82ea8bc081..79671b6128 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/PraetorsGrasp.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/PraetorsGrasp.java @@ -121,7 +121,7 @@ class PraetorsGraspPlayEffect extends AsThoughEffectImpl { private UUID cardId; public PraetorsGraspPlayEffect(UUID cardId) { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); this.cardId = cardId; staticText = "You may look at and play that card for as long as it remains exiled"; } diff --git a/Mage.Sets/src/mage/sets/planarchaos/IntetTheDreamer.java b/Mage.Sets/src/mage/sets/planarchaos/IntetTheDreamer.java index f286cdf5b9..ea9a46de99 100644 --- a/Mage.Sets/src/mage/sets/planarchaos/IntetTheDreamer.java +++ b/Mage.Sets/src/mage/sets/planarchaos/IntetTheDreamer.java @@ -121,7 +121,7 @@ class IntetTheDreamerExileEffect extends OneShotEffect { class IntetTheDreamerEffect extends AsThoughEffectImpl { public IntetTheDreamerEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit); staticText = "You may play the card from exile without paying its mana cost for as long as {this} remains on the battlefield"; } diff --git a/Mage.Sets/src/mage/sets/ravnica/SinsOfThePast.java b/Mage.Sets/src/mage/sets/ravnica/SinsOfThePast.java index f9863b55a7..01743f1db5 100644 --- a/Mage.Sets/src/mage/sets/ravnica/SinsOfThePast.java +++ b/Mage.Sets/src/mage/sets/ravnica/SinsOfThePast.java @@ -110,7 +110,7 @@ class SinsOfThePastEffect extends OneShotEffect { class SinsOfThePastCastFromGraveyardEffect extends AsThoughEffectImpl { SinsOfThePastCastFromGraveyardEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfTurn, Outcome.PlayForFree); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.PlayForFree); } SinsOfThePastCastFromGraveyardEffect(final SinsOfThePastCastFromGraveyardEffect effect) { diff --git a/Mage.Sets/src/mage/sets/shadowmoor/KnacksawClique.java b/Mage.Sets/src/mage/sets/shadowmoor/KnacksawClique.java index 6679cc7a4a..24e5ea3e54 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/KnacksawClique.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/KnacksawClique.java @@ -128,7 +128,7 @@ class KnacksawCliqueCastFromExileEffect extends AsThoughEffectImpl { private final UUID exileId; public KnacksawCliqueCastFromExileEffect(UUID cardId, UUID exileId) { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); staticText = "Until end of turn, you may play that card"; this.cardId = cardId; this.exileId = exileId; diff --git a/Mage.Sets/src/mage/sets/theros/DaxosOfMeletis.java b/Mage.Sets/src/mage/sets/theros/DaxosOfMeletis.java index ee8929301d..f59829ce40 100644 --- a/Mage.Sets/src/mage/sets/theros/DaxosOfMeletis.java +++ b/Mage.Sets/src/mage/sets/theros/DaxosOfMeletis.java @@ -148,7 +148,7 @@ class DaxosOfMeletisCastFromExileEffect extends AsThoughEffectImpl { private UUID exileId; public DaxosOfMeletisCastFromExileEffect(UUID cardId, UUID exileId) { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); staticText = "Until end of turn, you may cast that card and you may spend mana as though it were mana of any color to cast it"; this.cardId = cardId; this.exileId = exileId; diff --git a/Mage.Sets/src/mage/sets/theros/PsychicIntrusion.java b/Mage.Sets/src/mage/sets/theros/PsychicIntrusion.java index 3ca67cd231..d2ae49b8cc 100644 --- a/Mage.Sets/src/mage/sets/theros/PsychicIntrusion.java +++ b/Mage.Sets/src/mage/sets/theros/PsychicIntrusion.java @@ -155,7 +155,7 @@ class PsychicIntrusionExileEffect extends OneShotEffect { class PsychicIntrusionCastFromExileEffect extends AsThoughEffectImpl { public PsychicIntrusionCastFromExileEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.Custom, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.Custom, Outcome.Benefit); staticText = "You may cast that card for as long as it remains exiled, and you may spend mana as though it were mana of any color to cast that spell"; } diff --git a/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java b/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java index e9f1a93b72..5ae1263948 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java +++ b/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java @@ -136,7 +136,7 @@ class GrinningTotemSearchAndExileEffect extends OneShotEffect { class GrinningTotemMayPlayEffect extends AsThoughEffectImpl { public GrinningTotemMayPlayEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.Custom, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.Custom, Outcome.Benefit); this.staticText = "Until the beginning of your next upkeep, you may play that card."; } diff --git a/Mage.Sets/src/mage/sets/vintagemasters/MindsDesire.java b/Mage.Sets/src/mage/sets/vintagemasters/MindsDesire.java index 2d9aeb91bb..0533cb5b64 100644 --- a/Mage.Sets/src/mage/sets/vintagemasters/MindsDesire.java +++ b/Mage.Sets/src/mage/sets/vintagemasters/MindsDesire.java @@ -114,7 +114,7 @@ class MindsDesireEffect extends OneShotEffect { class MindsDesireCastFromExileEffect extends AsThoughEffectImpl { MindsDesireCastFromExileEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); staticText = "you may play that card without paying its mana cost"; } diff --git a/Mage.Sets/src/mage/sets/worldwake/ThadaAdelAcquisitor.java b/Mage.Sets/src/mage/sets/worldwake/ThadaAdelAcquisitor.java index 75ef0f6be8..409950b8a7 100644 --- a/Mage.Sets/src/mage/sets/worldwake/ThadaAdelAcquisitor.java +++ b/Mage.Sets/src/mage/sets/worldwake/ThadaAdelAcquisitor.java @@ -127,7 +127,7 @@ class ThadaAdelAcquisitorEffect extends OneShotEffect { class ThadaAdelPlayFromExileEffect extends AsThoughEffectImpl { public ThadaAdelPlayFromExileEffect() { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfTurn, Outcome.Benefit); staticText = "You may play this card from exile"; } diff --git a/Mage/src/mage/abilities/PlayLandAbility.java b/Mage/src/mage/abilities/PlayLandAbility.java index 416bb45003..60a60797cc 100644 --- a/Mage/src/mage/abilities/PlayLandAbility.java +++ b/Mage/src/mage/abilities/PlayLandAbility.java @@ -30,9 +30,9 @@ package mage.abilities; import java.util.UUID; import mage.constants.AbilityType; +import mage.constants.AsThoughEffectType; import mage.constants.Zone; import mage.game.Game; -import mage.game.events.GameEvent; /** * @@ -52,7 +52,8 @@ public class PlayLandAbility extends ActivatedAbilityImpl { @Override public boolean canActivate(UUID playerId, Game game) { - if (!controlsAbility(playerId, game)) { + if (!controlsAbility(playerId, game) && + !game.getContinuousEffects().asThough(getSourceId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, playerId, game)) { return false; } //20091005 - 114.2a diff --git a/Mage/src/mage/abilities/SpellAbility.java b/Mage/src/mage/abilities/SpellAbility.java index 6deef056b0..2c2d9c0fa2 100644 --- a/Mage/src/mage/abilities/SpellAbility.java +++ b/Mage/src/mage/abilities/SpellAbility.java @@ -96,7 +96,8 @@ public class SpellAbility extends ActivatedAbilityImpl { return false; } // fix for Gitaxian Probe and casting opponent's spells - if (!controllerId.equals(playerId)) { + if (!game.getContinuousEffects().asThough(getSourceId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, playerId, game) + && !controllerId.equals(playerId)) { return false; } // Check if spell has no costs (not {0} mana costs), than it's not castable. E.g. for spells like Living End, that only can be cast by Suspend Ability. diff --git a/Mage/src/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java b/Mage/src/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java index 4a3ac3919a..0c68c6db67 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/PlayTheTopCardEffect.java @@ -52,7 +52,7 @@ public class PlayTheTopCardEffect extends AsThoughEffectImpl { } public PlayTheTopCardEffect(FilterCard filter) { - super(AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit); + super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit); this.filter = filter; staticText = "You may play the top card of your library if it's a " + filter.getMessage(); } diff --git a/Mage/src/mage/constants/AsThoughEffectType.java b/Mage/src/mage/constants/AsThoughEffectType.java index 66f09ee240..433fbd7c03 100644 --- a/Mage/src/mage/constants/AsThoughEffectType.java +++ b/Mage/src/mage/constants/AsThoughEffectType.java @@ -11,7 +11,7 @@ public enum AsThoughEffectType { BLOCK_SHADOW, BLOCK_DRAGON, BE_BLOCKED, - PLAY_FROM_NON_HAND_ZONE, + PLAY_FROM_NOT_OWN_HAND_ZONE, CAST_AS_INSTANT, ACTIVATE_AS_INSTANT, DAMAGE, diff --git a/Mage/src/mage/game/Revealed.java b/Mage/src/mage/game/Revealed.java index f7400ca874..af4b7cd320 100644 --- a/Mage/src/mage/game/Revealed.java +++ b/Mage/src/mage/game/Revealed.java @@ -55,6 +55,10 @@ public class Revealed extends HashMap implements Serializable, Co this.get(name).add(card); } + public void update(String name, Cards cards) { + this.put(name, cards.copy()); + } + public void add(String name, Cards cards) { if (this.containsKey(name)) { this.get(name).addAll(cards); diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index fe29574f39..d87e64e540 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -41,7 +41,6 @@ import java.util.Map.Entry; import java.util.Random; import java.util.Set; import java.util.UUID; - import mage.MageObject; import mage.Mana; import mage.abilities.Abilities; @@ -130,7 +129,6 @@ import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetDiscard; import mage.util.CardUtil; import mage.util.GameLog; - import org.apache.log4j.Logger; public abstract class PlayerImpl implements Player, Serializable { @@ -1097,10 +1095,9 @@ public abstract class PlayerImpl implements Player, Serializable { return true; } if (ability instanceof PlayLandAbility) { - Card card = hand.get(ability.getSourceId(), game); - if (card == null) { - card = game.getCard(ability.getSourceId()); - } + + + Card card = game.getCard(ability.getSourceId()); result = playLand(card, game); } else { if (!ability.canActivate(this.playerId, game)) { @@ -1214,7 +1211,7 @@ public abstract class PlayerImpl implements Player, Serializable { } } } - if (zone != Zone.BATTLEFIELD && game.getContinuousEffects().asThough(object.getId(), AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, this.getId(), game)) { + if (zone != Zone.BATTLEFIELD && game.getContinuousEffects().asThough(object.getId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, this.getId(), game)) { for (Ability ability : object.getAbilities()) { ability.setControllerId(this.getId()); if (ability instanceof ActivatedAbility && ability.getZone().match(Zone.HAND) @@ -1317,7 +1314,11 @@ public abstract class PlayerImpl implements Player, Serializable { @Override public void revealCards(String name, Cards cards, Game game, boolean postToLog) { - game.getState().getRevealed().add(name, cards); + if (postToLog) { + game.getState().getRevealed().add(name, cards); + } else { + game.getState().getRevealed().update(name, cards); + } if (postToLog && !game.isSimulation()) { StringBuilder sb = new StringBuilder(getLogName()).append(" reveals "); int current = 0, last = cards.size(); @@ -2409,7 +2410,7 @@ public abstract class PlayerImpl implements Player, Serializable { } } for (Card card : graveyard.getUniqueCards(game)) { - boolean asThoughtCast = game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, this.getId(), game); + boolean asThoughtCast = game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, this.getId(), game); for (ActivatedAbility ability : card.getAbilities().getActivatedAbilities(Zone.ALL)) { boolean possible = false; if (ability.getZone().match(Zone.GRAVEYARD)) { @@ -2431,7 +2432,7 @@ public abstract class PlayerImpl implements Player, Serializable { } for (ExileZone exile : game.getExile().getExileZones()) { for (Card card : exile.getCards(game)) { - if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, this.getId(), game)) { + if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, this.getId(), game)) { for (Ability ability : card.getAbilities()) { if (ability.getZone().match(Zone.HAND)) { ability.setControllerId(this.getId()); // controller must be set for case owner != caster @@ -2447,7 +2448,7 @@ public abstract class PlayerImpl implements Player, Serializable { } for (Cards cards : game.getState().getRevealed().values()) { for (Card card : cards.getCards(game)) { - if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, this.getId(), game)) { + if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, this.getId(), game)) { for (ActivatedAbility ability : card.getAbilities().getActivatedAbilities(Zone.HAND)) { if (ability instanceof SpellAbility || ability instanceof PlayLandAbility) { playable.add(ability);