皮肤:武将、时装表修改

This commit is contained in:
luying
2021-10-19 11:08:01 +08:00
parent b6a904b091
commit da5a43abba
13 changed files with 3205 additions and 2754 deletions

View File

@@ -1,31 +1,39 @@
// 时装表
import { decodeArrayListStr, readFileAndParse } from '../util';
import { FILENAME } from '../../consts';
const _ = require('lodash');
export interface DicFashions {
// 时装id
readonly id: number;
// 皮肤装名
readonly name: string;
// 指向heroSkill表
readonly skillId: number;
// 全局加成
readonly globalAttr: Array<{id: number, number: number}>;
// 单体加成
readonly actorAttr: Array<{id: number, number: number}>;
// 角色id
// 即武将表里的heroId
readonly heroId: number;
// 原武将id300以内的武将id
readonly actorId: number;
}
type KeysEnum<T> = { [P in keyof Required<T>]: true };
const DicFashionsKeys: KeysEnum<DicFashions> = { id: true, name: true, globalAttr: true, actorAttr: true, heroId: true, actorId: true};
export const dicFashions = new Map<number, DicFashions>();
export const dicFashionsByHeroId = new Map<number, DicFashions>();
export function loadFashions() {
dicFashions.clear();
dicFashionsByHeroId.clear();
let arr = readFileAndParse(FILENAME.DIC_FASHIONS);
arr.forEach(o => {
o.id = o.goodId;
o.globalAttr = parseAttr(o.globalAttr);
o.actorAttr = parseAttr(o.actorAttr);
dicFashions.set(o.id, o);
dicFashions.set(o.id, _.pick(o, Object.keys(DicFashionsKeys)));
dicFashionsByHeroId.set(o.heroId, _.pick(o, Object.keys(DicFashionsKeys)));
});
arr = undefined;
}
@@ -39,6 +47,6 @@ function parseAttr(str: string) {
throw new Error('data table format wrong');
}
result.push({id: parseInt(id), number: parseInt(number)});
}
}
return result
}

View File

@@ -13,8 +13,10 @@ export interface DicHero {
readonly quality: number;
// 阵营
readonly camp: number;
// 兵种
readonly jobid: number;
// 兵种大类
readonly jobClass: number;
// 兵种初始阶层
readonly jobid: number;
// 技能
readonly skill: number;
// 武将碎片
@@ -34,7 +36,7 @@ export interface DicHero {
}
type KeysEnum<T> = { [P in keyof Required<T>]: true };
const DicHeroKeys: KeysEnum<DicHero> = {heroId: true, name: true, quality: true, camp: true, jobid: true, skill: true, pieceId: true, initialStars: true, pieceCount: true, baseAbilityArr: true, baseAbilityUpArr: true, initialSkin: true, recruit: true, face_id: true};
const DicHeroKeys: KeysEnum<DicHero> = {heroId: true, name: true, quality: true, camp: true, jobClass: true, jobid: true, skill: true, pieceId: true, initialStars: true, pieceCount: true, baseAbilityArr: true, baseAbilityUpArr: true, initialSkin: true, recruit: true, face_id: true};
export const dicMyHeroes = new Array<number>();
export const dicHero = new Map<number, DicHero>();
export function loadHero() {