diff --git a/package-lock.json b/package-lock.json index db97566d..7fbb4684 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "ncp": "^2.0.0", "typescript": "^5.5", "undici": "^7.10.0", - "warframe-public-export-plus": "^0.5.74", + "warframe-public-export-plus": "^0.5.76", "warframe-riven-info": "^0.1.2", "winston": "^3.17.0", "winston-daily-rotate-file": "^5.0.0", @@ -3386,9 +3386,9 @@ } }, "node_modules/warframe-public-export-plus": { - "version": "0.5.74", - "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.74.tgz", - "integrity": "sha512-pA7dxA0lKn9w/2Sc97oxnn+CEzL1SrT9XriNLTDF4Xp+2SBEpGcfbqbdR9ljPQJopIbrc9Zy02R+uBQVomcwyA==" + "version": "0.5.76", + "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.76.tgz", + "integrity": "sha512-0gX3NTWaxFyzUmqBSUHhPY8pMRX92iXQFqoBuMQlMG1+6uC6JMKtwP5t8cuXR3pvV2vkaCi/cDWjP1JUChkZ9g==" }, "node_modules/warframe-riven-info": { "version": "0.1.2", diff --git a/package.json b/package.json index 99f8c63d..eed277ae 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "ncp": "^2.0.0", "typescript": "^5.5", "undici": "^7.10.0", - "warframe-public-export-plus": "^0.5.74", + "warframe-public-export-plus": "^0.5.76", "warframe-riven-info": "^0.1.2", "winston": "^3.17.0", "winston-daily-rotate-file": "^5.0.0", diff --git a/src/controllers/api/guildTechController.ts b/src/controllers/api/guildTechController.ts index 97abbecf..f3e37217 100644 --- a/src/controllers/api/guildTechController.ts +++ b/src/controllers/api/guildTechController.ts @@ -5,6 +5,7 @@ import { getGuildVault, hasAccessToDojo, hasGuildPermission, + processCompletedGuildTechProject, processFundedGuildTechProject, processGuildTechProjectContributionsUpdate, removePigmentsFromGuildMembers, @@ -51,8 +52,12 @@ export const guildTechController: RequestHandler = async (req, res) => { }; if (project.CompletionDate) { techProject.CompletionDate = toMongoDate(project.CompletionDate); - if (Date.now() >= project.CompletionDate.getTime()) { - needSave ||= setGuildTechLogState(guild, project.ItemType, 4, project.CompletionDate); + if ( + Date.now() >= project.CompletionDate.getTime() && + setGuildTechLogState(guild, project.ItemType, 4, project.CompletionDate) + ) { + processCompletedGuildTechProject(guild, project.ItemType); + needSave = true; } } techProjects.push(techProject); diff --git a/src/controllers/api/placeDecoInComponentController.ts b/src/controllers/api/placeDecoInComponentController.ts index 088f1f11..fc1ef445 100644 --- a/src/controllers/api/placeDecoInComponentController.ts +++ b/src/controllers/api/placeDecoInComponentController.ts @@ -57,8 +57,12 @@ export const placeDecoInComponentController: RequestHandler = async (req, res) = component.DecoCapacity -= meta.capacityCost; } } else { - const [itemType, meta] = Object.entries(ExportResources).find(arr => arr[1].deco == deco.Type)!; - if (!itemType || meta.dojoCapacityCost === undefined) { + const entry = Object.entries(ExportResources).find(arr => arr[1].deco == deco.Type); + if (!entry) { + throw new Error(`unknown deco type: ${deco.Type}`); + } + const [itemType, meta] = entry; + if (meta.dojoCapacityCost === undefined) { throw new Error(`unknown deco type: ${deco.Type}`); } component.DecoCapacity -= meta.dojoCapacityCost; @@ -75,7 +79,13 @@ export const placeDecoInComponentController: RequestHandler = async (req, res) = if (meta) { processDojoBuildMaterialsGathered(guild, meta); } - } else if (guild.AutoContributeFromVault && guild.VaultRegularCredits && guild.VaultMiscItems) { + } else if ( + deco.Type.startsWith("/Lotus/Objects/Tenno/Dojo/NpcPlaceables/") || + (guild.AutoContributeFromVault && guild.VaultRegularCredits && guild.VaultMiscItems) + ) { + if (!guild.VaultRegularCredits || !guild.VaultMiscItems) { + throw new Error(`dojo visitor placed without anything in vault?!`); + } if (guild.VaultRegularCredits >= scaleRequiredCount(guild.Tier, meta.price)) { let enoughMiscItems = true; for (const ingredient of meta.ingredients) { diff --git a/src/services/guildService.ts b/src/services/guildService.ts index edf07ce1..87e2f721 100644 --- a/src/services/guildService.ts +++ b/src/services/guildService.ts @@ -550,6 +550,19 @@ export const processFundedGuildTechProject = ( guild.XP += recipe.guildXpValue; } setGuildTechLogState(guild, techProject.ItemType, config.noDojoResearchTime ? 4 : 3, techProject.CompletionDate); + if (config.noDojoResearchTime) { + processCompletedGuildTechProject(guild, techProject.ItemType); + } +}; + +export const processCompletedGuildTechProject = (guild: TGuildDatabaseDocument, type: string): void => { + if (type.startsWith("/Lotus/Levels/ClanDojo/ComponentPropRecipes/NpcPlaceables/")) { + guild.VaultDecoRecipes ??= []; + guild.VaultDecoRecipes.push({ + ItemType: type, + ItemCount: 1 + }); + } }; export const setGuildTechLogState = ( diff --git a/src/services/shipCustomizationsService.ts b/src/services/shipCustomizationsService.ts index 990fa13e..c815dc56 100644 --- a/src/services/shipCustomizationsService.ts +++ b/src/services/shipCustomizationsService.ts @@ -64,8 +64,12 @@ export const handleSetShipDecorations = async ( throw new Error(`unknown room: ${placedDecoration.Room}`); } - const [itemType, meta] = Object.entries(ExportResources).find(arr => arr[1].deco == placedDecoration.Type)!; - if (!itemType || meta.capacityCost === undefined) { + const entry = Object.entries(ExportResources).find(arr => arr[1].deco == placedDecoration.Type); + if (!entry) { + throw new Error(`unknown deco type: ${placedDecoration.Type}`); + } + const [itemType, meta] = entry; + if (meta.capacityCost === undefined) { throw new Error(`unknown deco type: ${placedDecoration.Type}`); } diff --git a/static/fixed_responses/allDecoRecipes.json b/static/fixed_responses/allDecoRecipes.json index efbbeed2..471f7ae3 100644 --- a/static/fixed_responses/allDecoRecipes.json +++ b/static/fixed_responses/allDecoRecipes.json @@ -92,5 +92,13 @@ "/Lotus/Levels/ClanDojo/ComponentPropRecipes/ThumperTrophySilverRecipe", "/Lotus/Levels/ClanDojo/ComponentPropRecipes/CorpusPlaceables/GasTurbineConeRecipe", "/Lotus/Levels/ClanDojo/ComponentPropRecipes/NaturalPlaceables/CoralChunkARecipe", - "/Lotus/Levels/ClanDojo/ComponentPropRecipes/TennoPlaceables/TnoBeaconEmitterRecipe" + "/Lotus/Levels/ClanDojo/ComponentPropRecipes/TennoPlaceables/TnoBeaconEmitterRecipe", + "/Lotus/Levels/ClanDojo/ComponentPropRecipes/NpcPlaceables/OstronFemaleSitting", + "/Lotus/Levels/ClanDojo/ComponentPropRecipes/NpcPlaceables/OstronFemaleStanding", + "/Lotus/Levels/ClanDojo/ComponentPropRecipes/NpcPlaceables/OstronMaleStanding", + "/Lotus/Levels/ClanDojo/ComponentPropRecipes/NpcPlaceables/OstronMaleStandingTwo", + "/Lotus/Levels/ClanDojo/ComponentPropRecipes/NpcPlaceables/SolarisForeman", + "/Lotus/Levels/ClanDojo/ComponentPropRecipes/NpcPlaceables/SolarisHazard", + "/Lotus/Levels/ClanDojo/ComponentPropRecipes/NpcPlaceables/SolarisStrikerOne", + "/Lotus/Levels/ClanDojo/ComponentPropRecipes/NpcPlaceables/SolarisStrikerThree" ]