fix 合成装备bug

This commit is contained in:
luying
2020-12-21 11:45:16 +08:00
parent e05577bae8
commit dc527cae2e
11 changed files with 759 additions and 713 deletions

View File

@@ -168,7 +168,7 @@ function parseSpecialMaterial(str: string) {
let decodeArr = decodeArrayStr(str);
if(decodeArr.length >= 2) {
let ids = parseNumberList(decodeArr[0]);
let count = parseInt(decodeArr[0]);
let count = parseInt(decodeArr[1]);
if(isNaN(count)) return specialAttr;
specialAttr.ids = ids;
specialAttr.count = count;

View File

@@ -26,7 +26,7 @@ export const dicRefine = new Map<number, DicRefine>();
arr.forEach(o => {
o.material = parseReward(o.material)
dicRefine.set(o.id, o);
dicRefine.set(o.level, o);
});
arr = undefined;

View File

@@ -2,7 +2,7 @@
* 体力系统
*/
import { HERO_SYSTEM_TYPE } from '../consts';
import { HERO_SYSTEM_TYPE, ABI_TYPE } from '../consts';
import { deepCopy } from './util';
import { HeroModel, HeroType } from '../db/Hero';
@@ -12,6 +12,8 @@ import { getAttrNameByJobStage, getAttrCeRatio, getAtrrNameById, ABI_TYPE_TO_STA
import { gameData, getJobByGradeAndClass, getHeroWakeByQuality, getHeroStarByQuality, getFriendShipById } from './data';
import { Attributes } from './interface';
import { DicSe } from './dictionary/DicSe';
import { EquipType } from '../db/Equip';
const HERO_CE_RATIO = 100;
const _ = require('underscore');
//战力计算TODO
@@ -35,6 +37,8 @@ export function calPlayerCe(hero: HeroType, type: number, args: Array<number>) {
reIncAttr = calHeroFavourUpIncAttr(hero, args);
} else if (type == HERO_SYSTEM_TYPE.CONNECT) {
reIncAttr = calHeroConectIncAttr(hero, args);
} else if (type == HERO_SYSTEM_TYPE.EQUIP) {
reIncAttr = calHeroEquipIncAttr(hero, args);
}
addSeidEffect(reIncAttr, addSeidList, removeSeidList); // 处理加值
@@ -225,6 +229,36 @@ export function calHeroFavourUpIncAttr(hero: HeroType, args: Array<number>) {
return res;
}
export function calHeroEquipIncAttr(hero: HeroType, args: Array<number>) {
let res: CeAttr = {};
let {ePlace} = hero;
for(let {equip, lv, refineLv} of ePlace) {
if(equip) {
let e = <EquipType>equip;
console.log(e.id, e._id);
let dicGoods = gameData.goods.get(e.id);
let {goodsAbility, goodsAbilityUp} = dicGoods;
let dicRefine = gameData.refine.get(refineLv);
for(let i = ABI_TYPE.ABI_HP; i < ABI_TYPE.ABI_MAX; i++) {
let jewel = 0;
for(let j = 0; j < e.holes.length; i++) {
}
let attr = (goodsAbility.get(i) + lv * goodsAbilityUp.get(i)) * ( 1 + dicRefine.upPercent);
console.log(jewel, attr, args);
}
// 基础属性
// 装备栏强化
// 精炼
// 宝石
}
}
return res;
}
// 根据存在升星表等的stage字段的id对应17维id
function getFieldByStage(stage: number, jobid: number) {
let targetAttrId = ABI_TYPE_TO_STAGE.get(stage);