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:
parent
a735cbdb6f
commit
836907ab62
|
@ -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",
|
||||||
|
|
Loading…
Reference in a new issue