* Arashin Sovereign - Fixed that the player had no option to let the card go to the graveyard.

This commit is contained in:
LevelX2 2015-04-03 16:28:40 +02:00
parent 5dc6f1a7c4
commit dbb9be6703
173 changed files with 873 additions and 506 deletions

View file

@ -101,7 +101,7 @@ class SlaveOfBolasEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -63,8 +63,8 @@ public class DeadeyeNavigator extends CardImpl {
this.addAbility(SoulbondAbility.getInstance());
// As long as Deadeye Navigator is paired with another creature, each of those creatures has "{1}{U}: Exile this creature, then return it to the battlefield under your control."
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileSourceEffect(Zone.BATTLEFIELD), new ManaCostsImpl("{1}{U}"));
ability.addEffect(new ReturnToBattlefieldUnderYourControlSourceEffect(Zone.EXILED));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileSourceEffect(true), new ManaCostsImpl("{1}{U}"));
ability.addEffect(new ReturnToBattlefieldUnderYourControlSourceEffect());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityPairedEffect(ability, ruleText)));
}

View file

@ -58,7 +58,6 @@ public class HarvesterOfSouls extends CardImpl {
this.expansionSetCode = "AVR";
this.subtype.add("Demon");
this.color.setBlack(true);
this.power = new MageInt(5);
this.toughness = new MageInt(5);

View file

@ -97,7 +97,7 @@ class ThatcherRevoltEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
return true;

View file

@ -125,7 +125,7 @@ class GoryosVengeanceEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;

View file

@ -94,7 +94,7 @@ class KaijinOfTheVanishingTouchEffect extends OneShotEffect {
AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new ReturnToHandTargetEffect());
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId()));
game.addDelayedTriggeredAbility(delayedAbility);
return true;

View file

@ -151,7 +151,7 @@ class ShireiShizosCaretakerEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(card.getId()));
game.addDelayedTriggeredAbility(delayedAbility);
return true;

View file

@ -115,7 +115,7 @@ class FelhideSpiritbinderEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;

View file

@ -95,7 +95,7 @@ class SearingBloodEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new SearingBloodDelayedTriggeredAbility(source.getFirstTarget());
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return new DamageTargetEffect(2).apply(game, source);

View file

@ -103,7 +103,7 @@ class HikariTwilightGuardianEffect extends OneShotEffect {
new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -107,7 +107,7 @@ class InameLifeAspectEffect extends OneShotEffect {
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && sourceObject != null) {
if (controller.chooseUse(outcome, "Exile " + sourceObject.getLogName() + " to return Spirit cards?", game)) {
new ExileSourceEffect(Zone.GRAVEYARD).apply(game, source);
new ExileSourceEffect().apply(game, source);
return new ReturnToHandTargetEffect().apply(game, source);
}
return true;

View file

@ -103,7 +103,7 @@ private class JunkyoBellSacrificeEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -131,7 +131,7 @@ class KikiJikiMirrorBreakerEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -99,7 +99,7 @@ class OtherworldlyJourneyEffect extends OneShotEffect {
new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, "return that card to the battlefield under its owner's control with a +1/+1 counter on it"));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
AddCountersTargetEffect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance());
effect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
delayedAbility.addEffect(effect);

View file

@ -141,7 +141,7 @@ class SosukeSonOfSeshiroEffect extends OneShotEffect {
AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect());
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId()));
game.addDelayedTriggeredAbility(delayedAbility);
return true;

View file

