✨ feat(战力): 为了ur武将使用,添加了武将成长属性
This commit is contained in:
@@ -45,13 +45,13 @@ export class CalCe {
|
|||||||
let lv = this.data.heroLv.get(hid)||1;
|
let lv = this.data.heroLv.get(hid)||1;
|
||||||
for(let attrId = ABI_TYPE.ABI_HP; attrId < ABI_TYPE.ABI_MAX; 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;
|
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 { 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 ] * ( 1 + hp5 ) + [( hp6 + hp7 ) * ( 1 + hp8 )]} * ( 1 + hp9 ) + hp10 + hp11
|
// {[ 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;
|
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}]* ( 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 {
|
} else {
|
||||||
// attr1 + attr2 + attr4 + attr5 + attr6 + attr7 + attr9
|
// attr1 + attr2 + attr4 + attr5 + attr6 + attr7 + attr9
|
||||||
val = subBase + job + teraph + school + title + jewel + equipStar;
|
val = subBase + job + teraph + school + title + jewel + equipStar;
|
||||||
@@ -139,12 +139,17 @@ export class CalCe {
|
|||||||
// 武将基础&成长
|
// 武将基础&成长
|
||||||
public setHeroBase(hid: number, skinId: number) {
|
public setHeroBase(hid: number, skinId: number) {
|
||||||
this.data.clearHeroAttrByHid(hid, 'mainBase');
|
this.data.clearHeroAttrByHid(hid, 'mainBase');
|
||||||
|
this.data.clearHeroAttrByHid(hid, 'mainBaseUp');
|
||||||
let dicHero = gameData.hero.get(skinId);
|
let dicHero = gameData.hero.get(skinId);
|
||||||
|
|
||||||
for(let [attrId, value] of dicHero.baseAbilityArr) {
|
for(let [attrId, value] of dicHero.baseAbilityArr) {
|
||||||
let heroAttr = this.data.getHeroAttrByHidAndId(hid, attrId);
|
let heroAttr = this.data.getHeroAttrByHidAndId(hid, attrId);
|
||||||
heroAttr.mainBase = value;
|
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)
|
equipSuit: number = 0; // hp8,套装(dic_zyz_equipSuit的effect,然后对应dic_zyz_se)
|
||||||
jewel: number = 0; // hp9 & attr7,天晶随机属性值(jewel的ranSe,对应dic_zyz_randomEffectPool)
|
jewel: number = 0; // hp9 & attr7,天晶随机属性值(jewel的ranSe,对应dic_zyz_randomEffectPool)
|
||||||
stone: number = 0; // hp10, 地玉增加的固定值(dic_zyz_stone的attribute)
|
stone: number = 0; // hp10, 地玉增加的固定值(dic_zyz_stone的attribute)
|
||||||
|
mainBaseUp: number = 0; // hp2, 基础成长(dic_zyz_hero的hp_up)
|
||||||
|
|
||||||
constructor(hid: number, attrId: number, ) {
|
constructor(hid: number, attrId: number, ) {
|
||||||
this.hid = hid;
|
this.hid = hid;
|
||||||
@@ -1033,6 +1039,8 @@ class HeroMainAttr extends HeroAllAttr {
|
|||||||
this.jewel = value; break;
|
this.jewel = value; break;
|
||||||
case HERO_MAIN_ATTR_INDEX.STONE:
|
case HERO_MAIN_ATTR_INDEX.STONE:
|
||||||
this.stone = value; break;
|
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:
|
case HERO_MAIN_ATTR_INDEX.STONE:
|
||||||
values.push(this.stone);
|
values.push(this.stone);
|
||||||
break;
|
break;
|
||||||
|
case HERO_MAIN_ATTR_INDEX.BASE_UP:
|
||||||
|
values.push(this.mainBaseUp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return values;
|
return values;
|
||||||
@@ -1266,6 +1277,7 @@ enum HERO_MAIN_ATTR_INDEX {
|
|||||||
EQUIP_SUIT = 9, // hp8,套装(dic_zyz_equipSuit的effect,然后对应dic_zyz_se)
|
EQUIP_SUIT = 9, // hp8,套装(dic_zyz_equipSuit的effect,然后对应dic_zyz_se)
|
||||||
JEWEL = 10, // hp9,天晶随机属性值(jewel的ranSe,对应dic_zyz_randomEffectPool)
|
JEWEL = 10, // hp9,天晶随机属性值(jewel的ranSe,对应dic_zyz_randomEffectPool)
|
||||||
STONE = 11, // hp10, 地玉增加的固定值(dic_zyz_stone的attribute)
|
STONE = 11, // hp10, 地玉增加的固定值(dic_zyz_stone的attribute)
|
||||||
|
BASE_UP = 12, // hp2, 角色基础属性成长(dic_zyz_hero的hp_up)
|
||||||
END
|
END
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user