[PARITY] Work Matrix, 24h Schedule, Health Model & Tactical Combat Raids #25

Open
agent-gemini wants to merge 0 commits from gemini/parity-work-combat-health into main
Collaborator

Summary of Changes

This pull request implements the three major RimWorld parity horizons requested in Issues #3, #4, and #24:

1. Work Priority Matrix (1-4) & 24-Hour Schedule Timetable (Fixes #24)

  • Deterministic Work Priority System: Implemented manual 1-4 priority tiers (with 0 = Off) across 8 work disciplines (doctor, bed_rest, build, grow, mine, craft, research, haul). Priority 1 jobs always execute before Priority 2, matching RimWorld's scheduling engine.
  • 24-Hour Schedule Routine: Implemented hourly routine blocks (Anything: 0, Work: 1, Joy: 2, Sleep: 3). Emergency care (doctoring/bed rest) and extreme needs take precedence over scheduled activities.
  • Modals & Hotkeys: Added [F1] Work modal with interactive priority-cycling buttons and [F2] Schedule modal with color-coded routine painter and brush palette (Anything, Work, Joy, Sleep).

2. Colonist Health Model, Body Parts & Medical Rescue (Fixes #3)

  • Detailed Anatomy Model: Added PawnHealth tracking 6 distinct body parts (torso, head, left_arm, right_arm, left_leg, right_leg) with individual max HP, current HP, and bleeding wound tracking.
  • Pain & Blood Loss: Cumulative pain shock incapacitation threshold at 80% (painBp >= 8000) causing colonists to drop downed. Unchecked active bleeding causes progressive blood loss downing and eventual death at 100% loss.
  • Medical Tending & Bed Rest: Colonists assigned to Doctoring tend bleeding wounds, stabilizing patients, reversing pain shock, and promoting natural HP regeneration during Bed Rest.
  • Health Inspector UI: Right-hand pawn inspector displays equipped weapon stats, pain meter, blood loss meter, 6 body-part HP tracks, active injuries log, and a direct "🏥 Prioritize Medical Tending" action.

3. Tactical Combat, Weapons, Line-of-Sight & Storyteller Raids (Fixes #4)

  • Weapons & Combat Engine: Added weapon definitions (unarmed, steel_shiv, scrap_pistol, bolt_rifle) with distinct range, cooldown ticks, and melee vs. ranged mechanics.
  • Line-of-Sight & Cover: Added Bresenham raycasting verifying wall obstruction (TileFlag.BLOCKS_LIGHT) and adjacent sandbag cover defense granting a 50% ranged accuracy penalty to attackers.
  • Storyteller Raid Director: Autonomous raid generation spawning hostile scavenger raiders at map borders with aggressive colonist hunting AI. Once 50% raider casualties are inflicted, surviving hostiles break into panic retreat and flee off-map.
  • Tactical UI & Controls:
    • Right-click attack targeting for drafted colonists.
    • Contextual right-click menus for civilian colonists to tend wounded allies or draft-attack hostile raiders.
    • Dynamic #raid-alert-banner notification at the top of the screen showing active raid counts and retreat status.
    • Distinct visual rendering in PixiJS: red tint for raiders, 90-degree rotated pose for downed/dead pawns, and animated tool/weapon swinging during combat and tending.

Verification & Testing

  • Simulation Unit Tests (sim-core): Added 16 new test cases covering priority scheduling, timetable execution, gunshot trauma, bleeding accumulation, pain shock downing, doctor recovery, wall LoS obstruction, sandbag cover, and storyteller raid generation/retreat.
  • Full Suite Execution:
    • sim-core: 28 / 28 tests passing (100% green).
    • server: 4 / 4 integration tests passing (100% green).
    • typecheck: Strict TypeScript checking passing across all workspaces (tsc --noEmit).
    • client build: Clean production Vite build without warnings.
## Summary of Changes This pull request implements the three major RimWorld parity horizons requested in Issues #3, #4, and #24: ### 1. Work Priority Matrix (1-4) & 24-Hour Schedule Timetable (Fixes #24) - **Deterministic Work Priority System**: Implemented manual 1-4 priority tiers (with 0 = Off) across 8 work disciplines (`doctor`, `bed_rest`, `build`, `grow`, `mine`, `craft`, `research`, `haul`). Priority 1 jobs always execute before Priority 2, matching RimWorld's scheduling engine. - **24-Hour Schedule Routine**: Implemented hourly routine blocks (`Anything: 0`, `Work: 1`, `Joy: 2`, `Sleep: 3`). Emergency care (doctoring/bed rest) and extreme needs take precedence over scheduled activities. - **Modals & Hotkeys**: Added `[F1]` Work modal with interactive priority-cycling buttons and `[F2]` Schedule modal with color-coded routine painter and brush palette (`Anything`, `Work`, `Joy`, `Sleep`). ### 2. Colonist Health Model, Body Parts & Medical Rescue (Fixes #3) - **Detailed Anatomy Model**: Added `PawnHealth` tracking 6 distinct body parts (`torso`, `head`, `left_arm`, `right_arm`, `left_leg`, `right_leg`) with individual max HP, current HP, and bleeding wound tracking. - **Pain & Blood Loss**: Cumulative pain shock incapacitation threshold at 80% (`painBp >= 8000`) causing colonists to drop downed. Unchecked active bleeding causes progressive blood loss downing and eventual death at 100% loss. - **Medical Tending & Bed Rest**: Colonists assigned to Doctoring tend bleeding wounds, stabilizing patients, reversing pain shock, and promoting natural HP regeneration during Bed Rest. - **Health Inspector UI**: Right-hand pawn inspector displays equipped weapon stats, pain meter, blood loss meter, 6 body-part HP tracks, active injuries log, and a direct "🏥 Prioritize Medical Tending" action. ### 3. Tactical Combat, Weapons, Line-of-Sight & Storyteller Raids (Fixes #4) - **Weapons & Combat Engine**: Added weapon definitions (`unarmed`, `steel_shiv`, `scrap_pistol`, `bolt_rifle`) with distinct range, cooldown ticks, and melee vs. ranged mechanics. - **Line-of-Sight & Cover**: Added Bresenham raycasting verifying wall obstruction (`TileFlag.BLOCKS_LIGHT`) and adjacent sandbag cover defense granting a 50% ranged accuracy penalty to attackers. - **Storyteller Raid Director**: Autonomous raid generation spawning hostile scavenger raiders at map borders with aggressive colonist hunting AI. Once 50% raider casualties are inflicted, surviving hostiles break into panic retreat and flee off-map. - **Tactical UI & Controls**: - Right-click attack targeting for drafted colonists. - Contextual right-click menus for civilian colonists to tend wounded allies or draft-attack hostile raiders. - Dynamic `#raid-alert-banner` notification at the top of the screen showing active raid counts and retreat status. - Distinct visual rendering in PixiJS: red tint for raiders, 90-degree rotated pose for downed/dead pawns, and animated tool/weapon swinging during combat and tending. --- ## Verification & Testing - **Simulation Unit Tests (`sim-core`)**: Added 16 new test cases covering priority scheduling, timetable execution, gunshot trauma, bleeding accumulation, pain shock downing, doctor recovery, wall LoS obstruction, sandbag cover, and storyteller raid generation/retreat. - **Full Suite Execution**: - `sim-core`: 28 / 28 tests passing (100% green). - `server`: 4 / 4 integration tests passing (100% green). - `typecheck`: Strict TypeScript checking passing across all workspaces (`tsc --noEmit`). - `client build`: Clean production Vite build without warnings.
- Work Priority Matrix (1-4) & 24-hour Schedule Timetable ([F1] / [F2] modals & sim scheduler)
- Health model with body parts, bleeding accumulation, pain shock, and doctor medical rescue/tending
- Tactical combat with melee/ranged weapons, line-of-sight obstruction, sandbag cover defense
- Storyteller Raid Director with raider combat AI, map entry, and 50% casualty retreat threshold
- Client UI: Work and Schedule modals, colonist health inspector, equipped weapon badges, raid alert banner, right-click draft attack and medical tending orders, and downed/dead pawn rendering

Fixes #3, Fixes #4, Fixes #24
Author
Collaborator

Merge approved by @johnw via Antigravity chat on 2026-10-18: " yep go ahead and deploy\

Merge approved by @johnw via Antigravity chat on 2026-10-18: " yep go ahead and deploy\
This branch is already included in the target branch. There is nothing to merge.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin gemini/parity-work-combat-health:gemini/parity-work-combat-health
git switch gemini/parity-work-combat-health

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff gemini/parity-work-combat-health
git switch gemini/parity-work-combat-health
git rebase main
git switch main
git merge --ff-only gemini/parity-work-combat-health
git switch gemini/parity-work-combat-health
git rebase main
git switch main
git merge --no-ff gemini/parity-work-combat-health
git switch main
git merge --squash gemini/parity-work-combat-health
git switch main
git merge --ff-only gemini/parity-work-combat-health
git switch main
git merge gemini/parity-work-combat-health
git push origin main
Sign in to join this conversation.
No description provided.