战力:pvp远征战场显示

This commit is contained in:
luying
2021-03-10 16:07:47 +08:00
parent 901995b8ba
commit 1fe2d0f307
6 changed files with 27 additions and 21 deletions
@@ -7,7 +7,7 @@ import { ExpeditionPointModel } from '../../../db/ExpeditionPoint';
import { RoleModel } from '../../../db/Role';
import { calculateSumCE, genCode } from '../../../pubUtils/util';
import { getPointRewardStatus, getResetRemainCnt, findOrCreateEnemies } from '../../../services/expeditionService';
import { EXPEDITION_CONST, EXPEDITION_WAR_RECORD_STATUS } from '../../../consts';
import { EXPEDITION_CONST, EXPEDITION_WAR_RECORD_STATUS, LINEUP_NUM } from '../../../consts';
import { WarReward } from '../../../services/warRewardService';
import { handleFixedReward } from '../../../services/rewardService';
import { getAp, setAp } from '../../../services/actionPointService';
@@ -35,7 +35,7 @@ export class ExpeditionBattleHandler {
let expeditionRecord = await ExpeditionRecordModel.getCurRecord(roleId);
if(!expeditionRecord) { // 首次新建一条记录
// 我方战力
let myCe = await calculateSumCE(roleId, 1, { num: 5 });
let myCe = await calculateSumCE(roleId, 1, { num: LINEUP_NUM });
expeditionRecord = await ExpeditionRecordModel.createRecord({
roleId, roleName, heroes: [], myCe
});
@@ -85,7 +85,7 @@ export class ExpeditionBattleHandler {
await ExpeditionRecordModel.hideRecord(roleId); // 刷掉旧关卡
// 我方战力(暂定)
let myCe = await calculateSumCE(roleId, 1, { num: 5 });
let myCe = await calculateSumCE(roleId, 1, { num: LINEUP_NUM });
// 每一关的挑战状态
let { expeditionCode, heroes } = await ExpeditionRecordModel.createRecord({
roleId, roleName, heroes: [], myCe
@@ -103,7 +103,7 @@ export async function matchPlayers(roleId: string, scale: number, range: number,
let hero = heroes[heroIndex];
if(hero) {
let h = <HeroType>hero.hero;
let { star, lv, attr: heroAttrs } = h;
let { star, lv, attr: heroAttrs, ce } = h;
let dicHero = gameData.hero.get(hero.actorId);
let newAttribute = getPlayerAttribute(heroAttrs, roleAttrs);
let heroInfo = {
@@ -114,7 +114,8 @@ export async function matchPlayers(roleId: string, scale: number, range: number,
star,
spine: 0,
attribute: newAttribute,
lv
lv,
ce
};
enemyObj.enemies.push({...json, ...heroInfo});
@@ -150,8 +151,8 @@ export async function matchRobots(scale: number, myCe: number, robotCe: number,
const { attribute } = json;
let newAttribute = getRobotAttribute(attribute, myCe, robotCe, scale);
let ce = newAttribute.calCe();
enemyObj.enemies.push({...json, attribute: newAttribute, lv});
let ce = newAttribute.ce;
enemyObj.enemies.push({...json, attribute: newAttribute, lv, ce});
allCe += ce;
}
}
+3 -3
View File
@@ -217,7 +217,7 @@ async function generPlayerOppHis(pvpdefense: PvpDefenseType, mapWarJson: DicWarJ
heroInfo.setOutIndex(h.order);
let attribute = getPlayerAttribute(dbHero.attr, role.attr);
heroInfo.setAttribute(attribute);
let enemy = new PvpEnemies(warJson, heroInfo, hs?hs.score: 0);
let enemy = new PvpEnemies(warJson, heroInfo, hs?hs.score: 0, attribute.ce);
heroes.push(enemy);
}
} else {
@@ -260,9 +260,9 @@ async function matchRobot(oppPlayers: OppPlayers[], mapWarJson: DicWarJson[], ro
let heroInfo = new PvpHeroInfo();
heroInfo.setRobotInfo(h, myLv, dicHero.initialStars, dicHero.quality);
let attribute = getRobotAttribute(h.attribute, myCe, PVP_CONST.ENEMY_CE, ratio);
defCe += attribute.ce;
defCe += attribute.ce
heroInfo.setAttribute(attribute);
let enemy = new PvpEnemies(warJson, heroInfo, 0);
let enemy = new PvpEnemies(warJson, heroInfo, 0, attribute.ce);
heroes.push(enemy);
}
}