形象:获得武将头像

This commit is contained in:
luying
2021-03-11 20:32:23 +08:00
parent 0eb016567b
commit 4ed7a7b0ec
4 changed files with 24 additions and 8 deletions

View File

@@ -20,7 +20,7 @@ import { PvpDefenseModel } from '@db/PvpDefense';
import { Service } from 'egg';
import Counter from '@db/Counter';
import { STATUS, HERO_SYSTEM_TYPE } from '@consts';
import { STATUS, HERO_SYSTEM_TYPE, FIGURE_UNLOCK_CONDITION } from '@consts';
import { ITID, COUNTER } from '@consts';
import { ItemModel } from '@db/Item';
import { gameData, getHeroExpByLv } from '@pubUtils/data';
@@ -32,6 +32,7 @@ import { isString } from 'underscore';
import { FriendShipModel } from '@db/FriendShip';
import { FriendApplyModel } from '@db/FriendApply';
import { FriendRelationModel } from '@db/FriendRelation';
import { unlockFigure } from '@pubUtils/itemUtils';
/**
* Test Service
@@ -267,6 +268,7 @@ export default class GMUsers extends Service {
try {
for(let heroInfo of heroInfos) {
let hero = await HeroModel.createHero(heroInfo);
await unlockFigure(heroInfo.roleId, [{ type: FIGURE_UNLOCK_CONDITION.GET_HERO, num: heroInfo.hid }]); // 解锁头像
await calPlayerCeAndSave(HERO_SYSTEM_TYPE.INIT, heroInfo.roleId, hero, {});
}
return ctx.service.utils.resResult(STATUS.SUCCESS, { uids });