战力:次级属性如果heroAttr没有就不会计算globalAttr
This commit is contained in:
@@ -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 { Connect, EPlace, HeroSkin, HeroType, HeroUpdate, Stone, Talent } from "../../db/Hero";
|
||||||
import { JewelType } from "../../db/Jewel";
|
import { JewelType } from "../../db/Jewel";
|
||||||
import { RoleUpdate, Teraph } from "../../db/Role";
|
import { RoleUpdate, Teraph } from "../../db/Role";
|
||||||
@@ -39,11 +39,12 @@ export class CalCe {
|
|||||||
|
|
||||||
public calHeroCe() {
|
public calHeroCe() {
|
||||||
let attrs = new Map<number, { id: number, val: number, str: string }[]>(); // hid => [{attrId, val}]
|
let attrs = new Map<number, { id: number, val: number, str: string }[]>(); // 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;
|
let lv = this.data.heroLv.get(hid)||1;
|
||||||
for(let key of keys) {
|
for(let attrId = ABI_TYPE.ABI_HP; attrId < ABI_TYPE.ABI_MAX; attrId++) {
|
||||||
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);
|
if(!this.data.heroAttrs.has(`${hid}_${attrId}`) && !this.data.globalAttrs.has(attrId)) continue;
|
||||||
let { school = 0, teraph = 0, title = 0, scroll = 0, skin = 0 } = this.data.getGlobalAttrById(attrId);
|
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 = '';
|
let val = 0, str = '';
|
||||||
if(ABI_TYPE_MAIN.indexOf(attrId) != -1) {
|
if(ABI_TYPE_MAIN.indexOf(attrId) != -1) {
|
||||||
// {[hp1 + lv * hp2 + hp3 * ( 1 + hp4 )] * (1 + hp5 ) + [( hp6 + hp7 ) * ( 1 + hp8 )] } * ( 1 + hp9 ) + hp10 + hp11
|
// {[hp1 + lv * hp2 + hp3 * ( 1 + hp4 )] * (1 + hp5 ) + [( hp6 + hp7 ) * ( 1 + hp8 )] } * ( 1 + hp9 ) + hp10 + hp11
|
||||||
|
|||||||
Reference in New Issue
Block a user