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

This commit is contained in:
luying
2021-07-30 16:33:14 +08:00
parent a48706fb8d
commit 6ab6a381e2
9 changed files with 144 additions and 176 deletions

View File

@@ -7,7 +7,7 @@ import { HERO_SYSTEM_TYPE, ABI_TYPE, HERO_CE_RATIO, HERO_SUB_ATTR_RATIO, LINEUP_
import { cal, deepCopy, getAllAttrStage, reduceCe } from './util';
import { HeroModel, HeroType, HeroUpdate } from '../db/Hero';
import { RoleModel, RoleType, RoleUpdate } from '../db/Role';
import { CeAttrData, CeAttrDataRole, Attribute } from '../domain/roleField/attribute';
import { CeAttrData, CeAttrDataRole, AttributeCal } from '../domain/roleField/attribute';
import { ABI_STAGE, SEID_TYPE } from '../consts';
import { gameData, getJobByGradeAndClass, getHeroWakeByQuality, getHeroStarByQuality, getFriendShipById, getSchoolRateByStar, getScollByStar, getTeraph, getDicSuitByTypeAndLv } from './data';
import { DicSe } from './dictionary/DicSe';
@@ -29,7 +29,7 @@ export async function calPlayerCeAndSave(type: number, roleId: string, originHer
let heroAttrs = calPlayerCe(originHero, update, type, args); // 根据操作计算attr的增加
let newAttr = new Attribute();
let newAttr = new AttributeCal();
newAttr.setByDbData(roleAttrs, heroAttrs);
let heroCe = newAttr.calCe(); // 计算最终战力
let incCe = heroCe - originHero.ce;
@@ -70,7 +70,7 @@ export async function reCalAllHeroCe(type: number, roleId: string, update: RoleU
let allIncCe = 0;
for (let hero of heros) {
let { attr: heroAttrs } = hero;
let newAttr = new Attribute();
let newAttr = new AttributeCal();
newAttr.setByDbData(roleAttrs, heroAttrs);
let heroCe = newAttr.calCe(); // 计算最终战力