洗炼重复锁定判断
This commit is contained in:
@@ -221,7 +221,11 @@ export class EquipHandler {
|
|||||||
|
|
||||||
let { randSe } = equip;
|
let { randSe } = equip;
|
||||||
if (!randSe || randSe.length <= 0) {
|
if (!randSe || randSe.length <= 0) {
|
||||||
return resResult(STATUS.EQUIP_HAVE_NO_RANDSE);
|
return resResult(STATUS.ROLE_EQUIP_HAVE_NO_RANDSE);
|
||||||
|
}
|
||||||
|
let curSe = randSe.find(cur => cur.id == id);
|
||||||
|
if(!curSe || lock == curSe.locked) {
|
||||||
|
return resResult(STATUS.ROLE_EQUIP_DUPLICATE_LOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lock) { // 仅在上锁时消耗,根据已有的锁的数量判断消耗
|
if (lock) { // 仅在上锁时消耗,根据已有的锁的数量判断消耗
|
||||||
@@ -242,7 +246,7 @@ export class EquipHandler {
|
|||||||
|
|
||||||
let result = await EquipModel.lock(roleId, eid, id, lock);
|
let result = await EquipModel.lock(roleId, eid, id, lock);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
return resResult(STATUS.EQUIP_HAVE_NO_RANDSE);
|
return resResult(STATUS.ROLE_EQUIP_HAVE_NO_RANDSE);
|
||||||
}
|
}
|
||||||
return resResult(STATUS.SUCCESS, { curEquip: result });
|
return resResult(STATUS.SUCCESS, { curEquip: result });
|
||||||
|
|
||||||
@@ -260,7 +264,7 @@ export class EquipHandler {
|
|||||||
|
|
||||||
let {id, randSe, hid, ePlaceId } = equip;
|
let {id, randSe, hid, ePlaceId } = equip;
|
||||||
if(!randSe || randSe.length <= 0 ) {
|
if(!randSe || randSe.length <= 0 ) {
|
||||||
return resResult(STATUS.EQUIP_HAVE_NO_RANDSE);
|
return resResult(STATUS.ROLE_EQUIP_HAVE_NO_RANDSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
let dicGoods = gameData.goods.get(id);
|
let dicGoods = gameData.goods.get(id);
|
||||||
|
|||||||
@@ -147,12 +147,13 @@ export const STATUS = {
|
|||||||
// 装备养成 30400-30499
|
// 装备养成 30400-30499
|
||||||
ROLE_EQUIP_PLACE_NOT_ENOUGH: {code: 30400, simStr: '装备栏未装备或无可强化'},
|
ROLE_EQUIP_PLACE_NOT_ENOUGH: {code: 30400, simStr: '装备栏未装备或无可强化'},
|
||||||
ROLE_COIN_NOT_ENOUGH: {code: 30401, simStr: '铜币不足'},
|
ROLE_COIN_NOT_ENOUGH: {code: 30401, simStr: '铜币不足'},
|
||||||
EQUIP_HAVE_NO_RANDSE: { code: 30403, simStr: '装备无随机属性' },
|
ROLE_EQUIP_HAVE_NO_RANDSE: { code: 30403, simStr: '装备无随机属性' },
|
||||||
ROLE_EQUIP_REACH_MAX: { code: 30404, simStr: '强化已达上限' },
|
ROLE_EQUIP_REACH_MAX: { code: 30404, simStr: '强化已达上限' },
|
||||||
ROLE_EQUIP_NOT_REACH_MAX: { code: 30405, simStr: '强化未达到上限' },
|
ROLE_EQUIP_NOT_REACH_MAX: { code: 30405, simStr: '强化未达到上限' },
|
||||||
ROLE_EQUIP_CANNOT_RESTRENGTHEN: { code: 30406, simStr: '无属性可以洗炼' },
|
ROLE_EQUIP_CANNOT_RESTRENGTHEN: { code: 30406, simStr: '无属性可以洗炼' },
|
||||||
ROLE_WRONG_ITEM: { code: 30407, simStr: '该道具不可用于该功能' },
|
ROLE_WRONG_ITEM: { code: 30407, simStr: '该道具不可用于该功能' },
|
||||||
ROLE_ALL_SE_LOCK: { code: 30407, simStr: '属性不可全部都锁住' },
|
ROLE_ALL_SE_LOCK: { code: 30408, simStr: '属性不可全部都锁住' },
|
||||||
|
ROLE_EQUIP_DUPLICATE_LOCK: { code: 30409, simStr: '随机属性不可重复锁定' },
|
||||||
|
|
||||||
EQUIP_NOT_FIND: {code: 30500, simStr: '装备不存在'},
|
EQUIP_NOT_FIND: {code: 30500, simStr: '装备不存在'},
|
||||||
EQUIP_IS_EQUIPED: {code: 30501, simStr: '装备已经穿戴'},
|
EQUIP_IS_EQUIPED: {code: 30501, simStr: '装备已经穿戴'},
|
||||||
|
|||||||
Reference in New Issue
Block a user