From 2dde092baf53da3e4b6308bfdf937755f70bdcde Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sat, 24 Dec 2022 22:00:18 -0600 Subject: [PATCH] Fix elves resetting things when they shouldn't --- src/data/layers/elves.tsx | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index 38ef179..fd3330d 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -49,6 +49,21 @@ export interface ElfBuyable extends GenericBuyable { const id = "elves"; const day = 4; +const elvesThatReset = [ + "Holly", + "Ivy", + "Hope", + "Jack", + "Mary", + "Noel", + "Joy", + "Faith", + "Snowball", + "Star", + "Bell", + "Gingersnap" +]; + const layer = createLayer(id, function (this: BaseLayer) { const name = "Elves"; const colorBright = "red"; @@ -730,16 +745,13 @@ const layer = createLayer(id, function (this: BaseLayer) { description: jsx(() => ( <> {options.description} - {upgrade.bought.value || - ["Peppermint", "Twinkle", "Cocoa", "Frosty"].includes( - options.name - ) ? null : ( + {upgrade.bought.value || elvesThatReset.includes(options.name) ? ( <> {" "} Training this elf will require resetting all your progress from days 1-3. - )} + ) : null} {upgrade.bought.value && options.hasToggle === true ? ( <> showIf(packing.upgrades.packingElf.bought.value), buyMax: true, onAutoPurchase(buyable, amount) { - if (buyable === packing.helpers.loader && !management.elfTraining.packingElfTraining.milestones[3].earned.value) { + if ( + buyable === packing.helpers.loader && + !management.elfTraining.packingElfTraining.milestones[3].earned.value + ) { buyable.amount.value = Decimal.sub(buyable.amount.value, amount); } }