寻宝:修正扣减藏宝图时队长 sid 的获取

This commit is contained in:
liangtongchuan
2021-01-27 16:00:49 +08:00
parent 183ec67bcb
commit aa41523792
2 changed files with 6 additions and 5 deletions
+4 -3
View File
@@ -216,7 +216,7 @@ function updateRobotKilled(bossHp: number, roleSt: RoleStatus) {
}
}
export async function handleComBtlProgress(teamStatus, sid: string, robotHurtTimer: Map<string, NodeJS.Timer>, teamMap: Map<string, any>, channel: Channel) {
export async function handleComBtlProgress(teamStatus, robotHurtTimer: Map<string, NodeJS.Timer>, teamMap: Map<string, any>, channel: Channel) {
const { teamCode } = teamStatus;
// 判断战斗是否结束
let battleSt = checkComBattleResult(teamStatus);
@@ -236,6 +236,7 @@ export async function handleComBtlProgress(teamStatus, sid: string, robotHurtTim
// 战斗胜利队长扣减藏宝图
if (result && teamStatus.capId != 'robot') {
const { sid } = channel.getMember(teamStatus.capId);
let res = await decreaseItems(teamStatus.capId, sid, [{id: teamStatus.blueprtId, count: 1}]);
if (res === true) return resResult(STATUS.COM_BATTLE_BLUEPRT_NOT_ENOUGH);
}
@@ -284,13 +285,13 @@ export function updateRobotHurt(teamStatus, roleSt: RoleStatus, channel: Channel
* @param {Channel} channel
* @param {Map<string, NodeJS.Timer>} robotHurtTimer
*/
export function updateRobotHurtByTime(teamStatus, roleSt: RoleStatus, interval: number, channel: Channel, robotHurtTimer: Map<string, NodeJS.Timer>, teamMap: Map<string, any>, sid: string) {
export function updateRobotHurtByTime(teamStatus, roleSt: RoleStatus, interval: number, channel: Channel, robotHurtTimer: Map<string, NodeJS.Timer>, teamMap: Map<string, any>) {
const timerKey = `${teamStatus.teamCode}_${roleSt.roleId}`;
const robotTimer = setInterval(() => {
const robotTotalHurt = teamStatus.bossHp * COM_BTL_CONST.ROBOT_HURT_RATIO;
if (roleSt.totalDmg < robotTotalHurt && teamStatus.bossCurHp > 0 && teamMap.has(teamStatus.teamCode)) {
updateRobotHurt(teamStatus, roleSt, channel);
handleComBtlProgress(teamStatus, sid, robotHurtTimer, teamMap, channel);
handleComBtlProgress(teamStatus, robotHurtTimer, teamMap, channel);
} else {
clearInterval(robotTimer);
}