添加获取对手阵容,开始战斗,结算
This commit is contained in:
@@ -60,6 +60,18 @@ export async function checkBattleHeroes(roleId: string, heroes: Array<number>) {
|
||||
return flag;
|
||||
}
|
||||
|
||||
export async function checkBattleHeroesByHid(roleId: string, heroes: Array<number>) {
|
||||
let flag = true;
|
||||
if(heroes.length <= 0) flag = false;
|
||||
|
||||
const findHeroes = await HeroModel.findByHidRange(heroes, roleId);
|
||||
if(findHeroes.length != heroes.length) flag = false;
|
||||
for(let hid of heroes) {
|
||||
let hero = findHeroes.find(cur => cur.hid == hid);
|
||||
if(!hero) flag = false;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
export async function updateWarStar(roleId: string, battleId: number, warType: number, star: number) {
|
||||
let role = await RoleModel.findByRoleId(roleId);
|
||||
|
||||
Reference in New Issue
Block a user