Merge remote-tracking branch 'origin/main' into days-15-16

This commit is contained in:
Chunkybanana 2022-12-15 04:29:57 +00:00
commit 6b56cc05bc
10 changed files with 179 additions and 131 deletions

View file

@ -166,7 +166,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
const row2Upgrades = { oreUpgrade, metalUpgrade, plasticUpgrade }; const row2Upgrades = { oreUpgrade, metalUpgrade, plasticUpgrade };
const clothUpgrade = createUpgrade(() => ({ const clothUpgrade = createUpgrade(() => ({
resource: noPersist(boxes), resource: noPersist(boxes),
cost: 1e16, cost: 1e28,
visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[4].earned.value), visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[4].earned.value),
display: { display: {
title: "Carry cloth in boxes", title: "Carry cloth in boxes",
@ -175,11 +175,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
})) as GenericUpgrade; })) as GenericUpgrade;
const dyeUpgrade = createUpgrade(() => ({ const dyeUpgrade = createUpgrade(() => ({
resource: noPersist(boxes), resource: noPersist(boxes),
cost: 1e17, cost: 1e29,
visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[4].earned.value), visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[4].earned.value),
display: { display: {
title: "Carry dye in boxes", title: "Carry dye in boxes",
description: "Double all dye gain" description: "Double all dye gain but reset all dyes"
}, },
onPurchase() { onPurchase() {
(["red", "yellow", "blue", "orange", "green", "purple"] as const).forEach(dyeColor => { (["red", "yellow", "blue", "orange", "green", "purple"] as const).forEach(dyeColor => {
@ -190,7 +190,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
})) as GenericUpgrade; })) as GenericUpgrade;
const xpUpgrade = createUpgrade(() => ({ const xpUpgrade = createUpgrade(() => ({
resource: noPersist(boxes), resource: noPersist(boxes),
cost: 1e18, cost: 1e30,
visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[4].earned.value), visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[4].earned.value),
display: { display: {
title: "Carry experience in boxes???", 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) let v = Decimal.mul(x, wrappingPaper.boosts.ocean1.value)
.mul(dyes.boosts.orange2.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)); v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value));
return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
@ -295,8 +296,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
scaling--; scaling--;
} }
let v = Decimal.mul(x, dyes.boosts.orange2.value) let v = Decimal.mul(x, dyes.boosts.orange2.value).div(1000).log(scaling);
.div(1000).log(scaling);
v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value));
return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
@ -351,8 +351,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
scaling--; scaling--;
} }
let v = Decimal.mul(x, dyes.boosts.orange2.value) let v = Decimal.mul(x, dyes.boosts.orange2.value).div(1000).log(scaling);
.div(1000).log(scaling);
v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value));
return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); 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) let v = Decimal.mul(x, wrappingPaper.boosts.ocean1.value)
.mul(dyes.boosts.orange2.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)); v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value));
return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
@ -468,8 +468,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
scaling--; scaling--;
} }
let v = Decimal.mul(x, dyes.boosts.orange2.value) let v = Decimal.mul(x, dyes.boosts.orange2.value).div(1e28).log(scaling);
.div(1e28).log(scaling);
v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value));
return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
@ -524,8 +523,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
scaling--; scaling--;
} }
let v = Decimal.mul(x, dyes.boosts.orange2.value) let v = Decimal.mul(x, dyes.boosts.orange2.value).div(1e31).log(scaling);
.div(1e31).log(scaling);
v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value));
return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
@ -614,7 +612,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
Object.values(row3Upgrades) Object.values(row3Upgrades)
)} )}
<Spacer /> <Spacer />
{renderRow(...Object.values(buyables))} {renderGrid(Object.values(buyables), Object.values(buyables2))}
</> </>
)), )),
minimizedDisplay: jsx(() => ( minimizedDisplay: jsx(() => (

View file

@ -55,8 +55,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
height: 10, height: 10,
style: "margin-top: 8px", style: "margin-top: 8px",
borderStyle: "border-color: black", borderStyle: "border-color: black",
baseStyle: "margin-top: 0", baseStyle: "margin-top: -1px",
fillStyle: "margin-top: 0; transition-duration: 0s; background: black", fillStyle: "margin-top: -1px; transition-duration: 0s; background: black",
progress: () => Decimal.div(breedingProgress.value, computedBreedingCooldown.value) progress: () => Decimal.div(breedingProgress.value, computedBreedingCooldown.value)
})); }));
const breeding = createClickable(() => ({ const breeding = createClickable(() => ({
@ -91,8 +91,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
height: 10, height: 10,
style: "margin-top: 8px", style: "margin-top: 8px",
borderStyle: "border-color: black", borderStyle: "border-color: black",
baseStyle: "margin-top: 0", baseStyle: "margin-top: -1px",
fillStyle: "margin-top: 0; transition-duration: 0s; background: black", fillStyle: "margin-top: -1px; transition-duration: 0s; background: black",
progress: () => Decimal.div(shearingProgress.value, computedShearingCooldown.value) progress: () => Decimal.div(shearingProgress.value, computedShearingCooldown.value)
})); }));
const shearing = createClickable(() => ({ const shearing = createClickable(() => ({
@ -127,8 +127,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
height: 10, height: 10,
style: "margin-top: 8px", style: "margin-top: 8px",
borderStyle: "border-color: black", borderStyle: "border-color: black",
baseStyle: "margin-top: 0", baseStyle: "margin-top: -1px",
fillStyle: "margin-top: 0; transition-duration: 0s; background: black", fillStyle: "margin-top: -1px; transition-duration: 0s; background: black",
progress: () => Decimal.div(spinningProgress.value, computedSpinningCooldown.value) progress: () => Decimal.div(spinningProgress.value, computedSpinningCooldown.value)
})); }));
const spinning = createClickable(() => ({ const spinning = createClickable(() => ({

View file

@ -89,6 +89,23 @@ const layer = createLayer(id, function (this: BaseLayer) {
const elfReset = createReset(() => ({ const elfReset = createReset(() => ({
thingsToReset: [trees, workshop, coal], thingsToReset: [trees, workshop, coal],
onReset() { 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(() => { setTimeout(() => {
if (treeUpgradesMilestone.earned.value) { if (treeUpgradesMilestone.earned.value) {
trees.row1Upgrades.forEach(upg => (upg.bought.value = true)); trees.row1Upgrades.forEach(upg => (upg.bought.value = true));
@ -101,6 +118,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
workshop.foundationProgress.value = 100; workshop.foundationProgress.value = 100;
} }
if (coalUpgradesMilestone.earned.value) { if (coalUpgradesMilestone.earned.value) {
coalUpgrades.forEach(
(upg, i) =>
(((coal as any)[upg] as GenericUpgrade).bought.value = upgradeValues[i])
);
coal.warmerCutters.bought.value = true; coal.warmerCutters.bought.value = true;
coal.warmerPlanters.bought.value = true; coal.warmerPlanters.bought.value = true;
coal.basicFertilizer.bought.value = true; coal.basicFertilizer.bought.value = true;
@ -503,7 +524,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
modifier: heavyDrillCooldown, modifier: heavyDrillCooldown,
base: 10, base: 10,
unit: "/s", unit: "/s",
visible: management.elfTraining.fertilizerElfTraining.milestones[4].earned.value visible: management.elfTraining.cutterElfTraining.milestones[4].earned.value
}, },
{ {
title: "Cocoa Auto-Buy Frequency", title: "Cocoa Auto-Buy Frequency",
@ -517,7 +538,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
modifier: metalCooldown, modifier: metalCooldown,
base: 10, base: 10,
unit: "/s", unit: "/s",
visible: management.elfTraining.expandersElfTraining.milestones[4].earned visible: management.elfTraining.fertilizerElfTraining.milestones[4].earned
} }
]); ]);
const showModifiersModal = ref(false); 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 onPurchase?: VoidFunction; // Will get overriden by the custom onpurchase, but that's fine
canBuy?: Computable<boolean>; canBuy?: Computable<boolean>;
buyMax?: Computable<boolean>; buyMax?: Computable<boolean>;
independent?: Computable<boolean>; // Whether or not the cost is independent of the current buyable amount
} & Partial<ClickableOptions> } & Partial<ClickableOptions>
) { ) {
const buyProgress = persistent<DecimalSource>(0); const buyProgress = persistent<DecimalSource>(0);
@ -573,6 +595,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
const isActive = convertComputable(options.canBuy ?? true); const isActive = convertComputable(options.canBuy ?? true);
const buyMax = convertComputable(options.buyMax ?? false); const buyMax = convertComputable(options.buyMax ?? false);
const independent = convertComputable(options.independent ?? false);
function update(diff: number) { function update(diff: number) {
if (upgrade.bought.value && unref(isActive)) { if (upgrade.bought.value && unref(isActive)) {
@ -594,7 +617,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
const buyAmount = Decimal.min( const buyAmount = Decimal.min(
Decimal.sub( Decimal.sub(
buyable.inverseCost(buyable.resource?.value), buyable.inverseCost(buyable.resource?.value),
buyable.amount.value unref(independent) ? 0 : buyable.amount.value
).add(1), ).add(1),
maxBuyAmount maxBuyAmount
); );
@ -629,7 +652,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
description: jsx(() => ( description: jsx(() => (
<> <>
{options.description} {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 Training this elf will require resetting all your progress from
@ -652,7 +678,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
style: "width: 190px", style: "width: 190px",
onPurchase() { onPurchase() {
options.onPurchase?.(); options.onPurchase?.();
elfReset.reset(); if (!["Peppermint", "Twinkle", "Cocoa", "Frosty"].includes(options.name)) {
elfReset.reset();
}
} }
}; };
}) as GenericUpgrade & { }) 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.", "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, buyable: coal.buildFire,
cooldownModifier: smallFireCooldown, cooldownModifier: smallFireCooldown,
buyMax: () => management.elfTraining.heatedCutterElfTraining.milestones[2].earned.value,
visibility: () => showIf(boxes.upgrades.logsUpgrade.bought.value), visibility: () => showIf(boxes.upgrades.logsUpgrade.bought.value),
hasToggle: true, hasToggle: true,
toggleDesc: "Activate auto-purchased small fires", 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.", "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, buyable: coal.buildBonfire,
cooldownModifier: bonfireCooldown, cooldownModifier: bonfireCooldown,
buyMax: () => management.elfTraining.heatedPlanterElfTraining.milestones[2].earned.value,
visibility: () => showIf(boxes.upgrades.ashUpgrade.bought.value), visibility: () => showIf(boxes.upgrades.ashUpgrade.bought.value),
hasToggle: true, hasToggle: true,
toggleDesc: "Activate auto-purchased bonfires", toggleDesc: "Activate auto-purchased bonfires",
@ -753,7 +783,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
onPurchase() { onPurchase() {
main.days[4].recentlyUpdated.value = true; main.days[4].recentlyUpdated.value = true;
}, },
canBuy: coal.unlockBonfire.bought canBuy: coal.unlockBonfire.bought,
independent: true
}); });
const kilnElf = createElf({ const kilnElf = createElf({
name: "Snowball", name: "Snowball",
@ -787,7 +818,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
name: "Bell", name: "Bell",
description: description:
"Bell will automatically purchase all box buyables you can afford, without actually spending any boxes.", "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, cooldownModifier: boxCooldown,
visibility: () => showIf(plastic.elfUpgrades.boxElf.bought.value) 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], buyable: [oil.buildHeavy, oil.buildHeavy2, oil.buildExtractor],
cooldownModifier: heavyDrillCooldown, cooldownModifier: heavyDrillCooldown,
visibility: () => visibility: () =>
showIf(management.elfTraining.fertilizerElfTraining.milestones[4].earned.value), showIf(management.elfTraining.cutterElfTraining.milestones[4].earned.value),
hasToggle: true, hasToggle: true,
toggleDesc: "Activate auto-purchased oil drills", toggleDesc: "Activate auto-purchased oil drills",
onAutoPurchase(buyable, amount) { onAutoPurchase(buyable, amount) {
@ -868,7 +899,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
buyable: [metal.oreDrill, metal.industrialCrucible, metal.hotterForge], buyable: [metal.oreDrill, metal.industrialCrucible, metal.hotterForge],
cooldownModifier: metalCooldown, cooldownModifier: metalCooldown,
visibility: () => visibility: () =>
showIf(management.elfTraining.expandersElfTraining.milestones[4].earned.value) showIf(management.elfTraining.fertilizerElfTraining.milestones[4].earned.value)
}); });
const managementElves2 = [metalElf]; const managementElves2 = [metalElf];
const dyeElf = createElf({ const dyeElf = createElf({

View file

@ -123,7 +123,7 @@ const layer = createLayer(id, () => {
showIf(main.day.value >= advancedDay && main.days[advancedDay - 1].opened.value), showIf(main.day.value >= advancedDay && main.days[advancedDay - 1].opened.value),
resource: boxes.boxes, resource: boxes.boxes,
style: "width: 150px", style: "width: 150px",
cost: 1e26 cost: 1e25
})); }));
const globalXPModifier = createSequentialModifier(() => [ const globalXPModifier = createSequentialModifier(() => [
createMultiplicativeModifier(() => ({ createMultiplicativeModifier(() => ({
@ -136,6 +136,11 @@ const layer = createLayer(id, () => {
description: "Advanced Training", description: "Advanced Training",
enabled: advancedUpgrade.bought enabled: advancedUpgrade.bought
})), })),
createMultiplicativeModifier(() => ({
multiplier: 2,
description: "Star Level 4",
enabled: paperElfMilestones[3].earned.value
})),
createMultiplicativeModifier(() => ({ createMultiplicativeModifier(() => ({
multiplier: 2, multiplier: 2,
description: "Carry experience in boxes???", description: "Carry experience in boxes???",
@ -180,19 +185,15 @@ const layer = createLayer(id, () => {
if (elf.name == "Star" || elf.name == "Bell") { if (elf.name == "Star" || elf.name == "Bell") {
costMulti /= 3; costMulti /= 3;
} }
const costBase = computed(() => { const costBase = 4000 * costMulti;
return Decimal.mul(paperElfMilestones[3].earned.value ? 2000 : 4000, costMulti); const expRequiredForNextLevel = computed(() => Decimal.pow(5, level.value).mul(costBase));
});
const expRequiredForNextLevel = computed(() =>
Decimal.pow(5, level.value).mul(costBase.value)
);
const level = computed(() => const level = computed(() =>
Decimal.affordGeometricSeries(exp.value, costBase.value, 5, 0) Decimal.affordGeometricSeries(exp.value, costBase, 5, 0)
.min(schools.amount.value) .min(schools.amount.value)
.toNumber() .toNumber()
); );
const expToNextLevel = computed(() => 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(() => ({ const bar = createBar(() => ({
direction: Direction.Right, direction: Direction.Right,
@ -340,7 +341,7 @@ const layer = createLayer(id, () => {
createMilestone(() => ({ createMilestone(() => ({
display: { display: {
requirement: "Holly Level 5", 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), visibility: () => showIf(cutterElfMilestones[3].earned.value && main.day.value >= 13),
shouldEarn: () => cutterElfTraining.level.value >= 5 shouldEarn: () => cutterElfTraining.level.value >= 5
@ -369,7 +370,7 @@ const layer = createLayer(id, () => {
<> <>
Auto planting speed is multiplied by 2 Auto planting speed is multiplied by 2
<sup> <sup>
(log<sub>10</sub>(logs)<sup>0.2</sup>) (log<sub>10</sub>(trees<sup>0.2</sup>))
</sup> </sup>
</> </>
)) ))
@ -414,8 +415,7 @@ const layer = createLayer(id, () => {
createMilestone(() => ({ createMilestone(() => ({
display: { display: {
requirement: "Hope Level 3", requirement: "Hope Level 3",
effectDisplay: effectDisplay: "The workshop can be expanded past 100%, but costs scale faster."
"The workshop can be expanded past 100%, but costs scale faster. It also buys max now."
}, },
visibility: () => showIf(expanderElfMilestones[1].earned.value), visibility: () => showIf(expanderElfMilestones[1].earned.value),
shouldEarn: () => expandersElfTraining.level.value >= 3 shouldEarn: () => expandersElfTraining.level.value >= 3
@ -431,7 +431,7 @@ const layer = createLayer(id, () => {
createMilestone(() => ({ createMilestone(() => ({
display: { display: {
requirement: "Hope Level 5", 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), visibility: () => showIf(expanderElfMilestones[3].earned.value && main.day.value >= 13),
shouldEarn: () => expandersElfTraining.level.value >= 5 shouldEarn: () => expandersElfTraining.level.value >= 5
@ -456,7 +456,7 @@ const layer = createLayer(id, () => {
createMilestone(() => ({ createMilestone(() => ({
display: { display: {
requirement: "Jack Level 3", requirement: "Jack Level 3",
effectDisplay: "Jack now buys max." effectDisplay: "Jack and Joy now buy max."
}, },
visibility: () => showIf(heatedCutterElfMilestones[1].earned.value), visibility: () => showIf(heatedCutterElfMilestones[1].earned.value),
shouldEarn: () => heatedCutterElfTraining.level.value >= 3 shouldEarn: () => heatedCutterElfTraining.level.value >= 3
@ -503,7 +503,7 @@ const layer = createLayer(id, () => {
createMilestone(() => ({ createMilestone(() => ({
display: { display: {
requirement: "Mary Level 3", requirement: "Mary Level 3",
effectDisplay: "Mary now buys max." effectDisplay: "Mary and Faith now buy max."
}, },
visibility: () => showIf(heatedPlanterElfMilestones[1].earned.value), visibility: () => showIf(heatedPlanterElfMilestones[1].earned.value),
shouldEarn: () => heatedPlanterElfTraining.level.value >= 3 shouldEarn: () => heatedPlanterElfTraining.level.value >= 3
@ -522,7 +522,7 @@ const layer = createLayer(id, () => {
requirement: "Mary Level 5", requirement: "Mary Level 5",
effectDisplay: jsx(() => ( effectDisplay: jsx(() => (
<> <>
Auto smelting speed is multiplied by <Sqrt>total XP/1000</Sqrt>. Auto smelting speed is multiplied by <Sqrt>total XP/1e6</Sqrt>.
</> </>
)) ))
}, },
@ -575,7 +575,7 @@ const layer = createLayer(id, () => {
createMilestone(() => ({ createMilestone(() => ({
display: { display: {
requirement: "Noel Level 5", requirement: "Noel Level 5",
effectDisplay: "Unlock an elf that autobuys drills and extractors" effectDisplay: "Unlock an elf that autobuys metal buyables"
}, },
visibility: () => visibility: () =>
showIf(fertilizerElfMilestones[3].earned.value && main.day.value >= 13), showIf(fertilizerElfMilestones[3].earned.value && main.day.value >= 13),
@ -734,7 +734,7 @@ const layer = createLayer(id, () => {
createMilestone(() => ({ createMilestone(() => ({
display: { display: {
requirement: "Star Level 4", requirement: "Star Level 4",
effectDisplay: "Halve xp requirements" effectDisplay: "Double all elf xp gain"
}, },
visibility: () => showIf(paperElfMilestones[2].earned.value && main.day.value >= 13), visibility: () => showIf(paperElfMilestones[2].earned.value && main.day.value >= 13),
shouldEarn: () => paperElfTraining.level.value >= 4 shouldEarn: () => paperElfTraining.level.value >= 4
@ -742,7 +742,7 @@ const layer = createLayer(id, () => {
createMilestone(() => ({ createMilestone(() => ({
display: { display: {
requirement: "Star Level 5", 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), visibility: () => showIf(paperElfMilestones[3].earned.value && main.day.value >= 13),
shouldEarn: () => paperElfTraining.level.value >= 5 shouldEarn: () => paperElfTraining.level.value >= 5
@ -847,11 +847,7 @@ const layer = createLayer(id, () => {
createMilestone(() => ({ createMilestone(() => ({
display: { display: {
requirement: "Gingersnap Level 5", requirement: "Gingersnap Level 5",
effectDisplay: jsx(() => ( effectDisplay: "Unlock another row of focus upgrades"
<>
<Sqrt>Well depth</Sqrt> divides metal machine costs
</>
))
}, },
visibility: () => showIf(clothElfMilestones[3].earned.value && main.day.value >= 13), visibility: () => showIf(clothElfMilestones[3].earned.value && main.day.value >= 13),
shouldEarn: () => clothElfTraining.level.value >= 5 shouldEarn: () => clothElfTraining.level.value >= 5
@ -935,7 +931,11 @@ const layer = createLayer(id, () => {
createMilestone(() => ({ createMilestone(() => ({
display: { display: {
requirement: "Twinkle Level 5", requirement: "Twinkle Level 5",
effectDisplay: "Unlock another row of focus upgrades" effectDisplay: jsx(() => (
<>
<Sqrt>Well depth</Sqrt> divides metal machine costs
</>
))
}, },
visibility: () => showIf(metalElfMilestones[3].earned.value && main.day.value >= 13), visibility: () => showIf(metalElfMilestones[3].earned.value && main.day.value >= 13),
shouldEarn: () => metalElfTraining.level.value >= 5 shouldEarn: () => metalElfTraining.level.value >= 5
@ -1273,8 +1273,9 @@ const layer = createLayer(id, () => {
title: "Focus", title: "Focus",
description: jsx(() => ( description: jsx(() => (
<> <>
Motivate elves to focus, multiplying 3 random elves' XP gain by up to{" "} Motivate elves to focus, multiplying {formatWhole(maximumElves.value)} random
{format(focusMaxMulti.value)}x for 10 seconds, equal to the focus bar's effect. 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) ? ( {Decimal.gte(focusCooldown.value, 0) ? (
<> <>
<br /> <br />
@ -1307,8 +1308,9 @@ const layer = createLayer(id, () => {
focusTargets.value = {}; focusTargets.value = {};
const newCount = Decimal.min(count, range); const newCount = Decimal.min(count, range);
while (newCount.gt(x)) { while (newCount.gt(x)) {
const roll = Object.values(elfTraining)[Math.floor(Math.random() * range)]?.name ?? ""; const elf = Object.values(elfTraining)[Math.floor(Math.random() * range)];
if (!focusTargets.value[roll]) { const roll = elf?.name ?? "";
if (!focusTargets.value[roll] && unref(elf.visibility) === Visibility.Visible) {
focusTargets.value[roll] = true; focusTargets.value[roll] = true;
x++; x++;
} }
@ -1328,7 +1330,7 @@ const layer = createLayer(id, () => {
description: "Increase elves affected by focus by 1" description: "Increase elves affected by focus by 1"
}, },
resource: trees.logs, resource: trees.logs,
cost: 1e30 cost: 1e28
})); }));
const focusUpgrade3 = createUpgrade(() => ({ const focusUpgrade3 = createUpgrade(() => ({
display: { display: {
@ -1336,7 +1338,7 @@ const layer = createLayer(id, () => {
description: "Focus can now be rerolled every 10 seconds" description: "Focus can now be rerolled every 10 seconds"
}, },
resource: trees.logs, resource: trees.logs,
cost: 1e35 cost: 1e31
})); }));
const upgrades = [focusUpgrade1, focusUpgrade2, focusUpgrade3]; const upgrades = [focusUpgrade1, focusUpgrade2, focusUpgrade3];
const focusUpgrade4 = createUpgrade(() => ({ 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" "The bar moves slower when it's closer to the right and faster when it's closer to the left"
}, },
resource: trees.logs, resource: trees.logs,
visibility: () => showIf(elfTraining.metalElfTraining.milestones[4].earned.value), visibility: () => showIf(elfTraining.clothElfTraining.milestones[4].earned.value),
cost: 1e40 cost: 1e34
})); }));
const focusUpgrade5 = createUpgrade(() => ({ const focusUpgrade5 = createUpgrade(() => ({
display: { display: {
@ -1355,8 +1357,8 @@ const layer = createLayer(id, () => {
description: "The bar moves 2x slower" description: "The bar moves 2x slower"
}, },
resource: trees.logs, resource: trees.logs,
visibility: () => showIf(elfTraining.metalElfTraining.milestones[4].earned.value), visibility: () => showIf(elfTraining.clothElfTraining.milestones[4].earned.value),
cost: 1e45 cost: 1e35
})); }));
const focusUpgrade6 = createUpgrade(() => ({ const focusUpgrade6 = createUpgrade(() => ({
display: { display: {
@ -1364,8 +1366,8 @@ const layer = createLayer(id, () => {
description: "Focus now applies to 6 elves." description: "Focus now applies to 6 elves."
}, },
resource: trees.logs, resource: trees.logs,
visibility: () => showIf(elfTraining.metalElfTraining.milestones[4].earned.value), visibility: () => showIf(elfTraining.clothElfTraining.milestones[4].earned.value),
cost: 1e50 cost: 1e36
})); }));
const upgrades2 = [focusUpgrade4, focusUpgrade5, focusUpgrade6]; const upgrades2 = [focusUpgrade4, focusUpgrade5, focusUpgrade6];
// ------------------------------------------------------------------------------- Schools // ------------------------------------------------------------------------------- Schools
@ -1450,7 +1452,10 @@ const layer = createLayer(id, () => {
})) as GenericBuyable; })) as GenericBuyable;
const classroomCost = computed(() => { 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 { return {
wood: classroomFactor.mul(1e21), wood: classroomFactor.mul(1e21),
paper: classroomFactor.mul(1e18), paper: classroomFactor.mul(1e18),
@ -1679,7 +1684,7 @@ const layer = createLayer(id, () => {
<br /> <br />
<br /> <br />
{render(focusButton)} {render(focusButton)}
{renderGrid(upgrades)} {renderGrid(upgrades, upgrades2)}
<br /> <br />
{renderGrid( {renderGrid(
[focusMeter], [focusMeter],

View file

@ -151,7 +151,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
enabled: dyes.upgrades.redDyeUpg2.bought enabled: dyes.upgrades.redDyeUpg2.bought
})), })),
createMultiplicativeModifier(() => ({ 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", description: "Mary Level 5",
enabled: management.elfTraining.heatedPlanterElfTraining.milestones[4].earned enabled: management.elfTraining.heatedPlanterElfTraining.milestones[4].earned
})), })),
@ -181,7 +181,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({ createMultiplicativeModifier(() => ({
multiplier: () => multiplier: () =>
Decimal.add(oil.effectiveBurners.value, 1).mul(oil.oilEffectiveness.value), Decimal.add(oil.effectiveBurners.value, 1).mul(oil.oilEffectiveness.value),
description: "Blaster Burner", description: "Oil Burner",
enabled: oil.row2Upgrades[2].bought enabled: oil.row2Upgrades[2].bought
})), })),
createMultiplicativeModifier(() => ({ createMultiplicativeModifier(() => ({
@ -408,7 +408,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
let v = new Decimal(this.amount.value); let v = new Decimal(this.amount.value);
v = Decimal.pow(0.95, paper.books.metalBook.totalAmount.value).times(v); v = Decimal.pow(0.95, paper.books.metalBook.totalAmount.value).times(v);
let cost = Decimal.pow(1.15, v).times(10); 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()); cost = Decimal.div(cost, Decimal.add(oil.depth.value, 1).sqrt());
} }
if (management.elfTraining.metalElfTraining.milestones[3].earned.value) { 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) { if (management.elfTraining.metalElfTraining.milestones[3].earned.value) {
x = Decimal.mul(x, 10); 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()); x = Decimal.mul(x, Decimal.add(oil.depth.value, 1).sqrt());
} }
let v = Decimal.div(x, 10).log(1.15); 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); let v = new Decimal(this.amount.value);
v = Decimal.pow(0.95, paper.books.metalBook.totalAmount.value).times(v); v = Decimal.pow(0.95, paper.books.metalBook.totalAmount.value).times(v);
let cost = Decimal.pow(1.15, Decimal.times(v, 10)).times(10); 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()); cost = Decimal.div(cost, Decimal.add(oil.depth.value, 1).sqrt());
} }
if (management.elfTraining.metalElfTraining.milestones[3].earned.value) { 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) { if (management.elfTraining.metalElfTraining.milestones[3].earned.value) {
x = Decimal.mul(x, 10); 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()); x = Decimal.mul(x, Decimal.add(oil.depth.value, 1).sqrt());
} }
let v = Decimal.div(x, 10).log(1.15).div(10); 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); let v = new Decimal(this.amount.value);
v = Decimal.pow(0.95, paper.books.metalBook.totalAmount.value).times(v); v = Decimal.pow(0.95, paper.books.metalBook.totalAmount.value).times(v);
let cost = Decimal.pow(10, v).times(1e12); 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()); cost = Decimal.div(cost, Decimal.add(oil.depth.value, 1).sqrt());
} }
if (management.elfTraining.metalElfTraining.milestones[3].earned.value) { 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) { if (management.elfTraining.metalElfTraining.milestones[3].earned.value) {
x = Decimal.mul(x, 10); 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()); x = Decimal.mul(x, Decimal.add(oil.depth.value, 1).sqrt());
} }
let v = Decimal.div(x, 1e12).log(10); let v = Decimal.div(x, 1e12).log(10);

View file

@ -139,7 +139,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
}, },
style: { style: {
color: colorText, color: colorText,
width: "160px" width: "160px",
flexGrow: 1
} }
})) as ElfBuyable & { resource: Resource }; })) as ElfBuyable & { resource: Resource };
const { const {
@ -206,7 +207,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
}, },
style: { style: {
color: colorText, color: colorText,
width: "160px" width: "160px",
flexGrow: 1
} }
})) as ElfBuyable & { resource: Resource }; })) as ElfBuyable & { resource: Resource };
const { const {
@ -228,14 +230,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
cost() { cost() {
let v = new Decimal(this.amount.value); let v = new Decimal(this.amount.value);
if (Decimal.gte(v, 10)) v = Decimal.pow(v, 4).div(10 ** 3); 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); v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v);
return Decimal.pow(8, v).times(2e5); return Decimal.pow(8, v).times(2e5);
}, },
inverseCost(x: DecimalSource) { inverseCost(x: DecimalSource) {
let v = Decimal.div(x, 2e5).log(8); let v = Decimal.div(x, 2e5).log(8);
v = v.div(Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value)); 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); if (Decimal.gte(v, 10)) v = Decimal.mul(v, 10 ** 3).root(4);
return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
}, },
@ -263,7 +263,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
}, },
style: { style: {
color: colorText, color: colorText,
width: "160px" width: "160px",
flexGrow: 1
} }
})) as ElfBuyable & { resource: Resource }; })) as ElfBuyable & { resource: Resource };
const { const {
@ -298,7 +299,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
resource: metal.metal, resource: metal.metal,
cost() { cost() {
let v = new Decimal(this.amount.value); 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); v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v);
let price = Decimal.pow(16, v).times(2e6); let price = Decimal.pow(16, v).times(2e6);
if (row2Upgrades[4].bought.value) { 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)); x = Decimal.mul(x, Decimal.add(totalOil.value, 1).root(6));
} }
let v = Decimal.div(x, 2e6).log(16); let v = Decimal.div(x, 2e6).log(16);
v = v.div(Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value)); 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, 10)) v = Decimal.mul(v, 10 ** 3).root(4);
return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
}, },
display: jsx(() => ( display: jsx(() => (
@ -344,7 +345,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
}, },
style: { style: {
color: colorText, color: colorText,
width: "160px" width: "160px",
flexGrow: 1
} }
})) as ElfBuyable & { resource: Resource }; })) as ElfBuyable & { resource: Resource };
const { const {
@ -372,14 +374,14 @@ const layer = createLayer(id, function (this: BaseLayer) {
resource: noPersist(oil), resource: noPersist(oil),
cost() { cost() {
let v = new Decimal(this.amount.value); 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); v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v);
return Decimal.pow(2, v).times(50); return Decimal.pow(2, v).times(50);
}, },
inverseCost(x: DecimalSource) { inverseCost(x: DecimalSource) {
let v = Decimal.div(x, 50).log(2); let v = Decimal.div(x, 50).log(2);
v = v.div(Decimal.pow(0.95, paper.books.oilBook.totalAmount.value)); 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); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
}, },
display: jsx(() => ( display: jsx(() => (
@ -412,7 +414,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
}, },
style: { style: {
color: colorText, color: colorText,
width: "160px" width: "160px",
flexGrow: 1
} }
})) as ElfBuyable & { resource: Resource }; })) as ElfBuyable & { resource: Resource };
const { const {
@ -472,7 +475,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
}, },
style: { style: {
color: colorText, color: colorText,
width: "160px" width: "160px",
flexGrow: 1
} }
})) as ElfBuyable & { resource: Resource }; })) as ElfBuyable & { resource: Resource };
@ -732,7 +736,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
const row3Upgrades = [ const row3Upgrades = [
createUpgrade(() => ({ createUpgrade(() => ({
resource: noPersist(oil), resource: noPersist(oil),
cost: 1e11, cost: 1e13,
display: { display: {
title: "Dye Synergy I", title: "Dye Synergy I",
description: "Red dye boosts yellow dye gain *(log(x)^0.75)" description: "Red dye boosts yellow dye gain *(log(x)^0.75)"
@ -743,7 +747,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
})), })),
createUpgrade(() => ({ createUpgrade(() => ({
resource: noPersist(oil), resource: noPersist(oil),
cost: 1e12, cost: 1e14,
display: { display: {
title: "Orange-colored boxes", title: "Orange-colored boxes",
description: "Orange dye's 2nd effect is raised to the 2.5" description: "Orange dye's 2nd effect is raised to the 2.5"
@ -754,7 +758,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
})), })),
createUpgrade(() => ({ createUpgrade(() => ({
resource: noPersist(oil), resource: noPersist(oil),
cost: 1e13, cost: 1e15,
display: { display: {
title: "Colorful Focus", title: "Colorful Focus",
description: "Sum of secondary dyes increases max focus multiplier by cbrt(x)" description: "Sum of secondary dyes increases max focus multiplier by cbrt(x)"
@ -765,7 +769,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
})), })),
createUpgrade(() => ({ createUpgrade(() => ({
resource: noPersist(oil), resource: noPersist(oil),
cost: 1e14, cost: 1e16,
display: { display: {
title: "Dye Synergy II", title: "Dye Synergy II",
description: "Blue dye boosts red dye gain *log(x)" description: "Blue dye boosts red dye gain *log(x)"
@ -776,7 +780,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
})), })),
createUpgrade(() => ({ createUpgrade(() => ({
resource: noPersist(oil), resource: noPersist(oil),
cost: 1e15, cost: 1e17,
display: { display: {
title: "The Ultimate Metal Dye", title: "The Ultimate Metal Dye",
description: "Sum of primary dyes boosts auto smelt speed" description: "Sum of primary dyes boosts auto smelt speed"

View file

@ -19,7 +19,7 @@ import { createMultiplicativeModifier, createSequentialModifier, Modifier } from
import { noPersist } from "game/persistence"; import { noPersist } from "game/persistence";
import Decimal, { DecimalSource, format, formatSmall, formatWhole } from "util/bignum"; import Decimal, { DecimalSource, format, formatSmall, formatWhole } from "util/bignum";
import { WithRequired } from "util/common"; 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 { computed, ComputedRef, ref, unref } from "vue";
import cloth from "./cloth"; import cloth from "./cloth";
import coal from "./coal"; import coal from "./coal";
@ -125,8 +125,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
scaling--; scaling--;
} }
let cost = Decimal.pow(scaling, v).times(10); let cost = Decimal.pow(scaling, v).times(10);
if(["Peppermint", "Twinkle", "Cocoa", "Frosty"].includes(options.elfName)){ if (["Peppermint", "Twinkle", "Cocoa", "Frosty"].includes(options.elfName)) {
cost = cost.mul(1e31) cost = cost.mul(1e31);
} }
if (management.elfTraining.paperElfTraining.milestones[0].earned.value) { if (management.elfTraining.paperElfTraining.milestones[0].earned.value) {
cost = Decimal.div(cost, sumBooks.value.max(1)); cost = Decimal.div(cost, sumBooks.value.max(1));
@ -149,9 +149,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
scaling--; scaling--;
} }
let v = Decimal.div(x, 10) let v = Decimal.div(x, 10);
if(["Peppermint", "Twinkle", "Cocoa", "Frosty"].includes(options.elfName)){ if (["Peppermint", "Twinkle", "Cocoa", "Frosty"].includes(options.elfName)) {
v = v.div(1e31) v = v.div(1e31);
} }
v = v.log(scaling); v = v.log(scaling);
@ -165,8 +165,23 @@ const layer = createLayer(id, function (this: BaseLayer) {
}, },
style: "width: 600px", style: "width: 600px",
freeLevels: computed(() => freeLevels: computed(() =>
management.elfTraining.paperElfTraining.milestones[4].earned.value management.elfTraining.paperElfTraining.milestones[4].earned.value &&
? Decimal.times(5, management.level5Elves.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 : 0
), ),
totalAmount: computed(() => Decimal.add(buyable.amount.value, buyable.freeLevels.value)) 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", name: "Drills and Mills",
elfName: "Peppermint", elfName: "Peppermint",
buyableName: "Coal Drill", buyableName: "Coal Drill",
visibility: () => visibility: () => showIf(elves.elves.coalDrillElf.bought.value)
showIf(management.elfTraining.expandersElfTraining.milestones[3].earned.value)
}); });
const heavyDrillBook = createBook({ const heavyDrillBook = createBook({
name: "Deep in the Earth", name: "Deep in the Earth",
elfName: "Frosty", elfName: "Frosty",
buyableName: "Oil Drills", buyableName: "Oil Drills",
visibility: () => visibility: () => showIf(elves.elves.heavyDrillElf.bought.value)
showIf(management.elfTraining.fertilizerElfTraining.milestones[4].earned.value)
}); });
const oilBook = createBook({ const oilBook = createBook({
name: "Burning the Midnight Oil", name: "Burning the Midnight Oil",
elfName: "Cocoa", elfName: "Cocoa",
buyableName: "Oil-Consuming Machines", buyableName: "Oil-Consuming Machines",
visibility: () => visibility: () => showIf(elves.elves.oilElf.bought.value)
showIf(management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value)
}); });
const metalBook = createBook({ const metalBook = createBook({
name: "Physical Metallurgy", name: "Physical Metallurgy",
elfName: "Twinkle", elfName: "Twinkle",
buyableName: "Metal Buyables", buyableName: "Metal Buyables",
visibility: () => visibility: () => showIf(elves.elves.metalElf.bought.value)
showIf(management.elfTraining.expandersElfTraining.milestones[4].earned.value)
}); });
const dyeBook = createBook({ const dyeBook = createBook({
name: "Arts and Crafts", name: "Arts and Crafts",
@ -341,7 +352,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
})) as GenericUpgrade; })) as GenericUpgrade;
const bookUpgrade = createUpgrade(() => ({ const bookUpgrade = createUpgrade(() => ({
resource: noPersist(paper), resource: noPersist(paper),
cost: 1e40, cost: 1e38,
visibility: () => visibility: () =>
showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value), showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value),
display: { display: {
@ -351,7 +362,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
})); }));
const classroomUpgrade = createUpgrade(() => ({ const classroomUpgrade = createUpgrade(() => ({
resource: noPersist(paper), resource: noPersist(paper),
cost: 1e44, cost: 1e40,
visibility: () => visibility: () =>
showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value), showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value),
display: { display: {
@ -475,7 +486,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
<Spacer /> <Spacer />
{render(makePaper)} {render(makePaper)}
<Spacer /> <Spacer />
{renderRow(...Object.values(upgrades))} {renderGrid(Object.values(upgrades), Object.values(upgrades2))}
<Spacer /> <Spacer />
{renderCol(...Object.values(books))} {renderCol(...Object.values(books))}
</> </>

View file

@ -278,7 +278,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
enabled: workshop.milestones.extraExpansionMilestone4.earned enabled: workshop.milestones.extraExpansionMilestone4.earned
})), })),
createMultiplicativeModifier(() => ({ createMultiplicativeModifier(() => ({
multiplier: () => Decimal.add(oil.buildExtractor.amount.value, 1), multiplier: () => Decimal.add(oil.buildExtractor.amount.value, 1).pow(1.25),
description: "Snowball Level 4", description: "Snowball Level 4",
enabled: management.elfTraining.kilnElfTraining.milestones[3].earned enabled: management.elfTraining.kilnElfTraining.milestones[3].earned
})) }))

View file

@ -434,7 +434,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
enabled: management.elfTraining.planterElfTraining.milestones[0].earned enabled: management.elfTraining.planterElfTraining.milestones[0].earned
})), })),
createMultiplicativeModifier(() => ({ 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", description: "Ivy Level 3",
enabled: management.elfTraining.planterElfTraining.milestones[2].earned enabled: management.elfTraining.planterElfTraining.milestones[2].earned
})), })),
@ -541,8 +541,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
width: 100, width: 100,
height: 10, height: 10,
style: "margin-top: 8px", style: "margin-top: 8px",
baseStyle: "margin-top: 0", baseStyle: "margin-top: -1px",
fillStyle: "margin-top: 0; transition-duration: 0s", fillStyle: "margin-top: -1px; transition-duration: 0s",
progress: () => Decimal.div(manualCutProgress.value, computedManualCuttingCooldown.value) progress: () => Decimal.div(manualCutProgress.value, computedManualCuttingCooldown.value)
})); }));
@ -593,8 +593,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
width: 100, width: 100,
height: 10, height: 10,
style: "margin-top: 8px", style: "margin-top: 8px",
baseStyle: "margin-top: 0", baseStyle: "margin-top: -1px",
fillStyle: "margin-top: 0; transition-duration: 0s", fillStyle: "margin-top: -1px; transition-duration: 0s",
progress: () => Decimal.div(manualPlantProgress.value, computedManualPlantingCooldown.value) progress: () => Decimal.div(manualPlantProgress.value, computedManualPlantingCooldown.value)
})); }));
const plantTree = createClickable(() => ({ const plantTree = createClickable(() => ({
@ -735,8 +735,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
computedAutoCuttingAmount.value, computedAutoCuttingAmount.value,
Decimal.sub(lastAutoPlantedAmount.value, lastAutoCuttingAmount.value).max(0) Decimal.sub(lastAutoPlantedAmount.value, lastAutoCuttingAmount.value).max(0)
); );
lastAutoPlantedAmount.value = plantingAmount; lastAutoPlantedAmount.value = Decimal.isNaN(plantingAmount) ? 0 : plantingAmount;
lastAutoCuttingAmount.value = cuttingAmount; lastAutoCuttingAmount.value = Decimal.isNaN(cuttingAmount) ? 0 : cuttingAmount;
const amountCut = Decimal.min( const amountCut = Decimal.min(
trees.value, trees.value,

View file

@ -3,14 +3,13 @@ import type { CoercableComponent } from "features/feature";
import { jsx } from "features/feature"; import { jsx } from "features/feature";
import settings from "game/settings"; import settings from "game/settings";
import type { DecimalSource } from "util/bignum"; 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 { WithRequired } from "util/common";
import type { Computable, ProcessedComputable } from "util/computed"; import type { Computable, ProcessedComputable } from "util/computed";
import { convertComputable } from "util/computed"; import { convertComputable } from "util/computed";
import { createLazyProxy } from "util/proxies"; import { createLazyProxy } from "util/proxies";
import { renderJSX } from "util/vue"; import { renderJSX } from "util/vue";
import { computed, unref } from "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. * An object that can be used to apply or unapply some modification to a number.
@ -87,7 +86,7 @@ export function createAdditiveModifier<T extends AdditiveModifierOptions>(
) : null} ) : null}
<span class="modifier-amount"> <span class="modifier-amount">
{Decimal.gte(unref(processedAddend), 0) ? "+" : ""} {Decimal.gte(unref(processedAddend), 0) ? "+" : ""}
{format(unref(processedAddend))} {formatSmall(unref(processedAddend))}
</span> </span>
</div> </div>
)) ))
@ -134,7 +133,7 @@ export function createMultiplicativeModifier<T extends MultiplicativeModifierOpt
</span> </span>
) : null} ) : null}
<span class="modifier-amount"> <span class="modifier-amount">
×{format(unref(processedMultiplier))} ×{formatSmall(unref(processedMultiplier))}
</span> </span>
</div> </div>
)) ))
@ -204,7 +203,7 @@ export function createExponentialModifier<T extends ExponentialModifierOptions>(
</span> </span>
) : null} ) : null}
<span class="modifier-amount"> <span class="modifier-amount">
^{format(unref(processedExponent))} ^{formatSmall(unref(processedExponent))}
</span> </span>
</div> </div>
)) ))
@ -274,7 +273,7 @@ export function createModifierSection(
baseText: CoercableComponent = "Base" baseText: CoercableComponent = "Base"
) { ) {
return ( return (
<div style={{"--unit": settings.alignUnits ? "'" + unit + "'" : ""}}> <div style={{ "--unit": settings.alignUnits ? "'" + unit + "'" : "" }}>
<h3> <h3>
{title} {title}
{subtitle ? <span class="subtitle"> ({subtitle})</span> : null} {subtitle ? <span class="subtitle"> ({subtitle})</span> : null}
@ -283,7 +282,7 @@ export function createModifierSection(
<div class="modifier-container"> <div class="modifier-container">
<span class="modifier-description">{renderJSX(baseText)}</span> <span class="modifier-description">{renderJSX(baseText)}</span>
<span class="modifier-amount"> <span class="modifier-amount">
{format(base)} {formatSmall(base)}
{unit} {unit}
</span> </span>
</div> </div>
@ -292,7 +291,7 @@ export function createModifierSection(
<div class="modifier-container"> <div class="modifier-container">
<span class="modifier-description">Total</span> <span class="modifier-description">Total</span>
<span class="modifier-amount"> <span class="modifier-amount">
{format(modifier.apply(base))} {formatSmall(modifier.apply(base))}
{unit} {unit}
</span> </span>
</div> </div>