From 3d64b039058cdf216b25e46f4a80e5da44f250b8 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Thu, 22 Dec 2022 21:53:51 -0600 Subject: [PATCH] Add each reindeer's modifier --- src/data/layers/boxes.tsx | 2 ++ src/data/layers/cloth.tsx | 10 +++++++--- src/data/layers/coal.tsx | 2 ++ src/data/layers/dyes.tsx | 2 ++ src/data/layers/metal.tsx | 2 ++ src/data/layers/oil.tsx | 4 +++- src/data/layers/paper.tsx | 4 +++- src/data/layers/plastic.tsx | 4 +++- src/data/layers/reindeer.tsx | 20 +++++++++++++++----- src/data/layers/trees.tsx | 2 ++ 10 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/data/layers/boxes.tsx b/src/data/layers/boxes.tsx index 98b8b8b..2d534fb 100644 --- a/src/data/layers/boxes.tsx +++ b/src/data/layers/boxes.tsx @@ -31,6 +31,7 @@ import elves, { ElfBuyable } from "./elves"; import management from "./management"; import paper from "./paper"; import plastic from "./plastic"; +import reindeer from "./reindeer"; import trees from "./trees"; import workshop from "./workshop"; import wrappingPaper from "./wrapping-paper"; @@ -55,6 +56,7 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "1000% Foundation Completed", enabled: workshop.milestones.extraExpansionMilestone5.earned })), + reindeer.reindeer.vixen.modifier, createExponentialModifier(() => ({ exponent: 1.1, description: "Bell Level 2", diff --git a/src/data/layers/cloth.tsx b/src/data/layers/cloth.tsx index 8f4f227..1c3d0a7 100644 --- a/src/data/layers/cloth.tsx +++ b/src/data/layers/cloth.tsx @@ -36,6 +36,7 @@ import management from "./management"; import metal from "./metal"; import paper from "./paper"; import plastic from "./plastic"; +import reindeer from "./reindeer"; import trees from "./trees"; import workshop from "./workshop"; @@ -449,7 +450,8 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: dyes.boosts.yellow2, description: "Yellow Dye", enabled: dyes.masteryEffectActive - })) + })), + reindeer.reindeer.cupid.modifier ]); const computedSheepGain = computed(() => sheepGain.apply(1)); const breedingCooldown = createSequentialModifier(() => []); @@ -494,7 +496,8 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: dyes.boosts.yellow2, description: "Yellow Dye", enabled: dyes.masteryEffectActive - })) + })), + reindeer.reindeer.cupid.modifier ]); const computedShearingAmount = computed(() => shearingAmount.apply(1)); const shearingCooldown = createSequentialModifier(() => []); @@ -539,7 +542,8 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: dyes.boosts.yellow2, description: "Yellow Dye", enabled: dyes.masteryEffectActive - })) + })), + reindeer.reindeer.cupid.modifier ]); const computedSpinningAmount = computed(() => spinningAmount.apply(1)); const spinningCooldown = createSequentialModifier(() => []); diff --git a/src/data/layers/coal.tsx b/src/data/layers/coal.tsx index 8aa20f3..17e6659 100644 --- a/src/data/layers/coal.tsx +++ b/src/data/layers/coal.tsx @@ -40,6 +40,7 @@ import metal from "./metal"; import oil from "./oil"; import paper from "./paper"; import plastic from "./plastic"; +import reindeer from "./reindeer"; import trees from "./trees"; import wrappingPaper from "./wrapping-paper"; @@ -785,6 +786,7 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Refined Coal", enabled: refinedCoal.bought })), + reindeer.reindeer.dancer.modifier, createExponentialModifier(() => ({ exponent: 1.05, description: "Jack Level 2", diff --git a/src/data/layers/dyes.tsx b/src/data/layers/dyes.tsx index 6d94dff..da71c0b 100644 --- a/src/data/layers/dyes.tsx +++ b/src/data/layers/dyes.tsx @@ -36,6 +36,7 @@ import oil from "./oil"; import paper from "./paper"; import trees from "./trees"; import toys from "./toys"; +import reindeer from "./reindeer"; interface Dye { name: string; @@ -200,6 +201,7 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: boxes.row3Upgrades.dyeUpgrade.bought })) ); + modifiers.push(reindeer.reindeer.rudolph.modifier); return modifiers; }) as WithRequired; const computedToGenerate = computed(() => toGenerate.apply(0)); diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index 7251725..c6d338f 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -37,6 +37,7 @@ import plastic from "./plastic"; import workshop from "./workshop"; import wrappingPaper from "./wrapping-paper"; import toys from "./toys"; +import reindeer from "./reindeer"; const id = "metal"; const day = 7; @@ -105,6 +106,7 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Twinkle Level 1", enabled: management.elfTraining.metalElfTraining.milestones[0].earned })), + reindeer.reindeer.comet.modifier, createExponentialModifier(() => ({ exponent: 1.1, description: "Mary Level 2", diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index a047ba9..5611dca 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -41,6 +41,7 @@ import workshop from "./workshop"; import { WithRequired } from "util/common"; import { ElfBuyable } from "./elves"; import toys from "./toys"; +import reindeer from "./reindeer"; const id = "oil"; const day = 9; @@ -957,7 +958,8 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: 50, description: "350 toys", enabled: toys.milestones.milestone4.earned - })) + })), + reindeer.reindeer.donner.modifier ]) as WithRequired; const computedOilSpeed = computed(() => oilSpeed.apply(0)); diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 1b817a2..d96b654 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -27,6 +27,7 @@ import dyes from "./dyes"; import elves, { ElfBuyable } from "./elves"; import management from "./management"; import plastic from "./plastic"; +import reindeer from "./reindeer"; import ribbon from "./ribbon"; import trees from "./trees"; import workshop from "./workshop"; @@ -423,7 +424,8 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: wrappingPaper.boosts.sunshine1, description: "Sunshine Wrapping Paper", enabled: () => Decimal.gte(wrappingPaper.boosts.sunshine1.value, 2) - })) + })), + reindeer.reindeer.prancer.modifier ]) as WithRequired; const ashCost = createSequentialModifier(() => [ createMultiplicativeModifier(() => ({ diff --git a/src/data/layers/plastic.tsx b/src/data/layers/plastic.tsx index b79c0b7..be9a09e 100644 --- a/src/data/layers/plastic.tsx +++ b/src/data/layers/plastic.tsx @@ -37,6 +37,7 @@ import oil from "./oil"; import paper from "./paper"; import workshop from "./workshop"; import toys from "./toys"; +import reindeer from "./reindeer"; const id = "plastic"; const day = 10; @@ -379,7 +380,8 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: 50, description: "350 toys", enabled: toys.milestones.milestone4.earned - })) + })), + reindeer.reindeer.blitzen.modifier ]); const computedPlasticGain = computed(() => plasticGain.apply(0)); diff --git a/src/data/layers/reindeer.tsx b/src/data/layers/reindeer.tsx index 75ce093..7324b66 100644 --- a/src/data/layers/reindeer.tsx +++ b/src/data/layers/reindeer.tsx @@ -5,16 +5,15 @@ import HotkeyVue from "components/Hotkey.vue"; import Spacer from "components/layout/Spacer.vue"; import Modal from "components/Modal.vue"; -import { createCollapsibleModifierSections, setUpDailyProgressTracker } from "data/common"; +import { createCollapsibleModifierSections } from "data/common"; import { main } from "data/projEntry"; import { createBar, GenericBar } from "features/bars/bar"; import { createClickable } from "features/clickables/clickable"; import { jsx } from "features/feature"; import { createHotkey, GenericHotkey } from "features/hotkey"; -import MainDisplay from "features/resources/MainDisplay.vue"; -import { createResource, Resource } from "features/resources/resource"; import { globalBus } from "game/events"; import { BaseLayer, createLayer } from "game/layers"; +import { createMultiplicativeModifier } from "game/modifiers"; import { persistent } from "game/persistence"; import Decimal, { DecimalSource, format, formatWhole } from "util/bignum"; import { Direction } from "util/common"; @@ -61,11 +60,23 @@ const layer = createLayer(id, function (this: BaseLayer) { progress: () => Decimal.div(progress.value, computedCooldown.value) })); + const modifier = createMultiplicativeModifier(() => ({ + multiplier: effect, + description: options.name, + enabled: () => Decimal.gt(timesFed.value, 0) + })); + + const effect = computed(() => + Decimal.times(options.boostAmount, timesFed.value).add(1) + ); + return { ...options, hotkey, timesFed, progress, + effect, + modifier, display: { title: jsx(() => (

@@ -78,7 +89,7 @@ const layer = createLayer(id, function (this: BaseLayer) { Each time you feed {options.name} will increase your{" "} {options.boostDescription} by +{format(options.boostAmount)}x - Currently {format(Decimal.pow(options.boostAmount, timesFed.value))}x + Currently {format(effect.value)}x
{render(progressBar)} @@ -100,7 +111,6 @@ const layer = createLayer(id, function (this: BaseLayer) { progress.value = 0; }, update(diff: number) { - console.log(progress.value, computedCooldown.value, diff); if (Decimal.gte(progress.value, computedCooldown.value)) { progress.value = computedCooldown.value; } else { diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index 51a799a..99c10b2 100644 --- a/src/data/layers/trees.tsx +++ b/src/data/layers/trees.tsx @@ -39,6 +39,7 @@ import paper from "./paper"; import workshop from "./workshop"; import wrappingPaper from "./wrapping-paper"; import toys from "./toys"; +import reindeer from "./reindeer"; const id = "trees"; const day = 1; @@ -551,6 +552,7 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "3000 Toys", enabled: toys.milestones.milestone7.earned })), + reindeer.reindeer.dasher.modifier, createExponentialModifier(() => ({ exponent: 1.2, description: "100% Foundation Completed",