Fix bonfire autobuying and fire display

This commit is contained in:
Seth Posner 2022-12-05 10:27:41 -08:00
parent 3e5696d35e
commit 45391be8ce
2 changed files with 4 additions and 5 deletions

View file

@ -821,7 +821,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
<Column>
{render(buildFire)}
<div>
{formatWhole(activeFires.value)}/{formatWhole(buildFire.amount.value)}
{formatWhole(Decimal.floor(activeFires.value))}/
{formatWhole(Decimal.floor(buildFire.amount.value))}
</div>
{renderRow(minFire, removeFire, addFire, maxFire)}
</Column>

View file

@ -429,15 +429,13 @@ const layer = createLayer(id, function (this: BaseLayer) {
buyable: coal.buildBonfire,
cooldownModifier: bonfireCooldown,
visibility: () => showIf(boxes.upgrades.ashUpgrade.bought.value),
customCost: amount =>
Decimal.times(amount, 10)
.plus(10)
.times(Decimal.pow(0.95, paper.books.bonfireBook.amount.value)),
hasToggle: true,
toggleDesc: "Activate auto-purchased bonfires",
onAutoPurchase() {
if (bonfireElf.toggle.value) {
coal.activeBonfires.value = Decimal.add(coal.activeBonfires.value, 1);
coal.buildFire.amount.value = Decimal.sub(coal.buildFire.amount.value, unref(this.buyable.cost!));
coal.activeFires.value = Decimal.sub(coal.activeFires.value, unref(this.buyable.cost!));
}
}
});