pvp:修复挑战阵容战力问题
This commit is contained in:
@@ -391,5 +391,6 @@ export class GmHandler {
|
|||||||
pinus.app.rpc.order.orderRemote.taflush.broadcast();
|
pinus.app.rpc.order.orderRemote.taflush.broadcast();
|
||||||
pinus.app.rpc.role.roleRemote.taflush.broadcast();
|
pinus.app.rpc.role.roleRemote.taflush.broadcast();
|
||||||
pinus.app.rpc.systimer.systimerRemote.taflush.broadcast();
|
pinus.app.rpc.systimer.systimerRemote.taflush.broadcast();
|
||||||
|
return resResult(STATUS.SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ export default class PvpDefense extends BaseModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static async updateCe(roleId: string, hid: number, incCe: number, lean = true) {
|
public static async updateCe(roleId: string, hid: number, incCe: number, lean = true) {
|
||||||
const rec: PvpDefenseType = await PvpDefenseModel.findOneAndUpdate({ roleId, 'lineupCe.hid': hid }, { $inc: { ce: incCe } }).lean(lean);
|
const rec: PvpDefenseType = await PvpDefenseModel.findOneAndUpdate({ roleId, 'lineupCe.hid': hid }, { $inc: { 'lineupCe.$.ce': incCe } }).lean(lean);
|
||||||
return rec
|
return rec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export async function calPlayerCeAndSave(type: number, roleId: string, originHer
|
|||||||
let { topLineup, topLineupCe } = await calculatetopLineup(role, originHero.hid, heroCe, originHero._id); // 计算更新最强五人战力
|
let { topLineup, topLineupCe } = await calculatetopLineup(role, originHero.hid, heroCe, originHero._id); // 计算更新最强五人战力
|
||||||
role = await RoleModel.updateRoleInfo(roleId, { ce: role.ce + incCe, topLineup, topLineupCe });
|
role = await RoleModel.updateRoleInfo(roleId, { ce: role.ce + incCe, topLineup, topLineupCe });
|
||||||
|
|
||||||
await PvpDefenseModel.updateCe(roleId, originHero.hid, incCe); // 更新pvp防守阵战力
|
await PvpDefenseModel.updateCe(roleId, originHero.hid, reduceCe(incCe)); // 更新pvp防守阵战力
|
||||||
let guild = await GuildModel.updateCe(roleId, incCe); // 公会更新战力
|
let guild = await GuildModel.updateCe(roleId, incCe); // 公会更新战力
|
||||||
|
|
||||||
let pushHeros = new Array<{ hid: number, ce: number, incHeroCe: number }>();
|
let pushHeros = new Array<{ hid: number, ce: number, incHeroCe: number }>();
|
||||||
@@ -83,7 +83,7 @@ export async function reCalAllHeroCe(type: number, roleId: string, update: RoleU
|
|||||||
allIncCe += incHeroCe;
|
allIncCe += incHeroCe;
|
||||||
pushHeros.push({ hid: hero.hid, ce: reduceCe(heroCe), incHeroCe: reduceCe(incHeroCe) });
|
pushHeros.push({ hid: hero.hid, ce: reduceCe(heroCe), incHeroCe: reduceCe(incHeroCe) });
|
||||||
await HeroModel.updateHeroInfo(roleId, hero.hid, { ce: heroCe });
|
await HeroModel.updateHeroInfo(roleId, hero.hid, { ce: heroCe });
|
||||||
await PvpDefenseModel.updateCe(roleId, hero.hid, incHeroCe); // 更新pvp防守阵战力
|
await PvpDefenseModel.updateCe(roleId, hero.hid, reduceCe(incHeroCe)); // 更新pvp防守阵战力
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user