rpg-event-generator 1.2.6 → 2.0.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 (436) hide show
  1. package/README.md +548 -4
  2. package/demo.js +705 -460
  3. package/dist/index.js +504 -7
  4. package/package.json +17 -3
  5. package/scripts/event-economy.js +388 -0
  6. package/scripts/export-templates.js +289 -0
  7. package/scripts/generate-templates.js +407 -0
  8. package/templates/cyberpunk/event_100.json +43 -0
  9. package/templates/cyberpunk/event_11.json +42 -0
  10. package/templates/cyberpunk/event_14.json +42 -0
  11. package/templates/cyberpunk/event_15.json +43 -0
  12. package/templates/cyberpunk/event_16.json +43 -0
  13. package/templates/cyberpunk/event_18.json +44 -0
  14. package/templates/cyberpunk/event_2.json +42 -0
  15. package/templates/cyberpunk/event_26.json +42 -0
  16. package/templates/cyberpunk/event_27.json +43 -0
  17. package/templates/cyberpunk/event_3.json +43 -0
  18. package/templates/cyberpunk/event_30.json +42 -0
  19. package/templates/cyberpunk/event_32.json +42 -0
  20. package/templates/cyberpunk/event_36.json +43 -0
  21. package/templates/cyberpunk/event_37.json +42 -0
  22. package/templates/cyberpunk/event_39.json +42 -0
  23. package/templates/cyberpunk/event_4.json +42 -0
  24. package/templates/cyberpunk/event_40.json +42 -0
  25. package/templates/cyberpunk/event_42.json +43 -0
  26. package/templates/cyberpunk/event_46.json +43 -0
  27. package/templates/cyberpunk/event_49.json +44 -0
  28. package/templates/cyberpunk/event_5.json +44 -0
  29. package/templates/cyberpunk/event_50.json +42 -0
  30. package/templates/cyberpunk/event_51.json +42 -0
  31. package/templates/cyberpunk/event_54.json +43 -0
  32. package/templates/cyberpunk/event_55.json +44 -0
  33. package/templates/cyberpunk/event_57.json +42 -0
  34. package/templates/cyberpunk/event_58.json +42 -0
  35. package/templates/cyberpunk/event_61.json +43 -0
  36. package/templates/cyberpunk/event_62.json +43 -0
  37. package/templates/cyberpunk/event_64.json +42 -0
  38. package/templates/cyberpunk/event_65.json +42 -0
  39. package/templates/cyberpunk/event_66.json +42 -0
  40. package/templates/cyberpunk/event_68.json +43 -0
  41. package/templates/cyberpunk/event_69.json +43 -0
  42. package/templates/cyberpunk/event_71.json +42 -0
  43. package/templates/cyberpunk/event_72.json +42 -0
  44. package/templates/cyberpunk/event_73.json +42 -0
  45. package/templates/cyberpunk/event_74.json +42 -0
  46. package/templates/cyberpunk/event_75.json +44 -0
  47. package/templates/cyberpunk/event_76.json +43 -0
  48. package/templates/cyberpunk/event_78.json +43 -0
  49. package/templates/cyberpunk/event_79.json +42 -0
  50. package/templates/cyberpunk/event_8.json +42 -0
  51. package/templates/cyberpunk/event_80.json +43 -0
  52. package/templates/cyberpunk/event_81.json +43 -0
  53. package/templates/cyberpunk/event_83.json +44 -0
  54. package/templates/cyberpunk/event_84.json +43 -0
  55. package/templates/cyberpunk/event_86.json +44 -0
  56. package/templates/cyberpunk/event_88.json +43 -0
  57. package/templates/cyberpunk/event_9.json +42 -0
  58. package/templates/cyberpunk/event_91.json +42 -0
  59. package/templates/cyberpunk/event_92.json +43 -0
  60. package/templates/cyberpunk/event_93.json +42 -0
  61. package/templates/cyberpunk/event_95.json +42 -0
  62. package/templates/cyberpunk/event_96.json +43 -0
  63. package/templates/cyberpunk/event_97.json +43 -0
  64. package/templates/cyberpunk/event_98.json +42 -0
  65. package/templates/cyberpunk/event_99.json +42 -0
  66. package/templates/fantasy/dragon_lair.json +28 -0
  67. package/templates/fantasy/event_1.json +44 -0
  68. package/templates/fantasy/event_10.json +43 -0
  69. package/templates/fantasy/event_11.json +43 -0
  70. package/templates/fantasy/event_12.json +42 -0
  71. package/templates/fantasy/event_13.json +43 -0
  72. package/templates/fantasy/event_16.json +44 -0
  73. package/templates/fantasy/event_20.json +42 -0
  74. package/templates/fantasy/event_21.json +42 -0
  75. package/templates/fantasy/event_22.json +42 -0
  76. package/templates/fantasy/event_23.json +42 -0
  77. package/templates/fantasy/event_24.json +43 -0
  78. package/templates/fantasy/event_27.json +43 -0
  79. package/templates/fantasy/event_29.json +43 -0
  80. package/templates/fantasy/event_3.json +42 -0
  81. package/templates/fantasy/event_30.json +43 -0
  82. package/templates/fantasy/event_31.json +42 -0
  83. package/templates/fantasy/event_33.json +42 -0
  84. package/templates/fantasy/event_34.json +43 -0
  85. package/templates/fantasy/event_36.json +43 -0
  86. package/templates/fantasy/event_38.json +43 -0
  87. package/templates/fantasy/event_39.json +42 -0
  88. package/templates/fantasy/event_4.json +44 -0
  89. package/templates/fantasy/event_41.json +43 -0
  90. package/templates/fantasy/event_44.json +42 -0
  91. package/templates/fantasy/event_45.json +42 -0
  92. package/templates/fantasy/event_46.json +42 -0
  93. package/templates/fantasy/event_47.json +42 -0
  94. package/templates/fantasy/event_48.json +42 -0
  95. package/templates/fantasy/event_5.json +42 -0
  96. package/templates/fantasy/event_50.json +44 -0
  97. package/templates/fantasy/event_51.json +43 -0
  98. package/templates/fantasy/event_54.json +43 -0
  99. package/templates/fantasy/event_55.json +43 -0
  100. package/templates/fantasy/event_57.json +44 -0
  101. package/templates/fantasy/event_58.json +44 -0
  102. package/templates/fantasy/event_6.json +42 -0
  103. package/templates/fantasy/event_64.json +42 -0
  104. package/templates/fantasy/event_68.json +42 -0
  105. package/templates/fantasy/event_69.json +43 -0
  106. package/templates/fantasy/event_70.json +42 -0
  107. package/templates/fantasy/event_71.json +42 -0
  108. package/templates/fantasy/event_72.json +43 -0
  109. package/templates/fantasy/event_73.json +42 -0
  110. package/templates/fantasy/event_76.json +43 -0
  111. package/templates/fantasy/event_77.json +43 -0
  112. package/templates/fantasy/event_79.json +42 -0
  113. package/templates/fantasy/event_88.json +42 -0
  114. package/templates/fantasy/event_9.json +44 -0
  115. package/templates/fantasy/event_90.json +43 -0
  116. package/templates/fantasy/event_91.json +42 -0
  117. package/templates/fantasy/event_92.json +42 -0
  118. package/templates/fantasy/event_94.json +43 -0
  119. package/templates/fantasy/event_96.json +42 -0
  120. package/templates/fantasy/event_97.json +42 -0
  121. package/templates/fantasy/event_98.json +42 -0
  122. package/templates/fantasy/event_99.json +42 -0
  123. package/templates/fantasy/magic_shop.json +28 -0
  124. package/templates/historical/court_intrigue.json +28 -0
  125. package/templates/historical/event_1.json +44 -0
  126. package/templates/historical/event_10.json +42 -0
  127. package/templates/historical/event_11.json +44 -0
  128. package/templates/historical/event_14.json +44 -0
  129. package/templates/historical/event_17.json +44 -0
  130. package/templates/historical/event_2.json +43 -0
  131. package/templates/historical/event_20.json +43 -0
  132. package/templates/historical/event_21.json +44 -0
  133. package/templates/historical/event_22.json +43 -0
  134. package/templates/historical/event_25.json +43 -0
  135. package/templates/historical/event_26.json +42 -0
  136. package/templates/historical/event_3.json +43 -0
  137. package/templates/historical/event_30.json +42 -0
  138. package/templates/historical/event_33.json +44 -0
  139. package/templates/historical/event_34.json +42 -0
  140. package/templates/historical/event_39.json +42 -0
  141. package/templates/historical/event_4.json +44 -0
  142. package/templates/historical/event_40.json +42 -0
  143. package/templates/historical/event_42.json +42 -0
  144. package/templates/historical/event_44.json +43 -0
  145. package/templates/historical/event_45.json +43 -0
  146. package/templates/historical/event_48.json +42 -0
  147. package/templates/historical/event_50.json +42 -0
  148. package/templates/historical/event_52.json +42 -0
  149. package/templates/historical/event_53.json +44 -0
  150. package/templates/historical/event_54.json +44 -0
  151. package/templates/historical/event_56.json +42 -0
  152. package/templates/historical/event_57.json +42 -0
  153. package/templates/historical/event_59.json +42 -0
  154. package/templates/historical/event_60.json +43 -0
  155. package/templates/historical/event_61.json +42 -0
  156. package/templates/historical/event_62.json +44 -0
  157. package/templates/historical/event_63.json +42 -0
  158. package/templates/historical/event_64.json +43 -0
  159. package/templates/historical/event_65.json +44 -0
  160. package/templates/historical/event_66.json +42 -0
  161. package/templates/historical/event_67.json +43 -0
  162. package/templates/historical/event_69.json +43 -0
  163. package/templates/historical/event_7.json +42 -0
  164. package/templates/historical/event_70.json +42 -0
  165. package/templates/historical/event_71.json +43 -0
  166. package/templates/historical/event_74.json +42 -0
  167. package/templates/historical/event_75.json +43 -0
  168. package/templates/historical/event_79.json +42 -0
  169. package/templates/historical/event_8.json +44 -0
  170. package/templates/historical/event_80.json +43 -0
  171. package/templates/historical/event_82.json +42 -0
  172. package/templates/historical/event_87.json +43 -0
  173. package/templates/historical/event_89.json +43 -0
  174. package/templates/historical/event_9.json +43 -0
  175. package/templates/historical/event_90.json +44 -0
  176. package/templates/historical/event_91.json +42 -0
  177. package/templates/historical/event_92.json +43 -0
  178. package/templates/historical/event_94.json +42 -0
  179. package/templates/historical/event_97.json +42 -0
  180. package/templates/horror/event_1.json +42 -0
  181. package/templates/horror/event_100.json +42 -0
  182. package/templates/horror/event_12.json +42 -0
  183. package/templates/horror/event_13.json +43 -0
  184. package/templates/horror/event_14.json +44 -0
  185. package/templates/horror/event_15.json +42 -0
  186. package/templates/horror/event_16.json +43 -0
  187. package/templates/horror/event_17.json +43 -0
  188. package/templates/horror/event_18.json +42 -0
  189. package/templates/horror/event_2.json +44 -0
  190. package/templates/horror/event_20.json +43 -0
  191. package/templates/horror/event_23.json +42 -0
  192. package/templates/horror/event_27.json +43 -0
  193. package/templates/horror/event_28.json +42 -0
  194. package/templates/horror/event_29.json +42 -0
  195. package/templates/horror/event_3.json +42 -0
  196. package/templates/horror/event_30.json +42 -0
  197. package/templates/horror/event_32.json +42 -0
  198. package/templates/horror/event_34.json +42 -0
  199. package/templates/horror/event_35.json +43 -0
  200. package/templates/horror/event_36.json +43 -0
  201. package/templates/horror/event_37.json +43 -0
  202. package/templates/horror/event_38.json +44 -0
  203. package/templates/horror/event_39.json +42 -0
  204. package/templates/horror/event_40.json +42 -0
  205. package/templates/horror/event_41.json +42 -0
  206. package/templates/horror/event_42.json +43 -0
  207. package/templates/horror/event_43.json +43 -0
  208. package/templates/horror/event_45.json +42 -0
  209. package/templates/horror/event_46.json +44 -0
  210. package/templates/horror/event_47.json +42 -0
  211. package/templates/horror/event_50.json +43 -0
  212. package/templates/horror/event_52.json +44 -0
  213. package/templates/horror/event_53.json +43 -0
  214. package/templates/horror/event_55.json +43 -0
  215. package/templates/horror/event_56.json +44 -0
  216. package/templates/horror/event_58.json +42 -0
  217. package/templates/horror/event_59.json +42 -0
  218. package/templates/horror/event_60.json +43 -0
  219. package/templates/horror/event_61.json +44 -0
  220. package/templates/horror/event_62.json +42 -0
  221. package/templates/horror/event_63.json +43 -0
  222. package/templates/horror/event_65.json +42 -0
  223. package/templates/horror/event_67.json +43 -0
  224. package/templates/horror/event_68.json +44 -0
  225. package/templates/horror/event_72.json +42 -0
  226. package/templates/horror/event_73.json +44 -0
  227. package/templates/horror/event_74.json +43 -0
  228. package/templates/horror/event_77.json +42 -0
  229. package/templates/horror/event_79.json +43 -0
  230. package/templates/horror/event_8.json +42 -0
  231. package/templates/horror/event_82.json +43 -0
  232. package/templates/horror/event_83.json +42 -0
  233. package/templates/horror/event_84.json +42 -0
  234. package/templates/horror/event_86.json +43 -0
  235. package/templates/horror/event_88.json +42 -0
  236. package/templates/horror/event_89.json +43 -0
  237. package/templates/horror/event_9.json +43 -0
  238. package/templates/horror/event_90.json +44 -0
  239. package/templates/horror/event_91.json +43 -0
  240. package/templates/horror/event_93.json +42 -0
  241. package/templates/horror/event_95.json +42 -0
  242. package/templates/horror/event_96.json +43 -0
  243. package/templates/horror/event_99.json +42 -0
  244. package/templates/horror/haunted_mansion.json +28 -0
  245. package/templates/index.json +475 -0
  246. package/templates/modern/event_10.json +42 -0
  247. package/templates/modern/event_100.json +43 -0
  248. package/templates/modern/event_11.json +44 -0
  249. package/templates/modern/event_13.json +42 -0
  250. package/templates/modern/event_15.json +43 -0
  251. package/templates/modern/event_16.json +42 -0
  252. package/templates/modern/event_17.json +42 -0
  253. package/templates/modern/event_19.json +43 -0
  254. package/templates/modern/event_2.json +42 -0
  255. package/templates/modern/event_20.json +42 -0
  256. package/templates/modern/event_21.json +43 -0
  257. package/templates/modern/event_22.json +43 -0
  258. package/templates/modern/event_23.json +43 -0
  259. package/templates/modern/event_25.json +43 -0
  260. package/templates/modern/event_27.json +42 -0
  261. package/templates/modern/event_28.json +42 -0
  262. package/templates/modern/event_31.json +42 -0
  263. package/templates/modern/event_32.json +43 -0
  264. package/templates/modern/event_34.json +44 -0
  265. package/templates/modern/event_35.json +42 -0
  266. package/templates/modern/event_36.json +44 -0
  267. package/templates/modern/event_37.json +42 -0
  268. package/templates/modern/event_39.json +42 -0
  269. package/templates/modern/event_4.json +42 -0
  270. package/templates/modern/event_41.json +42 -0
  271. package/templates/modern/event_42.json +44 -0
  272. package/templates/modern/event_43.json +42 -0
  273. package/templates/modern/event_44.json +44 -0
  274. package/templates/modern/event_45.json +44 -0
  275. package/templates/modern/event_46.json +44 -0
  276. package/templates/modern/event_47.json +43 -0
  277. package/templates/modern/event_48.json +42 -0
  278. package/templates/modern/event_49.json +43 -0
  279. package/templates/modern/event_5.json +43 -0
  280. package/templates/modern/event_51.json +42 -0
  281. package/templates/modern/event_52.json +42 -0
  282. package/templates/modern/event_55.json +43 -0
  283. package/templates/modern/event_56.json +42 -0
  284. package/templates/modern/event_57.json +42 -0
  285. package/templates/modern/event_59.json +42 -0
  286. package/templates/modern/event_6.json +43 -0
  287. package/templates/modern/event_60.json +43 -0
  288. package/templates/modern/event_61.json +42 -0
  289. package/templates/modern/event_63.json +42 -0
  290. package/templates/modern/event_64.json +42 -0
  291. package/templates/modern/event_66.json +42 -0
  292. package/templates/modern/event_67.json +42 -0
  293. package/templates/modern/event_69.json +42 -0
  294. package/templates/modern/event_7.json +43 -0
  295. package/templates/modern/event_70.json +42 -0
  296. package/templates/modern/event_72.json +43 -0
  297. package/templates/modern/event_74.json +43 -0
  298. package/templates/modern/event_78.json +42 -0
  299. package/templates/modern/event_8.json +42 -0
  300. package/templates/modern/event_80.json +44 -0
  301. package/templates/modern/event_81.json +43 -0
  302. package/templates/modern/event_82.json +42 -0
  303. package/templates/modern/event_83.json +42 -0
  304. package/templates/modern/event_84.json +44 -0
  305. package/templates/modern/event_85.json +42 -0
  306. package/templates/modern/event_86.json +42 -0
  307. package/templates/modern/event_87.json +44 -0
  308. package/templates/modern/event_89.json +42 -0
  309. package/templates/modern/event_94.json +42 -0
  310. package/templates/modern/event_97.json +43 -0
  311. package/templates/modern/event_98.json +42 -0
  312. package/templates/modern/event_99.json +44 -0
  313. package/templates/schema.json +87 -0
  314. package/templates/sci-fi/alien_encounter.json +28 -0
  315. package/templates/sci-fi/event_1.json +42 -0
  316. package/templates/sci-fi/event_11.json +43 -0
  317. package/templates/sci-fi/event_13.json +43 -0
  318. package/templates/sci-fi/event_15.json +43 -0
  319. package/templates/sci-fi/event_18.json +42 -0
  320. package/templates/sci-fi/event_19.json +43 -0
  321. package/templates/sci-fi/event_2.json +44 -0
  322. package/templates/sci-fi/event_22.json +42 -0
  323. package/templates/sci-fi/event_23.json +42 -0
  324. package/templates/sci-fi/event_24.json +43 -0
  325. package/templates/sci-fi/event_25.json +42 -0
  326. package/templates/sci-fi/event_27.json +43 -0
  327. package/templates/sci-fi/event_28.json +43 -0
  328. package/templates/sci-fi/event_30.json +43 -0
  329. package/templates/sci-fi/event_31.json +42 -0
  330. package/templates/sci-fi/event_32.json +42 -0
  331. package/templates/sci-fi/event_33.json +44 -0
  332. package/templates/sci-fi/event_34.json +42 -0
  333. package/templates/sci-fi/event_35.json +42 -0
  334. package/templates/sci-fi/event_36.json +42 -0
  335. package/templates/sci-fi/event_37.json +44 -0
  336. package/templates/sci-fi/event_39.json +43 -0
  337. package/templates/sci-fi/event_4.json +43 -0
  338. package/templates/sci-fi/event_41.json +42 -0
  339. package/templates/sci-fi/event_45.json +42 -0
  340. package/templates/sci-fi/event_47.json +43 -0
  341. package/templates/sci-fi/event_48.json +42 -0
  342. package/templates/sci-fi/event_50.json +43 -0
  343. package/templates/sci-fi/event_51.json +42 -0
  344. package/templates/sci-fi/event_53.json +42 -0
  345. package/templates/sci-fi/event_54.json +43 -0
  346. package/templates/sci-fi/event_55.json +42 -0
  347. package/templates/sci-fi/event_56.json +43 -0
  348. package/templates/sci-fi/event_59.json +42 -0
  349. package/templates/sci-fi/event_6.json +42 -0
  350. package/templates/sci-fi/event_60.json +43 -0
  351. package/templates/sci-fi/event_64.json +44 -0
  352. package/templates/sci-fi/event_65.json +43 -0
  353. package/templates/sci-fi/event_67.json +42 -0
  354. package/templates/sci-fi/event_7.json +42 -0
  355. package/templates/sci-fi/event_72.json +42 -0
  356. package/templates/sci-fi/event_73.json +43 -0
  357. package/templates/sci-fi/event_74.json +44 -0
  358. package/templates/sci-fi/event_75.json +43 -0
  359. package/templates/sci-fi/event_78.json +42 -0
  360. package/templates/sci-fi/event_80.json +42 -0
  361. package/templates/sci-fi/event_82.json +43 -0
  362. package/templates/sci-fi/event_83.json +44 -0
  363. package/templates/sci-fi/event_85.json +42 -0
  364. package/templates/sci-fi/event_87.json +42 -0
  365. package/templates/sci-fi/event_89.json +42 -0
  366. package/templates/sci-fi/event_9.json +42 -0
  367. package/templates/sci-fi/event_90.json +43 -0
  368. package/templates/sci-fi/event_92.json +44 -0
  369. package/templates/sci-fi/event_93.json +42 -0
  370. package/templates/sci-fi/event_94.json +42 -0
  371. package/templates/sci-fi/event_95.json +43 -0
  372. package/templates/sci-fi/event_96.json +43 -0
  373. package/templates/sci-fi/event_97.json +42 -0
  374. package/templates/space-opera/event_1.json +44 -0
  375. package/templates/space-opera/event_10.json +42 -0
  376. package/templates/space-opera/event_100.json +42 -0
  377. package/templates/space-opera/event_12.json +42 -0
  378. package/templates/space-opera/event_13.json +44 -0
  379. package/templates/space-opera/event_14.json +43 -0
  380. package/templates/space-opera/event_15.json +43 -0
  381. package/templates/space-opera/event_17.json +42 -0
  382. package/templates/space-opera/event_18.json +43 -0
  383. package/templates/space-opera/event_19.json +42 -0
  384. package/templates/space-opera/event_20.json +43 -0
  385. package/templates/space-opera/event_21.json +42 -0
  386. package/templates/space-opera/event_24.json +44 -0
  387. package/templates/space-opera/event_25.json +42 -0
  388. package/templates/space-opera/event_26.json +43 -0
  389. package/templates/space-opera/event_27.json +43 -0
  390. package/templates/space-opera/event_28.json +43 -0
  391. package/templates/space-opera/event_29.json +44 -0
  392. package/templates/space-opera/event_31.json +42 -0
  393. package/templates/space-opera/event_32.json +42 -0
  394. package/templates/space-opera/event_33.json +42 -0
  395. package/templates/space-opera/event_35.json +42 -0
  396. package/templates/space-opera/event_36.json +44 -0
  397. package/templates/space-opera/event_38.json +43 -0
  398. package/templates/space-opera/event_40.json +42 -0
  399. package/templates/space-opera/event_41.json +42 -0
  400. package/templates/space-opera/event_43.json +43 -0
  401. package/templates/space-opera/event_44.json +42 -0
  402. package/templates/space-opera/event_47.json +42 -0
  403. package/templates/space-opera/event_48.json +43 -0
  404. package/templates/space-opera/event_49.json +44 -0
  405. package/templates/space-opera/event_5.json +44 -0
  406. package/templates/space-opera/event_50.json +42 -0
  407. package/templates/space-opera/event_51.json +42 -0
  408. package/templates/space-opera/event_52.json +42 -0
  409. package/templates/space-opera/event_53.json +43 -0
  410. package/templates/space-opera/event_55.json +42 -0
  411. package/templates/space-opera/event_58.json +43 -0
  412. package/templates/space-opera/event_6.json +43 -0
  413. package/templates/space-opera/event_60.json +44 -0
  414. package/templates/space-opera/event_61.json +42 -0
  415. package/templates/space-opera/event_62.json +43 -0
  416. package/templates/space-opera/event_65.json +42 -0
  417. package/templates/space-opera/event_67.json +42 -0
  418. package/templates/space-opera/event_68.json +43 -0
  419. package/templates/space-opera/event_69.json +42 -0
  420. package/templates/space-opera/event_7.json +44 -0
  421. package/templates/space-opera/event_71.json +44 -0
  422. package/templates/space-opera/event_73.json +42 -0
  423. package/templates/space-opera/event_74.json +42 -0
  424. package/templates/space-opera/event_77.json +43 -0
  425. package/templates/space-opera/event_78.json +43 -0
  426. package/templates/space-opera/event_8.json +43 -0
  427. package/templates/space-opera/event_81.json +42 -0
  428. package/templates/space-opera/event_82.json +42 -0
  429. package/templates/space-opera/event_83.json +43 -0
  430. package/templates/space-opera/event_85.json +42 -0
  431. package/templates/space-opera/event_87.json +42 -0
  432. package/templates/space-opera/event_88.json +42 -0
  433. package/templates/space-opera/event_90.json +42 -0
  434. package/templates/space-opera/event_93.json +43 -0
  435. package/templates/space-opera/event_97.json +42 -0
  436. package/templates/space-opera/event_98.json +43 -0
