XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

fix: don't give mastery xp for SpecialItems except for venari (#2484)

Closes #2482 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2484 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

ba3df4bd
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

1 个文件 +25 -19
Modified src/services/inventoryService.ts +25 -19
@@ -1662,28 +1662,34 @@ export const applyClientEquipmentUpdates = (
1662 1662 item.XP ??= 0;
1663 1663 item.XP += XP;
1664 1664
1665 let xpItemType = item.ItemType;
1666 if (item.ModularParts) {
1667 for (const part of item.ModularParts) {
1668 // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1669 const partType = ExportWeapons[part]?.partType;
1670 if (partType !== undefined && xpEarningParts.indexOf(partType) != -1) {
1671 xpItemType = part;
1672 break;
1665 if (
1666 categoryName != "SpecialItems" ||
1667 item.ItemType == "/Lotus/Powersuits/Khora/Kavat/KhoraKavatPowerSuit" ||
1668 item.ItemType == "/Lotus/Powersuits/Khora/Kavat/KhoraPrimeKavatPowerSuit"
1669 ) {
1670 let xpItemType = item.ItemType;
1671 if (item.ModularParts) {
1672 for (const part of item.ModularParts) {
1673 // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1674 const partType = ExportWeapons[part]?.partType;
1675 if (partType !== undefined && xpEarningParts.indexOf(partType) != -1) {
1676 xpItemType = part;
1677 break;
1678 }
1673 1679 }
1680 logger.debug(`adding xp to ${xpItemType} for modular item ${fromOid(ItemId)} (${item.ItemType})`);
1674 1681 }
1675 logger.debug(`adding xp to ${xpItemType} for modular item ${fromOid(ItemId)} (${item.ItemType})`);
1676 }
1677 1682
1678 const xpinfoIndex = inventory.XPInfo.findIndex(x => x.ItemType == xpItemType);
1679 if (xpinfoIndex !== -1) {
1680 const xpinfo = inventory.XPInfo[xpinfoIndex];
1681 xpinfo.XP += XP;
1682 } else {
1683 inventory.XPInfo.push({
1684 ItemType: xpItemType,
1685 XP: XP
1686 });
1683 const xpinfoIndex = inventory.XPInfo.findIndex(x => x.ItemType == xpItemType);
1684 if (xpinfoIndex !== -1) {
1685 const xpinfo = inventory.XPInfo[xpinfoIndex];
1686 xpinfo.XP += XP;
1687 } else {
1688 inventory.XPInfo.push({
1689 ItemType: xpItemType,
1690 XP: XP
1691 });
1692 }
1687 1693 }
1688 1694 }
1689 1695