远征:在功能开启前不随机对手

This commit is contained in:
luying
2022-05-05 13:00:24 +08:00
parent cd314e2d13
commit a42c64bf7e
9 changed files with 796 additions and 15 deletions
@@ -2,7 +2,7 @@
import { ExpeditionPointModel } from '../db/ExpeditionPoint';
import Role, { RoleModel } from '../db/Role';
import { shouldRefresh, getRandSingleEelm } from '../pubUtils/util';
import { LINEUP_NUM, EXPEDITION_WAR_RECORD_STATUS } from '../consts';
import { LINEUP_NUM, EXPEDITION_WAR_RECORD_STATUS, SYSTEM_OPEN_ID } from '../consts';
import { ExpeditionWarRecordModel } from '../db/ExpeditionWarRecord';
import { HeroType } from '../db/Hero';
import { gameData } from '../pubUtils/data';
@@ -11,6 +11,7 @@ import { ExpeditionRecordModel } from '../db/ExpeditionRecord';
import { Attribute, AttributeCal } from '../domain/roleField/attribute';
import * as dicParam from '../pubUtils/dicParam';
import { getHeroesAttributes, getSumCe } from './playerCeService';
import { checkSystemIsOpen } from './roleService';
/**
* 获取远征关卡列表
@@ -20,7 +21,7 @@ import { getHeroesAttributes, getSumCe } from './playerCeService';
export async function getExpeditionStatus(roleId: string, roleName: string) {
// 重置次数
let role = await RoleModel.findByRoleId(roleId);
if(!role.hasInit) return false
if(!checkSystemIsOpen(role, SYSTEM_OPEN_ID.EXPEDITION)) return false
// 获取远征关卡状态
let expeditionRecord = await ExpeditionRecordModel.getCurRecord(roleId);
if (!expeditionRecord) { // 首次新建一条记录