装备:修改装备限制
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { mergeSameGoods, deepCopy } from '../pubUtils/util';
|
||||
import { EquipModel } from "../db/Equip";
|
||||
import { HeroModel, EPlace, HeroType } from "../db/Hero";
|
||||
import { getHeroJob, getGoodById, gameData, getJewelById, getHeroEquipByClassId } from "../pubUtils/data";
|
||||
import { getHeroJob, getGoodById, gameData, getJewelById } from "../pubUtils/data";
|
||||
import { calPlayerCeAndSave } from "./playerCeService";
|
||||
import { HERO_SYSTEM_TYPE, TASK_TYPE } from "../consts";
|
||||
import { EquipType } from "../db/Equip";
|
||||
@@ -69,10 +69,7 @@ export async function changeEquip(serverId: number, roleId: string, sid: string,
|
||||
let res = await takeOffEquipAndCalPlayerCe(roleId, sid, heroB, equipB, id, funcs);//卸下装备并重算战力
|
||||
return res;
|
||||
}
|
||||
let { jobid } = gameData.hero.get(hid);
|
||||
let { job_class } = getHeroJob(jobid);
|
||||
let { classId } = getHeroEquipByClassId(goodInfo.itid);
|
||||
if (indexOf(classId, job_class) < 0) {
|
||||
if (checkEquipCanPut(hid, equipA.id)) {
|
||||
let res = await takeOffEquipAndCalPlayerCe(roleId, sid, heroB, equipB, id, funcs);//卸下装备并重算战力
|
||||
return res;
|
||||
}
|
||||
@@ -132,4 +129,13 @@ export async function dressEquip(serverId: number, roleId: string, sid: string,
|
||||
await checkActivityTask(serverId, sid, funcs, roleId, TASK_TYPE.EQUIP_SUM, 1)
|
||||
|
||||
return { seqId: equip.seqId, hid: hero.hid, id: equip.id, ePlaceId: equip.ePlaceId };
|
||||
}
|
||||
|
||||
export function checkEquipCanPut(hid: number, id: number) {
|
||||
let dicGood = gameData.goods.get(id);
|
||||
let dicHero = gameData.hero.get(hid);
|
||||
let dicJob = gameData.job.get(dicHero.jobid);
|
||||
if(dicGood.jobLimited != 0 && dicGood.jobLimited != dicJob.job_class) return false;
|
||||
if(dicGood.charLimited != 0 && dicGood.charLimited != hid) return false;
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user