FlagRunMode class
Flag Run game mode (team-based).
While nobody carries the flag, it can be captured at any capture point (an event marked as easy-only or hard-only, otherwise a spawn point). The carrier has 45 seconds to take it into an enemy base, or self-destructs and the flag goes back. A delivery scores 3 points with more than 30 seconds left, 2 with more than 15 and 1 otherwise, plus one for every roast of the carrier (at most 3). Roasting a carrier with 15 seconds or less left steals the flag with 30 seconds on the clock and one bonus point, otherwise the flag goes back. The first team to reach the score wins.
Base classes
- class CustomGameModeBase
- Common base of the game modes that score points of their own.
Constructors, destructors, conversion operators
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.
killermay benullptr(environmental death). -
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. -
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 GetRoleLabel(std::
uint8_t modeFlags) const -> StringView override - Returns a short label shown next to the name of a player with the specified role, or empty.