Section - Boiler Feedback
To say bridgeupdate:
if saved-bridge-power is 0 and pressure of red pipe > 0 and Rockslide is unvisited, say "[line break]By the chasm, the [if bridge is raised]bridge[else]staircase[end if] shudders once, then subsides.".
saved-pyramid-power is a number that varies. saved-ropeway-power is a number that varies. saved-stairs-power is a number that varies. saved-bridge-power is a number that varies. s-m-pyr-test is a truth state that varies.
To say pyramidupdate:
if story mode and s-m-pyr-test is false and pressure of red pipe > 0: [To simplify the discovery process in story mode, we pretend the bridge has been "jammed" and the first time power is sent to it, it unlocks and falls. This explains how it can have been up, not falling, and unlocked, a state it normally can't be in.]
now s-m-pyr-test is true;
now bridge-control is unlocked;
let yP be pressure of the yellow pipe;
let tP be target pressure of the pyramid pressure gauge;
let sP be saved-pyramid-power;
if sP is 0 and yP is at least tP: [none to full]
say "[line break]A deep, subsonic rumbling booms through the ground, resolving into a steady, faint thrum. From atop the distant mountain[mtnex], the [o][distant-pyramid][x] lights up with a [if night]brilliant[else]faint[end if] ruby glow that spills from its seams, sending a faint pink beam straight up into the sky[one of], as if given off by something inside[or][stopping][if night], lighting up the distant mountain summit[end if].";
else if sP is 0 and yP is at least 1: [none to some]
say "[line break]From atop the distant mountain[mtnex], the [o][distant-pyramid][x] begins to slowly pulse with a reddish glow, cycling gradually from dimness to full strength[if night], like a beacon in the darkness[end if].";
else if sP is at least tP and yP is at least 1 and yP is less than tP: [full to some]
say "[line break]Some subsonic thrumming beneath your feet you'd hardly been aware of dies away. On the distant mountain[mtnex], the [o][distant-pyramid][x] loses its ruby glow, and instead starts cycling gradually from dimness to crimson and back again.";
else if sP is at least tP and yP is 0: [full to none]
say "[line break]Some subsonic thrumming beneath your feet you'd hardly been aware of dies away. On the distant mountain[mtnex], the [o][distant-pyramid][x] loses its ruby glow, which fades away along with the noise completely.";
else if sP is at least 1 and sP is less than tP and yP is at least tP: [some to full]
say "[line break]A faint subsonic thrumming ripples through the ground. On the distant mountain[mtnex], the pulsing light coming from the [o][distant-pyramid][x]'s seams suddenly brightens to a [if night]brilliant[else]strong[end if] and constant ruby glow[if night], and a faint pink beam points upward from it into the sky[end if].";
else if sP is at least 1 and yP is 0: [some to none]
say "[line break]On the distant mountain[mtnex], the cycling glow from the seams of the [o][distant-pyramid][x] dies away completely.".
To say mtnex: say "[one of], whose top you can just see poking above the jumbled end of the chasm[or], whose top pokes above the jumble[or][stopping]".
To say state of (outf - a number):
if outf is 0, say ", its outlet vent emitting nothing";
if outf >= 1 and outf <= 3, say ", venting faint wisps of steam";
if outf >= 4 and outf <= 7, say ", trickling steady tendrils of steam";
if outf >= 8 and outf <= 11, say ", emitting clouds of steam";
if outf >= 12 and outf <= 15, say ", billowing out fast-moving clouds of steam";
if outf >= 16 and outf <= 19, say ", surging with clouds of expanding steam";
if outf >= 20 and outf <= 23, say ", gushing a huge torrent of steam";
if outf >= 24 and outf <= 27, say ", exploding with a solid column of steam that surges high into the sky";
if outf >= 28 and outf <= 30, say ", whistling like a kettle and exploding with a solid column of steam that surges high into the sky".