后台:修复字段

This commit is contained in:
luying
2022-03-04 10:19:54 +08:00
parent 8649cb82b7
commit c4a5534b19
8 changed files with 24 additions and 24 deletions
@@ -1,7 +1,22 @@
import { COM_TEAM_STATUS } from '../../consts';
import { getBossHpByBlueprtId, getDicBlueprtById } from '../../pubUtils/data';
import { transBossHpArr } from '../../services/battleService';
import ComBattleTeam from './../../db/ComBattleTeam';
import { cloneDeep } from 'lodash'
/**
* 拷贝敌军数组并添加当前血量字段
* @param source 原敌军数组,不包含当前血量字段
*/
export function transBossHpArr(source: Array<{ dataId: number, hp: number, actorId: number }>): Array<{ dataId: number, hp: number, curHp: number, actorId: number }> {
let desArr = [];
source.forEach(elem => {
let { hp } = elem;
desArr.push(Object.assign(elem, { curHp: hp }));
});
return cloneDeep(desArr);
}
export class MemComBtlTeam extends ComBattleTeam {
bossCurHp: number;
curRnd: number;
+1 -1
View File
@@ -3,7 +3,7 @@ import { SimpleGuildRankParam, SimpleRoleRankParam } from '../rank'
import { prop } from "@typegoose/typegoose";
import { CITY_STATUS, RACE_ACTIVITY_STATUS, RACE_EVENT } from "../../consts";
import { gameData, getRaceEventItems } from "../../pubUtils/data";
import { getRandEelm, getRandResultByMember, getRandValueByMinMax, sortArrRandom } from "../../pubUtils/util";
import { getRandEelm, getRandResultByMember, } from "../../pubUtils/util";
import { RewardInter } from "../../pubUtils/interface";
export class GateMembersRec {