rpg-event-generator 2.0.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 CHANGED
@@ -1,8 +1,8 @@
1
- # RPG Event Generator v2.0.0
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.0
5
+ ## ✨ What's New in v2.0.1
6
6
 
7
7
  - 🎨 **Theme Creator**: Build custom themes with your own training data
8
8
  - 🧠 **Rule Engine**: Create conditional rules that modify event generation
@@ -81,7 +81,7 @@ Since this is a personal project with a private repository:
81
81
  - **NPC Relationships**: Dynamic character relationship networks and social consequences
82
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
83
 
84
- ### Revolutionary Features (v2.0.0) 🎉
84
+ ### Revolutionary Features (v2.0.1) 🎉
85
85
 
86
86
  - **🎨 Theme Creator**: Design custom game worlds with your own training data and atmospheric text
87
87
  - **🧠 Rule Engine**: Create sophisticated conditional rules that dynamically modify events based on player state, location, stats, and more
@@ -1008,7 +1008,8 @@ const generator = new RPGEventGenerator({
1008
1008
  enableRuleEngine: true, // Enable custom rules system
1009
1009
  customRules: {}, // Pre-load custom rules
1010
1010
  pureMarkovMode: false, // Generate purely from training data
1011
- templateLibrary: null // Load specific template genre
1011
+ templateLibrary: null, // Load specific template genre
1012
+ chance: new Chance() // Custom Chance.js instance (optional)
1012
1013
  });
1013
1014
  ```
1014
1015
 
@@ -1060,6 +1061,21 @@ const enhancedGenerator = new RPGEventGenerator({
1060
1061
  - Efficient template loading
1061
1062
  - Better memory management for large template libraries
1062
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
+ });
1077
+ ```
1078
+
1063
1079
  ## 🎮 Game Integration
1064
1080
 
1065
1081
  ### Real-Time Strategy Integration
package/dist/index.js CHANGED
@@ -118,6 +118,7 @@ class RPGEventGenerator {
118
118
  /**
119
119
  * Create a new event generator
120
120
  * @param {Object} options - Configuration options
121
+ * @param {Chance} options.chance - Chance.js instance (optional, will create new if not provided)
121
122
  * @param {number} options.stateSize - Markov chain state size (default: 2)
122
123
  * @param {Array} options.trainingData - Custom training data for Markov chains
123
124
  * @param {string} options.theme - Theme for event generation: 'fantasy', 'sci-fi', 'historical'
@@ -126,7 +127,7 @@ class RPGEventGenerator {
126
127
  * @param {string} options.templateLibrary - Genre to load templates from: 'fantasy', 'sci-fi', 'horror', 'historical'
127
128
  */
128
129
  constructor(options = {}) {
129
- this.chance = new Chance();
130
+ this.chance = options.chance || new Chance();
130
131
  this.markovGenerator = new SimpleMarkovGenerator({
131
132
  stateSize: options.stateSize || 2
132
133
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rpg-event-generator",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
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": [