rpg-event-generator 1.3.0 → 2.0.1

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 (431) hide show
  1. package/README.md +507 -7
  2. package/demo.js +153 -4
  3. package/dist/index.js +394 -11
  4. package/package.json +16 -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/event_1.json +44 -0
  67. package/templates/fantasy/event_10.json +43 -0
  68. package/templates/fantasy/event_11.json +43 -0
  69. package/templates/fantasy/event_12.json +42 -0
  70. package/templates/fantasy/event_13.json +43 -0
  71. package/templates/fantasy/event_16.json +44 -0
  72. package/templates/fantasy/event_20.json +42 -0
  73. package/templates/fantasy/event_21.json +42 -0
  74. package/templates/fantasy/event_22.json +42 -0
  75. package/templates/fantasy/event_23.json +42 -0
  76. package/templates/fantasy/event_24.json +43 -0
  77. package/templates/fantasy/event_27.json +43 -0
  78. package/templates/fantasy/event_29.json +43 -0
  79. package/templates/fantasy/event_3.json +42 -0
  80. package/templates/fantasy/event_30.json +43 -0
  81. package/templates/fantasy/event_31.json +42 -0
  82. package/templates/fantasy/event_33.json +42 -0
  83. package/templates/fantasy/event_34.json +43 -0
  84. package/templates/fantasy/event_36.json +43 -0
  85. package/templates/fantasy/event_38.json +43 -0
  86. package/templates/fantasy/event_39.json +42 -0
  87. package/templates/fantasy/event_4.json +44 -0
  88. package/templates/fantasy/event_41.json +43 -0
  89. package/templates/fantasy/event_44.json +42 -0
  90. package/templates/fantasy/event_45.json +42 -0
  91. package/templates/fantasy/event_46.json +42 -0
  92. package/templates/fantasy/event_47.json +42 -0
  93. package/templates/fantasy/event_48.json +42 -0
  94. package/templates/fantasy/event_5.json +42 -0
  95. package/templates/fantasy/event_50.json +44 -0
  96. package/templates/fantasy/event_51.json +43 -0
  97. package/templates/fantasy/event_54.json +43 -0
  98. package/templates/fantasy/event_55.json +43 -0
  99. package/templates/fantasy/event_57.json +44 -0
  100. package/templates/fantasy/event_58.json +44 -0
  101. package/templates/fantasy/event_6.json +42 -0
  102. package/templates/fantasy/event_64.json +42 -0
  103. package/templates/fantasy/event_68.json +42 -0
  104. package/templates/fantasy/event_69.json +43 -0
  105. package/templates/fantasy/event_70.json +42 -0
  106. package/templates/fantasy/event_71.json +42 -0
  107. package/templates/fantasy/event_72.json +43 -0
  108. package/templates/fantasy/event_73.json +42 -0
  109. package/templates/fantasy/event_76.json +43 -0
  110. package/templates/fantasy/event_77.json +43 -0
  111. package/templates/fantasy/event_79.json +42 -0
  112. package/templates/fantasy/event_88.json +42 -0
  113. package/templates/fantasy/event_9.json +44 -0
  114. package/templates/fantasy/event_90.json +43 -0
  115. package/templates/fantasy/event_91.json +42 -0
  116. package/templates/fantasy/event_92.json +42 -0
  117. package/templates/fantasy/event_94.json +43 -0
  118. package/templates/fantasy/event_96.json +42 -0
  119. package/templates/fantasy/event_97.json +42 -0
  120. package/templates/fantasy/event_98.json +42 -0
  121. package/templates/fantasy/event_99.json +42 -0
  122. package/templates/historical/event_1.json +44 -0
  123. package/templates/historical/event_10.json +42 -0
  124. package/templates/historical/event_11.json +44 -0
  125. package/templates/historical/event_14.json +44 -0
  126. package/templates/historical/event_17.json +44 -0
  127. package/templates/historical/event_2.json +43 -0
  128. package/templates/historical/event_20.json +43 -0
  129. package/templates/historical/event_21.json +44 -0
  130. package/templates/historical/event_22.json +43 -0
  131. package/templates/historical/event_25.json +43 -0
  132. package/templates/historical/event_26.json +42 -0
  133. package/templates/historical/event_3.json +43 -0
  134. package/templates/historical/event_30.json +42 -0
  135. package/templates/historical/event_33.json +44 -0
  136. package/templates/historical/event_34.json +42 -0
  137. package/templates/historical/event_39.json +42 -0
  138. package/templates/historical/event_4.json +44 -0
  139. package/templates/historical/event_40.json +42 -0
  140. package/templates/historical/event_42.json +42 -0
  141. package/templates/historical/event_44.json +43 -0
  142. package/templates/historical/event_45.json +43 -0
  143. package/templates/historical/event_48.json +42 -0
  144. package/templates/historical/event_50.json +42 -0
  145. package/templates/historical/event_52.json +42 -0
  146. package/templates/historical/event_53.json +44 -0
  147. package/templates/historical/event_54.json +44 -0
  148. package/templates/historical/event_56.json +42 -0
  149. package/templates/historical/event_57.json +42 -0
  150. package/templates/historical/event_59.json +42 -0
  151. package/templates/historical/event_60.json +43 -0
  152. package/templates/historical/event_61.json +42 -0
  153. package/templates/historical/event_62.json +44 -0
  154. package/templates/historical/event_63.json +42 -0
  155. package/templates/historical/event_64.json +43 -0
  156. package/templates/historical/event_65.json +44 -0
  157. package/templates/historical/event_66.json +42 -0
  158. package/templates/historical/event_67.json +43 -0
  159. package/templates/historical/event_69.json +43 -0
  160. package/templates/historical/event_7.json +42 -0
  161. package/templates/historical/event_70.json +42 -0
  162. package/templates/historical/event_71.json +43 -0
  163. package/templates/historical/event_74.json +42 -0
  164. package/templates/historical/event_75.json +43 -0
  165. package/templates/historical/event_79.json +42 -0
  166. package/templates/historical/event_8.json +44 -0
  167. package/templates/historical/event_80.json +43 -0
  168. package/templates/historical/event_82.json +42 -0
  169. package/templates/historical/event_87.json +43 -0
  170. package/templates/historical/event_89.json +43 -0
  171. package/templates/historical/event_9.json +43 -0
  172. package/templates/historical/event_90.json +44 -0
  173. package/templates/historical/event_91.json +42 -0
  174. package/templates/historical/event_92.json +43 -0
  175. package/templates/historical/event_94.json +42 -0
  176. package/templates/historical/event_97.json +42 -0
  177. package/templates/horror/event_1.json +42 -0
  178. package/templates/horror/event_100.json +42 -0
  179. package/templates/horror/event_12.json +42 -0
  180. package/templates/horror/event_13.json +43 -0
  181. package/templates/horror/event_14.json +44 -0
  182. package/templates/horror/event_15.json +42 -0
  183. package/templates/horror/event_16.json +43 -0
  184. package/templates/horror/event_17.json +43 -0
  185. package/templates/horror/event_18.json +42 -0
  186. package/templates/horror/event_2.json +44 -0
  187. package/templates/horror/event_20.json +43 -0
  188. package/templates/horror/event_23.json +42 -0
  189. package/templates/horror/event_27.json +43 -0
  190. package/templates/horror/event_28.json +42 -0
  191. package/templates/horror/event_29.json +42 -0
  192. package/templates/horror/event_3.json +42 -0
  193. package/templates/horror/event_30.json +42 -0
  194. package/templates/horror/event_32.json +42 -0
  195. package/templates/horror/event_34.json +42 -0
  196. package/templates/horror/event_35.json +43 -0
  197. package/templates/horror/event_36.json +43 -0
  198. package/templates/horror/event_37.json +43 -0
  199. package/templates/horror/event_38.json +44 -0
  200. package/templates/horror/event_39.json +42 -0
  201. package/templates/horror/event_40.json +42 -0
  202. package/templates/horror/event_41.json +42 -0
  203. package/templates/horror/event_42.json +43 -0
  204. package/templates/horror/event_43.json +43 -0
  205. package/templates/horror/event_45.json +42 -0
  206. package/templates/horror/event_46.json +44 -0
  207. package/templates/horror/event_47.json +42 -0
  208. package/templates/horror/event_50.json +43 -0
  209. package/templates/horror/event_52.json +44 -0
  210. package/templates/horror/event_53.json +43 -0
  211. package/templates/horror/event_55.json +43 -0
  212. package/templates/horror/event_56.json +44 -0
  213. package/templates/horror/event_58.json +42 -0
  214. package/templates/horror/event_59.json +42 -0
  215. package/templates/horror/event_60.json +43 -0
  216. package/templates/horror/event_61.json +44 -0
  217. package/templates/horror/event_62.json +42 -0
  218. package/templates/horror/event_63.json +43 -0
  219. package/templates/horror/event_65.json +42 -0
  220. package/templates/horror/event_67.json +43 -0
  221. package/templates/horror/event_68.json +44 -0
  222. package/templates/horror/event_72.json +42 -0
  223. package/templates/horror/event_73.json +44 -0
  224. package/templates/horror/event_74.json +43 -0
  225. package/templates/horror/event_77.json +42 -0
  226. package/templates/horror/event_79.json +43 -0
  227. package/templates/horror/event_8.json +42 -0
  228. package/templates/horror/event_82.json +43 -0
  229. package/templates/horror/event_83.json +42 -0
  230. package/templates/horror/event_84.json +42 -0
  231. package/templates/horror/event_86.json +43 -0
  232. package/templates/horror/event_88.json +42 -0
  233. package/templates/horror/event_89.json +43 -0
  234. package/templates/horror/event_9.json +43 -0
  235. package/templates/horror/event_90.json +44 -0
  236. package/templates/horror/event_91.json +43 -0
  237. package/templates/horror/event_93.json +42 -0
  238. package/templates/horror/event_95.json +42 -0
  239. package/templates/horror/event_96.json +43 -0
  240. package/templates/horror/event_99.json +42 -0
  241. package/templates/index.json +445 -5
  242. package/templates/modern/event_10.json +42 -0
  243. package/templates/modern/event_100.json +43 -0
  244. package/templates/modern/event_11.json +44 -0
  245. package/templates/modern/event_13.json +42 -0
  246. package/templates/modern/event_15.json +43 -0
  247. package/templates/modern/event_16.json +42 -0
  248. package/templates/modern/event_17.json +42 -0
  249. package/templates/modern/event_19.json +43 -0
  250. package/templates/modern/event_2.json +42 -0
  251. package/templates/modern/event_20.json +42 -0
  252. package/templates/modern/event_21.json +43 -0
  253. package/templates/modern/event_22.json +43 -0
  254. package/templates/modern/event_23.json +43 -0
  255. package/templates/modern/event_25.json +43 -0
  256. package/templates/modern/event_27.json +42 -0
  257. package/templates/modern/event_28.json +42 -0
  258. package/templates/modern/event_31.json +42 -0
  259. package/templates/modern/event_32.json +43 -0
  260. package/templates/modern/event_34.json +44 -0
  261. package/templates/modern/event_35.json +42 -0
  262. package/templates/modern/event_36.json +44 -0
  263. package/templates/modern/event_37.json +42 -0
  264. package/templates/modern/event_39.json +42 -0
  265. package/templates/modern/event_4.json +42 -0
  266. package/templates/modern/event_41.json +42 -0
  267. package/templates/modern/event_42.json +44 -0
  268. package/templates/modern/event_43.json +42 -0
  269. package/templates/modern/event_44.json +44 -0
  270. package/templates/modern/event_45.json +44 -0
  271. package/templates/modern/event_46.json +44 -0
  272. package/templates/modern/event_47.json +43 -0
  273. package/templates/modern/event_48.json +42 -0
  274. package/templates/modern/event_49.json +43 -0
  275. package/templates/modern/event_5.json +43 -0
  276. package/templates/modern/event_51.json +42 -0
  277. package/templates/modern/event_52.json +42 -0
  278. package/templates/modern/event_55.json +43 -0
  279. package/templates/modern/event_56.json +42 -0
  280. package/templates/modern/event_57.json +42 -0
  281. package/templates/modern/event_59.json +42 -0
  282. package/templates/modern/event_6.json +43 -0
  283. package/templates/modern/event_60.json +43 -0
  284. package/templates/modern/event_61.json +42 -0
  285. package/templates/modern/event_63.json +42 -0
  286. package/templates/modern/event_64.json +42 -0
  287. package/templates/modern/event_66.json +42 -0
  288. package/templates/modern/event_67.json +42 -0
  289. package/templates/modern/event_69.json +42 -0
  290. package/templates/modern/event_7.json +43 -0
  291. package/templates/modern/event_70.json +42 -0
  292. package/templates/modern/event_72.json +43 -0
  293. package/templates/modern/event_74.json +43 -0
  294. package/templates/modern/event_78.json +42 -0
  295. package/templates/modern/event_8.json +42 -0
  296. package/templates/modern/event_80.json +44 -0
  297. package/templates/modern/event_81.json +43 -0
  298. package/templates/modern/event_82.json +42 -0
  299. package/templates/modern/event_83.json +42 -0
  300. package/templates/modern/event_84.json +44 -0
  301. package/templates/modern/event_85.json +42 -0
  302. package/templates/modern/event_86.json +42 -0
  303. package/templates/modern/event_87.json +44 -0
  304. package/templates/modern/event_89.json +42 -0
  305. package/templates/modern/event_94.json +42 -0
  306. package/templates/modern/event_97.json +43 -0
  307. package/templates/modern/event_98.json +42 -0
  308. package/templates/modern/event_99.json +44 -0
  309. package/templates/schema.json +87 -0
  310. package/templates/sci-fi/event_1.json +42 -0
  311. package/templates/sci-fi/event_11.json +43 -0
  312. package/templates/sci-fi/event_13.json +43 -0
  313. package/templates/sci-fi/event_15.json +43 -0
  314. package/templates/sci-fi/event_18.json +42 -0
  315. package/templates/sci-fi/event_19.json +43 -0
  316. package/templates/sci-fi/event_2.json +44 -0
  317. package/templates/sci-fi/event_22.json +42 -0
  318. package/templates/sci-fi/event_23.json +42 -0
  319. package/templates/sci-fi/event_24.json +43 -0
  320. package/templates/sci-fi/event_25.json +42 -0
  321. package/templates/sci-fi/event_27.json +43 -0
  322. package/templates/sci-fi/event_28.json +43 -0
  323. package/templates/sci-fi/event_30.json +43 -0
  324. package/templates/sci-fi/event_31.json +42 -0
  325. package/templates/sci-fi/event_32.json +42 -0
  326. package/templates/sci-fi/event_33.json +44 -0
  327. package/templates/sci-fi/event_34.json +42 -0
  328. package/templates/sci-fi/event_35.json +42 -0
  329. package/templates/sci-fi/event_36.json +42 -0
  330. package/templates/sci-fi/event_37.json +44 -0
  331. package/templates/sci-fi/event_39.json +43 -0
  332. package/templates/sci-fi/event_4.json +43 -0
  333. package/templates/sci-fi/event_41.json +42 -0
  334. package/templates/sci-fi/event_45.json +42 -0
  335. package/templates/sci-fi/event_47.json +43 -0
  336. package/templates/sci-fi/event_48.json +42 -0
  337. package/templates/sci-fi/event_50.json +43 -0
  338. package/templates/sci-fi/event_51.json +42 -0
  339. package/templates/sci-fi/event_53.json +42 -0
  340. package/templates/sci-fi/event_54.json +43 -0
  341. package/templates/sci-fi/event_55.json +42 -0
  342. package/templates/sci-fi/event_56.json +43 -0
  343. package/templates/sci-fi/event_59.json +42 -0
  344. package/templates/sci-fi/event_6.json +42 -0
  345. package/templates/sci-fi/event_60.json +43 -0
  346. package/templates/sci-fi/event_64.json +44 -0
  347. package/templates/sci-fi/event_65.json +43 -0
  348. package/templates/sci-fi/event_67.json +42 -0
  349. package/templates/sci-fi/event_7.json +42 -0
  350. package/templates/sci-fi/event_72.json +42 -0
  351. package/templates/sci-fi/event_73.json +43 -0
  352. package/templates/sci-fi/event_74.json +44 -0
  353. package/templates/sci-fi/event_75.json +43 -0
  354. package/templates/sci-fi/event_78.json +42 -0
  355. package/templates/sci-fi/event_80.json +42 -0
  356. package/templates/sci-fi/event_82.json +43 -0
  357. package/templates/sci-fi/event_83.json +44 -0
  358. package/templates/sci-fi/event_85.json +42 -0
  359. package/templates/sci-fi/event_87.json +42 -0
  360. package/templates/sci-fi/event_89.json +42 -0
  361. package/templates/sci-fi/event_9.json +42 -0
  362. package/templates/sci-fi/event_90.json +43 -0
  363. package/templates/sci-fi/event_92.json +44 -0
  364. package/templates/sci-fi/event_93.json +42 -0
  365. package/templates/sci-fi/event_94.json +42 -0
  366. package/templates/sci-fi/event_95.json +43 -0
  367. package/templates/sci-fi/event_96.json +43 -0
  368. package/templates/sci-fi/event_97.json +42 -0
  369. package/templates/space-opera/event_1.json +44 -0
  370. package/templates/space-opera/event_10.json +42 -0
  371. package/templates/space-opera/event_100.json +42 -0
  372. package/templates/space-opera/event_12.json +42 -0
  373. package/templates/space-opera/event_13.json +44 -0
  374. package/templates/space-opera/event_14.json +43 -0
  375. package/templates/space-opera/event_15.json +43 -0
  376. package/templates/space-opera/event_17.json +42 -0
  377. package/templates/space-opera/event_18.json +43 -0
  378. package/templates/space-opera/event_19.json +42 -0
  379. package/templates/space-opera/event_20.json +43 -0
  380. package/templates/space-opera/event_21.json +42 -0
  381. package/templates/space-opera/event_24.json +44 -0
  382. package/templates/space-opera/event_25.json +42 -0
  383. package/templates/space-opera/event_26.json +43 -0
  384. package/templates/space-opera/event_27.json +43 -0
  385. package/templates/space-opera/event_28.json +43 -0
  386. package/templates/space-opera/event_29.json +44 -0
  387. package/templates/space-opera/event_31.json +42 -0
  388. package/templates/space-opera/event_32.json +42 -0
  389. package/templates/space-opera/event_33.json +42 -0
  390. package/templates/space-opera/event_35.json +42 -0
  391. package/templates/space-opera/event_36.json +44 -0
  392. package/templates/space-opera/event_38.json +43 -0
  393. package/templates/space-opera/event_40.json +42 -0
  394. package/templates/space-opera/event_41.json +42 -0
  395. package/templates/space-opera/event_43.json +43 -0
  396. package/templates/space-opera/event_44.json +42 -0
  397. package/templates/space-opera/event_47.json +42 -0
  398. package/templates/space-opera/event_48.json +43 -0
  399. package/templates/space-opera/event_49.json +44 -0
  400. package/templates/space-opera/event_5.json +44 -0
  401. package/templates/space-opera/event_50.json +42 -0
  402. package/templates/space-opera/event_51.json +42 -0
  403. package/templates/space-opera/event_52.json +42 -0
  404. package/templates/space-opera/event_53.json +43 -0
  405. package/templates/space-opera/event_55.json +42 -0
  406. package/templates/space-opera/event_58.json +43 -0
  407. package/templates/space-opera/event_6.json +43 -0
  408. package/templates/space-opera/event_60.json +44 -0
  409. package/templates/space-opera/event_61.json +42 -0
  410. package/templates/space-opera/event_62.json +43 -0
  411. package/templates/space-opera/event_65.json +42 -0
  412. package/templates/space-opera/event_67.json +42 -0
  413. package/templates/space-opera/event_68.json +43 -0
  414. package/templates/space-opera/event_69.json +42 -0
  415. package/templates/space-opera/event_7.json +44 -0
  416. package/templates/space-opera/event_71.json +44 -0
  417. package/templates/space-opera/event_73.json +42 -0
  418. package/templates/space-opera/event_74.json +42 -0
  419. package/templates/space-opera/event_77.json +43 -0
  420. package/templates/space-opera/event_78.json +43 -0
  421. package/templates/space-opera/event_8.json +43 -0
  422. package/templates/space-opera/event_81.json +42 -0
  423. package/templates/space-opera/event_82.json +42 -0
  424. package/templates/space-opera/event_83.json +43 -0
  425. package/templates/space-opera/event_85.json +42 -0
  426. package/templates/space-opera/event_87.json +42 -0
  427. package/templates/space-opera/event_88.json +42 -0
  428. package/templates/space-opera/event_90.json +42 -0
  429. package/templates/space-opera/event_93.json +43 -0
  430. package/templates/space-opera/event_97.json +42 -0
  431. 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.1
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.1
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
 
