mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2024-11-25 01:41:48 +00:00
Merge branch 'main' of https://github.com/thepaperpilot/Advent-Incremental
This commit is contained in:
commit
2edc63888d
9 changed files with 113 additions and 33 deletions
|
@ -15,7 +15,12 @@ import { createResource, displayResource, Resource } from "features/resources/re
|
|||
import { createUpgrade, GenericUpgrade } from "features/upgrades/upgrade";
|
||||
import { globalBus } from "game/events";
|
||||
import { BaseLayer, createLayer } from "game/layers";
|
||||
import { createExponentialModifier, createSequentialModifier, Modifier } from "game/modifiers";
|
||||
import {
|
||||
createExponentialModifier,
|
||||
createMultiplicativeModifier,
|
||||
createSequentialModifier,
|
||||
Modifier
|
||||
} from "game/modifiers";
|
||||
import { noPersist } from "game/persistence";
|
||||
import Decimal, { DecimalSource, format, formatWhole } from "util/bignum";
|
||||
import { WithRequired } from "util/common";
|
||||
|
@ -26,6 +31,7 @@ import management from "./management";
|
|||
import paper from "./paper";
|
||||
import plastic from "./plastic";
|
||||
import trees from "./trees";
|
||||
import workshop from "./workshop";
|
||||
|
||||
export type BoxesBuyable = GenericBuyable & {
|
||||
resource: Resource;
|
||||
|
@ -42,6 +48,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
const boxes = createResource<DecimalSource>(0, "boxes");
|
||||
|
||||
const boxGain = createSequentialModifier(() => [
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: 2,
|
||||
description: "1000% Foundation Completed",
|
||||
enabled: workshop.milestones.extraExpansionMilestone5.earned
|
||||
})),
|
||||
createExponentialModifier(() => ({
|
||||
exponent: 1.1,
|
||||
description: "Bell Level 2",
|
||||
|
|
|
@ -34,6 +34,7 @@ import metal from "./metal";
|
|||
import paper from "./paper";
|
||||
import plastic from "./plastic";
|
||||
import trees from "./trees";
|
||||
import workshop from "./workshop";
|
||||
|
||||
const id = "cloth";
|
||||
const day = 8;
|
||||
|
@ -332,7 +333,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
const paperUpgrades = { paperUpgrade4, paperUpgrade3, paperUpgrade2, paperUpgrade1 };
|
||||
|
||||
const hollyEffect = computed(() =>
|
||||
Decimal.add(trees.computedAutoCuttingAmount.value, 1).root(3)
|
||||
Decimal.add(trees.computedAutoCuttingAmount.value, 1).root(9)
|
||||
);
|
||||
const gingersnapEffect = computed(() => Decimal.add(dyes.dyeSum.value, 10).log10());
|
||||
|
||||
|
@ -360,6 +361,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
multiplier: hollyEffect,
|
||||
description: "Holly Level 3",
|
||||
enabled: management.elfTraining.cutterElfTraining.milestones[2].earned
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: 2,
|
||||
description: "1000% Foundation Completed",
|
||||
enabled: workshop.milestones.extraExpansionMilestone5.earned
|
||||
}))
|
||||
]);
|
||||
const computedSheepGain = computed(() => sheepGain.apply(1));
|
||||
|
@ -390,6 +396,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
multiplier: hollyEffect,
|
||||
description: "Holly Level 3",
|
||||
enabled: management.elfTraining.cutterElfTraining.milestones[2].earned
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: 2,
|
||||
description: "1000% Foundation Completed",
|
||||
enabled: workshop.milestones.extraExpansionMilestone5.earned
|
||||
}))
|
||||
]);
|
||||
const computedShearingAmount = computed(() => shearingAmount.apply(1));
|
||||
|
@ -420,6 +431,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
multiplier: hollyEffect,
|
||||
description: "Holly Level 3",
|
||||
enabled: management.elfTraining.cutterElfTraining.milestones[2].earned
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: 2,
|
||||
description: "1000% Foundation Completed",
|
||||
enabled: workshop.milestones.extraExpansionMilestone5.earned
|
||||
}))
|
||||
]);
|
||||
const computedSpinningAmount = computed(() => spinningAmount.apply(1));
|
||||
|
|
|
@ -22,7 +22,7 @@ import { persistent } from "game/persistence";
|
|||
import Decimal, { DecimalSource, format, formatTime, formatWhole } from "util/bignum";
|
||||
import { Direction } from "util/common";
|
||||
import { render, renderCol, renderGrid } from "util/vue";
|
||||
import { computed, ComputedRef, ref, Ref, unref } from "vue";
|
||||
import { computed, ComputedRef, ref, Ref, unref, watch } from "vue";
|
||||
import elves from "./elves";
|
||||
import trees from "./trees";
|
||||
import paper from "./paper";
|
||||
|
@ -156,7 +156,10 @@ const layer = createLayer(id, () => {
|
|||
).toNumber()
|
||||
);
|
||||
const expToNextLevel = computed(() =>
|
||||
Decimal.sub(exp.value, Decimal.sumGeometricSeries(level.value, Decimal.mul(4000, costMulti), 5, 0))
|
||||
Decimal.sub(
|
||||
exp.value,
|
||||
Decimal.sumGeometricSeries(level.value, Decimal.mul(4000, costMulti), 5, 0)
|
||||
)
|
||||
);
|
||||
const bar = createBar(() => ({
|
||||
direction: Direction.Right,
|
||||
|
@ -275,8 +278,7 @@ const layer = createLayer(id, () => {
|
|||
requirement: "Holly Level 3",
|
||||
effectDisplay: jsx(() => (
|
||||
<>
|
||||
Multiply all cloth actions' effectiveness by <sup>9</sup>
|
||||
<Sqrt>Cutter amount</Sqrt>.
|
||||
Multiply all cloth actions' effectiveness by log<sub>10</sub>Cutter amount.
|
||||
</>
|
||||
))
|
||||
},
|
||||
|
@ -449,7 +451,7 @@ const layer = createLayer(id, () => {
|
|||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Mary Level 2",
|
||||
effectDisplay: "Double automatic tree planting speed"
|
||||
effectDisplay: "Metal gain is raised to the 1.1."
|
||||
},
|
||||
visibility: () => showIf(heatedPlanterElfMilestones[0].earned.value),
|
||||
shouldEarn: () => heatedPlanterElfTraining.level.value >= 2
|
||||
|
@ -465,7 +467,7 @@ const layer = createLayer(id, () => {
|
|||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Mary Level 4",
|
||||
effectDisplay: "Metal gain is raised to the 1.1."
|
||||
effectDisplay: "Double automatic tree planting speed"
|
||||
},
|
||||
visibility: () =>
|
||||
showIf(heatedPlanterElfMilestones[2].earned.value && main.day.value >= 13),
|
||||
|
@ -940,6 +942,7 @@ const layer = createLayer(id, () => {
|
|||
focusCooldown.value = Math.max(focusCooldown.value - diff, 0);
|
||||
|
||||
if (Decimal.eq(focusTime.value, 0)) {
|
||||
focusTargets.value = {};
|
||||
focusMulti.value = Decimal.pow(
|
||||
focusMaxMulti.value,
|
||||
1 - Math.abs(Math.sin((Date.now() / 1000) * 2))
|
||||
|
@ -1052,7 +1055,7 @@ const layer = createLayer(id, () => {
|
|||
description: "Multiplies the maximum experience multiplier from focus by 2"
|
||||
},
|
||||
resource: trees.logs,
|
||||
cost: 1e30
|
||||
cost: 1e25
|
||||
}));
|
||||
const focusUpgrade2 = createUpgrade(() => ({
|
||||
display: {
|
||||
|
@ -1060,7 +1063,7 @@ const layer = createLayer(id, () => {
|
|||
description: "Increase elves affected by focus by 1"
|
||||
},
|
||||
resource: trees.logs,
|
||||
cost: 1e40
|
||||
cost: 1e30
|
||||
}));
|
||||
const focusUpgrade3 = createUpgrade(() => ({
|
||||
display: {
|
||||
|
@ -1068,23 +1071,24 @@ const layer = createLayer(id, () => {
|
|||
description: "Focus can now be rerolled every 10 seconds"
|
||||
},
|
||||
resource: trees.logs,
|
||||
cost: 1e50
|
||||
cost: 1e35
|
||||
}));
|
||||
const upgrades = [focusUpgrade1, focusUpgrade2, focusUpgrade3];
|
||||
// ------------------------------------------------------------------------------- Schools
|
||||
|
||||
const schoolCost = computed(() => {
|
||||
const schoolFactor = Decimal.pow(10, schools.amount.value);
|
||||
const woodFactor = Decimal.pow(2e4, schools.amount.value);
|
||||
const nerfedSchoolFactor = Decimal.pow(5, schools.amount.value);
|
||||
const woodFactor = Decimal.pow(1e4, schools.amount.value);
|
||||
const coalFactor = Decimal.pow(2000, schools.amount.value);
|
||||
return {
|
||||
wood: woodFactor.mul(1e21),
|
||||
coal: coalFactor.mul(1e32),
|
||||
paper: coalFactor.mul(1e18),
|
||||
boxes: woodFactor.mul(1e13),
|
||||
metalIngots: schoolFactor.mul(1e12),
|
||||
metalIngots: nerfedSchoolFactor.mul(1e12),
|
||||
cloth: schoolFactor.mul(1e4),
|
||||
plastic: schoolFactor.mul(1e6),
|
||||
plastic: nerfedSchoolFactor.mul(1e6),
|
||||
dye: Decimal.add(schools.amount.value, 1).mul(10000)
|
||||
};
|
||||
});
|
||||
|
@ -1151,7 +1155,7 @@ const layer = createLayer(id, () => {
|
|||
});
|
||||
|
||||
const classroomEffect = computed(() => {
|
||||
return Decimal.add(classrooms.amount.value, 1).sqrt();
|
||||
return Decimal.add(classrooms.amount.value, 1).pow(0.9);
|
||||
});
|
||||
|
||||
const classrooms = createBuyable(() => ({
|
||||
|
@ -1344,7 +1348,9 @@ const layer = createLayer(id, () => {
|
|||
{render(modifiersModal)}
|
||||
{render(dayProgress)}
|
||||
<br />
|
||||
{renderCol(schools, classrooms)} {renderGrid([teaching, classroomUpgrade])}{" "}
|
||||
{renderCol(schools, classrooms)}
|
||||
{renderGrid([teaching, classroomUpgrade])}
|
||||
<Spacer />
|
||||
{Decimal.gt(schools.amount.value, 0) ? (
|
||||
<>
|
||||
<br />
|
||||
|
|
|
@ -32,6 +32,7 @@ import cloth from "./cloth";
|
|||
import plastic from "./plastic";
|
||||
import dyes from "./dyes";
|
||||
import management from "./management";
|
||||
import workshop from "./workshop";
|
||||
|
||||
const id = "metal";
|
||||
const day = 7;
|
||||
|
@ -81,10 +82,16 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
description: "Glistening Paint",
|
||||
enabled: dyes.upgrades.redDyeUpg.bought
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: () =>
|
||||
Decimal.div(workshop.foundationProgress.value, 10).floor().div(10).add(1),
|
||||
description: "400% Foundation Completed",
|
||||
enabled: workshop.milestones.extraExpansionMilestone2.earned
|
||||
})),
|
||||
createExponentialModifier(() => ({
|
||||
exponent: 1.1,
|
||||
description: "Mary Level 4",
|
||||
enabled: management.elfTraining.heatedPlanterElfTraining.milestones[3].earned
|
||||
description: "Mary Level 2",
|
||||
enabled: management.elfTraining.heatedPlanterElfTraining.milestones[1].earned
|
||||
}))
|
||||
]);
|
||||
const computedOrePurity = computed(() => orePurity.apply(0.1));
|
||||
|
|
|
@ -36,6 +36,7 @@ import plastic from "./plastic";
|
|||
import paper from "./paper";
|
||||
import dyes from "./dyes";
|
||||
import management from "./management";
|
||||
import workshop from "./workshop";
|
||||
|
||||
const id = "oil";
|
||||
const day = 9;
|
||||
|
@ -720,6 +721,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
description: "Effectiveness",
|
||||
enabled: () => Decimal.lt(coalEffectiveness.value, 1)
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: () =>
|
||||
Decimal.div(workshop.foundationProgress.value, 10).floor().div(10).add(1),
|
||||
description: "600% Foundation Completed",
|
||||
enabled: workshop.milestones.extraExpansionMilestone3.earned
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: () => Decimal.sqrt(management.totalElfLevels.value),
|
||||
description: "Jack Level 4",
|
||||
|
|
|
@ -28,6 +28,7 @@ import plastic from "./plastic";
|
|||
import trees from "./trees";
|
||||
import dyes from "./dyes";
|
||||
import management from "./management";
|
||||
import workshop from "./workshop";
|
||||
|
||||
const id = "paper";
|
||||
const day = 5;
|
||||
|
@ -300,6 +301,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
multiplier: dyes.boosts.yellow1,
|
||||
description: "Yellow Dye Boost 1",
|
||||
enabled: () => Decimal.gte(dyes.dyes.yellow.amount.value, 1)
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: 2,
|
||||
description: "1000% Foundation Completed",
|
||||
enabled: workshop.milestones.extraExpansionMilestone5.earned
|
||||
}))
|
||||
]) as WithRequired<Modifier, "description" | "revert">;
|
||||
const ashCost = createSequentialModifier(() => [
|
||||
|
|
|
@ -33,6 +33,7 @@ import metal from "./metal";
|
|||
import oil from "./oil";
|
||||
import dyes from "./dyes";
|
||||
import management from "./management";
|
||||
import workshop from "./workshop";
|
||||
|
||||
const id = "plastic";
|
||||
const day = 10;
|
||||
|
@ -262,6 +263,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
multiplier: dyes.boosts.yellow1,
|
||||
description: "Yellow Dye Boost 1",
|
||||
enabled: () => Decimal.gte(dyes.dyes.yellow.amount.value, 1)
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: () =>
|
||||
Decimal.div(workshop.foundationProgress.value, 10).floor().div(10).add(1),
|
||||
description: "800% Foundation Completed",
|
||||
enabled: workshop.milestones.extraExpansionMilestone4.earned
|
||||
}))
|
||||
]);
|
||||
const computedPlasticGain = computed(() => plasticGain.apply(0));
|
||||
|
|
|
@ -292,7 +292,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
enabled: researchUpgrade2.bought
|
||||
})),
|
||||
createAdditiveModifier(() => ({
|
||||
addend: () => Decimal.div(workshop.foundationProgress.value, 5).floor(),
|
||||
addend: () =>
|
||||
workshop.milestones.extraExpansionMilestone1.earned
|
||||
? Decimal.pow(1.02, workshop.foundationProgress.value)
|
||||
: Decimal.div(workshop.foundationProgress.value, 5).floor(),
|
||||
description: "10% Foundation Completed",
|
||||
enabled: workshop.milestones.autoCutMilestone1.earned
|
||||
})),
|
||||
|
@ -406,16 +409,16 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
description: "Ivy Level 1",
|
||||
enabled: management.elfTraining.planterElfTraining.milestones[0].earned
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: 2,
|
||||
description: "Mary Level 2",
|
||||
enabled: management.elfTraining.heatedPlanterElfTraining.milestones[1].earned
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: () => Decimal.pow(trees.value, 0.2).log10().pow_base(2),
|
||||
description: "Ivy Level 3",
|
||||
enabled: management.elfTraining.planterElfTraining.milestones[2].earned
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: 2,
|
||||
description: "Mary Level 4",
|
||||
enabled: management.elfTraining.heatedPlanterElfTraining.milestones[3].earned
|
||||
})),
|
||||
createAdditiveModifier(() => ({
|
||||
addend: () =>
|
||||
Decimal.sub(lastAutoPlantedAmount.value, lastAutoCuttingAmount.value).max(0),
|
||||
|
|
|
@ -40,12 +40,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
scaling: addSoftcap(
|
||||
addSoftcap(createPolynomialScaling(250, 1.5), 5387, 1 / 1e10),
|
||||
1e20,
|
||||
1e9
|
||||
3e8
|
||||
),
|
||||
baseResource: trees.logs,
|
||||
gainResource: noPersist(foundationProgress),
|
||||
roundUpCost: true,
|
||||
buyMax: management.elfTraining.heatedCutterElfTraining.milestones[2].earned,
|
||||
// buyMax: management.elfTraining.expandersElfTraining.milestones[2].earned,
|
||||
spend(gain, spent) {
|
||||
trees.logs.value = Decimal.sub(trees.logs.value, spent);
|
||||
},
|
||||
|
@ -61,7 +61,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
const buildFoundation = createClickable(() => ({
|
||||
display: jsx(() => (
|
||||
<>
|
||||
<b style="font-size: x-large">Build part of the foundation</b>
|
||||
<b style="font-size: x-large">
|
||||
Build {formatWhole(foundationConversion.actualGain.value)}% of the foundation
|
||||
</b>
|
||||
<br />
|
||||
<br />
|
||||
<span style="font-size: large">
|
||||
|
@ -82,7 +84,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
management.elfTraining.expandersElfTraining.milestones[2].earned.value
|
||||
),
|
||||
canClick: () =>
|
||||
Decimal.gte(foundationConversion.actualGain.value, 1) &&
|
||||
Decimal.gte(trees.logs.value, foundationConversion.currentAt.value) &&
|
||||
(Decimal.lt(foundationProgress.value, 100) ||
|
||||
management.elfTraining.expandersElfTraining.milestones[2].earned.value),
|
||||
onClick() {
|
||||
|
@ -182,7 +184,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
},
|
||||
shouldEarn: () => Decimal.gte(foundationProgress.value, 200),
|
||||
visibility: () =>
|
||||
showIf(management.elfTraining.expandersElfTraining.milestones[2].earned.value),
|
||||
showIf(
|
||||
logGainMilestone3.earned.value &&
|
||||
management.elfTraining.expandersElfTraining.milestones[2].earned.value
|
||||
),
|
||||
showPopups: shouldShowPopups
|
||||
}));
|
||||
const extraExpansionMilestone2 = createMilestone(() => ({
|
||||
|
@ -192,7 +197,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
},
|
||||
shouldEarn: () => Decimal.gte(foundationProgress.value, 400),
|
||||
visibility: () =>
|
||||
showIf(management.elfTraining.expandersElfTraining.milestones[2].earned.value),
|
||||
showIf(
|
||||
extraExpansionMilestone1.earned.value &&
|
||||
management.elfTraining.expandersElfTraining.milestones[2].earned.value
|
||||
),
|
||||
showPopups: shouldShowPopups
|
||||
}));
|
||||
const extraExpansionMilestone3 = createMilestone(() => ({
|
||||
|
@ -202,7 +210,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
},
|
||||
shouldEarn: () => Decimal.gte(foundationProgress.value, 600),
|
||||
visibility: () =>
|
||||
showIf(management.elfTraining.expandersElfTraining.milestones[2].earned.value),
|
||||
showIf(
|
||||
extraExpansionMilestone2.earned.value &&
|
||||
management.elfTraining.expandersElfTraining.milestones[2].earned.value
|
||||
),
|
||||
showPopups: shouldShowPopups
|
||||
}));
|
||||
const extraExpansionMilestone4 = createMilestone(() => ({
|
||||
|
@ -212,7 +223,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
},
|
||||
shouldEarn: () => Decimal.gte(foundationProgress.value, 800),
|
||||
visibility: () =>
|
||||
showIf(management.elfTraining.expandersElfTraining.milestones[2].earned.value),
|
||||
showIf(
|
||||
extraExpansionMilestone3.earned.value &&
|
||||
management.elfTraining.expandersElfTraining.milestones[2].earned.value
|
||||
),
|
||||
showPopups: shouldShowPopups
|
||||
}));
|
||||
const extraExpansionMilestone5 = createMilestone(() => ({
|
||||
|
@ -222,7 +236,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
},
|
||||
shouldEarn: () => Decimal.gte(foundationProgress.value, 1000),
|
||||
visibility: () =>
|
||||
showIf(management.elfTraining.expandersElfTraining.milestones[2].earned.value),
|
||||
showIf(
|
||||
extraExpansionMilestone4.earned.value &&
|
||||
management.elfTraining.expandersElfTraining.milestones[2].earned.value
|
||||
),
|
||||
showPopups: shouldShowPopups
|
||||
}));
|
||||
const milestones = {
|
||||
|
|
Loading…
Reference in a new issue