mirror of
https://gitlab.com/Oreolek/salet.git
synced 2024-07-04 07:45:03 +03:00
Issue #7: renaming content to dsc
There are two reasons to make this change: 1. Consistency because objects also have `dsc` 2. `content` is not a good property name. `dsc` is much more self-explanatory.
This commit is contained in:
parent
a1d04aa459
commit
b51d54e227
|
@ -53,7 +53,7 @@ here = () ->
|
|||
# The first room of the game.
|
||||
# For accessibility reasons the text is provided in HTML, not here.
|
||||
room "start",
|
||||
content: """
|
||||
dsc: """
|
||||
""",
|
||||
choices: "#start"
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@ room "world",
|
|||
tags: ["start"],
|
||||
optionText: "Enter the world",
|
||||
ways: ["plaza"]
|
||||
content: """
|
||||
dsc: """
|
||||
### Rhinestone Room
|
||||
|
||||
|
||||
You're in a large room carved inside a giant milky rock mountain.
|
||||
The floor and walls are littered with signs and signatures of the previous visitors.
|
||||
|
||||
|
@ -32,7 +32,7 @@ room "plaza",
|
|||
"""
|
||||
else
|
||||
"You quickly find the central plaza."
|
||||
content: (character, system) ->
|
||||
dsc: (character, system) ->
|
||||
retval = "There are #{textlink("people shouting", "people")} nearby."
|
||||
unless character.sandbox.has_mark?
|
||||
retval += "\n\nYou could ask a policeman #{textlink("for directions.", "mark")}"
|
||||
|
@ -52,7 +52,7 @@ room "plaza",
|
|||
room "shop",
|
||||
title: "The Shop"
|
||||
ways: ["plaza", "shop-inside", "lair"]
|
||||
content: """
|
||||
dsc: """
|
||||
Being the only shop in town, this trendy establishment did not need a name.
|
||||
It's an open question why it had one, especially because its name was "Hung Crossing".
|
||||
|
||||
|
@ -62,7 +62,7 @@ room "shop",
|
|||
room "lair",
|
||||
title: "The Lair"
|
||||
before: "Finding The Lair is easy. Leaving it is impossible. Your game ends here."
|
||||
content: """
|
||||
dsc: """
|
||||
The Lair of Yog-Sothoth is a very *n'gai* cave, full of *buggs-shoggogs* and *n'ghaa ng'aa*.
|
||||
"""
|
||||
objects: {
|
||||
|
@ -83,8 +83,8 @@ room "shop-inside",
|
|||
tags: ["merchant"]
|
||||
optionText: "End the conversation"
|
||||
title: "Inside the Shop"
|
||||
content: """
|
||||
The insides are painted pastel white, honouring The Great Milk Spill of 1985.
|
||||
dsc: """
|
||||
The insides are painted pastel white, honouring The Great Milk Spill of 1985.
|
||||
"""
|
||||
objects: {
|
||||
merchant: obj "merchant",
|
||||
|
@ -108,7 +108,6 @@ lamp.put("shop-inside")
|
|||
|
||||
room "merchdialogue",
|
||||
choices: "#merchant",
|
||||
content: """
|
||||
dsc: """
|
||||
Nice day, isn't it?
|
||||
"""
|
||||
|
||||
|
|
|
@ -23,6 +23,10 @@
|
|||
<div id="content_wrapper" class="row">
|
||||
<div id="intro" class="content">
|
||||
<section>
|
||||
<!-- For the accessibility reasons, you really should begin your game here.
|
||||
Write a short intro the player will read while the Javascript is loading and executing.
|
||||
It has to be HTML but that shouldn't be a BIG problem if you're reading this.
|
||||
On the other hand this means the first intro passages will be non-interactive. -->
|
||||
<p><em>Salet</em> is an offspring of Undum and Raconteur.</p>
|
||||
<p>The project is still a work-in-progress. This "game" will show you some of the new features.</p>
|
||||
<p>It's supposed to be relatively painless for the author without sacrificing the reader's experience.
|
||||
|
|
|
@ -18,7 +18,7 @@ Usage:
|
|||
dialogue = (title, startTag, endTag, text, effect) ->
|
||||
retval = room(randomid(), {
|
||||
optionText: title
|
||||
content: text
|
||||
dsc: text
|
||||
clear: false # backlog is useful in dialogues
|
||||
choices: "#"+endTag
|
||||
})
|
||||
|
|
|
@ -79,7 +79,7 @@ class SaletRoom extends RaconteurSituation
|
|||
###
|
||||
exit: (character, system, to) =>
|
||||
return true
|
||||
|
||||
|
||||
###
|
||||
I call SaletRoom.enter every time the player enters this room but before the section is opened.
|
||||
Unlike @before this gets called before the current section is opened.
|
||||
|
@ -108,7 +108,7 @@ class SaletRoom extends RaconteurSituation
|
|||
@visited++
|
||||
if undum.game.situations[f].exit?
|
||||
undum.game.situations[f].exit(character, system, @name)
|
||||
|
||||
|
||||
if @enter
|
||||
@enter character, system, f
|
||||
|
||||
|
@ -148,8 +148,8 @@ class SaletRoom extends RaconteurSituation
|
|||
retval = ""
|
||||
|
||||
# Print the room description
|
||||
if @content
|
||||
retval += markdown(@content.fcall(this, character, system, f))
|
||||
if @dsc
|
||||
retval += markdown(@dsc.fcall(this, character, system, f))
|
||||
|
||||
for name, thing of @objects
|
||||
retval += thing.look()
|
||||
|
@ -188,7 +188,7 @@ class SaletRoom extends RaconteurSituation
|
|||
return print(thing.act.fcall(thing, character, system))
|
||||
# the loop is done but no return came - match not found
|
||||
console.error("Could not find #{link[1]} in current room.")
|
||||
|
||||
|
||||
# default Raconteur action
|
||||
return RaconteurSituation.prototype.act.call(this, character, system, action)
|
||||
|
||||
|
|
Loading…
Reference in a new issue