62 lines
5.1 KiB
Markdown
62 lines
5.1 KiB
Markdown
# Change Request CR-023 — Shop Time Counts as Rest
|
||
|
||
> **Numbering note (added when recorded):** this request arrived titled "CR-021 — Shop Time Counts as Rest" for "Phase 21". CR-021 (Independent Pilots) and CR-022 (Welcome Screens), and Phases 21 and 22, already existed, so it is stored as **CR-023** and done as **Phase 23**: every "21.n" below means **23.n**. Its references map to this repo as: "Phase 13 and CR-001 through CR-020" = Phase 13 and **CR-001 to CR-022**; "CR-004 pilot rest" is the same number; "CR-006 ship upgrades" = **CR-009**; "CR-011 local-first" = **CR-014** (the resolution loop and catch-up are CR-021's event queue, decision 0.5.129); "CR-019 independent pilots" = **CR-021**. Its new decision CR-021.D1 is recorded as **0.5.135 Shop time counts as rest**.
|
||
>
|
||
> **On recording:** rest is 10 game hours (10 real minutes at 60× compression) and the shop takes 10, 20 or 30 real minutes (10, 20 or 30 game hours), so every shop time already covers a full rest.
|
||
|
||
**Project:** Deadhead: Space Freight Tycoon
|
||
**Applies to:** a build with Phase 13 and CR-001 through CR-020 complete
|
||
**Do this:** as **Phase 21** (small)
|
||
**Related docs:** `change-request-pilot-rest.md` (CR-004), `change-request-ship-upgrades.md` (CR-006), `change-request-local-first.md` (CR-011), `change-request-independent-pilots.md` (CR-019), `DECISIONS.md`
|
||
|
||
---
|
||
|
||
## 1. Why
|
||
|
||
An upgrade takes a ship out of service for 10–30 real minutes, and a full rest is 10 real minutes. Today a tired pilot can wait out an upgrade and then still have to rest afterward: double downtime while they were standing around. From now on, a pilot who stays with their ship while it's in the shop comes out rested.
|
||
|
||
## 2. Rules
|
||
|
||
| Rule | Detail |
|
||
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||
| Duty reset | When an upgrade finishes, the pilot assigned to that ship has their duty hours set to zero, **if** they were assigned to it for the whole shop time and didn't fly in the meantime. |
|
||
| Already resting | If the pilot was resting when the upgrade started, the rest continues as normal alongside it. If the rest would end after the upgrade, it also ends when the upgrade finishes. |
|
||
| Not locked in | The pilot isn't blocked during the upgrade. They can still be unassigned at the HQ and fly another ship; if they do, they don't get the reset. |
|
||
| Shop time vs rest | All shop times are at least the rest duration. A content test enforces this; if a future shop time is shorter, it doesn't count as rest. |
|
||
| Independent pilots | Same rule (CR-019). An Independent pilot whose ship is in the shop waits with it and comes out rested. |
|
||
|
||
## 3. Decision
|
||
|
||
Record in `DECISIONS.md` and `implementation-plan.md` §0.5 with the next free number (labeled CR-021.D1 here).
|
||
|
||
- **CR-021.D1 Shop time counts as rest.** Per §2.
|
||
|
||
## 4. Steps — Phase 21
|
||
|
||
### Step 21.1 — Content test
|
||
|
||
- **Test:** Every upgrade level's shop time, converted to game hours, is at least the rest duration.
|
||
|
||
### Step 21.2 — Sim and engine: duty reset on upgrade completion
|
||
|
||
- When an upgrade's shop time ends (in the resolution loop or catch-up), if the ship's current pilot has been assigned to it since the upgrade started and hasn't flown since, set their duty hours to zero and clear any rest that would end later. Track this with an "assigned since" time on the pilot, or by recording the pilot id on the upgrade when it starts.
|
||
- **Test:** A pilot near the duty limit whose ship finishes an upgrade has zero duty hours and can be dispatched immediately. A pilot who was unassigned during the upgrade and flew another ship keeps their duty hours. A pilot already resting when the upgrade started is free when the upgrade ends, if their rest would have ended later. Catch-up produces the same result as live play.
|
||
|
||
### Step 21.3 — Client: status line
|
||
|
||
- While the ship is in the shop, the assigned pilot's status reads "Resting while in the shop — mm:ss" (the upgrade countdown). The ship's Fleet card keeps its "In the shop" countdown.
|
||
- **Test:** Component test: a pilot whose ship is in the shop shows the new status with the right countdown; after unassigning them, the status no longer says they're resting.
|
||
|
||
### Step 21.4 — Regression
|
||
|
||
- Run the full suite.
|
||
- **Test:** CI is green. Manual check: fly a pilot close to the duty limit, start an upgrade at the HQ, and confirm they're ready to fly the moment the upgrade finishes.
|
||
|
||
## Amendments
|
||
|
||
- **Amended by CR-027:** Booked service overlaps rest the same way: a rest due on arrival or already running ends with the service, so the pilot is free at the later end.
|
||
|
||
## 5. Out of scope
|
||
|
||
Rest facilities at HQs, shortening shop times, and anything else in `implementation-plan.md` §0.3.
|