mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-17 05:37:46 +00:00
initial upload
This commit is contained in:
commit
1c65f10e24
58 changed files with 2533 additions and 0 deletions
218
model/avatar.js
Normal file
218
model/avatar.js
Normal file
|
|
@ -0,0 +1,218 @@
|
|||
/**
|
||||
* @class
|
||||
*/
|
||||
export class Avatar {
|
||||
/**
|
||||
* @param {number} id
|
||||
* @param {number} level
|
||||
* @param {string} name_mi18n
|
||||
* @param {string} full_name_mi18n
|
||||
* @param {number} element_type
|
||||
* @param {string} camp_name_mi18n
|
||||
* @param {number} avatar_profession
|
||||
* @param {string} rarity
|
||||
* @param {string} group_icon_path
|
||||
* @param {string} hollow_icon_path
|
||||
* @param {number} rank
|
||||
* @param {boolean} is_chosen
|
||||
*/
|
||||
constructor(
|
||||
id,
|
||||
level,
|
||||
name_mi18n,
|
||||
full_name_mi18n,
|
||||
element_type,
|
||||
camp_name_mi18n,
|
||||
avatar_profession,
|
||||
rarity,
|
||||
group_icon_path,
|
||||
hollow_icon_path,
|
||||
rank,
|
||||
is_chosen
|
||||
) {
|
||||
this.id = id;
|
||||
this.level = level;
|
||||
this.name_mi18n = name_mi18n;
|
||||
this.full_name_mi18n = full_name_mi18n;
|
||||
this.element_type = element_type;
|
||||
this.camp_name_mi18n = camp_name_mi18n;
|
||||
this.avatar_profession = avatar_profession;
|
||||
this.rarity = rarity;
|
||||
this.group_icon_path = group_icon_path;
|
||||
this.hollow_icon_path = hollow_icon_path;
|
||||
this.rank = rank;
|
||||
this.is_chosen = is_chosen;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class AvatarIconPaths {
|
||||
/**
|
||||
* @param {string} group_icon_path
|
||||
* @param {string} hollow_icon_path
|
||||
*/
|
||||
constructor(group_icon_path, hollow_icon_path) {
|
||||
this.group_icon_path = group_icon_path;
|
||||
this.hollow_icon_path = hollow_icon_path;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class ZZZAvatarBasic {
|
||||
/**
|
||||
* @param {number} id
|
||||
* @param {number} level
|
||||
* @param {string} name_mi18n
|
||||
* @param {string} full_name_mi18n
|
||||
* @param {number} element_type
|
||||
* @param {string} camp_name_mi18n
|
||||
* @param {number} avatar_profession
|
||||
* @param {string} rarity
|
||||
* @param {AvatarIconPaths} icon_paths
|
||||
* @param {number} rank
|
||||
* @param {boolean} is_chosen
|
||||
*/
|
||||
constructor(
|
||||
id,
|
||||
level,
|
||||
name_mi18n,
|
||||
full_name_mi18n,
|
||||
element_type,
|
||||
camp_name_mi18n,
|
||||
avatar_profession,
|
||||
rarity,
|
||||
icon_paths,
|
||||
rank,
|
||||
is_chosen
|
||||
) {
|
||||
this.id = id;
|
||||
this.level = level;
|
||||
this.name_mi18n = name_mi18n;
|
||||
this.full_name_mi18n = full_name_mi18n;
|
||||
this.element_type = element_type;
|
||||
this.camp_name_mi18n = camp_name_mi18n;
|
||||
this.avatar_profession = avatar_profession;
|
||||
this.rarity = rarity;
|
||||
this.icon_paths = icon_paths;
|
||||
this.rank = rank;
|
||||
this.is_chosen = is_chosen;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class Rank {
|
||||
/**
|
||||
* @param {number} id
|
||||
* @param {string} name
|
||||
* @param {string} desc
|
||||
* @param {number} pos
|
||||
* @param {boolean} is_unlocked
|
||||
*/
|
||||
constructor(id, name, desc, pos, is_unlocked) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.desc = desc;
|
||||
this.pos = pos;
|
||||
this.is_unlocked = is_unlocked;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class ZZZAvatarInfo {
|
||||
/**
|
||||
* @param {number} id
|
||||
* @param {number} level
|
||||
* @param {string} name_mi18n
|
||||
* @param {string} full_name_mi18n
|
||||
* @param {number} element_type
|
||||
* @param {string} camp_name_mi18n
|
||||
* @param {number} avatar_profession
|
||||
* @param {string} rarity
|
||||
* @param {string} group_icon_path
|
||||
* @param {string} hollow_icon_path
|
||||
* @param {Equip[]} equip
|
||||
* @param {Weapon} weapon
|
||||
* @param {Property[]} properties
|
||||
* @param {Skill[]} skills
|
||||
* @param {number} rank
|
||||
* @param {Rank[]} ranks
|
||||
*/
|
||||
constructor(
|
||||
id,
|
||||
level,
|
||||
name_mi18n,
|
||||
full_name_mi18n,
|
||||
element_type,
|
||||
camp_name_mi18n,
|
||||
avatar_profession,
|
||||
rarity,
|
||||
group_icon_path,
|
||||
hollow_icon_path,
|
||||
equip,
|
||||
weapon,
|
||||
properties,
|
||||
skills,
|
||||
rank,
|
||||
ranks
|
||||
) {
|
||||
this.id = id;
|
||||
this.level = level;
|
||||
this.name_mi18n = name_mi18n;
|
||||
this.full_name_mi18n = full_name_mi18n;
|
||||
this.element_type = element_type;
|
||||
this.camp_name_mi18n = camp_name_mi18n;
|
||||
this.avatar_profession = avatar_profession;
|
||||
this.rarity = rarity;
|
||||
this.group_icon_path = group_icon_path;
|
||||
this.hollow_icon_path = hollow_icon_path;
|
||||
this.equip = equip;
|
||||
this.weapon = weapon;
|
||||
this.properties = properties;
|
||||
this.skills = skills;
|
||||
this.rank = rank;
|
||||
this.ranks = ranks;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class ZZZUser {
|
||||
/**
|
||||
* @param {string} game_biz
|
||||
* @param {string} region
|
||||
* @param {string} game_uid
|
||||
* @param {string} nickname
|
||||
* @param {number} level
|
||||
* @param {boolean} is_chosen
|
||||
* @param {string} region_name
|
||||
* @param {boolean} is_official
|
||||
*/
|
||||
constructor(
|
||||
game_biz,
|
||||
region,
|
||||
game_uid,
|
||||
nickname,
|
||||
level,
|
||||
is_chosen,
|
||||
region_name,
|
||||
is_official
|
||||
) {
|
||||
this.game_biz = game_biz;
|
||||
this.region = region;
|
||||
this.game_uid = game_uid;
|
||||
this.nickname = nickname;
|
||||
this.level = level;
|
||||
this.is_chosen = is_chosen;
|
||||
this.region_name = region_name;
|
||||
this.is_official = is_official;
|
||||
}
|
||||
}
|
||||
27
model/bangboo.js
Normal file
27
model/bangboo.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/**
|
||||
* @class
|
||||
*/
|
||||
export class BangbooWiki {
|
||||
/**
|
||||
* @param {string} item_id
|
||||
* @param {string} wiki_url
|
||||
*/
|
||||
constructor(item_id, wiki_url) {
|
||||
this.item_id = item_id;
|
||||
this.wiki_url = wiki_url;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class ZZZBangbooResp {
|
||||
/**
|
||||
* @param {Item[]} items
|
||||
* @param {BangbooWiki} bangboo_wiki
|
||||
*/
|
||||
constructor(items, bangboo_wiki) {
|
||||
this.items = items;
|
||||
this.bangboo_wiki = bangboo_wiki;
|
||||
}
|
||||
}
|
||||
133
model/equip.js
Normal file
133
model/equip.js
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
/**
|
||||
* @class
|
||||
*/
|
||||
export class EquipProperty {
|
||||
/**
|
||||
* @param {string} property_name
|
||||
* @param {number} property_id
|
||||
* @param {string} base
|
||||
*/
|
||||
constructor(property_name, property_id, base) {
|
||||
this.property_name = property_name;
|
||||
this.property_id = property_id;
|
||||
this.base = base;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class EquipMainProperty {
|
||||
/**
|
||||
* @param {string} property_name
|
||||
* @param {number} property_id
|
||||
* @param {string} base
|
||||
*/
|
||||
constructor(property_name, property_id, base) {
|
||||
this.property_name = property_name;
|
||||
this.property_id = property_id;
|
||||
this.base = base;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class EquipSuit {
|
||||
/**
|
||||
* @param {number} suit_id
|
||||
* @param {string} name
|
||||
* @param {number} own
|
||||
* @param {string} desc1
|
||||
* @param {string} desc2
|
||||
*/
|
||||
constructor(suit_id, name, own, desc1, desc2) {
|
||||
this.suit_id = suit_id;
|
||||
this.name = name;
|
||||
this.own = own;
|
||||
this.desc1 = desc1;
|
||||
this.desc2 = desc2;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class Equip {
|
||||
/**
|
||||
* @param {number} id
|
||||
* @param {number} level
|
||||
* @param {string} name
|
||||
* @param {string} icon
|
||||
* @param {string} rarity
|
||||
* @param {EquipProperty[]} properties
|
||||
* @param {EquipMainProperty[]} main_properties
|
||||
* @param {EquipSuit} equip_suit
|
||||
* @param {number} equipment_type
|
||||
*/
|
||||
constructor(
|
||||
id,
|
||||
level,
|
||||
name,
|
||||
icon,
|
||||
rarity,
|
||||
properties,
|
||||
main_properties,
|
||||
equip_suit,
|
||||
equipment_type
|
||||
) {
|
||||
this.id = id;
|
||||
this.level = level;
|
||||
this.name = name;
|
||||
this.icon = icon;
|
||||
this.rarity = rarity;
|
||||
this.properties = properties;
|
||||
this.main_properties = main_properties;
|
||||
this.equip_suit = equip_suit;
|
||||
this.equipment_type = equipment_type;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class Weapon {
|
||||
/**
|
||||
* @param {number} id
|
||||
* @param {number} level
|
||||
* @param {string} name
|
||||
* @param {number} star
|
||||
* @param {string} icon
|
||||
* @param {string} rarity
|
||||
* @param {EquipProperty[]} properties
|
||||
* @param {EquipMainProperty[]} main_properties
|
||||
* @param {string} talent_title
|
||||
* @param {string} talent_content
|
||||
* @param {number} profession
|
||||
*/
|
||||
constructor(
|
||||
id,
|
||||
level,
|
||||
name,
|
||||
star,
|
||||
icon,
|
||||
rarity,
|
||||
properties,
|
||||
main_properties,
|
||||
talent_title,
|
||||
talent_content,
|
||||
profession
|
||||
) {
|
||||
this.id = id;
|
||||
this.level = level;
|
||||
this.name = name;
|
||||
this.star = star;
|
||||
this.icon = icon;
|
||||
this.rarity = rarity;
|
||||
this.properties = properties;
|
||||
this.main_properties = main_properties;
|
||||
this.talent_title = talent_title;
|
||||
this.talent_content = talent_content;
|
||||
this.profession = profession;
|
||||
}
|
||||
}
|
||||
63
model/gacha.js
Normal file
63
model/gacha.js
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/**
|
||||
* @class
|
||||
*/
|
||||
export class SingleGachaLog {
|
||||
/**
|
||||
* @param {string} uid
|
||||
* @param {string} gacha_id
|
||||
* @param {string} gacha_type
|
||||
* @param {string} item_id
|
||||
* @param {string} count
|
||||
* @param {string} time
|
||||
* @param {string} name
|
||||
* @param {string} lang
|
||||
* @param {string} item_type
|
||||
* @param {string} rank_type
|
||||
* @param {string} id
|
||||
*/
|
||||
constructor(
|
||||
uid,
|
||||
gacha_id,
|
||||
gacha_type,
|
||||
item_id,
|
||||
count,
|
||||
time,
|
||||
name,
|
||||
lang,
|
||||
item_type,
|
||||
rank_type,
|
||||
id
|
||||
) {
|
||||
this.uid = uid;
|
||||
this.gacha_id = gacha_id;
|
||||
this.gacha_type = gacha_type;
|
||||
this.item_id = item_id;
|
||||
this.count = count;
|
||||
this.time = time;
|
||||
this.name = name;
|
||||
this.lang = lang;
|
||||
this.item_type = item_type;
|
||||
this.rank_type = rank_type;
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class ZZZGachaLogResp {
|
||||
/**
|
||||
* @param {string} page
|
||||
* @param {string} size
|
||||
* @param {SingleGachaLog[]} list
|
||||
* @param {string} region
|
||||
* @param {number} region_time_zone
|
||||
*/
|
||||
constructor(page, size, list, region, region_time_zone) {
|
||||
this.page = page;
|
||||
this.size = size;
|
||||
this.list = list;
|
||||
this.region = region;
|
||||
this.region_time_zone = region_time_zone;
|
||||
}
|
||||
}
|
||||
83
model/index.js
Normal file
83
model/index.js
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
/**
|
||||
* @class
|
||||
*/
|
||||
export class Buddy {
|
||||
/**
|
||||
* @param {number} id
|
||||
* @param {string} name
|
||||
* @param {string} rarity
|
||||
* @param {number} level
|
||||
* @param {number} star
|
||||
*/
|
||||
constructor(id, name, rarity, level, star) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.rarity = rarity;
|
||||
this.level = level;
|
||||
this.star = star;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class Stats {
|
||||
/**
|
||||
* @param {number} active_days
|
||||
* @param {number} avatar_num
|
||||
* @param {string} world_level_name
|
||||
* @param {number} cur_period_zone_layer_count
|
||||
* @param {number} buddy_num
|
||||
*/
|
||||
constructor(
|
||||
active_days,
|
||||
avatar_num,
|
||||
world_level_name,
|
||||
cur_period_zone_layer_count,
|
||||
buddy_num
|
||||
) {
|
||||
this.active_days = active_days;
|
||||
this.avatar_num = avatar_num;
|
||||
this.world_level_name = world_level_name;
|
||||
this.cur_period_zone_layer_count = cur_period_zone_layer_count;
|
||||
this.buddy_num = buddy_num;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class ZZZIndexResp {
|
||||
/**
|
||||
* @param {Stats} stats
|
||||
* @param {Avatar[]} avatar_list
|
||||
* @param {string} cur_head_icon_url
|
||||
* @param {Buddy[]} buddy_list
|
||||
*/
|
||||
constructor(stats, avatar_list, cur_head_icon_url, buddy_list) {
|
||||
this.stats = stats;
|
||||
this.avatar_list = avatar_list;
|
||||
this.cur_head_icon_url = cur_head_icon_url;
|
||||
this.buddy_list = buddy_list;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class Item {
|
||||
/**
|
||||
* @param {number} id
|
||||
* @param {string} name
|
||||
* @param {string} rarity
|
||||
* @param {number} level
|
||||
* @param {number} star
|
||||
*/
|
||||
constructor(id, name, rarity, level, star) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.rarity = rarity;
|
||||
this.level = level;
|
||||
this.star = star;
|
||||
}
|
||||
}
|
||||
103
model/note.js
Normal file
103
model/note.js
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
import { converSecondsToHM } from '../utils/time.js';
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class Vitality {
|
||||
/**
|
||||
* @param {number} max
|
||||
* @param {number} current
|
||||
*/
|
||||
constructor(max, current) {
|
||||
this.max = max;
|
||||
this.current = current;
|
||||
}
|
||||
get finish() {
|
||||
return this.max === this.current;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class VhsSale {
|
||||
/**
|
||||
* @param {string} sale_state
|
||||
*/
|
||||
constructor(sale_state) {
|
||||
this.sale_state = sale_state;
|
||||
}
|
||||
get state() {
|
||||
if (this.sale_state.includes('Doing')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
get state_label() {
|
||||
if (this.sale_state.includes('Doing')) {
|
||||
return '正在营业';
|
||||
}
|
||||
return '尚未营业';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class EnergyProgress {
|
||||
/**
|
||||
* @param {number} max
|
||||
* @param {number} current
|
||||
*/
|
||||
constructor(max, current) {
|
||||
this.max = max;
|
||||
this.current = current;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class Energy {
|
||||
/**
|
||||
* @param {EnergyProgress} progress
|
||||
* @param {number} restore
|
||||
*/
|
||||
constructor(progress, restore) {
|
||||
this.progress = progress;
|
||||
this.restore = restore;
|
||||
const leftHM = converSecondsToHM(restore);
|
||||
this.progress.rest = `${leftHM[0]}小时${leftHM[1]}分钟`;
|
||||
this.percent = parseInt((progress.current / progress.max) * 100);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class ZZZNoteResp {
|
||||
/**
|
||||
* @param {{ energy: Energy, vitality:Vitality, vhs_sale: VhsSale, card_sign: string }} data
|
||||
*/
|
||||
constructor(data) {
|
||||
const { energy, vitality, vhs_sale, card_sign } = data;
|
||||
this.energy = new Energy(energy.progress, energy.restore);
|
||||
this.vitality = new Vitality(vitality.max, vitality.current);
|
||||
this.vhs_sale = new VhsSale(vhs_sale.sale_state);
|
||||
this.card_sign = card_sign;
|
||||
}
|
||||
|
||||
get sign() {
|
||||
if (this.card_sign?.includes('Done')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
get sign_label() {
|
||||
if (this.card_sign?.includes('Done')) {
|
||||
return '已抽奖';
|
||||
}
|
||||
return '未抽奖';
|
||||
}
|
||||
}
|
||||
19
model/property.js
Normal file
19
model/property.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* @class
|
||||
*/
|
||||
class Property {
|
||||
/**
|
||||
* @param {string} property_name
|
||||
* @param {number} property_id
|
||||
* @param {string} base
|
||||
* @param {string} add
|
||||
* @param {string} final
|
||||
*/
|
||||
constructor(property_name, property_id, base, add, final) {
|
||||
this.property_name = property_name;
|
||||
this.property_id = property_id;
|
||||
this.base = base;
|
||||
this.add = add;
|
||||
this.final = final;
|
||||
}
|
||||
}
|
||||
29
model/skill.js
Normal file
29
model/skill.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/**
|
||||
* @class
|
||||
*/
|
||||
export class SkillItem {
|
||||
/**
|
||||
* @param {string} title
|
||||
* @param {string} text
|
||||
*/
|
||||
constructor(title, text) {
|
||||
this.title = title;
|
||||
this.text = text;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
export class Skill {
|
||||
/**
|
||||
* @param {number} level
|
||||
* @param {number} skill_type
|
||||
* @param {SkillItem[]} items
|
||||
*/
|
||||
constructor(level, skill_type, items) {
|
||||
this.level = level;
|
||||
this.skill_type = skill_type;
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue