Make books show current effect

This commit is contained in:
thepaperpilot 2022-12-04 13:43:22 -06:00
parent 27f574ea28
commit 02a1f6d44c
2 changed files with 9 additions and 3 deletions

View file

@ -12,7 +12,7 @@ import { jsx } from "features/feature";
import MainDisplay from "features/resources/MainDisplay.vue"; import MainDisplay from "features/resources/MainDisplay.vue";
import { createResource, displayResource, trackTotal } from "features/resources/resource"; import { createResource, displayResource, trackTotal } from "features/resources/resource";
import { BaseLayer, createLayer } from "game/layers"; import { BaseLayer, createLayer } from "game/layers";
import Decimal, { DecimalSource, formatWhole } from "util/bignum"; import Decimal, { DecimalSource, format, formatWhole } from "util/bignum";
import { Direction } from "util/common"; import { Direction } from "util/common";
import { render, renderCol } from "util/vue"; import { render, renderCol } from "util/vue";
import { computed, unref, watchEffect } from "vue"; import { computed, unref, watchEffect } from "vue";
@ -82,7 +82,14 @@ const layer = createLayer(id, function (this: BaseLayer) {
const buyable = createBuyable(() => ({ const buyable = createBuyable(() => ({
display: { display: {
title: options.name, title: options.name,
description: `Print a copy of "${options.name}", which ${options.elfName} will use to improve their skills! Each copy printed will reduce the "${options.buyableName}" price scaling by 0.95x and make ${options.elfName} purchase +10% faster!` description: `Print a copy of "${options.name}", which ${options.elfName} will use to improve their skills! Each copy printed will reduce the "${options.buyableName}" price scaling by 0.95x and make ${options.elfName} purchase +10% faster!`,
effectDisplay: jsx(() => (
<>
{format(Decimal.pow(0.95, buyable.amount.value))}x price scaling,{" "}
{format(Decimal.div(buyable.amount.value, 10).add(1))}x auto-purchase speed
</>
)),
showAmount: false
}, },
resource: paper, resource: paper,
cost: () => Decimal.pow(5, buyable.amount.value).times(10), cost: () => Decimal.pow(5, buyable.amount.value).times(10),

View file

@ -203,7 +203,6 @@ export function createBuyable<T extends BuyableOptions>(
) : null} ) : null}
{genericBuyable.cost && !genericBuyable.maxed.value ? ( {genericBuyable.cost && !genericBuyable.maxed.value ? (
<div> <div>
<br />
Cost: {format(unref(genericBuyable.cost) || 0)}{" "} Cost: {format(unref(genericBuyable.cost) || 0)}{" "}
{buyable.resource.displayName} {buyable.resource.displayName}
</div> </div>