@@ -68,6 +81,175 @@ Since this is a personal project with a private repository:
68
81
  - **NPC Relationships**: Dynamic character relationship networks and social consequences
69
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
70
83
 
84
+ ### Revolutionary Features (v2.0.1) 🎉
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
+ ```
252
+
71
253
  ## Usage Guide
72
254
 
73
255
  ### Basic Event Generation
@@ -315,12 +497,12 @@ const event = generator.generateEnhancedEvent({
315
497
 
316
498
  ### Event Templates Library (v1.3.0)
317
499
 
318
- Load pre-built event collections for different game genres:
500
+ Use the included library of 429 professionally crafted event templates across 7 genres:
319
501
 
320
502
  ```javascript
321
503
  const generator = new RPGEventGenerator({
322
504
  enableTemplates: true,
323
- templateLibrary: 'fantasy' // Auto-load fantasy templates
505
+ templateLibrary: 'fantasy' // Load fantasy templates
324
506
  });
325
507
 
326
508
  // Generate from specific template
@@ -332,9 +514,16 @@ const fantasyEvent = generator.generateFromGenre('fantasy');
332
514
 
333
515
  // Discover available templates
334
516
  const availableTemplates = generator.getAvailableTemplates();
335
- console.log(Object.keys(availableTemplates)); // ['fantasy']
517
+ console.log(Object.keys(availableTemplates)); // ['fantasy', 'sci-fi', etc.]
518
+ ```
336
519
 
337
- // Available genres: 'fantasy', 'sci-fi', 'horror', 'historical'
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
338
527
  ```
