秘境:首通信息
This commit is contained in:
@@ -6,6 +6,11 @@ import { resResult, shouldRefresh, } from '../pubUtils/util';
|
||||
import { STATUS } from '../consts/statusCode';
|
||||
import { RoleModel, RoleType } from '../db/Role';
|
||||
import * as dicParam from '../pubUtils/dicParam';
|
||||
import { RankParam } from '../domain/rank';
|
||||
import { BattleRecordType } from '../db/BattleRecord';
|
||||
import { gameData } from '../pubUtils/data';
|
||||
import { DungeonFirstModel } from '../db/DungeonFirst';
|
||||
import { nowSeconds } from '../pubUtils/timeUtil';
|
||||
|
||||
/**
|
||||
* 获取秘境本数据
|
||||
@@ -85,4 +90,13 @@ export function getDungeonBuyCountCost(num:number) {
|
||||
cost = dicParam.DUNGEON_CONST.DUNGEON_CONST_TOP;
|
||||
}
|
||||
return cost;
|
||||
}
|
||||
|
||||
export async function saveDungeonFirst(role: RoleType, warId: number, battleRecord: BattleRecordType) {
|
||||
let userInfo = new RankParam(role, true);
|
||||
let lineup = battleRecord.record.lineup;
|
||||
let dicWar = gameData.war.get(warId);
|
||||
await DungeonFirstModel.createDungeonFirst(role.serverId, dicWar.movePoint, warId, {
|
||||
time: nowSeconds(), roleId: role.roleId, userInfo, lineup
|
||||
})
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import { accomplishTask } from '../pubUtils/taskUtil';
|
||||
import { RScriptRecordModel } from '../db/RScriptRecord';
|
||||
import { setAp } from './actionPointService';
|
||||
import { resResult } from '../pubUtils/util';
|
||||
import { LineupParam } from '../domain/rank';
|
||||
|
||||
export async function roleLevelup(type: KING_EXP_RATIO_TYPE, roleId: string, kingExp: number = 0, session: BackendSession) {
|
||||
const serverId = session.get('serverId');
|
||||
@@ -82,7 +83,7 @@ export async function roleLevelup(type: KING_EXP_RATIO_TYPE, roleId: string, kin
|
||||
|
||||
|
||||
export async function checkBattleHeroes(roleId: string, seqIds: Array<number> = []) {
|
||||
let heroes: number[] = [];
|
||||
let heroes: number[] = [], lineup: LineupParam[] = [];
|
||||
let flag = true;
|
||||
// if (seqIds.length <= 0) flag = false;
|
||||
|
||||
@@ -94,8 +95,9 @@ export async function checkBattleHeroes(roleId: string, seqIds: Array<number> =
|
||||
flag = false; break;
|
||||
}
|
||||
heroes.push(hero.hid);
|
||||
lineup.push(new LineupParam(hero));
|
||||
}
|
||||
return { isOK: flag, heroes };
|
||||
return { isOK: flag, heroes, seqIds, lineup };
|
||||
}
|
||||
|
||||
export async function checkBattleHeroesByHid(roleId: string, heroes: Array<number> = []) {
|
||||
|
||||
Reference in New Issue
Block a user