title: Test Game --- command: pattern: "say #text#" action: script: msg ("You say '" + text + "', but nobody replies."); --- command: pattern: "test #object1# and #object2#" action: script: | msg ("Object1: " + object1); msg ("Object2: " + object2); --- location: lounge description: This is quite a plain lounge with an old beige carpet and peeling wallpaper. south: kitchen north: xoverride --- command: pattern: "x test" action: script: msg ("Success"); --- object: TV switchable: true alt: - television - telly look: The TV is an old model, possibly 20 years old. {if TV.switchedon:It is currently showing an old western.}{else:It is currently switched off.} watch: You watch for a few minutes. As your will to live slowly ebbs away, you remember that you’ve always hated watching westerns. --- character: Bob type: male look: "{if Bob.alive:Bob is sitting up, appearing to feel somewhat under the weather.}{else:Bob is lying on the floor, a lot more still than usual.}" use[defibrillator]: script: | if (get("Bob.alive")) { msg ("Bob is alive so you don't need to use the defibrillator again.") } else { msg ("Miraculously, the defibrillator lived up to its promise, and Bob is now alive again. He says his head feels kind of fuzzy."); set ("Bob.alive", true); } --- object: table surface: true --- object: newspaper parent: table take: true takemsg: You fold the newspaper and place it neatly under your arm. --- object: obj01 alias: lamp look: Just a lamp. --- object: obj02 alias: double bass look: Who knows why this musical instrument is here? --- object: defibrillator look: A heart defibrillator can magically revive a dead person, if all those hospital dramas are to be believed. take: true --- object: wallpaper look: There's really nothing interesting about the wallpaper. scenery: true --- location: kitchen description: Just an ordinary kitchen. east: garden --- object: eggs weight: 250 plural: true take: true look: script: msg ("A box of eggs, weighing " + get("eggs.weight") + " grams."); --- command: pattern: "weigh #object#" action: script: msg ("It weighs " + get(object, "weight") + " grams."); --- object: fridge container: true closed: true --- object: milk parent: fridge prefix: some --- object: cheese parent: fridge prefix: some --- object: beer parent: fridge prefix: some --- location: xoverride description: Test overriding the "look" command. --- command: pattern: "x #object#" action: script: msg ("x (object) is overridden here. Object " + object); --- object: thing --- location: garden --- exit: to: shed --- location: shed --- exit: direction: out to: garden --- walkthrough: test steps: - x tv - x bob - take defib - assert: get('defibrillator.parent') == 'player' - assert: get('player.parent') == 'lounge' - s - assert: get('player.parent') == 'kitchen' - undo - assert: get('player.parent') == 'lounge' - assert: get('defibrillator.parent') == 'player' - undo - assert: get('defibrillator.parent') == 'lounge' - s - x eggs - weigh eggs - n --- walkthrough: test 2 steps: - test bob and lamp - x b - 1