feat: noVendorPurchaseLimits cheat
All checks were successful
Build / build (22) (push) Successful in 41s
Build / build (20) (push) Successful in 1m4s
Build / build (18) (push) Successful in 1m12s
Build / build (18) (pull_request) Successful in 44s
Build / build (20) (pull_request) Successful in 1m5s
Build / build (22) (pull_request) Successful in 1m9s

This commit is contained in:
Sainan 2025-03-11 16:12:06 +01:00
parent eef87947ce
commit 163aeb58ee
8 changed files with 49 additions and 38 deletions

View File

@ -29,6 +29,7 @@
"unlockExilusEverywhere": false, "unlockExilusEverywhere": false,
"unlockArcanesEverywhere": false, "unlockArcanesEverywhere": false,
"noDailyStandingLimits": false, "noDailyStandingLimits": false,
"noVendorPurchaseLimits": false,
"instantResourceExtractorDrones": false, "instantResourceExtractorDrones": false,
"noDojoRoomBuildStage": false, "noDojoRoomBuildStage": false,
"fastDojoRoomDestruction": false, "fastDojoRoomDestruction": false,

View File

@ -55,6 +55,7 @@ interface IConfig {
unlockExilusEverywhere?: boolean; unlockExilusEverywhere?: boolean;
unlockArcanesEverywhere?: boolean; unlockArcanesEverywhere?: boolean;
noDailyStandingLimits?: boolean; noDailyStandingLimits?: boolean;
noVendorPurchaseLimits?: boolean;
instantResourceExtractorDrones?: boolean; instantResourceExtractorDrones?: boolean;
noDojoRoomBuildStage?: boolean; noDojoRoomBuildStage?: boolean;
fastDojoRoomDestruction?: boolean; fastDojoRoomDestruction?: boolean;

View File

@ -70,45 +70,46 @@ export const handlePurchase = async (
); );
} }
purchaseRequest.PurchaseParams.Quantity *= offer.QuantityMultiplier; purchaseRequest.PurchaseParams.Quantity *= offer.QuantityMultiplier;
if (!config.noVendorPurchaseLimits) {
inventory.RecentVendorPurchases ??= []; inventory.RecentVendorPurchases ??= [];
let vendorPurchases = inventory.RecentVendorPurchases.find( let vendorPurchases = inventory.RecentVendorPurchases.find(
x => x.VendorType == manifest.VendorInfo.TypeName x => x.VendorType == manifest.VendorInfo.TypeName
); );
if (!vendorPurchases) { if (!vendorPurchases) {
vendorPurchases = vendorPurchases =
inventory.RecentVendorPurchases[ inventory.RecentVendorPurchases[
inventory.RecentVendorPurchases.push({ inventory.RecentVendorPurchases.push({
VendorType: manifest.VendorInfo.TypeName, VendorType: manifest.VendorInfo.TypeName,
PurchaseHistory: [] PurchaseHistory: []
}) - 1 }) - 1
]; ];
}
const expiry = new Date(offer.RotatedWeekly ? Date.now() + 7 * 24 * 3600 * 1000 : 2051240400000);
const historyEntry = vendorPurchases.PurchaseHistory.find(x => x.ItemId == ItemId);
let numPurchased = purchaseRequest.PurchaseParams.Quantity;
if (historyEntry) {
numPurchased += historyEntry.NumPurchased;
historyEntry.NumPurchased += purchaseRequest.PurchaseParams.Quantity;
} else {
vendorPurchases.PurchaseHistory.push({
ItemId: ItemId,
NumPurchased: purchaseRequest.PurchaseParams.Quantity,
Expiry: expiry
});
}
inventoryChanges.RecentVendorPurchases = [
{
VendorType: manifest.VendorInfo.TypeName,
PurchaseHistory: [
{
ItemId: ItemId,
NumPurchased: numPurchased,
Expiry: toMongoDate(expiry)
}
]
} }
]; const expiry = new Date(offer.RotatedWeekly ? Date.now() + 7 * 24 * 3600 * 1000 : 2051240400000);
const historyEntry = vendorPurchases.PurchaseHistory.find(x => x.ItemId == ItemId);
let numPurchased = purchaseRequest.PurchaseParams.Quantity;
if (historyEntry) {
numPurchased += historyEntry.NumPurchased;
historyEntry.NumPurchased += purchaseRequest.PurchaseParams.Quantity;
} else {
vendorPurchases.PurchaseHistory.push({
ItemId: ItemId,
NumPurchased: purchaseRequest.PurchaseParams.Quantity,
Expiry: expiry
});
}
inventoryChanges.RecentVendorPurchases = [
{
VendorType: manifest.VendorInfo.TypeName,
PurchaseHistory: [
{
ItemId: ItemId,
NumPurchased: numPurchased,
Expiry: toMongoDate(expiry)
}
]
}
];
}
} else if (!ExportVendors[purchaseRequest.PurchaseParams.SourceId!]) { } else if (!ExportVendors[purchaseRequest.PurchaseParams.SourceId!]) {
throw new Error(`unknown vendor: ${purchaseRequest.PurchaseParams.SourceId!}`); throw new Error(`unknown vendor: ${purchaseRequest.PurchaseParams.SourceId!}`);
} }

View File

