Skip to content

master does not compile: VitalityService still uses AdditionalTypes - #2333

Merged
erwan-joly merged 1 commit into
NosCoreIO:masterfrom
denislauri1999:pr/vitality-bcard-effect
Aug 28, 2026
Merged

erwan-joly merged 1 commit into
NosCoreIO:masterfrom
denislauri1999:pr/vitality-bcard-effect

Conversation

@denislauri1999

@denislauri1999 denislauri1999 commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Master has not built since #2321. dotnet build fails with fourteen instances of

error CS0246: The type or namespace name 'AdditionalTypes' could not be found

all in src/NosCore.GameObject/Services/BattleService/VitalityService.cs.

How it happened

#2325 deleted AdditionalTypes.cs and replaced the (type, subtype) pair with a single BCardEffect key. #2321 merged right after it, carrying a VitalityService written against the old API. Each was green on its own branch; together they do not compile. Nothing in either diff touches the other file, which is why neither review could have caught it.

The change

card.Effect() instead of casting card.SubType to a per-type enum, and the flattened members — BCardEffect.QuestAdditionalHpPercent, BCardEffect.MaxHpmpMaximumHpIncreased, and so on. The two switches collapse into one because the key already carries the type; the early filter stays in front so ScaleByLevel is still only called for the two types that matter.

The test moved the same way and no longer names a subtype by hand:

Type = BCardEffect.MaxHpmpMaximumHpIncreased.Type(),
SubType = BCardEffect.MaxHpmpMaximumHpIncreased.SubType(),

Behaviour is unchanged — every case maps one to one, and the two Quest cases keep their SecondData cap.

Tested

  • dotnet build NosCore.sln — 0 errors, 0 warnings.
  • dotnet test NosCore.sln --filter TestCategory!=OPTIONAL-TEST — 1013 passed, 0 failed, including the 7 VitalityServiceTests.
  • Without the filter, EveryDeclaredEffectIsNamed fails on 231 unnamed effects. That is the opt-in test Make the BCard (type, subtype) pair one key #2325 added and it is what Name every declared effect the client describes #2329 is for — it is excluded in CI and it fails on master today with or without this change.
  • Not played. The NosCore servers are not run here, so this is the compiler and the test suite, nothing more.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor

    • Streamlined vitality effect processing for quest and maximum HP/MP cards.
    • Preserved existing health and mana bonuses, reductions, percentage effects, caps, and paired maximum-stat changes.
  • Tests

    • Updated test setup to use the corresponding maximum HP/MP effect definitions without changing expected behavior.

…tionalTypes

NosCoreIO#2325 deleted `AdditionalTypes.cs` and replaced the (type, subtype) pair with a
single `BCardEffect` key. NosCoreIO#2321 merged right after it, carrying a
`VitalityService` written against the old API, and the two are individually green
and broken together: `error CS0246: AdditionalTypes could not be found`, fourteen
times, on every build since.

Ported: `card.Effect()` instead of casting `card.SubType` to a per-type enum, and
the flattened members - `BCardEffect.QuestAdditionalHpPercent`,
`BCardEffect.MaxHpmpMaximumHpIncreased` and the rest. The two switches become one
because the key already carries the type, with the same early filter in front so
`ScaleByLevel` is still only called for the two types that matter.

The test moved the same way and no longer names a subtype by hand:
`BCardEffect.MaxHpmpMaximumHpIncreased.Type()` / `.SubType()`.

Behaviour is unchanged - every case maps one to one.

Tested: build 0 errors 0 warnings; `dotnet test --filter TestCategory!=OPTIONAL-TEST`
green, 1013 passed. Not played: the NosCore servers are not run here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: be0fd222-716d-4704-957f-5d19dcbf0462

📥 Commits

Reviewing files that changed from the base of the PR and between 195dfd5 and b518434.

📒 Files selected for processing (2)
  • src/NosCore.GameObject/Services/BattleService/VitalityService.cs
  • test/NosCore.GameObject.Tests/Services/BattleService/VitalityServiceTests.cs

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


Walkthrough

The vitality refresh loop now processes Quest and MaxHpmp cards in one pass. The BlessedHatVnum test setup uses BCardEffect helpers instead of hardcoded byte casts.

Changes

Vitality refresh

Layer / File(s) Summary
Unified vitality effect dispatch
src/NosCore.GameObject/Services/BattleService/VitalityService.cs, test/NosCore.GameObject.Tests/Services/BattleService/VitalityServiceTests.cs
The refresh loop filters card types once, scales values once, and dispatches effects through BCardEffect. The test setup derives Type and SubType from BCardEffect helpers.

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

Merge Risk: ⚪ Minimal · up to b5184

This change restores compilation by updating vitality calculations to the current effect-key API while preserving existing mappings and tests. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately identifies the compilation issue in VitalityService caused by remaining AdditionalTypes references. It clearly describes the main purpose of the pull request.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@erwan-joly
erwan-joly merged commit 12322f0 into NosCoreIO:master Aug 28, 2026
2 checks passed
denislauri1999 added a commit to denislauri1999/NosCore that referenced this pull request Aug 28, 2026
NosCoreIO#2325 ha cancellato `AdditionalTypes` sostituendo la coppia (tipo, sottotipo) con
la chiave unica `BCardEffect`, quindi il ciclo di `InflictCardsAsync` non
compilava piu' dopo la fusione. Portato allo stesso modo di `VitalityService` in
NosCoreIO#2333: `bCard.Effect()` invece del cast del sottotipo, e
`BCardEffect.BuffChanceCausing` / `BuffChanceRemoving` al posto dei due membri
dell'enum sparito.

Il test non nomina piu' un sottotipo a mano: `effect.Type()` e `effect.SubType()`.

E `HitQueueTests` ha preso il parametro `IVitalityService` che master ha aggiunto
al costruttore di `HitQueue`.

Build pulita, 1021 test verdi col filtro della CI.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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