339
528
 
340
529
  Each template includes:
@@ -343,6 +532,8 @@ Each template includes:
343
532
  - **Difficulty scaling** and context requirements
344
533
  - **Professional quality** event design
345
534
 
535
+ **Available genres**: 'fantasy', 'sci-fi', 'horror', 'historical', 'modern', 'cyberpunk', 'space-opera'
536
+
346
537
  #### Custom Template Creation
347
538
  Add your own templates to the library system:
348
539
 
@@ -579,7 +770,310 @@ const generator = new RPGEventGenerator({
579
770
  urgency: "normal",
580
771
  theme: "adventure",
581
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);
582
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
925
+ ```
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
+ chance: new Chance() // Custom Chance.js instance (optional)
1013
+ });
1014
+ ```
1015
+
1016
+ ### New Methods (v2.0.0)
1017
+
1018
+ ```javascript
1019
+ // Rule Engine
1020
+ generator.addCustomRule(name, ruleDefinition);
1021
+ generator.removeCustomRule(name);
1022
+ generator.getCustomRules();
1023
+ generator.clearCustomRules();
1024
+ generator.validateCustomRule(rule);
1025
+
1026
+ // Template System
1027
+ generator.generateFromTemplate(templateId);
1028
+ generator.generateFromGenre(genre);
1029
+ generator.getAvailableTemplates();
1030
+
1031
+ // Export System (via export-templates.js)
1032
+ exporter.exportTemplates('unity', 'fantasy');
1033
+ exporter.exportTemplates('godot', 'cyberpunk');
1034
+ exporter.exportTemplates('typescript', 'space-opera');
1035
+ ```
1036
+
1037
+ ## 🔄 v2.0.0 Migration Guide
1038
+
1039
+ ### From v1.x to v2.0.0
1040
+
1041
+ **✅ Fully Backward Compatible**
1042
+ - All existing code continues to work unchanged
1043
+ - v1.x features remain fully functional
1044
+ - No breaking changes to existing API
1045
+
1046
+ **🚀 New Features are Opt-in**
1047
+ ```javascript
1048
+ // v1.x code - still works perfectly
1049
+ const generator = new RPGEventGenerator();
1050
+
1051
+ // v2.0.0 enhancements - opt-in only
1052
+ const enhancedGenerator = new RPGEventGenerator({
1053
+ enableRuleEngine: true, // New feature
1054
+ pureMarkovMode: false, // New feature
1055
+ templateLibrary: 'fantasy' // Enhanced feature
1056
+ });
1057
+ ```
1058
+
1059
+ **📈 Performance Improvements**
1060
+ - Optimized rule evaluation
1061
+ - Efficient template loading
1062
+ - Better memory management for large template libraries
1063
+
1064
+ **🎲 Custom Randomness Control**
1065
+ ```javascript
1066
+ // For games that need deterministic randomness or custom seeding
1067
+ const customChance = new Chance('your-seed-here');
1068
+ const generator = new RPGEventGenerator({
1069
+ chance: customChance // Optional: pass your own Chance instance
1070
+ });
1071
+
1072
+ // For testing with predictable results
1073
+ const testChance = new Chance(12345); // Always same results
1074
+ const testGenerator = new RPGEventGenerator({
1075
+ chance: testChance
1076
+ });
583
1077
  ```
584
1078
 
585
1079
  ## 🎮 Game Integration
@@ -748,7 +1242,7 @@ function loadGame() {
748
1242
  npm test
749
1243
  ```
750
1244
 
751
- **Comprehensive test coverage (45+ tests):**
1245
+ **Comprehensive test coverage (70+ tests):**
752
1246
  - ✅ Core event generation and validation
753
1247
  - ✅ Context adaptation and player responsiveness
754
1248
  - ✅ Thematic systems and cultural variants
@@ -758,6 +1252,12 @@ npm test
758
1252
  - ✅ Modular features and custom content
759
1253
  - ✅ Edge cases and error handling
760
1254
  - ✅ Game state persistence and integration
1255
+ - ✅ **Event Economy system (25+ tests)**
1256
+ - Theme saving/loading/export/import
1257
+ - Rule pack management
1258
+ - Content pack creation
1259
+ - Quality metrics and statistics
1260
+ - File I/O operations and validation
761
1261
 
762
1262
  ## 🎯 Event Types
763
1263