forked from OpenWF/SpaceNinjaServer
feat: dontSubtractVendor{Credit,Platinum,Item,Standing}Cost cheats (#2209)
Closes #1586 Reviewed-on: OpenWF/SpaceNinjaServer#2209 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
parent
05382beaaf
commit
88d4ba6340
@ -20,6 +20,10 @@
|
||||
"infiniteRegalAya": false,
|
||||
"infiniteHelminthMaterials": false,
|
||||
"claimingBlueprintRefundsIngredients": false,
|
||||
"dontSubtractPurchaseCreditCost": false,
|
||||
"dontSubtractPurchasePlatinumCost": false,
|
||||
"dontSubtractPurchaseItemCost": false,
|
||||
"dontSubtractPurchaseStandingCost": false,
|
||||
"dontSubtractVoidTraces": false,
|
||||
"dontSubtractConsumables": false,
|
||||
"unlockAllShipFeatures": false,
|
||||
|
@ -25,6 +25,10 @@ export interface IConfig {
|
||||
infiniteRegalAya?: boolean;
|
||||
infiniteHelminthMaterials?: boolean;
|
||||
claimingBlueprintRefundsIngredients?: boolean;
|
||||
dontSubtractPurchaseCreditCost?: boolean;
|
||||
dontSubtractPurchasePlatinumCost?: boolean;
|
||||
dontSubtractPurchaseItemCost?: boolean;
|
||||
dontSubtractPurchaseStandingCost?: boolean;
|
||||
dontSubtractVoidTraces?: boolean;
|
||||
dontSubtractConsumables?: boolean;
|
||||
unlockAllShipFeatures?: boolean;
|
||||
|
@ -67,25 +67,31 @@ export const handlePurchase = async (
|
||||
if (!offer) {
|
||||
throw new Error(`unknown vendor offer: ${ItemId ? ItemId : purchaseRequest.PurchaseParams.StoreItem}`);
|
||||
}
|
||||
if (offer.RegularPrice) {
|
||||
combineInventoryChanges(
|
||||
prePurchaseInventoryChanges,
|
||||
updateCurrency(inventory, offer.RegularPrice[0], false)
|
||||
);
|
||||
if (!config.dontSubtractPurchaseCreditCost) {
|
||||
if (offer.RegularPrice) {
|
||||
combineInventoryChanges(
|
||||
prePurchaseInventoryChanges,
|
||||
updateCurrency(inventory, offer.RegularPrice[0], false)
|
||||
);
|
||||
}
|
||||
}
|
||||
if (offer.PremiumPrice) {
|
||||
combineInventoryChanges(
|
||||
prePurchaseInventoryChanges,
|
||||
updateCurrency(inventory, offer.PremiumPrice[0], true)
|
||||
);
|
||||
if (!config.dontSubtractPurchasePlatinumCost) {
|
||||
if (offer.PremiumPrice) {
|
||||
combineInventoryChanges(
|
||||
prePurchaseInventoryChanges,
|
||||
updateCurrency(inventory, offer.PremiumPrice[0], true)
|
||||
);
|
||||
}
|
||||
}
|
||||
if (offer.ItemPrices) {
|
||||
handleItemPrices(
|
||||
inventory,
|
||||
offer.ItemPrices,
|
||||
purchaseRequest.PurchaseParams.Quantity,
|
||||
prePurchaseInventoryChanges
|
||||
);
|
||||
if (!config.dontSubtractPurchaseItemCost) {
|
||||
if (offer.ItemPrices) {
|
||||
handleItemPrices(
|
||||
inventory,
|
||||
offer.ItemPrices,
|
||||
purchaseRequest.PurchaseParams.Quantity,
|
||||
prePurchaseInventoryChanges
|
||||
);
|
||||
}
|
||||
}
|
||||
if (offer.LocTagRandSeed !== undefined) {
|
||||
seed = BigInt(offer.LocTagRandSeed);
|
||||
@ -179,21 +185,25 @@ export const handlePurchase = async (
|
||||
x => x.ItemType == purchaseRequest.PurchaseParams.StoreItem
|
||||
);
|
||||
if (offer) {
|
||||
combineInventoryChanges(
|
||||
purchaseResponse.InventoryChanges,
|
||||
updateCurrency(inventory, offer.RegularPrice, false)
|
||||
);
|
||||
if (!config.dontSubtractPurchaseCreditCost) {
|
||||
combineInventoryChanges(
|
||||
purchaseResponse.InventoryChanges,
|
||||
updateCurrency(inventory, offer.RegularPrice, false)
|
||||
);
|
||||
}
|
||||
if (purchaseRequest.PurchaseParams.ExpectedPrice) {
|
||||
throw new Error(`vendor purchase should not have an expected price`);
|
||||
}
|
||||
|
||||
const invItem: IMiscItem = {
|
||||
ItemType: "/Lotus/Types/Items/MiscItems/PrimeBucks",
|
||||
ItemCount: offer.PrimePrice * purchaseRequest.PurchaseParams.Quantity * -1
|
||||
};
|
||||
addMiscItems(inventory, [invItem]);
|
||||
purchaseResponse.InventoryChanges.MiscItems ??= [];
|
||||
purchaseResponse.InventoryChanges.MiscItems.push(invItem);
|
||||
if (!config.dontSubtractPurchaseItemCost) {
|
||||
const invItem: IMiscItem = {
|
||||
ItemType: "/Lotus/Types/Items/MiscItems/PrimeBucks",
|
||||
ItemCount: offer.PrimePrice * purchaseRequest.PurchaseParams.Quantity * -1
|
||||
};
|
||||
addMiscItems(inventory, [invItem]);
|
||||
purchaseResponse.InventoryChanges.MiscItems ??= [];
|
||||
purchaseResponse.InventoryChanges.MiscItems.push(invItem);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -211,7 +221,7 @@ export const handlePurchase = async (
|
||||
Title: lastTitle
|
||||
}
|
||||
];
|
||||
} else {
|
||||
} else if (!config.dontSubtractPurchaseStandingCost) {
|
||||
const syndicate = ExportSyndicates[syndicateTag];
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
if (syndicate) {
|
||||
@ -239,19 +249,19 @@ export const handlePurchase = async (
|
||||
const vendor = ExportVendors[purchaseRequest.PurchaseParams.SourceId!];
|
||||
const offer = vendor.items.find(x => x.storeItem == purchaseRequest.PurchaseParams.StoreItem);
|
||||
if (offer) {
|
||||
if (typeof offer.credits == "number") {
|
||||
if (typeof offer.credits == "number" && !config.dontSubtractPurchaseCreditCost) {
|
||||
combineInventoryChanges(
|
||||
purchaseResponse.InventoryChanges,
|
||||
updateCurrency(inventory, offer.credits, false)
|
||||
);
|
||||
}
|
||||
if (typeof offer.platinum == "number") {
|
||||
if (typeof offer.platinum == "number" && !config.dontSubtractPurchasePlatinumCost) {
|
||||
combineInventoryChanges(
|
||||
purchaseResponse.InventoryChanges,
|
||||
updateCurrency(inventory, offer.platinum, true)
|
||||
);
|
||||
}
|
||||
if (offer.itemPrices) {
|
||||
if (offer.itemPrices && !config.dontSubtractPurchaseItemCost) {
|
||||
handleItemPrices(
|
||||
inventory,
|
||||
offer.itemPrices,
|
||||
@ -278,15 +288,17 @@ export const handlePurchase = async (
|
||||
);
|
||||
if (offer) {
|
||||
if (offer.RegularPrice) {
|
||||
const invItem: IMiscItem = {
|
||||
ItemType: "/Lotus/Types/Items/MiscItems/SchismKey",
|
||||
ItemCount: offer.RegularPrice * purchaseRequest.PurchaseParams.Quantity * -1
|
||||
};
|
||||
if (!config.dontSubtractPurchaseItemCost) {
|
||||
const invItem: IMiscItem = {
|
||||
ItemType: "/Lotus/Types/Items/MiscItems/SchismKey",
|
||||
ItemCount: offer.RegularPrice * purchaseRequest.PurchaseParams.Quantity * -1
|
||||
};
|
||||
|
||||
addMiscItems(inventory, [invItem]);
|
||||
addMiscItems(inventory, [invItem]);
|
||||
|
||||
purchaseResponse.InventoryChanges.MiscItems ??= [];
|
||||
purchaseResponse.InventoryChanges.MiscItems.push(invItem);
|
||||
purchaseResponse.InventoryChanges.MiscItems ??= [];
|
||||
purchaseResponse.InventoryChanges.MiscItems.push(invItem);
|
||||
}
|
||||
} else if (!config.infiniteRegalAya) {
|
||||
inventory.PrimeTokens -= offer.PrimePrice! * purchaseRequest.PurchaseParams.Quantity;
|
||||
|
||||
|
@ -604,13 +604,29 @@
|
||||
<input class="form-check-input" type="checkbox" id="infiniteRegalAya" />
|
||||
<label class="form-check-label" for="infiniteRegalAya" data-loc="cheats_infiniteRegalAya"></label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="infiniteHelminthMaterials" />
|
||||
<label class="form-check-label" for="infiniteHelminthMaterials" data-loc="cheats_infiniteHelminthMaterials"></label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="claimingBlueprintRefundsIngredients" />
|
||||
<label class="form-check-label" for="claimingBlueprintRefundsIngredients" data-loc="cheats_claimingBlueprintRefundsIngredients"></label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="infiniteHelminthMaterials" />
|
||||
<label class="form-check-label" for="infiniteHelminthMaterials" data-loc="cheats_infiniteHelminthMaterials"></label>
|
||||
<input class="form-check-input" type="checkbox" id="dontSubtractPurchaseCreditCost" />
|
||||
<label class="form-check-label" for="dontSubtractPurchaseCreditCost" data-loc="cheats_dontSubtractPurchaseCreditCost"></label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="dontSubtractPurchasePlatinumCost" />
|
||||
<label class="form-check-label" for="dontSubtractPurchasePlatinumCost" data-loc="cheats_dontSubtractPurchasePlatinumCost"></label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="dontSubtractPurchaseItemCost" />
|
||||
<label class="form-check-label" for="dontSubtractPurchaseItemCost" data-loc="cheats_dontSubtractPurchaseItemCost"></label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="dontSubtractPurchaseStandingCost" />
|
||||
<label class="form-check-label" for="dontSubtractPurchaseStandingCost" data-loc="cheats_dontSubtractPurchaseStandingCost"></label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="dontSubtractVoidTraces" />
|
||||
|
@ -135,11 +135,15 @@ dict = {
|
||||
cheats_infiniteRegalAya: `Unendlich Reines Aya`,
|
||||
cheats_infiniteHelminthMaterials: `Unendlich Helminth-Materialien`,
|
||||
cheats_claimingBlueprintRefundsIngredients: `Fertige Blaupausen erstatten Ressourcen zurück`,
|
||||
cheats_dontSubtractPurchaseCreditCost: `[UNTRANSLATED] Don't Subtract Purchase Credit Cost`,
|
||||
cheats_dontSubtractPurchasePlatinumCost: `[UNTRANSLATED] Don't Subtract Purchase Platinum Cost`,
|
||||
cheats_dontSubtractPurchaseItemCost: `[UNTRANSLATED] Don't Subtract Purchase Item Cost`,
|
||||
cheats_dontSubtractPurchaseStandingCost: `[UNTRANSLATED] Don't Subtract Purchase Standing Cost`,
|
||||
cheats_dontSubtractVoidTraces: `Void-Spuren nicht verbrauchen`,
|
||||
cheats_dontSubtractConsumables: `Verbrauchsgegenstände (Ausrüstung) nicht verbrauchen`,
|
||||
cheats_unlockAllShipFeatures: `Alle Schiffs-Funktionen freischalten`,
|
||||
cheats_unlockAllShipDecorations: `Alle Schiffsdekorationen freischalten`,
|
||||
cheats_unlockAllFlavourItems: `Alle <abbr title=\"Animationssets, Glyphen, Farbpaletten usw.\">Sammlerstücke</abbr> freischalten`,
|
||||
cheats_unlockAllFlavourItems: `Alle <abbr title="Animationssets, Glyphen, Farbpaletten usw.">Sammlerstücke</abbr> freischalten`,
|
||||
cheats_unlockAllSkins: `Alle Skins freischalten`,
|
||||
cheats_unlockAllCapturaScenes: `Alle Photora-Szenen freischalten`,
|
||||
cheats_unlockAllDecoRecipes: `Alle Dojo-Deko-Baupläne freischalten`,
|
||||
|
@ -134,11 +134,15 @@ dict = {
|
||||
cheats_infiniteRegalAya: `Infinite Regal Aya`,
|
||||
cheats_infiniteHelminthMaterials: `Infinite Helminth Materials`,
|
||||
cheats_claimingBlueprintRefundsIngredients: `Claiming Blueprint Refunds Ingredients`,
|
||||
cheats_dontSubtractPurchaseCreditCost: `Don't Subtract Purchase Credit Cost`,
|
||||
cheats_dontSubtractPurchasePlatinumCost: `Don't Subtract Purchase Platinum Cost`,
|
||||
cheats_dontSubtractPurchaseItemCost: `Don't Subtract Purchase Item Cost`,
|
||||
cheats_dontSubtractPurchaseStandingCost: `Don't Subtract Purchase Standing Cost`,
|
||||
cheats_dontSubtractVoidTraces: `Don't Subtract Void Traces`,
|
||||
cheats_dontSubtractConsumables: `Don't Subtract Consumables`,
|
||||
cheats_unlockAllShipFeatures: `Unlock All Ship Features`,
|
||||
cheats_unlockAllShipDecorations: `Unlock All Ship Decorations`,
|
||||
cheats_unlockAllFlavourItems: `Unlock All <abbr title=\"Animation Sets, Glyphs, Palettes, etc.\">Flavor Items</abbr>`,
|
||||
cheats_unlockAllFlavourItems: `Unlock All <abbr title="Animation Sets, Glyphs, Palettes, etc.">Flavor Items</abbr>`,
|
||||
cheats_unlockAllSkins: `Unlock All Skins`,
|
||||
cheats_unlockAllCapturaScenes: `Unlock All Captura Scenes`,
|
||||
cheats_unlockAllDecoRecipes: `Unlock All Dojo Deco Recipes`,
|
||||
|
@ -135,6 +135,10 @@ dict = {
|
||||
cheats_infiniteRegalAya: `Aya Real infinita`,
|
||||
cheats_infiniteHelminthMaterials: `Materiales Helminto infinitos`,
|
||||
cheats_claimingBlueprintRefundsIngredients: `Reclamar ingredientes devueltos por planos`,
|
||||
cheats_dontSubtractPurchaseCreditCost: `[UNTRANSLATED] Don't Subtract Purchase Credit Cost`,
|
||||
cheats_dontSubtractPurchasePlatinumCost: `[UNTRANSLATED] Don't Subtract Purchase Platinum Cost`,
|
||||
cheats_dontSubtractPurchaseItemCost: `[UNTRANSLATED] Don't Subtract Purchase Item Cost`,
|
||||
cheats_dontSubtractPurchaseStandingCost: `[UNTRANSLATED] Don't Subtract Purchase Standing Cost`,
|
||||
cheats_dontSubtractVoidTraces: `No descontar vestigios del Vacío`,
|
||||
cheats_dontSubtractConsumables: `No restar consumibles`,
|
||||
cheats_unlockAllShipFeatures: `Desbloquear todas las funciones de nave`,
|
||||
|
@ -135,11 +135,15 @@ dict = {
|
||||
cheats_infiniteRegalAya: `Aya Raffiné infini`,
|
||||
cheats_infiniteHelminthMaterials: `Ressources d'Helminth infinies`,
|
||||
cheats_claimingBlueprintRefundsIngredients: `Récupérer les items rend les ressources`,
|
||||
cheats_dontSubtractPurchaseCreditCost: `[UNTRANSLATED] Don't Subtract Purchase Credit Cost`,
|
||||
cheats_dontSubtractPurchasePlatinumCost: `[UNTRANSLATED] Don't Subtract Purchase Platinum Cost`,
|
||||
cheats_dontSubtractPurchaseItemCost: `[UNTRANSLATED] Don't Subtract Purchase Item Cost`,
|
||||
cheats_dontSubtractPurchaseStandingCost: `[UNTRANSLATED] Don't Subtract Purchase Standing Cost`,
|
||||
cheats_dontSubtractVoidTraces: `Ne pas consommer de Void Traces`,
|
||||
cheats_dontSubtractConsumables: `Ne pas retirer de consommables`,
|
||||
cheats_unlockAllShipFeatures: `Débloquer tous les segments du vaisseau`,
|
||||
cheats_unlockAllShipDecorations: `Débloquer toutes les décorations du vaisseau`,
|
||||
cheats_unlockAllFlavourItems: `Débloquer tous les <abbr title=\"Animations, Glyphes, Palettes, etc.\">Flavor Items</abbr>`,
|
||||
cheats_unlockAllFlavourItems: `Débloquer tous les <abbr title="Animations, Glyphes, Palettes, etc.">Flavor Items</abbr>`,
|
||||
cheats_unlockAllSkins: `Débloquer tous les skins`,
|
||||
cheats_unlockAllCapturaScenes: `Débloquer toutes les scènes captura`,
|
||||
cheats_unlockAllDecoRecipes: `Débloquer toutes les recherches dojo`,
|
||||
|
@ -135,11 +135,15 @@ dict = {
|
||||
cheats_infiniteRegalAya: `Бесконечная Королевская Айя`,
|
||||
cheats_infiniteHelminthMaterials: `Бесконечные Выделения Гельминта`,
|
||||
cheats_claimingBlueprintRefundsIngredients: `[UNTRANSLATED] Claiming Blueprint Refunds Ingredients`,
|
||||
cheats_dontSubtractPurchaseCreditCost: `[UNTRANSLATED] Don't Subtract Purchase Credit Cost`,
|
||||
cheats_dontSubtractPurchasePlatinumCost: `[UNTRANSLATED] Don't Subtract Purchase Platinum Cost`,
|
||||
cheats_dontSubtractPurchaseItemCost: `[UNTRANSLATED] Don't Subtract Purchase Item Cost`,
|
||||
cheats_dontSubtractPurchaseStandingCost: `[UNTRANSLATED] Don't Subtract Purchase Standing Cost`,
|
||||
cheats_dontSubtractVoidTraces: `[UNTRANSLATED] Don't Subtract Void Traces`,
|
||||
cheats_dontSubtractConsumables: `Не уменьшать количество расходников`,
|
||||
cheats_unlockAllShipFeatures: `Разблокировать все функции корабля`,
|
||||
cheats_unlockAllShipDecorations: `Разблокировать все украшения корабля`,
|
||||
cheats_unlockAllFlavourItems: `Разблокировать все <abbr title=\"Наборы анимаций, глифы, палитры и т. д.\">уникальные предметы</abbr>`,
|
||||
cheats_unlockAllFlavourItems: `Разблокировать все <abbr title="Наборы анимаций, глифы, палитры и т. д.">уникальные предметы</abbr>`,
|
||||
cheats_unlockAllSkins: `Разблокировать все скины`,
|
||||
cheats_unlockAllCapturaScenes: `Разблокировать все сцены Каптуры`,
|
||||
cheats_unlockAllDecoRecipes: `Разблокировать все рецепты декораций Дoдзё`,
|
||||
|
@ -135,11 +135,15 @@ dict = {
|
||||
cheats_infiniteRegalAya: `无限御品阿耶`,
|
||||
cheats_infiniteHelminthMaterials: `无限Helminth材料`,
|
||||
cheats_claimingBlueprintRefundsIngredients: `取消蓝图制造时返还材料`,
|
||||
cheats_dontSubtractPurchaseCreditCost: `[UNTRANSLATED] Don't Subtract Purchase Credit Cost`,
|
||||
cheats_dontSubtractPurchasePlatinumCost: `[UNTRANSLATED] Don't Subtract Purchase Platinum Cost`,
|
||||
cheats_dontSubtractPurchaseItemCost: `[UNTRANSLATED] Don't Subtract Purchase Item Cost`,
|
||||
cheats_dontSubtractPurchaseStandingCost: `[UNTRANSLATED] Don't Subtract Purchase Standing Cost`,
|
||||
cheats_dontSubtractVoidTraces: `虚空光体无消耗`,
|
||||
cheats_dontSubtractConsumables: `消耗物品使用时无损耗`,
|
||||
cheats_unlockAllShipFeatures: `解锁所有飞船功能`,
|
||||
cheats_unlockAllShipDecorations: `解锁所有飞船装饰`,
|
||||
cheats_unlockAllFlavourItems: `解锁所有<abbr title=\"动画组合、图标、调色板等\">装饰物品</abbr>`,
|
||||
cheats_unlockAllFlavourItems: `解锁所有<abbr title="动画组合、图标、调色板等">装饰物品</abbr>`,
|
||||
cheats_unlockAllSkins: `解锁所有外观`,
|
||||
cheats_unlockAllCapturaScenes: `解锁所有Captura场景`,
|
||||
cheats_unlockAllDecoRecipes: `解锁所有道场配方`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user