# Room 17: Spooky House Exterior

This is the exterior of a spooky old house located in a cemetery. The room features a cottage with windows and a door, stone steps, a surrounding stone wall, overgrown bushes, and a cemetery with graves. A ghoul (animated figure) appears if the player has not collected a specific item, triggering an encounter sequence that results in the player being transported to the underworld (Room 68). The primary interaction is opening the front door to enter the house.

## Look Description

"Indeed, this is a spooky old house! It looks as if no one has lived here for many years. Flanking the old house on both sides is a run-down cemetery. A thick forest looms all around."

## Interactions

| Status | Behavior Type | Command | Response |
|--------|--------------|---------|----------|
| TODO | Look | `look around` / `look room` / `look[<around>]` | "Indeed, this is a spooky old house! It looks as if no one has lived here for many years. Flanking the old house on both sides is a run-down cemetery. A thick forest looms all around." (Print 17 0) |
| TODO | Look | `look grave` / `look gravestone` | "The graves are in the cemetery." (Print 17 1) |
| TODO | Look | `look fence` / `look wall` | "An old, crumbling stone wall surrounds the neglected cemetery." (Print 17 2) |
| TODO | Look | `look cottage` | "This is not a pleasant house; in fact, it's downright scary! It looks old and abandoned, and badly in need of tender-loving-care. To make matters worse, it sits right in the middle of an old cemetery!" (Print 17 3) |
| TODO | Look | `look cemetery` | "A decrepit and over-grown cemetery surrounds the old house." (Print 17 4) |
| TODO | Look | `look door` | "This is a finely-carved, wooden door." (Print 17 5) |
| TODO | Look | `look window` (close to window) | "You peek through the window, but can make out no details." (Print 17 6) |
| TODO | Look | `look window` (in bushes) | "The bushes are too tall! Go up by the door." (Print 17 7) |
| TODO | Look | `look window` (elsewhere) | "You're not close enough." (Print 800 1) |
| TODO | Look | `look stair` | "Wide stone steps lead up to the front door of the spooky old house." (Print 17 8) |
| TODO | Look | `look bush` | "Overgrown shrubs front the old house." (Print 17 9) |
| TODO | Action | `break window` | "It looks like many of the windows are already broken!" (Print 17 10) |
| TODO | Action | `break door` | "You could never do that." (Print 17 11) |
| TODO | Action | `open door` (at door) | Opens the door with animation and sound, then transitions to Room 68 |
| TODO | Action | `open door` (not at door) | "You're not close enough." (Print 800 1) |
| TODO | Action | `close door` | "The door is closed." (Print 17 12) |
| TODO | Action | `open window` | "The windows do not open." (Print 17 13) |
| TODO | Action | `unlatch door` | "The door is already unlocked." (Print 17 14) |
| TODO | Action | `bang door` (at door) | "With trepidation, you rap on the door. Not surprisingly, nobody answers." (Print 17 15) |
| TODO | Action | `bang door` (not at door) | "You're not close enough." (Print 800 1) |

## Scripts

| Status | Behavior Type | Name | Trigger | Behavior |
|--------|--------------|------|---------|----------|
| TODO | Interaction | z6Actions | Player enters the door zone (rect 141,146 to 175,149) while ghoul encounter is active | Triggers ghoul encounter sequence: ghoul appears, theme plays, player transforms through multiple views, then is transported to Room 68 (underworld). Sets `ghoul_encounter_completed = true` when finished. |

## Technical Notes

- **Room Number**: 17
- **Picture**: 17
- **Region**: 508 (cemetery)
- **Exits**: North→11, South→23, East→18, West→16, Door→68 (spooky house interior)
- **Music**: Sound 21 (zTheme)

### State Variables

| Variable | Values | Description |
|----------|--------|-------------|
| `global100` | `true`, `false` | Ghoul encounter flag - when true, ghoul appears |
| `global101` | `0` | Room-specific flag, initialized to 0 |
| `global120` | message pointer | Stores the "wander forever" message pointer |
| `global127` | `0`, `1` | Ghoul encounter completion flag - set to 1 after encounter ends |

### Additional Technical Details

- Synonyms defined: `kiss` = `embrace`, `ghoul` = `ghoul man`
- The ghoul appears when `global100 = true` and player does not have inventory item 7
- Item 7 (not yet mapped) is required to prevent the ghoul encounter
- The door zone is defined as rectangle 141,146 to 175,149
- Opening the door requires player to be in rect 139,140 to 173,153
- Window visibility checks use multiple rect zones to determine proximity
- If player views is not 2 (normal form) when exiting, the room change is blocked
- Entry from Room 68 positions player at the door (loop:2, x:161, y:151)
- The overlay picture 117 is shown if `global100` is true
