mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 05:07:46 +00:00
Upd:零号·安比评分、评分权重ID转中文
This commit is contained in:
parent
a860c9c176
commit
de597aba8a
3 changed files with 412 additions and 370 deletions
|
|
@ -65,3 +65,14 @@ export const idToName = _id => {
|
|||
if (!result) return null;
|
||||
return result[1];
|
||||
};
|
||||
|
||||
/**
|
||||
* 属性名转id
|
||||
* @param {string} propName 属性名
|
||||
*/
|
||||
export const nameToId = (propName) => {
|
||||
for (const id in propertyData) {
|
||||
if (propertyData[id]?.[1] === propName) return Number(id);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
|
|
|||
17
lib/score.js
17
lib/score.js
|
|
@ -1,7 +1,22 @@
|
|||
import { getMapData } from '../utils/file.js';
|
||||
import { charNameToID } from './convert/char.js';
|
||||
import { nameToId } from './convert/property.js';
|
||||
|
||||
const scoreData = getMapData('EquipScore');
|
||||
const baseValueData = getMapData('EquipBaseValue');
|
||||
const equipScore = getMapData('EquipScore');
|
||||
const scoreData = {};
|
||||
for (const charName in equipScore) {
|
||||
const charID = charNameToID(charName);
|
||||
if (!charID)
|
||||
continue;
|
||||
scoreData[charID] = {};
|
||||
for (const propName in equipScore[charName]) {
|
||||
const propID = nameToId(propName);
|
||||
if (!propID)
|
||||
continue;
|
||||
scoreData[charID][propID] = equipScore[charName][propName];
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* 是否有分数数据
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue