This commit is contained in:
thepaperpilot 2022-12-12 22:26:52 -06:00
parent e181b2b533
commit 49198eb746
3 changed files with 131 additions and 54 deletions

View file

@ -329,23 +329,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
enabled: elvesMilestone2.earned enabled: elvesMilestone2.earned
})) }))
]); ]);
const metalCooldown = createSequentialModifier(() => [
createMultiplicativeModifier(() => ({
multiplier: 2,
description: "6 Elves Trained",
enabled: elvesMilestone.earned
})),
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.times(paper.books.metalBook.amount.value, 0.1).add(1),
description: "Physical Metallurgy",
enabled: () => Decimal.gt(paper.books.metalBook.amount.value, 0)
})),
createMultiplicativeModifier(() => ({
multiplier: 2,
description: "10 Elves Trained",
enabled: elvesMilestone2.earned
}))
]);
const heavyDrillCooldown = createSequentialModifier(() => [ const heavyDrillCooldown = createSequentialModifier(() => [
createMultiplicativeModifier(() => ({ createMultiplicativeModifier(() => ({
multiplier: 2, multiplier: 2,
@ -363,6 +346,40 @@ const layer = createLayer(id, function (this: BaseLayer) {
enabled: elvesMilestone2.earned enabled: elvesMilestone2.earned
})) }))
]); ]);
const oilCooldown = createSequentialModifier(() => [
createMultiplicativeModifier(() => ({
multiplier: 2,
description: "6 Elves Trained",
enabled: elvesMilestone.earned
})),
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.times(paper.books.oilBook.amount.value, 0.1).add(1),
description: "Burning the Midnight Oil",
enabled: () => Decimal.gt(paper.books.oilBook.amount.value, 0)
})),
createMultiplicativeModifier(() => ({
multiplier: 2,
description: "10 Elves Trained",
enabled: elvesMilestone2.earned
}))
]);
const metalCooldown = createSequentialModifier(() => [
createMultiplicativeModifier(() => ({
multiplier: 2,
description: "6 Elves Trained",
enabled: elvesMilestone.earned
})),
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.times(paper.books.metalBook.amount.value, 0.1).add(1),
description: "Physical Metallurgy",
enabled: () => Decimal.gt(paper.books.metalBook.amount.value, 0)
})),
createMultiplicativeModifier(() => ({
multiplier: 2,
description: "10 Elves Trained",
enabled: elvesMilestone2.earned
}))
]);
const [generalTab, generalTabCollapsed] = createCollapsibleModifierSections(() => [ const [generalTab, generalTabCollapsed] = createCollapsibleModifierSections(() => [
{ {
@ -456,19 +473,26 @@ const layer = createLayer(id, function (this: BaseLayer) {
unit: "/s", unit: "/s",
visible: management.elfTraining.expandersElfTraining.milestones[3].earned visible: management.elfTraining.expandersElfTraining.milestones[3].earned
}, },
{
title: "Frosty Auto-Buy Frequency",
modifier: heavyDrillCooldown,
base: 10,
unit: "/s",
visible: management.elfTraining.fertilizerElfTraining.milestones[4].earned.value
},
{
title: "Cocoa Auto-Buy Frequency",
modifier: oilCooldown,
base: 10,
unit: "/s",
visible: management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value
},
{ {
title: "Twinkle Auto-Buy Frequency", title: "Twinkle Auto-Buy Frequency",
modifier: metalCooldown, modifier: metalCooldown,
base: 10, base: 10,
unit: "/s", unit: "/s",
visible: management.elfTraining.expandersElfTraining.milestones[4].earned visible: management.elfTraining.expandersElfTraining.milestones[4].earned
},
{
title: "Frosty Auto-Buy Frequency",
modifier: heavyDrillCooldown,
base: 10,
unit: "/s",
visible: management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value
} }
]); ]);
const showModifiersModal = ref(false); const showModifiersModal = ref(false);
@ -751,15 +775,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
} }
} }
}); });
const metalElf = createElf({
name: "Twinkle",
description:
"Twinkle will automatically purchase all metal buyables you can afford, without actually spending any resources.",
buyable: [metal.oreDrill, metal.industrialCrucible, metal.hotterForge],
cooldownModifier: metalCooldown,
visibility: () =>
showIf(management.elfTraining.expandersElfTraining.milestones[4].earned.value)
});
const heavyDrillElf = createElf({ const heavyDrillElf = createElf({
name: "Frosty", name: "Frosty",
description: description:
@ -767,7 +782,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.heatedCutterElfTraining.milestones[4].earned.value), showIf(management.elfTraining.fertilizerElfTraining.milestones[4].earned.value),
hasToggle: true, hasToggle: true,
toggleDesc: "Activate auto-purchased oil drills", toggleDesc: "Activate auto-purchased oil drills",
onAutoPurchase(buyable) { onAutoPurchase(buyable) {
@ -782,7 +797,39 @@ const layer = createLayer(id, function (this: BaseLayer) {
} }
} }
}); });
const managementElves = [miningDrillElf, metalElf, heavyDrillElf]; const oilElf = createElf({
name: "Cocoa",
description:
"Cocoa will automatically purchase all oil-using machines you can afford, without actually spending any resources.",
buyable: [oil.buildPump, oil.buildBurner, oil.buildSmelter],
cooldownModifier: oilCooldown,
visibility: () =>
showIf(management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value),
hasToggle: true,
toggleDesc: "Activate auto-purchased oil-using machines",
onAutoPurchase(buyable) {
if (heavyDrillElf.toggle.value) {
if (buyable === oil.buildPump) {
oil.activePump.value = Decimal.add(oil.activePump.value, 1);
} else if (buyable === oil.buildBurner) {
oil.activeBurner.value = Decimal.add(oil.activeBurner.value, 1);
} else if (buyable === oil.buildSmelter) {
oil.activeSmelter.value = Decimal.add(oil.activeSmelter.value, 1);
}
}
}
});
const managementElves = [miningDrillElf, heavyDrillElf, oilElf];
const metalElf = createElf({
name: "Twinkle",
description:
"Twinkle will automatically purchase all metal buyables you can afford, without actually spending any resources.",
buyable: [metal.oreDrill, metal.industrialCrucible, metal.hotterForge],
cooldownModifier: metalCooldown,
visibility: () =>
showIf(management.elfTraining.expandersElfTraining.milestones[4].earned.value)
});
const managementElves2 = [metalElf];
const elves = { const elves = {
cuttersElf, cuttersElf,
plantersElf, plantersElf,
@ -797,8 +844,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
boxElf, boxElf,
clothElf, clothElf,
miningDrillElf, miningDrillElf,
metalElf, heavyDrillElf,
heavyDrillElf oilElf,
metalElf
}; };
const totalElves = computed(() => Object.values(elves).filter(elf => elf.bought.value).length); const totalElves = computed(() => Object.values(elves).filter(elf => elf.bought.value).length);
@ -978,7 +1026,14 @@ const layer = createLayer(id, function (this: BaseLayer) {
{render(modifiersModal)} {render(modifiersModal)}
<Spacer /> <Spacer />
<div style="width: 600px"> <div style="width: 600px">
{renderGrid(treesElves, coalElves, fireElves, plasticElves, managementElves)} {renderGrid(
treesElves,
coalElves,
fireElves,
plasticElves,
managementElves,
managementElves2
)}
</div> </div>
{milestonesDisplay()} {milestonesDisplay()}
</> </>

View file

@ -407,7 +407,7 @@ const layer = createLayer(id, () => {
createMilestone(() => ({ createMilestone(() => ({
display: { display: {
requirement: "Jack Level 5", requirement: "Jack Level 5",
effectDisplay: "Unlock an elf that autobuys oil buyables." effectDisplay: "Unlock an elf that autobuys oil-using machines."
}, },
visibility: () => visibility: () =>
showIf(heatedCutterElfMilestones[3].earned.value && main.day.value >= 13), showIf(heatedCutterElfMilestones[3].earned.value && main.day.value >= 13),

View file

@ -38,7 +38,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
const paper = createResource<DecimalSource>(0, "paper"); const paper = createResource<DecimalSource>(0, "paper");
const pulp = createResource<DecimalSource>( const pulp = createResource<DecimalSource>(
computed(() => Decimal.min(Decimal.div(trees.logs.value, 1e9), Decimal.div(coal.ash.value, computedAshCost.value))), computed(() =>
Decimal.min(
Decimal.div(trees.logs.value, 1e9),
Decimal.div(coal.ash.value, computedAshCost.value)
)
),
"pulp" "pulp"
); );
@ -49,7 +54,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
roundUpCost: true, roundUpCost: true,
spend(gain, cost) { spend(gain, cost) {
trees.logs.value = Decimal.sub(trees.logs.value, Decimal.times(cost, 1e9)); trees.logs.value = Decimal.sub(trees.logs.value, Decimal.times(cost, 1e9));
coal.ash.value = Decimal.sub(coal.ash.value, Decimal.times(cost, computedAshCost.value)); coal.ash.value = Decimal.sub(
coal.ash.value,
Decimal.times(cost, computedAshCost.value)
);
}, },
gainModifier: paperGain gainModifier: paperGain
})); }));
@ -68,7 +76,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
<span style="font-size: large"> <span style="font-size: large">
Cost: {displayResource(trees.logs, cost)} {pulp.displayName} ( Cost: {displayResource(trees.logs, cost)} {pulp.displayName} (
{formatWhole(Decimal.times(cost, 1e9))} {trees.logs.displayName};{" "} {formatWhole(Decimal.times(cost, 1e9))} {trees.logs.displayName};{" "}
{formatWhole(Decimal.times(cost, computedAshCost.value))} {coal.ash.displayName}) {formatWhole(Decimal.times(cost, computedAshCost.value))}{" "}
{coal.ash.displayName})
</span> </span>
</> </>
); );
@ -191,19 +200,29 @@ const layer = createLayer(id, function (this: BaseLayer) {
name: "Drills and Mills", name: "Drills and Mills",
elfName: "Peppermint", elfName: "Peppermint",
buyableName: "Mining Drill", buyableName: "Mining Drill",
visibility: () => showIf(management.elfTraining.expandersElfTraining.milestones[3].earned.value) visibility: () =>
}); showIf(management.elfTraining.expandersElfTraining.milestones[3].earned.value)
const metalBook = createBook({
name: "Physical Metallurgy",
elfName: "Twinkle",
buyableName: "Metal Buyables",
visibility: () => showIf(management.elfTraining.expandersElfTraining.milestones[4].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: () => showIf(management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value) visibility: () =>
showIf(management.elfTraining.fertilizerElfTraining.milestones[4].earned.value)
});
const oilBook = createBook({
name: "Burning the Midnight Oil",
elfName: "Cocoa",
buyableName: "Oil-Consuming Machines",
visibility: () =>
showIf(management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value)
});
const metalBook = createBook({
name: "Physical Metallurgy",
elfName: "Twinkle",
buyableName: "Metal Buyables",
visibility: () =>
showIf(management.elfTraining.expandersElfTraining.milestones[4].earned.value)
}); });
const books = { const books = {
cuttersBook, cuttersBook,
@ -219,10 +238,13 @@ const layer = createLayer(id, function (this: BaseLayer) {
boxBook, boxBook,
clothBook, clothBook,
miningDrillBook, miningDrillBook,
metalBook, heavyDrillBook,
heavyDrillBook oilBook,
metalBook
}; };
const sumBooks = computed(() => Object.values(books).reduce((acc, curr) => acc.add(curr.amount.value), new Decimal(0))); const sumBooks = computed(() =>
Object.values(books).reduce((acc, curr) => acc.add(curr.amount.value), new Decimal(0))
);
const clothUpgrade = createUpgrade(() => ({ const clothUpgrade = createUpgrade(() => ({
resource: noPersist(paper), resource: noPersist(paper),
@ -282,7 +304,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
]) as WithRequired<Modifier, "description" | "revert">; ]) as WithRequired<Modifier, "description" | "revert">;
const ashCost = createSequentialModifier(() => [ const ashCost = createSequentialModifier(() => [
createMultiplicativeModifier(() => ({ createMultiplicativeModifier(() => ({
multiplier: .1, multiplier: 0.1,
description: "Star Level 2", description: "Star Level 2",
enabled: management.elfTraining.paperElfTraining.milestones[1].earned enabled: management.elfTraining.paperElfTraining.milestones[1].earned
})) }))