UNPKG

text-rpg-engine

Version:

Library to create text adventures / interactive fiction with custom user interactions

72 lines 3.67 kB
{ "game": { "startRoom": "Beginning", "endRoom": "SecondRoom", "rooms": [ { "name": "Beginning", "getText": "This is the beginning room", "prompts": [ { "name": "go right", "keywords": ["go right", "move right", "open right", "enter right", "door right", "right door"], "results": { "successText": "You enter in the access code '14052' and successfully open the door.", "failText": "The door is locked with an access code!", "roomToEnter": "SecondRoom", "itemsGiven": "trophy" }, "requirements": ["accessKey"] }, { "name": "look room", "keywords": ["look room", "look at room", "search room", "examine room", "look in"], "results": { "successText": "You see a room with a door to the right and a statue in the middle." } }, { "name": "get statue", "keywords": ["look room", "look at room", "search room", "examine room", "look in"], "results": { "successText": "You see a room with a door to the right and a statue in the middle." } }, { "name": "get statue", "keywords": ["get statue", "pick up statue", "take statue", "pick statue"], "results": { "successText": "You pick up the statue. It feels heavy in your hands, and there's something hanging off the bottom.", "itemsGiven": ["statue"] } }, { "name": "rotate statue", "keywords": ["rotate statue", "rotate the statue"], "results": { "successText": "You take the note from the bottom of the statue.", "failText": "You have no statue to look at!", "itemsGiven": ["note"] }, "requirements": ["statue"] }, { "name": "look note", "keywords": ["look at note", "examine note", "take note", "get note", "check note", "read note", "look note"], "results": { "successText": "You look at the note and find an access code: '14052'.", "failText": "You have no note to look at!", "itemsGiven": ["accessKey"] }, "requirements": ["statue", "note"] } ] }, { "name": "SecondRoom", "getText": "You did it! You won!" } ] } }