You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Free daily path switch for Mage paths, with shared exp-table rewards - #161
Second opinion: CodeRabbit APPROVED at 9e91235 with one unverified minor (the picker showed the path switch wait on a pick that was free anyway, inside the class lock window); fixed in ed0596c, minor and no saved data, so not re-reviewed
Dev-tested: 9e91235 (with Magic 6b47ac9 and the ServerAssets tool): 18/18 bot checks; ed0596c's fix: on Invoker inside the class window with the daily switch on cooldown, the Conjurer tile shows Cost: Free and no wait (2/2); Dev log has only its usual errors
Local tests: ClassPickTest (32) and ClassServiceFamilyClaimsTest pass at ed0596c; CI build (tests + 100% line coverage) green at ed0596c
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.
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.
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.
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.
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.
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.
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.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:L100-499 effective changed lines (tests excluded in mixed PRs).
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
/classpicker.What
class-selection.free-path-switch(classes,cooldown, default none and24h). 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.class-picks.free-switch-at(epoch ms). It is omitted until first used and read back safely.mage_exp_tablewould 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.config.ymldocuments 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