远征:修改碾压判断条件
This commit is contained in:
@@ -205,11 +205,6 @@ export class ExpeditionBattleHandler {
|
||||
if (preBattle == -1) return resResult(STATUS.BATTLE_NEED_PREVIOUS_GK);
|
||||
}
|
||||
|
||||
// 检查战力是否足够
|
||||
if(!vipCanSkipExpedition(dicWar.recommendedPower, topLineupCe, vipStartTime)) {
|
||||
return resResult(STATUS.EXPEDITION_SKIP_POWER_NOT_ENOUGH)
|
||||
}
|
||||
|
||||
// 检查record
|
||||
let expeditionRecord = await ExpeditionRecordModel.getExpeditionRecordByCode(expeditionCode);
|
||||
let expeditionWarRecord = await ExpeditionWarRecordModel.getRecordByCodeAndId(expeditionCode, expeditionId);
|
||||
@@ -220,6 +215,11 @@ export class ExpeditionBattleHandler {
|
||||
return resResult(STATUS.EXPEDITION_DUPLICATE_CHALLENGE);
|
||||
}
|
||||
|
||||
// 检查战力是否足够
|
||||
if(!vipCanSkipExpedition(expeditionWarRecord.ce, topLineupCe, vipStartTime)) {
|
||||
return resResult(STATUS.EXPEDITION_SKIP_POWER_NOT_ENOUGH)
|
||||
}
|
||||
|
||||
// 更新敌人剩余状态及战斗状态
|
||||
expeditionWarRecord = await ExpeditionWarRecordModel.updateEnemiesStatus(expeditionCode, expeditionId, EXPEDITION_WAR_RECORD_STATUS.SUCCESS, []);
|
||||
// 更新点数
|
||||
|
||||
@@ -227,5 +227,5 @@ export function vipCanSkipTower(recommendCeSum: number, heroesCeSum: number, vip
|
||||
}
|
||||
|
||||
export function vipCanSkipExpedition(recommendCe: number, topLineupCe: number, vipStartTime: number) {
|
||||
return vipStartTime > 0 && topLineupCe > recommendCe;
|
||||
return vipStartTime > 0 && topLineupCe > recommendCe * VIP.EXPENDITION_SKIP_CE_RATIO_WITH_VIP;
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import { EXPEDITION_WAR_RECORD_STATUS, SYSTEM_OPEN_ID } from '../consts';
|
||||
import { ExpeditionWarRecordModel } from '../db/ExpeditionWarRecord';
|
||||
import { HeroType } from '../db/Hero';
|
||||
import { gameData } from '../pubUtils/data';
|
||||
import { getTimeFunD } from '../pubUtils/timeUtil';
|
||||
import { ExpeditionRecordModel } from '../db/ExpeditionRecord';
|
||||
import { Attribute, AttributeCal } from '../domain/roleField/attribute';
|
||||
import * as dicParam from '../pubUtils/dicParam';
|
||||
@@ -221,8 +220,8 @@ export async function matchRobots(scale: number, myCe: number, robotCe: number,
|
||||
export async function getCEScaleAndRange(roleId: string, curDicExpedition: any) {
|
||||
// 匹配,判断是不是新手期
|
||||
const role = await RoleModel.findByRoleId(roleId);
|
||||
let timef = getTimeFunD(role.createdAt)
|
||||
let isNew = timef.getDayGap() <= 3;
|
||||
let isNew = (role.expeditionHistoryResetCnt||0) <= 3;
|
||||
|
||||
let scale = isNew?curDicExpedition.CEScaleNew:curDicExpedition.CEScale;
|
||||
let range = isNew?curDicExpedition.CERangeNew:curDicExpedition.CERange;
|
||||
return {scale, range, lv: role.lv}
|
||||
|
||||
@@ -136,7 +136,7 @@ export function calculateWarStar(warStar: WarStar[] = [], battleId: number, star
|
||||
newStar = stars.filter(cur => cur > 0).length;
|
||||
newStars = stars;
|
||||
let dicWar = gameData.war.get(battleId);
|
||||
newWarStars.push({ id: battleId, warType: dicWar.warType, star: newStar, stars: newStars});
|
||||
if(dicWar) newWarStars.push({ id: battleId, warType: dicWar.warType, star: newStar, stars: newStars});
|
||||
}
|
||||
return { newWarStars, newStars, newStar };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user