package/README.md CHANGED
@@ -1,7 +1,16 @@
1
- # RPG Event Generator
1
+ # RPG Event Generator v2.0.0
2
2
 
3
3
  A powerful procedural event generation system for RPG games, capable of creating virtually infinite contextual events based on player state and game world.
4
4
 
5
+ ## ✨ What's New in v2.0.0
6
+
7
+ - 🎨 **Theme Creator**: Build custom themes with your own training data
8
+ - 🧠 **Rule Engine**: Create conditional rules that modify event generation
9
+ - 🎲 **Pure Markov Mode**: Generate events purely from custom text (no templates)
10
+ - 🌐 **Cross-Platform Export**: Unity C#, Godot GDScript, TypeScript support
11
+ - 📚 **Template Library**: 429 professionally crafted event templates included across 7 genres (fantasy, sci-fi, horror, historical, modern, cyberpunk, space-opera)
12
+ - 🏗️ **Creative Tools**: Visual tools for event customization
13
+
5
14
  > **Note:** This package was originally created for a personal RPG project and shared publicly because it might be useful for other game developers. The repository is private, so bug reports and maintenance issues cannot be submitted directly. Check npm regularly for updates, new features, or breaking changes.
6
15
 
7
16
  ## Installation
@@ -30,9 +39,13 @@ console.log(event.choices); // Array of meaningful choices
30
39
 
