File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 341341
342342function Constructor :addConstant (constant , value )
343343 local value = lume .deserialize (value )
344- self .book .constants [constant ] = lume . deserialize ( value )
344+ self .book .constants [constant ] = value
345345end
346346
347347function Constructor :addKnot (knot )
Original file line number Diff line number Diff line change 4646--- Start a story.
4747-- Generate the first chunk of paragraphs and choices.
4848function Story :begin ()
49- if # self .paragraphs == 0 and # self .choices == 0 and not self . isOver then
50- self : readPath ({ })
49+ if # self .paragraphs > 0 or # self .choices > 0 then
50+ return
5151 end
52+
53+ self :jumpTo (' _' )
5254end
5355
5456--- Does the story have paragraphs to output or not.
151153function Story :jumpTo (pathString )
152154 assert (pathString , ' The pathString can\' t be nil' )
153155
156+ self .choices = { }
157+
154158 if pathString == ' END' or pathString == ' DONE' then
155159 self .isOver = true
156160 return
Original file line number Diff line number Diff line change 1+ CONST STRING_EXAMPLE = " This is the string constant "
2+ CONST BOOLEAN_EXAMLPE_TRUE = true
3+ CONST BOOLEAN_EXAMLPE_FALSE = false
4+
15CONST LOBBY = 1
26CONST STAIRCASE = 2
37CONST HALLWAY = 3
4-
58CONST HELD_BY_AGENT = - 1
69
710VAR secret_agent_location = LOBBY
811VAR suitcase_location = HALLWAY
912
13+ { STRING_EXAMPLE } . One is { BOOLEAN_EXAMLPE_TRUE } . Zero is { BOOLEAN_EXAMLPE_FALSE } .
14+
1015-> report_progress
1116
1217=== report_progress ===
Original file line number Diff line number Diff line change 1+ This is the string constant. One is 1. Zero is 0.
12The secret agent moves forward.
23The secret agent moves forward.
34The secret agent grabs the suitcase!
You can’t perform that action at this time.
0 commit comments