* Game log - Added info to log if player loses life.

This commit is contained in:
LevelX2 2014-03-14 13:57:19 +01:00
parent 47af2cab75
commit 317d07215c

View file

@ -1277,6 +1277,7 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
GameEvent event = new GameEvent(GameEvent.EventType.LOSE_LIFE, playerId, playerId, playerId, amount, false); GameEvent event = new GameEvent(GameEvent.EventType.LOSE_LIFE, playerId, playerId, playerId, amount, false);
if (!game.replaceEvent(event)) { if (!game.replaceEvent(event)) {
this.life -= event.getAmount(); this.life -= event.getAmount();
game.informPlayers(new StringBuilder(this.getName()).append(" loses ").append(event.getAmount()).append(" life").toString());
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LOST_LIFE, playerId, playerId, playerId, amount)); game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LOST_LIFE, playerId, playerId, playerId, amount));
return amount; return amount;
} }