feat: correctly scale standing and focus limits by mastery rank #711

Merged
Sainan merged 2 commits from daily into main 2025-01-04 20:17:56 -08:00
Owner

Closes #709

Closes #709
coderabbitai[bot] commented 2025-01-04 18:19:07 -08:00 (Migrated from github.com)
Author
Owner

Walkthrough

The pull request modifies the inventoryController.ts file to dynamically calculate daily affiliation values based on the player's level. Previously, all daily affiliation categories were statically set to 16,000. The new implementation introduces a calculation method where daily affiliation values are computed as 16000 + inventory.PlayerLevel * 500. This change applies to multiple affiliation properties across different categories, including PvP, Library, Cetus, Quills, and others. A new property DailyFocus is also added, calculated as 250000 + inventory.PlayerLevel * 5000. The modification aims to make the daily standing reset more responsive to the player's progression by scaling the standing cap with their level.

Assessment against linked issues

Objective Addressed Explanation
Daily Standing reset should scale with Mastery Rank [#709]
Include daily focus calculation [#709]

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.
<!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- walkthrough_start --> ## Walkthrough The pull request modifies the `inventoryController.ts` file to dynamically calculate daily affiliation values based on the player's level. Previously, all daily affiliation categories were statically set to 16,000. The new implementation introduces a calculation method where daily affiliation values are computed as `16000 + inventory.PlayerLevel * 500`. This change applies to multiple affiliation properties across different categories, including PvP, Library, Cetus, Quills, and others. A new property `DailyFocus` is also added, calculated as `250000 + inventory.PlayerLevel * 5000`. The modification aims to make the daily standing reset more responsive to the player's progression by scaling the standing cap with their level. ## Assessment against linked issues | Objective | Addressed | Explanation | |-----------|-----------|-------------| | Daily Standing reset should scale with Mastery Rank [#709] | ✅ | | | Include daily focus calculation [#709] | ✅ | | <!-- walkthrough_end --> <!-- internal state start --> <!-- FAHghAtBAEAqAWBLAztF0CGA7TBXALgPYQDmAplmQE4b5kAm0AxoQLasX4Bc0ADldEIAjAFZkm+RADcyqIQE9mhetQxChifADoMiaFAB8wY+CjGAxOegAFAErQAyrnYYq84wjJ9cAGx/QqMgBHXFl8aEl8HwZoACIAMzJaHhYqQIkfRWQmDGjoZHxsekQsEkw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ZD+AAVNAACsONeky/yM4GnAhiqao7IwSZzVOrDGnqYXAtArC+JI1PXDS1CSLIPCdQAIromTFadS6IHTWCdWuofh/IkdnTHKbWFIvDx9AifHSn0ex7eiBCDQbjZ7nEdR+dKbJWQ+C1OXYd51XaeLQAirgS7Lo3Sf59Xi0OBCrgoD3zep7HABqnDdOsyCj5X48phPhA5vPyct7HACioUXWvfet1q8HiDQa3rHvG8pgAWsPrRxwnTcLwXKYANIYPAPjn4vi3JRgwMYNnoIK7ry/lqAAErmTqFxioAk0ItXIYNMDQEoPZak+ZZyKCAZOaUI01gDXoLgFE9A1z9CQGSEMKMbSdQAEwm2xniJWKter/Q1nzagOtRbQENrQvEkCyaCCgvApQA1/DxDWvZQIrQSioCTK1UoDA1xCAIMKNaG0ExTh3D4SWF1rRHVdhfRaRlUBYAvNAeg8gliNCYGuFQ+YxTWm5lcXmWshY1l1j4PiFgrDFR8EOWOy1hQqCYFLQ0BjRK5meLOfsAgHhCHVLyTYsDZDGBgPBHkuRfEpn8fGQJwS/FhLzFOaS6iYlxM4Ik+scNPa+nGp8VAxRTpjnyrEZJ3lfLCQqKJDApkKpSSsmwGyPAaD2Rqq0JyigXKqC0h5XSrT9IyTGAAfVngsoGOx+gMAWQjWcXkfJzIAMxGwxgADg5niE4JsCT0AJHiAALCcegJsmAEiNnsoQBIMZCD2Xsmh2MqE3LOQSJgQgdltPmZoJZ9BkArJFmsjZIlDBAA= --> <!-- internal state end --> <!-- tips_start --> --- Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <details> <summary>🪧 Tips</summary> ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit <commit_id>, please review it.` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (Invoked using PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR. ([Beta](https://docs.coderabbit.ai/early-access#beta)) - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### Documentation and Community - Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements. </details> <!-- tips_end -->
coderabbitai[bot] (Migrated from github.com) reviewed 2025-01-04 18:22:45 -08:00
coderabbitai[bot] (Migrated from github.com) left a comment
Author
Owner

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/controllers/api/inventoryController.ts (1)

49-49: Factor out the static values for daily focus.

Similarly, the expression 250000 + inventory.PlayerLevel * 5000 is another constant-based calculation repeated only once for now. If it is likely to appear elsewhere or require future modifications (e.g., different scaling factors for new expansions), consider extracting it into a shared helper function or well-documented constant.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea59665a0c and 3568ba0150.

📒 Files selected for processing (1)
  • src/controllers/api/inventoryController.ts (1 hunks)
🔇 Additional comments (1)
src/controllers/api/inventoryController.ts (1)

35-48: Consider extracting repeated daily affiliation logic into a helper function.

These lines use the same formula 16000 + inventory.PlayerLevel * 500 across multiple properties. This repetition can be prone to accidental discrepancies if changes are made later. Extracting the logic into a single helper function or a local variable (e.g., const dailyBase = 16000 + inventory.PlayerLevel * 500;) and then assigning it to each property would make the code more maintainable and consistent.

[refactor_suggestion_good_to_have, verify]

Would you like to automate checking for any calls or references that might rely on hardcoded daily affiliation values outside of this file? If so, I can generate a verification script.

**Actionable comments posted: 0** <details> <summary>🧹 Nitpick comments (1)</summary><blockquote> <details> <summary>src/controllers/api/inventoryController.ts (1)</summary><blockquote> `49-49`: **Factor out the static values for daily focus.** Similarly, the expression `250000 + inventory.PlayerLevel * 5000` is another constant-based calculation repeated only once for now. If it is likely to appear elsewhere or require future modifications (e.g., different scaling factors for new expansions), consider extracting it into a shared helper function or well-documented constant. </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: .coderabbit.yaml** **Review profile: CHILL** **Plan: Pro** <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between ea59665a0c66d3552774a6e463ed60edcf1fbc4c and 3568ba01509d9041d50c953b96b33250024019cb. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `src/controllers/api/inventoryController.ts` (1 hunks) </details> <details> <summary>🔇 Additional comments (1)</summary><blockquote> <details> <summary>src/controllers/api/inventoryController.ts (1)</summary> `35-48`: **Consider extracting repeated daily affiliation logic into a helper function.** These lines use the same formula `16000 + inventory.PlayerLevel * 500` across multiple properties. This repetition can be prone to accidental discrepancies if changes are made later. Extracting the logic into a single helper function or a local variable (e.g., `const dailyBase = 16000 + inventory.PlayerLevel * 500;`) and then assigning it to each property would make the code more maintainable and consistent. [refactor_suggestion_good_to_have, verify] Would you like to automate checking for any calls or references that might rely on hardcoded daily affiliation values outside of this file? If so, I can generate a verification script. </details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Sign in to join this conversation.
No description provided.