Skip to content

Free daily path switch for Mage paths, with shared exp-table rewards - #161

Merged
XxFran10xX merged 3 commits into
mainfrom
feat/mage-path-switch
Nov 19, 2026
Merged

XxFran10xX merged 3 commits into
mainfrom
feat/mage-path-switch

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Status record

Left alone from the review: shared claims also count the table's slot-unlock items, so a new Mage path doesn't replay mmocore admin slot unlock. Mage classes have no bindable skills, so nothing is lost; a future free-switch family with skills would need slot unlocks copied.

Why

Mage is becoming a base class with three weapon paths from level 1 (Invoker with staffs, Conjurer with wands, Battlemage with blades; ServerAssets PR). A Mage has no class skills or skill points: its whole kit is the weapon. So moving between Mage paths should cost nothing more than building the other weapon. It should be free once a day, through the normal /class picker.

What

  • class-selection.free-path-switch (classes, cooldown, default none and 24h). Moving between two subclasses of a listed base class is free once per cooldown. A second move inside the cooldown is priced like any other class change. An open class lock window, infinite points and the first free subclass still win, and none of them spend the daily switch.
  • The character file keeps the last free switch under class-picks.free-switch-at (epoch ms). It is omitted until first used and read back safely.
  • The picker shows "Uses your free path switch for 1d" or "Free path switch again in 5h 12m" on each path. The Your Class book shows "Path switch: Free now / Free in …".
  • Shared rewards. MMOCore keys exp-table claims by class, so three paths on mage_exp_table would each hand out the level 2 runestones again. Before replaying missed rewards, a class in a free-switch family takes the highest claim any family member (base class and its subclasses) made on the same table. Other classes are unchanged.
    • The table's slot unlocks then don't replay for the new path either. A Mage has no slot skills, so nothing is lost.
  • Default config.yml documents the block with no classes.

Not in this PR

No release, nothing on Main or Tutorial. Configs and class files: ServerAssets. Old mage weapons getting the new class lists: Magic.

🤖 Generated with Claude Code

…able rewards

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

  • Trigger review

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

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5eba785a-6de4-4d3a-8031-0282f4b3a13b
Summary

Summary by CodeRabbit

  • New Features
    • Eligible class-path switches can be free after a configurable cooldown. The class selection screen shows notes about switch costs and eligibility.
    • Experience rewards are shared across related classes that use the same experience table, preventing duplicate claims.
  • Configuration
    • Added settings to choose which classes qualify for free path switches and set the cooldown. Defaults are no eligible classes and a 24-hour cooldown.

The change adds configurable free subclass path switches with a cooldown. It stores the time of the last free switch and synchronises experience reward claims across eligible classes that use the same experience table.

Changes: Free path switching

Layer / File(s) Summary
Configuration and switch pricing
src/main/java/net/tfminecraft/rpcharacters/classpick/*, src/main/resources/config.yml, src/test/java/net/tfminecraft/rpcharacters/classpick/ClassPickTest.java
Configuration now accepts eligible class IDs and a cooldown. Class selection applies free-switch eligibility after existing free-pick rules, records the timestamp after a free switch, and adds switch notes to the picker lore. Tests cover configuration defaults, pricing, cooldowns, notes, and reward-family results.
Switch timestamp storage
src/main/java/net/tfminecraft/rpcharacters/objects/RPCharacter.java, src/main/java/net/tfminecraft/rpcharacters/database/CharacterClassPickFields.java, src/test/java/net/tfminecraft/rpcharacters/database/CharacterFieldsRuntimeTest.java
RPCharacter stores a non-negative free-switch timestamp. Character class-pick data loads and saves it, including when it is the only class-pick state. Tests cover round-tripping and invalid or negative values.
Shared experience claims
src/main/java/net/tfminecraft/rpcharacters/mmocore/ClassService.java, src/test/java/net/tfminecraft/rpcharacters/mmocore/ClassServiceFamilyClaimsTest.java
Before claiming missed level rewards, ClassService raises the selected class’s item claims to the highest recorded claims from other reward-family classes using the same experience table. Tests cover matching tables, excluded claims, and an empty family.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ClassPickGui
  participant ClassPickService
  participant RPCharacter
  ClassPickGui->>ClassPickService: Request path-switch price and note
  ClassPickService->>RPCharacter: Read last free-switch timestamp
  ClassPickService->>ClassPickGui: Return price and switch note
  ClassPickGui->>ClassPickService: Choose class option
  ClassPickService->>RPCharacter: Record timestamp after a free path switch
Loading

Possibly related PRs

  • TF-Minecraft/RPCharacters#154: Changes first-free subclass pick rules and picker lore, which overlap with this change’s class-pick pricing and display logic.

Suggested reviewers: ryanbarlow97, drefvelin

Merge Risk: Low · previous review 9e912

Free path switching and shared exp-table rewards appear functionally sound. The picker can show a cooldown message beside "Cost: Free" when an admin free pick or an open class-lock window applies, which may confuse players but does not change pricing. This is safe to merge, and the wording can be improved in a follow-up.

- [ ] 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

@github-actions github-actions Bot added the size:L 100-499 effective changed lines (tests excluded in mixed PRs). label Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@XxFran10xX
XxFran10xX marked this pull request as ready for review November 19, 2026 12:09
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional comments: 1

src/main/java/net/tfminecraft/rpcharacters/classpick/ClassPickService.java-242-244: 1

242-244: Minor · Functional Correctness · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Apply free-pick precedence to the availability text.

If the daily cooldown is active but staff grants a free subclass pick or opens the class-lock window, quote correctly returns a free pick without consuming the daily allowance. These lines still report “Free path switch again in” and “Path switch: Free in”. The picker can therefore show Cost: Free beside a wait message.

Apply the same precedence to these notes, or label the countdown explicitly as the next daily allowance. Keep the countdown when the switch would otherwise cost money.

Also applies to: 569-571

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 575a3ae9-d01f-4391-8aed-05236f132598
Commits

Reviewing files that changed from the base of the PR and between 8aeecbe and 9e91235.

Files selected for processing: 10

  • src/main/java/net/tfminecraft/rpcharacters/classpick/ClassPickConfig.java
  • src/main/java/net/tfminecraft/rpcharacters/classpick/ClassPickGui.java
  • src/main/java/net/tfminecraft/rpcharacters/classpick/ClassPickService.java
  • src/main/java/net/tfminecraft/rpcharacters/database/CharacterClassPickFields.java
  • src/main/java/net/tfminecraft/rpcharacters/mmocore/ClassService.java
  • src/main/java/net/tfminecraft/rpcharacters/objects/RPCharacter.java
  • src/main/resources/config.yml
  • src/test/java/net/tfminecraft/rpcharacters/classpick/ClassPickTest.java
  • src/test/java/net/tfminecraft/rpcharacters/database/CharacterFieldsRuntimeTest.java
  • src/test/java/net/tfminecraft/rpcharacters/mmocore/ClassServiceFamilyClaimsTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Nov 19, 2026
CodeRabbit: with the daily switch on cooldown, a pick made free by an open
class lock window or a free subclass pick still showed 'Free path switch
again in'. The note now follows the quote.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@XxFran10xX
XxFran10xX merged commit 6632a54 into main Nov 19, 2026
3 of 4 checks passed
@XxFran10xX
XxFran10xX deleted the feat/mage-path-switch branch November 19, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant