Jazz2::Multiplayer::GameModes::LastRabbitStandingMode class

Last Rabbit Standing game mode (free-for-all).

Every player starts the round with ServerConfiguration::PlayerLives lives and each death costs one. A player without lives is out and watches the rest of the round, so does anybody who joins after it started. The last player standing wins, roasts score nothing. When the time runs out, the player with the most lives wins.

Base classes

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

Derived classes

class ExtendedLastRabbitStandingMode
Extended Last Rabbit Standing game mode (free-for-all).

Constructors, destructors, conversion operators

LastRabbitStandingMode()

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 GetStateScore(const MpPlayerState& state) const -> std::uint32_t override
Returns the ranking metric stored in the specified state, a player with more ranks higher.
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 GetScoreboardLabel() const -> StringView override
Returns label of the mode-specific column of the scoreboard, which shows GetStateScore(), or empty.
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.
auto GetLeaderScore(IGameModeContext& ctx, Actors::Player* player) -> std::uint32_t override
Returns the score the overtime looks at, the round score by default.
void OnLateJoinerOut(IGameModeContext& ctx, Actors::Player* player) virtual
Called when a player who joined too late is taken out.
void AnnouncePosition(IGameModeContext& ctx, Actors::Player* player)
Announces the position of a player who doesn't roast anybody.
void Eliminate(IGameModeContext& ctx, Actors::Player* player)
Takes the player out of the round.
auto FindLastStanding(IGameModeContext& ctx, std::int32_t& standingCount) -> Actors::Player*
Returns the only player still in the round, nullptr if there are more of them or none.

Protected static variables

static float CampingLimitSecs constexpr

Protected variables

std::int32_t _participantCount
Number of players that started the round, a round of a single player never ends by elimination.