narrat 2.0.10 → 2.0.13-test

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +15 -0
  2. package/dist/assets/lib.d7c0f4e9.css +1 -0
  3. package/dist/components/hud.vue.d.ts +3 -1
  4. package/dist/components/screen-layer.vue.d.ts +54 -0
  5. package/dist/components/screens.vue.d.ts +46 -0
  6. package/dist/config.d.ts +21 -7
  7. package/dist/img/backgrounds/rpg.png +0 -0
  8. package/dist/img/backgrounds/test-layers.gif +0 -0
  9. package/dist/img/enemies/goblin.png +0 -0
  10. package/dist/img/enemies/skeleton.png +0 -0
  11. package/dist/img/enemies/slime.png +0 -0
  12. package/dist/img/levels/cave.png +0 -0
  13. package/dist/img/levels/dungeon.png +0 -0
  14. package/dist/img/levels/dungeon_F.png +0 -0
  15. package/dist/img/levels/dungeon_FL.png +0 -0
  16. package/dist/img/levels/dungeon_FR.png +0 -0
  17. package/dist/img/levels/dungeon_FRL.png +0 -0
  18. package/dist/img/levels/dungeon_LR.png +0 -0
  19. package/dist/img/levels/grass.png +0 -0
  20. package/dist/img/players/wizard.png +0 -0
  21. package/dist/img/ui/front.png +0 -0
  22. package/dist/img/ui/left.png +0 -0
  23. package/dist/img/ui/right.png +0 -0
  24. package/dist/img/ui/start.png +0 -0
  25. package/dist/main.d.ts +4 -4
  26. package/dist/narrat.es.js +30747 -33067
  27. package/dist/narrat.es.js.map +1 -1
  28. package/dist/narrat.umd.js +87 -96
  29. package/dist/narrat.umd.js.map +1 -1
  30. package/dist/stores/main-store.d.ts +72 -8
  31. package/dist/stores/screens-store.d.ts +9 -9
  32. package/dist/stores/skills.d.ts +4 -0
  33. package/dist/types/app-types.d.ts +1 -0
  34. package/dist/types/parser.d.ts +1 -1
  35. package/dist/vm/commands/arithmetic-commands.d.ts +6 -0
  36. package/dist/vm/commands/command-helpers.d.ts +1 -0
  37. package/dist/vm/commands/flow-commands.d.ts +3 -0
  38. package/dist/vm/commands/math-commands.d.ts +14 -0
  39. package/dist/vm/commands/random-commands.d.ts +10 -0
  40. package/dist/vm/commands/screen-commands.d.ts +5 -1
  41. package/dist/vm/commands/skill-commands.d.ts +12 -0
  42. package/dist/vm/vm-helpers.d.ts +2 -0
  43. package/dist/vm/vm.d.ts +0 -1
  44. package/package.json +5 -2
  45. package/dist/audio/click.ogg +0 -0
  46. package/dist/audio/failure.ogg +0 -0
  47. package/dist/audio/game_start.ogg +0 -0
  48. package/dist/audio/success.wav +0 -0
  49. package/dist/audio.7z +0 -0
  50. package/dist/data/characters.json +0 -62
  51. package/dist/data/config.json +0 -182
  52. package/dist/data/example.rpy +0 -367
  53. package/dist/data/refactor.rpy +0 -31
  54. package/dist/fonts/OpenDyslexic.ttf.eot +0 -0
  55. package/dist/fonts/OpenDyslexic.ttf.svg +0 -2326
  56. package/dist/fonts/OpenDyslexic.ttf.woff +0 -0
  57. package/dist/gameloop.d.ts +0 -3
  58. package/dist/img/characters/music_cat.jpeg +0 -0
  59. package/dist/lib.css +0 -1
  60. package/dist/music/calm.mp3 +0 -0
