示例#1
0
 @Override
 public boolean apply(Game game, Ability source) {
   PlayerLostLifeWatcher watcher =
       (PlayerLostLifeWatcher) game.getState().getWatchers().get("PlayerLostLifeWatcher");
   if (watcher != null) {
     return (watcher.getLiveLost(source.getControllerId()) == 0);
   }
   return false;
 }
 @Override
 protected int getInputValue(Game game, Ability source) {
   int maxLostLive = 0;
   PlayerLostLifeWatcher watcher =
       (PlayerLostLifeWatcher) game.getState().getWatchers().get("PlayerLostLifeWatcher");
   if (watcher != null) {
     for (UUID opponentId : game.getOpponents(source.getControllerId())) {
       int lostLive = watcher.getLiveLost(opponentId);
       if (lostLive > maxLostLive) {
         maxLostLive = lostLive;
       }
     }
   }
   return maxLostLive;
 }