@magicborn/dialogue-forge 0.1.0

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 (241) hide show
  1. package/README.md +233 -0
  2. package/bin/dialogue-forge.js +78 -0
  3. package/demo/app/layout.tsx +36 -0
  4. package/demo/app/page.tsx +440 -0
  5. package/demo/components/ThemeSwitcher.tsx +611 -0
  6. package/demo/next.config.mjs +7 -0
  7. package/demo/package.json +29 -0
  8. package/demo/postcss.config.mjs +7 -0
  9. package/demo/public/logo.svg +1 -0
  10. package/demo/styles/globals.css +19 -0
  11. package/demo/tailwind.config.ts +90 -0
  12. package/demo/tsconfig.json +42 -0
  13. package/dist/components/ChoiceEdgeV2.d.ts +3 -0
  14. package/dist/components/ChoiceEdgeV2.js +103 -0
  15. package/dist/components/CodeBlock.d.ts +8 -0
  16. package/dist/components/CodeBlock.js +24 -0
  17. package/dist/components/ConditionAutocomplete.d.ts +14 -0
  18. package/dist/components/ConditionAutocomplete.js +284 -0
  19. package/dist/components/ConditionalNodeV2.d.ts +16 -0
  20. package/dist/components/ConditionalNodeV2.js +147 -0
  21. package/dist/components/DialogueEditorV2.d.ts +22 -0
  22. package/dist/components/DialogueEditorV2.js +1170 -0
  23. package/dist/components/EdgeIcon.d.ts +8 -0
  24. package/dist/components/EdgeIcon.js +13 -0
  25. package/dist/components/ExampleLoader.d.ts +11 -0
  26. package/dist/components/ExampleLoader.js +52 -0
  27. package/dist/components/ExampleLoaderButton.d.ts +15 -0
  28. package/dist/components/ExampleLoaderButton.js +102 -0
  29. package/dist/components/FlagManager.d.ts +11 -0
  30. package/dist/components/FlagManager.js +282 -0
  31. package/dist/components/FlagSelector.d.ts +11 -0
  32. package/dist/components/FlagSelector.js +235 -0
  33. package/dist/components/GuidePanel.d.ts +7 -0
  34. package/dist/components/GuidePanel.js +1176 -0
  35. package/dist/components/Minimap.d.ts +16 -0
  36. package/dist/components/Minimap.js +93 -0
  37. package/dist/components/NPCEdgeV2.d.ts +3 -0
  38. package/dist/components/NPCEdgeV2.js +104 -0
  39. package/dist/components/NPCNodeV2.d.ts +26 -0
  40. package/dist/components/NPCNodeV2.js +86 -0
  41. package/dist/components/NodeEditor.d.ts +18 -0
  42. package/dist/components/NodeEditor.js +1025 -0
  43. package/dist/components/PlayView.d.ts +12 -0
  44. package/dist/components/PlayView.js +307 -0
  45. package/dist/components/PlayerNodeV2.d.ts +16 -0
  46. package/dist/components/PlayerNodeV2.js +139 -0
  47. package/dist/components/ReactFlowPOC.d.ts +61 -0
  48. package/dist/components/ReactFlowPOC.js +312 -0
  49. package/dist/components/ScenePlayer.d.ts +18 -0
  50. package/dist/components/ScenePlayer.js +196 -0
  51. package/dist/components/YarnView.d.ts +9 -0
  52. package/dist/components/YarnView.js +45 -0
  53. package/dist/components/ZoomControls.d.ts +11 -0
  54. package/dist/components/ZoomControls.js +34 -0
  55. package/dist/esm/components/ChoiceEdgeV2.d.ts +3 -0
  56. package/dist/esm/components/ChoiceEdgeV2.js +67 -0
  57. package/dist/esm/components/CodeBlock.d.ts +8 -0
  58. package/dist/esm/components/CodeBlock.js +18 -0
  59. package/dist/esm/components/ConditionAutocomplete.d.ts +14 -0
  60. package/dist/esm/components/ConditionAutocomplete.js +248 -0
  61. package/dist/esm/components/ConditionalNodeV2.d.ts +16 -0
  62. package/dist/esm/components/ConditionalNodeV2.js +111 -0
  63. package/dist/esm/components/DialogueEditorV2.d.ts +22 -0
  64. package/dist/esm/components/DialogueEditorV2.js +1134 -0
  65. package/dist/esm/components/EdgeIcon.d.ts +8 -0
  66. package/dist/esm/components/EdgeIcon.js +7 -0
  67. package/dist/esm/components/ExampleLoader.d.ts +11 -0
  68. package/dist/esm/components/ExampleLoader.js +46 -0
  69. package/dist/esm/components/ExampleLoaderButton.d.ts +15 -0
  70. package/dist/esm/components/ExampleLoaderButton.js +66 -0
  71. package/dist/esm/components/FlagManager.d.ts +11 -0
  72. package/dist/esm/components/FlagManager.js +246 -0
  73. package/dist/esm/components/FlagSelector.d.ts +11 -0
  74. package/dist/esm/components/FlagSelector.js +199 -0
  75. package/dist/esm/components/GuidePanel.d.ts +7 -0
  76. package/dist/esm/components/GuidePanel.js +1140 -0
  77. package/dist/esm/components/Minimap.d.ts +16 -0
  78. package/dist/esm/components/Minimap.js +57 -0
  79. package/dist/esm/components/NPCEdgeV2.d.ts +3 -0
  80. package/dist/esm/components/NPCEdgeV2.js +68 -0
  81. package/dist/esm/components/NPCNodeV2.d.ts +26 -0
  82. package/dist/esm/components/NPCNodeV2.js +80 -0
  83. package/dist/esm/components/NodeEditor.d.ts +18 -0
  84. package/dist/esm/components/NodeEditor.js +989 -0
  85. package/dist/esm/components/PlayView.d.ts +12 -0
  86. package/dist/esm/components/PlayView.js +271 -0
  87. package/dist/esm/components/PlayerNodeV2.d.ts +16 -0
  88. package/dist/esm/components/PlayerNodeV2.js +103 -0
  89. package/dist/esm/components/ReactFlowPOC.d.ts +61 -0
  90. package/dist/esm/components/ReactFlowPOC.js +275 -0
  91. package/dist/esm/components/ScenePlayer.d.ts +18 -0
  92. package/dist/esm/components/ScenePlayer.js +160 -0
  93. package/dist/esm/components/YarnView.d.ts +9 -0
  94. package/dist/esm/components/YarnView.js +39 -0
  95. package/dist/esm/components/ZoomControls.d.ts +11 -0
  96. package/dist/esm/components/ZoomControls.js +28 -0
  97. package/dist/esm/examples/example-loader.d.ts +29 -0
  98. package/dist/esm/examples/example-loader.js +103 -0
  99. package/dist/esm/examples/examples-registry.d.ts +38 -0
  100. package/dist/esm/examples/examples-registry.js +153 -0
  101. package/dist/esm/examples/index.d.ts +26 -0
  102. package/dist/esm/examples/index.js +50 -0
  103. package/dist/esm/examples/legacy-examples.d.ts +9 -0
  104. package/dist/esm/examples/legacy-examples.js +814 -0
  105. package/dist/esm/examples/yarn-examples.d.ts +35 -0
  106. package/dist/esm/examples/yarn-examples.js +181 -0
  107. package/dist/esm/index.d.ts +21 -0
  108. package/dist/esm/index.js +26 -0
  109. package/dist/esm/lib/flag-manager.d.ts +21 -0
  110. package/dist/esm/lib/flag-manager.js +93 -0
  111. package/dist/esm/lib/yarn-converter/__tests__/round-trip.test.d.ts +1 -0
  112. package/dist/esm/lib/yarn-converter/__tests__/round-trip.test.js +169 -0
  113. package/dist/esm/lib/yarn-converter.d.ts +17 -0
  114. package/dist/esm/lib/yarn-converter.js +521 -0
  115. package/dist/esm/lib/yarn-runner/__tests__/condition-evaluator.test.d.ts +1 -0
  116. package/dist/esm/lib/yarn-runner/__tests__/condition-evaluator.test.js +171 -0
  117. package/dist/esm/lib/yarn-runner/__tests__/node-processor.test.d.ts +1 -0
  118. package/dist/esm/lib/yarn-runner/__tests__/node-processor.test.js +237 -0
  119. package/dist/esm/lib/yarn-runner/__tests__/variable-manager.test.d.ts +1 -0
  120. package/dist/esm/lib/yarn-runner/__tests__/variable-manager.test.js +106 -0
  121. package/dist/esm/lib/yarn-runner/condition-evaluator.d.ts +12 -0
  122. package/dist/esm/lib/yarn-runner/condition-evaluator.js +56 -0
  123. package/dist/esm/lib/yarn-runner/index.d.ts +12 -0
  124. package/dist/esm/lib/yarn-runner/index.js +11 -0
  125. package/dist/esm/lib/yarn-runner/node-processor.d.ts +18 -0
  126. package/dist/esm/lib/yarn-runner/node-processor.js +129 -0
  127. package/dist/esm/lib/yarn-runner/variable-manager.d.ts +51 -0
  128. package/dist/esm/lib/yarn-runner/variable-manager.js +120 -0
  129. package/dist/esm/lib/yarn-runner/variable-operations.d.ts +16 -0
  130. package/dist/esm/lib/yarn-runner/variable-operations.js +88 -0
  131. package/dist/esm/types/conditionals.d.ts +29 -0
  132. package/dist/esm/types/conditionals.js +1 -0
  133. package/dist/esm/types/constants.d.ts +59 -0
  134. package/dist/esm/types/constants.js +55 -0
  135. package/dist/esm/types/flags.d.ts +49 -0
  136. package/dist/esm/types/flags.js +49 -0
  137. package/dist/esm/types/game-state.d.ts +62 -0
  138. package/dist/esm/types/game-state.js +6 -0
  139. package/dist/esm/types/index.d.ts +77 -0
  140. package/dist/esm/types/index.js +1 -0
  141. package/dist/esm/utils/constants.d.ts +5 -0
  142. package/dist/esm/utils/constants.js +5 -0
  143. package/dist/esm/utils/feature-flags.d.ts +11 -0
  144. package/dist/esm/utils/feature-flags.js +11 -0
  145. package/dist/esm/utils/game-state-flattener.d.ts +41 -0
  146. package/dist/esm/utils/game-state-flattener.js +135 -0
  147. package/dist/esm/utils/layout/collision.d.ts +27 -0
  148. package/dist/esm/utils/layout/collision.js +74 -0
  149. package/dist/esm/utils/layout/index.d.ts +82 -0
  150. package/dist/esm/utils/layout/index.js +98 -0
  151. package/dist/esm/utils/layout/registry.d.ts +91 -0
  152. package/dist/esm/utils/layout/registry.js +148 -0
  153. package/dist/esm/utils/layout/strategies/dagre.d.ts +19 -0
  154. package/dist/esm/utils/layout/strategies/dagre.js +182 -0
  155. package/dist/esm/utils/layout/strategies/force.d.ts +21 -0
  156. package/dist/esm/utils/layout/strategies/force.js +178 -0
  157. package/dist/esm/utils/layout/strategies/grid.d.ts +17 -0
  158. package/dist/esm/utils/layout/strategies/grid.js +91 -0
  159. package/dist/esm/utils/layout/strategies/index.d.ts +8 -0
  160. package/dist/esm/utils/layout/strategies/index.js +8 -0
  161. package/dist/esm/utils/layout/types.d.ts +100 -0
  162. package/dist/esm/utils/layout/types.js +7 -0
  163. package/dist/esm/utils/layout.d.ts +9 -0
  164. package/dist/esm/utils/layout.js +17 -0
  165. package/dist/esm/utils/node-helpers.d.ts +7 -0
  166. package/dist/esm/utils/node-helpers.js +94 -0
  167. package/dist/esm/utils/reactflow-converter.d.ts +42 -0
  168. package/dist/esm/utils/reactflow-converter.js +217 -0
  169. package/dist/examples/example-loader.d.ts +29 -0
  170. package/dist/examples/example-loader.js +109 -0
  171. package/dist/examples/examples-registry.d.ts +38 -0
  172. package/dist/examples/examples-registry.js +160 -0
  173. package/dist/examples/index.d.ts +26 -0
  174. package/dist/examples/index.js +63 -0
  175. package/dist/examples/legacy-examples.d.ts +9 -0
  176. package/dist/examples/legacy-examples.js +817 -0
  177. package/dist/examples/yarn-examples.d.ts +35 -0
  178. package/dist/examples/yarn-examples.js +189 -0
  179. package/dist/index.d.ts +21 -0
  180. package/dist/index.js +66 -0
  181. package/dist/lib/flag-manager.d.ts +21 -0
  182. package/dist/lib/flag-manager.js +99 -0
  183. package/dist/lib/yarn-converter/__tests__/round-trip.test.d.ts +1 -0
  184. package/dist/lib/yarn-converter/__tests__/round-trip.test.js +171 -0
  185. package/dist/lib/yarn-converter.d.ts +17 -0
  186. package/dist/lib/yarn-converter.js +525 -0
  187. package/dist/lib/yarn-runner/__tests__/condition-evaluator.test.d.ts +1 -0
  188. package/dist/lib/yarn-runner/__tests__/condition-evaluator.test.js +173 -0
  189. package/dist/lib/yarn-runner/__tests__/node-processor.test.d.ts +1 -0
  190. package/dist/lib/yarn-runner/__tests__/node-processor.test.js +239 -0
  191. package/dist/lib/yarn-runner/__tests__/variable-manager.test.d.ts +1 -0
  192. package/dist/lib/yarn-runner/__tests__/variable-manager.test.js +108 -0
  193. package/dist/lib/yarn-runner/condition-evaluator.d.ts +12 -0
  194. package/dist/lib/yarn-runner/condition-evaluator.js +60 -0
  195. package/dist/lib/yarn-runner/index.d.ts +12 -0
  196. package/dist/lib/yarn-runner/index.js +21 -0
  197. package/dist/lib/yarn-runner/node-processor.d.ts +18 -0
  198. package/dist/lib/yarn-runner/node-processor.js +133 -0
  199. package/dist/lib/yarn-runner/variable-manager.d.ts +51 -0
  200. package/dist/lib/yarn-runner/variable-manager.js +124 -0
  201. package/dist/lib/yarn-runner/variable-operations.d.ts +16 -0
  202. package/dist/lib/yarn-runner/variable-operations.js +92 -0
  203. package/dist/types/conditionals.d.ts +29 -0
  204. package/dist/types/conditionals.js +2 -0
  205. package/dist/types/constants.d.ts +59 -0
  206. package/dist/types/constants.js +58 -0
  207. package/dist/types/flags.d.ts +49 -0
  208. package/dist/types/flags.js +52 -0
  209. package/dist/types/game-state.d.ts +62 -0
  210. package/dist/types/game-state.js +7 -0
  211. package/dist/types/index.d.ts +77 -0
  212. package/dist/types/index.js +2 -0
  213. package/dist/utils/constants.d.ts +5 -0
  214. package/dist/utils/constants.js +8 -0
  215. package/dist/utils/feature-flags.d.ts +11 -0
  216. package/dist/utils/feature-flags.js +14 -0
  217. package/dist/utils/game-state-flattener.d.ts +41 -0
  218. package/dist/utils/game-state-flattener.js +140 -0
  219. package/dist/utils/layout/collision.d.ts +27 -0
  220. package/dist/utils/layout/collision.js +77 -0
  221. package/dist/utils/layout/index.d.ts +82 -0
  222. package/dist/utils/layout/index.js +109 -0
  223. package/dist/utils/layout/registry.d.ts +91 -0
  224. package/dist/utils/layout/registry.js +151 -0
  225. package/dist/utils/layout/strategies/dagre.d.ts +19 -0
  226. package/dist/utils/layout/strategies/dagre.js +189 -0
  227. package/dist/utils/layout/strategies/force.d.ts +21 -0
  228. package/dist/utils/layout/strategies/force.js +182 -0
  229. package/dist/utils/layout/strategies/grid.d.ts +17 -0
  230. package/dist/utils/layout/strategies/grid.js +95 -0
  231. package/dist/utils/layout/strategies/index.d.ts +8 -0
  232. package/dist/utils/layout/strategies/index.js +14 -0
  233. package/dist/utils/layout/types.d.ts +100 -0
  234. package/dist/utils/layout/types.js +8 -0
  235. package/dist/utils/layout.d.ts +9 -0
  236. package/dist/utils/layout.js +25 -0
  237. package/dist/utils/node-helpers.d.ts +7 -0
  238. package/dist/utils/node-helpers.js +101 -0
  239. package/dist/utils/reactflow-converter.d.ts +42 -0
  240. package/dist/utils/reactflow-converter.js +223 -0
  241. package/package.json +70 -0
