Skip to content

Damage as a percentage of HP, which the case did not read - #2306

Open
denislauri1999 wants to merge 1 commit into
NosCoreIO:masterfrom
denislauri1999:pr/percentage-hp-damage
Open

Damage as a percentage of HP, which the case did not read#2306
denislauri1999 wants to merge 1 commit into
NosCoreIO:masterfrom
denislauri1999:pr/percentage-hp-damage

Conversation

@denislauri1999

Copy link
Copy Markdown
Contributor

BCard type 37 subtype 31 — "Decreases the opponent's HP by %s%%."

112 of the 122 declarations on skills are this one subtype, and nothing read it: the skills carrying it did none of what they declare. The percentages in the file run from 5% to 100%, with 90% appearing twelve times — these are boss skills meant to take most of a health bar in one blow.

One assumption is ours

The percentage comes off maximum HP. The file says only "HP by %s%%" and does not distinguish, so this is the one point that does not come from it. Off current HP the loss would halve and halve again without ever finishing anything, which is not what a skill declaring 90% is for.

It is the same assumption the sibling codebase already carries, so the two do not drift.

One difference from the sibling, on purpose

It can kill. The loss is part of the same subtraction as the blow, so the ordinary death path handles it.

The sibling floors the victim at 1 HP, but that is a workaround for where it applies the effect — outside the blow, where a kill would bypass the death sequence. Here that does not arise, and nothing in the file says the effect must leave its victim standing.

Left out

Subtype 32 hits the caster instead, and no skill in the file declares it. Written blind against no data it would be a guess, so it is not here.

Checked by breaking it

Reading the percentage off current HP instead of maximum fails two of the five tests. One test also documents an existing guard I ran into: a blow whose ordinary damage rolls to zero is already treated as a miss, so the percentage rides along with a blow that landed rather than standing on its own.

BCard type 37 subtype 31, "Decreases the opponent's HP by %s%%". 112 of the 122
declarations on skills are this one subtype, and nothing read it: the skills
carrying it did none of what they declare.

The percentages in the file run from 5% to 100%, with 90% twelve times - these
are boss skills that are meant to take most of a health bar in one blow.

ONE ASSUMPTION IS OURS, and it is the same one the sibling codebase carries so
the two do not drift: the percentage comes off MAXIMUM HP. The file says only
"HP by %s%%" and does not distinguish. Off current HP the loss would halve and
halve again without ever finishing anything, which is not what a skill declaring
90% is for.

It is part of the same subtraction as the blow, so it can kill and the ordinary
death path handles it. That is a deliberate difference from the sibling, which
floors the victim at 1 HP - a workaround for applying the effect outside the
blow, where a kill would bypass the death sequence. Nothing in the file says the
effect must leave its victim standing.

Subtype 32 hits the caster and no skill in the file declares it, so it is left
out rather than written blind against no data.

Reading the percentage off current HP instead of maximum fails two tests.
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 17 minutes.

View limit details

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

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

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 033a9883-b6e3-4166-9718-9fad7ae6b6ee

📥 Commits

Reviewing files that changed from the base of the PR and between 55dc38c and 9e72385.

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

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.

@denislauri1999

Copy link
Copy Markdown
Contributor Author

Heads-up for whoever merges: this compiles on its own but not alongside another of my open PRs, and git will not warn you — the merge is clean and the break shows up at build time.

HitQueue gains an IInflictedCardService parameter in #2304. The QueueDealing helper this PR adds to HitQueueTests constructs it with the current five arguments, so after both land it needs new Mock<IInflictedCardService>().Object before the logger.

I found it by merging all nine of today's branches onto a scratch branch: with those two lines fixed the lot builds at zero warnings and passes 983 tests. Pairwise git merge-tree says every combination is clean, which is true and not enough.

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.

1 participant