cheat: crackRelicForPlatinum
This commit is contained in:
parent
0796917740
commit
92c59bcc3a
@ -9,6 +9,7 @@ import { addMiscItems, combineInventoryChanges } from "../services/inventoryServ
|
||||
import { handleStoreItemAcquisition } from "../services/purchaseService.ts";
|
||||
import type { IInventoryChanges } from "../types/purchaseTypes.ts";
|
||||
import { config } from "../services/configService.ts";
|
||||
import { log } from "winston";
|
||||
|
||||
export const crackRelic = async (
|
||||
inventory: TInventoryDatabaseDocument,
|
||||
@ -46,6 +47,26 @@ export const crackRelic = async (
|
||||
inventoryChanges,
|
||||
(await handleStoreItemAcquisition(reward.type, inventory, reward.itemCount)).InventoryChanges
|
||||
);
|
||||
|
||||
if (inventory.crackRelicForPlatinum) {
|
||||
let platinumReward = 0;
|
||||
switch (reward.rarity) {
|
||||
case "COMMON":
|
||||
platinumReward = inventory.relicPlatinumCommon ?? 2;
|
||||
break;
|
||||
case "UNCOMMON":
|
||||
platinumReward = inventory.relicPlatinumUncommon ?? 5;
|
||||
break;
|
||||
case "RARE":
|
||||
platinumReward = inventory.relicPlatinumRare ?? 12;
|
||||
break;
|
||||
case "LEGENDARY":
|
||||
logger.warn(`got a legendary reward for a relic!`);
|
||||
break;
|
||||
}
|
||||
logger.debug(`adding ${platinumReward} platinum to inventory for a ${reward.rarity} reward`);
|
||||
inventory.PremiumCredits += platinumReward;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove relic
|
||||
|
||||
@ -1469,6 +1469,10 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
||||
nemesisHintProgressMultiplierCorpus: Number,
|
||||
nemesisExtraWeapon: Number,
|
||||
extraRelicRewards: Number,
|
||||
crackRelicForPlatinum: Boolean,
|
||||
relicPlatinumCommon: Number,
|
||||
relicPlatinumUncommon: Number,
|
||||
relicPlatinumRare: Number,
|
||||
|
||||
SubscribedToEmails: { type: Number, default: 0 },
|
||||
SubscribedToEmailsPersonalized: { type: Number, default: 0 },
|
||||
|
||||
@ -62,6 +62,10 @@ export interface IAccountCheats {
|
||||
nemesisHintProgressMultiplierCorpus?: number;
|
||||
nemesisExtraWeapon?: number;
|
||||
extraRelicRewards?: number;
|
||||
crackRelicForPlatinum?: boolean;
|
||||
relicPlatinumCommon?: number;
|
||||
relicPlatinumUncommon?: number;
|
||||
relicPlatinumRare?: number;
|
||||
}
|
||||
|
||||
export interface IInventoryDatabase
|
||||
|
||||
@ -1064,6 +1064,31 @@
|
||||
<button class="btn btn-secondary" type="button" data-loc="cheats_save"></button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="crackRelicForPlatinum" />
|
||||
<label class="form-check-label" for="crackRelicForPlatinum" data-loc="cheats_crackRelicForPlatinum"></label>
|
||||
</div>
|
||||
<form class="form-group mt-2">
|
||||
<label class="form-label" for="relicPlatinumCommon" data-loc="cheats_relicPlatinumCommon"></label>
|
||||
<div class="input-group">
|
||||
<input class="form-control" id="relicPlatinumCommon" type="number" min="0" max="65535" data-default="2" />
|
||||
<button class="btn btn-secondary" type="button" data-loc="cheats_save"></button>
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-group mt-2">
|
||||
<label class="form-label" for="relicPlatinumUncommon" data-loc="cheats_relicPlatinumUncommon"></label>
|
||||
<div class="input-group">
|
||||
<input class="form-control" id="relicPlatinumUncommon" type="number" min="0" max="65535" data-default="5" />
|
||||
<button class="btn btn-secondary" type="button" data-loc="cheats_save"></button>
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-group mt-2">
|
||||
<label class="form-label" for="relicPlatinumRare" data-loc="cheats_relicPlatinumRare"></label>
|
||||
<div class="input-group">
|
||||
<input class="form-control" id="relicPlatinumRare" type="number" min="0" max="65535" data-default="12" />
|
||||
<button class="btn btn-secondary" type="button" data-loc="cheats_save"></button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="mt-2 mb-2 d-flex flex-wrap gap-2">
|
||||
<button class="btn btn-primary" onclick="debounce(doUnlockAllShipFeatures);" data-loc="cheats_unlockAllShipFeatures"></button>
|
||||
<button class="btn btn-primary" onclick="debounce(unlockAllMissions);" data-loc="cheats_unlockAllMissions"></button>
|
||||
|
||||
@ -263,6 +263,10 @@ dict = {
|
||||
cheats_nemesisHintProgressMultiplierCorpus: `Hint Progress Multiplier (Corpus)`,
|
||||
cheats_nemesisExtraWeapon: `Extra Nemesis Weapon / Token On Vanquish (0 to disable)`,
|
||||
cheats_extraRelicRewards: `Extra Relic Rewards`,
|
||||
cheats_crackRelicForPlatinum: `Crack Relic for Platinum`,
|
||||
cheats_relicPlatinumCommon: `Platinum on Common Rewards`,
|
||||
cheats_relicPlatinumUncommon: `Platinum on Uncommon Rewards`,
|
||||
cheats_relicPlatinumRare: `Platinum on Rare Rewards`,
|
||||
|
||||
worldState: `World State`,
|
||||
worldState_creditBoost: `Credit Boost`,
|
||||
|
||||
@ -264,6 +264,10 @@ dict = {
|
||||
cheats_nemesisHintProgressMultiplierCorpus: `解密进度倍率 (Corpus)`,
|
||||
cheats_nemesisExtraWeapon: `额外玄骸武器/代币 (0为禁用)`,
|
||||
cheats_extraRelicRewards: `额外遗物奖励`,
|
||||
cheats_crackRelicForPlatinum: `打开遗物时获得白金`,
|
||||
cheats_relicPlatinumCommon: `普通奖励的白金`,
|
||||
cheats_relicPlatinumUncommon: `罕见奖励的白金`,
|
||||
cheats_relicPlatinumRare: `稀有奖励的白金`,
|
||||
|
||||
worldState: `世界状态配置`,
|
||||
worldState_creditBoost: `现金加成`,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user