Small fixes

main
Ashelyn Dawn 4 years ago
parent 549f7dfc3b
commit f504226a87

@ -117,7 +117,7 @@ export default function Text({promptVisible: promptEnabled, handleCommand, showR
)}
</div>
<form style={{pointerEvents: currentMenu ? 'none' : 'initial'}} className={styles.input + (!promptVisible ? ' ' + styles.hidden : '')} onSubmit={onSubmit}>
<input autoFocus ref={inputRef} readOnly={(promptVisible && !currentMenu) ? undefined : ''} onChange={ev => setCurrentInput(ev.target.value)} id="gameInput"/>
<input autoComplete="off" autoFocus ref={inputRef} readOnly={(promptVisible && !currentMenu) ? undefined : ''} onChange={ev => setCurrentInput(ev.target.value)} id="gameInput"/>
</form>
</ScreenContext.Provider>
</div>

@ -32,6 +32,8 @@
padding: 16px;
padding-top: 0;
font-weight: bold;
display: flex;
flex-direction: row;
}
.hidden {

@ -13,15 +13,13 @@ export default function(parser : Parser, rules : RulesEngine, game : Game) {
const current = game.getCurrentRoom()
const neighborName = current?.neighbors.get(direction.name)
if(!neighborName)
game.say(`You cannot go to the ${direction.name}`)
let lookingAt = game.findObjectByName(neighborName, ObjectType.Room)
|| game.findObjectByName(neighborName, ObjectType.Door)
if(!lookingAt){
console.warn(`Unable to find object ${neighborName}`)
game.say(`You cannot go to the ${direction.name}`)
game.say(`You cannot go ${direction.name}`)
return;
}
@ -37,7 +35,7 @@ export default function(parser : Parser, rules : RulesEngine, game : Game) {
const nextNeighbor = game.findObjectByName(nextNeighborName, ObjectType.Room)
if(!nextNeighbor)
throw new Error(`Door ${lookingAt.name} does not lead anywhere to the ${direction.name}`)
throw new Error(`Door ${lookingAt.name} does not lead anywhere to ${direction.name}`)
else
room = nextNeighbor
}

@ -27,7 +27,7 @@ export default function(parser : Parser, rules : RulesEngine, game : Game) {
parser.understand('openItem')
.as('open [item]')
.as('open [item] with [item]')
.as('open [item] with [item|object]')
rules.onCommand('openItem', () => {
game.say(`You don't believe that can be opened!`)

@ -3,6 +3,8 @@ import {game} from '../engine'
export enum Phase {
wakeUp,
hasFlashlight,
checkedUnderSink,
gotWrench,
openedSinkPanel,
droppedBelow,
fixedLifeSupport,
@ -24,6 +26,8 @@ export enum Phase {
export const hints : Map<Phase, string> = new Map()
hints.set(Phase.wakeUp, 'You may be able to assess your situation better if you retrieve your flashlight.')
hints.set(Phase.hasFlashlight, 'With the security door shut and power cut off, you\'ll have to find another way into the rest of the ship.')
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.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.')

Loading…
Cancel
Save