Visitar URL original
Trigger the buffs gear grants on attack and defence by erwan-joly · Pull Request #3171 · NosCoreIO/NosCore · GitHub
Skip to content

Trigger the buffs gear grants on attack and defence - #3171

Merged
erwan-joly merged 1 commit into
masterfrom
claude/project-thread-vgcp5g
Nov 14, 2026
Merged

erwan-joly merged 1 commit into
masterfrom
claude/project-thread-vgcp5g

Conversation

@erwan-joly

Copy link
Copy Markdown
Collaborator

Fixes #3169

BCard type 95 subtypes 21/31/41/51 (a chance, on a landed hit, to put a card on the opponent or on oneself) were ignored. A new OnHitBuffService reads the attacker's and defender's gear and active buffs after every landed hit and rolls each line through IBuffService.InflictCardsAsync, so debuff resistance and immunity apply as for skill cards:

  • attacker 21: card on the defender; attacker 31: card on the attacker
  • defender 41: card on the attacker; defender 51: card on the defender

Nothing is put on a defender the hit killed. The "negated" subtypes (22/32/42/52) are left out: no item uses them in a way the data explains.

Client check

Tester (level 80) wears hat costume 8900 (8% card 4426 on self, 3% card 4424 on the enemy) and auto-attacks a Baby Dander for 60 s on Chicken Farm Path.

Build bf packets during the minute
master none
this PR bf 1 1 0.4426.100 80 twice on Tester, bf 3 990005 0.4424.100 80 twice on the monster, each followed by its .0 end

The card 4426 crescent icon shows on Tester's buff bar and above the character while it lasts.

Tests

  • OnHitBuffTests: each of the four subtypes reaches InflictCardsAsync with the right target, caster, chance and card; a killed defender gets nothing.
  • dotnet test on GameObject.Tests: 2030 passed.

Manual test plan

Added "Buffs triggered by hits" to documentation/manual-test-plan.md:

  • Wear hat 8900 and auto-attack a monster for a minute: card 4426 shows on your buff bar now and then, and card 4424 lands on the monster.
  • Gear that triggers on defence puts its card on you, or on the attacker, when you are hit (not checked in the client).

Generated by Claude Code

Fixes #3169

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014gSmkTnTjQfc83H72tpiYm
@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c4a189f and 54877e3.

Files selected for processing: 8

  • documentation/manual-test-plan.md
  • src/NosCore.GameObject/Services/BattleService/HitQueue.cs
  • src/NosCore.GameObject/Services/BattleService/IOnHitBuffService.cs
  • src/NosCore.GameObject/Services/BattleService/OnHitBuffService.cs
  • test/NosCore.GameObject.Tests/Services/BattleService/HitQueueTests.cs
  • test/NosCore.GameObject.Tests/Services/BattleService/OnHitBuffTests.cs
  • test/NosCore.GameObject.Tests/Services/BattleService/RevivalProtectionTests.cs
  • test/NosCore.GameObject.Tests/Services/BattleService/VitalsConcurrencyTests.cs
  • 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

@erwan-joly
erwan-joly merged commit 66f967e into master Nov 14, 2026
2 checks 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.

Gear chances to trigger a buff on attack or defence are ignored

2 participants