31
40
  ## Demo
32
41
 
33
- Run the included `demo.js` file to see the RPG Event Generator in action:
42
+ Run the included demo to see the RPG Event Generator in action:
34
43
 
35
44
  ```bash
45
+ # Using npm script (recommended)
46
+ npm run demo
47
+
48
+ # Direct script call
36
49
  node demo.js
37
50
  ```
38
51
 
@@ -60,12 +73,182 @@ Since this is a personal project with a private repository:
60
73
  - **Game Integration**: Proper save/load state management for real games
61
74
  - **Comprehensive Testing**: 45+ automated tests ensuring reliability
62
75
 
63
- ### Enhanced Features (v1.2.0)
76
+ ### Enhanced Features (v1.2.0+)
64
77
 
65
78
  - **Multi-Language Support**: Generate events in different languages with cultural adaptation
66
79
  - **Event Dependencies**: Complex prerequisite systems for event triggering
67
80
  - **Environmental Modifiers**: Weather, season, and location-based event modifications
68
81
  - **NPC Relationships**: Dynamic character relationship networks and social consequences
82
+ - **Event Templates Library** (v1.3.0): Pre-built genre-specific event collections for fantasy, sci-fi, horror, and historical themes, with support for custom template creation
83
+
84
+ ### Revolutionary Features (v2.0.0) 🎉
85
+
86
+ - **🎨 Theme Creator**: Design custom game worlds with your own training data and atmospheric text
87
+ - **🧠 Rule Engine**: Create sophisticated conditional rules that dynamically modify events based on player state, location, stats, and more
88
+ - **🎲 Pure Markov Mode**: Generate completely custom events using only your provided text - no templates required
89
+ - **💰 Event Economy**: User-generated content marketplace with theme sharing, rule packs, and quality metrics
90
+ - **📚 Template Library**: Generate hundreds of events across 7 genres using included CLI export tools
91
+ - **🌐 Cross-Platform Export**: Export events in JSON and TypeScript formats (Unity/Godot integration guides available)
92
+ - **⚙️ Creative Tools**: Visual interfaces for theme building, rule creation, and advanced customization
93
+
94
+ ### Planned Engine Integrations (Future Release)
95
+
96
+ - **🎮 Unity Plugin**: Package Manager compatible integration (planned)
97
+ - **🎯 Godot Addon**: Asset Library compatible addon (planned)
98
+ - **🔗 Game Engine Guides**: Integration patterns and API examples available now
99
+
100
+ ## Event Economy System 💰
101
+
102
+ The Event Economy enables **user-generated content sharing** and marketplace functionality for custom themes, rules, and content packs.
103
+
104
+ ### Key Features
105
+
106
+ - **🎨 Theme Marketplace**: Save, share, and import custom themes with training data
107
+ - **🧠 Rule Pack Sharing**: Exchange collections of custom rules between users
108
+ - **📦 Content Packs**: Bundle themes and rules into complete game configurations
109
+ - **⭐ Quality Metrics**: Automatic quality scoring for shared content
110
+ - **📤 Export/Import**: Easy sharing via JSON files
111
+
112
+ ### Basic Usage
113
+
114
+ ```javascript
115
+ const EventEconomy = require('./scripts/event-economy');
116
+
117
+ // Initialize the system
118
+ const economy = new EventEconomy('./my-user-content');
119
+
120
+ // Save a custom theme
121
+ const themeData = {
122
+ author: 'YourName',
123
+ description: 'Cyberpunk western theme',
124
+ tags: ['cyberpunk', 'western', 'scifi'],
125
+ theme: 'cyberpunk',
126
+ culture: 'western',
127
+ trainingData: [
128
+ 'neon signs flicker in the dusty saloon',
129
+ 'robotic sheriffs patrol the asteroid streets',
130
+ 'cyborg outlaws ride mechanical horses'
131
+ ],
132
+ enableRuleEngine: true,
133
+ customRules: [] // your custom rules here
134
+ };
135
+
136
+ const filepath = economy.saveTheme('CyberWestern', themeData);
137
+ console.log(`Theme saved to: ${filepath}); // ./my-user-content/themes/cyberwestern.json
138
+
139
+ // List available themes
140
+ const themes = economy.listThemes();
141
+ console.log('Available themes:', themes);
142
+
143
+ // Load and use a theme
144
+ const loadedTheme = economy.loadTheme('CyberWestern');
145
+ // Use with generator...
146
+ ```
147
+
148
+ ### CLI Tools
149
+
150
+ The Event Economy includes command-line tools for content management:
151
+
152
+ ```bash
153
+ # Using npm scripts (recommended)
154
+ npm run economy:list
155
+ npm run economy:stats
156
+
157
+ # Using direct script calls
158
+ node scripts/event-economy.js list-themes
159
+ node scripts/event-economy.js stats
160
+
161
+ # Save a theme (API integration needed)
162
+ node scripts/event-economy.js save-theme "MyTheme"
163
+ ```
164
+
165
+ For global installation, you can also use:
166
+ ```bash
167
+ npx rpg-events list-themes
168
+ npx rpg-export unity fantasy
169
+ ```
170
+
171
+ ### Content Pack Creation
172
+
173
+ ```javascript
174
+ // Create a complete content pack
175
+ const packData = {
176
+ author: 'ContentCreator',
177
+ description: 'Complete cyberpunk western adventure pack',
178
+ theme: themeData, // include your theme
179
+ rulePacks: ['combat-rules', 'dialogue-rules'] // reference rule packs
180
+ };
181
+
182
+ const packPath = economy.createContentPack('CyberWesternAdventure', packData);
183
+ ```
184
+
185
+ ### File Formats
186
+
187
+ #### Theme Files (`themes/*.json`)
188
+ ```json
189
+ {
190
+ "name": "CyberWestern",
191
+ "version": "1.0.0",
192
+ "author": "YourName",
193
+ "description": "Cyberpunk western theme",
194
+ "tags": ["cyberpunk", "western"],
195
+ "settings": {
196
+ "theme": "cyberpunk",
197
+ "culture": "western",
198
+ "enableRuleEngine": true,
199
+ "pureMarkovMode": false
200
+ },
201
+ "trainingData": ["sentence 1", "sentence 2"],
202
+ "customRules": [],
203
+ "statistics": {
204
+ "trainingSentences": 2,
205
+ "estimatedQuality": 85
206
+ }
207
+ }
208
+ ```
209
+
210
+ #### Rule Pack Files (`rules/*.json`)
211
+ ```json
212
+ {
213
+ "name": "CombatRules",
214
+ "rules": [
215
+ {
216
+ "name": "weak_enemy_bonus",
217
+ "conditions": [
218
+ {"type": "stat_less_than", "stat": "level", "value": 5}
219
+ ],
220
+ "effects": [
221
+ {"type": "modify_difficulty", "value": -1}
222
+ ]
223
+ }
224
+ ]
225
+ }
226
+ ```
227
+
228
+ ### Quality Metrics
229
+
230
+ Themes are automatically scored on:
231
+ - **Training Data Quality**: Sentence variety and length
232
+ - **Rule Complexity**: Advanced rule usage
233
+ - **Completeness**: All required fields present
234
+ - **Metadata**: Author info, tags, descriptions
235
+
236
+ ### Integration with Generator
237
+
238
+ ```javascript
239
+ // Load theme and apply to generator
240
+ const theme = economy.loadTheme('CyberWestern');
241
+ const generator = new RPGEventGenerator({
242
+ theme: theme.settings.theme,
243
+ culture: theme.settings.culture,
244
+ trainingData: theme.trainingData,
245
+ customRules: theme.customRules,
246
+ enableRuleEngine: theme.settings.enableRuleEngine
247
+ });
248
+
249
+ // Generate events with custom theme
250
+ const event = generator.generateEvent();
251
+ ```
69
252
 
70
253
  ## Usage Guide
71
254
 
@@ -312,6 +495,74 @@ const event = generator.generateEnhancedEvent({
312
495
  });
313
496
  ```
314
497
 
498
+ ### Event Templates Library (v1.3.0)
499
+
500
+ Use the included library of 429 professionally crafted event templates across 7 genres:
501
+
502
+ ```javascript
503
+ const generator = new RPGEventGenerator({
504
+ enableTemplates: true,
505
+ templateLibrary: 'fantasy' // Load fantasy templates
506
+ });
507
+
508
+ // Generate from specific template
509
+ const dragonEvent = generator.generateFromTemplate('dragon_lair');
510
+ console.log(dragonEvent.title); // "Ancient Dragon's Lair"
511
+
512
+ // Generate random event from genre
513
+ const fantasyEvent = generator.generateFromGenre('fantasy');
514
+
515
+ // Discover available templates
516
+ const availableTemplates = generator.getAvailableTemplates();
517
+ console.log(Object.keys(availableTemplates)); // ['fantasy', 'sci-fi', etc.]
518
+ ```
519
+
520
+ You can also export templates to other formats using CLI tools:
521
+
522
+ ```bash
523
+ # Export templates for different engines
524
+ npm run export:unity fantasy # Unity C# ScriptableObjects
525
+ npm run export:godot cyberpunk # Godot GDScript Resources
526
+ npm run export:typescript space-opera # TypeScript interfaces
527
+ ```
528
+
529
+ Each template includes:
530
+ - **Rich narratives** with atmospheric descriptions
531
+ - **Multiple meaningful choices** with consequences
532
+ - **Difficulty scaling** and context requirements
533
+ - **Professional quality** event design
534
+
535
+ **Available genres**: 'fantasy', 'sci-fi', 'horror', 'historical', 'modern', 'cyberpunk', 'space-opera'
536
+
537
+ #### Custom Template Creation
538
+ Add your own templates to the library system:
539
+
540
+ ```javascript
541
+ // Create a custom template
542
+ const myTemplate = {
543
+ title: 'Space Station Malfunction',
544
+ narrative: 'Critical system failure detected. Alarms blare throughout the station.',
545
+ choices: [
546
+ {
547
+ text: 'Attempt emergency repair',
548
+ effect: { risk: 30, engineering: 20 },
549
+ consequence: 'repair_attempt'
550
+ },
551
+ {
552
+ text: 'Abandon the station',
553
+ effect: { survival: 10, resources: -50 },
554
+ consequence: 'abandon_station'
555
+ }
556
+ ],
557
+ type: 'TECHNICAL_CRISIS',
558
+ difficulty: 'hard',
559
+ tags: ['space', 'technology', 'emergency']
560
+ };
561
+
562
+ // Add to your game's template collection
563
+ // Templates can be saved as JSON files in custom directories
564
+ ```
565
+
315
566
  ### Modular Event System
316
567
 
317
568
  ```javascript
@@ -519,9 +770,296 @@ const generator = new RPGEventGenerator({
519
770
  urgency: "normal",
520
771
  theme: "adventure",
521
772
  difficulty: "normal"
773
+
774
+ }
775
+ ```
776
+
777
+ ## 🎨 v2.0.0 Theme Creator
778
+
779
+ Create completely custom game worlds with your own atmospheric text and storytelling style.
780
+
781
+ ### Custom Theme Creation
782
+
783
+ ```javascript
784
+ const generator = new RPGEventGenerator({
785
+ trainingData: [
786
+ 'Space cowboys patrol asteroid fields on mechanical horses',
787
+ 'Neon-lit cantinas echo with the hum of quantum pianos',
788
+ 'Laser revolvers fire streams of pure starlight',
789
+ 'Alien saloons serve drinks that change your memories',
790
+ 'Robotic sheriffs maintain order in floating colonies'
791
+ ],
792
+ theme: 'sci-fi',
793
+ culture: 'western'
794
+ });
795
+
796
+ // Events will incorporate your custom atmosphere
797
+ const event = generator.generateEvent({
798
+ career: 'gunslinger',
799
+ location: 'asteroid-town'
800
+ });
801
+ ```
802
+
803
+ ### Pure Markov Mode
804
+
805
+ Generate events using only your custom training data - completely bypassing templates.
806
+
807
+ ```javascript
808
+ const pureGenerator = new RPGEventGenerator({
809
+ trainingData: [
810
+ 'Crystal caves echo with ancient magic',
811
+ 'Shadowy figures move through fog-shrouded forests',
812
+ 'Forgotten ruins hide treasures and traps',
813
+ 'Mysterious merchants offer enchanted artifacts',
814
+ 'Wandering bards sing tales of lost kingdoms'
815
+ ],
816
+ pureMarkovMode: true, // No templates used
817
+ enableTemplates: false
818
+ });
819
+
820
+ // Generates events purely from your text
821
+ const event = pureGenerator.generateEvent();
822
+ // Type: "MARKOV_GENERATED"
823
+ // Title: "Crystal caves echo with ancient magic."
824
+ // Description: Generated purely from your atmospheric training sentences
825
+ ```
826
+
827
+ ## 🧠 v2.0.0 Rule Engine
828
+
829
+ Create intelligent, conditional rules that modify events based on player state and game context.
830
+
831
+ ### Basic Rule Creation
832
+
833
+ ```javascript
834
+ const generator = new RPGEventGenerator({
835
+ enableRuleEngine: true
836
+ });
837
+
838
+ // Add a wealthy player bonus
839
+ generator.addCustomRule('wealthy_bonus', {
840
+ conditions: [
841
+ { type: 'stat_greater_than', params: { stat: 'gold', value: 1000 } }
842
+ ],
843
+ effects: {
844
+ addTags: ['wealthy_player'],
845
+ modifyChoices: {
846
+ multiply: { gold: 1.3 }, // 30% more gold rewards
847
+ add: { reputation: 5 } // Bonus reputation
848
+ }
849
+ }
850
+ });
851
+
852
+ // Events for wealthy players get enhanced
853
+ const wealthyEvent = generator.generateEvent({ gold: 2000 });
854
+ console.log(wealthyEvent.tags); // Includes 'wealthy_player'
855
+ ```
856
+
857
+ ### Advanced Rule Conditions
858
+
859
+ ```javascript
860
+ // Complex conditional logic
861
+ generator.addCustomRule('noble_intrigue', {
862
+ conditions: [
863
+ { type: 'and', params: {
864
+ conditions: [
865
+ { type: 'career_is', params: { career: 'noble' } },
866
+ { type: 'location_is', params: { location: 'castle' } },
867
+ { type: 'stat_greater_than', params: { stat: 'influence', value: 50 } }
868
+ ]
869
+ }}
870
+ ],
871
+ effects: {
872
+ modifyTitle: { append: ' (Royal Privilege)' },
873
+ setDifficulty: 'hard',
874
+ addTags: ['noble_bonus', 'court_influence']
875
+ }
876
+ });
877
+
878
+ // Available condition types:
879
+ // - stat_greater_than, stat_less_than, stat_between
880
+ // - location_is, season_is, career_is, time_greater_than
881
+ // - has_item, relationship_status
882
+ // - random_chance
883
+ // - and, or, not (for combining conditions)
884
+ ```
885
+
886
+ ### Rule Management
887
+
888
+ ```javascript
889
+ // Validate rules before adding
890
+ const rule = { /* your rule */ };
891
+ const validation = generator.validateCustomRule(rule);
892
+ if (validation.valid) {
893
+ generator.addCustomRule('my_rule', rule);
894
+ } else {
895
+ console.log('Rule errors:', validation.errors);
522
896
  }
