1
1
Fork 0
mirror of https://gitlab.com/Oreolek/cloak-salet.git synced 2024-05-04 18:18:35 +03:00

Exiting through the north entrance properly

This commit is contained in:
Alexander Yakovlev 2017-05-20 17:45:50 +07:00
parent c72d6bad55
commit 7cd0b92811
5 changed files with 23 additions and 15 deletions

View file

@ -70,6 +70,7 @@ sysroom = (name, options) ->
options.enter = () ->
$("#inventory").hide()
options.exit = () ->
salet.view.clearContent('#current-room')
$("#inventory").show()
options.dsc = () ->
return @text.fcall()+"\n\n"+"""

View file

@ -26,16 +26,22 @@ salet.init = () ->
return "no_cloak".l()
@character.take(cloak)
croom "start",
foyer_options =
before: () -> "start".l()
dsc: () -> "foyer".l()
ways: ["entrance", "cloakroom", "bar"]
croom "foyer",
clear: false
dsc: () -> "foyer".l()
ways: ["entrance", "cloakroom", "bar"]
title: () -> "foyer_title".l()
dsc: () -> "foyer".l()
ways: ["entrance", "cloakroom", "bar"]
canExit: (to) -> # can't exit to north
if (to == 'entrance')
# print the effect after the room description, after the player enters the room
setTimeout(() ->
salet.view.write("<span class='effect'>"+"entrance".l()+"</span>")
, 0)
return false
croom "start", foyer_options
foyer_options.before = null # no title splash after game begins
croom "foyer", foyer_options
croom "cloakroom",
dsc: () -> "cloakroom".l()
@ -43,9 +49,6 @@ croom "cloakroom",
ways: ["foyer"]
croom "entrance",
dsc: () -> "entrance".l()
after: () ->
salet.goTo('foyer')
title: () -> "entrance_title".l()
croom "bar",

View file

@ -12,8 +12,8 @@ start: """
foyer: """
You are standing in a spacious hall, splendidly decorated in red
and gold, with glittering chandeliers overhead.
The entrance from the street is to the [north,](north) and there are doorways
[south](south) and [west.](west)
The entrance from the street is to the [north,](entrance) and there are doorways
[south](bar) and [west.](cloakroom)
"""
credits: """
The game uses code licensed by MIT license.

View file

@ -1,11 +1,11 @@
{
"dependencies": {
"salet": "^1.7.5"
"salet": "^1.7.7"
},
"private": true,
"devDependencies": {
"bootstrap": "^4.0.0-alpha.5",
"browser-sync": "^2.18.8",
"browser-sync": "^2.18.11",
"coffee-script": "^1.12.6",
"cson": "^4.1.0",
"gulp": "^3.8.11",

View file

@ -155,6 +155,9 @@ hr {
}
text-align: center;
}
.effect {
color: #4c20dd;
}
.tab {
width: 100%;
position: relative;
@ -174,3 +177,4 @@ hr {
background: darken($body-bg, 15);
}
}