-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
修改了战斗临时buff存储方式到对象存储 #86
Conversation
审核者指南由 Sourcery 提供此拉取请求通过引入基于类的存储而不是全局变量来重构战斗增益存储系统。主要更改涉及创建两个新类 - BossBuff 和 UserRandomBuff - 以封装之前存储在全局变量中的增益相关状态。 BossBuff 和 UserRandomBuff 的类图classDiagram
class BossBuff {
+int boss_zs
+int boss_hx
+int boss_bs
+int boss_xx
+int boss_jg
+int boss_jh
+int boss_jb
+int boss_xl
}
class UserRandomBuff {
+int random_break
+int random_xx
+int random_hx
+int random_def
}
文件级更改
提示和命令与 Sourcery 互动
自定义您的体验访问您的仪表板以:
获取帮助Original review guide in EnglishReviewer's Guide by SourceryThis pull request refactors the battle buff storage system by introducing class-based storage instead of global variables. The main changes involve creating two new classes - BossBuff and UserRandomBuff - to encapsulate buff-related state that was previously stored in global variables. Class diagram for BossBuff and UserRandomBuffclassDiagram
class BossBuff {
+int boss_zs
+int boss_hx
+int boss_bs
+int boss_xx
+int boss_jg
+int boss_jh
+int boss_jb
+int boss_xl
}
class UserRandomBuff {
+int random_break
+int random_xx
+int random_hx
+int random_def
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嘿 @AnLanyoru - 我已经审查了你的更改 - 这里有一些反馈:
总体评论:
- 考虑在未来的 PR 中将数值魔法值(如增益百分比和阈值)提取为命名常量,以提高代码可读性
这是我在审查期间查看的内容
- 🟢 一般问题:一切看起来都很好
- 🟢 安全性:一切看起来都很好
- 🟢 测试:一切看起来都很好
- 🟢 复杂性:一切看起来都很好
- 🟢 文档:一切看起来都很好
帮助我变得更有用!请点击每条评论上的 👍 或 👎,我将使用反馈来改进你的评论。
Original comment in English
Hey @AnLanyoru - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider extracting numeric magic values (like buff percentages and thresholds) into named constants in a future PR to improve code readability
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
原代码因为boss_zs boss_hx等等会在战斗的同时被声明全局,如果有玩家A进行boss战,此时boss_zs等buff会遗留在全局变量,而无论玩家战斗或是boss战斗的函数均调用全局boss_zs等参数,此时会导致buff遗留。
Summary by Sourcery
增强功能:
Original summary in English
Summary by Sourcery
Enhancements: