🐞 fix(expedition battle): 永久类守护盾远征切关时保留

This commit is contained in:
dcl
2023-02-22 14:40:03 +08:00
parent 2f73cc010c
commit ddc1af67de
4 changed files with 15 additions and 11 deletions
@@ -256,7 +256,7 @@ export class ExpeditionBattleHandler {
* 战斗结算
* 结算战斗奖励,更新远征状态
*/
async battleEnd(msg: { expeditionCode: string, expeditionId: number, battleCode: string, battleId: number, isSuccess: boolean, heroes: Array<{ dataId: number, hp: number, ap: number }>, enemies: Array<{ dataId: number, hp: number, ap: number }>, star: number, stars: number[] }, session: BackendSession) {
async battleEnd(msg: { expeditionCode: string, expeditionId: number, battleCode: string, battleId: number, isSuccess: boolean, heroes: Array<{ dataId: number, hp: number, ap: number, shield: number }>, enemies: Array<{ dataId: number, hp: number, ap: number }>, star: number, stars: number[] }, session: BackendSession) {
const { expeditionCode, battleCode, battleId, expeditionId, isSuccess, heroes = [], star, stars = [], enemies } = msg;
let roleId = session.get('roleId');
@@ -51,7 +51,7 @@ export async function getExpeditionStatus(roleId: string, roleName: string, isEn
curLv,
expeditionWarRecord,
pointRewards,
heroes: heroes.map(cur => { return { "dataId": cur.seqId, "hp": cur.hp, "ap": cur.ap } }),
heroes: heroes.map(cur => { return { "dataId": cur.seqId, "hp": cur.hp, "ap": cur.ap, "shield": cur.shield || 0} }),
resetCnt
}
}
+3 -2
View File
@@ -274,6 +274,7 @@ describe('战斗测试', function () {
expect(hero.dataId).to.be.a('number');
expect(hero.hp).to.be.a('number');
expect(hero.ap).to.be.a('number');
expect(hero.shield).to.be.a('number');
});
expect(res.data.resetCnt).to.be.a('number');
done();
@@ -331,8 +332,8 @@ describe('战斗测试', function () {
});
it('远征关卡结束战斗', function (done) {
let { expeditionId, battleId } = expeditionWarRecord;
let heroes = paramHeroes.map(hero => { return { dataId: hero, hp: 100, ap: 100 }})
let { expeditionId, battleId } = expeditionWarRecord;
let heroes = paramHeroes.map(hero => { return { dataId: hero, hp: 100, ap: 100, shield: 100 }})
pinusClient.request('battle.expeditionBattleHandler.battleEnd', {
expeditionCode, expeditionId, battleId, battleCode, heroes, enemies: [], star: 3, stars: [], isSuccess: true
}, (res) => {