feat: unlock all captura scenes #650

Merged
Sainan merged 1 commits from captura into main 2024-12-29 12:11:36 -08:00
7 changed files with 48 additions and 8 deletions

View File

@ -22,6 +22,7 @@
"unlockAllShipDecorations": true, "unlockAllShipDecorations": true,
"unlockAllFlavourItems": true, "unlockAllFlavourItems": true,
"unlockAllSkins": true, "unlockAllSkins": true,
"unlockAllCapturaScenes": true,
"universalPolarityEverywhere": true, "universalPolarityEverywhere": true,
"spoofMasteryRank": -1 "spoofMasteryRank": -1
} }

8
package-lock.json generated
View File

@ -12,7 +12,7 @@
"copyfiles": "^2.4.1", "copyfiles": "^2.4.1",
"express": "^5", "express": "^5",
"mongoose": "^8.9.2", "mongoose": "^8.9.2",
"warframe-public-export-plus": "^0.5.15", "warframe-public-export-plus": "^0.5.16",
"warframe-riven-info": "^0.1.2", "warframe-riven-info": "^0.1.2",
"winston": "^3.17.0", "winston": "^3.17.0",
"winston-daily-rotate-file": "^5.0.0" "winston-daily-rotate-file": "^5.0.0"
@ -3877,9 +3877,9 @@
} }
}, },
"node_modules/warframe-public-export-plus": { "node_modules/warframe-public-export-plus": {
"version": "0.5.15", "version": "0.5.16",
"resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.15.tgz", "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.16.tgz",
"integrity": "sha512-xsMgj1+lB2VPDCLuU88YsbwQiGQT5cNgjgNTk1iKx2ZpX31fu19tflTWrTHEJbSnqxuh/8h2LP5ZpBZV0a9fCg==" "integrity": "sha512-4Mgng3ojWfF0mffZDKQLwrKx6qHty7o35F5+nCDmSal1TzjeEclJCSgoMgdAO0e+Ug/lTP7FSiIXcU4SDk3gsw=="
}, },
"node_modules/warframe-riven-info": { "node_modules/warframe-riven-info": {
"version": "0.1.2", "version": "0.1.2",

View File

@ -16,7 +16,7 @@
"copyfiles": "^2.4.1", "copyfiles": "^2.4.1",
"express": "^5", "express": "^5",
"mongoose": "^8.9.2", "mongoose": "^8.9.2",
"warframe-public-export-plus": "^0.5.15", "warframe-public-export-plus": "^0.5.16",
"warframe-riven-info": "^0.1.2", "warframe-riven-info": "^0.1.2",
"winston": "^3.17.0", "winston": "^3.17.0",
"winston-daily-rotate-file": "^5.0.0" "winston-daily-rotate-file": "^5.0.0"

View File

@ -7,9 +7,16 @@ import allDialogue from "@/static/fixed_responses/allDialogue.json";
import { ILoadoutDatabase } from "@/src/types/saveLoadoutTypes"; import { ILoadoutDatabase } from "@/src/types/saveLoadoutTypes";
import { IShipInventory, equipmentKeys } from "@/src/types/inventoryTypes/inventoryTypes"; import { IShipInventory, equipmentKeys } from "@/src/types/inventoryTypes/inventoryTypes";
import { IPolarity, ArtifactPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes"; import { IPolarity, ArtifactPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
import { ExportCustoms, ExportFlavour, ExportKeys, ExportRegions, ExportResources } from "warframe-public-export-plus"; import {
ExportCustoms,
ExportFlavour,
ExportKeys,
ExportRegions,
ExportResources,
ExportVirtuals
} from "warframe-public-export-plus";
const inventoryController: RequestHandler = async (request, response) => { export const inventoryController: RequestHandler = async (request, response) => {
let account; let account;
try { try {
account = await getAccountForRequest(request); account = await getAccountForRequest(request);
@ -152,6 +159,17 @@ const inventoryController: RequestHandler = async (request, response) => {
} }
} }
if (config.unlockAllCapturaScenes) {
for (const uniqueName of Object.keys(ExportResources)) {
if (resourceInheritsFrom(uniqueName, "/Lotus/Types/Items/MiscItems/PhotoboothTile")) {
inventoryResponse.MiscItems.push({
ItemType: uniqueName,
ItemCount: 1
});
}
}
}
if (typeof config.spoofMasteryRank === "number" && config.spoofMasteryRank >= 0) { if (typeof config.spoofMasteryRank === "number" && config.spoofMasteryRank >= 0) {
inventoryResponse.PlayerLevel = config.spoofMasteryRank; inventoryResponse.PlayerLevel = config.spoofMasteryRank;
if (!("xpBasedLevelCapDisabled" in request.query)) { if (!("xpBasedLevelCapDisabled" in request.query)) {
@ -206,4 +224,19 @@ const getExpRequiredForMr = (rank: number): number => {
return 2_250_000 + 147_500 * (rank - 30); return 2_250_000 + 147_500 * (rank - 30);
}; };
export { inventoryController }; const resourceInheritsFrom = (resourceName: string, targetName: string): boolean => {
let parentName = resourceGetParent(resourceName);
for (; parentName != undefined; parentName = resourceGetParent(parentName)) {
if (parentName == targetName) {
return true;
}
}
return false;
};
const resourceGetParent = (resourceName: string): string | undefined => {
if (resourceName in ExportResources) {
return ExportResources[resourceName].parentName;
}
return ExportVirtuals[resourceName]?.parentName;
};

View File

@ -47,6 +47,7 @@ interface IConfig {
unlockAllShipDecorations?: boolean; unlockAllShipDecorations?: boolean;
unlockAllFlavourItems?: boolean; unlockAllFlavourItems?: boolean;
unlockAllSkins?: boolean; unlockAllSkins?: boolean;
unlockAllCapturaScenes?: boolean;
universalPolarityEverywhere?: boolean; universalPolarityEverywhere?: boolean;
spoofMasteryRank?: number; spoofMasteryRank?: number;
} }

View File

@ -257,6 +257,10 @@
<input class="form-check-input" type="checkbox" id="unlockAllSkins" /> <input class="form-check-input" type="checkbox" id="unlockAllSkins" />
<label class="form-check-label" for="unlockAllSkins">Unlock All Skins</label> <label class="form-check-label" for="unlockAllSkins">Unlock All Skins</label>
</div> </div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="unlockAllCapturaScenes" />
<label class="form-check-label" for="unlockAllCapturaScenes">Unlock All Captura Scenes</label>
</div>
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" id="universalPolarityEverywhere" /> <input class="form-check-input" type="checkbox" id="universalPolarityEverywhere" />
<label class="form-check-label" for="universalPolarityEverywhere"> <label class="form-check-label" for="universalPolarityEverywhere">

View File

@ -787,6 +787,7 @@ const uiConfigs = [
"unlockAllShipDecorations", "unlockAllShipDecorations",
"unlockAllFlavourItems", "unlockAllFlavourItems",
"unlockAllSkins", "unlockAllSkins",
"unlockAllCapturaScenes",
"universalPolarityEverywhere", "universalPolarityEverywhere",
"spoofMasteryRank" "spoofMasteryRank"
]; ];