@@ -0,0 +1,817 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.exampleDialogues = exports.demoFlagSchemas = void 0;
4
+ const constants_1 = require("../types/constants");
5
+ /**
6
+ * Legacy TypeScript examples
7
+ * These are kept for backward compatibility while we migrate to Yarn format
8
+ * TODO: Convert these to Yarn format and remove this file
9
+ */
10
+ exports.demoFlagSchemas = {
11
+ basic: {
12
+ categories: ['quests', 'items', 'stats'],
13
+ flags: [
14
+ { id: 'quest_intro', name: 'Introduction Quest', type: constants_1.FLAG_TYPE.QUEST, category: 'quests', valueType: constants_1.FLAG_VALUE_TYPE.STRING },
15
+ { id: 'item_key', name: 'Key', type: constants_1.FLAG_TYPE.ITEM, category: 'items' },
16
+ { id: 'stat_reputation', name: 'Reputation', type: constants_1.FLAG_TYPE.STAT, category: 'stats', valueType: constants_1.FLAG_VALUE_TYPE.NUMBER, defaultValue: 0 },
17
+ ]
18
+ },
19
+ rpg: {
20
+ categories: ['quests', 'achievements', 'items', 'stats', 'titles'],
21
+ flags: [
22
+ { id: 'quest_dragon_slayer', name: 'Dragon Slayer Quest', type: constants_1.FLAG_TYPE.QUEST, category: 'quests', valueType: constants_1.FLAG_VALUE_TYPE.STRING },
23
+ { id: 'quest_dragon_slayer_complete', name: 'Dragon Slayer Complete', type: constants_1.FLAG_TYPE.QUEST, category: 'quests' },
24
+ { id: 'quest_find_key', name: 'Find the Key', type: constants_1.FLAG_TYPE.QUEST, category: 'quests', valueType: constants_1.FLAG_VALUE_TYPE.STRING },
25
+ { id: 'achievement_first_quest', name: 'First Quest', type: constants_1.FLAG_TYPE.ACHIEVEMENT, category: 'achievements' },
26
+ { id: 'achievement_dragon_slayer', name: 'Dragon Slayer', type: constants_1.FLAG_TYPE.ACHIEVEMENT, category: 'achievements' },
27
+ { id: 'achievement_hero', name: 'Hero', type: constants_1.FLAG_TYPE.ACHIEVEMENT, category: 'achievements' },
28
+ { id: 'item_ancient_key', name: 'Ancient Key', type: constants_1.FLAG_TYPE.ITEM, category: 'items' },
29
+ { id: 'item_map', name: 'Treasure Map', type: constants_1.FLAG_TYPE.ITEM, category: 'items' },
30
+ { id: 'item_sword', name: 'Legendary Sword', type: constants_1.FLAG_TYPE.ITEM, category: 'items' },
31
+ { id: 'stat_gold', name: 'Gold', type: constants_1.FLAG_TYPE.STAT, category: 'stats', valueType: constants_1.FLAG_VALUE_TYPE.NUMBER, defaultValue: 0 },
32
+ { id: 'stat_reputation', name: 'Reputation', type: constants_1.FLAG_TYPE.STAT, category: 'stats', valueType: constants_1.FLAG_VALUE_TYPE.NUMBER, defaultValue: 0 },
33
+ { id: 'stat_charisma', name: 'Charisma', type: constants_1.FLAG_TYPE.STAT, category: 'stats', valueType: constants_1.FLAG_VALUE_TYPE.NUMBER, defaultValue: 10 },
34
+ { id: 'title_hero', name: 'Hero', type: constants_1.FLAG_TYPE.TITLE, category: 'titles' },
35
+ { id: 'title_merchant', name: 'Merchant', type: constants_1.FLAG_TYPE.TITLE, category: 'titles' },
36
+ { id: 'dialogue_met_stranger', name: 'Met Stranger', type: constants_1.FLAG_TYPE.DIALOGUE, category: 'dialogue' },
37
+ { id: 'dialogue_hostile', name: 'Hostile Response', type: constants_1.FLAG_TYPE.DIALOGUE, category: 'dialogue' },
38
+ ]
39
+ },
40
+ conditional: {
41
+ categories: ['quests', 'items', 'stats'],
42
+ flags: [
43
+ { id: 'quest_main', name: 'Main Quest', type: constants_1.FLAG_TYPE.QUEST, category: 'quests', valueType: constants_1.FLAG_VALUE_TYPE.STRING },
44
+ { id: 'item_key', name: 'Key', type: constants_1.FLAG_TYPE.ITEM, category: 'items' },
45
+ { id: 'stat_gold', name: 'Gold', type: constants_1.FLAG_TYPE.STAT, category: 'stats', valueType: constants_1.FLAG_VALUE_TYPE.NUMBER, defaultValue: 0 },
46
+ { id: 'stat_reputation', name: 'Reputation', type: constants_1.FLAG_TYPE.STAT, category: 'stats', valueType: constants_1.FLAG_VALUE_TYPE.NUMBER, defaultValue: 0 },
47
+ ]
48
+ },
49
+ complex_conditional: {
50
+ categories: ['quests', 'achievements', 'items', 'stats', 'titles', 'global', 'dialogue'],
51
+ flags: [
52
+ { id: 'quest_ancient_ruins', name: 'Ancient Ruins Quest', type: constants_1.FLAG_TYPE.QUEST, category: 'quests', valueType: constants_1.FLAG_VALUE_TYPE.STRING },
53
+ { id: 'quest_ancient_ruins_complete', name: 'Ancient Ruins Complete', type: constants_1.FLAG_TYPE.QUEST, category: 'quests' },
54
+ { id: 'quest_treasure_hunt', name: 'Treasure Hunt', type: constants_1.FLAG_TYPE.QUEST, category: 'quests', valueType: constants_1.FLAG_VALUE_TYPE.STRING },
55
+ { id: 'quest_treasure_hunt_complete', name: 'Treasure Hunt Complete', type: constants_1.FLAG_TYPE.QUEST, category: 'quests' },
56
+ { id: 'quest_dragon_slayer', name: 'Dragon Slayer Quest', type: constants_1.FLAG_TYPE.QUEST, category: 'quests', valueType: constants_1.FLAG_VALUE_TYPE.STRING },
57
+ { id: 'achievement_explorer', name: 'Explorer', type: constants_1.FLAG_TYPE.ACHIEVEMENT, category: 'achievements' },
58
+ { id: 'achievement_rich', name: 'Rich', type: constants_1.FLAG_TYPE.ACHIEVEMENT, category: 'achievements' },
59
+ { id: 'achievement_hero', name: 'Hero', type: constants_1.FLAG_TYPE.ACHIEVEMENT, category: 'achievements' },
60
+ { id: 'achievement_diplomat', name: 'Diplomat', type: constants_1.FLAG_TYPE.ACHIEVEMENT, category: 'achievements' },
61
+ { id: 'item_ancient_key', name: 'Ancient Key', type: constants_1.FLAG_TYPE.ITEM, category: 'items' },
62
+ { id: 'item_treasure_map', name: 'Treasure Map', type: constants_1.FLAG_TYPE.ITEM, category: 'items' },
63
+ { id: 'item_legendary_sword', name: 'Legendary Sword', type: constants_1.FLAG_TYPE.ITEM, category: 'items' },
64
+ { id: 'item_gold_coin', name: 'Gold Coin', type: constants_1.FLAG_TYPE.ITEM, category: 'items' },
65
+ { id: 'stat_gold', name: 'Gold', type: constants_1.FLAG_TYPE.STAT, category: 'stats', valueType: constants_1.FLAG_VALUE_TYPE.NUMBER, defaultValue: 0 },
66
+ { id: 'stat_reputation', name: 'Reputation', type: constants_1.FLAG_TYPE.STAT, category: 'stats', valueType: constants_1.FLAG_VALUE_TYPE.NUMBER, defaultValue: 0 },
67
+ { id: 'stat_charisma', name: 'Charisma', type: constants_1.FLAG_TYPE.STAT, category: 'stats', valueType: constants_1.FLAG_VALUE_TYPE.NUMBER, defaultValue: 10 },
68
+ { id: 'stat_strength', name: 'Strength', type: constants_1.FLAG_TYPE.STAT, category: 'stats', valueType: constants_1.FLAG_VALUE_TYPE.NUMBER, defaultValue: 10 },
69
+ { id: 'stat_wisdom', name: 'Wisdom', type: constants_1.FLAG_TYPE.STAT, category: 'stats', valueType: constants_1.FLAG_VALUE_TYPE.NUMBER, defaultValue: 10 },
70
+ { id: 'title_hero', name: 'Hero', type: constants_1.FLAG_TYPE.TITLE, category: 'titles' },
71
+ { id: 'title_explorer', name: 'Explorer', type: constants_1.FLAG_TYPE.TITLE, category: 'titles' },
72
+ { id: 'title_merchant', name: 'Merchant', type: constants_1.FLAG_TYPE.TITLE, category: 'titles' },
73
+ { id: 'global_game_started', name: 'Game Started', type: constants_1.FLAG_TYPE.GLOBAL, category: 'global' },
74
+ { id: 'global_first_visit', name: 'First Visit', type: constants_1.FLAG_TYPE.GLOBAL, category: 'global' },
75
+ { id: 'global_difficulty', name: 'Difficulty', type: constants_1.FLAG_TYPE.GLOBAL, category: 'global', valueType: constants_1.FLAG_VALUE_TYPE.STRING },
76
+ { id: 'dialogue_met_guard', name: 'Met Guard', type: constants_1.FLAG_TYPE.DIALOGUE, category: 'dialogue' },
77
+ { id: 'dialogue_hostile', name: 'Hostile Response', type: constants_1.FLAG_TYPE.DIALOGUE, category: 'dialogue' },
78
+ { id: 'dialogue_friendly', name: 'Friendly Response', type: constants_1.FLAG_TYPE.DIALOGUE, category: 'dialogue' },
79
+ { id: 'dialogue_seeks_knowledge', name: 'Seeks Knowledge', type: constants_1.FLAG_TYPE.DIALOGUE, category: 'dialogue' },
80
+ { id: 'dialogue_offered_bribe', name: 'Offered Bribe', type: constants_1.FLAG_TYPE.DIALOGUE, category: 'dialogue' },
81
+ ]
82
+ }
83
+ };
84
+ exports.exampleDialogues = {
85
+ basic: {
86
+ id: 'basic-example',
87
+ title: 'Basic Dialogue Example',
88
+ startNodeId: 'start',
89
+ nodes: {
90
+ start: {
91
+ id: 'start',
92
+ type: constants_1.NODE_TYPE.NPC,
93
+ speaker: 'Merchant',
94
+ content: 'Welcome to my shop! How can I help you?',
95
+ nextNodeId: 'player_choice',
96
+ x: 300,
97
+ y: 100
98
+ },
99
+ player_choice: {
100
+ id: 'player_choice',
101
+ type: constants_1.NODE_TYPE.PLAYER,
102
+ content: '',
103
+ choices: [
104
+ {
105
+ id: 'buy',
106
+ text: 'I want to buy something',
107
+ nextNodeId: 'shop',
108
+ setFlags: ['dialogue_shopping']
109
+ },
110
+ {
111
+ id: 'sell',
112
+ text: 'I want to sell something',
113
+ nextNodeId: 'sell',
114
+ },
115
+ {
116
+ id: 'leave',
117
+ text: 'Never mind',
118
+ nextNodeId: 'goodbye'
119
+ }
120
+ ],
121
+ x: 300,
122
+ y: 250
123
+ },
124
+ shop: {
125
+ id: 'shop',
126
+ type: constants_1.NODE_TYPE.NPC,
127
+ speaker: 'Merchant',
128
+ content: 'What would you like to buy?',
129
+ x: 100,
130
+ y: 400
131
+ },
132
+ sell: {
133
+ id: 'sell',
134
+ type: constants_1.NODE_TYPE.NPC,
135
+ speaker: 'Merchant',
136
+ content: 'Show me what you have.',
137
+ x: 300,
138
+ y: 400
139
+ },
140
+ goodbye: {
141
+ id: 'goodbye',
142
+ type: constants_1.NODE_TYPE.NPC,
143
+ speaker: 'Merchant',
144
+ content: 'Come back anytime!',
145
+ x: 500,
146
+ y: 400
147
+ }
148
+ }
149
+ },
150
+ conditional: {
151
+ id: 'conditional-example',
152
+ title: 'Conditional Dialogue Example',
153
+ startNodeId: 'start',
154
+ nodes: {
155
+ start: {
156
+ id: 'start',
157
+ type: constants_1.NODE_TYPE.NPC,
158
+ speaker: 'Guard',
159
+ content: 'Halt! Who goes there?',
160
+ nextNodeId: 'check_reputation',
161
+ x: 300,
162
+ y: 100
163
+ },
164
+ check_reputation: {
165
+ id: 'check_reputation',
166
+ type: constants_1.NODE_TYPE.PLAYER,
167
+ content: '',
168
+ choices: [
169
+ {
170
+ id: 'high_rep',
171
+ text: 'I am a hero of this land!',
172
+ nextNodeId: 'high_rep_response',
173
+ conditions: [
174
+ { flag: 'stat_reputation', operator: constants_1.CONDITION_OPERATOR.GREATER_THAN, value: 50 }
175
+ ]
176
+ },
177
+ {
178
+ id: 'low_rep',
179
+ text: 'Just a traveler...',
180
+ nextNodeId: 'low_rep_response',
181
+ conditions: [
182
+ { flag: 'stat_reputation', operator: constants_1.CONDITION_OPERATOR.LESS_EQUAL, value: 50 }
183
+ ]
184
+ },
185
+ {
186
+ id: 'has_key',
187
+ text: 'I have the key!',
188
+ nextNodeId: 'key_response',
189
+ conditions: [
190
+ { flag: 'item_key', operator: constants_1.CONDITION_OPERATOR.IS_SET }
191
+ ]
192
+ }
193
+ ],
194
+ x: 300,
195
+ y: 250
196
+ },
197
+ high_rep_response: {
198
+ id: 'high_rep_response',
199
+ type: constants_1.NODE_TYPE.NPC,
200
+ speaker: 'Guard',
201
+ content: 'Hero! Please, come in. The city welcomes you.',
202
+ setFlags: ['stat_reputation'],
203
+ x: 100,
204
+ y: 400
205
+ },
206
+ low_rep_response: {
207
+ id: 'low_rep_response',
208
+ type: constants_1.NODE_TYPE.NPC,
209
+ speaker: 'Guard',
210
+ content: 'Hmm... you may pass, but watch yourself.',
211
+ x: 300,
212
+ y: 400
213
+ },
214
+ key_response: {
215
+ id: 'key_response',
216
+ type: constants_1.NODE_TYPE.NPC,
217
+ speaker: 'Guard',
218
+ content: 'Ah, you have the key! Please enter.',
219
+ x: 500,
220
+ y: 400
221
+ }
222
+ }
223
+ },
224
+ quest_progression: {
225
+ id: 'quest-progression-example',
226
+ title: 'Quest Progression Example',
227
+ startNodeId: 'start',
228
+ nodes: {
229
+ start: {
230
+ id: 'start',
231
+ type: constants_1.NODE_TYPE.NPC,
232
+ speaker: 'Quest Giver',
233
+ content: 'I need your help! A dragon threatens our village.',
234
+ nextNodeId: 'quest_offer',
235
+ x: 300,
236
+ y: 100
237
+ },
238
+ quest_offer: {
239
+ id: 'quest_offer',
240
+ type: constants_1.NODE_TYPE.PLAYER,
241
+ content: '',
242
+ choices: [
243
+ {
244
+ id: 'accept',
245
+ text: 'I will help you!',
246
+ nextNodeId: 'quest_started',
247
+ setFlags: ['quest_dragon_slayer']
248
+ },
249
+ {
250
+ id: 'decline',
251
+ text: 'I cannot help right now.',
252
+ nextNodeId: 'quest_declined'
253
+ }
254
+ ],
255
+ x: 300,
256
+ y: 250
257
+ },
258
+ quest_started: {
259
+ id: 'quest_started',
260
+ type: constants_1.NODE_TYPE.NPC,
261
+ speaker: 'Quest Giver',
262
+ content: 'Thank you! Here is a map to the dragon\'s lair.',
263
+ setFlags: ['item_map', 'achievement_first_quest'],
264
+ nextNodeId: 'quest_continue',
265
+ x: 100,
266
+ y: 400
267
+ },
268
+ quest_continue: {
269
+ id: 'quest_continue',
270
+ type: constants_1.NODE_TYPE.PLAYER,
271
+ content: '',
272
+ choices: [
273
+ {
274
+ id: 'ask_details',
275
+ text: 'Tell me more about the dragon',
276
+ nextNodeId: 'dragon_info'
277
+ },
278
+ {
279
+ id: 'leave',
280
+ text: 'I will return when I have slain the dragon',
281
+ nextNodeId: 'quest_end'
282
+ }
283
+ ],
284
+ x: 100,
285
+ y: 550
286
+ },
287
+ dragon_info: {
288
+ id: 'dragon_info',
289
+ type: constants_1.NODE_TYPE.NPC,
290
+ speaker: 'Quest Giver',
291
+ content: 'The dragon is ancient and powerful. You will need the legendary sword to defeat it.',
292
+ nextNodeId: 'quest_continue',
293
+ x: 300,
294
+ y: 550
295
+ },
296
+ quest_declined: {
297
+ id: 'quest_declined',
298
+ type: constants_1.NODE_TYPE.NPC,
299
+ speaker: 'Quest Giver',
300
+ content: 'I understand. Return if you change your mind.',
301
+ x: 500,
302
+ y: 400
303
+ },
304
+ quest_end: {
305
+ id: 'quest_end',
306
+ type: constants_1.NODE_TYPE.NPC,
307
+ speaker: 'Narrator',
308
+ content: 'You set off on your quest...\n\n— TO BE CONTINUED —',
309
+ x: 100,
310
+ y: 700
311
+ }
312
+ }
313
+ },
314
+ complex_conditional: {
315
+ id: 'complex-conditional-example',
316
+ title: 'Complex Conditional Example',
317
+ startNodeId: 'guard_encounter',
318
+ nodes: {
319
+ guard_encounter: {
320
+ id: 'guard_encounter',
321
+ type: constants_1.NODE_TYPE.NPC,
322
+ speaker: 'Guard',
323
+ content: 'Halt! Who goes there?',
324
+ nextNodeId: 'player_response',
325
+ setFlags: ['dialogue_met_guard'],
326
+ x: 400,
327
+ y: 100
328
+ },
329
+ player_response: {
330
+ id: 'player_response',
331
+ type: constants_1.NODE_TYPE.PLAYER,
332
+ content: '',
333
+ choices: [
334
+ {
335
+ id: 'friendly',
336
+ text: 'I mean no harm. I\'m just passing through.',
337
+ nextNodeId: 'guard_friendly',
338
+ setFlags: ['dialogue_friendly']
339
+ },
340
+ {
341
+ id: 'hostile',
342
+ text: 'None of your business!',
343
+ nextNodeId: 'guard_hostile',
344
+ setFlags: ['dialogue_hostile']
345
+ },
346
+ {
347
+ id: 'bribe',
348
+ text: 'Perhaps we can come to an arrangement?',
349
+ nextNodeId: 'guard_bribe',
350
+ conditions: [
351
+ { flag: 'stat_gold', operator: constants_1.CONDITION_OPERATOR.GREATER_THAN, value: 50 }
352
+ ],
353
+ setFlags: ['dialogue_offered_bribe']
354
+ },
355
+ {
356
+ id: 'knowledge',
357
+ text: 'I seek knowledge of the ancient ruins.',
358
+ nextNodeId: 'guard_knowledge',
359
+ conditions: [
360
+ { flag: 'stat_wisdom', operator: constants_1.CONDITION_OPERATOR.GREATER_EQUAL, value: 15 }
361
+ ],
362
+ setFlags: ['dialogue_seeks_knowledge']
363
+ },
364
+ {
365
+ id: 'hero',
366
+ text: 'I am a hero on a quest!',
367
+ nextNodeId: 'guard_hero',
368
+ conditions: [
369
+ { flag: 'title_hero', operator: constants_1.CONDITION_OPERATOR.IS_SET }
370
+ ]
371
+ }
372
+ ],
373
+ x: 400,
374
+ y: 250
375
+ },
376
+ guard_friendly: {
377
+ id: 'guard_friendly',
378
+ type: constants_1.NODE_TYPE.NPC,
379
+ speaker: 'Guard',
380
+ content: 'Very well. You may pass, but be careful. The ruins ahead are dangerous.',
381
+ nextNodeId: 'reputation_check',
382
+ x: 200,
383
+ y: 400
384
+ },
385
+ guard_hostile: {
386
+ id: 'guard_hostile',
387
+ type: constants_1.NODE_TYPE.NPC,
388
+ speaker: 'Guard',
389
+ content: 'That\'s not a good attitude. I\'ll be watching you.',
390
+ nextNodeId: 'reputation_check',
391
+ setFlags: ['stat_reputation'],
392
+ x: 600,
393
+ y: 400
394
+ },
395
+ guard_bribe: {
396
+ id: 'guard_bribe',
397
+ type: constants_1.NODE_TYPE.NPC,
398
+ speaker: 'Guard',
399
+ content: 'Ah, a person of culture! Very well, I\'ll look the other way... for now.',
400
+ nextNodeId: 'reputation_check',
401
+ setFlags: ['stat_gold'],
402
+ x: 400,
403
+ y: 400
404
+ },
405
+ guard_knowledge: {
406
+ id: 'guard_knowledge',
407
+ type: constants_1.NODE_TYPE.NPC,
408
+ speaker: 'Guard',
409
+ content: 'The ancient ruins? You must be a scholar. I can tell you about them, but it will cost you.',
410
+ nextNodeId: 'knowledge_choice',
411
+ x: 200,
412
+ y: 400
413
+ },
414
+ guard_hero: {
415
+ id: 'guard_hero',
416
+ type: constants_1.NODE_TYPE.NPC,
417
+ speaker: 'Guard',
418
+ content: 'A hero! We\'ve been waiting for someone like you. Please, come with me to meet the captain.',
419
+ nextNodeId: 'hero_path',
420
+ setFlags: ['quest_dragon_slayer'],
421
+ x: 800,
422
+ y: 400
423
+ },
424
+ knowledge_choice: {
425
+ id: 'knowledge_choice',
426
+ type: constants_1.NODE_TYPE.PLAYER,
427
+ content: '',
428
+ choices: [
429
+ {
430
+ id: 'pay_knowledge',
431
+ text: 'I\'ll pay for the information.',
432
+ nextNodeId: 'knowledge_paid',
433
+ conditions: [
434
+ { flag: 'stat_gold', operator: constants_1.CONDITION_OPERATOR.GREATER_EQUAL, value: 100 }
435
+ ],
436
+ setFlags: ['stat_gold', 'item_treasure_map']
437
+ },
438
+ {
439
+ id: 'decline_knowledge',
440
+ text: 'Never mind, I\'ll find out myself.',
441
+ nextNodeId: 'reputation_check'
442
+ }
443
+ ],
444
+ x: 200,
445
+ y: 550
446
+ },
447
+ knowledge_paid: {
448
+ id: 'knowledge_paid',
449
+ type: constants_1.NODE_TYPE.NPC,
450
+ speaker: 'Guard',
451
+ content: 'The ruins are to the east. Here\'s a map. Be careful - many have entered, few have returned.',
452
+ nextNodeId: 'reputation_check',
453
+ x: 100,
454
+ y: 700
455
+ },
456
+ hero_path: {
457
+ id: 'hero_path',
458
+ type: constants_1.NODE_TYPE.CONDITIONAL,
459
+ content: '',
460
+ conditionalBlocks: [
461
+ {
462
+ id: 'hero_if_quest',
463
+ type: 'if',
464
+ condition: [
465
+ { flag: 'quest_dragon_slayer', operator: constants_1.CONDITION_OPERATOR.IS_SET }
466
+ ],
467
+ content: 'Captain: We need your help! A dragon has been terrorizing our lands.',
468
+ speaker: 'Captain',
469
+ nextNodeId: 'dragon_quest_start'
470
+ },
471
+ {
472
+ id: 'hero_elseif_achievement',
473
+ type: 'elseif',
474
+ condition: [
475
+ { flag: 'achievement_hero', operator: constants_1.CONDITION_OPERATOR.IS_SET }
476
+ ],
477
+ content: 'Captain: Ah, the hero returns! We have a new mission for you.',
478
+ speaker: 'Captain',
479
+ nextNodeId: 'new_mission'
480
+ },
481
+ {
482
+ id: 'hero_else',
483
+ type: 'else',
484
+ content: 'Captain: Welcome, traveler. Perhaps you can help us with a problem.',
485
+ speaker: 'Captain',
486
+ nextNodeId: 'general_help'
487
+ }
488
+ ],
489
+ x: 800,
490
+ y: 550
491
+ },
492
+ dragon_quest_start: {
493
+ id: 'dragon_quest_start',
494
+ type: constants_1.NODE_TYPE.PLAYER,
495
+ content: '',
496
+ choices: [
497
+ {
498
+ id: 'accept_dragon',
499
+ text: 'I accept the quest!',
500
+ nextNodeId: 'dragon_quest_accepted',
501
+ setFlags: ['quest_dragon_slayer', 'achievement_hero']
502
+ },
503
+ {
504
+ id: 'decline_dragon',
505
+ text: 'I need to prepare first.',
506
+ nextNodeId: 'dragon_quest_declined'
507
+ },
508
+ {
509
+ id: 'ask_reward',
510
+ text: 'What\'s the reward?',
511
+ nextNodeId: 'dragon_reward_info',
512
+ conditions: [
513
+ { flag: 'stat_gold', operator: constants_1.CONDITION_OPERATOR.LESS_THAN, value: 1000 }
514
+ ]
515
+ }
516
+ ],
517
+ x: 800,
518
+ y: 700
519
+ },
520
+ dragon_quest_accepted: {
521
+ id: 'dragon_quest_accepted',
522
+ type: constants_1.NODE_TYPE.NPC,
523
+ speaker: 'Captain',
524
+ content: 'Excellent! The dragon\'s lair is in the mountains. You\'ll need the legendary sword to defeat it.',
525
+ nextNodeId: 'reputation_check',
526
+ setFlags: ['quest_dragon_slayer', 'title_hero'],
527
+ x: 600,
528
+ y: 850
529
+ },
530
+ dragon_quest_declined: {
531
+ id: 'dragon_quest_declined',
532
+ type: constants_1.NODE_TYPE.NPC,
533
+ speaker: 'Captain',
534
+ content: 'Very well. Return when you\'re ready. We\'ll be waiting.',
535
+ nextNodeId: 'reputation_check',
536
+ x: 1000,
537
+ y: 850
538
+ },
539
+ dragon_reward_info: {
540
+ id: 'dragon_reward_info',
541
+ type: constants_1.NODE_TYPE.NPC,
542
+ speaker: 'Captain',
543
+ content: 'The reward is 10,000 gold pieces and the title of "Dragon Slayer".',
544
+ nextNodeId: 'dragon_quest_start',
545
+ x: 800,
546
+ y: 850
547
+ },
548
+ new_mission: {
549
+ id: 'new_mission',
550
+ type: constants_1.NODE_TYPE.NPC,
551
+ speaker: 'Captain',
552
+ content: 'We need you to investigate the ancient ruins. Strange things have been happening there.',
553
+ nextNodeId: 'ruins_quest_choice',
554
+ setFlags: ['quest_ancient_ruins'],
555
+ x: 1000,
556
+ y: 700
557
+ },
558
+ general_help: {
559
+ id: 'general_help',
560
+ type: constants_1.NODE_TYPE.PLAYER,
561
+ content: '',
562
+ choices: [
563
+ {
564
+ id: 'help_yes',
565
+ text: 'I\'ll help!',
566
+ nextNodeId: 'reputation_check',
567
+ setFlags: ['stat_reputation']
568
+ },
569
+ {
570
+ id: 'help_no',
571
+ text: 'I\'m just passing through.',
572
+ nextNodeId: 'reputation_check'
573
+ }
574
+ ],
575
+ x: 1000,
576
+ y: 550
577
+ },
578
+ ruins_quest_choice: {
579
+ id: 'ruins_quest_choice',
580
+ type: constants_1.NODE_TYPE.PLAYER,
581
+ content: '',
582
+ choices: [
583
+ {
584
+ id: 'accept_ruins',
585
+ text: 'I\'ll investigate the ruins.',
586
+ nextNodeId: 'ruins_conditional',
587
+ setFlags: ['quest_ancient_ruins']
588
+ },
589
+ {
590
+ id: 'decline_ruins',
591
+ text: 'I have other priorities.',
592
+ nextNodeId: 'reputation_check'
593
+ }
594
+ ],
595
+ x: 1000,
596
+ y: 850
597
+ },
598
+ ruins_conditional: {
599
+ id: 'ruins_conditional',
600
+ type: constants_1.NODE_TYPE.CONDITIONAL,
601
+ content: '',
602
+ conditionalBlocks: [
603
+ {
604
+ id: 'ruins_if_key',
605
+ type: 'if',
606
+ condition: [
607
+ { flag: 'item_ancient_key', operator: constants_1.CONDITION_OPERATOR.IS_SET }
608
+ ],
609
+ content: 'You use the ancient key to unlock the ruins entrance. Inside, you find a treasure chest!',
610
+ nextNodeId: 'ruins_treasure'
611
+ },
612
+ {
613
+ id: 'ruins_elseif_strength',
614
+ type: 'elseif',
615
+ condition: [
616
+ { flag: 'stat_strength', operator: constants_1.CONDITION_OPERATOR.GREATER_EQUAL, value: 20 }
617
+ ],
618
+ content: 'You force the door open with your strength. The entrance creaks open.',
619
+ nextNodeId: 'ruins_inside'
620
+ },
621
+ {
622
+ id: 'ruins_elseif_charisma',
623
+ type: 'elseif',
624
+ condition: [
625
+ { flag: 'stat_charisma', operator: constants_1.CONDITION_OPERATOR.GREATER_EQUAL, value: 18 }
626
+ ],
627
+ content: 'You find a hidden mechanism and convince it to open through clever words.',
628
+ nextNodeId: 'ruins_inside'
629
+ },
630
+ {
631
+ id: 'ruins_else',
632
+ type: 'else',
633
+ content: 'The ruins entrance is sealed. You cannot enter without a key or sufficient strength.',
634
+ nextNodeId: 'reputation_check'
635
+ }
636
+ ],
637
+ x: 1000,
638
+ y: 1000
639
+ },
640
+ ruins_treasure: {
641
+ id: 'ruins_treasure',
642
+ type: constants_1.NODE_TYPE.PLAYER,
643
+ content: '',
644
+ choices: [
645
+ {
646
+ id: 'open_treasure',
647
+ text: 'Open the treasure chest',
648
+ nextNodeId: 'treasure_reward',
649
+ setFlags: ['quest_ancient_ruins_complete', 'achievement_explorer']
650
+ },
651
+ {
652
+ id: 'leave_treasure',
653
+ text: 'Leave it for now',
654
+ nextNodeId: 'reputation_check'
655
+ }
656
+ ],
657
+ x: 800,
658
+ y: 1150
659
+ },
660
+ treasure_reward: {
661
+ id: 'treasure_reward',
662
+ type: constants_1.NODE_TYPE.CONDITIONAL,
663
+ content: '',
664
+ conditionalBlocks: [
665
+ {
666
+ id: 'treasure_if_gold',
667
+ type: 'if',
668
+ condition: [
669
+ { flag: 'stat_gold', operator: constants_1.CONDITION_OPERATOR.LESS_THAN, value: 500 }
670
+ ],
671
+ content: 'You find 1000 gold pieces inside! This is a fortune!',
672
+ nextNodeId: 'treasure_gold_reward'
673
+ },
674
+ {
675
+ id: 'treasure_else',
676
+ type: 'else',
677
+ content: 'You find a legendary sword! This will be useful against the dragon.',
678
+ nextNodeId: 'treasure_sword_reward'
679
+ }
680
+ ],
681
+ x: 600,
682
+ y: 1300
683
+ },
684
+ treasure_gold_reward: {
685
+ id: 'treasure_gold_reward',
686
+ type: constants_1.NODE_TYPE.NPC,
687
+ speaker: 'Narrator',
688
+ content: 'You gain 1000 gold pieces and the "Rich" achievement!',
689
+ nextNodeId: 'reputation_check',
690
+ setFlags: ['stat_gold', 'achievement_rich'],
691
+ x: 400,
692
+ y: 1450
693
+ },
694
+ treasure_sword_reward: {
695
+ id: 'treasure_sword_reward',
696
+ type: constants_1.NODE_TYPE.NPC,
697
+ speaker: 'Narrator',
698
+ content: 'You obtain the legendary sword! This will be useful against the dragon.',
699
+ nextNodeId: 'reputation_check',
700
+ setFlags: ['item_legendary_sword'],
701
+ x: 800,
702
+ y: 1450
703
+ },
704
+ ruins_inside: {
705
+ id: 'ruins_inside',
706
+ type: constants_1.NODE_TYPE.PLAYER,
707
+ content: '',
708
+ choices: [
709
+ {
710
+ id: 'explore_ruins',
711
+ text: 'Explore the ruins',
712
+ nextNodeId: 'ruins_exploration',
713
+ setFlags: ['achievement_explorer']
714
+ },
715
+ {
716
+ id: 'search_key',
717
+ text: 'Search for a key',
718
+ nextNodeId: 'key_found',
719
+ conditions: [
720
+ { flag: 'stat_wisdom', operator: constants_1.CONDITION_OPERATOR.GREATER_EQUAL, value: 15 }
721
+ ]
722
+ },
723
+ {
724
+ id: 'leave_ruins',
725
+ text: 'Leave the ruins',
726
+ nextNodeId: 'reputation_check'
727
+ }
728
+ ],
729
+ x: 1200,
730
+ y: 1150
731
+ },
732
+ ruins_exploration: {
733
+ id: 'ruins_exploration',
734
+ type: constants_1.NODE_TYPE.NPC,
735
+ speaker: 'Narrator',
736
+ content: 'You explore the ancient ruins and discover ancient texts. Your wisdom increases.',
737
+ nextNodeId: 'reputation_check',
738
+ setFlags: ['stat_wisdom', 'quest_ancient_ruins_complete'],
739
+ x: 1200,
740
+ y: 1300
741
+ },
742
+ key_found: {
743
+ id: 'key_found',
744
+ type: constants_1.NODE_TYPE.NPC,
745
+ speaker: 'Narrator',
746
+ content: 'Your wisdom guides you to a hidden alcove. You find an ancient key!',
747
+ nextNodeId: 'reputation_check',
748
+ setFlags: ['item_ancient_key'],
749
+ x: 1400,
750
+ y: 1300
751
+ },
752
+ reputation_check: {
753
+ id: 'reputation_check',
754
+ type: constants_1.NODE_TYPE.CONDITIONAL,
755
+ content: '',
756
+ conditionalBlocks: [
757
+ {
758
+ id: 'rep_if_high',
759
+ type: 'if',
760
+ condition: [
761
+ { flag: 'stat_reputation', operator: constants_1.CONDITION_OPERATOR.GREATER_EQUAL, value: 50 }
762
+ ],
763
+ content: 'Your reputation precedes you. People recognize you as a hero and treat you with respect.',
764
+ nextNodeId: 'ending'
765
+ },
766
+ {
767
+ id: 'rep_elseif_medium',
768
+ type: 'elseif',
769
+ condition: [
770
+ { flag: 'stat_reputation', operator: constants_1.CONDITION_OPERATOR.GREATER_EQUAL, value: 20 }
771
+ ],
772
+ content: 'You have a decent reputation. Some people know of your deeds.',
773
+ nextNodeId: 'ending'
774
+ },
775
+ {
776
+ id: 'rep_else',
777
+ type: 'else',
778
+ content: 'You are relatively unknown. Your journey is just beginning.',
779
+ nextNodeId: 'ending'
780
+ }
781
+ ],
782
+ x: 400,
783
+ y: 1000
784
+ },
785
+ ending: {
786
+ id: 'ending',
787
+ type: constants_1.NODE_TYPE.PLAYER,
788
+ content: '',
789
+ choices: [
790
+ {
791
+ id: 'continue',
792
+ text: 'Continue your adventure',
793
+ nextNodeId: 'final_message'
794
+ },
795
+ {
796
+ id: 'rest',
797
+ text: 'Take a rest',
798
+ nextNodeId: 'final_message',
799
+ conditions: [
800
+ { flag: 'stat_strength', operator: constants_1.CONDITION_OPERATOR.LESS_THAN, value: 15 }
801
+ ]
802
+ }
803
+ ],
804
+ x: 400,
805
+ y: 1150
806
+ },
807
+ final_message: {
808
+ id: 'final_message',
809
+ type: constants_1.NODE_TYPE.NPC,
810
+ speaker: 'Narrator',
811
+ content: 'Your adventure continues...\n\nThis example demonstrates:\n- Conditional nodes with if/elseif/else\n- Conditional choices on player nodes\n- Multiple flag types (quest, achievement, item, stat, title, global, dialogue)\n- Complex conditions with various operators\n- Flag setting throughout the dialogue flow',
812
+ x: 400,
813
+ y: 1300
814
+ }
815
+ }
816
+ }
817
+ };