HeadHuntersMode class
Head Hunters game mode (team-based).
A roasted player drops all gems they carry plus one more. Gems brought to the base of the own team score for the team, at least 2 at once, n gems are worth floor(n * ln(n)) points (2 gems 1 point, 3 gems 3 points, 4 gems 5 points, 5 gems 8 points, ...). The first team to reach the score wins.
Base classes
- class CustomGameModeBase
- Common base of the game modes that score points of their own.
Public static functions
-
static auto GetPointsForGems(std::
uint32_t gems) -> std:: uint32_t - Returns the points the specified number of gems is worth when delivered.
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 PreventsHazardDeath(IGameModeContext& ctx,
Actors::
Player* player) -> bool override - Called before a pit nobody caused roasts the player, returns
trueto keep it alive at 1 heart instead. -
void OnGemsCollected(IGameModeContext& ctx,
Actors::
Player* player, std:: uint8_t gemType, std:: int32_t prevCount, std:: int32_t newCount) override - Called when a player's gem count changes.
-
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.