1
0
Fork 0
mirror of https://gitlab.com/Oreolek/salet.git synced 2024-07-07 01:04:25 +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:
Alexander Yakovlev 2016-01-18 17:29:14 +07:00
parent a1d04aa459
commit b51d54e227
5 changed files with 19 additions and 16 deletions

View file

@ -53,7 +53,7 @@ here = () ->
# The first room of the game. # The first room of the game.
# For accessibility reasons the text is provided in HTML, not here. # For accessibility reasons the text is provided in HTML, not here.
room "start", room "start",
content: """ dsc: """
""", """,
choices: "#start" choices: "#start"

View file

@ -2,9 +2,9 @@ room "world",
tags: ["start"], tags: ["start"],
optionText: "Enter the world", optionText: "Enter the world",
ways: ["plaza"] ways: ["plaza"]
content: """ dsc: """
### Rhinestone Room ### Rhinestone Room
You're in a large room carved inside a giant milky rock mountain. 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. The floor and walls are littered with signs and signatures of the previous visitors.
@ -32,7 +32,7 @@ room "plaza",
""" """
else else
"You quickly find the central plaza." "You quickly find the central plaza."
content: (character, system) -> dsc: (character, system) ->
retval = "There are #{textlink("people shouting", "people")} nearby." retval = "There are #{textlink("people shouting", "people")} nearby."
unless character.sandbox.has_mark? unless character.sandbox.has_mark?
retval += "\n\nYou could ask a policeman #{textlink("for directions.", "mark")}" retval += "\n\nYou could ask a policeman #{textlink("for directions.", "mark")}"
@ -52,7 +52,7 @@ room "plaza",
room "shop", room "shop",
title: "The Shop" title: "The Shop"
ways: ["plaza", "shop-inside", "lair"] ways: ["plaza", "shop-inside", "lair"]
content: """ dsc: """
Being the only shop in town, this trendy establishment did not need a name. 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". It's an open question why it had one, especially because its name was "Hung Crossing".
@ -62,7 +62,7 @@ room "shop",
room "lair", room "lair",
title: "The Lair" title: "The Lair"
before: "Finding The Lair is easy. Leaving it is impossible. Your game ends here." 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*. The Lair of Yog-Sothoth is a very *n'gai* cave, full of *buggs-shoggogs* and *n'ghaa ng'aa*.
""" """
objects: { objects: {
@ -83,8 +83,8 @@ room "shop-inside",
tags: ["merchant"] tags: ["merchant"]
optionText: "End the conversation" optionText: "End the conversation"
title: "Inside the Shop" title: "Inside the Shop"
content: """ dsc: """
The insides are painted pastel white, honouring The Great Milk Spill of 1985. The insides are painted pastel white, honouring The Great Milk Spill of 1985.
""" """
objects: { objects: {
merchant: obj "merchant", merchant: obj "merchant",
@ -108,7 +108,6 @@ lamp.put("shop-inside")
room "merchdialogue", room "merchdialogue",
choices: "#merchant", choices: "#merchant",
content: """ dsc: """
Nice day, isn't it? Nice day, isn't it?
""" """

View file

@ -23,6 +23,10 @@
<div id="content_wrapper" class="row"> <div id="content_wrapper" class="row">
<div id="intro" class="content"> <div id="intro" class="content">
<section> <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><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>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. <p>It's supposed to be relatively painless for the author without sacrificing the reader's experience.

View file

@ -18,7 +18,7 @@ Usage:
dialogue = (title, startTag, endTag, text, effect) -> dialogue = (title, startTag, endTag, text, effect) ->
retval = room(randomid(), { retval = room(randomid(), {
optionText: title optionText: title
content: text dsc: text
clear: false # backlog is useful in dialogues clear: false # backlog is useful in dialogues
choices: "#"+endTag choices: "#"+endTag
}) })

View file

@ -79,7 +79,7 @@ class SaletRoom extends RaconteurSituation
### ###
exit: (character, system, to) => exit: (character, system, to) =>
return true return true
### ###
I call SaletRoom.enter every time the player enters this room but before the section is opened. 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. Unlike @before this gets called before the current section is opened.
@ -108,7 +108,7 @@ class SaletRoom extends RaconteurSituation
@visited++ @visited++
if undum.game.situations[f].exit? if undum.game.situations[f].exit?
undum.game.situations[f].exit(character, system, @name) undum.game.situations[f].exit(character, system, @name)
if @enter if @enter
@enter character, system, f @enter character, system, f
@ -148,8 +148,8 @@ class SaletRoom extends RaconteurSituation
retval = "" retval = ""
# Print the room description # Print the room description
if @content if @dsc
retval += markdown(@content.fcall(this, character, system, f)) retval += markdown(@dsc.fcall(this, character, system, f))
for name, thing of @objects for name, thing of @objects
retval += thing.look() retval += thing.look()
@ -188,7 +188,7 @@ class SaletRoom extends RaconteurSituation
return print(thing.act.fcall(thing, character, system)) return print(thing.act.fcall(thing, character, system))
# the loop is done but no return came - match not found # the loop is done but no return came - match not found
console.error("Could not find #{link[1]} in current room.") console.error("Could not find #{link[1]} in current room.")
# default Raconteur action # default Raconteur action
return RaconteurSituation.prototype.act.call(this, character, system, action) return RaconteurSituation.prototype.act.call(this, character, system, action)