寻宝:仅匹配特定等级区间;修复机器人武将不阵亡 bug
This commit is contained in:
@@ -2,7 +2,7 @@ import { FriendPointModel } from './../db/FriendPoint';
|
||||
import { STATUS } from './../consts/statusCode';
|
||||
import { COM_BATTLE_ROBOT_ID_NAME, COM_TEAM_STATUS, CURRENCY_BY_TYPE, CURRENCY_TYPE, FRIEND_DROP_TYPE, COM_BTL_CONST, FRIEND_DROP_MAX } from './../consts';
|
||||
import { RoleStatus, ComBattleTeamModel } from './../db/ComBattleTeam';
|
||||
import { getBluePrtByQuality, getComBtlSetByQuality, getRewardByBlueprtId, getWarById, getWarIdByBlueprtId } from "../pubUtils/gamedata";
|
||||
import { getBluePrtByQuality, getComBtlSetByQuality, getRewardByBlueprtId, getWarById, getWarIdByBlueprtId, comBtlRangeInfo } from "../pubUtils/gamedata";
|
||||
import { getRandEelm, getRandValue, resResult, ratioReward } from "../pubUtils/util";
|
||||
import { getRandRobot } from "./battleService";
|
||||
import { difference } from 'underscore';
|
||||
@@ -204,7 +204,7 @@ function updateRobotKilled(bossHp: number, roleSt: RoleStatus) {
|
||||
const newKilledCnt = dmgProgress - roleSt.killed.length;
|
||||
const aliveHeroes = difference(roleSt.heroes, roleSt.killed);
|
||||
const newKilledHeroes = getRandEelm(aliveHeroes, newKilledCnt);
|
||||
roleSt.killed.concat(newKilledHeroes);
|
||||
roleSt.killed = roleSt.killed.concat(newKilledHeroes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ export function updateRobotHurt(teamStatus, roleSt: RoleStatus, channel: Channel
|
||||
teamStatus.bossCurHp -= robotTotalHurt;
|
||||
roleSt.totalDmg += robotTotalHurt;
|
||||
updateRobotKilled(teamStatus.bossHp, roleSt);
|
||||
channel.pushMessage('onTeammateAct', resResult(STATUS.SUCCESS, { teamCode: teamStatus.teamCode, bossCurHp: teamStatus.bossCurHp, bossHpArr: teamStatus.bossHpArr, roleStatus: roleSt, actRoleId: roleSt.roleId, actBossHurts }));
|
||||
channel.pushMessage('onTeammateAct', resResult(STATUS.SUCCESS, { teamCode: teamStatus.teamCode, bossCurHp: teamStatus.bossCurHp, bossHpArr: teamStatus.bossHpArr, roleStatus: teamStatus.roleStatus, actRoleId: roleSt.roleId, actBossHurts }));
|
||||
|
||||
}
|
||||
|
||||
@@ -259,3 +259,9 @@ export function updateRobotHurtByTime(teamStatus, roleSt: RoleStatus, interval:
|
||||
}, interval * 1000);
|
||||
}
|
||||
|
||||
export function comBtlLvInvalid(lv: number, lvRange: number) {
|
||||
const lvs = comBtlRangeInfo(lvRange);
|
||||
if (!lvs) return true;
|
||||
const minLv = lvs[0];
|
||||
return lv < minLv;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user