@@ -1,367 +0,0 @@
1
- main:
2
- run lorem
3
- "Hello world (text test)"
4
- var meal (run takeout_menu Cake)
5
- var playerName (text_field "Enter your name")
6
- "Your name is %{playerName}"
7
- "The player chose to eat %{meal}"
8
- // play music calm
9
- jump quest_demo
10
-
11
- lorem:
12
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris interdum tempus erat non maximus. Donec pellentesque quis nisi et cursus. Vestibulum vel pellentesque ligula. Cras et iaculis metus, vitae sollicitudin augue. Aenean porttitor feugiat quam nec molestie. Quisque ultrices eleifend sagittis. Nullam sodales nec mauris nec vulputate."
13
- return "lorem"
14
-
15
- takeout_menu third_option:
16
- var meal ""
17
- choice:
18
- talk helper idle "Which meal do you want?"
19
- "Pizza":
20
- set meal pizza
21
- "Burger":
22
- set meal burger
23
- "%{third_option}":
24
- set meal $third_option
25
- talk helper idle "Chosen %{meal}"
26
- return $meal
27
-
28
- test_functions:
29
- talk player idle "Function test label"
30
- return (+ 1 2)
31
-
32
- test_scopes:
33
- var test1 1
34
- talk player idle "Declared test1: %{test1}"
35
- run test_scopes_2
36
- talk player idle "Back to original scope, shouldn't have access to test2: %{test2}"
37
-
38
- test_scopes_2:
39
- var test2 2
40
- talk player idle "Entered scope 2, still have access to test1: %{test1}"
41
- talk player idle "Declared test2 in scope 2: %{test2}"
42
-
43
- random_tests:
44
- var test 2
45
- talk helper idle "%{test}"
46
- add test 1
47
- talk helper idle "%{test}"
48
- talk helper idle "Hello world"
49
- start_quest breadShopping
50
- choice:
51
- "Can we spend some energy?"
52
- "Spend 5 energy" if (>= (get_stat_value energy) 5):
53
- add_stat energy -5
54
- talk player idle "Spent 5 energy!"
55
- "Don't spend":
56
- talk player idle "Didn't spend anything"
57
- set data.winThreshold 10
58
- set data.player.score 5
59
- set data.player.scoreBonus 5
60
- if (== (+ $data.player.score $data.player.scoreBonus) $data.winThreshold):
61
- "The player won!"
62
-
63
- if (roll testAudio agility 90):
64
- "yahoo"
65
- else:
66
- "oh no"
67
- if (quest_started? breadShopping):
68
- "The quest has started"
69
- else:
70
- "It's not working"
71
- if (|| (== (+ 1 2 3 4) 10) (== (+ 1 2 3) 5) (== (+ 1 2) 3 3 3 3)):
72
- "It's true"
73
- else:
74
- "It's false"
75
- set data.counter (+ 1 2)
76
- add_item book 1
77
- if (has_item? book 1):
78
- "There's a book in the inventory"
79
- if (== (item_amount? book) 1):
80
- "We have 1 book"
81
- talk helper idle "Hello world"
82
- set data.counter 1
83
- jump quest_demo
84
- notify "Hello world!"
85
- start_quest breadShopping
86
- add_item bread 15
87
- remove_item bread 10
88
- if (> $items.bread.amount 0):
89
- talk helper idle "You have %{items.bread.amount} bread"
90
- else:
91
- talk helper idle "You have no bread"
92
- clear_dialog
93
- complete_objective breadShopping bread
94
- choice:
95
- "Let's do a skill check"
96
- roll aSkillCheck agility 70 "Test skill roll" hideAfterRoll:
97
- success:
98
- talk player idle "Woo I did it"
99
- failure "Text if the skill check failed":
100
- talk player idle "Oh no I failed"
101
- "Another choice":
102
- "Hello too"
103
- complete_quest breadShopping "You helped the cat get bread"
104
- if (roll someSkillCheck agility 40):
105
- set data.skillcheckDone true
106
- "You open the narrat demo and wonder how this thing even works"
107
- choice:
108
- "How about asking for help?"
109
- "Ask for help":
110
- jump askForHelp
111
- "No, I don't want help 😡"
112
- jump dontAskForHelp
113
-
114
- functions_test:
115
- run some_function
116
- talk player idle "Back to functions_test"
117
- run some_function
118
-
119
- some_function:
120
- talk player idle "Ran the function %{data.counter} times"
121
- add data.counter 1
122
-
123
- skillCheckTest:
124
- choice:
125
- "Let's do a skill check"
126
- roll aSkillCheck agility 70 "Test skill roll":
127
- success:
128
- talk player idle "Woo I did it"
129
- failure "Text if the skill check failed":
130
- talk player idle "Oh no I failed"
131
- "Another choice":
132
- "Hello too"
133
- if (roll someSkillCheck agility 40):
134
- set data.skillcheckDone true
135
- jump skillCheckTest
136
- stats:
137
- talk player idle "Trying energy feature"
138
- choice:
139
- "Can we spend some energy?"
140
- "Spend 5 energy" if (>= $stats.energy 5):
141
- add_stat energy -5
142
- talk player idle "Spent 5 energy!"
143
- "Don't spend":
144
- talk player idle "Didn't spend anything"
145
- jump stats
146
-
147
- xpTest:
148
- talk helper idle "Gaining 3 logic xp"
149
- add_xp haggling 3
150
- jump xpTest
151
-
152
- askForHelp:
153
- talk helper idle "Hello! I heard you're trying to play the narrat demo!"
154
- talk helper idle "You can view the source script for this demo in the <a href=\"https:\/\/github.com\/nialna\/narrat-demo\" target=\"_blank\">demo repo</a>"
155
- talk helper idle "There is also a <a href=\"https:\/\/github.com\/nialna\/narrat-template\" target=\"_blank\">game template</a> ready to use."
156
- talk helper idle "As you've probably noticed, you can make choices in this."
157
- talk helper idle "There are lots of things you can do to make an interactive story in Narrat really. Choices are one of the most useful ones."
158
- talk helper idle "I'm going to send you to my other friend who has some questions for you."
159
- jump askAboutChoices
160
-
161
- askAboutChoices:
162
- choice:
163
- talk cat idle "Hi it's me, another generic cat! Do you like making choices in games?"
164
- "Yes":
165
- set data.choices true
166
- "Cat will remember this."
167
- "No":
168
- add_level agility 2
169
- "Cat will remember this."
170
- choice:
171
- talk helper idle "Now I think we should do an activity, what do you like doing?"
172
- "let's make choices cause I like making choices!" if $data.likeChoices:
173
- jump makeChoices
174
- "let's do nothing!":
175
- jump doNothing
176
-
177
-
178
- dontAskForHelp:
179
- // clear_dialog
180
- talk inner idle "Maybe we should get help though? I don't really know what else to do"
181
- jump main
182
-
183
- makeChoices:
184
- choice:
185
- talk inner idle "I don't know, we've been making a lot of choices already lately."
186
- "I still want to make a choice!":
187
- talk helper idle "Well you just made one, it turns out. Can we continue now?"
188
- jump doNothing
189
- "I guess you're right":
190
- jump doNothing
191
-
192
-
193
- doNothing:
194
- choice:
195
- talk music_cat idle "How about we get some music in here?"
196
- "Play some relaxing music":
197
- "The music is going to start and stop with timers to show the feature"
198
- play music calm
199
- wait 2000
200
- pause music
201
- wait 500
202
- play music calm
203
- wait 500
204
- stop music
205
- wait 500
206
- play music calm
207
- "I hate music":
208
- talk music_cat idle "Well too bad, it's up to you."
209
- jump otherFeatures
210
-
211
- otherFeatures:
212
- talk helper idle "There are lots of other features, like skill checks and conditions."
213
- if (roll someSkillCheck agility 40):
214
- "For example this line only appears if you passed a skill check"
215
- "This engine is still very early and not fully documented yet, but you can look at the example demo and how it is made."
216
- "There is also a screen feature on the left where you can display background images with interactive buttons."
217
- jump showMap
218
-
219
- showMap:
220
- set_screen map
221
- set_button parkButton true
222
- talk helper idle "This is an example map. There are buttons you can click on. It is possible to dynanically enable and disable buttons in your script"
223
- talk helper idle "You can view the source script for this demo in the <a href=\"https:\/\/github.com\/nialna\/narrat-demo\">demo repo</a>"
224
-
225
- quest_demo:
226
- set_button shopButton true
227
- set_button parkButton false
228
- jump bread_quest
229
-
230
- bread_quest:
231
- choice:
232
- talk helper idle "Can you get 2 pieces of bread for me?"
233
- "Yes":
234
- talk helper idle "Thanks, that's very nice!"
235
- talk helper idle "I'll be waiting for you at the park"
236
- jump bread_start
237
- "No":
238
- talk helper idle "Oh, okay"
239
- jump quest_demo
240
-
241
- bread_start:
242
- start_quest breadShopping
243
- talk inner idle "Time to go to the shop to buy some bread then."
244
- set_screen map
245
- set_button shopButton true
246
-
247
- shopButton:
248
- set_screen default
249
- "You visit the bread shop"
250
- talk shopkeeper idle "Hello, I'm a little baker selling bread!"
251
- set data.breadPrice 5
252
- jump shop_menu
253
-
254
- parkButton:
255
- choice:
256
- talk helper idle "Ah, so do you have my bread?"
257
- "Yes!" if (>= $items.bread.amount 2):
258
- talk helper idle "Thanks a lot!"
259
- add_item bread -2
260
- complete_objective breadShopping delivery
261
- complete_quest breadShopping
262
- "No :(":
263
- talk helper idle "Oh okay"
264
- set_button parkButton false
265
-
266
- shop_menu:
267
- choice:
268
- talk shopkeeper idle "So, do you want some bread?"
269
- "Buy bread (costs %{data.breadPrice})" if (>= $stats.money.value $data.breadPrice):
270
- add_item bread 1
271
- if (== $data.breadPrice 5):
272
- add_stat money -5
273
- else:
274
- add_stat money -4
275
- jump map_update
276
- roll bread_haggle haggling 50 "Try to haggle for bread" hideAfterRoll:
277
- success "You explain that helper cat needs bread to feed his poor family":
278
- set data.breadPrice 4
279
- talk shopkeeper idle "I guess I can sell you bread for 4 coins"
280
- jump shop_menu
281
- failure "You try to pity trip the shopkeeper but he won't bulge":
282
- talk shopkeeper idle "The price is 5 coins, nothing less, nothing more."
283
- jump shop_menu
284
- "Exit":
285
- jump map_update
286
-
287
- map_update:
288
- if (>= $items.bread.amount 2):
289
- complete_objective breadShopping bread
290
- talk inner idle "I've got enough bread now, I'm going to go to the park."
291
- start_objective breadShopping delivery
292
- set_screen map
293
- set_button parkButton true
294
- set_button shopButton false
295
- else:
296
- talk inner idle "Hmm, I still need to buy more bread for helper cat."
297
- set_screen map
298
-
299
- eat_bread:
300
- talk player idle "hmm, bread"
301
-
302
- read_book:
303
- talk inner idle "It's full of ocult rituals. I'm not sure what they are, but I'm sure they are useful."
304
-
305
- label_to_jump:
306
- talk cat idle "The code has now jumped to this label"
307
-
308
- jump_example:
309
- talk cat idle "Hello, this is an example about jumping to other labels"
310
- talk cat idle "Use the jump command to jump to a different label in any of your scripts"
311
- jump label_to_jump
312
-
313
- choice_example:
314
- talk cat idle "This example shows how to use the choice command"
315
- choice:
316
- "This is the choice prompt text"
317
- "This is the first option the player can select":
318
- talk cat idle "I will say this if you select the first option"
319
- "This is the second choice the player can pick":
320
- talk cat idle "I see you picked the second choice!"
321
-
322
- choice_example_conditions:
323
- talk cat idle "This example shows how to use conditions in choices"
324
- choice:
325
- "This is the choice prompt text"
326
- "This choice will only appear if a condition is met" if $data.someFlag:
327
- talk cat idle "Choice response"
328
- roll someSkillCheck agility 50 "This choice will run a skill check":
329
- success "Skill check succeeded":
330
- "This line will appear if the skill check succeeds"
331
- failure "Skill check failed":
332
- "This line will appear if the skill check fails"
333
-
334
-
335
- set_example:
336
- choice:
337
- talk cat idle "Do you like surprises?"
338
- "Yes":
339
- set data.like_surprises true
340
- "No!":
341
- set data.like_surprises false
342
- if $data.like_surprises:
343
- talk cat idle "Since you like surprises, here's a surprise message"
344
-
345
-
346
- add_example:
347
- set data.counter 0
348
- jump add_example_add
349
-
350
- add_example_add:
351
- choice:
352
- talk cat idle "Do you want to increase the counter? You can only do it 10 times":
353
- "Increase the counter" if (< $data.counter 10):
354
- add data.counter 1
355
- "No!":
356
- talk cat idle "Ok then"
357
- "I'm done" if (>= $data.counter 10):
358
- jump add_example_end
359
- jump add_example_add
360
-
361
- add_example_end:
362
- talk cat idle "It seems you're done with the counter now"
363
-
364
- talk_example:
365
- talk cat idle "I'm talking to you!"
366
- "This is a shortcut for the narrator talking"
367
- talk player idle "The player can also talk"
@@ -1,31 +0,0 @@
1
- main:
2
- "hello world"
3
- set data.player.name "Alice"
4
- set data.player.rank "Beginner"
5
- run update_rank_text
6
- choice:
7
- "Yes or no?"
8
- "Yes" (== 1 2):
9
- talk player idle "You said yes"
10
- "no":
11
- talk player idle "You said no"
12
- roll bread_haggle haggling 70 "Try to haggle for bread":
13
- success:
14
- talk player idle "You haggled for bread"
15
- failure:
16
- talk player idle "You failed to haggle for bread"
17
- talk cat idle $data.player.rankText
18
- if (== (+ 1 3) 3)
19
- talk player idle "condition is true"
20
- else:
21
- talk player idle "condition is false"
22
- jump jump_test
23
-
24
- update_rank_text:
25
- set data.player.rankText "%{data.player.name} is a %{data.player.rank}."
26
-
27
- run_test:
28
- talk player idle "it's a function"
29
-
30
- jump_test:
31
- talk player idle "you jumped"
Binary file