Module:GameData/doc: Difference between revisions

Correct mastery checkpoint data for Summoning
(Use SyntaxHighlight)
(Correct mastery checkpoint data for Summoning)
Line 173: Line 173:
if ((categoryName === 'skillData') && dataNode.skillID !== undefined && dataNode.data !== undefined) {
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.getObjectByID(dataNode.skillID);
// For every skill with mastery, add mastery checkpoint descriptions
if (gameSkill instanceof SkillWithMastery && dataNode.data.masteryTokenID !== undefined && dataNode.data.masteryCheckpoints === undefined) {
const localID = this.getLocalID(dataNode.skillID);
dataNode.data.baseMasteryPoolCap = gameSkill.baseMasteryPoolCap;
dataNode.data.masteryCheckpoints = [];
masteryCheckpoints.forEach((pct, idx) => {
dataNode.data.masteryCheckpoints[idx] = getLangString('MASTERY_CHECKPOINT', `${ localID }_${ idx }`);
});
}
if (!this.skillDataInit[dataNode.skillID]) {
if (!this.skillDataInit[dataNode.skillID]) {
const gameSkill = game.skills.getObjectByID(dataNode.skillID);
if (gameSkill !== undefined) {
if (gameSkill !== undefined) {
if (gameSkill.milestones !== undefined && dataNode.data.milestoneCount === undefined) {
if (gameSkill.milestones !== undefined && dataNode.data.milestoneCount === undefined) {
dataNode.data.milestoneCount = gameSkill.milestones.length;
dataNode.data.milestoneCount = gameSkill.milestones.length;
}
// For every skill with mastery, add mastery checkpoint descriptions
if (gameSkill instanceof SkillWithMastery && dataNode.data.masteryTokenID !== undefined && dataNode.data.masteryCheckpoints === undefined) {
const localID = this.getLocalID(dataNode.skillID);
dataNode.data.baseMasteryPoolCap = gameSkill.baseMasteryPoolCap;
dataNode.data.masteryCheckpoints = [];
masteryCheckpoints.forEach((pct, idx) => {
dataNode.data.masteryCheckpoints[idx] = getLangString('MASTERY_CHECKPOINT', `${ localID }_${ idx }`);
});
}
}