Files
kq4-decompile/rooms/kq4-073-cave-exit/kq4-073-cave-exit.md
2026-02-20 14:00:40 -08:00

56 lines
3.2 KiB
Markdown

# Room 73: Cave Exit
This is a transitional room representing the exit from a dark cave into the swamp region. The player enters from the cave (Room 76) and can exit to the swamp area (Room 77). The room handles special crawling mechanics when arriving from the swamp - the player transitions from a crawling animation in water to standing on dry land. The cave entrance visual is displayed or hidden based on the player's position. The room provides look commands to observe the outside world, including the swamp and sky (which changes based on time of day).
## Look Description
"After this dark cave, the outside world looks good."
## Interactions
| Status | Behavior Type | Command | Response |
|--------|--------------|---------|----------|
| TODO | Action | `crawl exit cave` / `crawl` | "You're not close enough." (only works when in water area) |
| TODO | Look | `look exit` / `look for exit` | "After this dark cave, the outside world looks good." |
| TODO | Look | `look out` | "Outside the cave, you see a large swamp." |
| TODO | Look | `look sky` / `look up` | "Outside, the night sky is lit by a full moon." (if night) or "Outside, the sky is very blue." (if day) |
## Scripts
| Status | Behavior Type | Name | Trigger | Behavior |
|--------|--------------|------|---------|----------|
| TODO | Interaction | crawl | Player enters from Room 77 or attempts to crawl in water | Handles transition from crawling in water (view 950) to standing on land (view 904). If heading > 180 (entering water), plays crawl exit animation and transitions to Room 77. If heading <= 180 (exiting water), plays stand-up animation and returns to normal walking. Sets global205=1 and global204=0 when exiting to room 77. |
| TODO | Background | localproc_0402 | Continuous in doit | Shows cave entrance view (view 800, loop 1) at position 108,132 when not in water (proc0_20 returns false). Hides the view when in water. |
## Technical Notes
- **Room Number**: 73
- **Picture**: 73
- **Region**: 605
- **Exits**: South→76 (cave entrance), Room 77 (swamp, via crawl script)
- **Music**: None specified
### State Variables
| Variable | Values | Description |
|----------|--------|-------------|
| `global101` | `1` | Set to 1 on room init |
| `global100` | `0`, `1` | Time of day flag (0=day, 1=night) |
| `global126` | `0` | Set when entering from Room 77 |
| `global189` | `0` | Set when exiting to Room 77 |
| `global205` | `1` | Set when exiting to Room 77 via crawl |
| `global204` | `0` | Set when exiting to Room 77 via crawl |
| `newView` | `0`, `View object` | Tracks cave entrance view visibility |
### Additional Technical Details
- Room uses Region 605 for shared logic
- Player enters from Room 76 (cave) at position 138, 179
- Player enters from Room 77 (swamp) at position 290, 163 with crawl script active
- When in water area (control area $0002), player uses view 950 (crawling) and cannot exit crawl mode
- When on dry land, player uses view 904 (normal walking)
- Cave entrance visual (view 800) is shown/hidden based on whether player is in water
- The `proc0_20` function appears to detect if player is in water
- The `proc0_8`, `proc0_9`, `proc0_10` are system procedures related to crawl mechanics
- global101=1 may indicate the room has been initialized or visited