@ -70,7 +70,7 @@ public class TatsumasaTheDragonsFang extends CardImpl {
// {6}, Exile Tatsumasa, the Dragon's Fang: Put a 5/5 blue Dragon Spirit creature token with flying onto the battlefield. Return Tatsumasa to the battlefield under its owner's control when that token dies.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TatsumaTheDragonsFangEffect(), new GenericManaCost(6));
ability.addCost(new ExileSourceCost());
ability.addCost(new ExileSourceCost(true));
this.addAbility(ability);
// Equip {3}
@ -111,7 +111,7 @@ class TatsumaTheDragonsFangEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new TatsumaTheDragonsFangTriggeredAbility(fixedTarget);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
@ -123,7 +123,7 @@ class TatsumaTheDragonsFangTriggeredAbility extends DelayedTriggeredAbility {
protected FixedTarget fixedTarget;
public TatsumaTheDragonsFangTriggeredAbility(FixedTarget fixedTarget) {
super(new ReturnToBattlefieldUnderYourControlSourceEffect(Zone.EXILED), Duration.OneUse);
super(new ReturnToBattlefieldUnderYourControlSourceEffect(), Duration.OneUse);
this.fixedTarget = fixedTarget;
}

View file

@ -119,7 +119,7 @@ class ThroughTheBreachEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -115,7 +115,7 @@ class AdarkarValkyrieEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AdarkarValkyrieDelayedTriggeredAbility(new FixedTarget(this.getTargetPointer().getFirst(game, source)));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return false;
}

View file

@ -103,7 +103,7 @@ class ScatteringStrokeEffect extends OneShotEffect {
new AtTheBeginOMainPhaseDelayedTriggeredAbility(effect, true, TargetController.YOU, AtTheBeginOMainPhaseDelayedTriggeredAbility.PhaseSelection.NEXT_MAIN);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
return true;

View file

@ -136,7 +136,7 @@ class FlickerformEffect extends OneShotEffect {
new FlickerformReturnEffect(enchantedCreature.getId(), exileZoneId));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
return true;

View file

@ -98,7 +98,7 @@ class ReincarnationEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new ReincarnationDelayedTriggeredAbility(targetPointer.getFirst(game, source));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -129,7 +129,7 @@ class RoonOfTheHiddenRealmEffect extends OneShotEffect {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(card.getOwnerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
}

View file

@ -250,7 +250,7 @@ class DarettiScrapSavantEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(Zone.COMMAND, effect, TargetController.ANY);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -121,7 +121,7 @@ class FeldonOfTheThirdPathEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -165,7 +165,7 @@ class WakeTheDeadReturnFromGraveyardToBattlefieldTargetEffect extends OneShotEff
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}

View file

@ -101,7 +101,7 @@ class BrackwaterElementalSacrificeEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
return false;

View file

@ -96,7 +96,7 @@ class QuenchableFireEffect extends OneShotEffect {
QuenchableFireDelayedTriggeredAbility delayedAbility = new QuenchableFireDelayedTriggeredAbility();
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
delayedAbility.getTargets().addAll(source.getTargets());
game.addDelayedTriggeredAbility(delayedAbility);

View file

@ -56,7 +56,6 @@ public class BeguilerOfWills extends CardImpl {
this.subtype.add("Human");
this.subtype.add("Wizard");
this.color.setBlue(true);
this.power = new MageInt(1);
this.toughness = new MageInt(1);

View file

@ -100,7 +100,7 @@ class LoyalCatharEffect extends OneShotEffect {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnLoyalCatharEffect(source.getSourceId()));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -112,7 +112,7 @@ class SeanceEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}

View file

@ -97,7 +97,7 @@ class SuddenDisappearanceEffect extends OneShotEffect {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}

View file

@ -112,7 +112,7 @@ class RakdosGuildmageEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -107,7 +107,7 @@ class AEherlingRemovingEffect extends OneShotEffect {
new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -133,7 +133,7 @@ class LegionsInitiativeExileEffect extends OneShotEffect {
AtTheBeginOfCombatDelayedTriggeredAbility delayedAbility = new AtTheBeginOfCombatDelayedTriggeredAbility(new LegionsInitiativeReturnFromExileEffect());
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -101,7 +101,7 @@ class PlasmCaptureCounterEffect extends OneShotEffect {
new AtTheBeginOMainPhaseDelayedTriggeredAbility(new PlasmCaptureManaEffect(mana), false, TargetController.YOU, PhaseSelection.NEXT_PRECOMBAT_MAIN);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -101,7 +101,7 @@ class HedonistsTroveExileEffect extends OneShotEffect {
Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && targetPlayer != null && sourceObject != null) {
UUID exileId = CardUtil.getObjectExileZoneId(game, sourceObject);
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
ArrayList<UUID> graveyard = new ArrayList<>(targetPlayer.getGraveyard());
for (UUID cardId : graveyard) {
Card card = game.getCard(cardId);
@ -141,7 +141,7 @@ class HedonistsTrovePlayLandEffect extends AsThoughEffectImpl {
Card card = game.getCard(objectId);
MageObject sourceObject = source.getSourceObject(game);
if (card != null && card.getCardType().contains(CardType.LAND) && sourceObject != null) {
UUID exileId = CardUtil.getObjectExileZoneId(game, sourceObject);
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
if (exileId != null) {
ExileZone exileZone = game.getState().getExile().getExileZone(exileId);
return exileZone != null && exileZone.contains(objectId);
@ -182,7 +182,7 @@ class HedonistsTroveCastNonlandCardsEffect extends AsThoughEffectImpl {
Card card = game.getCard(objectId);
MageObject sourceObject = source.getSourceObject(game);
if (card != null && !card.getCardType().contains(CardType.LAND) && sourceObject != null) {
UUID exileId = CardUtil.getObjectExileZoneId(game, sourceObject);
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
if (exileId != null) {
ExileZone exileZone = game.getState().getExile().getExileZone(exileId);
if (exileZone != null && exileZone.contains(objectId)) {

View file

@ -110,7 +110,7 @@ class LivingLoreExileEffect extends OneShotEffect {
if (sourceObject != null && controller != null){
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(new FilterInstantOrSorceryCard("instant or sorcery card from your graveyard"));
if (controller.chooseTarget(outcome, target, source, game)) {
UUID exileId = CardUtil.getObjectExileZoneId(game, sourceObject);
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
Card card = controller.getGraveyard().get(target.getFirstTarget(), game);
if (card != null) {
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getName(), source.getSourceId(), game, Zone.GRAVEYARD);
@ -147,7 +147,7 @@ class LivingLoreSetPowerToughnessSourceEffect extends ContinuousEffectImpl {
discard();
return false;
}
UUID exileId = CardUtil.getObjectExileZoneId(game, mageObject);
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
if (exileId != null) {
ExileZone exileZone = game.getExile().getExileZone(exileId);
if (exileZone == null) {
@ -192,7 +192,7 @@ class LivingLoreSacrificeEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null && mageObject != null && new MageObjectReference(permanent, game).refersTo(mageObject, game)) {
if (permanent.sacrifice(source.getSourceId(), game)) {
UUID exileId = CardUtil.getObjectExileZoneId(game, mageObject);
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
if (exileId != null) {
ExileZone exileZone = game.getExile().getExileZone(exileId);
Card exiledCard = null;

View file

@ -120,7 +120,7 @@ class MirrorMockeryEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -133,7 +133,7 @@ class SwiftWarkiteEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect2);
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
}
@ -154,7 +154,7 @@ class SwiftWarkiteEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect2);
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
}

View file

@ -107,7 +107,7 @@ class FlickerwispEffect extends OneShotEffect {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, false));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -107,7 +107,7 @@ class RallyTheAncestorsEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
}

View file

@ -44,6 +44,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.combat.CombatGroup;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@ -53,13 +54,18 @@ import mage.watchers.common.BlockedAttackerWatcher;
*
* @author jeffwadsworth
*
5/1/2009 The ability grants you control of all creatures that are blocking it as the ability resolves. This will include any creatures that were put onto the battlefield blocking it.
5/1/2009 Any blocking creatures that regenerated during combat will have been removed from combat. Since such creatures are no longer in combat, they cannot be blocking The Wretched, which means you won't be able to gain control of them.
5/1/2009 If The Wretched itself regenerated during combat, then it will have been removed from combat. Since it is no longer in combat, there cannot be any creatures blocking it, which means you won't be able to gain control of any creatures.
10/1/2009 The Wretched's ability triggers only if it's still on the battlefield when the end of combat step begins (after the combat damage step). For example, if it's blocked by a 7/7 creature and is destroyed, its ability won't trigger at all.
5/1/2009 The ability grants you control of all creatures that are blocking it as the ability resolves. This will include
* any creatures that were put onto the battlefield blocking it.
5/1/2009 Any blocking creatures that regenerated during combat will have been removed from combat. Since such creatures
* are no longer in combat, they cannot be blocking The Wretched, which means you won't be able to gain control of them.
5/1/2009 If The Wretched itself regenerated during combat, then it will have been removed from combat. Since it is no longer
* in combat, there cannot be any creatures blocking it, which means you won't be able to gain control of any creatures.
10/1/2009 The Wretched's ability triggers only if it's still on the battlefield when the end of combat step begins (after the
* combat damage step). For example, if it's blocked by a 7/7 creature and is destroyed, its ability won't trigger at all.
10/1/2009 If The Wretched leaves the battlefield, you no longer control it, so the duration of its control-change effect ends.
10/1/2009 If you lose control of The Wretched before its ability resolves, you won't gain control of the creatures blocking it at all.
10/1/2009 Once the ability resolves, it doesn't care whether the permanents you gained control of remain creatures, only that they remain on the battlefield.
10/1/2009 Once the ability resolves, it doesn't care whether the permanents you gained control of remain creatures, only that
* they remain on the battlefield.
*/
public class TheWretched extends CardImpl {
@ -100,10 +106,15 @@ class EndOfAnyCombatTriggeredAbility extends TriggeredAbilityImpl {
public EndOfAnyCombatTriggeredAbility copy() {
return new EndOfAnyCombatTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.END_COMBAT_STEP_PRE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return (event.getType() == GameEvent.EventType.END_COMBAT_STEP_PRE);
return true;
}
@Override
@ -124,29 +135,44 @@ class TheWretchedEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent theWretched = game.getPermanent(source.getSourceId());
Permanent theWretched = (Permanent) source.getSourceObjectIfItStillExists(game);
if (theWretched == null) {
return false;
}
if (theWretched.isRemovedFromCombat()) {
if (theWretched.isRemovedFromCombat() || !theWretched.isAttacking()) {
return false;
}
if (!new SourceOnBattlefieldControlUnchangedCondition().apply(game, source)) {
return false;
}
BlockedAttackerWatcher watcher = (BlockedAttackerWatcher) game.getState().getWatchers().get("BlockedAttackerWatcher");
if (watcher != null) {
for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), game)) {
if (watcher.creatureHasBlockedAttacker(theWretched, creature, game)
&& !creature.isRemovedFromCombat()) {
ContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom, source.getControllerId()), new SourceOnBattlefieldControlUnchangedCondition(), "test");
effect.setTargetPointer(new FixedTarget(creature.getId()));
game.addEffect(effect, source);
for (CombatGroup combatGroup :game.getCombat().getGroups()) {
if (combatGroup.getAttackers().contains(source.getSourceId())) {
for(UUID creatureId: combatGroup.getBlockers()) {
Permanent blocker = game.getPermanent(creatureId);
if (blocker != null && blocker.getBlocking() > 0) {
ContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom, source.getControllerId()), new SourceOnBattlefieldControlUnchangedCondition(), "");
effect.setTargetPointer(new FixedTarget(blocker.getId()));
game.addEffect(effect, source);
}
}
}
return true;
}
return false;
return true;
// BlockedAttackerWatcher watcher = (BlockedAttackerWatcher) game.getState().getWatchers().get("BlockedAttackerWatcher");
// if (watcher != null) {
// for (Permanent creature : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), game)) {
// if (watcher.creatureHasBlockedAttacker(theWretched, creature, game)
// && !creature.isRemovedFromCombat()) {
// ContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom, source.getControllerId()), new SourceOnBattlefieldControlUnchangedCondition(), "test");
// effect.setTargetPointer(new FixedTarget(creature.getId()));
// game.addEffect(effect, source);
// }
// }
// return true;
// }
// return false;
}
@Override

View file

@ -69,8 +69,6 @@ public class BridgeFromBelow extends CardImpl {
super(ownerId, 81, "Bridge from Below", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}{B}");
this.expansionSetCode = "FUT";
this.color.setBlack(true);
// Whenever a nontoken creature is put into your graveyard from the battlefield, if Bridge from Below is in your graveyard, put a 2/2 black Zombie creature token onto the battlefield.
this.addAbility(new BridgeFromBelowAbility(new CreateTokenEffect(new ZombieToken()), filter1));
// When a creature is put into an opponent's graveyard from the battlefield, if Bridge from Below is in your graveyard, exile Bridge from Below.
@ -106,15 +104,18 @@ class BridgeFromBelowAbility extends TriggeredAbilityImpl {
return new BridgeFromBelowAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) {
return true;
}
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) {
return true;
}
}
return false;
@ -123,16 +124,11 @@ class BridgeFromBelowAbility extends TriggeredAbilityImpl {
@Override
public boolean checkInterveningIfClause(Game game) {
Player controller = game.getPlayer(this.getControllerId());
if(controller != null && controller.getGraveyard().contains(this.getSourceId())) {
return true;
}
return false;
return controller != null && controller.getGraveyard().contains(this.getSourceId());
}
@Override
public String getRule() {
return filter.getMessage() +", if Bridge from Below is in your graveyard, " + super.getRule();
return filter.getMessage() +", if {this} is in your graveyard, " + super.getRule();
}
}

View file

@ -98,7 +98,7 @@ class VoidwalkEffect extends OneShotEffect {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(card.getOwnerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -140,7 +140,7 @@ class GhostCouncilOfOrzhovaRemovingEffect extends OneShotEffect {
new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -95,7 +95,7 @@ class GhostwayEffect extends OneShotEffect {
MageObject sourceObject = source.getSourceObject(game);
if (sourceObject != null && controller != null) {
int numberCreatures = 0;
UUID exileId = CardUtil.getObjectExileZoneId(game, sourceObject);
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
if (creature != null) {
controller.moveCardToExileWithInfo(creature, exileId,sourceObject.getLogName(), source.getSourceId(), game, Zone.BATTLEFIELD);
@ -107,7 +107,7 @@ class GhostwayEffect extends OneShotEffect {
new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD, false));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
return true;

View file

@ -66,7 +66,7 @@ public class IcyPrison extends CardImpl {
new DoUnlessAnyPlayerPaysEffect(new SacrificeSourceEffect(), new GenericManaCost(3)), TargetController.YOU, false));
// When Icy Prison leaves the battlefield, return the exiled card to the battlefield under its owner's control.
this.addAbility(new LeavesBattlefieldTriggeredAbility(new ReturnFromExileForSourceEffect(Zone.BATTLEFIELD), false));
this.addAbility(new LeavesBattlefieldTriggeredAbility(new ReturnFromExileForSourceEffect(Zone.BATTLEFIELD, false, true), false));
}

View file

@ -144,7 +144,7 @@ class NecropotenceEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(returnToHandeffect, TargetController.YOU);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -149,7 +149,7 @@ class SpinalEmbraceAddDelayedEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -30,6 +30,7 @@ package mage.sets.journeyintonyx;
import java.util.LinkedList;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -49,6 +50,7 @@ import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.common.TargetOpponent;
@ -117,7 +119,7 @@ class BrainMaggotExileEffect extends OneShotEffect {
Card card = opponent.getHand().get(target.getFirstTarget(), game);
// If source permanent leaves the battlefield before its triggered ability resolves, the target card won't be exiled.
if (card != null && game.getState().getZone(source.getSourceId()) == Zone.BATTLEFIELD) {
controller.moveCardToExileWithInfo(card, CardUtil.getObjectExileZoneId(game, sourcePermanent), sourcePermanent.getName(), source.getSourceId(), game, Zone.HAND);
controller.moveCardToExileWithInfo(card, CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), sourcePermanent.getName(), source.getSourceId(), game, Zone.HAND);
}
}
}
@ -151,9 +153,14 @@ class BrainMaggotReturnExiledCreatureAbility extends DelayedTriggeredAbility {
return new BrainMaggotReturnExiledCreatureAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId())) {
if (event.getTargetId().equals(this.getSourceId())) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
return true;
@ -182,8 +189,10 @@ class BrainMaggotReturnExiledCreatureEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
ExileZone exile = game.getExile().getExileZone(CardUtil.getObjectExileZoneId(game, source.getSourceObject(game)));
MageObject sourceObject = source.getSourceObject(game);
if (sourceObject != null && controller != null) {
int zoneChangeCounter = (sourceObject instanceof PermanentToken) ? source.getSourceObjectZoneChangeCounter() : source.getSourceObjectZoneChangeCounter() -1;
ExileZone exile = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), zoneChangeCounter));
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (exile != null && sourcePermanent != null) {
LinkedList<UUID> cards = new LinkedList<>(exile);

View file

@ -100,7 +100,7 @@ class SkybindEffect extends OneShotEffect {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -112,7 +112,7 @@ class TwinflameCopyEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
}

View file

@ -128,7 +128,7 @@ class WormfangDrakeExileCost extends CostImpl {
MageObject sourceObject = ability.getSourceObject(game);
if (controller != null && sourceObject != null) {
if (targets.choose(Outcome.Exile, controllerId, sourceId, game)) {
UUID exileId = CardUtil.getObjectExileZoneId(game, sourceObject);
UUID exileId = CardUtil.getExileZoneId(game, ability.getSourceId(), ability.getSourceObjectZoneChangeCounter());
for (UUID targetId: targets.get(0).getTargets()) {
Permanent permanent = game.getPermanent(targetId);
if (permanent == null) {

View file

@ -72,9 +72,6 @@ public class AnafenzaTheForemost extends CardImpl {
this.subtype.add("Human");
this.subtype.add("Soldier");
this.color.setGreen(true);
this.color.setBlack(true);
this.color.setWhite(true);
this.power = new MageInt(4);
this.toughness = new MageInt(4);

View file

@ -141,7 +141,7 @@ class KheruLichLordEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
KheruLichLordReplacementEffect replacementEffect = new KheruLichLordReplacementEffect();

View file

@ -118,7 +118,7 @@ class MeanderingTowershellEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtBeginningNextDeclareAttackersStepNextTurnDelayedTriggeredAbility();
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -154,7 +154,7 @@ class AbominationEffect extends OneShotEffect {
AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect());
delayedAbility.setSourceId(permanent.getId());
delayedAbility.setControllerId(event.getControllerId());
delayedAbility.setSourceObject(event.getSourceObject(game));
delayedAbility.setSourceObject(event.getSourceObject(game), game);
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
game.addDelayedTriggeredAbility(delayedAbility);
return true;

View file

@ -117,7 +117,7 @@ class HazezonTamarEntersEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -174,7 +174,7 @@ class BerserkDestroyEffect extends OneShotEffect {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -136,7 +136,7 @@ class CockatriceEffect extends OneShotEffect {
AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect());
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId()));
game.addDelayedTriggeredAbility(delayedAbility);
return true;

View file

@ -133,7 +133,7 @@ class ThicketBasiliskEffect extends OneShotEffect {
AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect());
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId()));
game.addDelayedTriggeredAbility(delayedAbility);
return true;

View file

@ -103,7 +103,7 @@ class DragonWhelpEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new DragonWhelpDelayedEffect());
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
amount++;

View file

@ -134,7 +134,7 @@ class StoneGiantEffect extends OneShotEffect {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -101,7 +101,7 @@ class MystifyingMazeEffect extends OneShotEffect {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD, true));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -54,7 +54,7 @@ public class PrimevalTitan extends CardImpl {
super(ownerId, 192, "Primeval Titan", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{G}{G}");
this.expansionSetCode = "M11";
this.subtype.add("Giant");
this.color.setGreen(true);
this.power = new MageInt(6);
this.toughness = new MageInt(6);
@ -90,15 +90,17 @@ class PrimevalTitanAbility extends TriggeredAbilityImpl {
return new PrimevalTitanAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
return true;
}
if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD && event.getTargetId().equals(this.getSourceId()) ) {
return true;
}
return false;
return event.getType() == EventType.ENTERS_THE_BATTLEFIELD && event.getTargetId().equals(this.getSourceId());
}
@Override

View file

@ -103,11 +103,11 @@ class BanisherPriestExileEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game);
// If Banisher Priest leaves the battlefield before its triggered ability resolves,
// the target creature won't be exiled.
if (permanent != null) {
return new ExileTargetEffect(CardUtil.getObjectExileZoneId(game, permanent), permanent.getLogName()).apply(game, source);
return new ExileTargetEffect(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), permanent.getLogName()).apply(game, source);
}
return false;
}

View file

@ -94,7 +94,7 @@ class PhytotitanEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -135,7 +135,7 @@ class RockBasiliskEffect extends OneShotEffect {
AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect());
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId()));
game.addDelayedTriggeredAbility(delayedAbility);
return true;

View file

@ -113,7 +113,7 @@ class ShallowGraveEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
}

View file

@ -106,7 +106,7 @@ class GruesomeEncoreEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;

View file

@ -97,7 +97,7 @@ class VirulentWoundEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new VirulentWoundDelayedTriggeredAbility(source.getFirstTarget());
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -45,6 +45,7 @@ import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.permanent.PermanentToken;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.util.CardUtil;
@ -104,7 +105,8 @@ class ParallaxWaveEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
MageObject sourceObject = source.getSourceObject(game);
if (sourceObject != null) {
UUID exileZoneId = CardUtil.getObjectExileZoneId(game, sourceObject);
int zoneChangeCounter = (sourceObject instanceof PermanentToken) ? source.getSourceObjectZoneChangeCounter() : source.getSourceObjectZoneChangeCounter() -1;
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), zoneChangeCounter);
if (exileZoneId != null) {
ExileZone exileZone = game.getExile().getExileZone(exileZoneId);
if (exileZone != null) {

View file

@ -149,7 +149,7 @@ class KarnLiberatedEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new KarnLiberatedDelayedTriggeredAbility(exileId);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
game.start(null);
return true;

View file

@ -30,6 +30,8 @@ package mage.sets.newphyrexia;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.StaticAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.InfoEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
@ -53,7 +55,7 @@ public class MyrSuperion extends CardImpl {
this.toughness = new MageInt(6);
// Spend only mana produced by creatures to cast Myr Superion.
this.addAbility(new MyrSuperionStaticAbility());
this.addAbility(new SimpleStaticAbility(Zone.ALL, new InfoEffect("Spend only mana produced by creatures to cast {this}")));
this.getSpellAbility().getManaCostsToPay().setSourceFilter(filter);
this.getSpellAbility().getManaCosts().setSourceFilter(filter);
}
@ -67,25 +69,3 @@ public class MyrSuperion extends CardImpl {
return new MyrSuperion(this);
}
}
class MyrSuperionStaticAbility extends StaticAbility {
public MyrSuperionStaticAbility() {
super(Zone.STACK, null);
}
public MyrSuperionStaticAbility(MyrSuperionStaticAbility ability) {
super(ability);
}
@Override
public MyrSuperionStaticAbility copy() {
return new MyrSuperionStaticAbility(this);
}
@Override
public String getRule() {
return "Spend only mana produced by creatures to cast {this}.";
}
}

View file

@ -118,7 +118,7 @@ class PostmortemLungeEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;

View file

@ -103,7 +103,7 @@ class PraetorsGraspEffect extends OneShotEffect {
if (controller.searchLibrary(target, game, opponent.getId())) {
UUID targetId = target.getFirstTarget();
Card card = opponent.getLibrary().getCard(targetId, game);
UUID exileId = CardUtil.getObjectExileZoneId(game, sourceObject);
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
if (card != null && exileId != null) {
game.informPlayers(controller.getName() + " moves the searched card face down to exile");
card.moveToExile(exileId, sourceObject.getName(), source.getSourceId(), game);

View file

@ -97,7 +97,7 @@ class AstralSlideEffect extends OneShotEffect {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD, false));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -98,7 +98,7 @@ class HornetCannonEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(destroyEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -100,7 +100,7 @@ class FatalFrenzyEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -132,7 +132,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.getObjectExileZoneId(game, sourceObject));
ExileZone exZone = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()));
if (exZone != null) {
Card card = exZone.getRandom(game);
controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.EXILED);

View file

@ -114,7 +114,7 @@ class GraveBetrayalTriggeredAbility extends TriggeredAbilityImpl {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
delayedAbility.setSourceId(this.getSourceId());
delayedAbility.setControllerId(this.getControllerId());
delayedAbility.setSourceObject(this.getSourceObject(game));
delayedAbility.setSourceObject(this.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -28,6 +28,8 @@
package mage.sets.returntoravnica;
import java.util.UUID;
import static javax.xml.bind.JAXBIntrospector.getValue;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@ -47,8 +49,6 @@ import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
/**
*
* @author LevelX2
@ -60,8 +60,7 @@ public class TrostaniSelesnyasVoice extends CardImpl {
this.expansionSetCode = "RTR";
this.supertype.add("Legendary");
this.subtype.add("Dryad");
this.color.setGreen(true);
this.color.setWhite(true);
this.power = new MageInt(2);
this.toughness = new MageInt(5);
@ -102,6 +101,7 @@ class TrostaniSelesnyasVoiceTriggeredAbility extends TriggeredAbilityImpl {
&& permanent.getControllerId().equals(this.controllerId)
&& event.getTargetId() != this.getSourceId()) {
Effect effect = this.getEffects().get(0);
// life is determined during resolution so it has to be retrieved there (e.g. Giant Growth before resolution)
effect.setValue("lifeSource", event.getTargetId());
effect.setValue("zoneChangeCounter", permanent.getZoneChangeCounter(game));
return true;
@ -112,7 +112,7 @@ class TrostaniSelesnyasVoiceTriggeredAbility extends TriggeredAbilityImpl {
@Override
public String getRule() {
return "Whenever another creature enters the battlefield under your control, you gain life equal to that creature's toughness.";
return "Whenever another creature enters the battlefield under your control, " + super.getRule();
}
@Override
@ -125,7 +125,7 @@ class TrostaniSelesnyasVoiceEffect extends OneShotEffect {
public TrostaniSelesnyasVoiceEffect() {
super(Outcome.GainLife);
staticText = "you gain life equal to its toughness";
staticText = "you gain life equal to that creature's toughness";
}
public TrostaniSelesnyasVoiceEffect(final TrostaniSelesnyasVoiceEffect effect) {
@ -155,4 +155,4 @@ class TrostaniSelesnyasVoiceEffect extends OneShotEffect {
}
return false;
}
}
}

View file

@ -89,22 +89,24 @@ class ArrogantBloodlordTriggeredAbility extends TriggeredAbilityImpl {
return new ArrogantBloodlordTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.BLOCKER_DECLARED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
Permanent blocker = game.getPermanent(event.getSourceId());
Permanent blocked = game.getPermanent(event.getTargetId());
Permanent arrogantBloodlord = game.getPermanent(sourceId);
if (blocker != null && blocker != arrogantBloodlord
&& blocker.getPower().getValue() < 2
&& blocked == arrogantBloodlord) {
return true;
}
if (blocker != null && blocker == arrogantBloodlord
&& game.getPermanent(event.getTargetId()).getPower().getValue() < 2) {
return true;
}
return false;
Permanent blocker = game.getPermanent(event.getSourceId());
Permanent blocked = game.getPermanent(event.getTargetId());
Permanent arrogantBloodlord = game.getPermanent(sourceId);
if (blocker != null && blocker != arrogantBloodlord
&& blocker.getPower().getValue() < 2
&& blocked == arrogantBloodlord) {
return true;
}
if (blocker != null && blocker == arrogantBloodlord
&& game.getPermanent(event.getTargetId()).getPower().getValue() < 2) {
return true;
}
return false;
}
@ -133,7 +135,7 @@ class ArrogantBloodlordEffect extends OneShotEffect {
AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new DestroyTargetEffect());
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(source.getSourceId()));
game.addDelayedTriggeredAbility(delayedAbility);
return true;

View file

@ -119,7 +119,7 @@ class SplinterTwinEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -101,7 +101,7 @@ class FeralLightningEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
return true;

View file

@ -110,7 +110,7 @@ class FootstepsOfTheGoryoEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;

View file

@ -121,7 +121,7 @@ class InameAsOneEffect extends OneShotEffect {
// exile it, not that it actually gets to the exile zone. This is similar to how destroying a creature
// (with, for example, Rest in Peace) doesn't necessarily ensure that creature will end up in the graveyard;
// it just so happens that the action of exiling something and the exile zone both use the same word: "exile".
new ExileSourceEffect(Zone.GRAVEYARD).apply(game, source);
new ExileSourceEffect().apply(game, source);
return new ReturnFromGraveyardToBattlefieldTargetEffect().apply(game, source);
}
return true;

View file

@ -100,7 +100,7 @@ class WineOfBloodAndIronEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -99,7 +99,7 @@ class ArgentSphinxEffect extends OneShotEffect {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -100,7 +100,7 @@ class GlimmerpointStagEffect extends OneShotEffect {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -212,7 +212,7 @@ class MimicVatCreateTokenEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;

View file

@ -111,7 +111,7 @@ class OgreGeargrabberEffect1 extends OneShotEffect {
OgreGeargrabberDelayedTriggeredAbility delayedAbility = new OgreGeargrabberDelayedTriggeredAbility(equipmentId);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
Permanent equipment = game.getPermanent(equipmentId);
if (equipment != null) {

View file

@ -136,7 +136,7 @@ class VenserTheSojournerEffect extends OneShotEffect {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -119,7 +119,7 @@ class ElementalMasteryEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
}
return true;

View file

@ -97,7 +97,7 @@ class GiantbaitingEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -125,7 +125,7 @@ class ImpromptuRaidEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -99,7 +99,7 @@ class MistmeadowWitchEffect extends OneShotEffect {
AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnFromExileEffect(source.getSourceId(), Zone.BATTLEFIELD));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}

View file

@ -130,7 +130,7 @@ class PuppeteerCliqueEffect extends OneShotEffect {
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect, TargetController.YOU);
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
game.addDelayedTriggeredAbility(delayedAbility);
result = true;
}

View file

@ -89,7 +89,7 @@ class WickerWarcrawlerEffect extends OneShotEffect {
AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new AddCountersTargetEffect(CounterType.M1M1.createInstance()));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game));
delayedAbility.setSourceObject(source.getSourceObject(game), game);
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(source.getSourceId()));
game.addDelayedTriggeredAbility(delayedAbility);
return true;

View file

@ -90,15 +90,6 @@ class GatherSpecimensReplacementEffect extends ReplacementEffectImpl {
return true;
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
event.setPlayerId(controller.getId());
}
return false;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ZONE_CHANGE || event.getType() == GameEvent.EventType.CREATE_TOKEN;
@ -107,7 +98,7 @@ class GatherSpecimensReplacementEffect extends ReplacementEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE
&& ((ZoneChangeEvent) event).getToZone() == Zone.BATTLEFIELD) {
&& ((ZoneChangeEvent) event).getToZone().match(Zone.BATTLEFIELD)) {
Card card = game.getCard(event.getTargetId());
if (card.getCardType().contains(CardType.CREATURE)) { // TODO: Bestow Card cast as Enchantment probably not handled correctly
Player controller = game.getPlayer(source.getControllerId());
@ -124,4 +115,13 @@ class GatherSpecimensReplacementEffect extends ReplacementEffectImpl {
}
return false;
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
event.setPlayerId(controller.getId());
}
return false;
}
}

Some files were not shown because too many files have changed in this diff Show more