feat(webui): edit suit invigorations #2478
@ -1,5 +1,6 @@
|
||||
import { RequestHandler } from "express";
|
||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||
import { sendWsBroadcastTo } from "@/src/services/wsService";
|
||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||
import { addMiscItems, getInventory } from "@/src/services/inventoryService";
|
||||
import { TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||
@ -73,4 +74,5 @@ export const gildWeaponController: RequestHandler = async (req, res) => {
|
||||
InventoryChanges: inventoryChanges,
|
||||
AffiliationMods: affiliationMods
|
||||
});
|
||||
sendWsBroadcastTo(accountId, { update_inventory: true });
|
||||
};
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { RequestHandler } from "express";
|
||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||
import { sendWsBroadcastTo } from "@/src/services/wsService";
|
||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||
import {
|
||||
getInventory,
|
||||
@ -194,4 +195,5 @@ export const modularWeaponCraftingController: RequestHandler = async (req, res)
|
||||
MiscItems: miscItemChanges
|
||||
}
|
||||
});
|
||||
sendWsBroadcastTo(accountId, { update_inventory: true });
|
||||
};
|
||||
|
@ -15,6 +15,7 @@ import {
|
||||
} from "@/src/services/inventoryService";
|
||||
import { getDefaultUpgrades } from "@/src/services/itemDataService";
|
||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||
import { sendWsBroadcastTo } from "@/src/services/wsService";
|
||||
import { modularWeaponTypes } from "@/src/helpers/modularWeaponHelper";
|
||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||
import { EquipmentFeatures } from "@/src/types/equipmentTypes";
|
||||
@ -68,6 +69,7 @@ export const modularWeaponSaleController: RequestHandler = async (req, res) => {
|
||||
res.json({
|
||||
InventoryChanges: inventoryChanges
|
||||
});
|
||||
sendWsBroadcastTo(accountId, { update_inventory: true });
|
||||
} else {
|
||||
throw new Error(`unknown modularWeaponSale op: ${String(req.query.op)}`);
|
||||
}
|
||||
|
@ -16,15 +16,28 @@ export const playerSkillsController: RequestHandler = async (req, res) => {
|
||||
inventory.PlayerSkills[request.Skill as keyof IPlayerSkills]++;
|
||||
|
||||
const inventoryChanges: IInventoryChanges = {};
|
||||
if (request.Skill == "LPS_COMMAND" && inventory.PlayerSkills.LPS_COMMAND == 9) {
|
||||
const consumablesChanges = [
|
||||
{
|
||||
ItemType: "/Lotus/Types/Restoratives/Consumable/CrewmateBall",
|
||||
ItemCount: 1
|
||||
}
|
||||
];
|
||||
addConsumables(inventory, consumablesChanges);
|
||||
inventoryChanges.Consumables = consumablesChanges;
|
||||
if (request.Skill == "LPS_COMMAND") {
|
||||
if (inventory.PlayerSkills.LPS_COMMAND == 9) {
|
||||
const consumablesChanges = [
|
||||
{
|
||||
ItemType: "/Lotus/Types/Restoratives/Consumable/CrewmateBall",
|
||||
ItemCount: 1
|
||||
}
|
||||
];
|
||||
addConsumables(inventory, consumablesChanges);
|
||||
inventoryChanges.Consumables = consumablesChanges;
|
||||
}
|
||||
} else if (request.Skill == "LPS_DRIFT_RIDING") {
|
||||
if (inventory.PlayerSkills.LPS_DRIFT_RIDING == 9) {
|
||||
const consumablesChanges = [
|
||||
{
|
||||
ItemType: "/Lotus/Types/Restoratives/ErsatzSummon",
|
||||
ItemCount: 1
|
||||
}
|
||||
];
|
||||
addConsumables(inventory, consumablesChanges);
|
||||
inventoryChanges.Consumables = consumablesChanges;
|
||||
}
|
||||
}
|
||||
|
||||
await inventory.save();
|
||||
|
@ -1662,28 +1662,34 @@ export const applyClientEquipmentUpdates = (
|
||||
item.XP ??= 0;
|
||||
item.XP += XP;
|
||||
|
||||
let xpItemType = item.ItemType;
|
||||
if (item.ModularParts) {
|
||||
for (const part of item.ModularParts) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
const partType = ExportWeapons[part]?.partType;
|
||||
if (partType !== undefined && xpEarningParts.indexOf(partType) != -1) {
|
||||
xpItemType = part;
|
||||
break;
|
||||
if (
|
||||
categoryName != "SpecialItems" ||
|
||||
item.ItemType == "/Lotus/Powersuits/Khora/Kavat/KhoraKavatPowerSuit" ||
|
||||
item.ItemType == "/Lotus/Powersuits/Khora/Kavat/KhoraPrimeKavatPowerSuit"
|
||||
) {
|
||||
let xpItemType = item.ItemType;
|
||||
if (item.ModularParts) {
|
||||
for (const part of item.ModularParts) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
const partType = ExportWeapons[part]?.partType;
|
||||
if (partType !== undefined && xpEarningParts.indexOf(partType) != -1) {
|
||||
xpItemType = part;
|
||||
break;
|
||||
}
|
||||
}
|
||||
logger.debug(`adding xp to ${xpItemType} for modular item ${fromOid(ItemId)} (${item.ItemType})`);
|
||||
}
|
||||
logger.debug(`adding xp to ${xpItemType} for modular item ${fromOid(ItemId)} (${item.ItemType})`);
|
||||
}
|
||||
|
||||
const xpinfoIndex = inventory.XPInfo.findIndex(x => x.ItemType == xpItemType);
|
||||
if (xpinfoIndex !== -1) {
|
||||
const xpinfo = inventory.XPInfo[xpinfoIndex];
|
||||
xpinfo.XP += XP;
|
||||
} else {
|
||||
inventory.XPInfo.push({
|
||||
ItemType: xpItemType,
|
||||
XP: XP
|
||||
});
|
||||
const xpinfoIndex = inventory.XPInfo.findIndex(x => x.ItemType == xpItemType);
|
||||
if (xpinfoIndex !== -1) {
|
||||
const xpinfo = inventory.XPInfo[xpinfoIndex];
|
||||
xpinfo.XP += XP;
|
||||
} else {
|
||||
inventory.XPInfo.push({
|
||||
ItemType: xpItemType,
|
||||
XP: XP
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -282,6 +282,7 @@ function fetchItemList() {
|
||||
});
|
||||
|
||||
const syndicateNone = document.createElement("option");
|
||||
syndicateNone.value = "";
|
||||
syndicateNone.textContent = loc("cheats_none");
|
||||
document.getElementById("changeSyndicate").innerHTML = "";
|
||||
document.getElementById("changeSyndicate").appendChild(syndicateNone);
|
||||
|
@ -61,7 +61,7 @@ dict = {
|
||||
code_pigment: `Pigmento`,
|
||||
code_mature: `Listo para el combate`,
|
||||
code_unmature: `Regresar el envejecimiento genético`,
|
||||
code_succChange: `[UNTRANSLATED] Successfully changed.`,
|
||||
code_succChange: `Cambiado correctamente`,
|
||||
login_description: `Inicia sesión con las credenciales de tu cuenta OpenWF (las mismas que usas en el juego al conectarte a este servidor).`,
|
||||
login_emailLabel: `Dirección de correo electrónico`,
|
||||
login_passwordLabel: `Contraseña`,
|
||||
@ -124,7 +124,7 @@ dict = {
|
||||
detailedView_archonShardsDescription2: `Ten en cuenta que cada fragmento de archón tarda un poco en aplicarse al cargar`,
|
||||
detailedView_valenceBonusLabel: `Bônus de Valência`,
|
||||
detailedView_valenceBonusDescription: `Puedes establecer o quitar el bono de valencia de tu arma.`,
|
||||
detailedView_modularPartsLabel: `[UNTRANSLATED] Change Modular Parts`,
|
||||
detailedView_modularPartsLabel: `Cambiar partes modulares`,
|
||||
detailedView_editSuitInvigoration: `[UNTRANSLATED] Edit Suit Invigoration`,
|
||||
|
||||
mods_addRiven: `Agregar Agrietado`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user