mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 13:17:32 +00:00
feature:角色面板新增词条统计
This commit is contained in:
parent
6081513de5
commit
b51cf93758
8 changed files with 267 additions and 78 deletions
|
|
@ -44,28 +44,37 @@ export function idToClassName(_id) {
|
|||
|
||||
/**
|
||||
* 获取属性标识
|
||||
* @param {string | number} _id 属性id
|
||||
* @param {string | number} id 属性id
|
||||
* @returns {string | null}
|
||||
*/
|
||||
export const idToSignName = _id => {
|
||||
const id = _id.toString();
|
||||
export const idToSignName = id => {
|
||||
const result = propertyData[id];
|
||||
if (!result) return null;
|
||||
return result[0];
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取属性名称
|
||||
* @param {string | number} _id 属性id
|
||||
* 获取属性全称
|
||||
* @param {string | number} id 属性id
|
||||
* @returns {string | null}
|
||||
*/
|
||||
export const idToName = _id => {
|
||||
const id = _id.toString();
|
||||
export const idToName = id => {
|
||||
const result = propertyData[id];
|
||||
if (!result) return null;
|
||||
return result[1];
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取属性二字简称
|
||||
* @param {string | number} id 属性id
|
||||
* @returns {string | null}
|
||||
*/
|
||||
export const idToShortName = id => {
|
||||
const result = propertyData[id];
|
||||
if (!result) return null;
|
||||
return result[2];
|
||||
};
|
||||
|
||||
/**
|
||||
* 属性名转id
|
||||
* @param {string} propName 属性名
|
||||
|
|
|
|||
13
lib/score.js
13
lib/score.js
|
|
@ -48,14 +48,7 @@ for (const charName in equipScore) {
|
|||
* @returns {number}
|
||||
*/
|
||||
export const getEquipPropertyEnhanceCount = (propertyID, value) => {
|
||||
if (value.includes('%')) {
|
||||
value = value.replace('%', '');
|
||||
}
|
||||
value = Number(value);
|
||||
propertyID = String(propertyID);
|
||||
const baseValue = baseValueData[propertyID] || 0;
|
||||
if (baseValue === 0) {
|
||||
return 0;
|
||||
}
|
||||
return value / baseValue - 1;
|
||||
const baseValue = baseValueData[propertyID];
|
||||
value = +value.replace('%', '');
|
||||
return value / baseValue - 1 || 0;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue