Skip to content

Freeze Tag: players spawn with some lives and get eliminated if they are fragged after they lost all their lives

terencehill requested to merge terencehill/_freezetag_lives into master

New features:

  • Players spawn with 2 lives (g_freezetag_frozen_lives 2 by default)
  • Players get eliminated (like Clan Arena) if they are fragged after they lost all their lives
  • 2 seconds after a player gets frozen a centerprint message shows the number of lives remaining
  • Players joining after the round has already started spawn with the lowest number of lives a player has and don't spawn at all if at least a player has already been eliminated (they join a team though, like CA). This is to prevent players from gaining lives by spectating and rejoining

About the initial number of lives:

  • can never be 0 otherwise no player will ever be frozen
  • can be infinite (g_freezetag_frozen_lives <= 0), replicating current FT gameplay where player can't never be eliminated
  • can't be >= 100 (if g_freezetag_frozen_lives is set to >= 100, it falls back to infinite lives)

Bug fix: "Player was frozen by " wrongly shown when a player kill themself by falling into the void, now "Player froze themself" is shown

Implementation:

  • Player elimination code is obviously very similar to CA code with a few tweaks since it implements the very same feature.
  • Spectating rules are the same as CA so the code is basically the same
  • implementing infinite lives as a high finite number (start_lives = FT_INFINITE_LIVES;) makes internal lives handling easier as code doesn't need to check a special value that would represent infinite lives and 0 can't be used.
  • g_freezetag_frozen_lives >= 100 falls back to infinite lives so that the implementation is simpler by letting .lives be set to 0
  • in other game modes lives appear in the scoreboard, I think with this gameplay is not needed because it's a temporary resource that is renewed every round and isn't crucial for the match outcome since a round can be won even if all players of the enemy team have still 1 or more lives left

Merge request reports