- refactoring related to #8375 "A" cards

This commit is contained in:
Jeff Wadsworth 2021-10-19 11:12:45 -05:00
parent 8b36c70507
commit 8e3d4aed7e
10 changed files with 10 additions and 10 deletions

View file

@ -67,7 +67,7 @@ class AetherRiftEffect extends OneShotEffect {
Card card = controller.discardOne(true, false, source, game);
if (card != null && card.isCreature(game)) {
Effect returnEffect = new ReturnFromGraveyardToBattlefieldTargetEffect();
returnEffect.setTargetPointer(new FixedTarget(card.getId()));
returnEffect.setTargetPointer(new FixedTarget(card.getId(), game));
Effect doEffect = new DoUnlessAnyPlayerPaysEffect(returnEffect, new PayLifeCost(5),
"Pay 5 life to prevent " + card.getLogName() + " to return from graveyard to battlefield?");
return doEffect.apply(game, source);

View file

@ -77,7 +77,7 @@ class AkroanHorseChangeControlEffect extends OneShotEffect {
if (controller != null) {
if (controller.chooseTarget(outcome, target, source, game)) {
ContinuousEffect effect = new AkroanHorseGainControlEffect(Duration.Custom, target.getFirstTarget());
effect.setTargetPointer(new FixedTarget(source.getSourceId()));
effect.setTargetPointer(new FixedTarget(source.getSourceId(), game));
game.addEffect(effect, source);
return true;
}

View file

@ -114,7 +114,7 @@ class AkromaVisionOfIxidorEffect extends OneShotEffect {
.sum();
if (count > 0) {
ContinuousEffect effect = new BoostTargetEffect(count, count, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(permanent.getId()));
effect.setTargetPointer(new FixedTarget(permanent.getId(), game));
game.addEffect(effect, source);
}
}

View file

@ -63,7 +63,7 @@ class AmuletOfVigorTriggeredAbility extends TriggeredAbilityImpl {
if (permanent != null && permanent.isTapped() && permanent.isControlledBy(this.getControllerId())) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(
new FixedTarget(event.getTargetId())
new FixedTarget(event.getTargetId(), game)
.withData("triggeredName", GameLog.getColoredObjectIdNameForTooltip(permanent))
);
}

View file

@ -68,7 +68,7 @@ class BoostEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
ContinuousEffect effect = new BoostTargetEffect(amount, amount, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
game.addEffect(effect, source);
return true;
}

View file

@ -63,7 +63,7 @@ class AngelicExaltationAbility extends TriggeredAbilityImpl {
if (game.isActivePlayer(this.controllerId)) {
if (game.getCombat().attacksAlone()) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0)));
effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0), game));
}
return true;
}

View file

@ -131,7 +131,7 @@ class AssaultSuitGainControlEffect extends OneShotEffect {
"Let have " + activePlayer.getLogName() + " gain control of " + equippedCreature.getLogName() + '?', source, game)) {
equippedCreature.untap(game);
ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn, activePlayer.getId());
effect.setTargetPointer(new FixedTarget(equipment.getAttachedTo()));
effect.setTargetPointer(new FixedTarget(equipment.getAttachedTo(), game));
game.addEffect(effect, source);
}
}

View file

@ -84,7 +84,7 @@ class AtarkaWorldRenderEffect extends TriggeredAbilityImpl {
if (attacker != null
&& filter.match(attacker, sourceId, controllerId, game)) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(attacker.getId()));
effect.setTargetPointer(new FixedTarget(attacker.getId(), game));
}
return true;
}

View file

@ -73,7 +73,7 @@ class AuraThiefDiesTriggeredEffect extends OneShotEffect {
boolean ret = false;
for(Permanent enchantment : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_ENCHANTMENT_PERMANENT, source.getControllerId(), source.getControllerId(), game)) {
ContinuousEffect gainControl = new GainControlTargetEffect(Duration.EndOfGame);
gainControl.setTargetPointer(new FixedTarget(enchantment.getId()));
gainControl.setTargetPointer(new FixedTarget(enchantment.getId(), game));
game.addEffect(gainControl, source);
ret = true;
}

View file

@ -89,7 +89,7 @@ public final class Aurification extends CardImpl {
Permanent permanent = game.getPermanent(event.getSourceId());
if (permanent != null && permanent.isCreature(game)) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getSourceId()));
effect.setTargetPointer(new FixedTarget(event.getSourceId(), game));
}
return true;
}