1
0
Fork 0
mirror of https://gitlab.com/Oreolek/black_phone.git synced 2024-06-17 07:30:57 +03:00
Now you definitely can finish it.
This commit is contained in:
Alexander Yakovlev 2016-01-01 21:31:00 +07:00
parent c1cf0e2aa4
commit 053505a9be
4 changed files with 21 additions and 9 deletions

View file

@ -27,6 +27,7 @@ undum.game.version = "1.0"
a = require('raconteur/lib/elements.js').a
way_to = (content, ref) -> a(content).class('way').ref(ref)
textlink = (content, ref) -> a(content).once().writer(ref)
actlink = (content, ref) -> a(content).once().action(ref)
textcycle = (content, ref) -> a(content).replacer(ref).class("cycle").id(ref).toString()
# usage: writemd( system, "Text to write")
writemd = (system, text) ->
@ -78,6 +79,7 @@ code_check = (character, system) ->
Ronald has no other business here.
It's time to go.
""")
system.doLink("bedroom")
else
writemd(system, "Something clicks and the display resets, but the box stays locked.")
if character.sandbox.code == "000000"

View file

@ -5,8 +5,16 @@ undum.game.init = (character, system) ->
event.preventDefault()
undum.processClick($(this).attr("href"))
)
# If you use only once() links you can use this "hack":
document.onmousedown = (e) ->
e.target.click()
# It makes every click slightly faster because the game responds after the user presses the mouse button,
# not after he presses and releases it.
#
# Another thing to bear in mind: this game is not a typical Undum game.
# It deliberately repeats the situations, so you can repeat "once" links once you re-enter the situation.
# So this game has no need in repeatable links at all and this hack is useful.
character.sandbox.view_smash = 1
character.sandbox.code = ""
character.sandbox.knows_the_code = 0

View file

@ -28,8 +28,15 @@ situation "living-room",
#{textlink("A book stand", "bookcase")} is hanging above #{textlink("a television set.", "tv")}
Oh, and #{textlink("the door Ronald came into", "door")} the apartment is there, too.
Oh, and #{actlink("the door Ronald came into", "door")} the apartment is there, too.
"""
actions:
door: (character, system) ->
if character.sandbox.box_opened == 0
writemd(system, "Ronald has a job here. It's still on.")
else
$(".ways").hide()
system.doLink("exitdoor")
writers:
window: "The moon is full today. It illuminates the flat, makes the things stand out in some weird angles."
bookcase: """
@ -78,11 +85,6 @@ situation "living-room",
culinary: "An old culinary book. Nothing about it."
bible: "An Orthodox Christian Bible, Old Testament. A decent hardcover edition. Bookmarked at the Sodom episode."
tv: "An expensive 40-something inch TV standing on a stylish black stand. The room looks kinda small for that monster."
door: (character, system) ->
if character.sandbox.box_opened == 0
"Ronald has a job here. It's still on."
else
system.doLink("door")
situation "bedroom",
before: () ->
@ -99,7 +101,7 @@ situation "bedroom",
#{if character.sandbox.box_opened == 0
"On a small table near the bed is an ornate #{way_to("wooden box.", "box")}"
}
else ""}
"""
writers:
bed: """
@ -322,7 +324,7 @@ situation "reset",
You press Backspace until the display is empty.
"""
situation "door",
situation "exitdoor",
before: () ->
update_ways(this.ways)
ways: ["living-room"]

View file

@ -46,7 +46,7 @@
<div id="legal">
<div id="footleft">
<p>The game was written by <b><a href="http://en.oreolek.ru/" target="_blank">Oreolek.</a></b></p>
<p>Approximate play time: four minutes.</p>
<p>Approximate play time: five minutes.</p>
<p>Written using <a href="http://undum.com" target="_blank">Undum</a> and <a href="http://sequitur.github.io/raconteur/" target="_blank">Raconteur</a>.</p>
</div>
<div id="footright">