removed deprecated method for adding delayed triggered abilities

This commit is contained in:
Evan Kranzler 2021-04-17 12:13:37 -04:00
parent 1685b9a4ee
commit cbc949c08e
4 changed files with 9 additions and 20 deletions

View file

@ -203,7 +203,7 @@ class LukkaWaywardBonderReturnEffect extends OneShotEffect {
.setText("Exile it at the beginning of your next upkeep.") .setText("Exile it at the beginning of your next upkeep.")
.setTargetPointer(new FixedTarget(permanent, game)), .setTargetPointer(new FixedTarget(permanent, game)),
Duration.Custom, true Duration.Custom, true
)); ), source);
return true; return true;
} }
} }

View file

@ -425,8 +425,6 @@ public interface Game extends MageItem, Serializable {
void addTriggeredAbility(TriggeredAbility ability, GameEvent triggeringEvent); void addTriggeredAbility(TriggeredAbility ability, GameEvent triggeringEvent);
UUID addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility);
UUID addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility, Ability source); UUID addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility, Ability source);
UUID fireReflexiveTriggeredAbility(ReflexiveTriggeredAbility reflexiveAbility, Ability source); UUID fireReflexiveTriggeredAbility(ReflexiveTriggeredAbility reflexiveAbility, Ability source);

View file

@ -1778,25 +1778,16 @@ public abstract class GameImpl implements Game, Serializable {
@Override @Override
public UUID addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility, Ability source) { public UUID addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility, Ability source) {
delayedAbility.setSourceId(source.getSourceId()); if (source != null) {
delayedAbility.setControllerId(source.getControllerId()); delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
}
// return addDelayedTriggeredAbility(delayedAbility); // return addDelayedTriggeredAbility(delayedAbility);
DelayedTriggeredAbility newAbility = delayedAbility.copy(); DelayedTriggeredAbility newAbility = delayedAbility.copy();
newAbility.newId(); newAbility.newId();
newAbility.setSourceObjectZoneChangeCounter(getState().getZoneChangeCounter(source.getSourceId())); if (source != null) {
newAbility.initOnAdding(this); newAbility.setSourceObjectZoneChangeCounter(getState().getZoneChangeCounter(source.getSourceId()));
// ability.init is called as the ability triggeres not now. }
// If a FixedTarget pointer is already set from the effect setting up this delayed ability
// it has to be already initialized so it won't be overwitten as the ability triggers
getState().addDelayedTriggeredAbility(newAbility);
return newAbility.getId();
}
@Deprecated
@Override
public UUID addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility) {
DelayedTriggeredAbility newAbility = delayedAbility.copy();
newAbility.newId();
newAbility.initOnAdding(this); newAbility.initOnAdding(this);
// ability.init is called as the ability triggeres not now. // ability.init is called as the ability triggeres not now.
// If a FixedTarget pointer is already set from the effect setting up this delayed ability // If a FixedTarget pointer is already set from the effect setting up this delayed ability

View file

@ -553,7 +553,7 @@ public abstract class PlayerImpl implements Player, Serializable {
new LoseControlOnOtherPlayersControllerEffect(this.getLogName(), player.getLogName())); new LoseControlOnOtherPlayersControllerEffect(this.getLogName(), player.getLogName()));
ability.setSourceId(getId()); ability.setSourceId(getId());
ability.setControllerId(getId()); ability.setControllerId(getId());
game.addDelayedTriggeredAbility(ability); game.addDelayedTriggeredAbility(ability, null);
} }
} }