mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2025-03-14 01:51:40 +00:00
Carol and dye buy max now add actual dyes
This commit is contained in:
parent
e42e1f4c32
commit
e0c8629d19
2 changed files with 12 additions and 4 deletions
|
@ -316,7 +316,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
const buyAmount = this.inverseCost().sub(this.amount.value).plus(1);
|
||||
if (buyAmount.lte(0)) return;
|
||||
|
||||
amount.value = Decimal.times(computedToGenerate.value, buyAmount).add(amount.value);
|
||||
amount.value = Decimal.times(2, buyable.amount.value).plus(buyAmount).plus(1)
|
||||
.times(buyAmount).div(2)
|
||||
.times(Decimal.add(buyable.amount.value, 1)).div(computedToGenerate.value).plus(amount.value);
|
||||
buyable.amount.value = Decimal.add(buyable.amount.value, buyAmount);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -911,13 +911,19 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
cooldownModifier: dyeCooldown, // Note: Buy max will be unlocked at this point
|
||||
visibility: () => showIf(wrappingPaper.unlockDyeElfMilestone.earned.value),
|
||||
buyMax: management.elfTraining.dyeElfTraining.milestones[2].earned,
|
||||
onAutoPurchase(buyable, amount) {
|
||||
onAutoPurchase(buyable, amount) {
|
||||
buyable.amount.value = Decimal.sub(buyable.amount.value, amount);
|
||||
if (["orange", "green", "purple"].includes(dyeColors[buyable.id])) {
|
||||
if (!ribbon.milestones.secondaryDyeElf.earned.value) {
|
||||
buyable.amount.value = Decimal.sub(buyable.amount.value, amount)
|
||||
return;
|
||||
return
|
||||
}
|
||||
}
|
||||
const dye = dyes.dyes[dyeColors[buyable.id]];
|
||||
dye.amount.value = Decimal.times(2, buyable.amount.value).plus(amount).plus(1)
|
||||
.times(amount).div(2)
|
||||
.times(Decimal.add(buyable.amount.value, 1)).div(dye.computedToGenerate.value)
|
||||
|
||||
buyable.amount.value = Decimal.add(buyable.amount.value, amount);
|
||||
}
|
||||
});
|
||||
const wrappingPaperElves = [dyeElf];
|
||||
|
|
Loading…
Add table
Reference in a new issue