✨ feat(养成): 九品天晶添加基础属性
This commit is contained in:
@@ -46,15 +46,15 @@ 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, mainBaseUp = 0, subBase = 0, job = 0, starUp = 0, connect = 0, talent = 0, equipQuality = 0, equipStrength = 0, equipStar = 0, equipSuit = 0, jewel = 0, stone = 0, artifactLv = 0, artifactQuality = 0, artifactSeid = 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, artifactLv = 0, artifactQuality = 0, artifactSeid = 0, jewelBase = 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, ceVal = 0, str = '', ceStr = '';
|
let val = 0, ceVal = 0, str = '', ceStr = '';
|
||||||
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 + hp14
|
// {[ hp1 + lv * hp2 ] * ( 1 + hp5 ) + [( hp6 + hp7 ) * ( 1 + hp8 )]} * ( 1 + hp9 ) + hp10 + hp11 + hp14
|
||||||
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 + artifactSeid/100) + stone + teraph + title + scroll + artifactLv + artifactQuality;
|
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 + artifactSeid/100) + stone + teraph + title + scroll + artifactLv + artifactQuality + jewelBase;
|
||||||
ceVal = (( mainBase + job + lv * ( starUp + mainBaseUp ) ) * ( 1 + connect/100 ) + (( equipQuality + equipStrength ) * ( 1 + ( equipStar/100 + equipSuit/100 )))) * ( 1 + jewel/100 + school/100 + talent/100 + skin/100 + artifactSeid/100) + stone + teraph + title + scroll + artifactLv + artifactQuality;
|
ceVal = (( mainBase + job + lv * ( starUp + mainBaseUp ) ) * ( 1 + connect/100 ) + (( equipQuality + equipStrength ) * ( 1 + ( equipStar/100 + equipSuit/100 )))) * ( 1 + jewel/100 + school/100 + talent/100 + skin/100 + artifactSeid/100) + stone + teraph + title + scroll + artifactLv + artifactQuality + jewelBase;
|
||||||
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+${artifactSeid}/100)+${stone}+${teraph}+${title}+${scroll}+${artifactLv}+${artifactQuality}`;
|
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+${artifactSeid}/100)+${stone}+${teraph}+${title}+${scroll}+${artifactLv}+${artifactQuality}+${jewelBase}`;
|
||||||
ceStr += `{[${mainBase}+${job}+${lv}*(${starUp}+${mainBaseUp})]* ( 1 + ${connect}/100) + [(${equipQuality}+${equipStrength}) * ( 1 + ${equipStar}/100+${equipSuit}/100)]} * (1+${jewel}/100+${school}/100+${talent}/100+${skin}/100+${artifactSeid}/100)+${stone}+${teraph}+${title}+${scroll}+${artifactLv}+${artifactQuality}`;
|
ceStr += `{[${mainBase}+${job}+${lv}*(${starUp}+${mainBaseUp})]* ( 1 + ${connect}/100) + [(${equipQuality}+${equipStrength}) * ( 1 + ${equipStar}/100+${equipSuit}/100)]} * (1+${jewel}/100+${school}/100+${talent}/100+${skin}/100+${artifactSeid}/100)+${stone}+${teraph}+${title}+${scroll}+${artifactLv}+${artifactQuality}+${jewelBase}`;
|
||||||
} 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;
|
||||||
@@ -302,6 +302,7 @@ export class CalCe {
|
|||||||
this.data.clearHeroAttrByHid(hid, 'equipStar');
|
this.data.clearHeroAttrByHid(hid, 'equipStar');
|
||||||
this.data.clearEquipAttrByHid(hid, 'equipStar');
|
this.data.clearEquipAttrByHid(hid, 'equipStar');
|
||||||
this.data.clearHeroAttrByHid(hid, 'jewel');
|
this.data.clearHeroAttrByHid(hid, 'jewel');
|
||||||
|
this.data.clearHeroAttrByHid(hid, 'jewelBase');
|
||||||
this.data.clearHeroAttrByHid(hid, 'stone');
|
this.data.clearHeroAttrByHid(hid, 'stone');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -379,6 +380,8 @@ export class CalCe {
|
|||||||
public setJewel(hid: number, eplaceId: number, stones: Stone[], jewel: JewelType) {
|
public setJewel(hid: number, eplaceId: number, stones: Stone[], jewel: JewelType) {
|
||||||
this.data.clearHeroAttrByHid(hid, 'jewel');
|
this.data.clearHeroAttrByHid(hid, 'jewel');
|
||||||
this.data.clearEquipAttrByHidAndEplace(hid, eplaceId, 'jewel');
|
this.data.clearEquipAttrByHidAndEplace(hid, eplaceId, 'jewel');
|
||||||
|
this.data.clearHeroAttrByHid(hid, 'jewelBase');
|
||||||
|
this.data.clearEquipAttrByHidAndEplace(hid, eplaceId, 'jewelBase');
|
||||||
let seids: number[] = [];
|
let seids: number[] = [];
|
||||||
if(jewel) {
|
if(jewel) {
|
||||||
for(let { id, seid, rand } of jewel.randSe) {
|
for(let { id, seid, rand } of jewel.randSe) {
|
||||||
@@ -389,6 +392,14 @@ export class CalCe {
|
|||||||
for(let { seid, rand } of jewel.rareSe) {
|
for(let { seid, rand } of jewel.rareSe) {
|
||||||
seids.push(seid, rand);
|
seids.push(seid, rand);
|
||||||
}
|
}
|
||||||
|
let dicJewel = gameData.jewel.get(jewel.id);
|
||||||
|
if(dicJewel) {
|
||||||
|
let attrBaseValues = dicJewel.rareEffectBaseAttr||[];
|
||||||
|
for(let { id, num } of attrBaseValues) {
|
||||||
|
let equipAttr = this.data.getEquipAttrByHidAndId(hid, eplaceId, id);
|
||||||
|
equipAttr.jewelBase = num;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let { ratioUp } = this.addSeidEffect(seids);
|
let { ratioUp } = this.addSeidEffect(seids);
|
||||||
let map = new Map<number, number>(); // attrId => val
|
let map = new Map<number, number>(); // attrId => val
|
||||||
@@ -404,9 +415,10 @@ export class CalCe {
|
|||||||
equipAttr.jewel = val;
|
equipAttr.jewel = val;
|
||||||
}
|
}
|
||||||
let equips = this.data.getEquipAttrsByHid(hid);
|
let equips = this.data.getEquipAttrsByHid(hid);
|
||||||
for(let { hid, attrId, jewel } of equips) {
|
for(let { hid, attrId, jewel, jewelBase } of equips) {
|
||||||
let heroAttr = this.data.getHeroAttrByHidAndId(hid, attrId);
|
let heroAttr = this.data.getHeroAttrByHidAndId(hid, attrId);
|
||||||
heroAttr.jewel += jewel;
|
heroAttr.jewel += jewel;
|
||||||
|
heroAttr.jewelBase += jewelBase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1083,6 +1095,7 @@ abstract class HeroAllAttr {
|
|||||||
artifactLv: number = 0; // hp14 宝物等级(dic_zyz_artifactLvPlan的attr)
|
artifactLv: number = 0; // hp14 宝物等级(dic_zyz_artifactLvPlan的attr)
|
||||||
artifactQuality: number = 0; // hp14 宝物品质(dic_zyz_artifactQualityPlan的attr)
|
artifactQuality: number = 0; // hp14 宝物品质(dic_zyz_artifactQualityPlan的attr)
|
||||||
artifactSeid: number = 0; // hp9 宝物词条(dic_zyz_artifactSeid算出来的)
|
artifactSeid: number = 0; // hp9 宝物词条(dic_zyz_artifactSeid算出来的)
|
||||||
|
jewelBase: number = 0; // hp15 天晶固定属性值(jewel的基础属性)
|
||||||
|
|
||||||
constructor(hid: number, attrId: number, ) {
|
constructor(hid: number, attrId: number, ) {
|
||||||
this.hid = hid;
|
this.hid = hid;
|
||||||
@@ -1139,6 +1152,8 @@ class HeroMainAttr extends HeroAllAttr {
|
|||||||
this.artifactQuality = value; break;
|
this.artifactQuality = value; break;
|
||||||
case HERO_MAIN_ATTR_INDEX.ARTIFACT_SEID:
|
case HERO_MAIN_ATTR_INDEX.ARTIFACT_SEID:
|
||||||
this.artifactSeid = value; break;
|
this.artifactSeid = value; break;
|
||||||
|
case HERO_MAIN_ATTR_INDEX.JEWEL_BASE:
|
||||||
|
this.jewelBase = value; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1196,6 +1211,9 @@ class HeroMainAttr extends HeroAllAttr {
|
|||||||
case HERO_MAIN_ATTR_INDEX.ARTIFACT_SEID:
|
case HERO_MAIN_ATTR_INDEX.ARTIFACT_SEID:
|
||||||
values.push(this.artifactSeid);
|
values.push(this.artifactSeid);
|
||||||
break;
|
break;
|
||||||
|
case HERO_MAIN_ATTR_INDEX.JEWEL_BASE:
|
||||||
|
values.push(this.jewelBase);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return values;
|
return values;
|
||||||
@@ -1257,6 +1275,7 @@ abstract class EquipAllAttr {
|
|||||||
equipStar: number = 0;
|
equipStar: number = 0;
|
||||||
jewel: number = 0;
|
jewel: number = 0;
|
||||||
stone: number = 0;
|
stone: number = 0;
|
||||||
|
jewelBase: number = 0;
|
||||||
|
|
||||||
constructor(hid: number, attrId: number) {
|
constructor(hid: number, attrId: number) {
|
||||||
this.hid = hid;
|
this.hid = hid;
|
||||||
@@ -1290,6 +1309,8 @@ class EquipMainAttr extends EquipAllAttr {
|
|||||||
this.jewel = value; break;
|
this.jewel = value; break;
|
||||||
case EQUIP_MAIN_ATTR_INDEX.STONE:
|
case EQUIP_MAIN_ATTR_INDEX.STONE:
|
||||||
this.stone = value; break;
|
this.stone = value; break;
|
||||||
|
case EQUIP_MAIN_ATTR_INDEX.JEWEL_BASE:
|
||||||
|
this.jewelBase = value; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1314,6 +1335,9 @@ class EquipMainAttr extends EquipAllAttr {
|
|||||||
case EQUIP_MAIN_ATTR_INDEX.STONE:
|
case EQUIP_MAIN_ATTR_INDEX.STONE:
|
||||||
values.push(this.stone);
|
values.push(this.stone);
|
||||||
break;
|
break;
|
||||||
|
case EQUIP_MAIN_ATTR_INDEX.JEWEL_BASE:
|
||||||
|
values.push(this.jewelBase);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return values;
|
return values;
|
||||||
@@ -1388,6 +1412,7 @@ enum HERO_MAIN_ATTR_INDEX {
|
|||||||
ARTIFACT_LV = 13, // hp14, 宝物等级
|
ARTIFACT_LV = 13, // hp14, 宝物等级
|
||||||
ARTIFACT_QUALITY = 14, // hp14, 宝物品质
|
ARTIFACT_QUALITY = 14, // hp14, 宝物品质
|
||||||
ARTIFACT_SEID = 15, // hp9,宝物词条
|
ARTIFACT_SEID = 15, // hp9,宝物词条
|
||||||
|
JEWEL_BASE = 16, // hp15, 天晶基础属性(dic_zyz_jewel的rareEffectBaseAttr)
|
||||||
END
|
END
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1408,6 +1433,7 @@ enum EQUIP_MAIN_ATTR_INDEX {
|
|||||||
EQUIP_STAR = 2, // hp8, 装备(dic_zyz_equipStar)
|
EQUIP_STAR = 2, // hp8, 装备(dic_zyz_equipStar)
|
||||||
JEWEL = 3, // hp9, 天晶洗练出的主属性百分比加成,equipAttr加起来
|
JEWEL = 3, // hp9, 天晶洗练出的主属性百分比加成,equipAttr加起来
|
||||||
STONE = 4, // hp10,地玉石增加的固定值,equipAttr加起来
|
STONE = 4, // hp10,地玉石增加的固定值,equipAttr加起来
|
||||||
|
JEWEL_BASE = 5, // hp15, 天晶基础属性(dic_zyz_jewel的rareEffectBaseAttr)
|
||||||
END
|
END
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// 天晶石表
|
// 天晶石表
|
||||||
import { readFileAndParse, parseGoodStr, parseNumberList } from '../util'
|
import { readFileAndParse, parseGoodStr, parseNumberList, decodeArrayListStr } from '../util'
|
||||||
import { FILENAME } from '../../consts';
|
import { FILENAME } from '../../consts';
|
||||||
import { RewardInter } from '../interface';
|
import { RewardInter } from '../interface';
|
||||||
|
|
||||||
@@ -22,6 +22,8 @@ export interface DicJewel {
|
|||||||
readonly randomEffect: number[];
|
readonly randomEffect: number[];
|
||||||
// 稀有属性
|
// 稀有属性
|
||||||
readonly rareEffect: number[];
|
readonly rareEffect: number[];
|
||||||
|
// 基础属性
|
||||||
|
readonly rareEffectBaseAttr: {id: number, num: number}[];
|
||||||
// 对应藏宝图id
|
// 对应藏宝图id
|
||||||
readonly mapGoodId: number;
|
readonly mapGoodId: number;
|
||||||
// 淬炼消耗
|
// 淬炼消耗
|
||||||
@@ -43,8 +45,10 @@ export function loadJewel() {
|
|||||||
arr.forEach(o => {
|
arr.forEach(o => {
|
||||||
o.randomEffect = parseNumberList(o.randomEffect);
|
o.randomEffect = parseNumberList(o.randomEffect);
|
||||||
o.rareEffect = parseNumberList(o.rareEffect);
|
o.rareEffect = parseNumberList(o.rareEffect);
|
||||||
|
o.rareEffectBaseAttr = parseAttr(o.rareEffectBaseAttr);
|
||||||
o.quenchConsume = parseGoodStr(o.quenchConsume);
|
o.quenchConsume = parseGoodStr(o.quenchConsume);
|
||||||
o.inheritConsume = parseGoodStr(o.inheritConsume);
|
o.inheritConsume = parseGoodStr(o.inheritConsume);
|
||||||
|
|
||||||
dicJewel.set(o.good_id, o);
|
dicJewel.set(o.good_id, o);
|
||||||
dicBlueprt.set(o.mapGoodId, o.good_id);
|
dicBlueprt.set(o.mapGoodId, o.good_id);
|
||||||
if(!dicBlueprtByLv.has(o.lv)) {
|
if(!dicBlueprtByLv.has(o.lv)) {
|
||||||
@@ -54,3 +58,16 @@ export function loadJewel() {
|
|||||||
});
|
});
|
||||||
arr = undefined;
|
arr = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseAttr(str: string) {
|
||||||
|
let result = new Array<{id: number, num: number}>();
|
||||||
|
if(!str) return result;
|
||||||
|
let decodeArr = decodeArrayListStr(str);
|
||||||
|
for(let [id, num] of decodeArr) {
|
||||||
|
if(isNaN(parseInt(id)) || isNaN(parseInt(num))) {
|
||||||
|
throw new Error('data table format wrong');
|
||||||
|
}
|
||||||
|
result.push({id: parseInt(id), num: parseInt(num)});
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user