feat(stats_calc): recalculate character stats based on master skills#300
Conversation
olisikh commented Mar 22, 2026
- recalculate character stats based on master skills (works after relogin too)
- calculate defense success rate, both pvm and pvp and reflect it on character info pane
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the accuracy and display of character statistics within the game's UI. It introduces a robust mechanism to recalculate character attributes based on learned master skills, ensuring that these crucial values are correctly applied and presented to the player. The primary focus is on the precise calculation and visualization of defense success rates for different combat contexts, making the character information window more informative and reliable. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the calculation of character stats from master skills, which is a great improvement in terms of readability, correctness, and efficiency. The introduction of helper functions in an anonymous namespace is a good approach. I've added a couple of suggestions to make the new helper functions even more concise and efficient.
| const auto firstSkillInfo = CharacterAttribute->MasterSkillInfo[firstSkill]; | ||
| const auto secondSkillInfo = CharacterAttribute->MasterSkillInfo[secondSkill]; | ||
| | ||
| if (secondSkillInfo.GetSkillLevel() > firstSkillInfo.GetSkillLevel()) | ||
| { | ||
| return secondSkillInfo.GetSkillValue(); | ||
| } | ||
| | ||
| return firstSkillInfo.GetSkillValue(); |
There was a problem hiding this comment.
This function can be made more concise and efficient. Using const auto& avoids unnecessary copies of the skill info objects, and a ternary operator can simplify the logic.
const auto& firstSkillInfo = CharacterAttribute->MasterSkillInfo[firstSkill]; const auto& secondSkillInfo = CharacterAttribute->MasterSkillInfo[secondSkill]; return (secondSkillInfo.GetSkillLevel() > firstSkillInfo.GetSkillLevel()) ? secondSkillInfo.GetSkillValue() : firstSkillInfo.GetSkillValue();| if (multiplier < 1.0f) | ||
| { | ||
| return 1.0f; | ||
| } | ||
| | ||
| return multiplier; |
ba99b73 to 64eff66 Compare | Thanks :) |