数数:消耗来源

This commit is contained in:
luying
2021-12-14 13:18:29 +08:00
parent e9c471c583
commit b6501ee4a2
70 changed files with 503 additions and 305 deletions
+4 -3
View File
@@ -1,4 +1,4 @@
import { DEFAULT_HERO_LV, FIGURE_UNLOCK_CONDITION, LINEUP_NUM, REDIS_KEY, STATUS, TASK_TYPE } from "../consts";
import { DEFAULT_HERO_LV, FIGURE_UNLOCK_CONDITION, ITEM_CHANGE_REASON, LINEUP_NUM, REDIS_KEY, STATUS, TASK_TYPE } from "../consts";
import { SkinModel } from "../db/Skin";
import { DEFAULT_HEROES, HERO_SYSTEM_TYPE } from "../consts";
import { HeroModel, HeroSkin, HeroType, HeroUpdate } from "../db/Hero";
@@ -261,12 +261,13 @@ export class CreateHeroes extends UpdateHeroes {
private taskPushMessage: TaskListReturn[] = [];
private activityTaskPushMessage = [];
private figureInfos: { heads: Figure[], frames: Figure[], spines: Figure[] }[] = [];
private skinPushMessages: { heros: {skins: HeroSkin[], hid: number}[], skins: {id: number, hid: number }[]} = { heros: [], skins: [] };
private skinPushMessages: { heros: {skins: HeroSkin[], hid: number}[], skins: {id: number, hid: number, inc: number, reason: number }[]} = { heros: [], skins: [] };
private async getSkinsOfThisHero(hid: number, initSkinInfo: SkinUpdate, isInit: boolean) {
let allSkins = isInit? []: await SkinModel.findbyRoleAndHid(this.roleId, hid);
let skin = await SkinModel.insertSkins(this.roleId, this.roleName, [initSkinInfo]);
this.skinPushMessages.skins.push(...skin);
let skinInfos = skin.map(cur => ({ id: cur.id, hid, inc: 1, reason: ITEM_CHANGE_REASON.GET_HERO_UNLOCK_SKIN}))
this.skinPushMessages.skins.push(...skinInfos);
if(skin) allSkins.push(...skin);
let skins: { id: number, skin: string, enable: boolean, skinId: number }[] = [];
for(let skin of allSkins) {