战力:修复创建武将bug
This commit is contained in:
@@ -16,7 +16,7 @@ import { pushEquipQualityMax, pushEquipStarMax } from "../../../services/sysChat
|
||||
import { addConsumeToHero } from "../../../services/roleService";
|
||||
import { CheckMeterial } from "../../../services/role/checkMaterial";
|
||||
import { combineItems } from "../../../services/role/util";
|
||||
import { calculateCe } from "../../../services/playerCeService";
|
||||
import { calculateCeWithHero } from "../../../services/playerCeService";
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
@@ -58,7 +58,7 @@ export class EquipHandler {
|
||||
consumes: addConsumeToHero(hero.consumes, dicEquip.composeMaterial),
|
||||
}
|
||||
|
||||
await calculateCe(HERO_SYSTEM_TYPE.COMPOSE_EQUIP, roleId, serverId, sid, update, {}, { hid, ePlaceId });
|
||||
await calculateCeWithHero(HERO_SYSTEM_TYPE.COMPOSE_EQUIP, roleId, serverId, sid, hid, update, { ePlaceId });
|
||||
await checkTaskInComposeEquip(serverId, roleId, sid, oldEplace, newEplace);
|
||||
|
||||
let curHero = {
|
||||
@@ -105,7 +105,7 @@ export class EquipHandler {
|
||||
ePlace: newEplace,
|
||||
consumes: addConsumeToHero(hero.consumes, consumes)
|
||||
}
|
||||
await calculateCe(HERO_SYSTEM_TYPE.EQUIP_STRENGTH, roleId, serverId, sid, update, {}, { hid, ePlaceId });
|
||||
await calculateCeWithHero(HERO_SYSTEM_TYPE.EQUIP_STRENGTH, roleId, serverId, sid, hid, update, { ePlaceId });
|
||||
await checkTaskInEquipLvUp(serverId, roleId, sid, oldEplace, newEplace, [ePlaceId]);
|
||||
|
||||
const curHero = {
|
||||
@@ -156,7 +156,7 @@ export class EquipHandler {
|
||||
ePlace: newEplace,
|
||||
consumes: addConsumeToHero(hero.consumes, consumes),
|
||||
}
|
||||
await calculateCe(HERO_SYSTEM_TYPE.EQUIP_STRENGTH, roleId, serverId, sid, update, {}, { hid, ePlaceIds: [...eplaceIds.keys()] });
|
||||
await calculateCeWithHero(HERO_SYSTEM_TYPE.EQUIP_STRENGTH, roleId, serverId, sid, hid, update, { ePlaceIds: [...eplaceIds.keys()] });
|
||||
await checkTaskInEquipLvUp(serverId, roleId, sid, ePlace, newEplace, [...eplaceIds.keys()]);
|
||||
|
||||
const curHero = {
|
||||
@@ -223,7 +223,7 @@ export class EquipHandler {
|
||||
ePlace: newEplace,
|
||||
consumes: addConsumeToHero(hero.consumes, consumes),
|
||||
}
|
||||
await calculateCe(HERO_SYSTEM_TYPE.EQUIP_QUALITY, roleId, serverId, sid, update, {}, { hid, ePlaceId });
|
||||
await calculateCeWithHero(HERO_SYSTEM_TYPE.EQUIP_QUALITY, roleId, serverId, sid, hid, update, { ePlaceId });
|
||||
|
||||
await checkTaskInEquipQualityUp(serverId, roleId, sid, oldEplace, newEplace, ePlaceId, hid, isUpQuality);
|
||||
pushEquipQualityMax(roleId, roleName, serverId, hid, newEquip, isUpQuality);
|
||||
@@ -298,7 +298,7 @@ export class EquipHandler {
|
||||
ePlace: newEplace,
|
||||
consumes: addConsumeToHero(hero.consumes, consumes)
|
||||
}
|
||||
await calculateCe(HERO_SYSTEM_TYPE.EQUIP_STAR, roleId, serverId, sid, update, {}, { hid, ePlaceId });
|
||||
await calculateCeWithHero(HERO_SYSTEM_TYPE.EQUIP_STAR, roleId, serverId, sid, hid, update, { ePlaceId });
|
||||
|
||||
await checkTaskInEquipStarUp(serverId, roleId, sid, oldEplace, newEplace, ePlaceId, hid, isUpStar);
|
||||
pushEquipStarMax(roleId, roleName, serverId, hid, newEquip, isUpStar);
|
||||
@@ -343,7 +343,7 @@ export class EquipHandler {
|
||||
let canChange = originJewel && checkJewelCanPutOnEquip(originEquip, originJewel);
|
||||
if(canChange) canSentMineToOrigin = true;
|
||||
let { newEplace, updatedEplace } = updateEplace(originEplace, ePlaceId, { jewel: canChange? originJewel.seqId: 0 });
|
||||
await calculateCe(HERO_SYSTEM_TYPE.EQUIP_JEWEL, roleId, serverId, sid, { ePlace: newEplace }, {}, { hid, ePlaceId, oldJewel: jewel, newJewel: canChange? originJewel:null });
|
||||
await calculateCeWithHero(HERO_SYSTEM_TYPE.EQUIP_JEWEL, roleId, serverId, sid, hid, { ePlace: newEplace }, { ePlaceId, oldJewel: jewel, newJewel: canChange? originJewel:null });
|
||||
await checkTaskInPutJewel(serverId, roleId, sid, originEplace, newEplace, ePlaceId, jewel, canChange? originJewel:null);
|
||||
|
||||
originHeroResult = { hid: originHero.hid, ePlace: updatedEplace };
|
||||
@@ -356,7 +356,7 @@ export class EquipHandler {
|
||||
// 目标镶嵌上
|
||||
let curJewel = await JewelModel.putOnOrOff(seqId, hid, ePlaceId);
|
||||
let { newEplace, updatedEplace } = updateEplace(oldEplace, ePlaceId, { jewel: seqId });
|
||||
await calculateCe(HERO_SYSTEM_TYPE.EQUIP_JEWEL, roleId, serverId, sid, { ePlace: newEplace }, {}, { hid, ePlaceId, oldJewel: originJewel, newJewel: curJewel });
|
||||
await calculateCeWithHero(HERO_SYSTEM_TYPE.EQUIP_JEWEL, roleId, serverId, sid, hid, { ePlace: newEplace }, { ePlaceId, oldJewel: originJewel, newJewel: curJewel });
|
||||
await checkTaskInPutJewel(serverId, roleId, sid, oldEplace, newEplace, ePlaceId, originJewel, curJewel);
|
||||
|
||||
let curHero = {
|
||||
@@ -384,7 +384,7 @@ export class EquipHandler {
|
||||
|
||||
let curJewel = await JewelModel.putOnOrOff(curEquip.jewel, 0, 0);
|
||||
let { newEplace, updatedEplace } = updateEplace(oldEplace, ePlaceId, { jewel: 0 });
|
||||
await calculateCe(HERO_SYSTEM_TYPE.EQUIP_JEWEL, roleId, serverId, sid, { ePlace: newEplace }, {}, { hid, ePlaceId, oldJewel: curJewel });
|
||||
await calculateCeWithHero(HERO_SYSTEM_TYPE.EQUIP_JEWEL, roleId, serverId, sid, hid, { ePlace: newEplace }, { ePlaceId, oldJewel: curJewel });
|
||||
await checkTaskInPutJewel(serverId, roleId, sid, oldEplace, newEplace, ePlaceId, null, curJewel);
|
||||
|
||||
let curHero = {
|
||||
@@ -437,7 +437,7 @@ export class EquipHandler {
|
||||
ePlace: newEplace,
|
||||
consumes: updateConsumes,
|
||||
}
|
||||
await calculateCe(HERO_SYSTEM_TYPE.EQUIP_STONE, roleId, serverId, sid, update, {}, { hid, ePlaceId, jewel });
|
||||
await calculateCeWithHero(HERO_SYSTEM_TYPE.EQUIP_STONE, roleId, serverId, sid, hid, update, { ePlaceId, jewel });
|
||||
await checkTaskInPutStone(serverId, roleId, sid, oldEplace, newEplace, ePlaceId, jewel);
|
||||
|
||||
let curHero = {
|
||||
@@ -557,7 +557,7 @@ export class EquipHandler {
|
||||
// 更新战力
|
||||
if(hid > 0) {
|
||||
const hero = await HeroModel.findByHidAndRole(hid, roleId);
|
||||
await calculateCe(HERO_SYSTEM_TYPE.JEWEL_RESET_RANDSE, roleId, serverId, sid, {}, {}, { hid, ePlaceId, oldJewel: jewel, newJewel, hero });
|
||||
await calculateCeWithHero(HERO_SYSTEM_TYPE.JEWEL_RESET_RANDSE, roleId, serverId, sid, hid, {}, { ePlaceId, oldJewel: jewel, newJewel, hero });
|
||||
}
|
||||
|
||||
await checkTaskInEquipReset(serverId, roleId, sid);
|
||||
@@ -639,7 +639,7 @@ export class EquipHandler {
|
||||
// 更新战力
|
||||
if(isSuccess && hid > 0) {
|
||||
const hero = await HeroModel.findByHidAndRole(hid, roleId);
|
||||
await calculateCe(HERO_SYSTEM_TYPE.JEWEL_QUENCH, roleId, serverId, sid, {}, {}, { hid, ePlaceId, oldJewel: jewel, newJewel, hero });
|
||||
await calculateCeWithHero(HERO_SYSTEM_TYPE.JEWEL_QUENCH, roleId, serverId, sid, hid, {}, { ePlaceId, oldJewel: jewel, newJewel, hero });
|
||||
}
|
||||
|
||||
await checkTaskInEquipQuench(serverId, roleId, sid, isSuccess);
|
||||
@@ -759,7 +759,7 @@ export class EquipHandler {
|
||||
// 更新战力
|
||||
if(targetJewel.hid > 0) {
|
||||
const hero = await HeroModel.findByHidAndRole(targetJewel.hid, roleId);
|
||||
await calculateCe(HERO_SYSTEM_TYPE.JEWEL_RESET_RANDSE, roleId, serverId, sid, {}, {}, { hid: targetJewel.ePlaceId, ePlaceId: targetJewel.ePlaceId, oldJewel: originJewel, newJewel, hero });
|
||||
await calculateCeWithHero(HERO_SYSTEM_TYPE.JEWEL_RESET_RANDSE, roleId, serverId, sid, targetJewel.hid, {}, { hid: targetJewel.ePlaceId, ePlaceId: targetJewel.ePlaceId, oldJewel: originJewel, newJewel, hero });
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user