战力:修改套装计算方式

This commit is contained in:
luying
2022-03-30 19:20:40 +08:00
parent 83dc974632
commit 170a1b96bc
6 changed files with 33 additions and 38 deletions

View File

@@ -307,15 +307,11 @@ export class CalCe {
}
let minStar = Math.min(...suitStars);
let seids: number[] = [];
for(let { star, seid } of dicEquipSuit.effect) {
if(minStar >= star) seids.push(seid);
}
let { ratioUp } = this.addSeidEffect(seids);
for(let [attrId, val] of ratioUp) {
let heroAttr = this.data.getHeroAttrByHidAndId(hid, attrId);
heroAttr.equipSuit = val;
for(let { star, id, val } of dicEquipSuit.effect) {
if(minStar >= star) {
let heroAttr = this.data.getHeroAttrByHidAndId(hid, id);
heroAttr.equipSuit = val;
}
}
}

View File

@@ -305,8 +305,8 @@ export default class GMUsers extends Service {
}
let list = heroes.map(cur => {
let roleCe = roleMap.get(cur.roleId);
let attr = roleCe.attributes.filter(ccur => ccur.hid == cur.hid);
return {...cur, calculatedAttr: attr, env: ctx.app.config.realEnv}
let obj = roleCe.attributes.find(ccur => ccur.hid == cur.hid);
return {...cur, calculatedAttr: obj.attrs, env: ctx.app.config.realEnv}
})
return ctx.service.utils.resResult(STATUS.SUCCESS, { list, total })

View File

@@ -10,7 +10,7 @@ export interface DicEquipSuit {
// 套装内含的装备编号
readonly equips: number[];
// 按星级可解锁的属性
readonly effect: { star: number, seid: number }[];
readonly effect: { star: number, id: number, val: number }[];
}
export const dicEquipSuit = new Map<number, DicEquipSuit>();
@@ -30,14 +30,14 @@ export function loadEquipSuit() {
}
function parseEffect(str: string) {
let result = new Array<{star: number, seid: number}>();
let result = new Array<{star: number, id: number, val: number}>();
if(!str) return result;
let decodeArr = decodeArrayListStr(str);
for(let [star, seid] of decodeArr) {
if(isNaN(parseInt(star)) || isNaN(parseInt(seid))) {
for(let [star, id, val] of decodeArr) {
if(isNaN(parseInt(star)) || isNaN(parseInt(id)) || isNaN(parseInt(val))) {
throw new Error('data table format wrong');
}
result.push({star: parseInt(star), seid: parseInt(seid)});
result.push({star: parseInt(star), id: parseInt(id), val: parseInt(val)});
}
return result
}

View File

@@ -3,42 +3,42 @@
"id": 1,
"jobClass": 1,
"equips": "1&2&3&4",
"effect": "4&10011|8&10013|12&80003"
"effect": "4&1&1|8&2&20|12&3&1"
},
{
"id": 2,
"jobClass": 2,
"equips": "5&6&7&8",
"effect": "4&20011|8&10012|12&80023"
"effect": "4&1&1|8&2&20|12&3&1"
},
{
"id": 3,
"jobClass": 3,
"equips": "9&10&11&12",
"effect": "4&60032|8&60034|12&80002"
"effect": "4&1&1|8&2&20|12&3&1"
},
{
"id": 4,
"jobClass": 4,
"equips": "13&14&15&16",
"effect": "4&10011|8&10013|12&80003"
"effect": "4&1&1|8&2&20|12&3&1"
},
{
"id": 5,
"jobClass": 5,
"equips": "17&18&19&20",
"effect": "4&20011|8&10012|12&80023"
"effect": "4&1&1|8&2&20|12&3&1"
},
{
"id": 6,
"jobClass": 6,
"equips": "21&22&23&24",
"effect": "4&60032|8&60034|12&80002"
"effect": "4&1&1|8&2&20|12&3&1"
},
{
"id": 7,
"jobClass": 7,
"equips": "25&26&27&28",
"effect": "4&60032|8&60034|12&80002"
"effect": "4&1&1|8&2&20|12&3&1"
}
]

View File

@@ -1189,6 +1189,20 @@
"info": "法防",
"comment": "法防提高"
},
{
"id": 20011,
"type": 1,
"group": 10011,
"level": 10,
"gainValue": "1&0",
"index": 2,
"Min": 461,
"Max": 1150,
"gap": 1,
"count": "461&496&30|497&1065&35|1066&1150&35",
"info": "生命",
"comment": "生命值提高"
},
{
"id": 20012,
"type": 1,

View File

@@ -39278,20 +39278,5 @@
"rangeSeid": "&",
"seidNameImage": "&",
"passivespineName": "&"
},
{
"id": 20011,
"type": 2,
"group": 10011,
"level": 10,
"gainValue": "1&1000",
"index": 2,
"Min": 461,
"Max": 1150,
"gap": 1,
"count": "461&496&30|497&1065&35|1066&1150&35",
"info": "生命",
"comment": "生命值提高"
}
]