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

@ -1,12 +1,8 @@
package mage.abilities;
import mage.MageObject;
import mage.abilities.effects.Effect;
import mage.constants.AbilityType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
@ -25,17 +21,6 @@ public abstract class StaticAbility extends AbilityImpl {
}
}
@Override
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
if (game.checkShortLivingLKI(getSourceId(), zone)) { // TODO: can be deleted? Need research
return true; // maybe this can be a problem if effects removed the ability from the object
}
if (game.getPermanentEntering(getSourceId()) != null && zone == Zone.BATTLEFIELD) {
return true; // abilities of permanents entering battlefield are countes as on battlefield
}
return super.isInUseableZone(game, source, event);
}
protected StaticAbility(final StaticAbility ability) {
super(ability);
}