17,030
edits
(Initial creation) |
(Update code) |
||
Line 7: | Line 7: | ||
{{SpoilerBox|color=default|title=Code|text=<pre>// TODO: | {{SpoilerBox|color=default|title=Code|text=<pre>// TODO: | ||
// Special attack description generation | // Special attack description generation | ||
class Wiki { | class Wiki { | ||
Line 72: | Line 71: | ||
}; | }; | ||
this.dataPropTransforms.langCustomDescription = this.dataPropTransforms.langHint; | this.dataPropTransforms.langCustomDescription = this.dataPropTransforms.langHint; | ||
}; | }; | ||
async getWikiData() { | async getWikiData() { | ||
Line 208: | Line 199: | ||
}); | }); | ||
} | } | ||
// Special case for skillData so that certain values initialized when the various Skill | |||
// classes are initialized may be added here also | |||
if ( | if ((categoryName === 'skillData') && dataNode.skillID !== undefined && dataNode.data !== undefined) { | ||
// | // We are currently at the topmost level of a skill object | ||
dataNode. | const gameSkill = game.skills.registeredObjects.get(dataNode.skillID); | ||
if (gameSkill !== undefined) { | |||
let importKeys = []; | |||
switch(dataNode.skillID) { | |||
case 'melvorD:Firemaking': | |||
importKeys = [ | |||
'baseAshChance', | |||
'baseStardustChance', | |||
'baseCharcoalChance' | |||
]; | |||
break; | |||
case 'melvorD:Mining': | |||
importKeys = [ | |||
'baseInterval', | |||
'baseRockHP', | |||
'passiveRegenInterval' | |||
]; | |||
break; | |||
case 'melvorD:Smithing': | |||
case 'melvorD:Fletching': | |||
case 'melvorD:Crafting': | |||
case 'melvorD:Runecrafting': | |||
case 'melvorD:Herblore': | |||
case 'melvorD:Summoning': | |||
importKeys = [ | |||
'baseInterval' | |||
]; | |||
break; | |||
case 'melvorD:Thieving': | |||
importKeys = [ | |||
'baseInterval', | |||
'baseStunInterval', | |||
'itemChance', | |||
'baseAreaUniqueChance' | |||
]; | |||
break; | |||
case 'melvorD:Agility': | |||
importKeys = [ | |||
'obstacleUnlockLevels' | |||
]; | |||
break; | |||
case 'melvorD:Astrology': | |||
// Astrology has a number of values stored outside of gameSkill | |||
const astKeys = [ | |||
'standardModifierLevels', | |||
'uniqueModifierLevels', | |||
'standardModifierCosts', | |||
'uniqueModifierCosts', | |||
'baseStardustChance', | |||
'goldenStardustChance', | |||
'baseInterval' | |||
]; | |||
astKeys.forEach((k) => dataNode.data[k] = Astrology[k]); | |||
case 'melvorD:Township': | |||
// Remap a number of keys from their in-game names | |||
const townKeys = [ | |||
{'from': 'TICK_LENGTH', 'to': 'tickLength'}, | |||
{'from': 'MAX_TOWN_SIZE', 'to': 'maxTownSize'}, | |||
{'from': 'SECTION_SIZE', 'to': 'sectionSize'}, | |||
{'from': 'INITIAL_CITIZEN_COUNT', 'to': 'initialCitizenCount'}, | |||
{'from': 'MIN_WORKER_AGE', 'to': 'minWorkerAge'}, | |||
{'from': 'MAX_WORKER_AGE', 'to': 'maxWorkerAge'}, | |||
{'from': 'AGE_OF_DEATH', 'to': 'ageOfDeath'}, | |||
{'from': 'MIN_MIGRATION_AGE', 'to': 'minMigrationAge'}, | |||
{'from': 'MAX_MIGRATION_AGE', 'to': 'maxMigrationAge'}, | |||
{'from': 'BASE_TAX_RATE', 'to': 'baseTaxRate'}, | |||
{'from': 'EDUCATION_PER_CITIZEN', 'to': 'educationPerCitizen'}, | |||
{'from': 'HAPPINESS_PER_CITIZEN', 'to': 'happinessPerCitizen'}, | |||
{'from': 'CITIZEN_FOOD_USAGE', 'to': 'citizenFoodUsage'}, | |||
{'from': 'POPULATION_REQUIRED_FOR_BIRTH', 'to': 'populationRequiredForBirth'}, | |||
{'from': 'BASE_STORAGE', 'to': 'baseStorage'}, | |||
{'from': 'WORSHIP_CHECKPOINTS', 'to': 'worshipCheckpoints'}, | |||
{'from': 'MAX_WORSHIP', 'to': 'maxWorship'}, | |||
{'from': 'populationForTier', 'to': 'populationForTier'}, | |||
]; | |||
townKeys.forEach((k) => dataNode.data[k.to] = gameSkill[k.from]); | |||
} | } | ||
if ( | if (importKeys.length > 0) { | ||
importKeys.forEach((k) => dataNode.data[k] = gameSkill[k]); | |||
} | } | ||
} | } | ||
} | } | ||
} | } |