mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2025-03-21 21:51:45 +00:00
Fixed cloth and up not treating mastery correctly
This commit is contained in:
parent
a84eceea65
commit
7eb3e2fa0b
5 changed files with 64 additions and 61 deletions
src/data/layers
|
@ -27,7 +27,7 @@ import Decimal, { DecimalSource, format } from "util/bignum";
|
||||||
import { formatWhole } from "util/break_eternity";
|
import { formatWhole } from "util/break_eternity";
|
||||||
import { Direction } from "util/common";
|
import { Direction } from "util/common";
|
||||||
import { render, renderCol, renderRow } from "util/vue";
|
import { render, renderCol, renderRow } from "util/vue";
|
||||||
import { computed, ref } from "vue";
|
import { computed, ref, unref } from "vue";
|
||||||
import boxes from "./boxes";
|
import boxes from "./boxes";
|
||||||
import dyes from "./dyes";
|
import dyes from "./dyes";
|
||||||
import { ElfBuyable } from "./elves";
|
import { ElfBuyable } from "./elves";
|
||||||
|
@ -73,9 +73,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
style: {
|
style: {
|
||||||
minHeight: "80px"
|
minHeight: "80px"
|
||||||
},
|
},
|
||||||
canClick: () => Decimal.gte(breedingProgress.value, computedBreedingCooldown.value),
|
canClick: () =>
|
||||||
|
Decimal.gte(breedingProgress.value, computedBreedingCooldown.value) &&
|
||||||
|
(!main.isMastery.value || masteryEffectActive.value),
|
||||||
onClick() {
|
onClick() {
|
||||||
if (Decimal.lt(breedingProgress.value, computedBreedingCooldown.value)) {
|
if (!unref(breeding.canClick)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const amount = Decimal.floor(computedSheepGain.value);
|
const amount = Decimal.floor(computedSheepGain.value);
|
||||||
|
@ -109,9 +111,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
style: {
|
style: {
|
||||||
minHeight: "80px"
|
minHeight: "80px"
|
||||||
},
|
},
|
||||||
canClick: () => Decimal.gte(shearingProgress.value, computedShearingCooldown.value),
|
canClick: () =>
|
||||||
|
Decimal.gte(shearingProgress.value, computedShearingCooldown.value) &&
|
||||||
|
(!main.isMastery.value || masteryEffectActive.value),
|
||||||
onClick() {
|
onClick() {
|
||||||
if (Decimal.lt(shearingProgress.value, computedShearingCooldown.value)) {
|
if (!unref(shearing.canClick)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const amount = Decimal.min(sheep.value, computedShearingAmount.value).floor();
|
const amount = Decimal.min(sheep.value, computedShearingAmount.value).floor();
|
||||||
|
@ -145,9 +149,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
style: {
|
style: {
|
||||||
minHeight: "80px"
|
minHeight: "80px"
|
||||||
},
|
},
|
||||||
canClick: () => Decimal.gte(spinningProgress.value, computedSpinningCooldown.value),
|
canClick: () =>
|
||||||
|
Decimal.gte(spinningProgress.value, computedSpinningCooldown.value) &&
|
||||||
|
(!main.isMastery.value || masteryEffectActive.value),
|
||||||
onClick() {
|
onClick() {
|
||||||
if (Decimal.lt(spinningProgress.value, computedSpinningCooldown.value)) {
|
if (!unref(spinning.canClick)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const amount = Decimal.min(wool.value, computedSpinningAmount.value).floor();
|
const amount = Decimal.min(wool.value, computedSpinningAmount.value).floor();
|
||||||
|
@ -375,16 +381,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: gingersnapEffect,
|
multiplier: gingersnapEffect,
|
||||||
description: "Gingersnap Level 2",
|
description: "Gingersnap Level 2",
|
||||||
enabled: () =>
|
enabled: management.elfTraining.clothElfTraining.milestones[1].earned
|
||||||
management.elfTraining.clothElfTraining.milestones[1].earned.value &&
|
|
||||||
!main.isMastery.value
|
|
||||||
})),
|
})),
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: hollyEffect,
|
multiplier: hollyEffect,
|
||||||
description: "Holly Level 3",
|
description: "Holly Level 3",
|
||||||
enabled: () =>
|
enabled: management.elfTraining.cutterElfTraining.milestones[2].earned
|
||||||
management.elfTraining.cutterElfTraining.milestones[2].earned.value &&
|
|
||||||
!main.isMastery.value
|
|
||||||
})),
|
})),
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: 2,
|
multiplier: 2,
|
||||||
|
@ -419,16 +421,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: gingersnapEffect,
|
multiplier: gingersnapEffect,
|
||||||
description: "Gingersnap Level 2",
|
description: "Gingersnap Level 2",
|
||||||
enabled: () =>
|
enabled: management.elfTraining.clothElfTraining.milestones[1].earned
|
||||||
management.elfTraining.clothElfTraining.milestones[1].earned.value &&
|
|
||||||
!main.isMastery.value
|
|
||||||
})),
|
})),
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: hollyEffect,
|
multiplier: hollyEffect,
|
||||||
description: "Holly Level 3",
|
description: "Holly Level 3",
|
||||||
enabled: () =>
|
enabled: management.elfTraining.cutterElfTraining.milestones[2].earned
|
||||||
management.elfTraining.cutterElfTraining.milestones[2].earned.value &&
|
|
||||||
!main.isMastery.value
|
|
||||||
})),
|
})),
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: 2,
|
multiplier: 2,
|
||||||
|
@ -463,16 +461,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: gingersnapEffect,
|
multiplier: gingersnapEffect,
|
||||||
description: "Gingersnap Level 2",
|
description: "Gingersnap Level 2",
|
||||||
enabled: () =>
|
enabled: management.elfTraining.clothElfTraining.milestones[1].earned
|
||||||
management.elfTraining.clothElfTraining.milestones[1].earned.value &&
|
|
||||||
!main.isMastery.value
|
|
||||||
})),
|
})),
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: hollyEffect,
|
multiplier: hollyEffect,
|
||||||
description: "Holly Level 3",
|
description: "Holly Level 3",
|
||||||
enabled: () =>
|
enabled: management.elfTraining.cutterElfTraining.milestones[2].earned
|
||||||
management.elfTraining.cutterElfTraining.milestones[2].earned.value &&
|
|
||||||
!main.isMastery.value
|
|
||||||
})),
|
})),
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: 2,
|
multiplier: 2,
|
||||||
|
@ -659,8 +653,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
minimizedDisplay: jsx(() => (
|
minimizedDisplay: jsx(() => (
|
||||||
<div>
|
<div>
|
||||||
{name}{" "}
|
{name}{" "}
|
||||||
<span class="desc">{format(cloth.value)} {cloth.displayName}</span>
|
<span class="desc">
|
||||||
</div>
|
{format(cloth.value)} {cloth.displayName}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
)),
|
)),
|
||||||
mastery,
|
mastery,
|
||||||
mastered
|
mastered
|
||||||
|
|
|
@ -148,9 +148,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: () => Decimal.add(cloth.cloth.value, Math.E).ln(),
|
multiplier: () => Decimal.add(cloth.cloth.value, Math.E).ln(),
|
||||||
description: "Gingersnap Level 1",
|
description: "Gingersnap Level 1",
|
||||||
enabled: () =>
|
enabled: management.elfTraining.clothElfTraining.milestones[0].earned
|
||||||
management.elfTraining.clothElfTraining.milestones[0].earned.value &&
|
|
||||||
!main.isMastery.value
|
|
||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
modifiers.push(
|
modifiers.push(
|
||||||
|
@ -178,9 +176,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: 2,
|
multiplier: 2,
|
||||||
description: "Gingersnap Level 3",
|
description: "Gingersnap Level 3",
|
||||||
enabled: () =>
|
enabled: management.elfTraining.clothElfTraining.milestones[2].earned
|
||||||
management.elfTraining.clothElfTraining.milestones[2].earned.value &&
|
|
||||||
!main.isMastery.value
|
|
||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
modifiers.push(
|
modifiers.push(
|
||||||
|
@ -274,7 +270,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
canPurchase: computed((cost?: DecimalSource) => {
|
canPurchase: computed((cost?: DecimalSource) => {
|
||||||
if (unref(buyable.visibility) != Visibility.Visible) return false;
|
if (unref(buyable.visibility) != Visibility.Visible) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (main.isMastery.value && !masteryEffectActive.value) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const trueCost = cost ?? unref(buyable.cost) ?? Decimal.dInf;
|
const trueCost = cost ?? unref(buyable.cost) ?? Decimal.dInf;
|
||||||
return unref(costs).every(c =>
|
return unref(costs).every(c =>
|
||||||
Decimal.div(c.res.value, unref(c.base))
|
Decimal.div(c.res.value, unref(c.base))
|
||||||
|
@ -283,6 +284,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
onPurchase(cost?: DecimalSource) {
|
onPurchase(cost?: DecimalSource) {
|
||||||
|
if (!unref(buyable.canPurchase)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const trueCost = cost ?? unref(buyable.cost) ?? Decimal.dInf;
|
const trueCost = cost ?? unref(buyable.cost) ?? Decimal.dInf;
|
||||||
|
|
||||||
amount.value = Decimal.add(amount.value, computedToGenerate.value);
|
amount.value = Decimal.add(amount.value, computedToGenerate.value);
|
||||||
|
|
|
@ -61,7 +61,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
style: {
|
style: {
|
||||||
minHeight: "80px"
|
minHeight: "80px"
|
||||||
},
|
},
|
||||||
canClick: () => Decimal.gte(processingProgress.value, computedProcessingCooldown.value),
|
canClick: () =>
|
||||||
|
Decimal.gte(processingProgress.value, computedProcessingCooldown.value) &&
|
||||||
|
(!main.isMastery.value || masteryEffectActive.value),
|
||||||
onClick() {
|
onClick() {
|
||||||
if (Decimal.lt(processingProgress.value, computedProcessingCooldown.value)) {
|
if (Decimal.lt(processingProgress.value, computedProcessingCooldown.value)) {
|
||||||
return;
|
return;
|
||||||
|
@ -87,7 +89,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
resource: metal.metal,
|
resource: metal.metal,
|
||||||
cost() {
|
cost() {
|
||||||
return Decimal.pow(10, metalBuyable.amount.value).times(1e21);
|
return Decimal.pow(10, metalBuyable.amount.value).times(1e21);
|
||||||
}
|
},
|
||||||
|
visibility: () => showIf(!main.isMastery.value || masteryEffectActive.value)
|
||||||
})) as GenericBuyable;
|
})) as GenericBuyable;
|
||||||
const plasticBuyable = createBuyable(() => ({
|
const plasticBuyable = createBuyable(() => ({
|
||||||
display: {
|
display: {
|
||||||
|
@ -101,7 +104,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
resource: plastic.plastic,
|
resource: plastic.plastic,
|
||||||
cost() {
|
cost() {
|
||||||
return Decimal.pow(1.5, plasticBuyable.amount.value).times(1e9);
|
return Decimal.pow(1.5, plasticBuyable.amount.value).times(1e9);
|
||||||
}
|
},
|
||||||
|
visibility: () => showIf(!main.isMastery.value || masteryEffectActive.value)
|
||||||
})) as GenericBuyable;
|
})) as GenericBuyable;
|
||||||
const paperBuyable = createBuyable(() => ({
|
const paperBuyable = createBuyable(() => ({
|
||||||
display: {
|
display: {
|
||||||
|
@ -114,7 +118,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
resource: paper.paper,
|
resource: paper.paper,
|
||||||
cost() {
|
cost() {
|
||||||
return Decimal.pow(3, paperBuyable.amount.value).times(1e38);
|
return Decimal.pow(3, paperBuyable.amount.value).times(1e38);
|
||||||
}
|
},
|
||||||
|
visibility: () => showIf(!main.isMastery.value || masteryEffectActive.value)
|
||||||
})) as GenericBuyable;
|
})) as GenericBuyable;
|
||||||
const buyables = { metalBuyable, plasticBuyable, paperBuyable };
|
const buyables = { metalBuyable, plasticBuyable, paperBuyable };
|
||||||
|
|
||||||
|
@ -304,8 +309,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
minimizedDisplay: jsx(() => (
|
minimizedDisplay: jsx(() => (
|
||||||
<div>
|
<div>
|
||||||
{name}{" "}
|
{name}{" "}
|
||||||
<span class="desc">{format(letters.value)} {letters.displayName}</span>
|
<span class="desc">
|
||||||
</div>
|
{format(letters.value)} {letters.displayName}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
)),
|
)),
|
||||||
mastery,
|
mastery,
|
||||||
mastered
|
mastered
|
||||||
|
|
|
@ -141,7 +141,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
color: colorText,
|
color: colorText,
|
||||||
width: "160px",
|
width: "160px",
|
||||||
flexGrow: 1
|
flexGrow: 1
|
||||||
}
|
},
|
||||||
|
visibility: () => showIf(!main.isMastery.value || masteryEffectActive.value)
|
||||||
})) as ElfBuyable & { resource: Resource };
|
})) as ElfBuyable & { resource: Resource };
|
||||||
const {
|
const {
|
||||||
min: minHeavy,
|
min: minHeavy,
|
||||||
|
@ -854,16 +855,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: () => Decimal.add(totalOil.value, 1).log10().add(1),
|
multiplier: () => Decimal.add(totalOil.value, 1).log10().add(1),
|
||||||
description: "Cocoa Level 2",
|
description: "Cocoa Level 2",
|
||||||
enabled: () =>
|
enabled: management.elfTraining.oilElfTraining.milestones[1].earned
|
||||||
management.elfTraining.oilElfTraining.milestones[1].earned.value &&
|
|
||||||
!main.isMastery.value
|
|
||||||
})),
|
})),
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: 2,
|
multiplier: 2,
|
||||||
description: "Cocoa Level 3",
|
description: "Cocoa Level 3",
|
||||||
enabled: () =>
|
enabled: management.elfTraining.oilElfTraining.milestones[2].earned
|
||||||
management.elfTraining.oilElfTraining.milestones[2].earned.value &&
|
|
||||||
!main.isMastery.value
|
|
||||||
})),
|
})),
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: () => coalEffectiveness.value,
|
multiplier: () => coalEffectiveness.value,
|
||||||
|
@ -917,23 +914,17 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: () => Decimal.sqrt(management.totalElfLevels.value),
|
multiplier: () => Decimal.sqrt(management.totalElfLevels.value),
|
||||||
description: "Jack Level 4",
|
description: "Jack Level 4",
|
||||||
enabled: () =>
|
enabled: management.elfTraining.heatedCutterElfTraining.milestones[3].earned
|
||||||
management.elfTraining.heatedCutterElfTraining.milestones[3].earned.value &&
|
|
||||||
!main.isMastery.value
|
|
||||||
})),
|
})),
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: () => Decimal.add(buildHeavy2.amount.value, 1).sqrt(),
|
multiplier: () => Decimal.add(buildHeavy2.amount.value, 1).sqrt(),
|
||||||
description: "Faith Level 4",
|
description: "Faith Level 4",
|
||||||
enabled: () =>
|
enabled: management.elfTraining.bonfireElfTraining.milestones[3].earned
|
||||||
management.elfTraining.bonfireElfTraining.milestones[3].earned.value &&
|
|
||||||
!main.isMastery.value
|
|
||||||
})),
|
})),
|
||||||
createMultiplicativeModifier(() => ({
|
createMultiplicativeModifier(() => ({
|
||||||
multiplier: 2,
|
multiplier: 2,
|
||||||
description: "Cocoa Level 3",
|
description: "Cocoa Level 3",
|
||||||
enabled: () =>
|
enabled: management.elfTraining.oilElfTraining.milestones[2].earned
|
||||||
management.elfTraining.oilElfTraining.milestones[2].earned.value &&
|
|
||||||
!main.isMastery.value
|
|
||||||
}))
|
}))
|
||||||
]) as WithRequired<Modifier, "description" | "revert">;
|
]) as WithRequired<Modifier, "description" | "revert">;
|
||||||
const computedOilSpeed = computed(() => oilSpeed.apply(0));
|
const computedOilSpeed = computed(() => oilSpeed.apply(0));
|
||||||
|
@ -1353,8 +1344,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
minimizedDisplay: jsx(() => (
|
minimizedDisplay: jsx(() => (
|
||||||
<div>
|
<div>
|
||||||
{name}{" "}
|
{name}{" "}
|
||||||
<span class="desc">{format(oil.value)} {oil.displayName}</span>
|
<span class="desc">
|
||||||
</div>
|
{format(oil.value)} {oil.displayName}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
)),
|
)),
|
||||||
mastery,
|
mastery,
|
||||||
mastered
|
mastered
|
||||||
|
|
|
@ -101,7 +101,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
width: "300px"
|
width: "300px"
|
||||||
}
|
},
|
||||||
|
visibility: () => showIf(!main.isMastery.value || masteryEffectActive.value)
|
||||||
})) as GenericBuyable & { resource: Resource };
|
})) as GenericBuyable & { resource: Resource };
|
||||||
const {
|
const {
|
||||||
min: minRefinery,
|
min: minRefinery,
|
||||||
|
@ -384,8 +385,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
minimizedDisplay: jsx(() => (
|
minimizedDisplay: jsx(() => (
|
||||||
<div>
|
<div>
|
||||||
{name}{" "}
|
{name}{" "}
|
||||||
<span class="desc">{format(plastic.value)} {plastic.displayName}</span>
|
<span class="desc">
|
||||||
</div>
|
{format(plastic.value)} {plastic.displayName}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
)),
|
)),
|
||||||
mastery,
|
mastery,
|
||||||
mastered
|
mastered
|
||||||
|
|
Loading…
Add table
Reference in a new issue