diff --git a/game-server/app/servers/gm/handler/gmRoleHandler.ts b/game-server/app/servers/gm/handler/gmRoleHandler.ts index 09fcbb2f4..fae95cfbb 100644 --- a/game-server/app/servers/gm/handler/gmRoleHandler.ts +++ b/game-server/app/servers/gm/handler/gmRoleHandler.ts @@ -28,6 +28,7 @@ import { SchoolModel } from '../../../db/School'; import { JewelModel } from '../../../db/Jewel'; import { RoleCeModel } from '../../../db/RoleCe'; import { setTrainLv } from '../../../services/gmService'; +import { ArtifactModel } from '../../../db/Artifact'; let timer: NodeJS.Timer; export default function (app: Application) { @@ -301,8 +302,9 @@ export class GmRoleHandler { let jewels = await JewelModel.findbyRole(roleId); let heroes = await HeroModel.findByRole(roleId); let skins = await SkinModel.findbyRole(roleId); + let artifacts = await ArtifactModel.findbyRole(roleId); - await calculateCeWithRole(HERO_SYSTEM_TYPE.RE_CAL, roleId, role.serverId, null, {}, { role, schools, jewels, heroes, skins }); + await calculateCeWithRole(HERO_SYSTEM_TYPE.RE_CAL, roleId, role.serverId, null, {}, { role, schools, jewels, heroes, skins, artifacts }); return resResult(STATUS.SUCCESS); } } \ No newline at end of file diff --git a/game-server/app/services/playerCeService.ts b/game-server/app/services/playerCeService.ts index abea54d95..8359e7153 100644 --- a/game-server/app/services/playerCeService.ts +++ b/game-server/app/services/playerCeService.ts @@ -46,6 +46,7 @@ interface Param { stonesId?: number, talentId?: number, artifact?: ArtifactModelType, + artifacts?: ArtifactModelType[], job?: number, } @@ -324,7 +325,7 @@ export async function calculateCes(type: HERO_SYSTEM_TYPE, roleId: string, serve } case HERO_SYSTEM_TYPE.RE_CAL: // 31. 重新计算 { - let { role, schools, jewels, heroes, skins } = param; + let { role, schools, jewels, heroes, skins, artifacts } = param; calCe.clearRoleCe(); for(let { hid, skinId, lv, quality, star, starStage, colorStar, colorStarStage, job, jobStage, connections, skins, scrollStar, scrollQuality, scrollColorStar, ePlace } of heroes) { calCe.setHeroBase(hid, skinId); @@ -343,6 +344,8 @@ export async function calculateCes(type: HERO_SYSTEM_TYPE, roleId: string, serve calCe.setTitle(role.title); calCe.setTeraph(role.teraphs); } + let artifact = artifacts.find(cur => cur.hid == hid); + if(artifact) calCe.setPutArtifact(hid, skinId, job, artifact); calCe.setEquipSuit(hid, skinId, ePlace); calCe.setScroll(hid, scrollStar, scrollQuality, scrollColorStar); } @@ -364,8 +367,8 @@ export async function calculateCes(type: HERO_SYSTEM_TYPE, roleId: string, serve if(!artifact) break; for(let [hid ] of heroUpdates) { calCe.setPutArtifact(hid, skinId, job, artifact); - calCe.setArtifactQuality(hid, artifact.artifactId); - calCe.setArtifactSeid(hid, skinId, job, artifact.artifactId); + // calCe.setArtifactQuality(hid, artifact.artifactId); + // calCe.setArtifactSeid(hid, skinId, job, artifact.artifactId); ceChangeTxt.push(`武将 ${hid} 装备宝物 ${artifact.artifactId}`); } break; diff --git a/game-server/app/services/role/calCe.ts b/game-server/app/services/role/calCe.ts index 427a1c312..b38ca2377 100644 --- a/game-server/app/services/role/calCe.ts +++ b/game-server/app/services/role/calCe.ts @@ -528,7 +528,7 @@ export class CalCe { if(artifact) { this.setArtifactLv(hid, artifact.artifactId, artifact.lv); this.setArtifactQuality(hid, artifact.artifactId); - this.setArtifactSeid(hid, skinId, job, artifact.lv); + this.setArtifactSeid(hid, skinId, job, artifact.artifactId); } } @@ -580,9 +580,11 @@ export class CalCe { let dicArtifactSeid = gameData.artifactSeid.get(seid); if(!dicArtifactSeid) continue; if(dicArtifactSeid.jobClass != 0 && dicArtifactSeid.jobClass != dicJob.job_class) continue; - if(dicArtifactSeid.hids.indexOf(skinId) == -1) continue; + if(dicArtifactSeid.hids.length > 0 && dicArtifactSeid.hids.indexOf(skinId) == -1) continue; if(dicArtifactSeid.quality > dicArtifact.quality) continue; - seids.push(...dicArtifactSeid.seids); + for(let seid of dicArtifactSeid.seids) { + seids.push(seid, 0); + } } let { ratioUp } = this.addSeidEffect(seids); diff --git a/shared/pubUtils/dictionary/DicArtifactSeid.ts b/shared/pubUtils/dictionary/DicArtifactSeid.ts index 25d0b1dda..4396bce97 100644 --- a/shared/pubUtils/dictionary/DicArtifactSeid.ts +++ b/shared/pubUtils/dictionary/DicArtifactSeid.ts @@ -34,7 +34,7 @@ export function loadArtifactSeid() { arr.forEach(o => { o.seids = parseNumberList(o.newId); o.hids = parseNumberList(o.hids); - dicArtifactSeid.set(o.seid, _.pick(o, Object.keys(DicArtifactSeidKeys))); + dicArtifactSeid.set(o.id, _.pick(o, Object.keys(DicArtifactSeidKeys))); }); arr = undefined;