dies triggers improves:

* tests: added additional tests and verify/runtime checks for wrong die trigger settings;
* refactor: removed some usage of short LKI ;
* fixed dies events support in "or trigger" and "conditional trigger" (use cases like sacrifice cost);
* fixed dies events support in shared triggered abilities (use cases like sacrifice cost);
This commit is contained in:
Oleg Agafonov 2024-11-04 23:55:14 +04:00
parent a2ed52b8de
commit 66b338c6fc
18 changed files with 233 additions and 63 deletions

View file

@ -351,7 +351,12 @@ public interface Ability extends Controllable, Serializable {
void addWatcher(Watcher watcher);
/**
* Returns true if this abilities source is in the zone for the ability
* Allow to control ability/trigger's lifecycle
* <p>
* How-to use:
* - for normal abilities and triggers - keep default
* - for leave battlefield triggers - keep default + set setLeavesTheBattlefieldTrigger(true)
* - for dies triggers - override and use TriggeredAbilityImpl.isInUseableZoneDiesTrigger inside + set setLeavesTheBattlefieldTrigger(true)
*/
boolean isInUseableZone(Game game, MageObject source, GameEvent event);