Updated AI to use repeatables instead of buyables

This commit is contained in:
thepaperpilot 2023-02-14 13:24:21 -06:00
parent 5a4bb43814
commit 7000d4898c
19 changed files with 107 additions and 107 deletions

View file

@ -1,7 +1,7 @@
import Collapsible from "components/layout/Collapsible.vue";
import "data/layers/styles/day-gradients.css";
import { createBar } from "features/bars/bar";
import { GenericBuyable } from "features/buyable";
import { GenericRepeatable } from "features/repeatable";
import type { Clickable, ClickableOptions, GenericClickable } from "features/clickables/clickable";
import { createClickable } from "features/clickables/clickable";
import type { GenericConversion } from "features/conversion";
@ -534,7 +534,7 @@ export function setUpDailyProgressTracker(options: {
export function changeActiveBuyables(options: {
style?: StyleValue;
active: Persistent<DecimalSource>;
buyable: GenericBuyable;
buyable: GenericRepeatable;
}) {
const style = options.style ?? { minHeight: "20px", width: "40px", color: "var(--foreground)" };
const min = createClickable(() => ({

View file

@ -6,7 +6,7 @@ import Spacer from "components/layout/Spacer.vue";
import Modal from "components/Modal.vue";
import { createCollapsibleModifierSections, setUpDailyProgressTracker } from "data/common";
import { main } from "data/projEntry";
import { createBuyable } from "features/buyable";
import { createRepeatable } from "features/repeatable";
import { createClickable } from "features/clickables/clickable";
import { createCumulativeConversion, createPolynomialScaling } from "features/conversion";
import { jsx, showIf } from "features/feature";
@ -230,7 +230,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
})) as GenericUpgrade;
const row3Upgrades = { clothUpgrade, dyeUpgrade, xpUpgrade };
const logBoxesBuyable = createBuyable(() => ({
const logBoxesBuyable = createRepeatable(() => ({
display: {
title: "Carry more logs",
description: jsx(() => (
@ -300,7 +300,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
Decimal.add(logBoxesBuyable.amount.value, logBoxesBuyable.freeLevels.value)
)
})) as BoxesBuyable;
const ashBoxesBuyable = createBuyable(() => ({
const ashBoxesBuyable = createRepeatable(() => ({
display: {
title: "Carry more ash",
description: jsx(() => (
@ -364,7 +364,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
Decimal.add(ashBoxesBuyable.amount.value, ashBoxesBuyable.freeLevels.value)
)
})) as BoxesBuyable;
const coalBoxesBuyable = createBuyable(() => ({
const coalBoxesBuyable = createRepeatable(() => ({
display: {
title: "Carry more coal",
description: jsx(() => (
@ -429,7 +429,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
)
})) as BoxesBuyable;
const buyables = { logBoxesBuyable, ashBoxesBuyable, coalBoxesBuyable };
const oreBoxesBuyable = createBuyable(() => ({
const oreBoxesBuyable = createRepeatable(() => ({
display: {
title: "Carry more ore",
description: jsx(() => (
@ -499,7 +499,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
Decimal.add(oreBoxesBuyable.amount.value, oreBoxesBuyable.freeLevels.value)
)
})) as BoxesBuyable;
const metalBoxesBuyable = createBuyable(() => ({
const metalBoxesBuyable = createRepeatable(() => ({
display: {
title: "Carry more metal",
description: jsx(() => (
@ -563,7 +563,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
Decimal.add(metalBoxesBuyable.amount.value, metalBoxesBuyable.freeLevels.value)
)
})) as BoxesBuyable;
const plasticBoxesBuyable = createBuyable(() => ({
const plasticBoxesBuyable = createRepeatable(() => ({
display: {
title: "Carry more plastic",
description: jsx(() => (
@ -627,7 +627,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
Decimal.add(plasticBoxesBuyable.amount.value, plasticBoxesBuyable.freeLevels.value)
)
})) as BoxesBuyable;
const presentBuyable = createBuyable(() => ({
const presentBuyable = createRepeatable(() => ({
display: {
title: "Carry presents in boxes",
description: jsx(() => (

View file

@ -9,7 +9,7 @@ import Modal from "components/Modal.vue";
import { createCollapsibleModifierSections, setUpDailyProgressTracker } from "data/common";
import { main } from "data/projEntry";
import { createBar } from "features/bars/bar";
import { createBuyable } from "features/buyable";
import { createRepeatable } from "features/repeatable";
import { createClickable } from "features/clickables/clickable";
import { jsx, showIf } from "features/feature";
import { createHotkey } from "features/hotkey";
@ -240,7 +240,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
enabled: noPersist(main.days[day - 1].opened)
}));
const buildPens = createBuyable(() => ({
const buildPens = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: trees.logs,
cost() {
@ -263,7 +263,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
})) as ElfBuyable;
const betterShears = createBuyable(() => ({
const betterShears = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: metal.metal,
cost() {
@ -286,7 +286,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
})) as ElfBuyable;
const fasterSpinning = createBuyable(() => ({
const fasterSpinning = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: paper.paper,
cost() {

View file

@ -12,7 +12,7 @@ import {
setUpDailyProgressTracker
} from "data/common";
import { main } from "data/projEntry";
import { createBuyable } from "features/buyable";
import { createRepeatable } from "features/repeatable";
import { jsx, showIf } from "features/feature";
import MainDisplay from "features/resources/MainDisplay.vue";
import { createResource, Resource } from "features/resources/resource";
@ -75,7 +75,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
v = Decimal.pow(0.95, paper.books.smallFireBook.totalAmount.value).times(v);
return v.pow(masteryEffectActive.value ? 1.1 : 1.5).times(1e4);
});
const buildFire = createBuyable(() => ({
const buildFire = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: trees.logs,
cost: fireCost
@ -141,7 +141,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
return gain;
});
const buildBonfire = createBuyable(() => ({
const buildBonfire = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: fireResource,
cost() {
@ -215,7 +215,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
1e7
);
});
const buildKiln = createBuyable(() => ({
const buildKiln = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: trees.logs,
cost: kilnCost
@ -288,7 +288,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
return cost;
});
const buildDrill = createBuyable(() => ({
const buildDrill = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: metal.metal,
cost: drillCost
@ -521,7 +521,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
}));
const row3upgrades = [efficientSmelther, arsonistAssistance, refinedCoal, coloredFire];
const heatedCutters = createBuyable(() => ({
const heatedCutters = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(coal),
cost() {
@ -559,7 +559,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
style: { color: colorText },
visibility: () => showIf(warmerCutters.bought.value)
})) as ElfBuyable & { display: { title: string }; resource: Resource };
const heatedPlanters = createBuyable(() => ({
const heatedPlanters = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(coal),
cost() {
@ -599,7 +599,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
style: { color: colorText },
visibility: () => showIf(warmerPlanters.bought.value)
})) as ElfBuyable & { display: { title: string }; resource: Resource };
const moreFertilizer = createBuyable(() => ({
const moreFertilizer = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(ash),
cost() {

View file

@ -7,7 +7,7 @@ import Spacer from "components/layout/Spacer.vue";
import Sqrt from "components/math/Sqrt.vue";
import Modal from "components/Modal.vue";
import { createCollapsibleModifierSections, setUpDailyProgressTracker } from "data/common";
import { BuyableOptions, createBuyable } from "features/buyable";
import { RepeatableOptions, createRepeatable } from "features/repeatable";
import { jsx, JSXFunction, showIf, Visibility } from "features/feature";
import { createHotkey, GenericHotkey } from "features/hotkey";
import MainDisplay from "features/resources/MainDisplay.vue";
@ -111,7 +111,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
name: string;
reset: VoidFunction;
}[];
} & Partial<BuyableOptions>
} & Partial<RepeatableOptions>
): Dye {
const amount = createResource(
computed(() =>
@ -259,7 +259,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
break;
}
const buyable: ElfBuyable = createBuyable(() => {
const buyable: ElfBuyable = createRepeatable(() => {
const costs = options.costs();
return {
...options,

View file

@ -9,7 +9,7 @@ import Modal from "components/Modal.vue";
import { createCollapsibleMilestones, createCollapsibleModifierSections } from "data/common";
import { main } from "data/projEntry";
import { createBar, GenericBar } from "features/bars/bar";
import { GenericBuyable } from "features/buyable";
import { GenericRepeatable } from "features/repeatable";
import { ClickableOptions } from "features/clickables/clickable";
import { jsx, showIf, Visibility } from "features/feature";
import { createMilestone } from "features/milestones/milestone";
@ -42,7 +42,7 @@ import letters from "./letters";
import packing from "./packing";
import { createBooleanRequirement, createCostRequirement } from "game/requirements";
export interface ElfBuyable extends GenericBuyable {
export interface ElfBuyable extends GenericRepeatable {
/** The inverse function of the cost formula, used to calculate the maximum amount that can be bought by elves. */
inverseCost: (x?: DecimalSource) => DecimalSource;
resource: Resource;

View file

@ -10,7 +10,7 @@ import Modal from "components/Modal.vue";
import { createCollapsibleModifierSections } from "data/common";
import { main } from "data/projEntry";
import { createBar, GenericBar } from "features/bars/bar";
import { createBuyable, GenericBuyable } from "features/buyable";
import { createRepeatable, GenericRepeatable } from "features/repeatable";
import { jsx, showIf } from "features/feature";
import { createHotkey, GenericHotkey } from "features/hotkey";
import MainDisplay from "features/resources/MainDisplay.vue";
@ -1153,7 +1153,7 @@ const factory = createLayer(id, () => {
]);
const computedCostCheapeners = computed(() => costCheapener.apply(1));
const clothesBuyable = createBuyable(() => ({
const clothesBuyable = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: toys.clothes,
cost() {
@ -1167,8 +1167,8 @@ const factory = createLayer(id, () => {
description: "Use your finished toys to train an elf on factory work"
},
style: "width: 110px"
})) as GenericBuyable;
const blocksBuyable = createBuyable(() => ({
})) as GenericRepeatable;
const blocksBuyable = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: toys.woodenBlocks,
cost() {
@ -1182,8 +1182,8 @@ const factory = createLayer(id, () => {
description: "Use your finished toys to train an elf on factory work"
},
style: "width: 110px"
})) as GenericBuyable;
const trucksBuyable = createBuyable(() => ({
})) as GenericRepeatable;
const trucksBuyable = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: toys.trucks,
cost() {
@ -1197,8 +1197,8 @@ const factory = createLayer(id, () => {
description: "Use your finished toys to train an elf on factory work"
},
style: "width: 110px"
})) as GenericBuyable;
const bearsBuyable = createBuyable(() => ({
})) as GenericRepeatable;
const bearsBuyable = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(bears),
cost() {
@ -1213,8 +1213,8 @@ const factory = createLayer(id, () => {
},
style: "width: 110px",
visible: () => showIf(main.days[advancedDay - 1].opened.value)
})) as GenericBuyable;
const bucketBuyable = createBuyable(() => ({
})) as GenericRepeatable;
const bucketBuyable = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(bucketAndShovels),
cost() {
@ -1229,8 +1229,8 @@ const factory = createLayer(id, () => {
},
style: "width: 110px",
visible: () => showIf(main.days[advancedDay - 1].opened.value)
})) as GenericBuyable;
const consolesBuyable = createBuyable(() => ({
})) as GenericRepeatable;
const consolesBuyable = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(consoles),
cost() {
@ -1245,7 +1245,7 @@ const factory = createLayer(id, () => {
},
style: "width: 110px",
visible: () => showIf(main.days[advancedDay - 1].opened.value)
})) as GenericBuyable;
})) as GenericRepeatable;
const elfBuyables = {
clothesBuyable,
blocksBuyable,
@ -1263,7 +1263,7 @@ const factory = createLayer(id, () => {
const trainedElves = createResource<DecimalSource>(sumElves, "trained elves");
const elvesEffect = computed(() => Decimal.pow(1.05, trainedElves.value));
const expandFactory = createBuyable(() => ({
const expandFactory = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: trees.logs,
cost() {
@ -1282,8 +1282,8 @@ const factory = createLayer(id, () => {
purchaseLimit: 12,
style: "width: 200px",
visibility: () => showIf(main.days[advancedDay - 1].opened.value)
})) as GenericBuyable;
const oilFuel = createBuyable(() => ({
})) as GenericRepeatable;
const oilFuel = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: oil.oil,
cost() {
@ -1298,8 +1298,8 @@ const factory = createLayer(id, () => {
},
style: "width: 200px",
visibility: () => showIf(main.days[advancedDay - 1].opened.value)
})) as GenericBuyable;
const carryToys = createBuyable(() => ({
})) as GenericRepeatable;
const carryToys = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: boxes.boxes,
cost() {
@ -1316,7 +1316,7 @@ const factory = createLayer(id, () => {
},
style: "width: 200px",
visibility: () => showIf(main.days[advancedDay - 1].opened.value)
})) as GenericBuyable;
})) as GenericRepeatable;
const betterFactory = createUpgrade(() => ({
requirements: createCostRequirement(() => ({
@ -1368,7 +1368,7 @@ const factory = createLayer(id, () => {
},
visibility: () => showIf(excitmentUpgrade.bought.value)
}));
const carryBoxes = createBuyable(() => ({
const carryBoxes = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(presents),
cost() {
@ -1386,7 +1386,7 @@ const factory = createLayer(id, () => {
effectDisplay: jsx(() => <>x{format(Decimal.pow(1.5, carryBoxes.amount.value))}</>)
},
visibility: () => showIf(carryPresents.bought.value)
})) as GenericBuyable;
})) as GenericRepeatable;
const catalysts = createUpgrade(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(presents),

View file

@ -20,7 +20,7 @@ import Decimal, { DecimalSource, format, formatWhole } from "util/bignum";
import { Direction } from "util/common";
import { render, renderRow } from "util/vue";
import { computed, ref } from "vue";
import { createBuyable, GenericBuyable } from "features/buyable";
import { createRepeatable, GenericRepeatable } from "features/repeatable";
import metal from "./metal";
import plastic from "./plastic";
import paper from "./paper";
@ -96,7 +96,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
enabled: noPersist(main.days[day - 1].opened)
}));
const metalBuyable = createBuyable(() => ({
const metalBuyable = createRepeatable(() => ({
display: {
title: "Sorting Machine",
description:
@ -112,8 +112,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
})),
visibility: () => showIf(!main.isMastery.value || masteryEffectActive.value)
})) as GenericBuyable;
const plasticBuyable = createBuyable(() => ({
})) as GenericRepeatable;
const plasticBuyable = createRepeatable(() => ({
display: {
title: "Plastic Bins",
description:
@ -129,8 +129,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
})),
visibility: () => showIf(!main.isMastery.value || masteryEffectActive.value)
})) as GenericBuyable;
const paperBuyable = createBuyable(() => ({
})) as GenericRepeatable;
const paperBuyable = createRepeatable(() => ({
display: {
title: "Printed Labels",
description: "Use printed labels to improve how many letters you can process at once",
@ -145,7 +145,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
})),
visibility: () => showIf(!main.isMastery.value || masteryEffectActive.value)
})) as GenericBuyable;
})) as GenericRepeatable;
const buyables = { metalBuyable, plasticBuyable, paperBuyable };
const autoSmeltingMilestone = createMilestone(() => ({

View file

@ -4,7 +4,7 @@ import Modal from "components/Modal.vue";
import { createCollapsibleMilestones, createCollapsibleModifierSections } from "data/common";
import { main } from "data/projEntry";
import { createBar, GenericBar } from "features/bars/bar";
import { createBuyable, GenericBuyable } from "features/buyable";
import { createRepeatable, GenericRepeatable } from "features/repeatable";
import { createClickable } from "features/clickables/clickable";
import { jsx, showIf, Visibility } from "features/feature";
import { createMilestone, GenericMilestone } from "features/milestones/milestone";
@ -1592,7 +1592,7 @@ const layer = createLayer(id, () => {
const upgrades2 = [focusUpgrade4, focusUpgrade5, focusUpgrade6];
// ------------------------------------------------------------------------------- Schools
const schools = createBuyable(() => ({
const schools = createRepeatable(() => ({
requirements: [
createCostRequirement(() => ({
resource: trees.logs,
@ -1678,7 +1678,7 @@ const layer = createLayer(id, () => {
},
visibility: computed(() => showIf(teaching.bought.value)),
style: "width: 600px"
})) as GenericBuyable;
})) as GenericRepeatable;
const classroomFactor = computed(() => {
let v = classrooms.amount.value;
@ -1691,7 +1691,7 @@ const layer = createLayer(id, () => {
return Decimal.add(classrooms.amount.value, 1).pow(0.9);
});
const classrooms = createBuyable(() => ({
const classrooms = createRepeatable(() => ({
requirements: [
createCostRequirement(() => ({
resource: trees.logs,
@ -1727,7 +1727,7 @@ const layer = createLayer(id, () => {
},
visibility: computed(() => showIf(classroomUpgrade.bought.value)),
style: "width: 600px"
})) as GenericBuyable;
})) as GenericRepeatable;
// ------------------------------------------------------------------------------- Modifiers

View file

@ -3,7 +3,7 @@ import Spacer from "components/layout/Spacer.vue";
import Modal from "components/Modal.vue";
import { createCollapsibleModifierSections, setUpDailyProgressTracker } from "data/common";
import { createBar } from "features/bars/bar";
import { createBuyable } from "features/buyable";
import { createRepeatable } from "features/repeatable";
import { createClickable } from "features/clickables/clickable";
import { jsx, showIf } from "features/feature";
import MainDisplay from "features/resources/MainDisplay.vue";
@ -505,7 +505,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
visibility: () => showIf(oil.depthMilestones[4].earned.value)
}));
const oreDrill = createBuyable(() => ({
const oreDrill = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(metal),
cost() {
@ -552,7 +552,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
),
style: { width: "200px" }
})) as ElfBuyable;
const industrialCrucible = createBuyable(() => ({
const industrialCrucible = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(metal),
cost() {
@ -599,7 +599,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
style: { width: "200px" }
})) as ElfBuyable;
const autoSmeltEnabled = persistent<boolean>(true);
const hotterForge = createBuyable(() => ({
const hotterForge = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: coal.coal,
cost() {

View file

@ -18,7 +18,7 @@ import Decimal, { DecimalSource } from "lib/break_eternity";
import { render, renderGrid, renderRow } from "util/vue";
import { computed, ComputedRef, ref, unref } from "vue";
import { noPersist, persistent } from "game/persistence";
import { createBuyable, GenericBuyable } from "features/buyable";
import { createRepeatable, GenericRepeatable } from "features/repeatable";
import { format, formatWhole } from "util/break_eternity";
import metal from "./metal";
import {
@ -114,7 +114,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v);
return Decimal.pow(1.3, v).times(2.5e4);
});
const buildHeavy = createBuyable(() => ({
const buildHeavy = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: metal.metal,
cost: heavyCost
@ -185,7 +185,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v);
return Decimal.pow(2, v).times(1e5);
});
const buildHeavy2 = createBuyable(() => ({
const buildHeavy2 = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: metal.metal,
cost: heavy2Cost
@ -253,7 +253,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v);
return Decimal.pow(8, v).times(2e5);
});
const buildExtractor = createBuyable(() => ({
const buildExtractor = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: metal.metal,
cost: extractorCost
@ -334,7 +334,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
return price;
});
const buildPump = createBuyable(() => ({
const buildPump = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: metal.metal,
cost: pumpCost
@ -407,7 +407,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v);
return Decimal.pow(2, v).times(50);
});
const buildBurner = createBuyable(() => ({
const buildBurner = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(oil),
cost: burnerCost
@ -477,7 +477,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
if (row2Upgrades[4].bought.value) price = price.div(Decimal.add(totalOil.value, 1).root(6));
return price;
});
const buildSmelter = createBuyable(() => ({
const buildSmelter = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: metal.metal,
cost: smelterCost

View file

@ -3,7 +3,7 @@ import SpacerVue from "components/layout/Spacer.vue";
import { createCollapsibleModifierSections, setUpDailyProgressTracker } from "data/common";
import { main } from "data/projEntry";
import { createBar } from "features/bars/bar";
import { createBuyable, GenericBuyable } from "features/buyable";
import { createRepeatable, GenericRepeatable } from "features/repeatable";
import { createClickable } from "features/clickables/clickable";
import { jsx, showIf } from "features/feature";
import { createMilestone, GenericMilestone } from "features/milestones/milestone";
@ -197,7 +197,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
}))
]);
const computedLoaderPackingSpeed = computed(() => loaderPackingSpeed.apply(1000));
const elf = createBuyable(() => ({
const elf = createRepeatable(() => ({
visibility: () => showIf(Decimal.gte(totalPresents.value, 10)),
requirements: createCostRequirement(() => ({
resource: totalPresentsResource,
@ -228,7 +228,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
width: "200px"
}
})) as ElfBuyable;
const loader = createBuyable(() => ({
const loader = createRepeatable(() => ({
visibility: () => showIf(upgrades.loaderUnlock.bought.value),
requirements: [
createCostRequirement(() => ({

View file

@ -6,7 +6,7 @@ import Spacer from "components/layout/Spacer.vue";
import Modal from "components/Modal.vue";
import { createCollapsibleModifierSections, setUpDailyProgressTracker } from "data/common";
import { main } from "data/projEntry";
import { BuyableOptions, createBuyable } from "features/buyable";
import { RepeatableOptions, createRepeatable } from "features/repeatable";
import { createClickable } from "features/clickables/clickable";
import { createCumulativeConversion, createPolynomialScaling } from "features/conversion";
import { jsx, showIf } from "features/feature";
@ -100,9 +100,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
}));
function createBook(
options: { name: string; elfName: string; buyableName: string } & Partial<BuyableOptions>
options: { name: string; elfName: string; buyableName: string } & Partial<RepeatableOptions>
) {
const buyable = createBuyable(() => ({
const buyable = createRepeatable(() => ({
...options,
display: {
title: options.name,

View file

@ -12,7 +12,7 @@ import {
setUpDailyProgressTracker
} from "data/common";
import { main } from "data/projEntry";
import { createBuyable, GenericBuyable } from "features/buyable";
import { createRepeatable, GenericRepeatable } from "features/repeatable";
import { jsx, showIf } from "features/feature";
import MainDisplay from "features/resources/MainDisplay.vue";
import { createResource, Resource } from "features/resources/resource";
@ -86,7 +86,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
return cost;
});
const buildRefinery = createBuyable(() => ({
const buildRefinery = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: metal.metal,
cost: refineryCost
@ -116,7 +116,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
width: "300px"
},
visibility: () => showIf(!main.isMastery.value || masteryEffectActive.value)
})) as GenericBuyable & { resource: Resource };
})) as GenericRepeatable & { resource: Resource };
const {
min: minRefinery,
max: maxRefinery,
@ -227,7 +227,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
})) as GenericUpgrade;
const elfUpgrades = { paperElf, boxElf, clothElf };
const passivePaper = createBuyable(() => ({
const passivePaper = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(plastic),
cost() {
@ -263,7 +263,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
Decimal.add(passivePaper.amount.value, passivePaper.freeLevels.value)
)
})) as BoxesBuyable;
const passiveBoxes = createBuyable(() => ({
const passiveBoxes = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(plastic),
cost() {
@ -299,7 +299,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
Decimal.add(passiveBoxes.amount.value, passiveBoxes.freeLevels.value)
)
})) as BoxesBuyable;
const clothGains = createBuyable(() => ({
const clothGains = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(plastic),
cost() {

View file

@ -8,7 +8,7 @@ import { createCollapsibleMilestones, createCollapsibleModifierSections } from "
import { main } from "data/projEntry";
import { createBar, GenericBar } from "features/bars/bar";
import { BoardNode, BoardNodeLink, createBoard, Shape } from "features/boards/board";
import { createBuyable, GenericBuyable } from "features/buyable";
import { createRepeatable, GenericRepeatable } from "features/repeatable";
import { createClickable } from "features/clickables/clickable";
import { jsx, showIf } from "features/feature";
import { createMilestone, GenericMilestone } from "features/milestones/milestone";
@ -610,7 +610,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
return Decimal.pow(1.2, amount).mul(1e11).div(Decimal.max(citiesCompleted.value, 1));
});
const metaBuyables = {
metal: createBuyable(() => ({
metal: createRepeatable(() => ({
resName: "Metal",
requirements: createCostRequirement(() => ({
resource: metal.metal,
@ -624,7 +624,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
style: "width: 150px; min-height: 60px"
})),
console: createBuyable(() => ({
console: createRepeatable(() => ({
resName: "Game Console",
requirements: createCostRequirement(() => ({
resource: factory.consoles,
@ -638,7 +638,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
style: "width: 150px; min-height: 60px"
})),
classroom: createBuyable(() => ({
classroom: createRepeatable(() => ({
resName: "Classroom",
requirements: createCostRequirement(() => ({
resource: createResource(management.classrooms.amount, "classrooms"),
@ -658,7 +658,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
style: "width: 150px; min-height: 60px"
})),
tick: createBuyable(() => ({
tick: createRepeatable(() => ({
resName: "Factory Tick Rate",
requirements: createCostRequirement(() => ({
resource: createResource(factory.computedTickRate, "factory tick rate"),
@ -678,7 +678,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
style: "width: 150px; min-height: 60px"
}))
} as Record<string, GenericBuyable & { resName: string }>;
} as Record<string, GenericRepeatable & { resName: string }>;
const metaMilestones = {
0: createMilestone(() => ({

View file

@ -7,7 +7,7 @@ import Spacer from "components/layout/Spacer.vue";
import { createCollapsibleMilestones } from "data/common";
import { main } from "data/projEntry";
import { createBar } from "features/bars/bar";
import { createBuyable, GenericBuyable } from "features/buyable";
import { createRepeatable, GenericRepeatable } from "features/repeatable";
import { jsx, showIf } from "features/feature";
import { createMilestone } from "features/milestones/milestone";
import { Resource } from "features/resources/resource";
@ -41,7 +41,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
);
}
const sleighProgress = computed(() => sleigh.amount);
const sleigh = createBuyable(() => ({
const sleigh = createRepeatable(() => ({
requirements: [
createCostRequirement(() => ({
resource: trees.logs,
@ -65,7 +65,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
visibility: () => showIf(Decimal.lt(sleighProgress.value.value, 100)),
style: "width: 600px"
})) as GenericBuyable;
})) as GenericRepeatable;
const shouldShowPopups = computed(() => true);
const milestone1 = createMilestone(() => ({

View file

@ -10,7 +10,7 @@ import {
setUpDailyProgressTracker
} from "data/common";
import { main } from "data/projEntry";
import { createBuyable, GenericBuyable } from "features/buyable";
import { createRepeatable, GenericRepeatable } from "features/repeatable";
import { jsx, showIf } from "features/feature";
import { createMilestone, GenericMilestone } from "features/milestones/milestone";
import MainDisplay from "features/resources/MainDisplay.vue";
@ -47,7 +47,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
"toys"
);
const clothesBuyable = createBuyable(() => ({
const clothesBuyable = createRepeatable(() => ({
requirements: [
createCostRequirement(() => ({
resource: cloth.cloth,
@ -87,8 +87,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
onPurchase() {
clothes.value = Decimal.add(clothes.value, 1);
}
})) as GenericBuyable;
const woodenBlocksBuyable = createBuyable(() => ({
})) as GenericRepeatable;
const woodenBlocksBuyable = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: trees.logs,
cost() {
@ -113,8 +113,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
onPurchase() {
woodenBlocks.value = Decimal.add(woodenBlocks.value, 1);
}
})) as GenericBuyable;
const trucksBuyable = createBuyable(() => ({
})) as GenericRepeatable;
const trucksBuyable = createRepeatable(() => ({
requirements: [
createCostRequirement(() => ({
resource: metal.metal,
@ -153,7 +153,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
onPurchase() {
trucks.value = Decimal.add(trucks.value, 1);
}
})) as GenericBuyable;
})) as GenericRepeatable;
const buyables = [clothesBuyable, woodenBlocksBuyable, trucksBuyable];
const trucksUpgrade1 = createUpgrade(() => ({
requirements: createCostRequirement(() => ({

View file

@ -8,7 +8,7 @@ import Modal from "components/Modal.vue";
import { createCollapsibleModifierSections, setUpDailyProgressTracker } from "data/common";
import { main } from "data/projEntry";
import { createBar } from "features/bars/bar";
import { createBuyable } from "features/buyable";
import { createRepeatable } from "features/repeatable";
import { createClickable } from "features/clickables/clickable";
import { jsx, showIf } from "features/feature";
import { createHotkey } from "features/hotkey";
@ -237,7 +237,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
researchUpgrade2
];
const autoCuttingBuyable1 = createBuyable(() => ({
const autoCuttingBuyable1 = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(logs),
cost() {
@ -266,7 +266,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
visibility: () => showIf(researchUpgrade2.bought.value)
})) as ElfBuyable;
const autoPlantingBuyable1 = createBuyable(() => ({
const autoPlantingBuyable1 = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(logs),
cost() {
@ -302,7 +302,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
visibility: () => showIf(researchUpgrade2.bought.value)
})) as ElfBuyable;
const expandingForestBuyable = createBuyable(() => ({
const expandingForestBuyable = createRepeatable(() => ({
requirements: createCostRequirement(() => ({
resource: noPersist(logs),
cost() {

View file

@ -1,6 +1,6 @@
import Spacer from "components/layout/Spacer.vue";
import { createBar, GenericBar } from "features/bars/bar";
import { BuyableOptions, createBuyable, GenericBuyable } from "features/buyable";
import { RepeatableOptions, createRepeatable, GenericRepeatable } from "features/repeatable";
import { createClickable } from "features/clickables/clickable";
import { jsx, JSXFunction, showIf } from "features/feature";
import { createMilestone } from "features/milestones/milestone";
@ -29,7 +29,7 @@ const baseSecondaryRatio = 1.2;
interface WrappingPaper {
name: string;
buyable: GenericBuyable;
buyable: GenericRepeatable;
display: JSXFunction;
}
@ -54,8 +54,8 @@ const layer = createLayer(id, () => {
const name = "Wrapping Paper";
const color = "gold";
const createWrappingPaper = (options: WrappingPaperOptions & Partial<BuyableOptions>) => {
const buyable: GenericBuyable = createBuyable(() => {
const createWrappingPaper = (options: WrappingPaperOptions & Partial<RepeatableOptions>) => {
const buyable: GenericRepeatable = createRepeatable(() => {
return {
requirements: (Object.entries(options.ratio) as [enumColor, Scaling][]).map(
([color, ratio]) => {