镇念塔:检查武将需要根据皮肤变化
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { HeroModel } from './../db/Hero';
|
||||
import { HeroModel, HeroType } from './../db/Hero';
|
||||
import { HangUpRecordModel } from './../db/HangUpRecord';
|
||||
import { HANG_UP_CONSTS, REDIS_KEY, TASK_TYPE, TOWER_FORBIDDEN_CHARA_TYPE, TOWER_TASK_STATUS, MAIL_TYPE, MSG_SOURCE } from './../consts';
|
||||
import { BattleRecordModel } from './../db/BattleRecord';
|
||||
@@ -141,7 +141,7 @@ export function checkTaskRewards(batchCode: string, tasks: TowerTaskRecType[]) {
|
||||
return { compTasks, rewards };
|
||||
}
|
||||
|
||||
export async function checkTowerWar(roleId: string, battleId: number, seqIds: number[], heroes: Array<number>) {
|
||||
export async function checkTowerWar(roleId: string, battleId: number, seqIds: number[], heroes: HeroType[]) {
|
||||
let { towerLv } = await RoleModel.findByRoleId(roleId);
|
||||
const towerInfo = gameData.tower.get(towerLv);
|
||||
if (!towerInfo) {
|
||||
@@ -166,8 +166,8 @@ export async function checkTowerWar(roleId: string, battleId: number, seqIds: nu
|
||||
return { status: -1, resResult: resResult(STATUS.TOWER_DUPLICATE_HERO) };
|
||||
}
|
||||
}
|
||||
for(let hid of heroes) {
|
||||
if(checkForbiddenChar(hid, fobiddenCharactor)) {
|
||||
for(let {hid, job} of heroes) {
|
||||
if(checkForbiddenChar(hid, job, fobiddenCharactor)) {
|
||||
return { status: -1, resResult: resResult(STATUS.TOWER_HERO_FORBIDDEN) };
|
||||
}
|
||||
}
|
||||
@@ -183,9 +183,9 @@ export async function checkTowerWar(roleId: string, battleId: number, seqIds: nu
|
||||
};
|
||||
}
|
||||
|
||||
export function checkForbiddenChar(hid: number, fobiddenCharactor: {type: number, id: number}[]) {
|
||||
export function checkForbiddenChar(hid: number, job: number, fobiddenCharactor: {type: number, id: number}[]) {
|
||||
let dicHero = gameData.hero.get(hid);
|
||||
let dicJob = gameData.job.get(dicHero.jobid);
|
||||
let dicJob = gameData.job.get(job);
|
||||
let flag = false;
|
||||
for(let { type, id } of fobiddenCharactor) {
|
||||
switch(type) {
|
||||
|
||||
Reference in New Issue
Block a user