1
0
Fork 0
mirror of https://gitlab.com/Oreolek/salet.git synced 2024-04-29 23:59:38 +03:00

restore inventory room

This commit is contained in:
Alexander Yakovlev 2019-09-11 12:48:54 +07:00
parent a735cbdb6f
commit 836907ab62
Signed by: oreolek
GPG key ID: 1CDC4B7820C93BD3

View file

@ -52,6 +52,29 @@ room "start",
""", """,
choices: "#start" choices: "#start"
# This is a special inventory room.
# The inventory button is a regular link to this room.
# You may alter these as much as you like or scrap it along with the button.
room "inventory",
canSave: false # saving the game here is forbidden. Aautosaving too.
enter: () ->
$("#inventory").hide()
exit: () ->
$("#inventory").show()
dsc: () ->
if salet.character.inventory.length == 0
text = "You are carrying nothing."
else
text = "You are carrying:\n\n"
for thing in salet.character.inventory
text += "* #{salet.character.listinv(thing.name)}\n"
return text+"\n\n"+"""
<div class="center"><a href="./exit"><button class="btn btn-lg btn-outline-primary">Go back</button></a></div>
"""
actions:
exit: () ->
return salet.goBack()
room "world", room "world",
tags: ["start"], tags: ["start"],
optionText: "Enter the world", optionText: "Enter the world",