战力:地玉&羁绊
This commit is contained in:
@@ -146,8 +146,7 @@ export async function calculateCes(type: HERO_SYSTEM_TYPE, roleId: string, serve
|
|||||||
case HERO_SYSTEM_TYPE.CONNECT: // 9. 羁绊
|
case HERO_SYSTEM_TYPE.CONNECT: // 9. 羁绊
|
||||||
{
|
{
|
||||||
for(let [ hid, { connections } ] of heroUpdates) {
|
for(let [ hid, { connections } ] of heroUpdates) {
|
||||||
let { shipId } = param;
|
calCe.setConnection(hid, connections);
|
||||||
calCe.setConnection(hid, shipId, connections);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -262,6 +261,7 @@ export async function calculateCes(type: HERO_SYSTEM_TYPE, roleId: string, serve
|
|||||||
for(let [hid, { ePlace = [] }] of heroUpdates) {
|
for(let [hid, { ePlace = [] }] of heroUpdates) {
|
||||||
for(let { id, stones } of ePlace) {
|
for(let { id, stones } of ePlace) {
|
||||||
if(ePlaceId == id) {
|
if(ePlaceId == id) {
|
||||||
|
calCe.setStone(hid, ePlaceId, stones);
|
||||||
calCe.setJewel(hid, id, stones, curJewel);
|
calCe.setJewel(hid, id, stones, curJewel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,18 +198,25 @@ export class CalCe {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 羁绊
|
// 羁绊
|
||||||
public setConnection(hid: number, shipId: number, connections: Connect[]) {
|
public setConnection(hid: number, connections: Connect[]) {
|
||||||
this.data.clearHeroAttrByHid(hid, 'connect');
|
this.data.clearHeroAttrByHid(hid, 'connect');
|
||||||
let connect = connections.find(cur => cur.shipId == shipId);
|
let map = new Map<number, number>(); // attrId => val;
|
||||||
let level = connect?.level||0;
|
for(let { shipId, level = 0 } of connections) {
|
||||||
|
let currentShip = getFriendShipById(shipId, level);
|
||||||
let currentShip = getFriendShipById(shipId, level);
|
if (currentShip) {
|
||||||
if (currentShip) {
|
for (let { id, number: val } of currentShip.attributes) {
|
||||||
for (let { id, number: val } of currentShip.attributes) {
|
if(!map.has(id)) {
|
||||||
let heroAttr = this.data.getHeroAttrByHidAndId(hid, id);
|
map.set(id, val);
|
||||||
heroAttr.connect = val;
|
} else {
|
||||||
|
map.set(id, map.get(id) + val);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for(let [id, val] of map) {
|
||||||
|
let heroAttr = this.data.getHeroAttrByHidAndId(hid, id);
|
||||||
|
heroAttr.connect = val;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 第一次获得皮肤
|
// 第一次获得皮肤
|
||||||
|
|||||||
Reference in New Issue
Block a user