Skip to content

Cast the specialist's skill while transformed - #3603

Merged
erwan-joly merged 1 commit into
NosCoreIO:masterfrom
Sosotess93:fix/specialist-skill-cast-id
Nov 20, 2026
Merged

erwan-joly merged 1 commit into
NosCoreIO:masterfrom
Sosotess93:fix/specialist-skill-cast-id

Conversation

@Sosotess93

@Sosotess93 Sosotess93 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Class skills and specialist skills reuse the same cast ids. For example, Ice Bolt (mage) and Volcano's Magma Plating are both cast id 3, and Magic Bullet and Holy Mage's Holy Weapon are both cast id 8.

SkillService.LoadSpecialistSkillsAsync adds the specialist's skills next to the class skills in character.Skills, and SkillResolver.FindLearned searched all of them by cast id without looking at UseSp. A transformed player's cast could therefore resolve to the class skill. That skill's target type no longer matched what the client sent (Magma Plating targets the caster, Ice Bolt an enemy), so the cast was cancelled (cancel 2 ...) and most specialist skills could not be used.

FindLearned is used both by the packet guard (UseSkillPacketHandler, UseAoeSkillPacketHandler, cooldown and mana) and by SkillResolver.Resolve, so both picked the wrong skill.

Fix

FindLearned now only searches the skills the character can cast right now: the specialist's skills (IsSpecialist()) while transformed, the class's otherwise.

Tests

In SkillResolverTests, with a character knowing both Ice Bolt (263) and Magma Plating (1081) on cast id 3:

  • ATransformedCharacterCastsTheSpecialistSkillOfACastIdItsClassAlsoUses: transformed, cast id 3 resolves to Magma Plating. This test fails without the fix.
  • AnUntransformedCharacterCastsTheClassSkillOfACastIdASpecialistAlsoUses: untransformed, it resolves to Ice Bolt.

The skill and battle tests (607 in NosCore.GameObject.Tests) and the skill, battle and mate packet handler tests (156) pass. Also checked in game: Volcano's skills, cancelled before the fix, now cast.

Summary by CodeRabbit

  • Bug Fixes
    • Skill selection now accounts for a character’s transformation state when choosing between learned skills that share a cast ID. Transformed characters select the specialist skill, while untransformed characters select the non-specialist skill.

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4216084 and 64fc2cd.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

FindLearned now filters skills by the character's transformation state. Tests verify that it selects the specialist skill when transformed and the class skill when untransformed.

Changes

Skill Lookup

Layer / File(s) Summary
Filter and verify learned skills
src/NosCore.GameObject/Services/BattleService/SkillResolver.cs, test/NosCore.GameObject.Tests/Services/BattleService/SkillResolverTests.cs
FindLearned now matches specialist status to character.UseSp. Tests use two skills with cast ID 3 and assert the expected selection for each transformation state.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: claude, erwan-joly

Merge Risk: Minimal · previous review 42160

This change makes a transformed character cast the specialist skill, not a class skill that shares its cast ID. Tests cover both states, and no actionable merge risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Cast the specialist's skill while transformed" matches the main change. The PR changes SkillResolver.FindLearned to pick specialist skills while transformed and non-specialist skills otherw…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Cast the specialist's skill while transformed" matches the main change. The PR changes SkillResolver.FindLearned to pick specialist skills while transformed and non-specialist skills otherwise, which fixes cast-ID collisions between class and specialist skills. The title is specific and describes the primary behavior change, and it does not include file lists or vague terms.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 683641b and 4216084.

Files selected for processing: 2

  • src/NosCore.GameObject/Services/BattleService/SkillResolver.cs
  • test/NosCore.GameObject.Tests/Services/BattleService/SkillResolverTests.cs

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Class and specialist skills reuse the same cast ids: Ice Bolt and
Volcano's Magma Plating are both 3, Magic Bullet and Holy Mage's Holy
Weapon are both 8. Loading a specialist adds its skills next to the class
ones, and FindLearned searched them all, so a transformed player's cast
could resolve to the class skill. Its target type did not match what the
client sent, and the cast was cancelled: most specialist skills could not
be used.

Only search the specialist's skills while transformed, and the class's
otherwise.
@Sosotess93
Sosotess93 force-pushed the fix/specialist-skill-cast-id branch from 4216084 to 64fc2cd Compare November 19, 2026 10:56

@erwan-joly erwan-joly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and tested on top of current master (9cc1908), since CI has not run on this fork's branch.

The change reads right. While transformed, the cast-id lookup only searches the specialist's skills, and otherwise only the class's. That matches the skill bar the client shows, so a specialist skill that shares its cast id with a class skill (Magma Plating and Ice Bolt, both 3) now resolves to the specialist's. Upgrade lookups still go through every skill, and passives are untouched.

Results after rebasing onto master:

  • dotnet build NosCore.sln: 0 errors.
  • GameObject.Tests 2822/2822 and PacketHandlers.Tests 1003/1003.
  • End-to-end Fight, Specialist and Skill scenarios: 29 of 31 on the first run, while the lab database went down mid-run. The two that failed (TheLivingCannotReviveThemselvesBackToFullHp and ASkillIsRefusedToSomeoneWithoutTheMpForIt) pass when re-run, so nothing in this change broke them.

Generated by Claude Code


Generated by Claude Code

@erwan-joly
erwan-joly merged commit 77a6bc6 into NosCoreIO:master Nov 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants