-
Notifications
You must be signed in to change notification settings - Fork 58
Adjust compulsion buff effect #620
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
Adjust compulsion buff effect #620
Conversation
WalkthroughBuff aggregation and critical-hit logic were adjusted: BuffManager's TotalCompulsionRate now includes compulsion entries with empty SkillIds when computing a skill's compulsion rate; DamageCalculator simplifies and reorders critical-determination and crit-rate override checks, reducing nesting. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
✏️ Tip: You can disable this entire section by setting 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. Comment |
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@Maple2.Server.Game/Util/DamageCalculator.cs`:
- Around line 77-83: The logic currently calls caster.Stats.GetCriticalRate even
when property.CanCrit is false; change the flow in DamageCalculator so
GetCriticalRate is only invoked if CanCrit is true (i.e., keep the
CompulsionTypes check and, if that fails, call caster.Stats.GetCriticalRate only
when property.CanCrit is true), ensuring DamageType only becomes Critical when
CanCrit is true; reference the existing symbols property.CanCrit,
property.CompulsionTypes, DamageType, and caster.Stats.GetCriticalRate (and
BuffCompulsionEventType.CritChanceOverride) to locate and wrap/move the
GetCriticalRate call accordingly.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
Maple2.Server.Game/Manager/BuffManager.csMaple2.Server.Game/Util/DamageCalculator.cs
🧰 Additional context used
🧬 Code graph analysis (1)
Maple2.Server.Game/Util/DamageCalculator.cs (5)
Maple2.Server.Game/Manager/StatsManager.cs (1)
DamageType(103-111)Maple2.Server.Game/Model/Stats.cs (4)
Stats(8-165)Stats(17-33)Stats(35-41)Total(116-126)Maple2.File.Ingest/Utils/AttributeExtensions.cs (1)
BasicAttribute(6-44)Maple2.Server.Core/Formulas/BaseStat.cs (1)
CriticalEvasion(274-274)Maple2.Server.Game/Manager/BuffManager.cs (1)
TotalCompulsionRate(301-308)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build
- GitHub Check: build
🔇 Additional comments (1)
Maple2.Server.Game/Manager/BuffManager.cs (1)
301-308: LGTM!The logic correctly treats compulsions with empty
SkillIdsarrays as global compulsions that apply to all skills. This addresses the Assassin's Fatal Strikes case mentioned in the PR where buffs should apply to all skills when no specific SkillIds are listed.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Maple2.Server.Game/Manager/BuffManager.cs
The main change is the
|| compulsion.SkillIds.Length == 0addition to theWherefilter. Some skills which can buff all other skills, like the Assassin's Fatal Strikes (10800041). Because the player will have aCritChancecompulsion applied to them, but it doesn't affect any particular skill IDs, if the compulsion doesn't have any skill IDs, then it's being interpreted as "this applies to all skills while active".Maple2.Server.Game/Util/DamageCalculator.cs
This change is just to simplify the logic around applying critical damage.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.