forked from External/mage
New LoseLifeOpponentsEffect, new dynamicValue SacrificeCostCreaturesPower, update to OpponentsLostLifeCount
This commit is contained in:
parent
6445430af2
commit
80b1d971b5
3 changed files with 143 additions and 6 deletions
|
|
@ -49,13 +49,10 @@ public class OpponentsLostLifeCount implements DynamicValue {
|
|||
|
||||
public int calculate(Game game, UUID controllerId) {
|
||||
PlayerLostLifeWatcher watcher = (PlayerLostLifeWatcher) game.getState().getWatchers().get("PlayerLostLifeWatcher");
|
||||
Player you = game.getPlayer(controllerId);
|
||||
if (watcher != null && you != null) {
|
||||
if (watcher != null) {
|
||||
int amountLifeLost = 0;
|
||||
for(UUID opponent: you.getInRange()) {
|
||||
if (!opponent.equals(controllerId)) {
|
||||
amountLifeLost += watcher.getLiveLost(opponent);
|
||||
}
|
||||
for(UUID opponent: game.getOpponents(controllerId)){
|
||||
amountLifeLost += watcher.getLiveLost(opponent);
|
||||
}
|
||||
return amountLifeLost;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue