diff --git a/lib/score.js b/lib/score.js index 5095a41..6de22f2 100644 --- a/lib/score.js +++ b/lib/score.js @@ -29,7 +29,7 @@ export const getEquipPropertyBaseScore = (charID, propertyID) => { /** * 获取装备属性分数 * @param {string} charID 角色id - * @param {string} propertyID 属性id + * @param {number} propertyID 属性id * @param {string} value 属性值 * @returns {number} */ @@ -38,6 +38,7 @@ export const getEquipPropertyScore = (charID, propertyID, value) => { value = value.replace('%', ''); } value = Number(value); + propertyID = String(propertyID); const baseScore = getEquipPropertyBaseScore(charID, propertyID); let finalScore = baseScore * value; switch (propertyID) { diff --git a/model/avatar.js b/model/avatar.js index 3d7ba9c..7bc74f2 100644 --- a/model/avatar.js +++ b/model/avatar.js @@ -400,14 +400,14 @@ export class ZZZAvatarInfo { return damagelist; } - /** @type {number|boolean} */ + /** @type {string|boolean} */ get equip_score() { if (hasScoreData(this.id)) { let score = 0; for (const equip of this.equip) { score += equip.score; } - return score; + return score.toFixed(2); } return false; }