Module arena

Source
Expand description

Arena rating-change math (code-dispatched by the matchmaking display and fight-result paths).

Asymmetric point exchange: the opponent’s KIND is decided by the honest power ratio opponent_power / player_power at the moment of the fight — below the prey threshold it’s «добыча» (small reward), above the stretch threshold «дерзость» (big reward), otherwise «ровня». Wins pay by kind plus a capped win-streak bonus; losses also cost by kind (losing to a stretch is nearly free, losing to prey is expensive) and cost NOTHING below the newcomer-protection rating — the ladder cushions its floor without capping the top (whales keep dominating by design).

Structs§

RatingChangeCtx
Matchup inputs for the rating math. player_win_streak is the streak BEFORE the fight being scored (so the Nth consecutive win pays base + min((N-1)·step, max)).

Enums§

OpponentKind
Opponent kind by honest power ratio (see module docs).

Functions§

lose_rating_decrease
Rating change on an arena loss: kind-based cost (losing to a stronger opponent costs less), or 0 under the newcomer-protection rating (the ladder’s no-point-loss floor).
opponent_kind
win_rating_increase
Rating gained on an arena win: kind base + capped win-streak bonus.