mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 21:27:47 +00:00
feat: panel
This commit is contained in:
parent
35c8c95b80
commit
27171c5727
77 changed files with 2126 additions and 312 deletions
|
|
@ -27,7 +27,7 @@ export const IDToCharName = (id, full = true, en = false) => {
|
|||
export const IDToCharSprite = id => {
|
||||
const data = PartnerId2SpriteId?.[id];
|
||||
if (!data) return null;
|
||||
return data?.['sprite'];
|
||||
return data?.['sprite_id'];
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
19
lib/convert/equip.js
Normal file
19
lib/convert/equip.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { getMapData } from '../../utils/file.js';
|
||||
|
||||
const equipData = getMapData('EquipId2Data');
|
||||
|
||||
/**
|
||||
* 获取驱动盘装备的图片
|
||||
* @param {string | number} equipId
|
||||
* @returns {string | null}
|
||||
*/
|
||||
export function equipIdToSprite(equipId) {
|
||||
equipId = equipId.toString();
|
||||
if (equipId.length === 5) {
|
||||
const suitId = equipId.slice(0, 3) + '00';
|
||||
if (equipData.hasOwnProperty(suitId)) {
|
||||
return equipData[suitId]['sprite_file'].replace('3D', '');
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
41
lib/convert/property.js
Normal file
41
lib/convert/property.js
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
const prop_id = {
|
||||
111: 'hpmax',
|
||||
121: 'attack',
|
||||
131: 'def',
|
||||
122: 'breakstun',
|
||||
201: 'crit',
|
||||
211: 'critdam',
|
||||
314: 'elementabnormalpower',
|
||||
312: 'elementmystery',
|
||||
231: 'penratio',
|
||||
232: 'penvalue',
|
||||
305: 'sprecover',
|
||||
310: 'spgetratio',
|
||||
115: 'spmax',
|
||||
315: 'physdmg',
|
||||
316: 'fire',
|
||||
317: 'ice',
|
||||
318: 'thunder',
|
||||
319: 'dungeonbuffether',
|
||||
};
|
||||
|
||||
const pro_id = {
|
||||
1: 'attack',
|
||||
2: 'stun',
|
||||
3: 'anomaly',
|
||||
4: 'support',
|
||||
5: 'defense',
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取属性css类名
|
||||
* @param {string} _id 属性id
|
||||
* @returns {string | null}
|
||||
*/
|
||||
export function idToClassName(_id) {
|
||||
let propId = _id.toString();
|
||||
propId = propId.slice(0, 3);
|
||||
const propIcon = prop_id[propId];
|
||||
if (!propIcon) return null;
|
||||
return propIcon;
|
||||
}
|
||||
14
lib/convert/rank.js
Normal file
14
lib/convert/rank.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
const RANK_MAP = {
|
||||
4: 'S',
|
||||
3: 'A',
|
||||
2: 'B',
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取星级对应的字母
|
||||
* @param {string | number} id
|
||||
* @returns {string}
|
||||
*/
|
||||
export function getRankChar(id) {
|
||||
return RANK_MAP[id] || '';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue