[PR #8326] [MERGED] fix(game): health held into a tier sets back a choice that keeps it from moving #8274

Closed
opened 2026-10-26 04:04:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8326
Author: @kolacheee
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @kolacheee

Base: staging ← Head: fix/health-hold-method-reset


📝 Commits (2)

  • d42ffa8 fix(game): health held into a tier sets back a choice that keeps it from moving
  • 39fbe5e fix(game): only a choice that stops health's field counting is set back

📊 Changes

2 files changed (+164 additions, -26 deletions)

View changed files

📝 packages/shared/src/features/ruleset-combat/hold.ts (+92 -24)
📝 scripts/regressions/game-ruleset-combat-creature-sheets.regression.ts (+72 -2)

📄 Description

Linked issue

Closes #8325

Why this change

Before: when the Game Master wrote a sheet for an invented creature that also picked a way of counting health that never reads the typed number (5e's "Average" hit points), holding its health into the tier's band changed nothing. A mage stayed at 38 hit points under a band of 45 to 120, and the adjustment said health "was moved toward" the band.

After: when only that choice stands in the way, it goes back to the ruleset's default and health lands in the band. The adjustment line says which choice was set back.

What changed

  • holdRulesetSheetHealth searches the field as before. If that cannot reach the band and the field does not count at all as written, it tries setting back each enum choice that the health pool's maximum reads and that the sheet set away from its default. It keeps the first one after which the field counts again and health lands in the band.
  • A choice that moves health by itself (a creature's own hit die, a class) is never set back, and a field that counts but runs out of room sets nothing back.
  • The adjustment line names the reset choice ("with its Hit points method set back to the ruleset's default").
  • The creature-sheets regression gains a method field that reads no typed number, a build field that moves health without it, and a capped typed number. The method case fails on staging; the build case fails without the "field counts again" guard.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • scripts/regressions/game-ruleset-combat-creature-sheets.regression.ts passes, and fails on staging with "Health 28 was moved toward the 45 to 82 of CR 3 ... and is now 28."
  • packages/shared lint (registries + tsc --noEmit) and prettier are clean.
  • Checked which enums each example and converted ruleset's health maximum reads: 5e reads its hit point method, first-level die and hit die. Only the method stops the typed number counting, so only it can be set back.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8326 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `fix/health-hold-method-reset` --- ### 📝 Commits (2) - [`d42ffa8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d42ffa857d4755f0934c553c546a0a7436ff3ddc) fix(game): health held into a tier sets back a choice that keeps it from moving - [`39fbe5e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/39fbe5e1196b952ce88a656127317309509f91f3) fix(game): only a choice that stops health's field counting is set back ### 📊 Changes **2 files changed** (+164 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `packages/shared/src/features/ruleset-combat/hold.ts` (+92 -24) 📝 `scripts/regressions/game-ruleset-combat-creature-sheets.regression.ts` (+72 -2) </details> ### 📄 Description ## Linked issue Closes #8325 ## Why this change Before: when the Game Master wrote a sheet for an invented creature that also picked a way of counting health that never reads the typed number (5e's "Average" hit points), holding its health into the tier's band changed nothing. A mage stayed at 38 hit points under a band of 45 to 120, and the adjustment said health "was moved toward" the band. After: when only that choice stands in the way, it goes back to the ruleset's default and health lands in the band. The adjustment line says which choice was set back. ## What changed - `holdRulesetSheetHealth` searches the field as before. If that cannot reach the band and the field does not count at all as written, it tries setting back each enum choice that the health pool's maximum reads and that the sheet set away from its default. It keeps the first one after which the field counts again and health lands in the band. - A choice that moves health by itself (a creature's own hit die, a class) is never set back, and a field that counts but runs out of room sets nothing back. - The adjustment line names the reset choice ("with its Hit points method set back to the ruleset's default"). - The creature-sheets regression gains a method field that reads no typed number, a build field that moves health without it, and a capped typed number. The method case fails on staging; the build case fails without the "field counts again" guard. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - `scripts/regressions/game-ruleset-combat-creature-sheets.regression.ts` passes, and fails on staging with "Health 28 was moved toward the 45 to 82 of CR 3 ... and is now 28." - `packages/shared` lint (registries + `tsc --noEmit`) and prettier are clean. - Checked which enums each example and converted ruleset's health maximum reads: 5e reads its hit point method, first-level die and hit die. Only the method stops the typed number counting, so only it can be set back. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 04:04:18 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8274
No description provided.