New LoseLifeOpponentsEffect, new dynamicValue SacrificeCostCreaturesPower, update to OpponentsLostLifeCount

This commit is contained in:
LevelX2 2012-10-18 00:03:42 +02:00
parent 6445430af2
commit 80b1d971b5
3 changed files with 143 additions and 6 deletions

View file

@ -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;
}