diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogic.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogic.java index 586522c..e2f7a62 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogic.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/GameLogic.java @@ -498,7 +498,7 @@ public class GameLogic { EntityType opposing = target.id.type == EntityType.P1 ? EntityType.P2 : EntityType.P1; state.winConditions.increaseValue(opposing, WinCondition.TotalDamage, ((CharacterEvent)event).amount); - if(target.hp.getValue() == 0) { + if(!target.isAlive()) { state.winConditions.increaseValue(opposing, WinCondition.TotalKnockouts, 1); } } @@ -815,7 +815,7 @@ public class GameLogic { Collections.shuffle(state.turnOrder); for (EntityID id: state.turnOrder) { - if(id.type == EntityType.NPC || revived.contains(id) || ((Character)state.entities.findEntity(id)).hp.getValue() > 0){ + if(id.type == EntityType.NPC || revived.contains(id) || ((Character)state.entities.findEntity(id)).isAlive()){ state.activeCharacter = id; break; }else { // again send empty turns for knocked out characters @@ -927,7 +927,7 @@ public class GameLogic { for(Character character: characters) { if(checkLineOfSight(state, spawnPosition, character.getPosition())) { - if(character.hp.getValue() == 0) { + if(!character.isAlive()) { revived.add(character.id); } if(character.hp.getValue() != character.hp.getMax()) {