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.
- package/README.md +507 -7
- package/demo.js +153 -4
- package/dist/index.js +394 -11
- package/package.json +16 -3
- package/scripts/event-economy.js +388 -0
- package/scripts/export-templates.js +289 -0
- package/scripts/generate-templates.js +407 -0
- package/templates/cyberpunk/event_100.json +43 -0
- package/templates/cyberpunk/event_11.json +42 -0
- package/templates/cyberpunk/event_14.json +42 -0
- package/templates/cyberpunk/event_15.json +43 -0
- package/templates/cyberpunk/event_16.json +43 -0
- package/templates/cyberpunk/event_18.json +44 -0
- package/templates/cyberpunk/event_2.json +42 -0
- package/templates/cyberpunk/event_26.json +42 -0
- package/templates/cyberpunk/event_27.json +43 -0
- package/templates/cyberpunk/event_3.json +43 -0
- package/templates/cyberpunk/event_30.json +42 -0
- package/templates/cyberpunk/event_32.json +42 -0
- package/templates/cyberpunk/event_36.json +43 -0
- package/templates/cyberpunk/event_37.json +42 -0
- package/templates/cyberpunk/event_39.json +42 -0
- package/templates/cyberpunk/event_4.json +42 -0
- package/templates/cyberpunk/event_40.json +42 -0
- package/templates/cyberpunk/event_42.json +43 -0
- package/templates/cyberpunk/event_46.json +43 -0
- package/templates/cyberpunk/event_49.json +44 -0
- package/templates/cyberpunk/event_5.json +44 -0
- package/templates/cyberpunk/event_50.json +42 -0
- package/templates/cyberpunk/event_51.json +42 -0
- package/templates/cyberpunk/event_54.json +43 -0
- package/templates/cyberpunk/event_55.json +44 -0
- package/templates/cyberpunk/event_57.json +42 -0
- package/templates/cyberpunk/event_58.json +42 -0
- package/templates/cyberpunk/event_61.json +43 -0
- package/templates/cyberpunk/event_62.json +43 -0
- package/templates/cyberpunk/event_64.json +42 -0
- package/templates/cyberpunk/event_65.json +42 -0
- package/templates/cyberpunk/event_66.json +42 -0
- package/templates/cyberpunk/event_68.json +43 -0
- package/templates/cyberpunk/event_69.json +43 -0
- package/templates/cyberpunk/event_71.json +42 -0
- package/templates/cyberpunk/event_72.json +42 -0
- package/templates/cyberpunk/event_73.json +42 -0
- package/templates/cyberpunk/event_74.json +42 -0
- package/templates/cyberpunk/event_75.json +44 -0
- package/templates/cyberpunk/event_76.json +43 -0
- package/templates/cyberpunk/event_78.json +43 -0
- package/templates/cyberpunk/event_79.json +42 -0
- package/templates/cyberpunk/event_8.json +42 -0
- package/templates/cyberpunk/event_80.json +43 -0
- package/templates/cyberpunk/event_81.json +43 -0
- package/templates/cyberpunk/event_83.json +44 -0
- package/templates/cyberpunk/event_84.json +43 -0
- package/templates/cyberpunk/event_86.json +44 -0
- package/templates/cyberpunk/event_88.json +43 -0
- package/templates/cyberpunk/event_9.json +42 -0
- package/templates/cyberpunk/event_91.json +42 -0
- package/templates/cyberpunk/event_92.json +43 -0
- package/templates/cyberpunk/event_93.json +42 -0
- package/templates/cyberpunk/event_95.json +42 -0
- package/templates/cyberpunk/event_96.json +43 -0
- package/templates/cyberpunk/event_97.json +43 -0
- package/templates/cyberpunk/event_98.json +42 -0
- package/templates/cyberpunk/event_99.json +42 -0
- package/templates/fantasy/event_1.json +44 -0
- package/templates/fantasy/event_10.json +43 -0
- package/templates/fantasy/event_11.json +43 -0
- package/templates/fantasy/event_12.json +42 -0
- package/templates/fantasy/event_13.json +43 -0
- package/templates/fantasy/event_16.json +44 -0
- package/templates/fantasy/event_20.json +42 -0
- package/templates/fantasy/event_21.json +42 -0
- package/templates/fantasy/event_22.json +42 -0
- package/templates/fantasy/event_23.json +42 -0
- package/templates/fantasy/event_24.json +43 -0
- package/templates/fantasy/event_27.json +43 -0
- package/templates/fantasy/event_29.json +43 -0
- package/templates/fantasy/event_3.json +42 -0
- package/templates/fantasy/event_30.json +43 -0
- package/templates/fantasy/event_31.json +42 -0
- package/templates/fantasy/event_33.json +42 -0
- package/templates/fantasy/event_34.json +43 -0
- package/templates/fantasy/event_36.json +43 -0
- package/templates/fantasy/event_38.json +43 -0
- package/templates/fantasy/event_39.json +42 -0
- package/templates/fantasy/event_4.json +44 -0
- package/templates/fantasy/event_41.json +43 -0
- package/templates/fantasy/event_44.json +42 -0
- package/templates/fantasy/event_45.json +42 -0
- package/templates/fantasy/event_46.json +42 -0
- package/templates/fantasy/event_47.json +42 -0
- package/templates/fantasy/event_48.json +42 -0
- package/templates/fantasy/event_5.json +42 -0
- package/templates/fantasy/event_50.json +44 -0
- package/templates/fantasy/event_51.json +43 -0
- package/templates/fantasy/event_54.json +43 -0
- package/templates/fantasy/event_55.json +43 -0
- package/templates/fantasy/event_57.json +44 -0
- package/templates/fantasy/event_58.json +44 -0
- package/templates/fantasy/event_6.json +42 -0
- package/templates/fantasy/event_64.json +42 -0
- package/templates/fantasy/event_68.json +42 -0
- package/templates/fantasy/event_69.json +43 -0
- package/templates/fantasy/event_70.json +42 -0
- package/templates/fantasy/event_71.json +42 -0
- package/templates/fantasy/event_72.json +43 -0
- package/templates/fantasy/event_73.json +42 -0
- package/templates/fantasy/event_76.json +43 -0
- package/templates/fantasy/event_77.json +43 -0
- package/templates/fantasy/event_79.json +42 -0
- package/templates/fantasy/event_88.json +42 -0
- package/templates/fantasy/event_9.json +44 -0
- package/templates/fantasy/event_90.json +43 -0
- package/templates/fantasy/event_91.json +42 -0
- package/templates/fantasy/event_92.json +42 -0
- package/templates/fantasy/event_94.json +43 -0
- package/templates/fantasy/event_96.json +42 -0
- package/templates/fantasy/event_97.json +42 -0
- package/templates/fantasy/event_98.json +42 -0
- package/templates/fantasy/event_99.json +42 -0
- package/templates/historical/event_1.json +44 -0
- package/templates/historical/event_10.json +42 -0
- package/templates/historical/event_11.json +44 -0
- package/templates/historical/event_14.json +44 -0
- package/templates/historical/event_17.json +44 -0
- package/templates/historical/event_2.json +43 -0
- package/templates/historical/event_20.json +43 -0
- package/templates/historical/event_21.json +44 -0
- package/templates/historical/event_22.json +43 -0
- package/templates/historical/event_25.json +43 -0
- package/templates/historical/event_26.json +42 -0
- package/templates/historical/event_3.json +43 -0
- package/templates/historical/event_30.json +42 -0
- package/templates/historical/event_33.json +44 -0
- package/templates/historical/event_34.json +42 -0
- package/templates/historical/event_39.json +42 -0
- package/templates/historical/event_4.json +44 -0
- package/templates/historical/event_40.json +42 -0
- package/templates/historical/event_42.json +42 -0
- package/templates/historical/event_44.json +43 -0
- package/templates/historical/event_45.json +43 -0
- package/templates/historical/event_48.json +42 -0
- package/templates/historical/event_50.json +42 -0
- package/templates/historical/event_52.json +42 -0
- package/templates/historical/event_53.json +44 -0
- package/templates/historical/event_54.json +44 -0
- package/templates/historical/event_56.json +42 -0
- package/templates/historical/event_57.json +42 -0
- package/templates/historical/event_59.json +42 -0
- package/templates/historical/event_60.json +43 -0
- package/templates/historical/event_61.json +42 -0
- package/templates/historical/event_62.json +44 -0
- package/templates/historical/event_63.json +42 -0
- package/templates/historical/event_64.json +43 -0
- package/templates/historical/event_65.json +44 -0
- package/templates/historical/event_66.json +42 -0
- package/templates/historical/event_67.json +43 -0
- package/templates/historical/event_69.json +43 -0
- package/templates/historical/event_7.json +42 -0
- package/templates/historical/event_70.json +42 -0
- package/templates/historical/event_71.json +43 -0
- package/templates/historical/event_74.json +42 -0
- package/templates/historical/event_75.json +43 -0
- package/templates/historical/event_79.json +42 -0
- package/templates/historical/event_8.json +44 -0
- package/templates/historical/event_80.json +43 -0
- package/templates/historical/event_82.json +42 -0
- package/templates/historical/event_87.json +43 -0
- package/templates/historical/event_89.json +43 -0
- package/templates/historical/event_9.json +43 -0
- package/templates/historical/event_90.json +44 -0
- package/templates/historical/event_91.json +42 -0
- package/templates/historical/event_92.json +43 -0
- package/templates/historical/event_94.json +42 -0
- package/templates/historical/event_97.json +42 -0
- package/templates/horror/event_1.json +42 -0
- package/templates/horror/event_100.json +42 -0
- package/templates/horror/event_12.json +42 -0
- package/templates/horror/event_13.json +43 -0
- package/templates/horror/event_14.json +44 -0
- package/templates/horror/event_15.json +42 -0
- package/templates/horror/event_16.json +43 -0
- package/templates/horror/event_17.json +43 -0
- package/templates/horror/event_18.json +42 -0
- package/templates/horror/event_2.json +44 -0
- package/templates/horror/event_20.json +43 -0
- package/templates/horror/event_23.json +42 -0
- package/templates/horror/event_27.json +43 -0
- package/templates/horror/event_28.json +42 -0
- package/templates/horror/event_29.json +42 -0
- package/templates/horror/event_3.json +42 -0
- package/templates/horror/event_30.json +42 -0
- package/templates/horror/event_32.json +42 -0
- package/templates/horror/event_34.json +42 -0
- package/templates/horror/event_35.json +43 -0
- package/templates/horror/event_36.json +43 -0
- package/templates/horror/event_37.json +43 -0
- package/templates/horror/event_38.json +44 -0
- package/templates/horror/event_39.json +42 -0
- package/templates/horror/event_40.json +42 -0
- package/templates/horror/event_41.json +42 -0
- package/templates/horror/event_42.json +43 -0
- package/templates/horror/event_43.json +43 -0
- package/templates/horror/event_45.json +42 -0
- package/templates/horror/event_46.json +44 -0
- package/templates/horror/event_47.json +42 -0
- package/templates/horror/event_50.json +43 -0
- package/templates/horror/event_52.json +44 -0
- package/templates/horror/event_53.json +43 -0
- package/templates/horror/event_55.json +43 -0
- package/templates/horror/event_56.json +44 -0
- package/templates/horror/event_58.json +42 -0
- package/templates/horror/event_59.json +42 -0
- package/templates/horror/event_60.json +43 -0
- package/templates/horror/event_61.json +44 -0
- package/templates/horror/event_62.json +42 -0
- package/templates/horror/event_63.json +43 -0
- package/templates/horror/event_65.json +42 -0
- package/templates/horror/event_67.json +43 -0
- package/templates/horror/event_68.json +44 -0
- package/templates/horror/event_72.json +42 -0
- package/templates/horror/event_73.json +44 -0
- package/templates/horror/event_74.json +43 -0
- package/templates/horror/event_77.json +42 -0
- package/templates/horror/event_79.json +43 -0
- package/templates/horror/event_8.json +42 -0
- package/templates/horror/event_82.json +43 -0
- package/templates/horror/event_83.json +42 -0
- package/templates/horror/event_84.json +42 -0
- package/templates/horror/event_86.json +43 -0
- package/templates/horror/event_88.json +42 -0
- package/templates/horror/event_89.json +43 -0
- package/templates/horror/event_9.json +43 -0
- package/templates/horror/event_90.json +44 -0
- package/templates/horror/event_91.json +43 -0
- package/templates/horror/event_93.json +42 -0
- package/templates/horror/event_95.json +42 -0
- package/templates/horror/event_96.json +43 -0
- package/templates/horror/event_99.json +42 -0
- package/templates/index.json +445 -5
- package/templates/modern/event_10.json +42 -0
- package/templates/modern/event_100.json +43 -0
- package/templates/modern/event_11.json +44 -0
- package/templates/modern/event_13.json +42 -0
- package/templates/modern/event_15.json +43 -0
- package/templates/modern/event_16.json +42 -0
- package/templates/modern/event_17.json +42 -0
- package/templates/modern/event_19.json +43 -0
- package/templates/modern/event_2.json +42 -0
- package/templates/modern/event_20.json +42 -0
- package/templates/modern/event_21.json +43 -0
- package/templates/modern/event_22.json +43 -0
- package/templates/modern/event_23.json +43 -0
- package/templates/modern/event_25.json +43 -0
- package/templates/modern/event_27.json +42 -0
- package/templates/modern/event_28.json +42 -0
- package/templates/modern/event_31.json +42 -0
- package/templates/modern/event_32.json +43 -0
- package/templates/modern/event_34.json +44 -0
- package/templates/modern/event_35.json +42 -0
- package/templates/modern/event_36.json +44 -0
- package/templates/modern/event_37.json +42 -0
- package/templates/modern/event_39.json +42 -0
- package/templates/modern/event_4.json +42 -0
- package/templates/modern/event_41.json +42 -0
- package/templates/modern/event_42.json +44 -0
- package/templates/modern/event_43.json +42 -0
- package/templates/modern/event_44.json +44 -0
- package/templates/modern/event_45.json +44 -0
- package/templates/modern/event_46.json +44 -0
- package/templates/modern/event_47.json +43 -0
- package/templates/modern/event_48.json +42 -0
- package/templates/modern/event_49.json +43 -0
- package/templates/modern/event_5.json +43 -0
- package/templates/modern/event_51.json +42 -0
- package/templates/modern/event_52.json +42 -0
- package/templates/modern/event_55.json +43 -0
- package/templates/modern/event_56.json +42 -0
- package/templates/modern/event_57.json +42 -0
- package/templates/modern/event_59.json +42 -0
- package/templates/modern/event_6.json +43 -0
- package/templates/modern/event_60.json +43 -0
- package/templates/modern/event_61.json +42 -0
- package/templates/modern/event_63.json +42 -0
- package/templates/modern/event_64.json +42 -0
- package/templates/modern/event_66.json +42 -0
- package/templates/modern/event_67.json +42 -0
- package/templates/modern/event_69.json +42 -0
- package/templates/modern/event_7.json +43 -0
- package/templates/modern/event_70.json +42 -0
- package/templates/modern/event_72.json +43 -0
- package/templates/modern/event_74.json +43 -0
- package/templates/modern/event_78.json +42 -0
- package/templates/modern/event_8.json +42 -0
- package/templates/modern/event_80.json +44 -0
- package/templates/modern/event_81.json +43 -0
- package/templates/modern/event_82.json +42 -0
- package/templates/modern/event_83.json +42 -0
- package/templates/modern/event_84.json +44 -0
- package/templates/modern/event_85.json +42 -0
- package/templates/modern/event_86.json +42 -0
- package/templates/modern/event_87.json +44 -0
- package/templates/modern/event_89.json +42 -0
- package/templates/modern/event_94.json +42 -0
- package/templates/modern/event_97.json +43 -0
- package/templates/modern/event_98.json +42 -0
- package/templates/modern/event_99.json +44 -0
- package/templates/schema.json +87 -0
- package/templates/sci-fi/event_1.json +42 -0
- package/templates/sci-fi/event_11.json +43 -0
- package/templates/sci-fi/event_13.json +43 -0
- package/templates/sci-fi/event_15.json +43 -0
- package/templates/sci-fi/event_18.json +42 -0
- package/templates/sci-fi/event_19.json +43 -0
- package/templates/sci-fi/event_2.json +44 -0
- package/templates/sci-fi/event_22.json +42 -0
- package/templates/sci-fi/event_23.json +42 -0
- package/templates/sci-fi/event_24.json +43 -0
- package/templates/sci-fi/event_25.json +42 -0
- package/templates/sci-fi/event_27.json +43 -0
- package/templates/sci-fi/event_28.json +43 -0
- package/templates/sci-fi/event_30.json +43 -0
- package/templates/sci-fi/event_31.json +42 -0
- package/templates/sci-fi/event_32.json +42 -0
- package/templates/sci-fi/event_33.json +44 -0
- package/templates/sci-fi/event_34.json +42 -0
- package/templates/sci-fi/event_35.json +42 -0
- package/templates/sci-fi/event_36.json +42 -0
- package/templates/sci-fi/event_37.json +44 -0
- package/templates/sci-fi/event_39.json +43 -0
- package/templates/sci-fi/event_4.json +43 -0
- package/templates/sci-fi/event_41.json +42 -0
- package/templates/sci-fi/event_45.json +42 -0
- package/templates/sci-fi/event_47.json +43 -0
- package/templates/sci-fi/event_48.json +42 -0
- package/templates/sci-fi/event_50.json +43 -0
- package/templates/sci-fi/event_51.json +42 -0
- package/templates/sci-fi/event_53.json +42 -0
- package/templates/sci-fi/event_54.json +43 -0
- package/templates/sci-fi/event_55.json +42 -0
- package/templates/sci-fi/event_56.json +43 -0
- package/templates/sci-fi/event_59.json +42 -0
- package/templates/sci-fi/event_6.json +42 -0
- package/templates/sci-fi/event_60.json +43 -0
- package/templates/sci-fi/event_64.json +44 -0
- package/templates/sci-fi/event_65.json +43 -0
- package/templates/sci-fi/event_67.json +42 -0
- package/templates/sci-fi/event_7.json +42 -0
- package/templates/sci-fi/event_72.json +42 -0
- package/templates/sci-fi/event_73.json +43 -0
- package/templates/sci-fi/event_74.json +44 -0
- package/templates/sci-fi/event_75.json +43 -0
- package/templates/sci-fi/event_78.json +42 -0
- package/templates/sci-fi/event_80.json +42 -0
- package/templates/sci-fi/event_82.json +43 -0
- package/templates/sci-fi/event_83.json +44 -0
- package/templates/sci-fi/event_85.json +42 -0
- package/templates/sci-fi/event_87.json +42 -0
- package/templates/sci-fi/event_89.json +42 -0
- package/templates/sci-fi/event_9.json +42 -0
- package/templates/sci-fi/event_90.json +43 -0
- package/templates/sci-fi/event_92.json +44 -0
- package/templates/sci-fi/event_93.json +42 -0
- package/templates/sci-fi/event_94.json +42 -0
- package/templates/sci-fi/event_95.json +43 -0
- package/templates/sci-fi/event_96.json +43 -0
- package/templates/sci-fi/event_97.json +42 -0
- package/templates/space-opera/event_1.json +44 -0
- package/templates/space-opera/event_10.json +42 -0
- package/templates/space-opera/event_100.json +42 -0
- package/templates/space-opera/event_12.json +42 -0
- package/templates/space-opera/event_13.json +44 -0
- package/templates/space-opera/event_14.json +43 -0
- package/templates/space-opera/event_15.json +43 -0
- package/templates/space-opera/event_17.json +42 -0
- package/templates/space-opera/event_18.json +43 -0
- package/templates/space-opera/event_19.json +42 -0
- package/templates/space-opera/event_20.json +43 -0
- package/templates/space-opera/event_21.json +42 -0
- package/templates/space-opera/event_24.json +44 -0
- package/templates/space-opera/event_25.json +42 -0
- package/templates/space-opera/event_26.json +43 -0
- package/templates/space-opera/event_27.json +43 -0
- package/templates/space-opera/event_28.json +43 -0
- package/templates/space-opera/event_29.json +44 -0
- package/templates/space-opera/event_31.json +42 -0
- package/templates/space-opera/event_32.json +42 -0
- package/templates/space-opera/event_33.json +42 -0
- package/templates/space-opera/event_35.json +42 -0
- package/templates/space-opera/event_36.json +44 -0
- package/templates/space-opera/event_38.json +43 -0
- package/templates/space-opera/event_40.json +42 -0
- package/templates/space-opera/event_41.json +42 -0
- package/templates/space-opera/event_43.json +43 -0
- package/templates/space-opera/event_44.json +42 -0
- package/templates/space-opera/event_47.json +42 -0
- package/templates/space-opera/event_48.json +43 -0
- package/templates/space-opera/event_49.json +44 -0
- package/templates/space-opera/event_5.json +44 -0
- package/templates/space-opera/event_50.json +42 -0
- package/templates/space-opera/event_51.json +42 -0
- package/templates/space-opera/event_52.json +42 -0
- package/templates/space-opera/event_53.json +43 -0
- package/templates/space-opera/event_55.json +42 -0
- package/templates/space-opera/event_58.json +43 -0
- package/templates/space-opera/event_6.json +43 -0
- package/templates/space-opera/event_60.json +44 -0
- package/templates/space-opera/event_61.json +42 -0
- package/templates/space-opera/event_62.json +43 -0
- package/templates/space-opera/event_65.json +42 -0
- package/templates/space-opera/event_67.json +42 -0
- package/templates/space-opera/event_68.json +43 -0
- package/templates/space-opera/event_69.json +42 -0
- package/templates/space-opera/event_7.json +44 -0
- package/templates/space-opera/event_71.json +44 -0
- package/templates/space-opera/event_73.json +42 -0
- package/templates/space-opera/event_74.json +42 -0
- package/templates/space-opera/event_77.json +43 -0
- package/templates/space-opera/event_78.json +43 -0
- package/templates/space-opera/event_8.json +43 -0
- package/templates/space-opera/event_81.json +42 -0
- package/templates/space-opera/event_82.json +42 -0
- package/templates/space-opera/event_83.json +43 -0
- package/templates/space-opera/event_85.json +42 -0
- package/templates/space-opera/event_87.json +42 -0
- package/templates/space-opera/event_88.json +42 -0
- package/templates/space-opera/event_90.json +42 -0
- package/templates/space-opera/event_93.json +43 -0
- package/templates/space-opera/event_97.json +42 -0
- package/templates/space-opera/event_98.json +43 -0
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rpg-event-generator",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "RPG Event Generator v2.0.0 - Complete procedural event generation with 429+ templates, rule engine, and theme creator",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist/",
|
|
8
8
|
"templates/",
|
|
9
|
+
"scripts/",
|
|
9
10
|
"demo.js",
|
|
10
11
|
"README.md",
|
|
11
12
|
"LICENSE"
|
|
@@ -13,7 +14,14 @@
|
|
|
13
14
|
"scripts": {
|
|
14
15
|
"test": "jest",
|
|
15
16
|
"build": "babel src --out-dir dist",
|
|
16
|
-
"
|
|
17
|
+
"build:browser": "npm run build && browserify dist/index.js --standalone RPGEventGenerator -o demo-web/rpg-event-generator.js",
|
|
18
|
+
"prepublishOnly": "npm run build",
|
|
19
|
+
"demo": "node demo.js",
|
|
20
|
+
"economy:list": "node scripts/event-economy.js list-themes",
|
|
21
|
+
"economy:stats": "node scripts/event-economy.js stats",
|
|
22
|
+
"export:unity": "node scripts/export-templates.js unity",
|
|
23
|
+
"export:godot": "node scripts/export-templates.js godot",
|
|
24
|
+
"export:typescript": "node scripts/export-templates.js typescript"
|
|
17
25
|
},
|
|
18
26
|
"keywords": [
|
|
19
27
|
"rpg",
|
|
@@ -55,6 +63,7 @@
|
|
|
55
63
|
"@babel/cli": "^7.23.0",
|
|
56
64
|
"@babel/core": "^7.23.0",
|
|
57
65
|
"@babel/preset-env": "^7.23.0",
|
|
66
|
+
"browserify": "^17.0.0",
|
|
58
67
|
"jest": "^29.7.0",
|
|
59
68
|
"jest-environment-node": "^29.7.0"
|
|
60
69
|
},
|
|
@@ -64,6 +73,10 @@
|
|
|
64
73
|
"^.+\\.(js|jsx)$": "babel-jest"
|
|
65
74
|
}
|
|
66
75
|
},
|
|
76
|
+
"bin": {
|
|
77
|
+
"rpg-events": "./scripts/event-economy.js",
|
|
78
|
+
"rpg-export": "./scripts/export-templates.js"
|
|
79
|
+
},
|
|
67
80
|
"engines": {
|
|
68
81
|
"node": ">=14.0.0"
|
|
69
82
|
}
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Event Economy System for RPG Event Generator v2.0.0
|
|
5
|
+
* User-generated content sharing and marketplace foundation
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
|
|
11
|
+
class EventEconomy {
|
|
12
|
+
constructor(storagePath = './user-content') {
|
|
13
|
+
this.storagePath = storagePath;
|
|
14
|
+
this.themesPath = path.join(storagePath, 'themes');
|
|
15
|
+
this.rulesPath = path.join(storagePath, 'rules');
|
|
16
|
+
this.packsPath = path.join(storagePath, 'packs');
|
|
17
|
+
|
|
18
|
+
this.initializeDirectories();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
initializeDirectories() {
|
|
22
|
+
[this.storagePath, this.themesPath, this.rulesPath, this.packsPath].forEach(dir => {
|
|
23
|
+
if (!fs.existsSync(dir)) {
|
|
24
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
saveTheme(themeName, themeData) {
|
|
30
|
+
const theme = {
|
|
31
|
+
name: themeName,
|
|
32
|
+
version: '1.0.0',
|
|
33
|
+
created: new Date().toISOString(),
|
|
34
|
+
author: themeData.author || 'Anonymous',
|
|
35
|
+
description: themeData.description || '',
|
|
36
|
+
tags: themeData.tags || [],
|
|
37
|
+
license: themeData.license || 'MIT',
|
|
38
|
+
|
|
39
|
+
// Generator settings - use existing settings if available, otherwise create from properties
|
|
40
|
+
settings: themeData.settings || {
|
|
41
|
+
theme: themeData.theme,
|
|
42
|
+
culture: themeData.culture,
|
|
43
|
+
language: themeData.language || 'en',
|
|
44
|
+
enableRuleEngine: themeData.enableRuleEngine,
|
|
45
|
+
enableTemplates: themeData.enableTemplates,
|
|
46
|
+
pureMarkovMode: themeData.pureMarkovMode
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
// Content
|
|
50
|
+
trainingData: themeData.trainingData || [],
|
|
51
|
+
customRules: themeData.customRules || [],
|
|
52
|
+
|
|
53
|
+
// Metadata
|
|
54
|
+
statistics: {
|
|
55
|
+
trainingSentences: themeData.trainingData?.length || 0,
|
|
56
|
+
customRules: themeData.customRules?.length || 0,
|
|
57
|
+
estimatedQuality: this.calculateThemeQuality(themeData)
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const filename = this.sanitizeFilename(themeName) + '.json';
|
|
62
|
+
const filepath = path.join(this.themesPath, filename);
|
|
63
|
+
|
|
64
|
+
fs.writeFileSync(filepath, JSON.stringify(theme, null, 2));
|
|
65
|
+
console.log(`✅ Theme "${themeName}" saved to ${filepath}`);
|
|
66
|
+
return filepath;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
loadTheme(themeName) {
|
|
70
|
+
const filename = this.sanitizeFilename(themeName) + '.json';
|
|
71
|
+
const filepath = path.join(this.themesPath, filename);
|
|
72
|
+
|
|
73
|
+
if (!fs.existsSync(filepath)) {
|
|
74
|
+
throw new Error(`Theme "${themeName}" not found`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const themeData = JSON.parse(fs.readFileSync(filepath, 'utf8'));
|
|
78
|
+
console.log(`✅ Theme "${themeName}" loaded`);
|
|
79
|
+
return themeData;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
listThemes() {
|
|
83
|
+
const files = fs.readdirSync(this.themesPath).filter(f => f.endsWith('.json'));
|
|
84
|
+
return files.map(filename => {
|
|
85
|
+
const filepath = path.join(this.themesPath, filename);
|
|
86
|
+
const theme = JSON.parse(fs.readFileSync(filepath, 'utf8'));
|
|
87
|
+
return {
|
|
88
|
+
name: theme.name,
|
|
89
|
+
author: theme.author,
|
|
90
|
+
description: theme.description,
|
|
91
|
+
tags: theme.tags,
|
|
92
|
+
version: theme.version,
|
|
93
|
+
created: theme.created,
|
|
94
|
+
quality: theme.statistics?.estimatedQuality || 0
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
deleteTheme(themeName) {
|
|
100
|
+
const filename = this.sanitizeFilename(themeName) + '.json';
|
|
101
|
+
const filepath = path.join(this.themesPath, filename);
|
|
102
|
+
|
|
103
|
+
if (fs.existsSync(filepath)) {
|
|
104
|
+
fs.unlinkSync(filepath);
|
|
105
|
+
console.log(`🗑️ Theme "${themeName}" deleted`);
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
saveRulePack(packName, ruleData) {
|
|
112
|
+
const pack = {
|
|
113
|
+
name: packName,
|
|
114
|
+
version: '1.0.0',
|
|
115
|
+
created: new Date().toISOString(),
|
|
116
|
+
author: ruleData.author || 'Anonymous',
|
|
117
|
+
description: ruleData.description || '',
|
|
118
|
+
tags: ruleData.tags || ['rules'],
|
|
119
|
+
|
|
120
|
+
rules: ruleData.rules || [],
|
|
121
|
+
|
|
122
|
+
statistics: {
|
|
123
|
+
totalRules: ruleData.rules?.length || 0,
|
|
124
|
+
conditionTypes: this.analyzeRuleConditions(ruleData.rules || [])
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const filename = this.sanitizeFilename(packName) + '.json';
|
|
129
|
+
const filepath = path.join(this.rulesPath, filename);
|
|
130
|
+
|
|
131
|
+
fs.writeFileSync(filepath, JSON.stringify(pack, null, 2));
|
|
132
|
+
console.log(`✅ Rule pack "${packName}" saved to ${filepath}`);
|
|
133
|
+
return filepath;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
loadRulePack(packName) {
|
|
137
|
+
const filename = this.sanitizeFilename(packName) + '.json';
|
|
138
|
+
const filepath = path.join(this.rulesPath, filename);
|
|
139
|
+
|
|
140
|
+
if (!fs.existsSync(filepath)) {
|
|
141
|
+
throw new Error(`Rule pack "${packName}" not found`);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const packData = JSON.parse(fs.readFileSync(filepath, 'utf8'));
|
|
145
|
+
console.log(`✅ Rule pack "${packName}" loaded`);
|
|
146
|
+
return packData;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
createContentPack(packName, packData) {
|
|
150
|
+
const pack = {
|
|
151
|
+
name: packName,
|
|
152
|
+
version: '1.0.0',
|
|
153
|
+
created: new Date().toISOString(),
|
|
154
|
+
author: packData.author || 'Anonymous',
|
|
155
|
+
description: packData.description || '',
|
|
156
|
+
tags: packData.tags || ['content-pack'],
|
|
157
|
+
|
|
158
|
+
// Include theme and rules
|
|
159
|
+
theme: packData.theme,
|
|
160
|
+
rulePacks: packData.rulePacks || [],
|
|
161
|
+
|
|
162
|
+
// Metadata
|
|
163
|
+
statistics: {
|
|
164
|
+
totalThemes: packData.theme ? 1 : 0,
|
|
165
|
+
totalRulePacks: packData.rulePacks?.length || 0,
|
|
166
|
+
estimatedValue: this.calculatePackValue(packData)
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const filename = this.sanitizeFilename(packName) + '.json';
|
|
171
|
+
const filepath = path.join(this.packsPath, filename);
|
|
172
|
+
|
|
173
|
+
fs.writeFileSync(filepath, JSON.stringify(pack, null, 2));
|
|
174
|
+
console.log(`✅ Content pack "${packName}" created`);
|
|
175
|
+
return filepath;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
exportTheme(themeName, exportPath = null) {
|
|
179
|
+
const theme = this.loadTheme(themeName);
|
|
180
|
+
const exportFilePath = exportPath || `${this.sanitizeFilename(themeName)}_export.json`;
|
|
181
|
+
|
|
182
|
+
fs.writeFileSync(exportFilePath, JSON.stringify(theme, null, 2));
|
|
183
|
+
console.log(`📤 Theme "${themeName}" exported to ${exportFilePath}`);
|
|
184
|
+
return exportFilePath;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
importTheme(importPath) {
|
|
188
|
+
if (!fs.existsSync(importPath)) {
|
|
189
|
+
throw new Error(`Import file not found: ${importPath}`);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const themeData = JSON.parse(fs.readFileSync(importPath, 'utf8'));
|
|
193
|
+
|
|
194
|
+
// Validate theme structure
|
|
195
|
+
if (!themeData.name || !themeData.settings) {
|
|
196
|
+
throw new Error('Invalid theme file structure');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Save imported theme
|
|
200
|
+
const savedPath = this.saveTheme(themeData.name + '_imported', {
|
|
201
|
+
...themeData,
|
|
202
|
+
imported: true,
|
|
203
|
+
originalPath: importPath
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
console.log(`📥 Theme "${themeData.name}" imported successfully`);
|
|
207
|
+
return savedPath;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
sanitizeFilename(name) {
|
|
211
|
+
return name.replace(/[^a-zA-Z0-9-_]/g, '_').toLowerCase();
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
calculateThemeQuality(themeData) {
|
|
215
|
+
let score = 0;
|
|
216
|
+
|
|
217
|
+
const trainingCount = themeData.trainingData?.length || 0;
|
|
218
|
+
score += Math.min(trainingCount * 2, 40); // Max 40 points for training data
|
|
219
|
+
|
|
220
|
+
const ruleCount = themeData.customRules?.length || 0;
|
|
221
|
+
score += Math.min(ruleCount * 5, 30); // Max 30 points for rules
|
|
222
|
+
|
|
223
|
+
if (themeData.description && themeData.description.length > 20) {
|
|
224
|
+
score += 15;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (themeData.tags && themeData.tags.length > 0) {
|
|
228
|
+
score += 15;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return Math.min(score, 100);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
analyzeRuleConditions(rules) {
|
|
235
|
+
const conditionTypes = {};
|
|
236
|
+
|
|
237
|
+
rules.forEach(rule => {
|
|
238
|
+
if (rule.conditions) {
|
|
239
|
+
rule.conditions.forEach(condition => {
|
|
240
|
+
const type = condition.type || 'unknown';
|
|
241
|
+
conditionTypes[type] = (conditionTypes[type] || 0) + 1;
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
return conditionTypes;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
calculatePackValue(packData) {
|
|
250
|
+
let value = 0;
|
|
251
|
+
|
|
252
|
+
if (packData.theme) {
|
|
253
|
+
value += this.calculateThemeQuality(packData.theme);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (packData.rulePacks) {
|
|
257
|
+
packData.rulePacks.forEach(rules => {
|
|
258
|
+
value += (rules.length || 0) * 10;
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return Math.min(value, 1000);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
searchContent(query, type = 'all') {
|
|
266
|
+
const results = [];
|
|
267
|
+
|
|
268
|
+
if (type === 'all' || type === 'themes') {
|
|
269
|
+
const themes = this.listThemes();
|
|
270
|
+
themes.forEach(theme => {
|
|
271
|
+
if (this.matchesQuery(theme, query)) {
|
|
272
|
+
results.push({ type: 'theme', ...theme });
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (type === 'all' || type === 'rules') {
|
|
278
|
+
const ruleFiles = fs.readdirSync(this.rulesPath).filter(f => f.endsWith('.json'));
|
|
279
|
+
ruleFiles.forEach(filename => {
|
|
280
|
+
const filepath = path.join(this.rulesPath, filename);
|
|
281
|
+
const pack = JSON.parse(fs.readFileSync(filepath, 'utf8'));
|
|
282
|
+
|
|
283
|
+
if (this.matchesQuery(pack, query)) {
|
|
284
|
+
results.push({ type: 'rule-pack', ...pack });
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
return results;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
matchesQuery(item, query) {
|
|
293
|
+
const searchText = query.toLowerCase();
|
|
294
|
+
return (
|
|
295
|
+
item.name?.toLowerCase().includes(searchText) ||
|
|
296
|
+
item.description?.toLowerCase().includes(searchText) ||
|
|
297
|
+
item.tags?.some(tag => tag.toLowerCase().includes(searchText)) ||
|
|
298
|
+
item.author?.toLowerCase().includes(searchText)
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
getStatistics() {
|
|
303
|
+
const themes = this.listThemes();
|
|
304
|
+
const ruleFiles = fs.readdirSync(this.rulesPath).filter(f => f.endsWith('.json'));
|
|
305
|
+
const packs = fs.readdirSync(this.packsPath).filter(f => f.endsWith('.json'));
|
|
306
|
+
|
|
307
|
+
return {
|
|
308
|
+
totalThemes: themes.length,
|
|
309
|
+
totalRulePacks: ruleFiles.length,
|
|
310
|
+
totalContentPacks: packs.length,
|
|
311
|
+
averageThemeQuality: themes.length > 0 ?
|
|
312
|
+
themes.reduce((sum, t) => sum + (t.quality || 0), 0) / themes.length : 0,
|
|
313
|
+
popularTags: this.getPopularTags(themes),
|
|
314
|
+
lastUpdated: new Date().toISOString()
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
getPopularTags(themes) {
|
|
319
|
+
const tagCounts = {};
|
|
320
|
+
|
|
321
|
+
themes.forEach(theme => {
|
|
322
|
+
theme.tags?.forEach(tag => {
|
|
323
|
+
tagCounts[tag] = (tagCounts[tag] || 0) + 1;
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
return Object.entries(tagCounts)
|
|
328
|
+
.sort(([,a], [,b]) => b - a)
|
|
329
|
+
.slice(0, 10)
|
|
330
|
+
.map(([tag, count]) => ({ tag, count }));
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function main() {
|
|
335
|
+
const economy = new EventEconomy();
|
|
336
|
+
|
|
337
|
+
const command = process.argv[2];
|
|
338
|
+
const args = process.argv.slice(3);
|
|
339
|
+
|
|
340
|
+
try {
|
|
341
|
+
switch (command) {
|
|
342
|
+
case 'list-themes':
|
|
343
|
+
console.log('Available themes:');
|
|
344
|
+
economy.listThemes().forEach(theme => {
|
|
345
|
+
console.log(` - ${theme.name} by ${theme.author} (Quality: ${theme.quality}/100)`);
|
|
346
|
+
});
|
|
347
|
+
break;
|
|
348
|
+
|
|
349
|
+
case 'save-theme':
|
|
350
|
+
if (args.length < 1) {
|
|
351
|
+
console.log('Usage: node event-economy.js save-theme <theme-name> [description]');
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
// This would need theme data - just showing the API
|
|
355
|
+
console.log('Theme saving API ready - integrate with your generator');
|
|
356
|
+
break;
|
|
357
|
+
|
|
358
|
+
case 'stats':
|
|
359
|
+
const stats = economy.getStatistics();
|
|
360
|
+
console.log('Event Economy Statistics:');
|
|
361
|
+
console.log(` Themes: ${stats.totalThemes}`);
|
|
362
|
+
console.log(` Rule Packs: ${stats.totalRulePacks}`);
|
|
363
|
+
console.log(` Content Packs: ${stats.totalContentPacks}`);
|
|
364
|
+
console.log(` Average Quality: ${stats.averageThemeQuality.toFixed(1)}/100`);
|
|
365
|
+
break;
|
|
366
|
+
|
|
367
|
+
default:
|
|
368
|
+
console.log('Event Economy System v2.0.0');
|
|
369
|
+
console.log('');
|
|
370
|
+
console.log('Commands:');
|
|
371
|
+
console.log(' list-themes - List all saved themes');
|
|
372
|
+
console.log(' save-theme - Save a theme (API ready)');
|
|
373
|
+
console.log(' stats - Show system statistics');
|
|
374
|
+
break;
|
|
375
|
+
}
|
|
376
|
+
} catch (error) {
|
|
377
|
+
console.error('Error:', error.message);
|
|
378
|
+
process.exit(1);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// Export for use in other modules
|
|
383
|
+
module.exports = EventEconomy;
|
|
384
|
+
|
|
385
|
+
// Run CLI if called directly
|
|
386
|
+
if (require.main === module) {
|
|
387
|
+
main();
|
|
388
|
+
}
|