JailbreakMode class
Jailbreak game mode (team-based).
Every roasted player goes to the jail of their team, an area between two Area ID events of the level (the first parameter bit is the team), where the start positions of the team are. A prisoner is free again once out of the area: through a spring of the jail frozen by a teammate (only teammates can freeze them, and nobody in overtime), or when the jails open. Trigger 30 is on for 10 seconds whenever the jails open, the level should warp the prisoners out with it. Jailed players can't be hurt or pushed. When all players of a team are in jail, the other team scores a point, everybody dies (or only the losing team without ServerConfiguration::
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). -
void OnPlayerTeamChanged(IGameModeContext& ctx,
Actors::
Player* player) override - Called when a living player changed the team, right before the player respawns on the new team.
-
auto DecideRespawn(IGameModeContext& ctx,
Actors::
Player* player) -> RespawnDecision override - Decides whether and where the specified player should respawn.
-
auto CanDamagePlayer(IGameModeContext& ctx,
Actors::
Player* victim, Actors:: Player* attacker) -> bool override - Returns whether
attackermay hurtvictim. -
auto CanPlayersPush(IGameModeContext& ctx,
Actors::
Player* a, Actors:: Player* b) -> bool override - Returns
trueif playersaandbpush each other when they touch. -
auto CanFreezeActor(IGameModeContext& ctx,
Actors::
ActorBase* actor, Actors:: Player* shooter) -> bool override - Returns
trueif a shot ofshooter(may benullptr) can freezeactor, it's called also on clients. -
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 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 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.
- auto ProcessCommand(IGameModeContext& ctx, StringView command) -> bool override
- Processes an admin command of the mode (without the leading slash), returns
trueif it was one. - void OnOvertimeStarted(IGameModeContext& ctx) override
- Called when the round goes into overtime.
Function documentation
bool Jazz2:: Multiplayer:: GameModes:: JailbreakMode:: 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.