Section - Boiler Wheels (Puzzle Mode)
A wheel is a kind of setpiece. Understand "wheel/wheels" or "number" as a wheel. The description of a wheel is usually "The [noun], marked by now-flaking gritty paint, is exquisitely carved and smoothed from some local wood. Between it and the corresponding pipe, scratched into the wood, [if noun is red wheel]is a single horizontal line[otherwise if noun is blue wheel]are four horizontal lines[otherwise]are twenty-two tiny horizontal lines[end if].". The red wheel is a wheel in Volcano Floor. The blue wheel is a wheel in Volcano Floor. The yellow wheel is a wheel in Volcano Floor. Instead of pushing a wheel, try turning noun. Does the player mean turning a wheel: it is likely. Does the player mean examining a pipe when location is Volcano Floor: it is unlikely. Understand "b" as blue wheel when location is Volcano Floor. Understand "r" as red wheel when location is Volcano Floor. Understand "y" as yellow wheel when location is Volcano Floor. Understand "w" as a wheel when location is Volcano Floor. Does the player mean adjusting a wheel: it is very likely. Instead of adjusting the red pipe when location is Volcano Floor: try adjusting the red wheel. Instead of adjusting the yellow pipe when location is Volcano Floor: try adjusting the yellow wheel. Instead of adjusting the blue pipe when location is Volcano Floor: try adjusting the blue wheel.
Instead of turning a wheel: say "It looks like you can turn it either left or right, and multiple revolutions in either direction.
[as the parser]You can type TURN RED WHEEL 3 RIGHT, for example. For convenience, you could abbreviate this to T RED 3 R[as normal].".
left is a thing. right is a thing. Understand "l" as left. Understand "r" as right.
Adjusting is an action applying to one thing and one topic. Understand "turn [something] [text]" as adjusting when location is Volcano Floor. Understand "t [something] [text]" as adjusting when location is Volcano Floor. Does the player mean adjusting a wheel: it is very likely.
The third noun is a thing which varies. Blankblank is a thing. The num noun is a number that varies.
Check adjusting:
let temp be the noun;
change the num noun to -1;
if the topic understood includes "[number]" begin; change the num noun to the number understood; end if;
if the player's command includes "hleft/l" begin; change the third noun to left; end if;
if the player's command includes "hright/r" begin; change the third noun to right; end if;
if third noun is not left and third noun is not right begin; say "(left)[line break]"; change the third noun to left; end if;
if num noun is -1, now num noun is 1;
change the noun to temp.
To say absolute value of (xnum - a number):
if xnum < 0, now xnum is xnum * -1;
say "[xnum in words]".
Check adjusting:
if noun is not a wheel, try turning noun instead.
[ if the second noun is not a number or the third noun is not a handedness, try turning noun instead;]
[ if the second noun is not a number, try turning noun instead;]
To say boilerupdate:
say ".[paragraph break]You glance at the tube[state of current outflow] now";
if saved-pyramid-power is 0 and pressure of the yellow pipe > 0, say ". The yellow pipe hisses and begins to heat up";
if saved-pyramid-power > 0 and pressure of the yellow pipe is 0, say ". The yellow pipe ticks and pops as it starts cooling down";
if saved-ropeway-power is 0 and pressure of the blue pipe > 0, say ". The blue pipe hisses and begins to heat up";
if saved-ropeway-power > 0 and pressure of the blue pipe is 0, say ". The blue pipe ticks and pops as it starts cooling down";
if saved-stairs-power is 0 and pressure of the red pipe > 0, say ". The red pipe hisses and begins to heat up";
if saved-stairs-power > 0 and pressure of the red pipe is 0, say ". The red pipe ticks and pops as it starts cooling down".
Carry out adjusting:
now saved-pyramid-power is pressure of yellow pipe;
now saved-ropeway-power is pressure of blue pipe;
now saved-bridge-power is pressure of red pipe;
now saved-stairs-power is pressure of red pipe;
let rotations be num noun;
if rotations is 0, try touching the noun instead;
if third noun is left, now rotations is rotations * -1;
[say "r: [rotations]";]
if noun is red wheel, let recipient be red pipe;
if noun is blue wheel, let recipient be blue pipe;
if noun is yellow wheel, let recipient be yellow pipe;
[say "***pressure of recipient: [pressure of recipient], current outflow: [current outflow]***"; ]
if pressure of recipient + rotations < 0: [too far]
if pressure of recipient is 0, say "You can't seem to turn [the noun] any farther to the left";
otherwise say "As you turn the [the noun], the volume of steam from the outflow [o]tube[x] steadily increases. However, you only manage to turn it [pressure of recipient in words] time[s] to the left before it will no longer go any farther";
now pressure of recipient is 0;
else if pressure of recipient + rotations is 0: [exactly 0]
say "As you turn the [the noun], the volume of steam from the outflow [o]tube[x] steadily increases. At the end of your last turn is a firm resistance";
now pressure of recipient is 0;
else if current outflow - rotations < 0: [using more power than avail.]
if current outflow is 0, say "Attempts to turn [the noun] farther right produce only a loose, wobbly feeling, as if it's no longer catching on anything";
otherwise say "You turn [the noun] to the right, causing the volume of steam from the outflow [o]tube[x] to steadily decrease, but after [current outflow in words] revolution[s] the wheel becomes loose and wobbly, as if it's no longer catching on anything";
now pressure of recipient is pressure of recipient + current outflow;
else if current outflow - rotations is 0: [exactly everything]
say "You turn [the noun] [current outflow in words] time[s] to the right. As you stop, the last wisp of steam vanishes from the outflow [o]tube[x] above you";
now pressure of recipient is pressure of recipient + current outflow;
else: [ not hitting any boundaries ]
say "You turn [the noun] [absolute value of rotations] time[s] to the [third noun]. As you do so, the water level inside the [o]gauge[x] slowly [if rotations > 0]drops[otherwise]rises[end if]";
if current outflow > 0, say " and the steam venting from the outflow [o]tube[x] above you [if rotations > 0]decreases in quantity and pressure[otherwise]increases in volume and speed[end if]";
otherwise say ", and steam begins to flow from the outflow [o]tube[x] above you";
now pressure of recipient is pressure of recipient + rotations;
say "[boilerupdate].";
if the psyche of Progue is resolved or Progue is dead, pipechangeending;
say pyramidupdate;
say bridgeupdate;
if brick boiler is being debugged, say powersystemstatus.
Does the player mean object-debugging the brick boiler: it is very likely. Instead of object-debugging a pipe, try object-debugging the brick boiler. Instead of object-debugging a wheel, try object-debugging the brick boiler. Instead of object-debugging a pressure gauge, try object-debugging the brick boiler.
Check adjusting when the brick boiler is being debugged: say "[powersystemstatus]"; continue the action.
To say powersystemstatus: say "// Power system: Blue pipe (ropeway) at [pressure of blue pipe] of [target pressure of ropeway pressure gauge]; Red pipe (bridge) at [pressure of red pipe] of [target pressure of bridge pressure gauge]; Yellow pipe (pyramid) at [pressure of yellow pipe] of [target pressure of pyramid pressure gauge]; Total boiler output at [system power - current outflow] of [system power].".
To decide what number is the current outflow: [say "([system power]-[pressure of red pipe]r-[pressure of blue pipe]b-[pressure of yellow pipe]y)";] let val1 be system power - pressure of red pipe; let val2 be val1 - pressure of blue pipe; let val3 be val2 - pressure of yellow pipe; decide on val3.
Check pipesetting: if second noun is not a pipe, say "You can only turn it to point to one of the three pipes: red, yellow, and blue." Carry out pipesetting: if second noun is red pipe, now pipe-position of boiler handle is yellow pipe; if second noun is yellow pipe, now pipe-position of boiler handle is blue pipe; if second noun is blue pipe, now pipe-position of boiler handle is red pipe; try pushing boiler handle. Understand "turn [boiler handle] to [a pipe]" or "set [boiler handle] to [a pipe]" as pipesetting. Pipesetting is an action applying to two things.