支持自定义评分规则、支持动态选用、更新相关文档

This commit is contained in:
UCPr 2025-03-27 01:31:46 +08:00
parent 06ec5152a0
commit 504d2792a8
11 changed files with 217 additions and 114 deletions

View file

@ -1,10 +1,6 @@
import { property } from '../lib/convert.js';
import { getSuitImage, getWeaponImage } from '../lib/download.js';
import {
scoreData,
hasScoreData,
getEquipPropertyEnhanceCount
} from '../lib/score.js';
import { getEquipPropertyEnhanceCount } from '../lib/score.js';
import Score from './damage/Score.js';
/**
@ -186,14 +182,13 @@ export class Equip {
/**
* 获取装备属性分数
* @param {string} charID
* @param {{[propID: string]: number}} weight 权重
* @returns {number}
*/
get_score(charID) {
if (hasScoreData(charID)) {
this.properties.forEach(item => item.base_score = scoreData[charID][item.property_id] || 0);
this.score = Score.main(charID, this);
}
get_score(weight) {
if (!weight) return this.score;
this.properties.forEach(item => item.base_score = weight[item.property_id] || 0);
this.score = Score.main(this, weight);
return this.score;
}