Added Sen Triplets (Alara Reborn = 100%).

This commit is contained in:
LevelX2 2015-06-23 16:15:14 +02:00
parent 5b02b5b32c
commit 2547753dcb
40 changed files with 249 additions and 51 deletions

View file

@ -69,7 +69,7 @@ public class Cards extends javax.swing.JPanel {
private final Map<UUID, MageCard> 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);

View file

@ -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());
}
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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.";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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}";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -119,7 +119,7 @@ class ActOnImpulseMayPlayExiledEffect extends AsThoughEffectImpl {
public List<UUID> cards = new ArrayList<>();
public ActOnImpulseMayPlayExiledEffect(List<UUID> 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);
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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) {

View file

@ -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;

View file

@ -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;

View file

@ -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";
}

View file

@ -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.";
}

View file

@ -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";
}

View file

@ -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";
}

View file

@ -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

View file

@ -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.

View file

@ -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();
}

View file

@ -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,

View file

@ -55,6 +55,10 @@ public class Revealed extends HashMap<String, Cards> 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);

View file

@ -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);