17,376
edits
(Resolve property filters not applying to properties whose values were objects; add more property filters) |
(Update code) |
||
Line 210: | Line 210: | ||
// Special case for skillData so that certain values initialized when the various Skill | // Special case for skillData so that certain values initialized when the various Skill | ||
// classes are initialized may be added here also | // classes are initialized may be added here also | ||
if ((categoryName === 'skillData') && dataNode.skillID !== undefined && dataNode.data !== undefined) { | else if ((categoryName === 'skillData') && dataNode.skillID !== undefined && dataNode.data !== undefined) { | ||
// We are currently at the topmost level of a skill object | // We are currently at the topmost level of a skill object | ||
const gameSkill = game.skills.registeredObjects.get(dataNode.skillID); | const gameSkill = game.skills.registeredObjects.get(dataNode.skillID); | ||
Line 305: | Line 305: | ||
// Add namespace entry to game data | // Add namespace entry to game data | ||
this.gameData.namespaces[namespace] = this.namespaces[namespace]; | this.gameData.namespaces[namespace] = this.namespaces[namespace]; | ||
this.registerNonPackData(); | |||
// Consolidate data | // Consolidate data | ||
Object.keys(packData).forEach((categoryName) => { | Object.keys(packData).forEach((categoryName) => { | ||
let categoryData = packData[categoryName]; | |||
// Data must be pushed into the consoldiated data, rules for vary | // Data must be pushed into the consoldiated data, rules for vary | ||
// depending on the category in question | // depending on the category in question | ||
switch(categoryName) { | switch(categoryName) { | ||
case 'combatAreas': | |||
case 'dungeons': | |||
case 'slayerAreas': | |||
// Add area type to each area object | |||
const areaTypes = { | |||
'combatAreas': 'combatArea', | |||
'dungeons': 'dungeon', | |||
'slayerAreas': 'slayerArea' | |||
} | |||
const areaType = areaTypes[categoryName]; | |||
const newData = structuredClone(categoryData); | |||
newData.forEach((x) => x.type = areaType); | |||
categoryData = newData; | |||
case 'ancientSpells': | case 'ancientSpells': | ||
case 'archaicSpells': | case 'archaicSpells': | ||
Line 316: | Line 330: | ||
case 'attacks': | case 'attacks': | ||
case 'auroraSpells': | case 'auroraSpells': | ||
case 'combatEvents': | case 'combatEvents': | ||
case 'combatPassives': | case 'combatPassives': | ||
case 'curseSpells': | case 'curseSpells': | ||
case 'gamemodes': | case 'gamemodes': | ||
case 'itemEffects': | case 'itemEffects': | ||
Line 333: | Line 345: | ||
case 'randomGems': | case 'randomGems': | ||
case 'randomSuperiorGems': | case 'randomSuperiorGems': | ||
case 'shopCategories': | |||
case 'shopPurchases': | case 'shopPurchases': | ||
case 'shopUpgradeChains': | case 'shopUpgradeChains': | ||
case 'stackingEffects': | case 'stackingEffects': | ||
case 'standardSpells': | case 'standardSpells': | ||
Line 352: | Line 364: | ||
case 'combatAreaDisplayOrder': | case 'combatAreaDisplayOrder': | ||
case 'dungeonDisplayOrder': | case 'dungeonDisplayOrder': | ||
case 'shopCategoryOrder': | |||
case 'shopDisplayOrder': | case 'shopDisplayOrder': | ||
case 'slayerAreaDisplayOrder': | case 'slayerAreaDisplayOrder': | ||
Line 436: | Line 449: | ||
} | } | ||
}); | }); | ||
} | |||
registerNonPackData() { | |||
// Some data resides outside of packages. Add any such data to this.gameData within this function | |||
if (this.gameData.combatTriangles === undefined) { | |||
const ctData = []; | |||
Object.keys(COMBAT_TRIANGLE_IDS).forEach((id) => { | |||
const newObj = structuredClone(combatTriangle[COMBAT_TRIANGLE_IDS[id]]); | |||
newObj.id = id; | |||
ctData.push(newObj); | |||
}); | |||
this.gameData.combatTriangles = ctData; | |||
} | |||
} | } | ||
getNamespacedID(namespace, ID) { | getNamespacedID(namespace, ID) { |