897
+
898
+ // Manage rules
899
+ console.log(generator.getCustomRules()); // View all rules
900
+ generator.removeCustomRule('my_rule'); // Remove specific rule
901
+ generator.clearCustomRules(); // Remove all rules
902
+ ```
903
+
904
+ ## 🌐 v2.0.0 Cross-Platform Export
905
+
906
+ Export your events directly to game engines.
907
+
908
+ ### Unity Integration
909
+
910
+ ```javascript
911
+ // Programmatic export
912
+ const exporter = require('./scripts/export-templates.js');
913
+ exporter.exportTemplates('unity', 'fantasy');
914
+
915
+ // Creates: templates/unity/fantasy/event_1.cs
916
+ // Result: Event1.cs - Unity ScriptableObject
917
+ ```
918
+
919
+ ```bash
920
+ # Using npm scripts
921
+ npm run export:unity fantasy
922
+
923
+ # Direct script call
924
+ node scripts/export-templates.js unity fantasy
523
925
  ```
524
926
 
927
+ ### Godot Integration
928
+
929
+ ```javascript
930
+ // Export for Godot
931
+ const exporter = require('./scripts/export-templates.js');
932
+ exporter.exportTemplates('godot', 'cyberpunk');
933
+
934
+ // Creates: templates/godot/cyberpunk/event_1.gd
935
+ // Result: Event1.gd - Godot Resource script
936
+ ```
937
+
938
+ ```bash
939
+ # Using npm scripts
940
+ npm run export:godot cyberpunk
941
+
942
+ # Direct script call
943
+ node scripts/export-templates.js godot cyberpunk
944
+ ```
945
+
946
+ ### TypeScript Support
947
+
948
+ ```javascript
949
+ // Export as TypeScript interfaces
950
+ const exporter = require('./scripts/export-templates.js');
951
+ exporter.exportTemplates('typescript', 'space-opera');
952
+
953
+ // Creates: templates/typescript/space-opera/event_1.ts
954
+ // Result: Strongly-typed event definitions
955
+ ```
956
+
957
+ ```bash
958
+ # Using npm scripts
959
+ npm run export:typescript space-opera
960
+
961
+ # Direct script call
962
+ node scripts/export-templates.js typescript space-opera
963
+ ```
964
+
965
+ ## 📊 v2.0.0 Enhanced Template Library
966
+
967
+ Generate 400+ professionally crafted events across 7 genres:
968
+
969
+ - **Fantasy**: Knights, dragons, magic, medieval politics
970
+ - **Sci-Fi**: Space exploration, technology, alien encounters
971
+ - **Horror**: Supernatural terror, psychological horror
972
+ - **Historical**: Medieval courts, exploration, diplomacy
973
+ - **Modern**: Contemporary settings, urban adventures
974
+ - **Cyberpunk**: Neon cities, hackers, megacorporations
975
+ - **Space Opera**: Galactic empires, starships, cosmic conflicts
976
+
977
+ ### Template Integration
978
+
979
+ ```javascript
980
+ // Load genre-specific templates
981
+ const fantasyGen = new RPGEventGenerator({
982
+ enableTemplates: true,
983
+ templateLibrary: 'fantasy'
984
+ });
985
+
986
+ // Generate from specific genre
987
+ const fantasyEvent = fantasyGen.generateFromGenre('fantasy');
988
+ const horrorEvent = fantasyGen.generateFromTemplate('haunted_mansion');
989
+
990
+ // Available templates
991
+ console.log(fantasyGen.getAvailableTemplates());
992
+ // { fantasy: [...], sci-fi: [...], horror: [...], etc. }
993
+ ```
994
+
995
+ ## 🎯 v2.0.0 API Reference
996
+
997
+ ### Constructor Options (v2.0.0 additions)
998
+
999
+ ```javascript
1000
+ const generator = new RPGEventGenerator({
1001
+ // v1.x options still supported
1002
+ theme: 'fantasy',
1003
+ culture: 'norse',
1004
+ trainingData: [...],
1005
+ enableModifiers: true,
1006
+
1007
+ // v2.0.0 new options
1008
+ enableRuleEngine: true, // Enable custom rules system
1009
+ customRules: {}, // Pre-load custom rules
1010
+ pureMarkovMode: false, // Generate purely from training data
1011
+ templateLibrary: null // Load specific template genre
1012
+ });
1013
+ ```
1014
+
1015
+ ### New Methods (v2.0.0)
1016
+
1017
+ ```javascript
1018
+ // Rule Engine
1019
+ generator.addCustomRule(name, ruleDefinition);
1020
+ generator.removeCustomRule(name);
1021
+ generator.getCustomRules();
1022
+ generator.clearCustomRules();
1023
+ generator.validateCustomRule(rule);
1024
+
1025
+ // Template System
1026
+ generator.generateFromTemplate(templateId);
1027
+ generator.generateFromGenre(genre);
1028
+ generator.getAvailableTemplates();
1029
+
1030
+ // Export System (via export-templates.js)
1031
+ exporter.exportTemplates('unity', 'fantasy');
1032
+ exporter.exportTemplates('godot', 'cyberpunk');
1033
+ exporter.exportTemplates('typescript', 'space-opera');
1034
+ ```
1035
+
1036
+ ## 🔄 v2.0.0 Migration Guide
1037
+
1038
+ ### From v1.x to v2.0.0
1039
+
1040
+ **✅ Fully Backward Compatible**
1041
+ - All existing code continues to work unchanged
1042
+ - v1.x features remain fully functional
1043
+ - No breaking changes to existing API
1044
+
1045
+ **🚀 New Features are Opt-in**
1046
+ ```javascript
1047
+ // v1.x code - still works perfectly
1048
+ const generator = new RPGEventGenerator();
1049
+
1050
+ // v2.0.0 enhancements - opt-in only
1051
+ const enhancedGenerator = new RPGEventGenerator({
1052
+ enableRuleEngine: true, // New feature
1053
+ pureMarkovMode: false, // New feature
1054
+ templateLibrary: 'fantasy' // Enhanced feature
1055
+ });
1056
+ ```
1057
+
1058
+ **📈 Performance Improvements**
1059
+ - Optimized rule evaluation
1060
+ - Efficient template loading
1061
+ - Better memory management for large template libraries
1062
+
525
1063
  ## 🎮 Game Integration
526
1064
 
527
1065
  ### Real-Time Strategy Integration
@@ -688,7 +1226,7 @@ function loadGame() {
688
1226
  npm test
689
1227
  ```
690
1228
 
691
- **Comprehensive test coverage (45+ tests):**
1229
+ **Comprehensive test coverage (70+ tests):**
692
1230
  - ✅ Core event generation and validation
693
1231
  - ✅ Context adaptation and player responsiveness
694
1232
  - ✅ Thematic systems and cultural variants
@@ -698,6 +1236,12 @@ npm test
698
1236
  - ✅ Modular features and custom content
699
1237
  - ✅ Edge cases and error handling
700
1238
  - ✅ Game state persistence and integration
1239
+ - ✅ **Event Economy system (25+ tests)**
1240
+ - Theme saving/loading/export/import
1241
+ - Rule pack management
1242
+ - Content pack creation
1243
+ - Quality metrics and statistics
1244
+ - File I/O operations and validation
701
1245
 
702
1246
  ## 🎯 Event Types
703
1247