1
0
Fork 0
mirror of https://gitlab.com/Oreolek/salet.git synced 2024-07-07 01:04:25 +03:00

Rewritten using more OOP

This commit is contained in:
Alexander Yakovlev 2016-01-18 18:29:34 +07:00
parent 0d7f566441
commit 407305a54c

View file

@ -7,11 +7,11 @@ room "world",
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.
A steep narrow #{textlink("well", "well")} proceeds upward.
""" """
writers: objects:
well: "There is only one passage out. See the „Other rooms“ block popped up? Click it." well: obj "well",
dsc: "A steep narrow {{well}} proceeds upward."
act: "There is only one passage out. See the „Other rooms“ block popped up? Click it."
room "plaza", room "plaza",
title: (from) -> title: (from) ->
@ -32,22 +32,22 @@ room "plaza",
""" """
else else
"You quickly find the central plaza." "You quickly find the central plaza."
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")}"
return retval
writers: writers:
cyclewriter: (character) -> cycle(this, character) cyclewriter: (character) -> cycle(this, character)
mark: (character) -> objects:
if character.sandbox.has_mark? policeman: obj "policeman",
return "You already talked to him, no need to bug the man twice." dsc: "There is a policeman nearby. You could ask him {{for directions.}}"
character.sandbox.has_mark ?= true act: (character) ->
get_room("lair").destination() if character.sandbox.has_mark?
""" return "You already talked to him, no need to bug the man twice."
Here, let me mark it on your map. character.sandbox.has_mark ?= true
""" get_room("lair").destination()
people: 'Just some weirdos shouting "Viva la Cthulhu!". Typical.' """
Here, let me mark it on your map.
"""
people: obj "people",
dsc: "There are {{people shouting}} nearby."
act: 'Just some weirdos shouting "Viva la Cthulhu!". Typical.'
room "shop", room "shop",
title: "The Shop" title: "The Shop"