Items downstairs - most of them

main
Ashelyn Dawn 4 years ago
parent 59377ed38f
commit a00a21c2b6

@ -87,6 +87,8 @@ export default function Text({promptVisible: promptEnabled, handleCommand, showR
if(ev.key !== ' ' && ev.key !== 'Enter') return;
ev.preventDefault()
inputRef.current.value = ''
setCurrentInput('')
game.getState().messages[currentPause].resolved = true
game.saveDraft()
forceRender()

@ -1,17 +1,11 @@
import {game} from '../engine'
/**
* Cabin
*/
game.addRoom('cabin', 'Crew Cabin', `
A dark and dingy room with a single bunk bed along the starboard side.
The washroom is to the aft, with the comms room to port.
`)
/**
* Washroom
*/
game.addRoom('bathroom', 'Washroom', `
Tight, cramped, but serviceable. The _Dawn_ was really only meant for a crew
of one or two, and that is no more evident than here.
@ -30,10 +24,6 @@ cupboard.aliases.push('cupboard')
cupboard.aliases.push('cupboard door')
cupboard.aliases.push('cabinet door')
/**
* Comms
*/
game.addRoom('comms', 'Comms Room', `
A wide room with pipes and cabling running thick through the floor.
@ -75,7 +65,6 @@ The mainframe is to the fore, and above you the stairs curl up and
out of sight.
`)
game.addRoom('mainframe', 'Mainframe', `
The mainframe fills the room with its soft humming, lights blinking
on and off in a disorderly pattern.
@ -83,6 +72,18 @@ on and off in a disorderly pattern.
The stairwell is to the aft, with the engine room to starboard.
`)
const computer = game.addItem('mainframe', `
Filling almost the entire room, the mainframe serves as the ship's primary control
computer. It regulates engine power, controls the navigation and piloting systems,
and even has a few games built in!
Of course, with the engine not running the mainframe is currently in low power
mode - you'll have to start the engine up again to restore full functionality.
`, 'mainframe')
computer.aliases.push('computer')
computer.aliases.push('engine controller')
computer.aliases.push('control circuit')
game.addRoom('engine', 'Engine Room', `
The usual deep rumble of the ship's engines is missing, leaving a
disconcerting silence.
@ -90,6 +91,12 @@ disconcerting silence.
The mainframe is to port, with the docking bay to starboard.
`)
game.addItem('engine', `
Even running on standby power, your view through the window of the engine is overwhelmingly bright.
At full power the windows have to be polarized to block the blinding glow of the engine's warp singularity - as it is, it's relatively safe to look at.
`, 'engine')
game.addRoom('docking', 'Docking Bay', `
A long and wide room for loading and unloading cargo. The
dock hatch is sealed, and you definitely shouldn't go opening

@ -29,7 +29,7 @@ hints.set(Phase.hasFlashlight, 'With the security door shut and power cut off, y
hints.set(Phase.checkedUnderSink, `There is a panel under the sink that you might be able to fit through - you'll need a wrench to get it open though.`)
hints.set(Phase.gotWrench, `You have a wrench and can open the panel under the sink.`)
hints.set(Phase.openedSinkPanel, 'You can get to the lower deck through the panel under the sink, but be sure not to leave anything behind!')
hints.set(Phase.droppedBelow, 'You need to re-start the CO2 scrubber before you run out of clean air.')
hints.set(Phase.droppedBelow, 'You need to re-start the CO<sub>2</sub> scrubber before you run out of clean air.')
hints.set(Phase.fixedLifeSupport, 'While the immediate threat to your life has been solved, you need to bring the engine back on so you can restore power to your ship.')
hints.set(Phase.examinedEngine, 'The engine itself seems to be in good repair, time to go to the mainframe and start up its control systems.')
hints.set(Phase.examinedMainframe, 'The engine control systems are missing [thing]. There\'s a spare in the comm room locker, but you\'ll have to find a way to get there.')

@ -102,3 +102,13 @@ rules.onBeforeCommand(command => {
throw new Error('It takes you a few minutes, but eventually you pull up the floor panel. You should be able to get down to the docking bay from here.')
})
/**
* Add to engine description when CO2 not fixed
*/
rules.onAfterCommand(command => {
if(command.verb.name !== 'lookAt' || command.subject?.name !== 'engine') return;
if(game.getProperty('gamePhase') < Phase.fixedLifeSupport)
game.say(`_Focus_, you remind yourself. _The engine is pretty but I've gotta fix that CO<sub>2</sub> filter before I'll have time to bother with this._`)
})

@ -81,8 +81,7 @@ rules.onAfterCommand(command => {
* Dropping from bathroom to docking bay for the first time
*/
rules.onAfterCommand(command => {
// When going down from the bathroom . . .
if(command.verb.name !== 'go' || command.subject?.name !== 'down' || game.getCurrentRoom()?.name !== 'bathroom')
if(command.verb.name !== 'go' || command.subject?.name !== 'down' || game.getCurrentRoom()?.name !== 'docking')
return
// Only do once
@ -100,4 +99,21 @@ rules.onAfterCommand(command => {
game.pause()
game.clear()
rules.printArea()
})
/**
* Entering lower stairwell for first time
*/
rules.onAfterCommand(command => {
if(command.verb.name !== 'go' || command.subject?.name !== 'aft' || game.getCurrentRoom()?.name !== 'stairlower')
return
// Only do once
if(game.hasProperty('printedLowerStairwell'))
return
else
game.createProperty('printedLowerStairwell', true)
game.say(`As you look up the stairway you catch a glimpse of light filtering down from above - must be near a star cluster you suppose. Not really any good way to know which one until you can bring the navigation systems back online.`)
})

Loading…
Cancel
Save