WP-108: Phantom’s fountain close-up, played (Gen 1)
Status: ✅ Done (2026-11-28). Fork PR barefootbetters/scummvm#31 merged on 2026-11-28 (merge commit 50e43fc735).
Phase: 5 (a room checked only by calling its class, played)
Depends on: WP-075 ✅ (the port of the maze interior), WP-103 ✅ (the maze centre, played)
Companion EC: none (inline checklist under Exit criteria)
Pre-flight: pre-flight-WP-108-2026-11-28. Required: the packet modifies engines/terraglyph/**.
Targets generation(s): Gen 1, Phantom of the Knight only.
Estimated effort: An hour or two
Goal
Play the fountain close-up (ROOM_P44_Fountain_Closeup, class 0x429740,
vtable 0x45F304) through the engine’s mouse and tick, against the decompile,
and fix what differs. You reach it from the maze centre. A piranha guards the
tokens, and the burger feeds it.
WP-075 ported the room. Its check called the class’s
event() directly, which skips the engine’s hit test, cursor and click path.
That is the gap the search of the packets found in WP-099 to WP-103’s rooms,
and the maze centre (WP-103) was the last room on that search’s list. The
fountain is next to the centre and has the same gap.
What the decompile says
- The claim (
0x429CC0).- The piranha is a requires object (
0x402D90) wanting the burger, at depth -1, with the polygon hit test (+0x04 = 2). A requires object’s hover cursor isANIM_CURSOROPEN(0x402D90sets+0x70). - Its sequence is set at the claim:
ANIM_PIRANHAFULLlooping once the burger has been used (held but in no slot,0x407060and0x4070C0); otherwiseANIM_PIRANHAIDLEplayed once, with the swim sound. - The tokens, until taken, are a requires object wanting
ANIM_CURSORBURGER, at depth -100. - Shaggy’s grab is a sprite at depth 100, hidden and stopped.
- The piranha is a requires object (
- The click (
0x429B50).- The burger, on the piranha or the tokens: out of its slot, the cursor
back to the default,
ANIM_PIRANHALUNGE_EAT_START,Piranha_Eats, no lunge, input held and the cursor hidden. - A plain click needs the shown cursor to be the open hand. It sets a lunge
pending and plays the next of
Fountain.250D_,.250D1_and.250D2_, holding input.
- The burger, on the piranha or the tokens: out of its slot, the cursor
back to the default,
- The tick (
0x429800). When the piranha’s sequence ends:- with a lunge pending, it lunges (
ANIM_PIRANHALUNGE_ATTACK, 3, 3, -1); - after the eat start, the piranha and the tokens hide and Shaggy’s grab plays;
- otherwise it goes back to its idle, or to full after the eat finish, with the swim.
When the grab ends: the tokens into a slot, the piranha’s eat finish, and an exit to the centre with
Fountain.250F_through the room’s+0x24(the default,0x40C1E0). While the burger is being eaten, every tick holds input and hides the cursor. - with a lunge pending, it lunges (
The fork’s class already does all of this, with the same animation arguments
(read from the tick’s bytes, since the decompile drops the arguments of the
+0x24 calls). Two places where the fork looks thinner are covered elsewhere:
- the cursor goes back to the arrow in the engine’s requires click
(
inventory.cpp, afterroomEvent); addItem(0x406DD0) already drives a parked toolbar in, which is what the original’s extra0x407C00adds.
The tick clock reset (0x437540) is one the fork doesn’t keep anywhere.
Scope
In scope: fork maze_interior_check.cpp, a new section that plays the
room; this packet, its pre-flight, a pointer in WP-075 and the index row.
Out of scope: the well in the maze (ROOM_P22_Well_In_Maze), whose check
also calls its class directly. It’s the next room.
Exit criteria
- Expectations first. The new lines were written from the decompile before the run.
- Self-test. The new lines match those expectations, after the one wrong expectation was corrected (below). The rest matches the WP-105 run except for the per-run random keys. No new warnings.
- Live. A scripted run plays a line, the lunge, and the burger fed to the piranha through to the centre.
- Process. The fork PR against
scooby-engineis open (merged later the same day).
Result
Evidence labels: log (a self-test’s debug log), live (session) (a scripted run this session drove and read).
- No change to the room. The fork’s class matches the decompile.
- The check (source). On
wp-108-fountain-closeup(d63f3ac5b0), a section after the maze centre’s. It clicks withhandleMouseat a point where the room’s hit test finds the sprite, and reads the result after the tick that takes the click. - Self-test (log). The new lines:
- Entry:
opening Fountain.250D_, busy 1; piranha requires 1 hit 2, ANIM_PIRANHAIDLE; hover ANIM_CURSOROPEN; tokens shown 1 requires 1 depth -100; grab hidden 1; water 1, swim 1. - Clicks:
250D_,250D1_,250D2_(the third on the tokens), then250D_; the lunge plays with its sound, then the idle again with the swim. - Exit:
to ROOM_P23_Maze_Center movie -1. - Burger: the next tick has the burger in no slot (still held), the
cursor back to the arrow,
EAT_START,Piranha_Eats, busy and cursor hidden. Then the grab hides the piranha and the tokens, with its sound. Then the tokens are in a slot and the piranha showsEAT_FINISH. ThenFountain.250F_, thenROOM_P23_Maze_Center movie -1, busy 0. - Back:
ANIM_PIRANHAFULL mode 1; tokens 0; swim 0; step polygon 0; a click (hit 0) -> none; lunge in 400 ticks 0. - The burger on the tokens:
ANIM_PIRANHALUNGE_EAT_START, busy 1.
Two notes on reading these:
- The opening is reported by name on the second visit, but the room marks it played and doesn’t play it.
- The fourth click’s
lunge pending 0is the lunge already under way within the three ticks the check waits for the line.
- Entry:
- The wrong expectation. I expected the full piranha to answer a plain
click with a line.
ANIM_PIRANHAFULLhas no step polygon, and the claim gives the piranha the polygon hit test, so in the original too nothing is hit. The fork was right. - The rest of the self-test (log). It matches the WP-105 run (
55c8b6b) except for the per-run random keys. One of them is new: the library’s taunt (300C1_or300C2_, at random, WP-102) changed, because the new section uses the random source before the wizards check. 18 warnings in both, and no build warnings in the engine. - Live (session). A scripted run started in the fountain with the burger:
- The opening
Fountain.250D_played. - A click on the piranha played
Fountain.250D_, and it lunged. - The burger’s toolbar slot set the burger cursor.
- A click on the piranha fed it (“the piranha is fed”), and Shaggy grabbed the tokens, which went into slot 0.
Fountain.250F_played, and the game went toROOM_P23_Maze_Center.
The screenshots show the piranha by the tokens, then eating, then full with the tokens in the toolbar, then the gang at the centre.
- The opening
Deliverables
- Fork:
wp-108-fountain-closeup, PR barefootbetters/scummvm#31 (d63f3ac5b0), merged on 2026-11-28 as50e43fc735; the fork worktree is removed, andC:\dev\scummvmwas rebuilt from it. Staged by name:maze_interior_check.cpp. - Docs: this packet, its pre-flight, the pointer in WP-075, and the index row.
- Local only: the self-test and live logs, the screenshots, and the expected text.