Oh, it's using awaits / yields, yeah? Just read up a little more. That's much more manageable, heh.
Yeah pretty much! Here's the turn function which is all that stuff that happens between choosing a horror and checking if someone died from it. (there's coroutine stuff there for tutorials and such as well!) So each turn in the main loop is basically just
var loser:Player = await turn(remaining_players)
and then that's
## Returns the player with the lowest score func turn(_selected_players:Array = []) -> Player: set_active_players(_selected_players) var chosen_actions:Dictionary[Player, Action] = await get_chosen_actions(_selected_players) await trigger_actions(chosen_actions.values(), Effect.Trigger.BeforeScoring) var score_buckets:Dictionary[int, Array] = score_actions(chosen_actions) var losers:Array = get_lowest_scoring_players(score_buckets) if losers.size() > 1: await tutorial.trigger(Tutorial.Flag.Ties) await trigger_actions(get_all_actions(), Effect.Trigger.Tied) Game.play_sfx(Game.SFX.Boom) return await turn(losers) return losers[0]
Oh wait! It's doing more than that, it returns all actions in the players hands. This was meant for an action effect that I never actually added. In theory a card could do something extra if a tie triggers while it's in your hand. I do have cards that have a bonus when playing during ties but that's a different mechanism. I think I was planning on the growth ability to be a tie only thing but that made it way too slow, and tbh even per turn felt too slow which is why unlockable characters growth cards grow way faster.