diff --git a/src/data/layers/boxes.tsx b/src/data/layers/boxes.tsx index 86401b5..4fb0f35 100644 --- a/src/data/layers/boxes.tsx +++ b/src/data/layers/boxes.tsx @@ -166,7 +166,7 @@ const layer = createLayer(id, function (this: BaseLayer) { const row2Upgrades = { oreUpgrade, metalUpgrade, plasticUpgrade }; const clothUpgrade = createUpgrade(() => ({ resource: noPersist(boxes), - cost: 1e16, + cost: 1e28, visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[4].earned.value), display: { title: "Carry cloth in boxes", @@ -175,11 +175,11 @@ const layer = createLayer(id, function (this: BaseLayer) { })) as GenericUpgrade; const dyeUpgrade = createUpgrade(() => ({ resource: noPersist(boxes), - cost: 1e17, + cost: 1e29, visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[4].earned.value), display: { title: "Carry dye in boxes", - description: "Double all dye gain" + description: "Double all dye gain but reset all dyes" }, onPurchase() { (["red", "yellow", "blue", "orange", "green", "purple"] as const).forEach(dyeColor => { @@ -190,7 +190,7 @@ const layer = createLayer(id, function (this: BaseLayer) { })) as GenericUpgrade; const xpUpgrade = createUpgrade(() => ({ resource: noPersist(boxes), - cost: 1e18, + cost: 1e30, visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[4].earned.value), display: { title: "Carry experience in boxes???", @@ -240,7 +240,8 @@ const layer = createLayer(id, function (this: BaseLayer) { let v = Decimal.mul(x, wrappingPaper.boosts.ocean1.value) .mul(dyes.boosts.orange2.value) - .div(100).log(scaling); + .div(100) + .log(scaling); v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); @@ -295,8 +296,7 @@ const layer = createLayer(id, function (this: BaseLayer) { scaling--; } - let v = Decimal.mul(x, dyes.boosts.orange2.value) - .div(1000).log(scaling); + let v = Decimal.mul(x, dyes.boosts.orange2.value).div(1000).log(scaling); v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); @@ -351,8 +351,7 @@ const layer = createLayer(id, function (this: BaseLayer) { scaling--; } - let v = Decimal.mul(x, dyes.boosts.orange2.value) - .div(1000).log(scaling); + let v = Decimal.mul(x, dyes.boosts.orange2.value).div(1000).log(scaling); v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); @@ -413,7 +412,8 @@ const layer = createLayer(id, function (this: BaseLayer) { let v = Decimal.mul(x, wrappingPaper.boosts.ocean1.value) .mul(dyes.boosts.orange2.value) - .div(1e25).log(scaling); + .div(1e25) + .log(scaling); v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); @@ -468,8 +468,7 @@ const layer = createLayer(id, function (this: BaseLayer) { scaling--; } - let v = Decimal.mul(x, dyes.boosts.orange2.value) - .div(1e28).log(scaling); + let v = Decimal.mul(x, dyes.boosts.orange2.value).div(1e28).log(scaling); v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); @@ -524,8 +523,7 @@ const layer = createLayer(id, function (this: BaseLayer) { scaling--; } - let v = Decimal.mul(x, dyes.boosts.orange2.value) - .div(1e31).log(scaling); + let v = Decimal.mul(x, dyes.boosts.orange2.value).div(1e31).log(scaling); v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); @@ -614,7 +612,7 @@ const layer = createLayer(id, function (this: BaseLayer) { Object.values(row3Upgrades) )} - {renderRow(...Object.values(buyables))} + {renderGrid(Object.values(buyables), Object.values(buyables2))} )), minimizedDisplay: jsx(() => ( diff --git a/src/data/layers/cloth.tsx b/src/data/layers/cloth.tsx index 3d910b0..a430a49 100644 --- a/src/data/layers/cloth.tsx +++ b/src/data/layers/cloth.tsx @@ -55,8 +55,8 @@ const layer = createLayer(id, function (this: BaseLayer) { height: 10, style: "margin-top: 8px", borderStyle: "border-color: black", - baseStyle: "margin-top: 0", - fillStyle: "margin-top: 0; transition-duration: 0s; background: black", + baseStyle: "margin-top: -1px", + fillStyle: "margin-top: -1px; transition-duration: 0s; background: black", progress: () => Decimal.div(breedingProgress.value, computedBreedingCooldown.value) })); const breeding = createClickable(() => ({ @@ -91,8 +91,8 @@ const layer = createLayer(id, function (this: BaseLayer) { height: 10, style: "margin-top: 8px", borderStyle: "border-color: black", - baseStyle: "margin-top: 0", - fillStyle: "margin-top: 0; transition-duration: 0s; background: black", + baseStyle: "margin-top: -1px", + fillStyle: "margin-top: -1px; transition-duration: 0s; background: black", progress: () => Decimal.div(shearingProgress.value, computedShearingCooldown.value) })); const shearing = createClickable(() => ({ @@ -127,8 +127,8 @@ const layer = createLayer(id, function (this: BaseLayer) { height: 10, style: "margin-top: 8px", borderStyle: "border-color: black", - baseStyle: "margin-top: 0", - fillStyle: "margin-top: 0; transition-duration: 0s; background: black", + baseStyle: "margin-top: -1px", + fillStyle: "margin-top: -1px; transition-duration: 0s; background: black", progress: () => Decimal.div(spinningProgress.value, computedSpinningCooldown.value) })); const spinning = createClickable(() => ({ diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index 4e76e99..2a43698 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -89,6 +89,23 @@ const layer = createLayer(id, function (this: BaseLayer) { const elfReset = createReset(() => ({ thingsToReset: [trees, workshop, coal], onReset() { + const coalUpgrades = [ + "warmerCutters", + "warmerPlanters", + "basicFertilizer", + "unlockBonfire", + "dedicatedCutters", + "dedicatedPlanters", + "betterFertilizer", + "unlockKiln", + "efficientSmelther", + "arsonistAssistance", + "refinedCoal", + "coloredFire" + ]; + const upgradeValues = coalUpgrades.map( + upg => ((coal as any)[upg] as GenericUpgrade).bought.value + ); setTimeout(() => { if (treeUpgradesMilestone.earned.value) { trees.row1Upgrades.forEach(upg => (upg.bought.value = true)); @@ -101,6 +118,10 @@ const layer = createLayer(id, function (this: BaseLayer) { workshop.foundationProgress.value = 100; } if (coalUpgradesMilestone.earned.value) { + coalUpgrades.forEach( + (upg, i) => + (((coal as any)[upg] as GenericUpgrade).bought.value = upgradeValues[i]) + ); coal.warmerCutters.bought.value = true; coal.warmerPlanters.bought.value = true; coal.basicFertilizer.bought.value = true; @@ -503,7 +524,7 @@ const layer = createLayer(id, function (this: BaseLayer) { modifier: heavyDrillCooldown, base: 10, unit: "/s", - visible: management.elfTraining.fertilizerElfTraining.milestones[4].earned.value + visible: management.elfTraining.cutterElfTraining.milestones[4].earned.value }, { title: "Cocoa Auto-Buy Frequency", @@ -517,7 +538,7 @@ const layer = createLayer(id, function (this: BaseLayer) { modifier: metalCooldown, base: 10, unit: "/s", - visible: management.elfTraining.expandersElfTraining.milestones[4].earned + visible: management.elfTraining.fertilizerElfTraining.milestones[4].earned } ]); const showModifiersModal = ref(false); @@ -563,6 +584,7 @@ const layer = createLayer(id, function (this: BaseLayer) { onPurchase?: VoidFunction; // Will get overriden by the custom onpurchase, but that's fine canBuy?: Computable; buyMax?: Computable; + independent?: Computable; // Whether or not the cost is independent of the current buyable amount } & Partial ) { const buyProgress = persistent(0); @@ -573,6 +595,7 @@ const layer = createLayer(id, function (this: BaseLayer) { const isActive = convertComputable(options.canBuy ?? true); const buyMax = convertComputable(options.buyMax ?? false); + const independent = convertComputable(options.independent ?? false); function update(diff: number) { if (upgrade.bought.value && unref(isActive)) { @@ -594,7 +617,7 @@ const layer = createLayer(id, function (this: BaseLayer) { const buyAmount = Decimal.min( Decimal.sub( buyable.inverseCost(buyable.resource?.value), - buyable.amount.value + unref(independent) ? 0 : buyable.amount.value ).add(1), maxBuyAmount ); @@ -629,7 +652,10 @@ const layer = createLayer(id, function (this: BaseLayer) { description: jsx(() => ( <> {options.description} - {upgrade.bought.value ? null : ( + {upgrade.bought.value || + ["Peppermint", "Twinkle", "Cocoa", "Frosty"].includes( + options.name + ) ? null : ( <> {" "} Training this elf will require resetting all your progress from @@ -652,7 +678,9 @@ const layer = createLayer(id, function (this: BaseLayer) { style: "width: 190px", onPurchase() { options.onPurchase?.(); - elfReset.reset(); + if (!["Peppermint", "Twinkle", "Cocoa", "Frosty"].includes(options.name)) { + elfReset.reset(); + } } }; }) as GenericUpgrade & { @@ -721,6 +749,7 @@ const layer = createLayer(id, function (this: BaseLayer) { "Joy will automatically purchase small fires you can afford, without actually spending any logs. You can toggle whether or not to enable the purchased small fires automatically. Small fires will start giving a boost to ash and coal gain.", buyable: coal.buildFire, cooldownModifier: smallFireCooldown, + buyMax: () => management.elfTraining.heatedCutterElfTraining.milestones[2].earned.value, visibility: () => showIf(boxes.upgrades.logsUpgrade.bought.value), hasToggle: true, toggleDesc: "Activate auto-purchased small fires", @@ -739,6 +768,7 @@ const layer = createLayer(id, function (this: BaseLayer) { "Faith will automatically purchase bonfires you can afford. You can toggle whether or not to enable the purchased bonfires automatically. Bonfires will start giving a boost to ash and coal gain.", buyable: coal.buildBonfire, cooldownModifier: bonfireCooldown, + buyMax: () => management.elfTraining.heatedPlanterElfTraining.milestones[2].earned.value, visibility: () => showIf(boxes.upgrades.ashUpgrade.bought.value), hasToggle: true, toggleDesc: "Activate auto-purchased bonfires", @@ -753,7 +783,8 @@ const layer = createLayer(id, function (this: BaseLayer) { onPurchase() { main.days[4].recentlyUpdated.value = true; }, - canBuy: coal.unlockBonfire.bought + canBuy: coal.unlockBonfire.bought, + independent: true }); const kilnElf = createElf({ name: "Snowball", @@ -787,7 +818,7 @@ const layer = createLayer(id, function (this: BaseLayer) { name: "Bell", description: "Bell will automatically purchase all box buyables you can afford, without actually spending any boxes.", - buyable: Object.values(boxes.buyables), + buyable: [...Object.values(boxes.buyables), ...Object.values(boxes.buyables2)], cooldownModifier: boxCooldown, visibility: () => showIf(plastic.elfUpgrades.boxElf.bought.value) }); @@ -823,7 +854,7 @@ const layer = createLayer(id, function (this: BaseLayer) { buyable: [oil.buildHeavy, oil.buildHeavy2, oil.buildExtractor], cooldownModifier: heavyDrillCooldown, visibility: () => - showIf(management.elfTraining.fertilizerElfTraining.milestones[4].earned.value), + showIf(management.elfTraining.cutterElfTraining.milestones[4].earned.value), hasToggle: true, toggleDesc: "Activate auto-purchased oil drills", onAutoPurchase(buyable, amount) { @@ -868,7 +899,7 @@ const layer = createLayer(id, function (this: BaseLayer) { buyable: [metal.oreDrill, metal.industrialCrucible, metal.hotterForge], cooldownModifier: metalCooldown, visibility: () => - showIf(management.elfTraining.expandersElfTraining.milestones[4].earned.value) + showIf(management.elfTraining.fertilizerElfTraining.milestones[4].earned.value) }); const managementElves2 = [metalElf]; const dyeElf = createElf({ diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 8f687ae..feb73b9 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -123,7 +123,7 @@ const layer = createLayer(id, () => { showIf(main.day.value >= advancedDay && main.days[advancedDay - 1].opened.value), resource: boxes.boxes, style: "width: 150px", - cost: 1e26 + cost: 1e25 })); const globalXPModifier = createSequentialModifier(() => [ createMultiplicativeModifier(() => ({ @@ -136,6 +136,11 @@ const layer = createLayer(id, () => { description: "Advanced Training", enabled: advancedUpgrade.bought })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "Star Level 4", + enabled: paperElfMilestones[3].earned.value + })), createMultiplicativeModifier(() => ({ multiplier: 2, description: "Carry experience in boxes???", @@ -180,19 +185,15 @@ const layer = createLayer(id, () => { if (elf.name == "Star" || elf.name == "Bell") { costMulti /= 3; } - const costBase = computed(() => { - return Decimal.mul(paperElfMilestones[3].earned.value ? 2000 : 4000, costMulti); - }); - const expRequiredForNextLevel = computed(() => - Decimal.pow(5, level.value).mul(costBase.value) - ); + const costBase = 4000 * costMulti; + const expRequiredForNextLevel = computed(() => Decimal.pow(5, level.value).mul(costBase)); const level = computed(() => - Decimal.affordGeometricSeries(exp.value, costBase.value, 5, 0) + Decimal.affordGeometricSeries(exp.value, costBase, 5, 0) .min(schools.amount.value) .toNumber() ); const expToNextLevel = computed(() => - Decimal.sub(exp.value, Decimal.sumGeometricSeries(level.value, costBase.value, 5, 0)) + Decimal.sub(exp.value, Decimal.sumGeometricSeries(level.value, costBase, 5, 0)) ); const bar = createBar(() => ({ direction: Direction.Right, @@ -340,7 +341,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Holly Level 5", - effectDisplay: "Raise workshop expansion cost by 0.99" + effectDisplay: "Unlock an elf that autobuys oil drills and extractors." }, visibility: () => showIf(cutterElfMilestones[3].earned.value && main.day.value >= 13), shouldEarn: () => cutterElfTraining.level.value >= 5 @@ -369,7 +370,7 @@ const layer = createLayer(id, () => { <> Auto planting speed is multiplied by 2 - (log10(logs)0.2) + (log10(trees0.2)) )) @@ -414,8 +415,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Hope Level 3", - effectDisplay: - "The workshop can be expanded past 100%, but costs scale faster. It also buys max now." + effectDisplay: "The workshop can be expanded past 100%, but costs scale faster." }, visibility: () => showIf(expanderElfMilestones[1].earned.value), shouldEarn: () => expandersElfTraining.level.value >= 3 @@ -431,7 +431,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Hope Level 5", - effectDisplay: "Unlock an elf that autobuys metal buyables." + effectDisplay: "Raise workshop expansion cost by 0.99" }, visibility: () => showIf(expanderElfMilestones[3].earned.value && main.day.value >= 13), shouldEarn: () => expandersElfTraining.level.value >= 5 @@ -456,7 +456,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Jack Level 3", - effectDisplay: "Jack now buys max." + effectDisplay: "Jack and Joy now buy max." }, visibility: () => showIf(heatedCutterElfMilestones[1].earned.value), shouldEarn: () => heatedCutterElfTraining.level.value >= 3 @@ -503,7 +503,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Mary Level 3", - effectDisplay: "Mary now buys max." + effectDisplay: "Mary and Faith now buy max." }, visibility: () => showIf(heatedPlanterElfMilestones[1].earned.value), shouldEarn: () => heatedPlanterElfTraining.level.value >= 3 @@ -522,7 +522,7 @@ const layer = createLayer(id, () => { requirement: "Mary Level 5", effectDisplay: jsx(() => ( <> - Auto smelting speed is multiplied by total XP/1000. + Auto smelting speed is multiplied by total XP/1e6. )) }, @@ -575,7 +575,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Noel Level 5", - effectDisplay: "Unlock an elf that autobuys drills and extractors" + effectDisplay: "Unlock an elf that autobuys metal buyables" }, visibility: () => showIf(fertilizerElfMilestones[3].earned.value && main.day.value >= 13), @@ -734,7 +734,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Star Level 4", - effectDisplay: "Halve xp requirements" + effectDisplay: "Double all elf xp gain" }, visibility: () => showIf(paperElfMilestones[2].earned.value && main.day.value >= 13), shouldEarn: () => paperElfTraining.level.value >= 4 @@ -742,7 +742,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Star Level 5", - effectDisplay: "Gain 5 free books for all elves that are at level 5 or above." + effectDisplay: "Gain 5 free books for all prior elves that are at level 5 or above." }, visibility: () => showIf(paperElfMilestones[3].earned.value && main.day.value >= 13), shouldEarn: () => paperElfTraining.level.value >= 5 @@ -847,11 +847,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Gingersnap Level 5", - effectDisplay: jsx(() => ( - <> - Well depth divides metal machine costs - - )) + effectDisplay: "Unlock another row of focus upgrades" }, visibility: () => showIf(clothElfMilestones[3].earned.value && main.day.value >= 13), shouldEarn: () => clothElfTraining.level.value >= 5 @@ -935,7 +931,11 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Twinkle Level 5", - effectDisplay: "Unlock another row of focus upgrades" + effectDisplay: jsx(() => ( + <> + Well depth divides metal machine costs + + )) }, visibility: () => showIf(metalElfMilestones[3].earned.value && main.day.value >= 13), shouldEarn: () => metalElfTraining.level.value >= 5 @@ -1273,8 +1273,9 @@ const layer = createLayer(id, () => { title: "Focus", description: jsx(() => ( <> - Motivate elves to focus, multiplying 3 random elves' XP gain by up to{" "} - {format(focusMaxMulti.value)}x for 10 seconds, equal to the focus bar's effect. + Motivate elves to focus, multiplying {formatWhole(maximumElves.value)} random + elves' XP gain by up to {format(focusMaxMulti.value)}x for 10 seconds, equal to + the focus bar's effect. {Decimal.gte(focusCooldown.value, 0) ? ( <>
@@ -1307,8 +1308,9 @@ const layer = createLayer(id, () => { focusTargets.value = {}; const newCount = Decimal.min(count, range); while (newCount.gt(x)) { - const roll = Object.values(elfTraining)[Math.floor(Math.random() * range)]?.name ?? ""; - if (!focusTargets.value[roll]) { + const elf = Object.values(elfTraining)[Math.floor(Math.random() * range)]; + const roll = elf?.name ?? ""; + if (!focusTargets.value[roll] && unref(elf.visibility) === Visibility.Visible) { focusTargets.value[roll] = true; x++; } @@ -1328,7 +1330,7 @@ const layer = createLayer(id, () => { description: "Increase elves affected by focus by 1" }, resource: trees.logs, - cost: 1e30 + cost: 1e28 })); const focusUpgrade3 = createUpgrade(() => ({ display: { @@ -1336,7 +1338,7 @@ const layer = createLayer(id, () => { description: "Focus can now be rerolled every 10 seconds" }, resource: trees.logs, - cost: 1e35 + cost: 1e31 })); const upgrades = [focusUpgrade1, focusUpgrade2, focusUpgrade3]; const focusUpgrade4 = createUpgrade(() => ({ @@ -1346,8 +1348,8 @@ const layer = createLayer(id, () => { "The bar moves slower when it's closer to the right and faster when it's closer to the left" }, resource: trees.logs, - visibility: () => showIf(elfTraining.metalElfTraining.milestones[4].earned.value), - cost: 1e40 + visibility: () => showIf(elfTraining.clothElfTraining.milestones[4].earned.value), + cost: 1e34 })); const focusUpgrade5 = createUpgrade(() => ({ display: { @@ -1355,8 +1357,8 @@ const layer = createLayer(id, () => { description: "The bar moves 2x slower" }, resource: trees.logs, - visibility: () => showIf(elfTraining.metalElfTraining.milestones[4].earned.value), - cost: 1e45 + visibility: () => showIf(elfTraining.clothElfTraining.milestones[4].earned.value), + cost: 1e35 })); const focusUpgrade6 = createUpgrade(() => ({ display: { @@ -1364,8 +1366,8 @@ const layer = createLayer(id, () => { description: "Focus now applies to 6 elves." }, resource: trees.logs, - visibility: () => showIf(elfTraining.metalElfTraining.milestones[4].earned.value), - cost: 1e50 + visibility: () => showIf(elfTraining.clothElfTraining.milestones[4].earned.value), + cost: 1e36 })); const upgrades2 = [focusUpgrade4, focusUpgrade5, focusUpgrade6]; // ------------------------------------------------------------------------------- Schools @@ -1450,7 +1452,10 @@ const layer = createLayer(id, () => { })) as GenericBuyable; const classroomCost = computed(() => { - const classroomFactor = Decimal.add(classrooms.amount.value, 1).pow(1.5); + let v = classrooms.amount.value; + if (Decimal.gte(v, 50)) v = Decimal.pow(v, 2).div(50); + if (Decimal.gte(v, 200)) v = Decimal.pow(v, 2).div(200); + const classroomFactor = Decimal.add(v, 1).pow(1.5); return { wood: classroomFactor.mul(1e21), paper: classroomFactor.mul(1e18), @@ -1679,7 +1684,7 @@ const layer = createLayer(id, () => {

{render(focusButton)} - {renderGrid(upgrades)} + {renderGrid(upgrades, upgrades2)}
{renderGrid( [focusMeter], diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index a08bf55..b73348f 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -151,7 +151,7 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: dyes.upgrades.redDyeUpg2.bought })), createMultiplicativeModifier(() => ({ - multiplier: () => Decimal.div(management.totalElfExp.value, 1000).add(1).sqrt(), + multiplier: () => Decimal.div(management.totalElfExp.value, 1e6).add(1).sqrt(), description: "Mary Level 5", enabled: management.elfTraining.heatedPlanterElfTraining.milestones[4].earned })), @@ -181,7 +181,7 @@ const layer = createLayer(id, function (this: BaseLayer) { createMultiplicativeModifier(() => ({ multiplier: () => Decimal.add(oil.effectiveBurners.value, 1).mul(oil.oilEffectiveness.value), - description: "Blaster Burner", + description: "Oil Burner", enabled: oil.row2Upgrades[2].bought })), createMultiplicativeModifier(() => ({ @@ -408,7 +408,7 @@ const layer = createLayer(id, function (this: BaseLayer) { let v = new Decimal(this.amount.value); v = Decimal.pow(0.95, paper.books.metalBook.totalAmount.value).times(v); let cost = Decimal.pow(1.15, v).times(10); - if (management.elfTraining.clothElfTraining.milestones[4].earned.value) { + if (management.elfTraining.metalElfTraining.milestones[4].earned.value) { cost = Decimal.div(cost, Decimal.add(oil.depth.value, 1).sqrt()); } if (management.elfTraining.metalElfTraining.milestones[3].earned.value) { @@ -420,7 +420,7 @@ const layer = createLayer(id, function (this: BaseLayer) { if (management.elfTraining.metalElfTraining.milestones[3].earned.value) { x = Decimal.mul(x, 10); } - if (management.elfTraining.clothElfTraining.milestones[4].earned.value) { + if (management.elfTraining.metalElfTraining.milestones[4].earned.value) { x = Decimal.mul(x, Decimal.add(oil.depth.value, 1).sqrt()); } let v = Decimal.div(x, 10).log(1.15); @@ -452,7 +452,7 @@ const layer = createLayer(id, function (this: BaseLayer) { let v = new Decimal(this.amount.value); v = Decimal.pow(0.95, paper.books.metalBook.totalAmount.value).times(v); let cost = Decimal.pow(1.15, Decimal.times(v, 10)).times(10); - if (management.elfTraining.clothElfTraining.milestones[4].earned.value) { + if (management.elfTraining.metalElfTraining.milestones[4].earned.value) { cost = Decimal.div(cost, Decimal.add(oil.depth.value, 1).sqrt()); } if (management.elfTraining.metalElfTraining.milestones[3].earned.value) { @@ -464,7 +464,7 @@ const layer = createLayer(id, function (this: BaseLayer) { if (management.elfTraining.metalElfTraining.milestones[3].earned.value) { x = Decimal.mul(x, 10); } - if (management.elfTraining.clothElfTraining.milestones[4].earned.value) { + if (management.elfTraining.metalElfTraining.milestones[4].earned.value) { x = Decimal.mul(x, Decimal.add(oil.depth.value, 1).sqrt()); } let v = Decimal.div(x, 10).log(1.15).div(10); @@ -496,7 +496,7 @@ const layer = createLayer(id, function (this: BaseLayer) { let v = new Decimal(this.amount.value); v = Decimal.pow(0.95, paper.books.metalBook.totalAmount.value).times(v); let cost = Decimal.pow(10, v).times(1e12); - if (management.elfTraining.clothElfTraining.milestones[4].earned.value) { + if (management.elfTraining.metalElfTraining.milestones[4].earned.value) { cost = Decimal.div(cost, Decimal.add(oil.depth.value, 1).sqrt()); } if (management.elfTraining.metalElfTraining.milestones[3].earned.value) { @@ -508,7 +508,7 @@ const layer = createLayer(id, function (this: BaseLayer) { if (management.elfTraining.metalElfTraining.milestones[3].earned.value) { x = Decimal.mul(x, 10); } - if (management.elfTraining.clothElfTraining.milestones[4].earned.value) { + if (management.elfTraining.metalElfTraining.milestones[4].earned.value) { x = Decimal.mul(x, Decimal.add(oil.depth.value, 1).sqrt()); } let v = Decimal.div(x, 1e12).log(10); diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index 2303e15..64a0ad4 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -139,7 +139,8 @@ const layer = createLayer(id, function (this: BaseLayer) { }, style: { color: colorText, - width: "160px" + width: "160px", + flexGrow: 1 } })) as ElfBuyable & { resource: Resource }; const { @@ -206,7 +207,8 @@ const layer = createLayer(id, function (this: BaseLayer) { }, style: { color: colorText, - width: "160px" + width: "160px", + flexGrow: 1 } })) as ElfBuyable & { resource: Resource }; const { @@ -228,14 +230,12 @@ const layer = createLayer(id, function (this: BaseLayer) { cost() { let v = new Decimal(this.amount.value); if (Decimal.gte(v, 10)) v = Decimal.pow(v, 4).div(10 ** 3); - if (Decimal.gte(v, 1e3)) v = Decimal.pow(v, 4).div(1e3 ** 3); v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v); return Decimal.pow(8, v).times(2e5); }, inverseCost(x: DecimalSource) { let v = Decimal.div(x, 2e5).log(8); v = v.div(Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value)); - if (Decimal.gte(v, 1e3)) v = Decimal.mul(v, 1e3 ** 3).root(4); if (Decimal.gte(v, 10)) v = Decimal.mul(v, 10 ** 3).root(4); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); }, @@ -263,7 +263,8 @@ const layer = createLayer(id, function (this: BaseLayer) { }, style: { color: colorText, - width: "160px" + width: "160px", + flexGrow: 1 } })) as ElfBuyable & { resource: Resource }; const { @@ -298,7 +299,7 @@ const layer = createLayer(id, function (this: BaseLayer) { resource: metal.metal, cost() { let v = new Decimal(this.amount.value); - if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100); + if (Decimal.gte(v, 10)) v = Decimal.pow(v, 4).div(10 ** 3); v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v); let price = Decimal.pow(16, v).times(2e6); if (row2Upgrades[4].bought.value) { @@ -317,8 +318,8 @@ const layer = createLayer(id, function (this: BaseLayer) { x = Decimal.mul(x, Decimal.add(totalOil.value, 1).root(6)); } let v = Decimal.div(x, 2e6).log(16); - v = v.div(Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value)); - if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(4); + v = v.div(Decimal.pow(0.95, paper.books.oilBook.totalAmount.value)); + if (Decimal.gte(v, 10)) v = Decimal.mul(v, 10 ** 3).root(4); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); }, display: jsx(() => ( @@ -344,7 +345,8 @@ const layer = createLayer(id, function (this: BaseLayer) { }, style: { color: colorText, - width: "160px" + width: "160px", + flexGrow: 1 } })) as ElfBuyable & { resource: Resource }; const { @@ -372,14 +374,14 @@ const layer = createLayer(id, function (this: BaseLayer) { resource: noPersist(oil), cost() { let v = new Decimal(this.amount.value); - if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100); + if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100 ** 3); v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v); return Decimal.pow(2, v).times(50); }, inverseCost(x: DecimalSource) { let v = Decimal.div(x, 50).log(2); v = v.div(Decimal.pow(0.95, paper.books.oilBook.totalAmount.value)); - if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(4); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100 ** 3).root(4); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); }, display: jsx(() => ( @@ -412,7 +414,8 @@ const layer = createLayer(id, function (this: BaseLayer) { }, style: { color: colorText, - width: "160px" + width: "160px", + flexGrow: 1 } })) as ElfBuyable & { resource: Resource }; const { @@ -472,7 +475,8 @@ const layer = createLayer(id, function (this: BaseLayer) { }, style: { color: colorText, - width: "160px" + width: "160px", + flexGrow: 1 } })) as ElfBuyable & { resource: Resource }; @@ -732,7 +736,7 @@ const layer = createLayer(id, function (this: BaseLayer) { const row3Upgrades = [ createUpgrade(() => ({ resource: noPersist(oil), - cost: 1e11, + cost: 1e13, display: { title: "Dye Synergy I", description: "Red dye boosts yellow dye gain *(log(x)^0.75)" @@ -743,7 +747,7 @@ const layer = createLayer(id, function (this: BaseLayer) { })), createUpgrade(() => ({ resource: noPersist(oil), - cost: 1e12, + cost: 1e14, display: { title: "Orange-colored boxes", description: "Orange dye's 2nd effect is raised to the 2.5" @@ -754,7 +758,7 @@ const layer = createLayer(id, function (this: BaseLayer) { })), createUpgrade(() => ({ resource: noPersist(oil), - cost: 1e13, + cost: 1e15, display: { title: "Colorful Focus", description: "Sum of secondary dyes increases max focus multiplier by cbrt(x)" @@ -765,7 +769,7 @@ const layer = createLayer(id, function (this: BaseLayer) { })), createUpgrade(() => ({ resource: noPersist(oil), - cost: 1e14, + cost: 1e16, display: { title: "Dye Synergy II", description: "Blue dye boosts red dye gain *log(x)" @@ -776,7 +780,7 @@ const layer = createLayer(id, function (this: BaseLayer) { })), createUpgrade(() => ({ resource: noPersist(oil), - cost: 1e15, + cost: 1e17, display: { title: "The Ultimate Metal Dye", description: "Sum of primary dyes boosts auto smelt speed" diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 1b5c52e..caea52d 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -19,7 +19,7 @@ import { createMultiplicativeModifier, createSequentialModifier, Modifier } from import { noPersist } from "game/persistence"; import Decimal, { DecimalSource, format, formatSmall, formatWhole } from "util/bignum"; import { WithRequired } from "util/common"; -import { render, renderCol, renderRow } from "util/vue"; +import { render, renderCol, renderGrid, renderRow } from "util/vue"; import { computed, ComputedRef, ref, unref } from "vue"; import cloth from "./cloth"; import coal from "./coal"; @@ -125,8 +125,8 @@ const layer = createLayer(id, function (this: BaseLayer) { scaling--; } let cost = Decimal.pow(scaling, v).times(10); - if(["Peppermint", "Twinkle", "Cocoa", "Frosty"].includes(options.elfName)){ - cost = cost.mul(1e31) + if (["Peppermint", "Twinkle", "Cocoa", "Frosty"].includes(options.elfName)) { + cost = cost.mul(1e31); } if (management.elfTraining.paperElfTraining.milestones[0].earned.value) { cost = Decimal.div(cost, sumBooks.value.max(1)); @@ -149,9 +149,9 @@ const layer = createLayer(id, function (this: BaseLayer) { scaling--; } - let v = Decimal.div(x, 10) - if(["Peppermint", "Twinkle", "Cocoa", "Frosty"].includes(options.elfName)){ - v = v.div(1e31) + let v = Decimal.div(x, 10); + if (["Peppermint", "Twinkle", "Cocoa", "Frosty"].includes(options.elfName)) { + v = v.div(1e31); } v = v.log(scaling); @@ -165,8 +165,23 @@ const layer = createLayer(id, function (this: BaseLayer) { }, style: "width: 600px", freeLevels: computed(() => - management.elfTraining.paperElfTraining.milestones[4].earned.value - ? Decimal.times(5, management.level5Elves.value) + management.elfTraining.paperElfTraining.milestones[4].earned.value && + Decimal.gte( + Object.values(management.elfTraining).find( + training => training.name === options.elfName + )?.level.value ?? 0, + 5 + ) && + ![ + "Star", + "Bell", + "Gingersnap", + "Peppermint", + "Twinkle", + "Cocoa", + "Frosty" + ].includes(options.elfName) + ? 5 : 0 ), totalAmount: computed(() => Decimal.add(buyable.amount.value, buyable.freeLevels.value)) @@ -248,29 +263,25 @@ const layer = createLayer(id, function (this: BaseLayer) { name: "Drills and Mills", elfName: "Peppermint", buyableName: "Coal Drill", - visibility: () => - showIf(management.elfTraining.expandersElfTraining.milestones[3].earned.value) + visibility: () => showIf(elves.elves.coalDrillElf.bought.value) }); const heavyDrillBook = createBook({ name: "Deep in the Earth", elfName: "Frosty", buyableName: "Oil Drills", - visibility: () => - showIf(management.elfTraining.fertilizerElfTraining.milestones[4].earned.value) + visibility: () => showIf(elves.elves.heavyDrillElf.bought.value) }); const oilBook = createBook({ name: "Burning the Midnight Oil", elfName: "Cocoa", buyableName: "Oil-Consuming Machines", - visibility: () => - showIf(management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value) + visibility: () => showIf(elves.elves.oilElf.bought.value) }); const metalBook = createBook({ name: "Physical Metallurgy", elfName: "Twinkle", buyableName: "Metal Buyables", - visibility: () => - showIf(management.elfTraining.expandersElfTraining.milestones[4].earned.value) + visibility: () => showIf(elves.elves.metalElf.bought.value) }); const dyeBook = createBook({ name: "Arts and Crafts", @@ -341,7 +352,7 @@ const layer = createLayer(id, function (this: BaseLayer) { })) as GenericUpgrade; const bookUpgrade = createUpgrade(() => ({ resource: noPersist(paper), - cost: 1e40, + cost: 1e38, visibility: () => showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value), display: { @@ -351,7 +362,7 @@ const layer = createLayer(id, function (this: BaseLayer) { })); const classroomUpgrade = createUpgrade(() => ({ resource: noPersist(paper), - cost: 1e44, + cost: 1e40, visibility: () => showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value), display: { @@ -475,7 +486,7 @@ const layer = createLayer(id, function (this: BaseLayer) { {render(makePaper)} - {renderRow(...Object.values(upgrades))} + {renderGrid(Object.values(upgrades), Object.values(upgrades2))} {renderCol(...Object.values(books))} diff --git a/src/data/layers/plastic.tsx b/src/data/layers/plastic.tsx index 906dba8..f6131cf 100644 --- a/src/data/layers/plastic.tsx +++ b/src/data/layers/plastic.tsx @@ -278,7 +278,7 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: workshop.milestones.extraExpansionMilestone4.earned })), createMultiplicativeModifier(() => ({ - multiplier: () => Decimal.add(oil.buildExtractor.amount.value, 1), + multiplier: () => Decimal.add(oil.buildExtractor.amount.value, 1).pow(1.25), description: "Snowball Level 4", enabled: management.elfTraining.kilnElfTraining.milestones[3].earned })) diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index 02d018c..a134221 100644 --- a/src/data/layers/trees.tsx +++ b/src/data/layers/trees.tsx @@ -434,7 +434,7 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: management.elfTraining.planterElfTraining.milestones[0].earned })), createMultiplicativeModifier(() => ({ - multiplier: () => Decimal.pow(trees.value, 0.2).log10().pow_base(2), + multiplier: () => Decimal.pow(trees.value, 0.2).max(1).log10().pow_base(2), description: "Ivy Level 3", enabled: management.elfTraining.planterElfTraining.milestones[2].earned })), @@ -541,8 +541,8 @@ const layer = createLayer(id, function (this: BaseLayer) { width: 100, height: 10, style: "margin-top: 8px", - baseStyle: "margin-top: 0", - fillStyle: "margin-top: 0; transition-duration: 0s", + baseStyle: "margin-top: -1px", + fillStyle: "margin-top: -1px; transition-duration: 0s", progress: () => Decimal.div(manualCutProgress.value, computedManualCuttingCooldown.value) })); @@ -593,8 +593,8 @@ const layer = createLayer(id, function (this: BaseLayer) { width: 100, height: 10, style: "margin-top: 8px", - baseStyle: "margin-top: 0", - fillStyle: "margin-top: 0; transition-duration: 0s", + baseStyle: "margin-top: -1px", + fillStyle: "margin-top: -1px; transition-duration: 0s", progress: () => Decimal.div(manualPlantProgress.value, computedManualPlantingCooldown.value) })); const plantTree = createClickable(() => ({ @@ -735,8 +735,8 @@ const layer = createLayer(id, function (this: BaseLayer) { computedAutoCuttingAmount.value, Decimal.sub(lastAutoPlantedAmount.value, lastAutoCuttingAmount.value).max(0) ); - lastAutoPlantedAmount.value = plantingAmount; - lastAutoCuttingAmount.value = cuttingAmount; + lastAutoPlantedAmount.value = Decimal.isNaN(plantingAmount) ? 0 : plantingAmount; + lastAutoCuttingAmount.value = Decimal.isNaN(cuttingAmount) ? 0 : cuttingAmount; const amountCut = Decimal.min( trees.value, diff --git a/src/game/modifiers.tsx b/src/game/modifiers.tsx index f1038ed..a5cd416 100644 --- a/src/game/modifiers.tsx +++ b/src/game/modifiers.tsx @@ -3,14 +3,13 @@ import type { CoercableComponent } from "features/feature"; import { jsx } from "features/feature"; import settings from "game/settings"; import type { DecimalSource } from "util/bignum"; -import Decimal, { format } from "util/bignum"; +import Decimal, { formatSmall } from "util/bignum"; import type { WithRequired } from "util/common"; import type { Computable, ProcessedComputable } from "util/computed"; import { convertComputable } from "util/computed"; import { createLazyProxy } from "util/proxies"; import { renderJSX } from "util/vue"; import { computed, unref } from "vue"; -import player from "./player"; /** * An object that can be used to apply or unapply some modification to a number. @@ -87,7 +86,7 @@ export function createAdditiveModifier( ) : null} {Decimal.gte(unref(processedAddend), 0) ? "+" : ""} - {format(unref(processedAddend))} + {formatSmall(unref(processedAddend))} )) @@ -134,7 +133,7 @@ export function createMultiplicativeModifier ) : null} - ×{format(unref(processedMultiplier))} + ×{formatSmall(unref(processedMultiplier))} )) @@ -204,7 +203,7 @@ export function createExponentialModifier( ) : null} - ^{format(unref(processedExponent))} + ^{formatSmall(unref(processedExponent))} )) @@ -274,7 +273,7 @@ export function createModifierSection( baseText: CoercableComponent = "Base" ) { return ( -
+

{title} {subtitle ? ({subtitle}) : null} @@ -283,7 +282,7 @@ export function createModifierSection(
{renderJSX(baseText)} - {format(base)} + {formatSmall(base)} {unit}
@@ -292,7 +291,7 @@ export function createModifierSection(
Total - {format(modifier.apply(base))} + {formatSmall(modifier.apply(base))} {unit}