This commit is contained in:
thepaperpilot 2022-12-24 10:19:27 -06:00
parent ad00101b8d
commit 8e6ba89928

View file

@ -21,7 +21,7 @@ import oil from "./oil";
import { createCollapsibleMilestones } from "data/common";
import { globalBus } from "game/events";
import { createUpgrade } from "features/upgrades/upgrade";
import { ElfBuyable } from "./elves";
import elves, { ElfBuyable } from "./elves";
import management from "./management";
import paper from "./paper";
import ModalVue from "components/Modal.vue";
@ -77,6 +77,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
</>
))
},
style: "min-height: 40px",
visibility: () => showIf(Decimal.gt(remainingSize.value, 0)),
canClick: () => Decimal.gte(packingProgress.value, 1),
onClick() {
@ -102,11 +103,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
});
const packedPresentsSize = computed(() =>
Decimal.times(packedPresents.value, 0.008).dividedBy(packingDensity.value)
);
const currentMaxPresents = computed(() =>
Decimal.times(sledSpace, packingDensity.value).div(0.008)
Decimal.div(packedPresents.value, packingDensity.value)
);
const currentMaxPresents = computed(() => Decimal.times(sledSpace, packingDensity.value));
const remainingSize = computed(() => Decimal.sub(sledSpace, packedPresentsSize.value));
const elfPackingSpeed = createSequentialModifier(() => [
@ -163,8 +162,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
}))
]);
const computedLoaderPackingSpeed = computed(() => loaderPackingSpeed.apply(1000));
const helpers = {
elf: createBuyable(() => ({
const elf = createBuyable(() => ({
visibility: () => showIf(Decimal.gte(totalPresents.value, 10)),
cost() {
let v = this.amount.value;
@ -204,8 +202,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
style: {
width: "200px"
}
})),
loader: createBuyable(() => ({
})) as ElfBuyable;
const loader = createBuyable(() => ({
visibility: () => showIf(upgrades.loaderUnlock.bought.value),
metalCost: computed(() => Decimal.pow(1.2, helpers.loader.amount.value).times(1e70)),
oilCost: computed(() => Decimal.pow(1.2, helpers.loader.amount.value).times(1e25)),
@ -245,10 +243,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
<br />
Currently packing{" "}
{format(
Decimal.times(
helpers.loader.amount.value,
computedLoaderPackingSpeed.value
)
Decimal.times(helpers.loader.amount.value, computedLoaderPackingSpeed.value)
)}{" "}
persents per second
</div>
@ -266,27 +261,28 @@ const layer = createLayer(id, function (this: BaseLayer) {
style: {
width: "200px"
}
}))
} as {
elf: ElfBuyable;
loader: ElfBuyable & {
})) as ElfBuyable & {
metalCost: ComputedRef<DecimalSource>;
oilCost: ComputedRef<DecimalSource>;
};
};
const helpers = { elf, loader };
const upgrades = {
packingElf: createUpgrade(() => ({
display: {
title: "An Elf's Elf",
description: "Hire an Elf to help you hire more Elves."
description: "Train an Elf to help you hire more Elves."
},
cost: 1000,
resource: totalPresentsResource,
style: {
width: "200px"
},
visibility: () => showIf(Decimal.gte(helpers.elf.amount.value, 10))
visibility: () => showIf(Decimal.gte(helpers.elf.amount.value, 10)),
onPurchase() {
main.days[3].recentlyUpdated.value = true;
elves.elves.packingElf.bought.value = true;
}
})),
loaderUnlock: createUpgrade(() => ({
display: {
@ -303,10 +299,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
}))
};
const resetButton = createClickable(() => ({
display: jsx(() => <>Oh no! You've run out of room for presents! You'll need to take</>)
}));
const packingMilestones: Record<string, GenericMilestone> = {
logBoost: createMilestone(() => ({
display: {
@ -382,7 +374,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
ribbonBoost: createMilestone(() => ({
display: {
requirement: `8,230,000 ${packedPresents.displayName}`,
effectDisplay: "Halve ribbon cost"
effectDisplay: "Halve ribbon's dye cost"
},
shouldEarn: () => Decimal.gte(packedPresents.value, 8230000),
visibility: () => showIf(packingMilestones.oreBoost.earned.value)
@ -499,6 +491,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
packingMilestones,
collapseMilestones,
generalTabCollapsed,
minWidth: 700,
display: jsx(() => (
<>
{render(trackerDisplay)}