From 9e16c98949e8da2d5cf069afdba43156d78029bf Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Thu, 1 Dec 2022 00:45:59 -0600 Subject: [PATCH] Fix softlock --- src/data/layers/trees.tsx | 8 ++++---- src/data/projEntry.tsx | 23 +++++++++++++++++++---- src/data/projInfo.json | 2 +- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index 8725b09..7360132 100644 --- a/src/data/layers/trees.tsx +++ b/src/data/layers/trees.tsx @@ -46,8 +46,8 @@ const layer = createLayer(id, function (this: BaseLayer) { } })); const manualPlantUpgrade1 = createUpgrade(() => ({ - resource: saplings, - cost: 5, + resource: logs, + cost: 10, display: { title: "Leafy Fingers", description: "Plant an additional tree per click" @@ -62,8 +62,8 @@ const layer = createLayer(id, function (this: BaseLayer) { } })); const autoPlantUpgrade1 = createUpgrade(() => ({ - resource: saplings, - cost: 10, + resource: logs, + cost: 25, display: { title: "Automated Spade", description: "Plant a tree every second" diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx index fef679f..93510af 100644 --- a/src/data/projEntry.tsx +++ b/src/data/projEntry.tsx @@ -1,11 +1,17 @@ import "@fontsource/material-icons"; import Spacer from "components/layout/Spacer.vue"; -import { CoercableComponent, Component, GatherProps, GenericComponent, jsx } from "features/feature"; +import { + CoercableComponent, + Component, + GatherProps, + GenericComponent, + jsx +} from "features/feature"; import { BaseLayer, createLayer, GenericLayer, layers } from "game/layers"; import { persistent } from "game/persistence"; -import type { PlayerData } from "game/player"; +import type { LayerData, PlayerData } from "game/player"; import player from "game/player"; -import { format, formatTime } from "util/bignum"; +import Decimal, { format, formatTime } from "util/bignum"; import { Computable, convertComputable, ProcessedComputable } from "util/computed"; import { createLazyProxy } from "util/proxies"; import { renderRow, VueFeature } from "util/vue"; @@ -316,5 +322,14 @@ export function fixOldSave( oldVersion: string | undefined, player: Partial // eslint-disable-next-line @typescript-eslint/no-empty-function -): void {} +): void { + if (oldVersion === "0.0") { + if (player.layers?.trees) { + (player.layers.trees as LayerData).trees = Decimal.sub( + 10, + (player.layers.trees as LayerData).saplings ?? 0 + ); + } + } +} /* eslint-enable @typescript-eslint/no-unused-vars */ diff --git a/src/data/projInfo.json b/src/data/projInfo.json index 8c94b84..056ef82 100644 --- a/src/data/projInfo.json +++ b/src/data/projInfo.json @@ -8,7 +8,7 @@ "discordName": "", "discordLink": "", - "versionNumber": "0.0", + "versionNumber": "0.1", "versionTitle": "Initial Commit", "allowGoBack": true,