refactor: removed some usages of short LKI, moved static ability's useable zone logic to basic ability implementation;

This commit is contained in:
Oleg Agafonov 2024-11-16 22:12:14 +04:00
parent 52ebba4cd1
commit 740a9347ae
7 changed files with 32 additions and 30 deletions

View file

@ -376,11 +376,16 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
* Kozilek card is itself and has the ability.
*/
// process events from other objects
Set<UUID> eventTargets = CardUtil.getEventTargets(event);
if (!eventTargets.contains(getSourceId())) {
return super.isInUseableZone(game, source, event);
}
// process events from own object
// inject process of "look back in time" events
// TODO: need sync code with AbilityImpl.isInUseableZone
switch (event.getType()) {
case ZONE_CHANGE:
ZoneChangeEvent zce = (ZoneChangeEvent) event;
@ -405,6 +410,8 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
}
break;
}
// all other events from own object
return super.isInUseableZone(game, source, event);
}