From 4962055782ae9e3f33bdc70e38a6f766943e452d Mon Sep 17 00:00:00 2001 From: luying Date: Wed, 6 Jul 2022 20:42:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=98=E5=8A=9B=EF=BC=9A=E6=AC=A1=E7=BA=A7?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=A6=82=E6=9E=9CheroAttr=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=B0=B1=E4=B8=8D=E4=BC=9A=E8=AE=A1=E7=AE=97globalAttr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/role/calCe.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/game-server/app/services/role/calCe.ts b/game-server/app/services/role/calCe.ts index f58e5addb..da22c449a 100644 --- a/game-server/app/services/role/calCe.ts +++ b/game-server/app/services/role/calCe.ts @@ -1,4 +1,4 @@ -import { ABI_STAGE, ABI_STAGE_TO_TYPE, ABI_TYPE_MAIN, LINEUP_NUM, SEID_TYPE, TALENT_RELATION_TYPE } from "../../consts"; +import { ABI_STAGE, ABI_STAGE_TO_TYPE, ABI_TYPE, ABI_TYPE_MAIN, LINEUP_NUM, SEID_TYPE, TALENT_RELATION_TYPE } from "../../consts"; import { Connect, EPlace, HeroSkin, HeroType, HeroUpdate, Stone, Talent } from "../../db/Hero"; import { JewelType } from "../../db/Jewel"; import { RoleUpdate, Teraph } from "../../db/Role"; @@ -39,11 +39,12 @@ export class CalCe { public calHeroCe() { let attrs = new Map(); // hid => [{attrId, val}] - for(let [hid, keys] of this.data.heroAttrsByHid) { + for(let [hid ] of this.data.heroAttrsByHid) { let lv = this.data.heroLv.get(hid)||1; - for(let key of keys) { - let { attrId, mainBase = 0, subBase = 0, job = 0, starUp = 0, connect = 0, favour = 0, talent = 0, equipQuality = 0, equipStrength = 0, equipStar = 0, equipSuit = 0, jewel = 0, stone = 0 } = this.data.heroAttrs.get(key); - let { school = 0, teraph = 0, title = 0, scroll = 0, skin = 0 } = this.data.getGlobalAttrById(attrId); + for(let attrId = ABI_TYPE.ABI_HP; attrId < ABI_TYPE.ABI_MAX; attrId++) { + if(!this.data.heroAttrs.has(`${hid}_${attrId}`) && !this.data.globalAttrs.has(attrId)) continue; + let { mainBase = 0, subBase = 0, job = 0, starUp = 0, connect = 0, favour = 0, talent = 0, equipQuality = 0, equipStrength = 0, equipStar = 0, equipSuit = 0, jewel = 0, stone = 0 } = this.data.heroAttrs.get(`${hid}_${attrId}`)||{}; + let { school = 0, teraph = 0, title = 0, scroll = 0, skin = 0 } = this.data.getGlobalAttrById(attrId)||{}; let val = 0, str = ''; if(ABI_TYPE_MAIN.indexOf(attrId) != -1) { // {[hp1 + lv * hp2 + hp3 * ( 1 + hp4 )] * (1 + hp5 ) + [( hp6 + hp7 ) * ( 1 + hp8 )] } * ( 1 + hp9 ) + hp10 + hp11