1
0
Fork 0
mirror of https://gitlab.com/Oreolek/salet.git synced 2024-07-02 23:05:04 +03:00
salet/game/phrase.coffee
Alexander Yakovlev b02f728d0c Made the game "codepen-ready".
Removed Browserify, made the game lighter.
The game now loads Salet as a JS library.

The preparations for that are done by Gulp.
2016-12-27 15:16:16 +07:00

27 lines
694 B
CoffeeScript

###
A phrase shortcut.
Usage:
phrase "Point out a thing in her purse (mildly)", "start", """
Point out a thing in her purse (mildly)
""", "character.sandbox.mild = true"
@param title phrase Phrase (question)
@param salet Salet core
@param string tag tag marking viewing condition
@param string text Response
@param string effect an optional parameter, eval'd code
###
phrase = (title, tag, text, effect) ->
retval = room("phrase_"+salet.rooms.length, {
optionText: title
dsc: text
clear: false # backlog is useful in dialogues
choices: "#"+tag
tags: [tag]
})
if effect?
retval.before = (character, system) ->
eval(effect)
return retval