mirror of
https://github.com/magefree/mage.git
synced 2025-12-27 05:52:06 -08:00
[FIX] Fixes issue 298 and 303.
This commit is contained in:
parent
47d759c850
commit
c26f634d85
2 changed files with 7 additions and 4 deletions
|
|
@ -30,6 +30,8 @@ package mage.abilities.effects.common;
|
|||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
|
@ -40,16 +42,17 @@ import mage.players.Player;
|
|||
*/
|
||||
public class LoseLifePlayersEffect extends OneShotEffect<LoseLifePlayersEffect> {
|
||||
|
||||
private int amount;
|
||||
private DynamicValue amount;
|
||||
|
||||
public LoseLifePlayersEffect(int amount) {
|
||||
super(Constants.Outcome.Damage);
|
||||
this.amount = amount;
|
||||
this.amount = new StaticValue(amount);
|
||||
staticText = "each player loses " + amount + " life";
|
||||
}
|
||||
|
||||
public LoseLifePlayersEffect(final LoseLifePlayersEffect effect) {
|
||||
super(effect);
|
||||
this.amount = effect.amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -57,7 +60,7 @@ public class LoseLifePlayersEffect extends OneShotEffect<LoseLifePlayersEffect>
|
|||
for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null)
|
||||
player.loseLife(amount, game);
|
||||
player.loseLife(amount.calculate(game, source), game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue