Stop metal from generating before it should be

This commit is contained in:
thepaperpilot 2022-12-17 10:37:30 -06:00
parent ae37422645
commit 271485a5a6

View file

@ -93,17 +93,23 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.add(oil.buildHeavy.amount.value, 1).sqrt(),
description: "Joy Level 4",
enabled: () => management.elfTraining.smallfireElfTraining.milestones[3].earned.value && !main.isMastery.value
enabled: () =>
management.elfTraining.smallfireElfTraining.milestones[3].earned.value &&
!main.isMastery.value
})),
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.add(management.schools.amount.value, 1),
description: "Twinkle Level 1",
enabled: () => management.elfTraining.metalElfTraining.milestones[0].earned.value && !main.isMastery.value
enabled: () =>
management.elfTraining.metalElfTraining.milestones[0].earned.value &&
!main.isMastery.value
})),
createExponentialModifier(() => ({
exponent: 1.1,
description: "Mary Level 2",
enabled: () => management.elfTraining.heatedPlanterElfTraining.milestones[1].earned.value && !main.isMastery.value
enabled: () =>
management.elfTraining.heatedPlanterElfTraining.milestones[1].earned.value &&
!main.isMastery.value
}))
]);
const computedOrePurity = computed(() => orePurity.apply(0.1));
@ -117,17 +123,23 @@ const layer = createLayer(id, function (this: BaseLayer) {
createExponentialModifier(() => ({
exponent: 1.1,
description: "Joy Level 5",
enabled: () => management.elfTraining.smallfireElfTraining.milestones[4].earned.value && !main.isMastery.value
enabled: () =>
management.elfTraining.smallfireElfTraining.milestones[4].earned.value &&
!main.isMastery.value
})),
createExponentialModifier(() => ({
exponent: 1.1,
description: "Faith Level 5",
enabled: () => management.elfTraining.bonfireElfTraining.milestones[4].earned.value && !main.isMastery.value
enabled: () =>
management.elfTraining.bonfireElfTraining.milestones[4].earned.value &&
!main.isMastery.value
})),
createExponentialModifier(() => ({
exponent: 1.1,
description: "Snowball Level 5",
enabled: () => management.elfTraining.kilnElfTraining.milestones[4].earned.value && !main.isMastery.value
enabled: () =>
management.elfTraining.kilnElfTraining.milestones[4].earned.value &&
!main.isMastery.value
})),
createMultiplicativeModifier(() => ({
multiplier: 2,
@ -153,13 +165,17 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.div(management.totalElfExp.value, 1e6).add(1).sqrt(),
description: "Mary Level 5",
enabled: () => management.elfTraining.heatedPlanterElfTraining.milestones[4].earned.value && !main.isMastery.value
enabled: () =>
management.elfTraining.heatedPlanterElfTraining.milestones[4].earned.value &&
!main.isMastery.value
})),
createMultiplicativeModifier(() => ({
multiplier: () =>
Decimal.pow(1.25, management.elfTraining.metalElfTraining.level.value),
description: "Twinkle Level 2",
enabled: () => management.elfTraining.metalElfTraining.milestones[1].earned.value && !main.isMastery.value
enabled: () =>
management.elfTraining.metalElfTraining.milestones[1].earned.value &&
!main.isMastery.value
})),
createMultiplicativeModifier(() => ({
multiplier: () =>
@ -187,7 +203,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({
multiplier: 3,
description: "Twinkle Level 3",
enabled: () => management.elfTraining.metalElfTraining.milestones[2].earned.value && !main.isMastery.value
enabled: () =>
management.elfTraining.metalElfTraining.milestones[2].earned.value &&
!main.isMastery.value
})),
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.add(industrialCrucible.amount.value, 1).sqrt(),
@ -552,6 +570,15 @@ const layer = createLayer(id, function (this: BaseLayer) {
const hotterForgeEffect = computed(() => Decimal.times(hotterForge.amount.value, 0.25));
globalBus.on("update", diff => {
if (
Decimal.lt(main.day.value, day) ||
(main.isMastery.value &&
!mastered.value &&
main.currentlyMastering.value?.name !== name)
) {
return;
}
oreProgress.value = Decimal.times(diff, computedOreSpeed.value).plus(oreProgress.value);
const oreGain = oreProgress.value.trunc();
oreProgress.value = oreProgress.value.minus(oreGain);
@ -738,7 +765,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
{renderRow(oreDrill, industrialCrucible, hotterForge)}
</>
)),
minimizedDisplay: jsx(() => (<div>{name} - {format(metal.value)} {metal.displayName}</div>)),
minimizedDisplay: jsx(() => (
<div>
{name} - {format(metal.value)} {metal.displayName}
</div>
)),
mastery,
mastered
};