fix: include knocked out characters in TurnEvent for standard compatibility
This commit is contained in:
parent
cc4c5ba8cb
commit
c990356da0
@ -709,8 +709,13 @@ public class GameLogic {
|
|||||||
|
|
||||||
Character character = ((Character)state.entities.findEntity(id));
|
Character character = ((Character)state.entities.findEntity(id));
|
||||||
|
|
||||||
if(character.hp.getValue() > 0){
|
if(character.isAlive()){
|
||||||
alive.add(id);
|
alive.add(id);
|
||||||
|
}else { // send empty turn for knocked out characters
|
||||||
|
result.add(new EventBuilder(EventType.TurnEvent)
|
||||||
|
.withTurnCount(state.turnOrder.size())
|
||||||
|
.withNextCharacter(id)
|
||||||
|
.buildGameEvent());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(character.inventory.getFreeSlots() == 0) { // no slots => has all infinity stones
|
if(character.inventory.getFreeSlots() == 0) { // no slots => has all infinity stones
|
||||||
@ -779,6 +784,11 @@ public class GameLogic {
|
|||||||
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)).hp.getValue() > 0){
|
||||||
state.activeCharacter = id;
|
state.activeCharacter = id;
|
||||||
break;
|
break;
|
||||||
|
}else { // again send empty turns for knocked out characters
|
||||||
|
result.add(new EventBuilder(EventType.TurnEvent)
|
||||||
|
.withTurnCount(state.turnOrder.size())
|
||||||
|
.withNextCharacter(id)
|
||||||
|
.buildGameEvent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user