feat(武将): 重生体验优化 ca13e8be3 至 4ee246e78

This commit is contained in:
luying
2023-08-29 16:29:19 +08:00
parent 878d80f069
commit 820bfe170a
8 changed files with 155 additions and 9 deletions

View File

@@ -42,6 +42,7 @@ export enum HERO_SYSTEM_TYPE {
ARTIFACT_REBUILD = 39, // 宝物重铸
AUTHOR_BOOK_STAR = 40, // 诸子列传升星
AUTHOR_BOOK_SUB_RESET = 41, // 诸子列传重置
REBORN_CAL = 42, //重生计算
};
// 武将上限

View File

@@ -42,6 +42,11 @@ export default class School extends BaseModel {
return result;
}
public static async findByHids(roleId: string, hids: number[]) {
let result: SchoolType[] = await SchoolModel.find({ roleId, hid: { $in: hids } }).lean();
return result;
}
public static async updateBySclAndPos(roleId: string, schoolId: number, positionId: number, update: SchoolUpdate) {
const doc = new SchoolModel();

View File

@@ -29,6 +29,11 @@ export default class Skin extends BaseModel {
return rec;
}
public static async findbyRoleAndHids(roleId: string, hids: number[]) {
const rec: SkinType[] = await SkinModel.find({ roleId, hid: { $in: hids } }).lean();
return rec;
}
public static getInitInfo(hid: number): SkinUpdate {
let dicHero = gameData.hero.get(hid);
let dicFashion = gameData.fashion.get(dicHero.initialSkin)

View File

@@ -881,4 +881,13 @@ export function compareVersion(versionA: string, versionB: string) {
} else {
return 0;
}
};
};
// 交换俩obj中的指定字段
export function swapFields(originObj: object, targetObj: object, fieldsToSwap: string[]) {
for (const field of fieldsToSwap) {
const temp = originObj[field];
originObj[field] = targetObj[field];
targetObj[field] = temp;
}
}