| @@ -63,7 +63,12 @@ stories.push({ | |||||
| "execute": (room) => { | "execute": (room) => { | ||||
| state.player.rooms[room.id].squinted = true; | state.player.rooms[room.id].squinted = true; | ||||
| print(["You stare at the wall and notice a secret door. But where is the key?"]); | print(["You stare at the wall and notice a secret door. But where is the key?"]); | ||||
| } | |||||
| }, | |||||
| "conditions": [ | |||||
| (room) => { | |||||
| return !state.player.rooms[room.id].squinted; | |||||
| } | |||||
| ] | |||||
| }, | }, | ||||
| { | { | ||||
| "name": "Find Keys", | "name": "Find Keys", | ||||
| @@ -259,7 +259,10 @@ function updateRoom() { | |||||
| if (action.conditions) { | if (action.conditions) { | ||||
| if (!action.conditions.every(cond => cond(room))) { | if (!action.conditions.every(cond => cond(room))) { | ||||
| button.classList.add("disabled"); | button.classList.add("disabled"); | ||||
| button.setAttribute("disabled", "true"); | |||||
| button.setAttribute("disabled", true); | |||||
| } else { | |||||
| button.classList.remove("disabled"); | |||||
| button.removeAttribute("disabled"); | |||||
| } | } | ||||
| } | } | ||||