Create common class for "when target dies this turn" delayed triggers (#9722)

Fixes #9716. Fixes #9719.
This commit is contained in:
Alex W. Jackson 2022-11-04 05:27:56 -04:00 committed by GitHub
parent afb7d75007
commit 10d7acb4b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
74 changed files with 397 additions and 1628 deletions

View file

@ -1985,10 +1985,7 @@ public abstract class GameImpl implements Game {
newAbility.setSourceObjectZoneChangeCounter(getState().getZoneChangeCounter(source.getSourceId()));
newAbility.setSourcePermanentTransformCount(this);
}
newAbility.initOnAdding(this);
// 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
newAbility.init(this);
getState().addDelayedTriggeredAbility(newAbility);
return newAbility.getId();
}