WP-093: Phantom’s fountain piranha and the tokens (Gen 1)

Status: ✅ Done (2026-11-27). Fork PR barefootbetters/scummvm#17 merged on 2026-11-27 (merge commit 3960fdbaa8). Phase: 5 (a soft-lock found while checking WP-075’s modelled items) Depends on: WP-075 ✅ (the maze interior: the fountain and the centre the way back leads to) Companion EC: none (inline checklist under Exit criteria) Pre-flight: pre-flight-WP-093-2026-11-27. Required: the packet modifies engines/terraglyph/**. Targets generation(s): Gen 1, Phantom of the Knight only. Showdown has no such room. Estimated effort: Two hours


Goal

Port the fountain close-up’s piranha (ROOM_P44_Fountain_Closeup, class 0x429740) from the decompile, so feeding it the burger gives the tokens as the original does.

Background

WP-075 ported the fountain and noted under Deviations that “the piranha eat … [is] modelled, not frame-exact”. WP-092 found that WP-075’s other modelled item hid a missing behaviour, so Jeff asked for this one next.

The fork at 8410401 (source, then live — session):

The tokens are what the empty bottle asks for (OBJ_INV_BOTTLE_EMPTY, requiredanim=ANIM_CURSORTOKENS). The burger is an inventoryobject placement, which by the inventory rules is picked up once (inferred, not replayed). A player who fed the piranha on the old build therefore couldn’t reach the bottle chain: a progression soft-lock.

Scope

In scope:

  1. Fork, maze_interior_rooms.{h,cpp}: FountainCloseupRoom’s claim, reset, entry, event, tick and leave from the trace.
  2. Fork, maze_interior_check.cpp: the room played through the engine’s tick. WP-075’s claim line is reworded to what the claim now decides.
  3. Docs: this packet, its pre-flight, the fountain’s section in scooby-exe, the correction in WP-075, and the index row.

Out of scope:

Exit criteria

  1. Self-test. The new fountain lines match text written from the trace before the run. The rest of the self-test matches the 8410401 baseline except the per-run random keys (and WP-075’s reworded claim line). No new warnings.
  2. Live (session). The burger fed to the piranha gives the tokens and takes the gang back to the centre. A plain click plays a line, and the piranha lunges.
  3. Process. The fork PR against scooby-engine is open (merged later the same day), and each claim carries its evidence label.

Result

Every claim is Gen 1, Phantom. Evidence labels: source (the decompile), self-test, log (the engine’s debug log of a live run), live — session (a scripted run this session drove). Nothing here is live — Jeff.

What the original does (source). This is recorded in full in scooby-exe, from Scooby.exe (SHA-256 619EA687…AF807ED, Ghidra 12.1.4 headless):

The port (source). On wp-093-fountain-piranha (7db942e513): the claim, reset, entry, event, tick and leave follow the trace. The piranha’s sequence is set at entry, since the fork’s claim can’t set a once-only start. A plain click is recognised by Inventory::isDefaultCursor(); the original checks for the open-hand cursor.

Self-test (self-test). Five lines were written from the trace before the run, using the step counts in TGIFILE.ART: idle 35, attack 30, eat start 17, eat finish 13, grab 13, at 3 ticks a step. All match:

The rest of the self-test matches the 8410401 baseline from C:\dev\scummvm, run alone this time, with 1828 lines each. The only differences are the per-run random keys and WP-075’s claim line, which now reports the build, layer and depth instead of the sequences the claim no longer sets. The runtime warnings match the baseline’s, 18 each.

Build (log). Terraglyph only, in the fork worktree; no warnings in the changed files.

Live (live — session, with log). All runs used start_room=ROOM_P44_Fountain_Closeup and start_items=OBJ_INV_BURGER:

Deliverables

Notes