Jazz2::Multiplayer::GameModes::TeamLastRabbitStandingMode class

Team Last Rabbit Standing game mode (team-based).

Every team has ServerConfiguration::TeamLives lives. When the round starts, they're split as evenly as possible among at most ServerConfiguration::MaxTeamPlayersWithLives players of the team (the later ones get the remainder), nobody more than ServerConfiguration::PlayerLives, the rest goes to the reserve of the team and the other players are out. When a player runs out of lives, the reserve is split among the players of the team who are out, those out the longest first, as long as the team has room for players with lives. The last team with any lives wins.

Base classes

class CustomGameModeBase
Common base of the game modes that score points of their own.

Constructors, destructors, conversion operators

TeamLastRabbitStandingMode()

Public functions

auto GetMode() const -> MpGameMode override
Returns the game mode identifier.
auto IsTeamBased() const -> bool override
Returns whether players are split into teams.
void OnRoundStarted(IGameModeContext& ctx) override
Called when the round starts (after the countdown) to reset/initialize mode state.
void OnUpdate(IGameModeContext& ctx, float timeMult) override
Called every host tick while the round is running.
void OnPlayerKilled(IGameModeContext& ctx, Actors::Player* victim, Actors::Player* killer) override
Called when a player dies, for mode-specific reactions (e.g. dropping a carried flag); kill/death counts are maintained by the host. killer may be nullptr (environmental death).
auto DecideRespawn(IGameModeContext& ctx, Actors::Player* player) -> RespawnDecision override
Decides whether and where the specified player should respawn.
auto CheckGameEnds(IGameModeContext& ctx) -> GameEndResult override
Checks whether the round should end now, and who won.
auto TryGetTeamScore(IGameModeContext& ctx, std::uint8_t team, std::uint32_t& score) -> bool override
Returns the score of the specified team if the mode keeps it on its own, otherwise false.
auto TryGetTeamExtra(IGameModeContext& ctx, std::uint8_t team, std::uint32_t& value) -> bool override
Returns a second number of the specified team the HUD shows (synchronized), otherwise false.
auto GetStateScore(const MpPlayerState& state) const -> std::uint32_t override
Returns the ranking metric stored in the specified state, a player with more ranks higher.
auto GetScoreboardLabel() const -> StringView override
Returns label of the mode-specific column of the scoreboard, which shows GetStateScore(), or empty.
void OnDrawHUD(IGameModeContext& ctx, IGameModeHUD& hud, Actors::Player* player, const Rectf& view) override
Draws the mode-specific part of the HUD for the given player's split-screen view.
auto HasDamageAmplifierInOvertime() const -> bool override
Returns true if the damage amplifier turns on in the overtime of this mode.

Protected functions

auto GetOvertimeRule() const -> OvertimeRule override
Returns how the overtime works in the mode.