feat: rpg stats improvements
This commit is contained in:
@@ -43,6 +43,12 @@
|
||||
* Example: { "Health": 85, "Energy": 70, "Custom Stat": 50 }
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object.<string, number>} TrackerAttributes
|
||||
* Dynamic attributes object - keys are attribute names from config (e.g., STR, DEX), values are numeric
|
||||
* Example: { "STR": 15, "DEX": 12, "INT": 18 }
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {Object} TrackerStatus
|
||||
* @property {string} [mood] - Mood emoji (if enabled)
|
||||
@@ -84,6 +90,8 @@
|
||||
* @typedef {Object} TrackerData
|
||||
* @property {TrackerStats} [stats] - Numeric stats (based on config)
|
||||
* @property {TrackerStatus} [status] - Status info (mood, custom fields)
|
||||
* @property {TrackerAttributes} [attributes] - RPG attributes (STR, DEX, etc.)
|
||||
* @property {number} [level] - Character level
|
||||
* @property {TrackerInfoBox} [infoBox] - Scene information (based on enabled widgets)
|
||||
* @property {TrackerCharacter[]} [characters] - Present characters
|
||||
* @property {TrackerInventory} [inventory] - Player inventory
|
||||
@@ -431,6 +439,14 @@ export function mergeTrackerData(existing, newData) {
|
||||
};
|
||||
}
|
||||
|
||||
if (newData.attributes) {
|
||||
merged.attributes = { ...merged.attributes, ...newData.attributes };
|
||||
}
|
||||
|
||||
if (newData.level !== undefined) {
|
||||
merged.level = newData.level;
|
||||
}
|
||||
|
||||
if (newData.infoBox) {
|
||||
merged.infoBox = { ...merged.infoBox, ...newData.infoBox };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user