Fix exhancers sell issue
This commit is contained in:
parent
a646a30412
commit
b5910cd542
1 changed files with 18 additions and 17 deletions
|
@ -214,8 +214,7 @@ const layer = createLayer(id, () => {
|
|||
}));
|
||||
const upgrades = [generatorUpgrade, lollipopMultiplierUpgrade, unlockIlluminatiUpgrade];
|
||||
|
||||
const exhancers = createRepeatable(() => ({
|
||||
requirements: createCostRequirement(() => ({
|
||||
const exhancersCost = createCostRequirement(() => ({
|
||||
resource: noPersist(points),
|
||||
cost() {
|
||||
let x = new Decimal(exhancers.amount.value);
|
||||
|
@ -230,7 +229,9 @@ const layer = createLayer(id, () => {
|
|||
spentOnBuyables.value = Decimal.add(spentOnBuyables.value, cost ?? 0);
|
||||
this.resource.value = Decimal.sub(this.resource.value, cost).max(0);
|
||||
}
|
||||
})),
|
||||
}));
|
||||
const exhancers = createRepeatable(() => ({
|
||||
requirements: exhancersCost,
|
||||
display() {
|
||||
return {
|
||||
title: "Exhancers",
|
||||
|
@ -280,7 +281,7 @@ const layer = createLayer(id, () => {
|
|||
return;
|
||||
}
|
||||
exhancers.amount.value = Decimal.sub(exhancers.amount.value, 1);
|
||||
const cost = (exhancers.requirements.cost as Ref<DecimalSource>).value;
|
||||
const cost = (exhancersCost.cost as Ref<DecimalSource>).value;
|
||||
points.value = Decimal.add(points.value, cost);
|
||||
spentOnBuyables.value = Decimal.sub(spentOnBuyables.value, cost);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue