1
0
Fork 0
mirror of https://gitlab.com/Oreolek/black_phone.git synced 2024-05-21 18:38:31 +03:00

Bugfixing and README

This commit is contained in:
Alexander Yakovlev 2016-01-02 15:17:36 +07:00
parent 053505a9be
commit d98370303f
5 changed files with 151 additions and 114 deletions

37
README.md Normal file
View file

@ -0,0 +1,37 @@
# The Black Phone
### A walk through someone else's apartment
*Provided under the terms of MIT license, see LICENSE.txt*
#### Hacks and whistles
"Black phone" boasts a new technical feature: additional room exits.
This is something I greatly missed coming from INSTEAD.
I had to hack Undum and expose ("export") its `processClick` function so I could make an additional interface block.
The technical side is simple: my [Undum-commonjs](https://github.com/oreolek/undum-commonjs) fork exports `processClick` function.
Every situation that is a room (there are non-room situations, mind) has an array of `ways`.
This array has every other room this one connects to.
On entering a room, the `before` function calls for `update_ways` function that reads `ways` array and updates the UI.
It's not automatic but the game is small enough for this to work.
Undum has a bug: every "once" link becomes clickable again when you visit the same situation.
For example, you can save the game, load it again and click everything the second time.
The game exploits this because you can visit any room again and examine everything you missed.
There is also a slightly debatable UI hack: as every link is "once" link (it gets deactivated once it's called),
I've sped up every click by 250ms or so like this:
document.onmousedown = (e) ->
e.target.click()
A "click" in Javascript is an event of clicking the mouse button and releasing it.
The "mousedown" event is just clicking the button, not waiting for the release.
I didn't bother with intricacies, so the right mouse click is treated the same as the left one.
#### Known bugs
* The `once` bug I mentioned earlier (it's almost a feature by now)
* The `writemd` function just pops the text out.
This is inconsistent with normal actions and situation transitions that play a slideDown animation for that.

View file

@ -54,7 +54,7 @@ code_check = (character, system) ->
# that prevents the player from entering "3112".
# You see, you can't select the situation 1 when you are
# already in this situation, so you can't input 1 twice.
if character.sandbox.code == "31122017" or character.sandbox.code == "01012017"
if character.sandbox.code == "01012017"
character.sandbox.box_opened = 1
if character.sandbox.knows_the_code == 0
writemd(system, """
@ -84,9 +84,16 @@ code_check = (character, system) ->
writemd(system, "Something clicks and the display resets, but the box stays locked.")
if character.sandbox.code == "000000"
writemd(system, "Of course, Ronald didn't hope it would be that easy.")
character.sandbox.code = ""
update_ways = (ways) ->
content = ""
for way in ways
if undum.game.situations[way]?
content += way_to(undum.game.situations[way].title, way)
$("#ways").html(content)
situation "start",
content: """
Peter had so much trouble sleeping he had to drown his pills in at least an hour of thoughts.

View file

@ -1,4 +1,6 @@
qualities
general:
money: qualities.integer('Money'),
undum.game.init = (character, system) ->
$("#ways").on("click", "a", (event) ->

View file

@ -1,15 +1,3 @@
update_ways = (ways) ->
content = ""
for way in ways
if undum.game.situations[way]?
content += way_to(undum.game.situations[way].title, way)
$("#ways").html(content)
# if the player enters the code prior to learning the birthday, the game responds accordingly
# when he wants to go, there's someone at rge door
# it's another thief (someone who is at ease with Ana's Instagram too) who took out Petya
# the Black Phone can deal with him
situation "living-room",
title: "Living room"
before: () ->
@ -19,15 +7,13 @@ situation "living-room",
ways: ["bedroom", "kitchen", "balcony"]
content: """
Ronald is standing in a dark room with a big #{textlink("window.", "window")}
The walls are covered with a dingy rose wallpaper.
The room is very unnerving.
Was it actually her home?
On a coffee table lies an opened envelope.
#{textlink("A book stand", "bookcase")} is hanging above #{textlink("a television set.", "tv")}
Oh, and #{actlink("the door Ronald came into", "door")} the apartment is there, too.
"""
actions:
@ -35,7 +21,6 @@ situation "living-room",
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."
@ -65,18 +50,24 @@ situation "living-room",
dictionary: "A big fat dictionary of everything, issued in 1989. Nobody reads every page of these. Ronald doubts Anastacia got to read at least one page."
grey: "Fifty Shades of Grey, an unnecessary remake. Now from a psychopath's point of view. And she actually read that."
zaratustra: (character, system) ->
money(character, system, 20000)
"""
Nietsche's four-part novel about The Man, The Superman and everything in-between.
It's surprisingly worn down.
She took this book out a lot.
if character.sandbox.seen_zaratustra?
"""
This book already gave Ronald everything he wanted.
No need to read it, not a bit.
"""
else
money(character, system, 20000)
"""
Nietsche's four-part novel about The Man, The Superman and everything in-between.
It's surprisingly worn down.
She took this book out a lot.
Was she secretly a philosophy nut?
An Übermensch dreamer?
Was she secretly a philosophy nut?
An Übermensch dreamer?
No, of course not.
Ronald opens the book and finds a stash of money inside.
"""
No, of course not.
Ronald opens the book and finds a stash of money inside.
"""
dontzova: """
An "ironic detective" by Daria Dontzova about Evlampia Romanova, an amateur detective.
The heroine (nicknamed as Lamp) plays harp and solves murders.
@ -98,7 +89,7 @@ situation "bedroom",
#{textlink("A massive wardrobe", "wardrobe")} occupies one of the walls.
On the wall across #{textlink("a big bed", "bed")} hangs #{textlink("a full sized mirror.", "mirror")}
#{if character.sandbox.box_opened == 0
"On a small table near the bed is an ornate #{way_to("wooden box.", "box")}"
else ""}
@ -110,7 +101,32 @@ situation "bedroom",
The sheets are still fresh.
"""
wardrobe: """
TODO [This is about Ana's looks, her body.]
Anastacia's wardrobe is very high-maintenance.
It has a built-in ironing board (with an iron hanged nearby), with 5 drawer rows for #{textlink("lingerie,", "lingerie")} #{textlink("accessories", "accessories")}, #{textlink("shoes.", "shoes")}, #{textlink("hats", "hats")} and.. #{textlink("audio players.", "mp3")}
On the hangers are cashmere coat, sport jacket, jeans, green shirt, a red sleeveless shirt, an orange vest, knee-length flower dress, another flower dress, alpaca coat, a short skirt and a big collection of dancing costumes.
"""
mp3: """
Wow, this woman LOVES her players!
There are MP3 players, CD players, portable DVD, walk-on clips, sport hands-free players, underwater ones.
These are all rather cheap, though, compared to *something else* in this room.
"""
hats: "These look very old-style, very Mary Poppins-like.Maybe that's just a trend or whatever.",
lingerie: "Ronald won't be digging in that."
accessories: """
A cross necklace, three metal bracelets and lots of uncomplicated earrings and hair pins.
A dozen of scarfs or so.
No diamonds, no rings, no *jewelry.*
On the other hand, her Instagram nickname is *bareboned mane shaker.*
"""
shoes: """
Anastacia doesn't care for the footwear fashion.
These 4 pairs of combat boots and 13 pairs of ballet flats can attest that.
Of course, there are sandals, loafers, flat dress shoes.. That's a strong dislike for heels... or maybe it's a medical problem?
"""
mirror: """
The mirror looks directly at the bed.
@ -123,14 +139,25 @@ situation "bedroom",
On a close examination, the frame isn't attached to the wall.
There is #{textlink("a safe", "safe")} behind the mirror!
"""
safe: """
The safe is locked with a regular lock.
Ronald tries two keys.
The first of them opens the door.
safe: (character) -> """
#{if character.sandbox.seen_safe?
"""
The safe is locked with a regular lock.
Ronald tries two keys.
The first of them opens the door.
There are #{textlink("money", "money")} inside, and #{textlink("a rough sketch.", "sketch")}
There are #{textlink("money", "money")} inside, and #{textlink("a rough sketch.", "sketch")}
"""
else
"""
The safe is open now.
There is #{textlink("a rough sketch", "sketch")} inside.
"""
}
"""
money: (character, system) ->
character.sandbox.seen_safe = 1
money(character, system, 50000)
"""
It's a big cash.
@ -170,9 +197,22 @@ situation "kitchen",
And enough frozen pizzas to last a month.
"""
table: """
TODO [Here the player learns why Ana decided to bolt away. Also that the date notation is DD.MM.YYYY. I'm still deciding on the object that would be here, though.]
"""
table: (character, system) ->
if character.sandbox.seen_table?
"A letter's still there. Nothing new about it."
else
character.sandbox.seen_table = 1
"""
There's something on the table.
It looks like a formal letter.
It's in French, though, so Ronald won't be able to read it.
He's sure it's recent (`24.03.2018`) and it's about something-something QUANTUM AUDIO.. armement?
Ronald makes a photo copy to translate it later, after the job.
*Perhaps this is why she ran away? Best not to touch it but a copy could be useful.*
"""
situation "bathroom",
before: (character,system) ->
@ -226,7 +266,7 @@ situation "box",
"""
Ronald takes out a vial from his pocket. He coats the keys with a bright white powder.
Only 1, 2, 3, 7 and 0 keys are fingerprinted.
Only 1, 2, 7 and 0 keys are fingerprinted.
He wipes the box clean until there is no trace of the powder.
"""
@ -238,81 +278,31 @@ situation "smash",
canView: (character) ->
character.sandbox.view_smash == 1
optionText: "Smash the box"
before: (character) ->
before: (character) ->
character.sandbox.view_smash = 0
choices: "#box"
tags: ["box"]
content: "Ronald still needs the phone in this box. A very high-tech fragile phone. Smashing isn't an option."
situation "put1",
choices: "#box"
tags: ["box"]
optionText: "Enter 1"
before: (character) ->
code_input(character, 1)
canChoose: (character) ->
code_can_input(character)
after: (character, system) ->
code_check(character, system)
content: (character) -> """
Ronald presses button 1. The display is #{character.sandbox.code} now.
"""
safe_button = (number) ->
situation "put#{number}",
choices: "#box"
tags: ["box"]
optionText: "Enter #{number}"
before: (character) ->
code_input(character, number)
canChoose: (character) ->
code_can_input(character)
after: (character, system) ->
code_check(character, system)
content: (character) -> """
Ronald presses button #{number}. The display is #{character.sandbox.code} now.
"""
situation "put2",
choices: "#box"
tags: ["box"]
optionText: "Enter 2"
before: (character) ->
code_input(character, 2)
after: (character, system) ->
code_check(character, system)
canChoose: (character) ->
code_can_input(character)
content: (character) -> """
Ronald presses button 2. The display is #{character.sandbox.code} now.
"""
situation "put3",
choices: "#box"
tags: ["box"]
optionText: "Enter 3"
before: (character) ->
code_input(character, 3)
after: (character, system) ->
code_check(character, system)
canChoose: (character) ->
code_can_input(character)
content: (character) -> """
Ronald presses button 3. The display is #{character.sandbox.code} now.
"""
situation "put7",
choices: "#box"
tags: ["box"]
optionText: "Enter 7"
before: (character) ->
code_input(character, 7)
after: (character, system) ->
code_check(character, system)
canChoose: (character) ->
code_can_input(character)
content: (character) -> """
Ronald presses button 7. The display is #{character.sandbox.code} now.
"""
situation "put0",
choices: "#box"
tags: ["box"]
optionText: "Enter 0"
before: (character) ->
code_input(character, 0)
after: (character, system) ->
code_check(character, system)
canChoose: (character) ->
code_can_input(character)
content: (character) -> """
Ronald presses button 0. The display is #{character.sandbox.code} now.
"""
safe_button(1)
safe_button(2)
safe_button(7)
safe_button(0)
situation "reset",
choices: "#box"
@ -321,7 +311,7 @@ situation "reset",
before: (character) ->
code_reset(character)
content: """
You press Backspace until the display is empty.
Ronald presses Backspace until the display is empty.
"""
situation "exitdoor",
@ -339,6 +329,7 @@ situation "exitdoor",
situation "finale",
before: () ->
$("#tools_wrapper").hide()
update_ways(this.ways)
optionText: "Use the Phone"
tags: ["door"]
@ -350,13 +341,13 @@ situation "finale",
### A CACOPHONY OF MONKEY SOUNDS
There stands a tall man in a grey jacket.
There stands a tall man in a grey jacket and plaid shirt.
*Another Instagram follower, perhaps?*
An older man in his pajamas and slippers lies motionless on the floor near him.
### A QUANTUM MAGICAL SMART PHONE FIESTA
The man in a grey jacket slumps as if struck by something.
Ronald taps the Phone again and quietly escapes the floor.
@ -368,7 +359,7 @@ situation "finale",
"The phone is heavy in the pocket."
}
The sun is coming up soon.
If you're not sleeping at night, you risk to learn something secret about your neighbors.
<center><h3>END</h3></center>

View file

@ -30,7 +30,7 @@
<div id="character_text">
<div id="character_text_content"></div>
</div>
<div id="qualities"></div>
<!-- <div id="qualities"></div> -->
</div>
</div>
<div class='ways'>