[FIN] fix Aettier and Priwen not working (fixes #13822)

This commit is contained in:
theelk801 2025-07-07 10:30:35 -04:00
parent 42e5c09f35
commit 7582123f55

View file

@ -61,18 +61,22 @@ class AettirAndPriwenEffect extends ContinuousEffectImpl {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent permanent = source.getSourcePermanentIfItStillExists(game); Permanent permanent = Optional
.ofNullable(source.getSourcePermanentIfItStillExists(game))
.map(Permanent::getAttachedTo)
.map(game::getPermanent)
.orElse(null);
if (permanent == null) { if (permanent == null) {
return false; return false;
} }
int life = Optional Optional.ofNullable(source)
.ofNullable(source)
.map(Controllable::getControllerId) .map(Controllable::getControllerId)
.map(game::getPlayer) .map(game::getPlayer)
.map(Player::getLife) .map(Player::getLife)
.orElse(0); .ifPresent(life -> {
permanent.getPower().setModifiedBaseValue(life); permanent.getPower().setModifiedBaseValue(life);
permanent.getToughness().setModifiedBaseValue(life); permanent.getToughness().setModifiedBaseValue(life);
});
return true; return true;
} }
} }