seppedl a1bb4cbf02 Add complete game content: Vogon ship, Heart of Gold, off-Earth, dream system
Engine refactoring:
- Replace hardcoded state attributes with generic state.flags dict
- Add death system (jigs_up/finish) with dream-restore callbacks
- Add inventory extras hook system (removes hardcoded headache/tea lines)
- Add 16 new verb handlers (consult, say, carve, plug, repair, kick, etc.)
- Add verb synonyms to parser

New content modules (25 rooms, 107 objects total):
- vogon.py: Hold, Captain's Quarters, Airlock; babel fish puzzle, poetry
  scene, airlock ejection sequence with timed events
- heart.py: 10 Heart of Gold rooms; Marvin tool quest, tea/no-tea paradox,
  Nutrimat overload, Infinite Improbability Drive puzzle, victory sequence
- unearth.py: Traal (Beast lair with towel/name/carve puzzle), War Chamber,
  Inside Whale, Maze with random exits and particle
- dark.py: Dream dispatch room with probabilistic destination selection,
  sensory discovery mechanic, dream-restore callback

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 21:52:57 +02:00

The Hitchhiker's Guide to the Galaxy

A Python text adventure engine for the classic 1984 Infocom interactive fiction game, built from the original ZIL source code. The long-term goal is an accessible version for blind players via TTS/STT.

Requirements

  • Python 3.12+
  • uv

Install & Run

# Clone the repo
git clone https://gitea.smashconsult.be/seppedl/h2g2.git
cd h2g2

# Install dependencies and run
uv run h2g2

Or install it into an environment:

uv pip install -e .
h2g2

You can also run it directly as a module without installing:

uv run python -m h2g2.main

What's playable

The Earth opening sequence: wake up in your bedroom, find your gown and aspirin, make your way downstairs, head to the pub, and meet Ford Prefect.

Project structure

h2g2/
    engine/          # Core game engine (parser, object model, game loop)
    content/         # Game content (rooms, objects, puzzles)
    main.py          # Entry point
*.zil                # Original ZIL source code (Infocom, 1984)
docs/                # Original game manuals, maps, and story file (.z5)
S
Description
Python Infocom H2G2 interpreter
Readme 71 MiB
Languages
Python 100%