mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 21:27:47 +00:00
feat: 角色天赋图鉴(支持自定义等级)
This commit is contained in:
parent
4f02e6b2ce
commit
15b14eece4
23 changed files with 937 additions and 124 deletions
19
lib/hakush.js
Normal file
19
lib/hakush.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { Character } from '../model/hakush/character.js';
|
||||
import * as convert from './convert.js';
|
||||
import { getHakushCharacter } from './download.js';
|
||||
export const getHakushCharacterData = async alias => {
|
||||
const name = convert.char.aliasToName(alias);
|
||||
const id = convert.char.charNameToID(name);
|
||||
if (!id) return null;
|
||||
const data = await getHakushCharacter(id);
|
||||
if (!data) return null;
|
||||
const result = new Character(data);
|
||||
return result;
|
||||
};
|
||||
|
||||
export const isSkillLevelLegal = (key, level) => {
|
||||
if (key === 'CoreLevel') {
|
||||
return !!level && level >= 0 && level <= 6;
|
||||
}
|
||||
return !!level && level >= 1 && level <= 12;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue