update:新增1.4.5版本鞭子适配挑战者#1151
Conversation
There was a problem hiding this comment.
Hey - 我发现了 1 个问题,并给出了一些整体性的反馈:
- 在 switch 语句中不断增加的硬编码弹幕(projectile)ID,如果能分组为具名常量或枚举(例如
WhipProjectileIds),而不是使用带注释的裸数字字面量,会更容易维护和理解。 - 建议把重复出现的
TikiArmorEffect/SpookyArmorEffect调用提取到一个小的辅助方法中,这样可以让这个 switch 分支中的控制流更清晰,并在效果行为再次改变时减少重复代码。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- The growing list of hard-coded projectile IDs in the switch statement would be easier to maintain and reason about if they were grouped into named constants or an enum (e.g., `WhipProjectileIds`) instead of raw numeric literals with comments.
- Consider extracting the repeated `TikiArmorEffect` / `SpookyArmorEffect` calls into a small helper method to make the control flow in this switch case clearer and reduce duplication if the effect behavior changes again.
## Individual Comments
### Comment 1
<location path="src/Challenger/Challenger/Challenger.cs" line_range="1777-1786" />
<code_context>
case 913:
case 914:
case 952:
- this.TikiArmorEffect(null, args);
- this.SpookyArmorEffect(args);
- break;
+ case 1028: // 蛛网鞭
+ case 1029: // 魂笞
+ case 1030: // 脉管
+ case 1031: // 星坠
+ case 1032: // 花儿的粗暴展示
+ case 1033: // 电鳗
+ case 1034: // 星座
+ case 1035: // 支配之鞭
+ case 1104: // 史莱姆鞭
case 847:
case 848:
case 849:
case 915:
+ this.TikiArmorEffect(null, args);
+ this.SpookyArmorEffect(args);
this.TikiArmorEffect(null, args, 1);
this.SpookyArmorEffect(args, 1);
break;
</code_context>
<issue_to_address>
**question (bug_risk):** Check whether the extra Tiki/Spooky effect calls for cases 913, 914, and 952 are intentional.
Previously, these cases only ran the first `TikiArmorEffect(null, args)` and `SpookyArmorEffect(args)` and then broke. Now they also run the stronger `TikiArmorEffect(null, args, 1)` and `SpookyArmorEffect(args, 1)` by falling through into the 847/848/849/915 block. Please confirm this behavioral change is intended; otherwise, consider reinstating the `break` or giving 913/914/952 their own block.
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进评审质量。
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- The growing list of hard-coded projectile IDs in the switch statement would be easier to maintain and reason about if they were grouped into named constants or an enum (e.g.,
WhipProjectileIds) instead of raw numeric literals with comments. - Consider extracting the repeated
TikiArmorEffect/SpookyArmorEffectcalls into a small helper method to make the control flow in this switch case clearer and reduce duplication if the effect behavior changes again.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The growing list of hard-coded projectile IDs in the switch statement would be easier to maintain and reason about if they were grouped into named constants or an enum (e.g., `WhipProjectileIds`) instead of raw numeric literals with comments.
- Consider extracting the repeated `TikiArmorEffect` / `SpookyArmorEffect` calls into a small helper method to make the control flow in this switch case clearer and reduce duplication if the effect behavior changes again.
## Individual Comments
### Comment 1
<location path="src/Challenger/Challenger/Challenger.cs" line_range="1777-1786" />
<code_context>
case 913:
case 914:
case 952:
- this.TikiArmorEffect(null, args);
- this.SpookyArmorEffect(args);
- break;
+ case 1028: // 蛛网鞭
+ case 1029: // 魂笞
+ case 1030: // 脉管
+ case 1031: // 星坠
+ case 1032: // 花儿的粗暴展示
+ case 1033: // 电鳗
+ case 1034: // 星座
+ case 1035: // 支配之鞭
+ case 1104: // 史莱姆鞭
case 847:
case 848:
case 849:
case 915:
+ this.TikiArmorEffect(null, args);
+ this.SpookyArmorEffect(args);
this.TikiArmorEffect(null, args, 1);
this.SpookyArmorEffect(args, 1);
break;
</code_context>
<issue_to_address>
**question (bug_risk):** Check whether the extra Tiki/Spooky effect calls for cases 913, 914, and 952 are intentional.
Previously, these cases only ran the first `TikiArmorEffect(null, args)` and `SpookyArmorEffect(args)` and then broke. Now they also run the stronger `TikiArmorEffect(null, args, 1)` and `SpookyArmorEffect(args, 1)` by falling through into the 847/848/849/915 block. Please confirm this behavioral change is intended; otherwise, consider reinstating the `break` or giving 913/914/952 their own block.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| case 913: | ||
| case 914: | ||
| case 952: | ||
| this.TikiArmorEffect(null, args); | ||
| this.SpookyArmorEffect(args); | ||
| break; | ||
| case 1028: // 蛛网鞭 | ||
| case 1029: // 魂笞 | ||
| case 1030: // 脉管 | ||
| case 1031: // 星坠 | ||
| case 1032: // 花儿的粗暴展示 | ||
| case 1033: // 电鳗 | ||
| case 1034: // 星座 |
There was a problem hiding this comment.
question (bug_risk): 请检查对 case 913、914 和 952 额外调用 Tiki/Spooky 效果是否是有意为之。
之前,这几个 case 只会执行第一次 TikiArmorEffect(null, args) 和 SpookyArmorEffect(args) 然后直接跳出(break)。现在它们会继续向下落入 847/848/849/915 这个分支,从而额外执行更强力的 TikiArmorEffect(null, args, 1) 和 SpookyArmorEffect(args, 1)。请确认这种行为变更是否是预期的;如果不是,建议恢复中间的 break,或者给 913/914/952 单独的分支块。
Original comment in English
question (bug_risk): Check whether the extra Tiki/Spooky effect calls for cases 913, 914, and 952 are intentional.
Previously, these cases only ran the first TikiArmorEffect(null, args) and SpookyArmorEffect(args) and then broke. Now they also run the stronger TikiArmorEffect(null, args, 1) and SpookyArmorEffect(args, 1) by falling through into the 847/848/849/915 block. Please confirm this behavioral change is intended; otherwise, consider reinstating the break or giving 913/914/952 their own block.
|
写一下更新日志,在插件的README下面 |
|
好了 |
update:新增1.4.5版本鞭子适配挑战者
Summary by Sourcery
更新 Challenger 插件版本,并扩展鞭类处理逻辑以支持更多投射物。
增强内容:
Original summary in English
Summary by Sourcery
Update Challenger plugin version and extend whip handling to support additional projectiles.
Enhancements: