Skip to content

Level sync and a point per three losses (0.9.0) - #46

Merged
Finesssee merged 1 commit into
mainfrom
rebalance-level-sync
Oct 20, 2026
Merged

Finesssee merged 1 commit into
mainfrom
rebalance-level-sync

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

What changes for players

  • Level sync. In every duel (ranked or unrated, quick or HP), the stronger fighter's build drops levels until it costs at most 10 points more than the weaker one's. Pet boost counts. Saved builds and levels don't change.
  • Loss points. Every third ranked loss gives an upgrade point. It is counted from the losses total, so past losses count too.
  • The Rules tab and the upgrades help on the fighter page explain both. Bot chat lines are unchanged.

Code

  • server/upgrades.ts: syncPair / syncStats / SYNC_MARGIN, LOSSES_PER_POINT, and an Earned object for pointsFor, effectiveStats, validStats and upgradeRules.
  • server/game.ts: duelStats feeds max HP, quick-duel swings and HP-fight blows.
  • server/channel.ts, src/dashboard.ts: the new signatures. Hidden losses are held back like hidden wins.

Simulation (weaker fighter's win rate against a 40-point build)

Weaker build Before After
0 pts 2.5% 39.1%
10 pts 7.6% 40.3%
20 pts 16.5% 43.8%

Tests

bun run check: 429/429 pass. New tests cover sync in quick duels, syncPair edge cases and loss points.

In every duel the stronger build drops levels until it costs at most 10 points more than the weaker one (syncPair in server/upgrades.ts, used for max HP, quick-duel swings and HP-fight blows). Saved builds are untouched. Every third ranked loss now gives an upgrade point, counted from the losses total. Rules tab, DUELS.md, CONTRACTS.md and the changelog explain both.
@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: nesszer/pixfray/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6f94880c-4f37-4381-a5c5-bf5ff3429f48
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Finesssee
Finesssee merged commit 51bae0b into main Oct 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant