Here’s my code:
CheckForVictory(MaybeAgent : ?agent)<suspends> : void =
Sleep(3.0)
PrintDebug("Elimination detected")
AllPlayers : []player = GetPlayspace().GetPlayers()
var PlayersAlive : int = 0
for(Player : AllPlayers, FortChar : fort_character = Player.GetFortCharacter[]):
PrintDebug("This player has {FortChar.GetHealth()} / {FortChar.GetMaxHealth()} HP")
if(FortChar.GetHealth() > 0.0):
set PlayersAlive += 1
PrintDebug("Players alive = {PlayersAlive}")
if(PlayersAlive = 1):
if(Agent : agent = MaybeAgent?):
PrintDebug("ACTIVATING END GAME!")
EndGame.Activate(Agent)
I am testing with 3 players, and it always prints that each player has 100 HP.
Am I missing something?