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

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

View File

@@ -71,7 +71,7 @@ function getApWithDataAp(roleId: string, ip: string, lv: number, dataAp: ActionP
export async function setAp(serverId: number, roleId: string, ip: string, lv: number, changeAp: number, sid: string, reason: ITEM_CHANGE_REASON) {
// console.log('***** setAp', roleId, ip, lv, changeAp)
const now = Date.now();
const dicAp = getDicApByLv(lv);
let ApResult = await getAp(roleId, ip, lv, true);
let { ap: apBefore, maxAp, refTime, apRemainTime, apMaxRemainTime, isOver, buyTimes } = ApResult; // 更新ap
let ap = apBefore + changeAp;

View File

@@ -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) { // 首次新建一条记录

View File

@@ -871,18 +871,18 @@ export class Rank {
this.valueConfig.forEach(({ name, reverse, isTimestamp, len, weight }) => {
let pow = Math.pow(10, weight);
let score = Math.floor(_num / pow);
console.log('*** 1', name, len, weight, score)
// console.log('*** 1', name, len, weight, score)
_num -= pow * score;
if(isTimestamp) score = this.handleTimestamp(score, len);
console.log('*** 2', name, len, weight, score)
// console.log('*** 2', name, len, weight, score)
if(reverse) {
let pow = Math.pow(10, len);
score = pow - 1 - score;
}
console.log('*** 3', name, len, weight, score)
// console.log('*** 3', name, len, weight, score)
scores.push(score);
})
console.log('#### decodeScore', this.key, scores, this.valueConfig);
// console.log('#### decodeScore', this.key, scores, this.valueConfig);
return scores;
}