fix 合成装备bug

This commit is contained in:
luying
2020-12-21 11:45:16 +08:00
parent e05577bae8
commit dc527cae2e
11 changed files with 759 additions and 713 deletions

View File

@@ -48,7 +48,7 @@ export class EquipHandler {
let cost = new Array<ItemInter>();
if(targetGood.suitId > 0) { // 套装
cost.concat(targetGood.composeMaterial);
cost = cost.concat(targetGood.composeMaterial);
let specialMaterial = targetGood.specialMaterial;
let costCount = 0;
let equips = await EquipModel.getEquips(originalEquip);
@@ -83,7 +83,7 @@ export class EquipHandler {
let sid: string = session.get('sid');
let {hid, ePlaceId, type} = msg;
let hero = await HeroModel.findByHidAndRole(hid, roleId);
let hero = await HeroModel.findByHidAndRoleWithEquip(hid, roleId);
if(!hero) return resResult(STATUS.HERO_NOT_FIND);
let { ePlace, lv: playerLv } = hero; // 装备栏
@@ -135,7 +135,7 @@ export class EquipHandler {
hero.ePlace = ePlace;
await calPlayerCeAndSave(sid, roleId, [hero], HERO_SYSTEM_TYPE.EPLACE_STRENGTHEN);
await calPlayerCeAndSave(sid, roleId, [hero], HERO_SYSTEM_TYPE.EQUIP);
const curHero = {
hid,
ePlace: strengthenArr
@@ -144,7 +144,7 @@ export class EquipHandler {
}
// TODO 装备栏精炼
// 装备栏精炼
public async refine(msg: { hid: number, ePlaceId: number, material: {id: number, count: number}[] }, session: BackendSession) {
let roleId: string = session.get('roleId');
// let roleName: string = session.get('roleName');
@@ -152,7 +152,7 @@ export class EquipHandler {
let {hid, ePlaceId, material} = msg;
let hero = await HeroModel.findByHidAndRole(hid, roleId);
let hero = await HeroModel.findByHidAndRoleWithEquip(hid, roleId);
if(!hero) return resResult(STATUS.HERO_NOT_FIND);
let { ePlace } = hero; // 装备栏
@@ -169,7 +169,7 @@ export class EquipHandler {
return resResult(STATUS.ROLE_EQUIP_REACH_MAX);
}
// TODO 是否成功精炼
// 是否成功精炼
let dicRefine = gameData.refine.get(refineLv + 1);
if(!dicRefine) {
return resResult(STATUS.ROLE_INFO_NOT_FOUND)
@@ -188,7 +188,6 @@ export class EquipHandler {
let ran = Math.floor(Math.random() * 100);
let isSuccess = ran <= successRate;
console.log(successRate, ran, isSuccess)
// 消耗道具提升成功率 每个道具提升10%成功率
// 精炼
@@ -201,7 +200,7 @@ export class EquipHandler {
let result = await handleCost(roleId, sid, cost);
if(!result) return resResult(STATUS.ROLE_MATERIAL_NOT_ENOUGH);
await calPlayerCeAndSave(sid, roleId, [hero], HERO_SYSTEM_TYPE.EPLACE_STRENGTHEN);
await calPlayerCeAndSave(sid, roleId, [hero], HERO_SYSTEM_TYPE.EQUIP);
const curHero = {
hid,