Skip to content

fix: prioritize Fatigued status over Fragile in fatigueText - #3218

Draft
domfelipe wants to merge 2 commits into
FreezingMoon:masterfrom
domfelipe:fix/prioritize-fatigued-over-fragile
Draft

domfelipe wants to merge 2 commits into
FreezingMoon:masterfrom
domfelipe:fix/prioritize-fatigued-over-fragile

Conversation

@domfelipe

Copy link
Copy Markdown

This fixes issue #1986

When a creature has a minimal endurance pool (max 1) and it is fully depleted, both isFragile() and isFatigued() are true. The fatigueText getter checked Fragile first, so the queue displayed a misleading Fragile status and logged has become fragile at the wrong moment.

Changes:

  • src/creature.ts: check isFatigued() before isFragile() in the fatigueText getter, so the more severe status is displayed (the fragile log now only fires when the creature is fragile but not fatigued).
  • src/__tests__/creature.ts: 3 new unit tests — fragile+fatigued overlap shows Fatigued (and does not log a misleading message), plain fragile shows Fragile + logs, normal pool shows 3/5.

Validation: full suite 385 passed / lint clean. The new overlap test fails against the original ordering (verified by temporarily reverting the fix).

Note: no bounty attached to this issue, so no wallet address needed.

When a creature has a minimal endurance pool (max 1) and it is fully
depleted, both isFragile() and isFatigued() are true. The getter checked
Fragile first, so the queue displayed a misleading Fragile status and
logged has-become-fragile at the wrong moment.

Fatigued (0/x endurance) is the more severe and accurate status, so it
is now checked first. Fixes FreezingMoon#1986
@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the FreezingMoon Team on Vercel.

A member of the Team first needs to authorize it.

woahwhattheheck added a commit to woahwhattheheck/AncientBeast that referenced this pull request Sep 13, 2026
Preserve Felipe Domingues' exact upstream commit 4d84d7d while incorporating the five concurrent fork commits already on master. No changes are made to Felipe's two-file patch.
woahwhattheheck added a commit to woahwhattheheck/AncientBeast that referenced this pull request Sep 13, 2026
Preserve Felipe Domingues' exact upstream fatigue-priority commit while incorporating the concurrently merged materialization-variety work from fork master. The resulting tree keeps Felipe's two-file patch unchanged.
woahwhattheheck added a commit to woahwhattheheck/AncientBeast that referenced this pull request Sep 13, 2026
…gue-priority

mirror: prioritize Fatigued over Fragile from upstream FreezingMoon#3218
@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ancientbeast Ready Ready Preview Sep 16, 2026 11:48pm UTC

@DreadKnight

Copy link
Copy Markdown
Member

It has errors:

ERROR in /vercel/path0/src/tests/creature.ts
379:13-22
[tsl] ERROR in /vercel/path0/src/tests/creature.ts(379,14)
TS2339: Property 'endurance' does not exist on type '{ health: number; movement: number; }'.
ERROR in /vercel/path0/src/tests/creature.ts
395:13-22
[tsl] ERROR in /vercel/path0/src/tests/creature.ts(395,14)
TS2339: Property 'endurance' does not exist on type '{ health: number; movement: number; }'.
ERROR in /vercel/path0/src/tests/creature.ts
407:13-22
[tsl] ERROR in /vercel/path0/src/tests/creature.ts(407,14)
TS2339: Property 'endurance' does not exist on type '{ health: number; movement: number; }'.
3 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
webpack 5.107.2 compiled with 3 errors in 75989 ms
Error: Command "npm run build" exited with 1

@DreadKnight
DreadKnight marked this pull request as draft September 15, 2026 02:04
The production build type-checks the test sources, and the shared
getCreatureObjMock() fixture declares stats as { health, movement } only,
so assigning stats.endurance directly failed with TS2339 and broke
npm run build.

Set endurance through a small typed helper with a widening cast, leaving
the shared fixture untouched for the other suites. Verified with the full
repo gate: lint, production build and jest (385 passed).
@domfelipe

Copy link
Copy Markdown
Author

Fixed in b8a68b4 — thanks for the report.

Cause: the production build type-checks the test sources, and the shared getCreatureObjMock() fixture declares stats as { health, movement }, so assigning stats.endurance directly was a compile-time error rather than a runtime one.

Endurance is now set through a small typed helper with a widening cast, so the shared fixture stays untouched for the other suites. Verified with the repo's own gate — npm run test (lint + production build + Jest): the build compiles and 385 tests pass.

One note on the check above: the Vercel status is now "Authorization required to deploy" rather than a build failure, so it will not turn green until a team member authorizes the deployment.

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