战斗:远征&pvp,属性字段修改

This commit is contained in:
luying
2021-07-30 16:36:23 +08:00
parent a48706fb8d
commit 6ab6a381e2
9 changed files with 144 additions and 176 deletions
@@ -4,13 +4,14 @@ import Role, { RoleModel, RoleType } from '../db/Role';
import { PvpDefenseModel } from '../db/PvpDefense';
import { shouldRefresh, calculateSumCE } from '../pubUtils/util';
import { EXPEDITION_CONST, LINEUP_NUM, EXPEDITION_WAR_RECORD_STATUS } from '../consts';
import { EXPEDITION_CONST, LINEUP_NUM, EXPEDITION_WAR_RECORD_STATUS, ABI_TYPE } from '../consts';
import { ExpeditionWarRecordModel } from '../db/ExpeditionWarRecord';
import { HeroType } from '../db/Hero';
import { gameData } from '../pubUtils/data';
import { getPlayerAttribute, getRobotAttribute } from './pvpService';
import { getTimeFunD } from '../pubUtils/timeUtil';
import { ExpeditionRecordModel } from '../db/ExpeditionRecord';
import { Attribute } from '../domain/roleField/attribute';
/**
* 获取远征关卡列表
@@ -104,7 +105,9 @@ export async function findOrCreateEnemies(roleId: string, myCe: number, expediti
cur.hp = getHp.hp;
cur.ap = getHp.ap;
} else {
cur.hp = enemy.attribute.hp;
let attr = new Attribute();
attr.setByStr(enemy.attribute);
cur.hp = attr.hp;
cur.ap = 0;
}
enemy["cur"] = cur;
@@ -149,7 +152,7 @@ export async function matchPlayers(roleId: string, scale: number, range: number,
if(h) {
let { star, lv, attr: heroAttrs, ce } = h;
let dicHero = gameData.hero.get(hero.actorId);
let newAttribute = getPlayerAttribute(heroAttrs, roleAttrs);
let { attribute } = getPlayerAttribute(heroAttrs, roleAttrs);
let heroInfo = {
actorId: hero.actorId,
actorName: dicHero.name,
@@ -157,7 +160,7 @@ export async function matchPlayers(roleId: string, scale: number, range: number,
seid:'&',
star,
spine: 0,
attribute: newAttribute,
attribute,
lv,
ce
};
@@ -195,8 +198,7 @@ export async function matchRobots(scale: number, myCe: number, robotCe: number,
if(json.relation == 2) {
const { attribute } = json;
let newAttribute = getRobotAttribute(attribute, myCe, robotCe, scale);
let ce = newAttribute.ce;
let { attribute: newAttribute, ce } = getRobotAttribute(attribute, myCe, robotCe, scale);
enemyObj.enemies.push({...json, attribute: newAttribute, lv, ce});
allCe += ce;
}