master does not compile: VitalityService still uses AdditionalTypes - #2333
Conversation
…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>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. WalkthroughThe vitality refresh loop now processes Quest and MaxHpmp cards in one pass. The BlessedHatVnum test setup uses ChangesVitality refresh
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to 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)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
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>
Master has not built since #2321.
dotnet buildfails with fourteen instances ofall in
src/NosCore.GameObject/Services/BattleService/VitalityService.cs.How it happened
#2325 deleted
AdditionalTypes.csand replaced the(type, subtype)pair with a singleBCardEffectkey. #2321 merged right after it, carrying aVitalityServicewritten 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 castingcard.SubTypeto 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 soScaleByLevelis still only called for the two types that matter.The test moved the same way and no longer names a subtype by hand:
Behaviour is unchanged — every case maps one to one, and the two
Questcases keep theirSecondDatacap.Tested
dotnet build NosCore.sln— 0 errors, 0 warnings.dotnet test NosCore.sln --filter TestCategory!=OPTIONAL-TEST— 1013 passed, 0 failed, including the 7VitalityServiceTests.EveryDeclaredEffectIsNamedfails 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.🤖 Generated with Claude Code
Summary by CodeRabbit
Refactor
Tests