Merge branch 'days-15-16' of https://github.com/thepaperpilot/Advent-Incremental into days-15-16

This commit is contained in:
Seth Posner 2022-12-18 19:07:03 -08:00
commit cf8df5e27e
2 changed files with 15 additions and 6 deletions

View file

@ -676,7 +676,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
style: "width: 190px",
onPurchase() {
options.onPurchase?.();
if (!["Peppermint", "Twinkle", "Cocoa", "Frosty"].includes(options.name)) {
if (
!["Peppermint", "Twinkle", "Cocoa", "Frosty", "Carol"].includes(
options.name
)
) {
elfReset.reset();
}
}
@ -901,8 +905,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
});
const managementElves2 = [metalElf];
const dyeColors = Object.fromEntries((["red", "yellow", "blue", "orange", "green", "purple"] as enumColor[])
.map(color => [dyes.dyes[color].buyable.id, color])) as Record<string, enumColor>;
const dyeColors = Object.fromEntries(
(["red", "yellow", "blue", "orange", "green", "purple"] as enumColor[]).map(color => [
dyes.dyes[color].buyable.id,
color
])
) as Record<string, enumColor>;
const dyeElf = createElf({
name: "Carol",
description:
@ -910,7 +918,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
buyable: Object.values(dyes.dyes).map(dye => dye.buyable),
cooldownModifier: dyeCooldown, // Note: Buy max will be unlocked at this point
visibility: () => showIf(wrappingPaper.unlockDyeElfMilestone.earned.value),
buyMax: management.elfTraining.dyeElfTraining.milestones[2].earned,
buyMax: () => management.elfTraining.dyeElfTraining.milestones[2].earned.value,
onAutoPurchase(buyable, amount) {
buyable.amount.value = Decimal.sub(buyable.amount.value, amount);
if (["orange", "green", "purple"].includes(dyeColors[buyable.id])) {

View file

@ -292,10 +292,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
visibility: () => showIf(elves.elves.dyeElf.bought.value)
});
const secondaryDyeBook = createBook({
name: "",
name: "Natural Dyeing",
elfName: "Carol",
buyableName: "Secondary Dyes",
visibility: () => showIf(elves.elves.dyeElf.bought.value && ribbon.milestones.dyeBook.earned.value)
visibility: () =>
showIf(elves.elves.dyeElf.bought.value && ribbon.milestones.dyeBook.earned.value)
});
const books = {
cuttersBook,