mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2024-11-25 18:00:25 +00:00
Make books show current effect
This commit is contained in:
parent
27f574ea28
commit
02a1f6d44c
2 changed files with 9 additions and 3 deletions
|
@ -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),
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue