2016-09-10 07:38:07 +03:00
|
|
|
dialogue = require('../../lib/dialogue.coffee')
|
|
|
|
phrase = require('../../lib/phrase.coffee')
|
2016-01-15 03:06:03 +02:00
|
|
|
oneOf = require('../../lib/oneOf.coffee')
|
2016-09-11 14:33:36 +03:00
|
|
|
require('salet')
|
2016-02-01 09:22:23 +02:00
|
|
|
|
2016-09-10 07:38:07 +03:00
|
|
|
salet.game_id = "your-game-id-here"
|
2016-09-20 18:05:09 +03:00
|
|
|
salet.game_version = "1.5"
|
2016-02-01 09:22:23 +02:00
|
|
|
$(document).ready(() ->
|
2016-06-28 11:00:41 +03:00
|
|
|
window.addEventListener('popstate', (event) ->
|
|
|
|
salet.goBack()
|
|
|
|
)
|
|
|
|
|
2016-02-01 09:22:23 +02:00
|
|
|
salet.beginGame()
|
|
|
|
)
|
2016-01-07 13:27:57 +02:00
|
|
|
|
2016-01-15 03:06:03 +02:00
|
|
|
###
|
|
|
|
Element helpers. There is no real need to build monsters like a().id("hello")
|
|
|
|
because you won't use them as is. It does not make sense in context, the
|
|
|
|
author has Markdown and all utilities to *forget* about the markup.
|
|
|
|
###
|
|
|
|
way_to = (content, ref) ->
|
|
|
|
return "<a href='#{ref}' class='way'>#{content}</a>"
|
|
|
|
textlink = (content, ref) ->
|
|
|
|
return "<a href='./_writer_#{ref}' class='once'>#{content}</a>"
|
|
|
|
actlink = (content, ref) ->
|
|
|
|
return "<a href='./#{ref}' class='once'>#{content}</a>"
|
2016-01-19 05:03:01 +02:00
|
|
|
|
2016-01-15 03:06:03 +02:00
|
|
|
# The first room of the game.
|
|
|
|
# For accessibility reasons the text is provided in HTML, not here.
|
2016-09-11 14:33:36 +03:00
|
|
|
room "start",
|
|
|
|
enter: () ->
|
2016-04-05 04:56:44 +03:00
|
|
|
salet.character.bought_lamp = false
|
2016-01-18 12:29:14 +02:00
|
|
|
dsc: """
|
2016-01-15 03:06:03 +02:00
|
|
|
""",
|
|
|
|
choices: "#start"
|
2016-03-20 15:46:40 +02:00
|
|
|
|
|
|
|
# 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.
|
2016-09-11 14:33:36 +03:00
|
|
|
room "inventory",
|
2016-03-27 18:34:16 +03:00
|
|
|
canSave: false # saving the game here is forbidden. Aautosaving too.
|
2016-03-20 15:46:40 +02:00
|
|
|
enter: () ->
|
|
|
|
$("#inventory").hide()
|
|
|
|
exit: () ->
|
|
|
|
$("#inventory").show()
|
2016-09-11 14:33:36 +03:00
|
|
|
dsc: () ->
|
2016-03-20 15:46:40 +02:00
|
|
|
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"+"""
|
2016-03-21 03:41:56 +02:00
|
|
|
<div class="center"><a href="./exit"><button class="btn btn-lg btn-outline-primary">Go back</button></a></div>
|
2016-03-20 15:46:40 +02:00
|
|
|
"""
|
2016-03-21 03:41:56 +02:00
|
|
|
actions:
|
2016-09-11 14:33:36 +03:00
|
|
|
exit: () ->
|
2016-03-21 03:41:56 +02:00
|
|
|
return salet.goBack()
|