forked from External/mage
Mass rename getSourceObjectZoneChangeCounter to getStackMomentSourceZCC, un-deprecate and change comment
This commit is contained in:
parent
f674034cdf
commit
60be7070d6
138 changed files with 188 additions and 203 deletions
|
|
@ -114,7 +114,7 @@ class AngelOfDestinyLoseEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
Set<UUID> playerSet = watcher.getPlayers(new MageObjectReference(
|
||||
source.getSourceId(), source.getSourceObjectZoneChangeCounter(), game
|
||||
source.getSourceId(), source.getStackMomentSourceZCC(), game
|
||||
));
|
||||
if (playerSet == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class AshioksErasureExileEffect extends OneShotEffect {
|
|||
|| spell == null) {
|
||||
return false;
|
||||
}
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
return controller.moveCardsToExile(spell, source, game, true, exileId, sourceObject.getIdName());
|
||||
}
|
||||
}
|
||||
|
|
@ -126,7 +126,7 @@ class AshioksErasureReplacementEffect extends ContinuousRuleModifyingEffectImpl
|
|||
|| card == null) {
|
||||
return false;
|
||||
}
|
||||
UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
|
||||
ExileZone exile = game.getExile().getExileZone(exileZone);
|
||||
if (exile == null) {
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class AuratouchedMageEffect extends OneShotEffect {
|
|||
Card aura = game.getCard(target.getFirstTarget());
|
||||
Permanent auratouchedMage = source.getSourcePermanentIfItStillExists(game);
|
||||
if (aura != null && auratouchedMage != null
|
||||
&& game.getState().getZoneChangeCounter(source.getSourceId()) == source.getSourceObjectZoneChangeCounter()) {
|
||||
&& game.getState().getZoneChangeCounter(source.getSourceId()) == source.getStackMomentSourceZCC()) {
|
||||
game.getState().setValue("attachTo:" + aura.getId(), auratouchedMage);
|
||||
if (controller.moveCards(aura, Zone.BATTLEFIELD, source, game)) {
|
||||
auratouchedMage.addAttachment(aura.getId(), source, game);
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class BagOfHoldingReturnCardsEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
ExileZone exileZone = game.getExile().getExileZone(
|
||||
CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter())
|
||||
CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC())
|
||||
);
|
||||
if (exileZone == null) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -121,11 +121,11 @@ class BeamsplitterMageTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
private boolean checkNotSource(Permanent permanent, Game game) {
|
||||
// workaround for zcc not being set before first intervening if check
|
||||
if (this.getSourceObjectZoneChangeCounter() == 0) {
|
||||
if (this.getStackMomentSourceZCC() == 0) {
|
||||
return !permanent.getId().equals(this.getSourceId());
|
||||
}
|
||||
return !permanent.getId().equals(this.getSourceId())
|
||||
|| permanent.getZoneChangeCounter(game) != this.getSourceObjectZoneChangeCounter();
|
||||
|| permanent.getZoneChangeCounter(game) != this.getStackMomentSourceZCC();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -18,13 +18,11 @@ import mage.constants.CardType;
|
|||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import static mage.filter.StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE;
|
||||
|
|
@ -87,7 +85,7 @@ class BishopOfBindingExileEffect extends OneShotEffect {
|
|||
// the target creature won't be exiled.
|
||||
if (permanent != null) {
|
||||
new ExileTargetEffect(
|
||||
CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), permanent.getIdName()
|
||||
CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC()), permanent.getIdName()
|
||||
).apply(game, source);
|
||||
game.addDelayedTriggeredAbility(new OnLeaveReturnExiledAbility(), source);
|
||||
return true;
|
||||
|
|
@ -101,7 +99,7 @@ enum BishopOfBindingValue implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, sourceAbility.getSourceId(), sourceAbility.getSourceObjectZoneChangeCounter()));
|
||||
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, sourceAbility.getSourceId(), sourceAbility.getStackMomentSourceZCC()));
|
||||
if (exileZone != null) {
|
||||
Card exiledCard = exileZone.getRandom(game);
|
||||
if (exiledCard != null) {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ enum BlazingEffigyCount implements DynamicValue {
|
|||
if (watcher == null) {
|
||||
return 3;
|
||||
}
|
||||
int effigyDamage = watcher.damageDoneTo(sourceAbility.getSourceId(), sourceAbility.getSourceObjectZoneChangeCounter() - 1, game);
|
||||
int effigyDamage = watcher.damageDoneTo(sourceAbility.getSourceId(), sourceAbility.getStackMomentSourceZCC() - 1, game);
|
||||
return CardUtil.overflowInc(3, effigyDamage);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,11 +74,11 @@ class BogardanPhoenixEffect extends OneShotEffect {
|
|||
if (permanent == null
|
||||
|| controller == null
|
||||
|| permanent.getZoneChangeCounter(game) + 1
|
||||
!= source.getSourceObjectZoneChangeCounter()) {
|
||||
!= source.getStackMomentSourceZCC()) {
|
||||
return false;
|
||||
}
|
||||
Card card = game.getCard(permanent.getId());
|
||||
if (card == null || card.getZoneChangeCounter(game) != source.getSourceObjectZoneChangeCounter()) {
|
||||
if (card == null || card.getZoneChangeCounter(game) != source.getStackMomentSourceZCC()) {
|
||||
return false;
|
||||
}
|
||||
if (permanent.getCounters(game).containsKey(CounterType.DEATH)) {
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class CemeteryGatekeeperEffect extends OneShotEffect {
|
|||
controller.choose(outcome, target, source, game);
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
String exileName = sourceObject == null ? null : sourceObject.getIdName();
|
||||
return controller.moveCardsToExile(card, source, game, true, exileId, exileName);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class CemeteryIlluminatorExileEffect extends OneShotEffect {
|
|||
controller.choose(outcome, target, source, game);
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
String exileName = sourceObject == null ? null : sourceObject.getIdName();
|
||||
return controller.moveCardsToExile(card, source, game, true, exileId, exileName);
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class CemeteryProtectorEffect extends OneShotEffect {
|
|||
controller.choose(outcome, target, source, game);
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
String exileName = sourceObject == null ? null : sourceObject.getIdName();
|
||||
return controller.moveCardsToExile(card, source, game, true, exileId, exileName);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class CemeteryProwlerExileEffect extends OneShotEffect {
|
|||
controller.choose(outcome, target, source, game);
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
String exileName = sourceObject == null ? null : sourceObject.getIdName();
|
||||
return controller.moveCardsToExile(card, source, game, true, exileId, exileName);
|
||||
|
|
|
|||
|
|
@ -141,14 +141,14 @@ class ChainerNightmareAdeptWatcher extends Watcher {
|
|||
return false;
|
||||
}
|
||||
MageObjectReference mor = new MageObjectReference(
|
||||
source.getSourceId(), source.getSourceObjectZoneChangeCounter(), game
|
||||
source.getSourceId(), source.getStackMomentSourceZCC(), game
|
||||
);
|
||||
return morMap.computeIfAbsent(mor, m -> new HashMap<>()).getOrDefault(playerId, 0) > 0;
|
||||
}
|
||||
|
||||
void addPlayable(Ability source, Game game) {
|
||||
MageObjectReference mor = new MageObjectReference(
|
||||
source.getSourceId(), source.getSourceObjectZoneChangeCounter(), game
|
||||
source.getSourceId(), source.getStackMomentSourceZCC(), game
|
||||
);
|
||||
morMap.computeIfAbsent(mor, m -> new HashMap<>())
|
||||
.compute(source.getControllerId(), CardUtil::setOrIncrementValue);
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class ChandraDressedToKillExile1Effect extends OneShotEffect {
|
|||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
String exileName = sourceObject == null ? null : sourceObject.getIdName();
|
||||
controller.moveCardsToExile(card, source, game, true, exileId, exileName);
|
||||
|
|
@ -135,7 +135,7 @@ class ChandraDressedToKillExile5Effect extends OneShotEffect {
|
|||
if (cards.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
String exileName = sourceObject == null ? null : sourceObject.getIdName();
|
||||
controller.moveCardsToExile(cards, source, game, true, exileId, exileName);
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class ClockworkBeetleEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
Effect effect = new RemoveCounterTargetEffect(CounterType.P1P1.createInstance());
|
||||
effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getSourceObjectZoneChangeCounter()));
|
||||
effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getStackMomentSourceZCC()));
|
||||
game.addDelayedTriggeredAbility(new AtTheEndOfCombatDelayedTriggeredAbility(effect), source);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class CorrosiveOozeEffect extends OneShotEffect {
|
|||
if (watcher == null) {
|
||||
return false;
|
||||
}
|
||||
MageObjectReference sourceMor = new MageObjectReference(source.getSourceId(), source.getSourceObjectZoneChangeCounter(), game);
|
||||
MageObjectReference sourceMor = new MageObjectReference(source.getSourceId(), source.getStackMomentSourceZCC(), game);
|
||||
List<Permanent> equipments = watcher.getEquipmentsToDestroy(sourceMor)
|
||||
.stream()
|
||||
.map(mor -> mor.getPermanent(game))
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class CustodyBattleUnlessPaysEffect extends OneShotEffect {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
if (source.getSourceObjectZoneChangeCounter() == game.getState().getZoneChangeCounter(source.getSourceId())
|
||||
if (source.getStackMomentSourceZCC() == game.getState().getZoneChangeCounter(source.getSourceId())
|
||||
&& game.getState().getZone(source.getSourceId()) == Zone.BATTLEFIELD) {
|
||||
ContinuousEffect effect = new GiveControlEffect();
|
||||
effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ class CyclopeanTombEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObjectReference mor = new MageObjectReference(source.getSourceId(), source.getSourceObjectZoneChangeCounter(), game);
|
||||
MageObjectReference mor = new MageObjectReference(source.getSourceId(), source.getStackMomentSourceZCC(), game);
|
||||
CyclopeanTombCounterWatcher watcher = game.getState().getWatcher(CyclopeanTombCounterWatcher.class);
|
||||
if (controller != null && watcher != null) {
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class DampingEngine extends CardImpl {
|
|||
return "dampingEngine_"
|
||||
+ playerId + "_"
|
||||
+ source.getSourceId() + "_"
|
||||
+ source.getSourceObjectZoneChangeCounter() + "_"
|
||||
+ source.getStackMomentSourceZCC() + "_"
|
||||
+ game.getTurnNum();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class DayOfTheDragonsEntersEffect extends OneShotEffect {
|
|||
Set<Card> toExile = new HashSet<>();
|
||||
toExile.addAll(game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game));
|
||||
if (!toExile.isEmpty()) {
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
controller.moveCardsToExile(toExile, source, game, true, exileId, sourceObject.getIdName());
|
||||
DragonToken2 token = new DragonToken2();
|
||||
token.putOntoBattlefield(toExile.size(), game, source, source.getControllerId());
|
||||
|
|
@ -110,7 +110,7 @@ class DayOfTheDragonsLeavesEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (controller != null) {
|
||||
int zoneChangeCounter = source.getSourceObjectZoneChangeCounter();
|
||||
int zoneChangeCounter = source.getStackMomentSourceZCC();
|
||||
if (zoneChangeCounter > 0 && !(sourceObject instanceof PermanentToken)) {
|
||||
zoneChangeCounter--;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class DayOfTheMoonEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
private static List<String> getOrSetValue(Game game, Ability source) {
|
||||
String key = "DayOfTheMoon_" + source.getControllerId() + '_' + source.getSourceObjectZoneChangeCounter();
|
||||
String key = "DayOfTheMoon_" + source.getControllerId() + '_' + source.getStackMomentSourceZCC();
|
||||
List<String> list = (List<String>) game.getState().getValue(key);
|
||||
if (list != null) {
|
||||
return list;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class DetentionSphereEntersEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import mage.constants.CardType;
|
|||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
|
|
@ -74,7 +73,7 @@ class DragonWhelpEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
ActivationInfo activationInfo = ActivationInfo.getInstance(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
ActivationInfo activationInfo = ActivationInfo.getInstance(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
activationInfo.addActivation(game);
|
||||
if (activationInfo.getActivationCounter() >= 4) {
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeSourceEffect());
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class DralnusPetEffect extends OneShotEffect {
|
|||
SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
|
||||
if (spellAbility != null
|
||||
&& spellAbility.getSourceId().equals(source.getSourceId())
|
||||
&& permanent.getZoneChangeCounter(game) == spellAbility.getSourceObjectZoneChangeCounter()) {
|
||||
&& permanent.getZoneChangeCounter(game) == spellAbility.getStackMomentSourceZCC()) {
|
||||
int cmc = 0;
|
||||
for (Cost cost : spellAbility.getCosts()) {
|
||||
if (cost instanceof DiscardCardCost && !((DiscardCardCost) cost).getCards().isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class DurkwoodTrackerEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent == null
|
||||
|| permanent.getZoneChangeCounter(game)
|
||||
!= source.getSourceObjectZoneChangeCounter()) {
|
||||
!= source.getStackMomentSourceZCC()) {
|
||||
return false;
|
||||
}
|
||||
Permanent targeted = game.getPermanent(source.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class EmberwildeDjinnEffect extends OneShotEffect {
|
|||
if (player.chooseUse(Outcome.GainControl, "Gain control of " + sourceObject.getLogName() + "?", source, game)) {
|
||||
if (cost.pay(source, game, source, player.getId(), false)) {
|
||||
ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, false, player.getId());
|
||||
effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getSourceObjectZoneChangeCounter()));
|
||||
effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getStackMomentSourceZCC()));
|
||||
game.addEffect(effect, source);
|
||||
player.resetStoredBookmark(game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class FaerieArtisansEffect extends OneShotEffect {
|
|||
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(null, CardType.ARTIFACT, false);
|
||||
effect.setTargetPointer(new FixedTarget(permanentToCopy, game));
|
||||
if (effect.apply(game, source)) {
|
||||
String oldTokens = (String) game.getState().getValue(source.getSourceId().toString() + source.getSourceObjectZoneChangeCounter());
|
||||
String oldTokens = (String) game.getState().getValue(source.getSourceId().toString() + source.getStackMomentSourceZCC());
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Permanent permanent : effect.getAddedPermanents()) {
|
||||
if (sb.length() > 0) {
|
||||
|
|
@ -85,7 +85,7 @@ class FaerieArtisansEffect extends OneShotEffect {
|
|||
}
|
||||
sb.append(permanent.getId());
|
||||
}
|
||||
game.getState().setValue(source.getSourceId().toString() + source.getSourceObjectZoneChangeCounter(), sb.toString());
|
||||
game.getState().setValue(source.getSourceId().toString() + source.getStackMomentSourceZCC(), sb.toString());
|
||||
|
||||
if (oldTokens != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class FarrelitePriestEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
ActivationInfo activationInfo = ActivationInfo.getInstance(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
ActivationInfo activationInfo = ActivationInfo.getInstance(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
activationInfo.addActivation(game);
|
||||
if (activationInfo.getActivationCounter() == 4) {
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeSourceEffect());
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class FuriousRiseEffect extends OneShotEffect {
|
|||
Card cardToExile = controller.getLibrary().getFromTop(game);
|
||||
|
||||
UUID exileId = CardUtil.getCardExileZoneId(game, source);
|
||||
controller.moveCardsToExile(cardToExile, source, game, true, exileId, mageObject.getIdName() + " (" + source.getSourceObjectZoneChangeCounter() + ")");
|
||||
controller.moveCardsToExile(cardToExile, source, game, true, exileId, mageObject.getIdName() + " (" + source.getStackMomentSourceZCC() + ")");
|
||||
Card cardToPlay = game.getCard(cardToExile.getId());
|
||||
|
||||
endPreviousEffect(game, source); // workaround for Furious Rise
|
||||
|
|
@ -90,7 +90,7 @@ class FuriousRiseEffect extends OneShotEffect {
|
|||
if (effect instanceof FuriousRisePlayEffect) {
|
||||
for (Ability ability : game.getContinuousEffects().getAsThoughEffectsAbility(effect)) {
|
||||
if (ability.getSourceId().equals(source.getSourceId())
|
||||
&& source.getSourceObjectZoneChangeCounter() == ability.getSourceObjectZoneChangeCounter()) {
|
||||
&& source.getStackMomentSourceZCC() == ability.getStackMomentSourceZCC()) {
|
||||
effect.discard();
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,13 +13,11 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -82,7 +80,7 @@ class GoToJailExileEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
game.getState().setValue(permanent.getId() + ChooseOpponentEffect.VALUE_KEY, controller.getId());
|
||||
new ExileTargetEffect(
|
||||
CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), permanent.getIdName()
|
||||
CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC()), permanent.getIdName()
|
||||
).apply(game, source);
|
||||
game.addDelayedTriggeredAbility(new OnLeaveReturnExiledAbility(), source);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ class GarthOneEyeEffect extends OneShotEffect {
|
|||
|
||||
static final String getKey(Ability source) {
|
||||
return source.getSourceId() + "_"
|
||||
+ source.getSourceObjectZoneChangeCounter() + "_"
|
||||
+ source.getStackMomentSourceZCC() + "_"
|
||||
+ source.getOriginalId() + "_garth";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class GhostwayEffect extends OneShotEffect {
|
|||
if (sourceObject != null && controller != null) {
|
||||
Set<Card> toExile = new HashSet<>();
|
||||
toExile.addAll(game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game));
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
controller.moveCardsToExile(toExile, source, game, true, exileId, sourceObject.getIdName());
|
||||
|
||||
Cards cardsToReturn = new CardsImpl();
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class GloriousProtectorEffect extends OneShotEffect {
|
|||
player.moveCardsToExile(
|
||||
new CardsImpl(target.getTargets()).getCards(game),
|
||||
source, game, true, CardUtil.getExileZoneId(
|
||||
game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()
|
||||
game, source.getSourceId(), source.getStackMomentSourceZCC()
|
||||
), sourceObject.getIdName()
|
||||
);
|
||||
game.addDelayedTriggeredAbility(new OnLeaveReturnExiledAbility(), source);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import mage.cards.Card;
|
|||
import mage.constants.*;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.DamagedEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
|
|
@ -152,7 +151,7 @@ class GontiExileEffect extends OneShotEffect {
|
|||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
UUID exileZoneId = CardUtil.getExileZoneId(game, controller.getId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileZoneId = CardUtil.getExileZoneId(game, controller.getId(), source.getStackMomentSourceZCC());
|
||||
String exileName = CardUtil.getSourceName(game, source) + " - " + controller.getName();
|
||||
if (controller.moveCardsToExile(card, source, game, false, exileZoneId, exileName)) {
|
||||
card.setFaceDown(true, game);
|
||||
|
|
|
|||
|
|
@ -135,11 +135,11 @@ class GorexTheTombshellReturnEffect extends OneShotEffect {
|
|||
// relative zcc depends on object zone (battlefield for attacks trigger, graveyard for dies)
|
||||
// so try both zcc offsets to find zone
|
||||
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(
|
||||
game, source.getSourceId(), source.getSourceObjectZoneChangeCounter() - 1
|
||||
game, source.getSourceId(), source.getStackMomentSourceZCC() - 1
|
||||
));
|
||||
if (exileZone == null || exileZone.isEmpty()) {
|
||||
exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(
|
||||
game, source.getSourceId(), source.getSourceObjectZoneChangeCounter() - 2
|
||||
game, source.getSourceId(), source.getStackMomentSourceZCC() - 2
|
||||
));
|
||||
if (exileZone == null || exileZone.isEmpty()) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class GrimoireThiefExileEffect extends OneShotEffect {
|
|||
card.setFaceDown(true, game);
|
||||
}
|
||||
UUID exileZoneId = CardUtil.getExileZoneId(game,
|
||||
source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
targetOpponent.moveCardsToExile(cards, source, game, false,
|
||||
exileZoneId, sourceObject.getIdName());
|
||||
for (Card card : cards) {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import mage.constants.CardType;
|
|||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||
import mage.game.Game;
|
||||
|
|
@ -152,7 +151,7 @@ class GrothamaAllDevouringDrawCardsEffect extends OneShotEffect {
|
|||
if (watcher == null) {
|
||||
return false;
|
||||
}
|
||||
Map<UUID, Integer> damageMap = watcher.getDamageMap(new MageObjectReference(source.getSourceId(), source.getSourceObjectZoneChangeCounter() - 1, game));
|
||||
Map<UUID, Integer> damageMap = watcher.getDamageMap(new MageObjectReference(source.getSourceId(), source.getStackMomentSourceZCC() - 1, game));
|
||||
for (UUID playerId : game.getPlayerList()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class HaktosTheUnscarredChooseEffect extends OneShotEffect {
|
|||
}
|
||||
int number = 2 + RandomUtil.nextInt(3);
|
||||
game.informPlayers(permanent.getLogName() + ": " + controller.getLogName() + " has chosen " + number + " at random");
|
||||
game.getState().setValue(permanent.getId() + "" + source.getSourceObjectZoneChangeCounter() + "_haktos_number", number);
|
||||
game.getState().setValue(permanent.getId() + "" + source.getStackMomentSourceZCC() + "_haktos_number", number);
|
||||
permanent.addInfo("chosen number", CardUtil.addToolTipMarkTags("Chosen number: " + number), game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class HaukensInsightExileEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
String exileName = sourceObject == null ? null : sourceObject.getIdName();
|
||||
card.setFaceDown(true, game);
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ class HopeOfGhirapurCombatDamageWatcher extends Watcher {
|
|||
MageObjectReference mor;
|
||||
if (stackObject instanceof StackAbility) {
|
||||
// This is neccessary because the source object was sacrificed as cost and the correct zone change counter for target calid check can only be get from stack
|
||||
mor = new MageObjectReference(objectId, ((StackAbility) stackObject).getSourceObjectZoneChangeCounter(), game);
|
||||
mor = new MageObjectReference(objectId, ((StackAbility) stackObject).getStackMomentSourceZCC(), game);
|
||||
} else {
|
||||
mor = new MageObjectReference(objectId, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class InfectiousRageReattachEffect extends OneShotEffect {
|
|||
if (controller == null || auraCard == null) {
|
||||
return false;
|
||||
}
|
||||
if (source.getSourceObjectZoneChangeCounter() != auraCard.getZoneChangeCounter(game)) {
|
||||
if (source.getStackMomentSourceZCC() != auraCard.getZoneChangeCounter(game)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class InitiatesOfTheEbonHandEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
ActivationInfo activationInfo = ActivationInfo.getInstance(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
ActivationInfo activationInfo = ActivationInfo.getInstance(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
activationInfo.addActivation(game);
|
||||
if (activationInfo.getActivationCounter() == 4) {
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeSourceEffect());
|
||||
|
|
|
|||
|
|
@ -99,8 +99,8 @@ class InkTreaderNephilimTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (permanent == null || !permanent.getId().equals(getSourceId())) {
|
||||
return false;
|
||||
}
|
||||
if (getSourceObjectZoneChangeCounter() != 0
|
||||
&& getSourceObjectZoneChangeCounter() != permanent.getZoneChangeCounter(game)) {
|
||||
if (getStackMomentSourceZCC() != 0
|
||||
&& getStackMomentSourceZCC() != permanent.getZoneChangeCounter(game)) {
|
||||
return false;
|
||||
}
|
||||
flag = true;
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ class IntellectDevourerReturnExiledCardEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (sourceObject != null && controller != null) {
|
||||
ExileZone exile = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()));
|
||||
ExileZone exile = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC()));
|
||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (exile != null && sourcePermanent != null) {
|
||||
controller.moveCards(exile, Zone.HAND, source, game);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
|
|
@ -78,7 +77,7 @@ class IxalansBindingReplacementEffect extends ContinuousRuleModifyingEffectImpl
|
|||
}
|
||||
Card card = spellAbility.getCharacteristics(game);
|
||||
if (sourcePermanent != null && card != null) {
|
||||
UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
if (exileZone != null) {
|
||||
ExileZone exile = game.getExile().getExileZone(exileZone);
|
||||
if (exile == null) {
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class JacobHaukenInspectorExileEffect extends OneShotEffect {
|
|||
controller.chooseTarget(outcome, controller.getHand(), target, source, game);
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
String exileName = sourceObject == null ? null : sourceObject.getIdName();
|
||||
card.setFaceDown(true, game);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class KarnLiberatedEffect extends OneShotEffect {
|
|||
}
|
||||
List<Card> keepExiled = new ArrayList<>();
|
||||
for (ExileZone zone : game.getExile().getExileZones()) {
|
||||
exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
if (zone.getId().equals(exileId)) {
|
||||
for (Card card : zone.getCards(game)) {
|
||||
if (!card.hasSubtype(SubType.AURA, game)
|
||||
|
|
@ -243,7 +243,7 @@ class KarnPlayerExileEffect extends OneShotEffect {
|
|||
TargetCardInHand target = new TargetCardInHand();
|
||||
if (target.canChoose(player.getId(), source, game)
|
||||
&& target.chooseTarget(Outcome.Exile, player.getId(), source, game)) {
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
return player.moveCardsToExile(new CardsImpl(target.getTargets()).getCards(game), source, game, true, exileId, sourceObject.getIdName());
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ class KayaSpiritsJusticeExileEffect extends OneShotEffect {
|
|||
controller.choose(outcome, target, source, game);
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
String exileName = sourceObject == null ? null : sourceObject.getIdName();
|
||||
return controller.moveCardsToExile(card, source, game, true, exileId, exileName);
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class KnowledgePoolExileThreeCardsEffect extends OneShotEffect {
|
|||
source,
|
||||
game,
|
||||
true,
|
||||
CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()),
|
||||
CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC()),
|
||||
sourceObject.getIdName() + " (" + sourceObject.getZoneChangeCounter(game) + ')'
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class KroxaTitanOfDeathsHungerEntersEffect extends OneShotEffect {
|
|||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
if (EscapeAbility.wasCastedWithEscape(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter())) {
|
||||
if (EscapeAbility.wasCastedWithEscape(game, source.getSourceId(), source.getStackMomentSourceZCC())) {
|
||||
return false;
|
||||
}
|
||||
return permanent.sacrifice(source, game);
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class LazavWearerOfFacesEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
ExileZone exile = game.getExile().getExileZone(exileId);
|
||||
if (exile == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class LidlessGazeEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
String exileName = sourceObject == null ? null : sourceObject.getIdName();
|
||||
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ class LifestreamsBlessingWatcher extends Watcher {
|
|||
.getWatcher(LifestreamsBlessingWatcher.class)
|
||||
.map
|
||||
.getOrDefault(new MageObjectReference(
|
||||
source.getSourceId(), source.getSourceObjectZoneChangeCounter(), game
|
||||
source.getSourceId(), source.getStackMomentSourceZCC(), game
|
||||
), 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ class LostInThoughtIgnoreEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
String key = source.getSourceId().toString() + source.getSourceObjectZoneChangeCounter() + LostInThought.keyString + game.getTurnNum() + ((ActivatedAbilityImpl) source).getActivatorId();
|
||||
String key = source.getSourceId().toString() + source.getStackMomentSourceZCC() + LostInThought.keyString + game.getTurnNum() + ((ActivatedAbilityImpl) source).getActivatorId();
|
||||
game.getState().setValue(key, true);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ enum LumberingBattlementValue implements DynamicValue {
|
|||
}
|
||||
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(
|
||||
game, sourceAbility.getSourceId(),
|
||||
sourceAbility.getSourceObjectZoneChangeCounter()
|
||||
sourceAbility.getStackMomentSourceZCC()
|
||||
));
|
||||
if (exileZone == null) {
|
||||
exileZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, sourceAbility));
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class MeriekeRiBeritDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
|||
@Override
|
||||
public boolean isInactive(Game game) {
|
||||
return getSourceObjectIfItStillExists(game) == null
|
||||
&& game.getLastKnownInformation(getSourceId(), Zone.BATTLEFIELD, getSourceObjectZoneChangeCounter()) == null;
|
||||
&& game.getLastKnownInformation(getSourceId(), Zone.BATTLEFIELD, getStackMomentSourceZCC()) == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -85,8 +85,8 @@ class MesmericFiendExileEffect extends OneShotEffect {
|
|||
if (controller.choose(Outcome.Exile, opponent.getHand(), target, source, game)) {
|
||||
Card card = opponent.getHand().get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
game.getState().setValue(source.getSourceId().toString() + source.getSourceObjectZoneChangeCounter(), exileId);
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
game.getState().setValue(source.getSourceId().toString() + source.getStackMomentSourceZCC(), exileId);
|
||||
controller.moveCardsToExile(card, source, game, true, exileId, sourcePermanent.getName());
|
||||
}
|
||||
}
|
||||
|
|
@ -118,7 +118,7 @@ class MesmericFiendLeaveEffect extends OneShotEffect {
|
|||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (controller != null
|
||||
&& sourceObject != null) {
|
||||
int zoneChangeMinusOne = source.getSourceObjectZoneChangeCounter() - 1;
|
||||
int zoneChangeMinusOne = source.getStackMomentSourceZCC() - 1;
|
||||
UUID exileId = (UUID) game.getState().getValue(source.getSourceId().toString() + zoneChangeMinusOne);
|
||||
if (exileId != null) {
|
||||
Cards cards = game.getExile().getExileZone(exileId);
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class MirrorOfLifeTrappingEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
|
||||
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
ExileZone exileZone = game.getExile().getExileZone(exileZoneId);
|
||||
|
||||
Cards toBattlefield = null;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class MoonringMirrorExileEffect extends OneShotEffect {
|
|||
Card card = controller.getLibrary().getFromTop(game);
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (card != null && sourceObject != null) {
|
||||
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
card.setFaceDown(true, game);
|
||||
controller.moveCardsToExile(card, source, game, false, exileZoneId, sourceObject.getIdName());
|
||||
card.setFaceDown(true, game);
|
||||
|
|
@ -110,7 +110,7 @@ class MoonringMirrorEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
|
||||
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
ExileZone exileZone = game.getExile().getExileZone(exileZoneId);
|
||||
|
||||
Cards cardsToHand = null;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class MournersShieldImprintEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Card card = game.getCard(this.getTargetPointer().getFirst(game, source));
|
||||
if (card != null) {
|
||||
controller.moveCardsToExile(card, source, game, true, CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), source.getSourceObject(game).getIdName());
|
||||
controller.moveCardsToExile(card, source, game, true, CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC()), source.getSourceObject(game).getIdName());
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent != null) {
|
||||
sourcePermanent.imprint(this.getTargetPointer().getFirst(game, source), game);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import mage.constants.CardType;
|
|||
import mage.constants.SubType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
|
|
@ -78,7 +77,7 @@ class NalathniDragonEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
ActivationInfo activationInfo = ActivationInfo.getInstance(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
ActivationInfo activationInfo = ActivationInfo.getInstance(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
activationInfo.addActivation(game);
|
||||
if (activationInfo.getActivationCounter() >= 4) {
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SacrificeSourceEffect());
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ enum OrvarTheAllFormCondition implements Condition {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Spell spell = (Spell) source.getEffects().get(0).getValue("spellCast");
|
||||
MageObjectReference mor;
|
||||
if (source.getSourceObjectZoneChangeCounter() == 0) {
|
||||
if (source.getStackMomentSourceZCC() == 0) {
|
||||
mor = new MageObjectReference(source.getSourceId(), game);
|
||||
} else {
|
||||
mor = new MageObjectReference(source);
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ class OutOfTimeReplacementEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Set<UUID> creatureIds = (Set<UUID>) game.getState().getValue("phasedOutCreatures"
|
||||
+ source.getId().toString());
|
||||
return source.getSourceObjectZoneChangeCounter() == game.getState().getZoneChangeCounter(source.getSourceId()) // blinked
|
||||
return source.getStackMomentSourceZCC() == game.getState().getZoneChangeCounter(source.getSourceId()) // blinked
|
||||
&& creatureIds != null
|
||||
&& creatureIds.contains(event.getTargetId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,13 +20,11 @@ import mage.constants.SubType;
|
|||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import static mage.filter.StaticFilters.FILTER_OPPONENTS_PERMANENT_CREATURE;
|
||||
|
|
@ -85,7 +83,7 @@ class PalaceJailerExileEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (sourceObject != null) {
|
||||
return new ExileTargetEffect(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), sourceObject.getIdName()).apply(game, source);
|
||||
return new ExileTargetEffect(CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC()), sourceObject.getIdName()).apply(game, source);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -140,7 +138,7 @@ class PalaceJailerReturnExiledPermanentsEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (sourceObject != null && controller != null) {
|
||||
UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
if (exileZone != null) {
|
||||
ExileZone exile = game.getExile().getExileZone(exileZone);
|
||||
if (exile != null) {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class PhlageTitanOfFiresFuryEffect extends OneShotEffect {
|
|||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
if (EscapeAbility.wasCastedWithEscape(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter())) {
|
||||
if (EscapeAbility.wasCastedWithEscape(game, source.getSourceId(), source.getStackMomentSourceZCC())) {
|
||||
return false;
|
||||
}
|
||||
return permanent.sacrifice(source, game);
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class PlagueReaverDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
|||
|
||||
PlagueReaverDelayedTriggeredAbility(UUID playerId, Ability source) {
|
||||
super(new PlagueReaverReturnEffect(playerId).setTargetPointer(
|
||||
new FixedTarget(source.getSourceId(), source.getSourceObjectZoneChangeCounter() + 1)
|
||||
new FixedTarget(source.getSourceId(), source.getStackMomentSourceZCC() + 1)
|
||||
), Duration.Custom, true, false);
|
||||
this.playerId = playerId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class PolukranosUnchainedEffect extends OneShotEffect {
|
|||
int counters = 12;
|
||||
if (!(spellAbility instanceof EscapeAbility)
|
||||
|| !spellAbility.getSourceId().equals(source.getSourceId())
|
||||
|| permanent.getZoneChangeCounter(game) != spellAbility.getSourceObjectZoneChangeCounter()) {
|
||||
|| permanent.getZoneChangeCounter(game) != spellAbility.getStackMomentSourceZCC()) {
|
||||
counters = 6;
|
||||
}
|
||||
List<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects");
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class PuppetMasterEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
card = game.getCard(source.getSourceId());
|
||||
if (card == null || card.getZoneChangeCounter(game) != source.getSourceObjectZoneChangeCounter() + 1) {
|
||||
if (card == null || card.getZoneChangeCounter(game) != source.getStackMomentSourceZCC() + 1) {
|
||||
return false;
|
||||
}
|
||||
Cost cost = new ManaCostsImpl<>("{U}{U}{U}");
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ class RalLeylineProdigyMinusEightEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
Set<Card> cards = player.getLibrary().getTopCards(game, 8);
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
player.moveCardsToExile(cards, source, game, true, exileId, sourceObject.getIdName());
|
||||
for (Card card : cards) {
|
||||
if (game.getState().getZone(card.getId()) == Zone.EXILED) {
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ class SalvationSwanTargetEffect extends OneShotEffect {
|
|||
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect), source);
|
||||
|
||||
// move exiled cards to shared zone for better UX
|
||||
String exileKey = SalvationSwan.VALUE_PREFIX + "_" + source.getSourceId() + "_" + source.getSourceObjectZoneChangeCounter();
|
||||
String exileKey = SalvationSwan.VALUE_PREFIX + "_" + source.getSourceId() + "_" + source.getStackMomentSourceZCC();
|
||||
ExileZone sharedExileZone = game.getExile().createZone(
|
||||
CardUtil.getExileZoneId(exileKey, game),
|
||||
sourceObject.getIdName()
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ class ServantOfTheScaleEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent sourcePermanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
|
||||
if (sourcePermanent != null && controller != null
|
||||
&& (sourcePermanent.getZoneChangeCounter(game) == source.getSourceObjectZoneChangeCounter() // Token
|
||||
|| sourcePermanent.getZoneChangeCounter(game) + 1 == source.getSourceObjectZoneChangeCounter())) { // PermanentCard
|
||||
&& (sourcePermanent.getZoneChangeCounter(game) == source.getStackMomentSourceZCC() // Token
|
||||
|| sourcePermanent.getZoneChangeCounter(game) + 1 == source.getStackMomentSourceZCC())) { // PermanentCard
|
||||
int amount = sourcePermanent.getCounters(game).getCount(CounterType.P1P1);
|
||||
if (amount > 0) {
|
||||
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(amount));
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class ShyftEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Effect effect = new BecomesColorOrColorsTargetEffect(Duration.Custom);
|
||||
effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getSourceObjectZoneChangeCounter()));
|
||||
effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getStackMomentSourceZCC()));
|
||||
return effect.apply(game, source);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class SinisterConciergeEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (controller == null || card == null
|
||||
|| card.getZoneChangeCounter(game) != source.getSourceObjectZoneChangeCounter()
|
||||
|| card.getZoneChangeCounter(game) != source.getStackMomentSourceZCC()
|
||||
|| !Zone.GRAVEYARD.match(game.getState().getZone(card.getId()))) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,6 +102,6 @@ class SkyclaveShadeEffect extends AsThoughEffectImpl {
|
|||
Card card = game.getCard(source.getSourceId());
|
||||
return card != null
|
||||
&& game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD
|
||||
&& source.getSourceObjectZoneChangeCounter() == card.getZoneChangeCounter(game);
|
||||
&& source.getStackMomentSourceZCC() == card.getZoneChangeCounter(game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class SkyshipWeatherlightEffect extends SearchEffect {
|
|||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (sourceObject != null && controller != null) {
|
||||
if (controller.searchLibrary(target, source, game)) {
|
||||
UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
if (!target.getTargets().isEmpty()) {
|
||||
for (UUID cardID : target.getTargets()) {
|
||||
Card card = controller.getLibrary().getCard(cardID, game);
|
||||
|
|
@ -125,7 +125,7 @@ class SkyshipWeatherlightEffect2 extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (sourceObject != null && controller != null) {
|
||||
ExileZone exZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()));
|
||||
ExileZone exZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC()));
|
||||
if (exZone != null) {
|
||||
controller.moveCards(exZone.getRandom(game), Zone.HAND, source, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class SkywayRobberCastForFreeEffect extends OneShotEffect {
|
|||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
String exileZoneName = CardUtil.getObjectZoneString(CardUtil.SOURCE_EXILE_ZONE_TEXT, source.getSourceId(), game, source.getSourceObjectZoneChangeCounter()-1, false);
|
||||
String exileZoneName = CardUtil.getObjectZoneString(CardUtil.SOURCE_EXILE_ZONE_TEXT, source.getSourceId(), game, source.getStackMomentSourceZCC()-1, false);
|
||||
UUID exileId = CardUtil.getExileZoneId(exileZoneName, game);
|
||||
ExileZone exileZone = game.getExile().getExileZone(exileId);
|
||||
if (exileZone == null) {
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class SoulgorgerOrggLoseLifeEffect extends OneShotEffect {
|
|||
if (player.getLife() > 1) {
|
||||
lifeValue = player.getLife() - 1;
|
||||
}
|
||||
game.getState().setValue(source.getSourceId().toString() + source.getControllerId().toString() + source.getSourceObjectZoneChangeCounter() + "_lifeValue", lifeValue);
|
||||
game.getState().setValue(source.getSourceId().toString() + source.getControllerId().toString() + source.getStackMomentSourceZCC() + "_lifeValue", lifeValue);
|
||||
if (lifeValue > 0) {
|
||||
player.loseLife(lifeValue, game, source, false);
|
||||
}
|
||||
|
|
@ -103,7 +103,7 @@ class SoulgorgerOrggGainLifeEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Object obj = game.getState().getValue(source.getSourceId().toString() + source.getControllerId().toString() + (source.getSourceObjectZoneChangeCounter() - 1) + "_lifeValue");
|
||||
Object obj = game.getState().getValue(source.getSourceId().toString() + source.getControllerId().toString() + (source.getStackMomentSourceZCC() - 1) + "_lifeValue");
|
||||
if (!(obj instanceof Integer)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class SpellQuellerEntersEffect extends OneShotEffect {
|
|||
if (controller != null && sourceObject != null) {
|
||||
Spell spell = game.getStack().getSpell(getTargetPointer().getFirst(game, source));
|
||||
if (spell != null) {
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
return controller.moveCardsToExile(spell, source, game, true, exileId, sourceObject.getIdName());
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class SpellweaverHelixImprintEffect extends OneShotEffect {
|
|||
for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
controller.moveCardsToExile(card, source, game, true, CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), source.getSourceObject(game).getIdName());
|
||||
controller.moveCardsToExile(card, source, game, true, CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC()), source.getSourceObject(game).getIdName());
|
||||
if (sourcePermanent != null) {
|
||||
sourcePermanent.imprint(targetId, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class SynodSanctumEffect extends OneShotEffect {
|
|||
if (getTargetPointer().getFirst(game, source) != null) {
|
||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (permanent != null) {
|
||||
UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
if (exileZone != null) {
|
||||
controller.moveCardToExileWithInfo(permanent, exileZone, sourceObject.getIdName(), source, game, Zone.BATTLEFIELD, true);
|
||||
}
|
||||
|
|
@ -113,7 +113,7 @@ class SynodSanctumEffect2 extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
ExileZone exileZone = game.getExile().getExileZone(exileId);
|
||||
if (exileZone == null) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class TalionTheKindlyLordEffect extends OneShotEffect {
|
|||
}
|
||||
int numberChoice = controller.getAmount(1, 10, "Choose a number.", source, game);
|
||||
game.getState().setValue("chosenNumber_" + source.getSourceId()
|
||||
+ '_' + source.getSourceObjectZoneChangeCounter(), numberChoice);
|
||||
+ '_' + source.getStackMomentSourceZCC(), numberChoice);
|
||||
Permanent permanent = game.getPermanentEntering(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
permanent.addInfo("chosen players", "<font color = 'blue'>Chosen Number: " + numberChoice + "</font>", game);
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class TheAesirEscapeValhallaTwoEffect extends OneShotEffect {
|
|||
if (controller == null || sourceObject == null) {
|
||||
return false;
|
||||
}
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
ExileZone exileZone = game.getExile().getExileZone(exileId);
|
||||
if (exileZone == null || exileZone.isEmpty()) {
|
||||
return false;
|
||||
|
|
@ -154,7 +154,7 @@ class TheAesirEscapeValhallaThreeEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
ExileZone exileZone = game.getExile().getExileZone(exileId);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class TheCreationOfAvacynTwoEffect extends OneShotEffect {
|
|||
// ability (likely because the triggered ability was copied or the ability triggered a second time), the second
|
||||
// chapter ability will turn all of the exiled cards face up. If at least one of them is a creature card, you'll
|
||||
// lose life equal to the combined mana value of all the exiled cards.
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
ExileZone exileZone = game.getExile().getExileZone(exileId);
|
||||
if (exileZone == null || exileZone.isEmpty()) {
|
||||
return false;
|
||||
|
|
@ -163,7 +163,7 @@ class TheCreationOfAvacynThreeEffect extends OneShotEffect {
|
|||
// when the third chapter ability resolves, if at least one of the exiled cards is a creature card, you may choose
|
||||
// to put all or none of the exiled cards that are permanent cards onto the battlefield. Regardless of what you
|
||||
// choose, any remaining exiled cards will be put into their owners' hands.
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
ExileZone exileZone = game.getExile().getExileZone(exileId);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null || exileZone == null || exileZone.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ import mage.constants.CardType;
|
|||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.TheLocustGodInsectToken;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
|
@ -83,7 +82,7 @@ class TheLocustGodEffect extends OneShotEffect {
|
|||
// Create delayed triggered ability
|
||||
Effect effect = new ReturnToHandTargetEffect();
|
||||
effect.setText("return {this} to its owner's hand");
|
||||
effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getSourceObjectZoneChangeCounter()));
|
||||
effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getStackMomentSourceZCC()));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
|
||||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class TheScarabGodEffectDieEffect extends OneShotEffect {
|
|||
// Create delayed triggered ability
|
||||
Effect effect = new ReturnToHandTargetEffect();
|
||||
effect.setText("return {this} to its owner's hand");
|
||||
effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getSourceObjectZoneChangeCounter()));
|
||||
effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getStackMomentSourceZCC()));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
|
||||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -24,13 +24,11 @@ import mage.constants.Outcome;
|
|||
import mage.constants.SuperType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import static mage.filter.StaticFilters.FILTER_ANOTHER_TARGET_CREATURE;
|
||||
|
|
@ -135,7 +133,7 @@ class TheScorpionGodEffect extends OneShotEffect {
|
|||
// Create delayed triggered ability
|
||||
Effect effect = new ReturnToHandTargetEffect();
|
||||
effect.setText("return {this} to its owner's hand");
|
||||
effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getSourceObjectZoneChangeCounter()));
|
||||
effect.setTargetPointer(new FixedTarget(source.getSourceId(), source.getStackMomentSourceZCC()));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
|
||||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -152,14 +152,14 @@ class TheTombOfAclazotzWatcher extends Watcher {
|
|||
return false;
|
||||
}
|
||||
MageObjectReference mor = new MageObjectReference(
|
||||
source.getSourceId(), source.getSourceObjectZoneChangeCounter(), game
|
||||
source.getSourceId(), source.getStackMomentSourceZCC(), game
|
||||
);
|
||||
return morMap.computeIfAbsent(mor, m -> new HashMap<>()).getOrDefault(playerId, 0) > 0;
|
||||
}
|
||||
|
||||
void addPlayable(Ability source, Game game) {
|
||||
MageObjectReference mor = new MageObjectReference(
|
||||
source.getSourceId(), source.getSourceObjectZoneChangeCounter(), game
|
||||
source.getSourceId(), source.getStackMomentSourceZCC(), game
|
||||
);
|
||||
morMap.computeIfAbsent(mor, m -> new HashMap<>())
|
||||
.compute(source.getControllerId(), CardUtil::setOrIncrementValue);
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class TheToymakersTrapEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
private static List<String> getOrSetValue(Game game, Ability source) {
|
||||
String key = "chosenNumbers_" + source.getControllerId() + '_' + source.getSourceObjectZoneChangeCounter();
|
||||
String key = "chosenNumbers_" + source.getControllerId() + '_' + source.getStackMomentSourceZCC();
|
||||
List<String> list = (List<String>) game.getState().getValue(key);
|
||||
if (list != null) {
|
||||
return list;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class TidehollowScullerExileEffect extends OneShotEffect {
|
|||
true,
|
||||
CardUtil.getExileZoneId(game,
|
||||
source.getSourceId(),
|
||||
source.getSourceObjectZoneChangeCounter()),
|
||||
source.getStackMomentSourceZCC()),
|
||||
"Tidehollow Sculler");
|
||||
}
|
||||
}
|
||||
|
|
@ -124,8 +124,8 @@ class TidehollowScullerLeaveEffect extends OneShotEffect {
|
|||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (controller != null && sourceObject != null) {
|
||||
int zoneChangeCounter = (sourceObject instanceof PermanentToken)
|
||||
? source.getSourceObjectZoneChangeCounter()
|
||||
: source.getSourceObjectZoneChangeCounter() - 1;
|
||||
? source.getStackMomentSourceZCC()
|
||||
: source.getStackMomentSourceZCC() - 1;
|
||||
ExileZone exZone = game.getExile().getExileZone(
|
||||
CardUtil.getExileZoneId(game, source.getSourceId(), zoneChangeCounter));
|
||||
if (exZone != null) {
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class TizerusChargerEffect extends OneShotEffect {
|
|||
SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
|
||||
if (!(spellAbility instanceof EscapeAbility)
|
||||
|| !spellAbility.getSourceId().equals(source.getSourceId())
|
||||
|| permanent.getZoneChangeCounter(game) != spellAbility.getSourceObjectZoneChangeCounter()) {
|
||||
|| permanent.getZoneChangeCounter(game) != spellAbility.getStackMomentSourceZCC()) {
|
||||
return false;
|
||||
}
|
||||
List<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects");
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class ToluzCleverConductorEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter() - 1));
|
||||
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC() - 1));
|
||||
return player != null
|
||||
&& exileZone != null
|
||||
&& !exileZone.isEmpty()
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class TriumphOfSaintKatherineEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
Cards cards = new CardsImpl();
|
||||
if (card.getZoneChangeCounter(game) == source.getSourceObjectZoneChangeCounter()) {
|
||||
if (card.getZoneChangeCounter(game) == source.getStackMomentSourceZCC()) {
|
||||
cards.add(card);
|
||||
}
|
||||
cards.addAllCards(player.getLibrary().getTopCards(game, 6));
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class UginTheIneffableEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
// exile and look
|
||||
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
|
||||
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC());
|
||||
if (player.moveCardsToExile(card, source, game, false, exileZoneId, sourceObject.getIdName() + " (" + player.getName() + ")")) {
|
||||
card.turnFaceDown(source, game, source.getControllerId());
|
||||
player.lookAtCards(player.getName() + " - " + card.getIdName() + " - " + CardUtil.sdf.format(System.currentTimeMillis()), card, game);
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class UnderworldSentinelEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
ExileZone exileZone = game.getExile().getExileZone(
|
||||
CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter())
|
||||
CardUtil.getExileZoneId(game, source.getSourceId(), source.getStackMomentSourceZCC())
|
||||
);
|
||||
return exileZone != null && controller.moveCards(exileZone, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class UroTitanOfNaturesWrathEffect extends OneShotEffect {
|
|||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
if (EscapeAbility.wasCastedWithEscape(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter())) {
|
||||
if (EscapeAbility.wasCastedWithEscape(game, source.getSourceId(), source.getStackMomentSourceZCC())) {
|
||||
return false;
|
||||
}
|
||||
return permanent.sacrifice(source, game);
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class ValakutExplorationExileEffect extends OneShotEffect {
|
|||
}
|
||||
controller.moveCardsToExile(
|
||||
card, source, game, true, CardUtil.getExileZoneId(
|
||||
game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()
|
||||
game, source.getSourceId(), source.getStackMomentSourceZCC()
|
||||
), sourcePermanent.getIdName()
|
||||
);
|
||||
ContinuousEffect effect = new PlayFromNotOwnHandZoneTargetEffect(Duration.EndOfGame);
|
||||
|
|
@ -130,7 +130,7 @@ class ValakutExplorationDamageEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
ExileZone exileZone = game.getExile().getExileZone(CardUtil.getExileZoneId(
|
||||
game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()
|
||||
game, source.getSourceId(), source.getStackMomentSourceZCC()
|
||||
));
|
||||
if (exileZone == null) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ class VolrathsCurseIgnoreEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
String key = source.getSourceId().toString() + source.getSourceObjectZoneChangeCounter() + VolrathsCurse.keyString + game.getTurnNum() + ((ActivatedAbilityImpl) source).getActivatorId();
|
||||
String key = source.getSourceId().toString() + source.getStackMomentSourceZCC() + VolrathsCurse.keyString + game.getTurnNum() + ((ActivatedAbilityImpl) source).getActivatorId();
|
||||
game.getState().setValue(key, true);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
|
|
@ -70,7 +69,7 @@ class WallOfDeceitEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent != null
|
||||
&& source.getSourceObjectZoneChangeCounter() == sourcePermanent.getZoneChangeCounter(game) // in case source was blinked after ability was set to stack
|
||||
&& source.getStackMomentSourceZCC() == sourcePermanent.getZoneChangeCounter(game) // in case source was blinked after ability was set to stack
|
||||
&& !sourcePermanent.isFaceDown(game)) {
|
||||
sourcePermanent.setFaceDown(true, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ class WhispersteelDaggerWatcher extends Watcher {
|
|||
return false;
|
||||
}
|
||||
MageObjectReference mor = new MageObjectReference(
|
||||
source.getSourceId(), source.getSourceObjectZoneChangeCounter(), game
|
||||
source.getSourceId(), source.getStackMomentSourceZCC(), game
|
||||
);
|
||||
if (!morMap.containsKey(mor)) {
|
||||
return false;
|
||||
|
|
@ -188,7 +188,7 @@ class WhispersteelDaggerWatcher extends Watcher {
|
|||
|
||||
void addPlayable(Ability source, UUID ownerId, Game game) {
|
||||
MageObjectReference mor = new MageObjectReference(
|
||||
source.getSourceId(), source.getSourceObjectZoneChangeCounter(), game
|
||||
source.getSourceId(), source.getStackMomentSourceZCC(), game
|
||||
);
|
||||
morMap.computeIfAbsent(mor, m -> new HashMap<>())
|
||||
.computeIfAbsent(ownerId, m -> new HashMap<>())
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class WoebringerDemonEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
||||
if (sourceObject != null && sourceObject.getZoneChangeCounter(game) == source.getSourceObjectZoneChangeCounter()) {
|
||||
if (sourceObject != null && sourceObject.getZoneChangeCounter(game) == source.getStackMomentSourceZCC()) {
|
||||
sourceObject.sacrifice(source, game);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue