feat(战力): 为了ur武将使用,添加了武将成长属性

This commit is contained in:
luying
2022-11-15 10:37:51 +08:00
parent 113e257cd5
commit 8ee829cd1d

View File

@@ -45,13 +45,13 @@ export class CalCe {
let lv = this.data.heroLv.get(hid)||1;
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, talent = 0, equipQuality = 0, equipStrength = 0, equipStar = 0, equipSuit = 0, jewel = 0, stone = 0 } = this.data.heroAttrs.get(`${hid}_${attrId}`)||{};
let { mainBase = 0, mainBaseUp = 0, subBase = 0, job = 0, starUp = 0, connect = 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 ] * ( 1 + hp5 ) + [( hp6 + hp7 ) * ( 1 + hp8 )]} * ( 1 + hp9 ) + hp10 + hp11
val = (( mainBase + job + lv * starUp ) * ( 1 + connect/100 ) + (( equipQuality + equipStrength ) * ( 1 + ( equipStar/100 + equipSuit/100 )))) * ( 1 + jewel/100 + school/100 + talent/100 + skin/100 ) + stone + teraph + title + scroll;
str += `{[${mainBase}+${job}+${lv}*${starUp}]* ( 1 + ${connect}/100) + [(${equipQuality}+${equipStrength}) * ( 1 + ${equipStar}/100+${equipSuit}/100)]} * (1+${jewel}/100+${school}/100+${talent}/100+${skin}/100 )+${stone}+${teraph}+${title}+${scroll}`;
// {[ hp1 + lv * hp2 ] * ( 1 + hp5 ) + [( hp6 + hp7 ) * ( 1 + hp8 )]} * ( 1 + hp9 ) + hp10 + hp11
val = (( mainBase + job + lv * ( starUp + mainBaseUp ) ) * ( 1 + connect/100 ) + (( equipQuality + equipStrength ) * ( 1 + ( equipStar/100 + equipSuit/100 )))) * ( 1 + jewel/100 + school/100 + talent/100 + skin/100 ) + stone + teraph + title + scroll;
str += `{[${mainBase}+${job}+${lv}*(${starUp}+${mainBaseUp})]* ( 1 + ${connect}/100) + [(${equipQuality}+${equipStrength}) * ( 1 + ${equipStar}/100+${equipSuit}/100)]} * (1+${jewel}/100+${school}/100+${talent}/100+${skin}/100 )+${stone}+${teraph}+${title}+${scroll}`;
} else {
// attr1 + attr2 + attr4 + attr5 + attr6 + attr7 + attr9
val = subBase + job + teraph + school + title + jewel + equipStar;
@@ -139,12 +139,17 @@ export class CalCe {
// 武将基础&成长
public setHeroBase(hid: number, skinId: number) {
this.data.clearHeroAttrByHid(hid, 'mainBase');
this.data.clearHeroAttrByHid(hid, 'mainBaseUp');
let dicHero = gameData.hero.get(skinId);
for(let [attrId, value] of dicHero.baseAbilityArr) {
let heroAttr = this.data.getHeroAttrByHidAndId(hid, attrId);
heroAttr.mainBase = value;
}
for(let [attrId, value] of dicHero.baseAbilityUpArr) {
let heroAttr = this.data.getHeroAttrByHidAndId(hid, attrId);
heroAttr.mainBaseUp = value;
}
}
// 武将等级
@@ -985,6 +990,7 @@ abstract class HeroAllAttr {
equipSuit: number = 0; // hp8套装(dic_zyz_equipSuit的effect然后对应dic_zyz_se)
jewel: number = 0; // hp9 & attr7天晶随机属性值(jewel的ranSe对应dic_zyz_randomEffectPool)
stone: number = 0; // hp10, 地玉增加的固定值(dic_zyz_stone的attribute)
mainBaseUp: number = 0; // hp2, 基础成长(dic_zyz_hero的hp_up)
constructor(hid: number, attrId: number, ) {
this.hid = hid;
@@ -1033,6 +1039,8 @@ class HeroMainAttr extends HeroAllAttr {
this.jewel = value; break;
case HERO_MAIN_ATTR_INDEX.STONE:
this.stone = value; break;
case HERO_MAIN_ATTR_INDEX.BASE_UP:
this.mainBaseUp = value; break;
}
}
}
@@ -1078,6 +1086,9 @@ class HeroMainAttr extends HeroAllAttr {
case HERO_MAIN_ATTR_INDEX.STONE:
values.push(this.stone);
break;
case HERO_MAIN_ATTR_INDEX.BASE_UP:
values.push(this.mainBaseUp);
break;
}
}
return values;
@@ -1266,6 +1277,7 @@ enum HERO_MAIN_ATTR_INDEX {
EQUIP_SUIT = 9, // hp8套装(dic_zyz_equipSuit的effect然后对应dic_zyz_se)
JEWEL = 10, // hp9天晶随机属性值(jewel的ranSe对应dic_zyz_randomEffectPool)
STONE = 11, // hp10, 地玉增加的固定值(dic_zyz_stone的attribute)
BASE_UP = 12, // hp2, 角色基础属性成长(dic_zyz_hero的hp_up)
END
}