Mark new objects as seen if they're in the same room

main
Ashelyn Dawn 4 years ago
parent 8b4a2086ac
commit 9b2b267e20

@ -22,7 +22,7 @@ export default function Map() {
}, []) // eslint-disable-line
const currentRoom = (roomName && gameState.rooms.get(roomName)) || null
const itemsInRoom = Array.from(gameState.items.values()).filter(({lastKnownLocation}) => lastKnownLocation === roomName)
const itemsInRoom = Array.from(gameState.items.values()).filter(({lastKnownLocation, location}) => lastKnownLocation === roomName && location !== 'inventory')
return (
<div className={styles.map}>

@ -185,7 +185,7 @@ export default class Game {
type: ObjectType.Item,
name, aliases: [], printableName: name, description,
location,
seen: false,
seen: location === this.getCurrentRoom()?.name,
carryable
}

@ -95,6 +95,10 @@ rules.onBeforeCommand(command => {
if(command.verb.name !== 'openItem') return;
if(command.subject?.name !== 'floor panel') return;
const wrench = game.findObjectByName('wrench', ObjectType.Item) as Item
if(wrench?.location !== 'inventory')
throw new Error(`It's bolted down pretty tightly - you'll need a tool to open this panel.`)
game.setNeighbor('bathroom', 'down', 'docking')
if(game.getProperty('gamePhase') < Phase.openedSinkPanel)
game.setProperty('gamePhase', Phase.openedSinkPanel)

Loading…
Cancel
Save