@ -517,6 +517,10 @@
<input class="form-check-input" type="checkbox" id="noDailyStandingLimits" /> <input class="form-check-input" type="checkbox" id="noDailyStandingLimits" />
<label class="form-check-label" for="noDailyStandingLimits" data-loc="cheats_noDailyStandingLimits"></label> <label class="form-check-label" for="noDailyStandingLimits" data-loc="cheats_noDailyStandingLimits"></label>
</div> </div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="noVendorPurchaseLimits" />
<label class="form-check-label" for="noVendorPurchaseLimits" data-loc="cheats_noVendorPurchaseLimits"></label>
</div>
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" id="instantResourceExtractorDrones" /> <input class="form-check-input" type="checkbox" id="instantResourceExtractorDrones" />
<label class="form-check-label" for="instantResourceExtractorDrones" data-loc="cheats_instantResourceExtractorDrones"></label> <label class="form-check-label" for="instantResourceExtractorDrones" data-loc="cheats_instantResourceExtractorDrones"></label>

View File

@ -110,6 +110,7 @@ dict = {
cheats_unlockExilusEverywhere: `Exilus-Adapter überall`, cheats_unlockExilusEverywhere: `Exilus-Adapter überall`,
cheats_unlockArcanesEverywhere: `Arkana-Adapter überall`, cheats_unlockArcanesEverywhere: `Arkana-Adapter überall`,
cheats_noDailyStandingLimits: `Kein tägliches Ansehenslimit`, cheats_noDailyStandingLimits: `Kein tägliches Ansehenslimit`,
cheats_noVendorPurchaseLimits: `[UNTRANSLATED] No Vendor Purchase Limits`,
cheats_instantResourceExtractorDrones: `Sofortige Ressourcen-Extraktor-Drohnen`, cheats_instantResourceExtractorDrones: `Sofortige Ressourcen-Extraktor-Drohnen`,
cheats_noDojoRoomBuildStage: `Kein Dojo-Raum-Bauvorgang`, cheats_noDojoRoomBuildStage: `Kein Dojo-Raum-Bauvorgang`,
cheats_fastDojoRoomDestruction: `Schnelle Dojo-Raum-Zerstörung`, cheats_fastDojoRoomDestruction: `Schnelle Dojo-Raum-Zerstörung`,

View File

@ -109,6 +109,7 @@ dict = {
cheats_unlockExilusEverywhere: `Exilus Adapters Everywhere`, cheats_unlockExilusEverywhere: `Exilus Adapters Everywhere`,
cheats_unlockArcanesEverywhere: `Arcane Adapters Everywhere`, cheats_unlockArcanesEverywhere: `Arcane Adapters Everywhere`,
cheats_noDailyStandingLimits: `No Daily Standing Limits`, cheats_noDailyStandingLimits: `No Daily Standing Limits`,
cheats_noVendorPurchaseLimits: `No Vendor Purchase Limits`,
cheats_instantResourceExtractorDrones: `Instant Resource Extractor Drones`, cheats_instantResourceExtractorDrones: `Instant Resource Extractor Drones`,
cheats_noDojoRoomBuildStage: `No Dojo Room Build Stage`, cheats_noDojoRoomBuildStage: `No Dojo Room Build Stage`,
cheats_fastDojoRoomDestruction: `Fast Dojo Room Destruction`, cheats_fastDojoRoomDestruction: `Fast Dojo Room Destruction`,

View File

@ -110,6 +110,7 @@ dict = {
cheats_unlockExilusEverywhere: `Adaptateurs Exilus partout`, cheats_unlockExilusEverywhere: `Adaptateurs Exilus partout`,
cheats_unlockArcanesEverywhere: `Adaptateur d'Arcanes partout`, cheats_unlockArcanesEverywhere: `Adaptateur d'Arcanes partout`,
cheats_noDailyStandingLimits: `Pas de limite de réputation journalière`, cheats_noDailyStandingLimits: `Pas de limite de réputation journalière`,
cheats_noVendorPurchaseLimits: `[UNTRANSLATED] No Vendor Purchase Limits`,
cheats_instantResourceExtractorDrones: `Ressources de drone d'extraction instantannées`, cheats_instantResourceExtractorDrones: `Ressources de drone d'extraction instantannées`,
cheats_noDojoRoomBuildStage: `No Dojo Room Build Stage`, cheats_noDojoRoomBuildStage: `No Dojo Room Build Stage`,
cheats_fastDojoRoomDestruction: `[UNTRANSLATED] Fast Dojo Room Destruction`, cheats_fastDojoRoomDestruction: `[UNTRANSLATED] Fast Dojo Room Destruction`,

View File

@ -110,6 +110,7 @@ dict = {
cheats_unlockExilusEverywhere: `Адаптеры Эксилус везде`, cheats_unlockExilusEverywhere: `Адаптеры Эксилус везде`,
cheats_unlockArcanesEverywhere: `Адаптеры для мистификаторов везде`, cheats_unlockArcanesEverywhere: `Адаптеры для мистификаторов везде`,
cheats_noDailyStandingLimits: `Без ежедневных ограничений репутации`, cheats_noDailyStandingLimits: `Без ежедневных ограничений репутации`,
cheats_noVendorPurchaseLimits: `[UNTRANSLATED] No Vendor Purchase Limits`,
cheats_instantResourceExtractorDrones: `Мгновенные Экстракторы Ресурсов`, cheats_instantResourceExtractorDrones: `Мгновенные Экстракторы Ресурсов`,
cheats_noDojoRoomBuildStage: `Мгновенное Строительтво Комнат Додзё`, cheats_noDojoRoomBuildStage: `Мгновенное Строительтво Комнат Додзё`,
cheats_fastDojoRoomDestruction: `Мгновенные Уничтожение Комнат Додзё`, cheats_fastDojoRoomDestruction: `Мгновенные Уничтожение Комнат Додзё`,