1
0
Fork 0
mirror of https://gitlab.com/Oreolek/ludumdare37.git synced 2024-07-08 17:54:26 +03:00
ludumdare37/game/story.coffee
Alexander Yakovlev e572061fb2 Можно разговаривать с NPC! (ура)
А ещё я исправил баг с эффектами.
2016-12-10 22:31:49 +07:00

73 lines
1.8 KiB
CoffeeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## REAL ROOM
room "start",
clear: false
before: (from) ->
if (!from)
salet.character.beat = 0
state.setTag("weather", "warm")
state.setTag("mood", "calm")
return "intro".l()
dsc: () -> "dsc".l(Improv, state)
beforeChoices: () ->
if salet.character.lastBeat() > 3 and salet.character.heard_call == false
salet.character.heard_call = true
salet.character.beat = salet.progress.sequence.length
salet.view.write "<b>#{"story_call".l()}</b>"
writers:
window: () ->
# re-enter the room, reroll the description
salet.view.clearContent()
salet.here().entering("start")
return "<em>"+procgen("window")+"</em>"
## ACTUALLY DIALOGUES
dlg = (name) ->
return room(name, {
choices: "##{name}",
dsc: () ->
"#{name}_dsc".l(Improv, state)
})
dlg_bye = (name) ->
return room("#{name}_bye", {
clear: false
tags: [name]
optionText: "bye".l()
dsc: "#{name}_bye".l()
after: () ->
return salet.goTo("start")
})
dlg("alexey")
dlg("margo")
dlg("katie")
dlg("phone")
dialogue "alexey_mood".l(), "alexey", "alexey", "alexey_mood_answ".l()
dialogue "alexey_speed".l(), "alexey", "alexey", "alexey_speed_answ".l()
dlg_bye("alexey")
dlg_bye("margo")
dlg_bye("katie")
room "director",
tags: ["phone"],
choices: "#director"
optionText: "director_prompt".l()
dsc: "director_dsc".l()
# особый диалог прощания, потому что у него особый текст на возврате
dialogue "bye".l(), "director", "phone", "cyalater".l()
# Virtual room to go around limitations
room "vstart",
tags: ["phone"]
optionText: (from) ->
switch from
when "phone" then "end_phone".l()
else "end".l()
enter: () ->
salet.goTo("start")