Jazz2::Multiplayer::GameModes::PestilenceMode class

Pestilence game mode (free-for-all).

The first player to die becomes a zombie. Zombies can only roast humans and humans can only roast zombies, a human roasted by a zombie (or dying in any other way) turns into a zombie too. A human scores 1 point per zombie in the game (at most 3) for roasting a zombie, a zombie scores 1 point for roasting a human. When the last human falls, the zombie that roasted them gets 2 more points, the last human 5 more and the round ends, the most points win. If no zombie roasts anybody for 120 seconds, a random human turns. Anybody who joins after the round started is a zombie, unless late joiners are allowed.

Base classes

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

Constructors, destructors, conversion operators

PestilenceMode()

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 CanDamagePlayer(IGameModeContext& ctx, Actors::Player* victim, Actors::Player* attacker) -> bool override
Returns whether attacker may hurt victim.
auto CanPlayersPush(IGameModeContext& ctx, Actors::Player* a, Actors::Player* b) -> bool override
Returns true if players a and b push each other when they touch.
auto GetDamage(IGameModeContext& ctx, Actors::Player* victim, Actors::Player* attacker, std::int32_t amount) -> std::int32_t override
Returns the damage attacker deals to victim by one hit of amount.
auto HasDamageAmplifierInOvertime() const -> bool override
Returns true if the damage amplifier turns on in the overtime of this mode.
auto CheckGameEnds(IGameModeContext& ctx) -> GameEndResult override
Checks whether the round should end now, and who won.
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 GetForcedFurColor(std::uint8_t modeFlags) const -> std::uint32_t override
Returns fur color forced on the player by its role in the mode, or 0 to keep it.
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.

Function documentation

bool Jazz2::Multiplayer::GameModes::PestilenceMode::CanDamagePlayer(IGameModeContext& ctx, Actors::Player* victim, Actors::Player* attacker) override

Returns whether attacker may hurt victim.

Called on top of the friendly-fire rule of the host, so a mode only restricts it further.