mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 13:17:32 +00:00
完全重构伤害计算;支持异常伤害计算;支持所有武器、套装计算;新增悠真计算等
This commit is contained in:
parent
f7e1066773
commit
3f8e64af66
99 changed files with 4243 additions and 1615 deletions
|
|
@ -30,3 +30,26 @@ export const weaponFileNameToID = name => {
|
|||
export const getAllWeaponID = () => {
|
||||
return Object.keys(WeaponId2Sprite);
|
||||
};
|
||||
|
||||
const WeaponId2Data = getMapData('WeaponId2Data');
|
||||
|
||||
/**
|
||||
* 武器名称转id
|
||||
* @param {string} name 武器全称
|
||||
* @returns {number | null}
|
||||
*/
|
||||
export const weaponNameToID = name => {
|
||||
for (const [id, data] of Object.entries(WeaponId2Data)) {
|
||||
if (data.name === name) return +id;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 武器ID转职业
|
||||
* @param {number} id 武器全称
|
||||
* @returns {number | null}
|
||||
*/
|
||||
export const weaponIDToProfession = id => {
|
||||
return WeaponId2Data[id]?.profession ?? null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue