import Modal from "@/components/system/Modal.vue"; import Spacer from "@/components/system/Spacer.vue"; import { createResource, trackBest, trackOOMPS, trackTotal } from "@/features/resource"; import { createTree, GenericTree } from "@/features/tree"; import { globalBus } from "@/game/events"; import { createLayer, GenericLayer } from "@/game/layers"; import player, { PlayerData } from "@/game/player"; import { DecimalSource } from "@/lib/break_eternity"; import Decimal, { format, formatSmall, formatTime } from "@/util/bignum"; import { render } from "@/util/vue"; import { computed, ref } from "vue"; import a from "./layers/aca/a"; import c from "./layers/aca/c"; import f from "./layers/aca/f"; export const main = createLayer(() => { const points = createResource(0); const best = trackBest(points); const total = trackTotal(points); const oomps = trackOOMPS(points); const showModal = ref(false); const pointGain = computed(() => { if (!c.value.generatorUpgrade.bought) return new Decimal(0); let gain = new Decimal(3.19); if (c.value.lollipopMultiplierUpgrade.bought) gain = gain.times(c.value.lollipopMultiplierEffect.value); return gain; }); globalBus.on("update", diff => { points.value = Decimal.add(points.value, Decimal.times(pointGain.value, diff)); }); // Note: Casting as generic tree to avoid recursive type definitions const tree = createTree({ nodes: [[c.value.treeNode], [f.value.treeNode, c.value.spook]], leftSideNodes: [a.value.treeNode, c.value.h], branches: [ { startNode: f.value.treeNode, endNode: c.value.treeNode, stroke: "blue", "stroke-width": "25px", style: { filter: "blur(5px)" } }, { startNode: c.value.treeNode, endNode: c.value.g } ] }) as GenericTree; // Note: layers don't _need_ a reference to everything, // but I'd recommend it over trying to remember what does and doesn't need to be included. // Officially all you need are anything with persistency or that you want to access elsewhere return { id: "main", name: "Tree", links: tree.links, display: ( ), points, best, total, oomps, tree }; }); export const getInitialLayers = ( /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ player: Partial ): Array => [main.value, f.value, c.value, a.value]; export const hasWon = computed(() => { return false; }); /* eslint-disable @typescript-eslint/no-unused-vars */ export function fixOldSave( oldVersion: string | undefined, player: Partial // eslint-disable-next-line @typescript-eslint/no-empty-function ): void {} /* eslint-enable @typescript-eslint/no-unused-vars */