mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
[FIN] fix Aettier and Priwen not working (fixes #13822)
This commit is contained in:
parent
42e5c09f35
commit
7582123f55
1 changed files with 10 additions and 6 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue