mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
- refactored Grollub.
This commit is contained in:
parent
fa65ef0237
commit
6ae86a7f7d
1 changed files with 6 additions and 9 deletions
|
@ -62,15 +62,12 @@ class EachOpponentGainsLifeEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (UUID opponentId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
Player opponent = game.getPlayer(opponentId);
|
||||
if (opponent != null) {
|
||||
game.getOpponents(source.getControllerId()).stream().map((opponentId) -> game.getPlayer(opponentId)).filter((opponent) -> (opponent != null)).forEachOrdered((opponent) -> {
|
||||
int amount = (Integer) getValue("damage");
|
||||
if (amount > 0) {
|
||||
opponent.gainLife(amount, game, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue