mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2025-01-20 04:21:30 +00:00
Merge branch 'main' of https://github.com/thepaperpilot/Advent-Incremental
This commit is contained in:
commit
6cb741a134
7 changed files with 86 additions and 51 deletions
|
@ -531,6 +531,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
if (Decimal.gte(totalElves.value, 9)) {
|
||||
cost = Decimal.times(cost, 1e15);
|
||||
}
|
||||
if (Decimal.gte(totalElves.value, 12)) {
|
||||
cost = Decimal.times(cost, 1e18);
|
||||
}
|
||||
return cost;
|
||||
});
|
||||
|
||||
|
@ -808,10 +811,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
if (heavyDrillElf.toggle.value) {
|
||||
if (buyable === oil.buildHeavy) {
|
||||
oil.activeHeavy.value = Decimal.add(oil.activeHeavy.value, 1);
|
||||
} else if (buyable === oil.buildHeavy) {
|
||||
oil.activeHeavy.value = Decimal.add(oil.activeHeavy.value, 1);
|
||||
} else if (buyable === oil.buildHeavy) {
|
||||
oil.activeHeavy.value = Decimal.add(oil.activeHeavy.value, 1);
|
||||
} else if (buyable === oil.buildHeavy2) {
|
||||
oil.activeHeavy2.value = Decimal.add(oil.activeHeavy2.value, 1);
|
||||
} else if (buyable === oil.buildExtractor) {
|
||||
oil.activeExtractor.value = Decimal.add(oil.activeExtractor.value, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import Spacer from "components/layout/Spacer.vue";
|
||||
import Fraction from "components/math/Fraction.vue";
|
||||
import Sqrt from "components/math/Sqrt.vue";
|
||||
import Modal from "components/Modal.vue";
|
||||
import { createCollapsibleMilestones, createCollapsibleModifierSections } from "data/common";
|
||||
import { main } from "data/projEntry";
|
||||
import { createBar, GenericBar } from "features/bars/bar";
|
||||
import { createBuyable } from "features/buyable";
|
||||
import { createBuyable, GenericBuyable } from "features/buyable";
|
||||
import { createClickable } from "features/clickables/clickable";
|
||||
import { jsx, showIf, Visibility } from "features/feature";
|
||||
import { createMilestone, GenericMilestone } from "features/milestones/milestone";
|
||||
|
@ -21,7 +20,6 @@ import {
|
|||
import { persistent } from "game/persistence";
|
||||
import Decimal, { DecimalSource, format, formatTime, formatWhole } from "util/bignum";
|
||||
import { Direction, WithRequired } from "util/common";
|
||||
import { ProcessedComputable } from "util/computed";
|
||||
import { render, renderCol, renderGrid } from "util/vue";
|
||||
import { computed, ComputedRef, ref, Ref, unref, watchEffect } from "vue";
|
||||
import boxes from "./boxes";
|
||||
|
@ -30,10 +28,10 @@ import coal from "./coal";
|
|||
import dyes from "./dyes";
|
||||
import elves from "./elves";
|
||||
import metal from "./metal";
|
||||
import oil from "./oil";
|
||||
import paper from "./paper";
|
||||
import plastic from "./plastic";
|
||||
import trees from "./trees";
|
||||
import oil from "./oil";
|
||||
|
||||
import "./styles/management.css";
|
||||
|
||||
|
@ -115,12 +113,29 @@ const layer = createLayer(id, () => {
|
|||
style: "width: 150px",
|
||||
cost: 1e13
|
||||
}));
|
||||
const advancedUpgrade = createUpgrade(() => ({
|
||||
display: {
|
||||
title: "Advanced Training",
|
||||
description:
|
||||
"Time for some advanced training! Now that all the elves know the basics, you have a foundation you can truly build off of. Everyone seems to be learning 10x as quickly!"
|
||||
},
|
||||
visibility: () =>
|
||||
showIf(main.day.value >= advancedDay && main.days[advancedDay - 1].opened.value),
|
||||
resource: boxes.boxes,
|
||||
style: "width: 150px",
|
||||
cost: 1e26
|
||||
}));
|
||||
const globalXPModifier = createSequentialModifier(() => [
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: classroomEffect,
|
||||
description: "Classroom Effect",
|
||||
enabled: classroomUpgrade.bought
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: 10,
|
||||
description: "Advanced Training",
|
||||
enabled: advancedUpgrade.bought
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: 2,
|
||||
description: "Carry experience in boxes???",
|
||||
|
@ -136,7 +151,7 @@ const layer = createLayer(id, () => {
|
|||
name: string;
|
||||
computedAutoBuyCooldown: ComputedRef<DecimalSource>;
|
||||
amountOfTimesDone: Ref<number>;
|
||||
visibility: ProcessedComputable<Visibility>;
|
||||
bought: Ref<boolean>;
|
||||
},
|
||||
milestones: Array<GenericMilestone>,
|
||||
...modifiers: Modifier[]
|
||||
|
@ -259,7 +274,7 @@ const layer = createLayer(id, () => {
|
|||
canClick() {
|
||||
return currentShown.value !== elf.name;
|
||||
},
|
||||
visibility: elf.visibility,
|
||||
visibility: () => showIf(elf.bought.value),
|
||||
name: elf.name,
|
||||
state,
|
||||
displayMilestone,
|
||||
|
@ -321,7 +336,7 @@ const layer = createLayer(id, () => {
|
|||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Holly Level 5",
|
||||
effectDisplay: "Raise workshop expansion cost by 0.95"
|
||||
effectDisplay: "Raise workshop expansion cost by 0.99"
|
||||
},
|
||||
visibility: () => showIf(cutterElfMilestones[3].earned.value && main.day.value >= 13),
|
||||
shouldEarn: () => cutterElfTraining.level.value >= 5
|
||||
|
@ -560,7 +575,7 @@ const layer = createLayer(id, () => {
|
|||
},
|
||||
visibility: () =>
|
||||
showIf(fertilizerElfMilestones[3].earned.value && main.day.value >= 13),
|
||||
shouldEarn: () => heatedPlanterElfTraining.level.value >= 5
|
||||
shouldEarn: () => fertilizerElfTraining.level.value >= 5
|
||||
}))
|
||||
] as Array<GenericMilestone>;
|
||||
const smallfireElfMilestones = [
|
||||
|
@ -1222,7 +1237,7 @@ const layer = createLayer(id, () => {
|
|||
const focusMeter = createBar(() => ({
|
||||
direction: Direction.Right,
|
||||
width: 566,
|
||||
height: 25,
|
||||
height: 50,
|
||||
style: `border-radius: 4px 4px 0 0`,
|
||||
borderStyle: `border-radius: 4px 4px 0 0`,
|
||||
fillStyle: () => ({
|
||||
|
@ -1354,7 +1369,10 @@ const layer = createLayer(id, () => {
|
|||
const schoolCost = computed(() => {
|
||||
const schoolFactor = Decimal.pow(10, schools.amount.value);
|
||||
const nerfedSchoolFactor = Decimal.pow(5, schools.amount.value);
|
||||
const woodFactor = Decimal.pow(2e4, Decimal.pow(schools.amount.value, 0.75));
|
||||
let woodFactor = Decimal.pow(2e4, Decimal.pow(schools.amount.value, 0.75));
|
||||
if (Decimal.gte(schools.amount.value, 4)) {
|
||||
woodFactor = woodFactor.div(1e3);
|
||||
}
|
||||
const coalFactor = Decimal.pow(2000, schools.amount.value);
|
||||
return {
|
||||
wood: woodFactor.mul(1e21),
|
||||
|
@ -1380,14 +1398,17 @@ const layer = createLayer(id, () => {
|
|||
You have {formatWhole(schools.amount.value)} schools, which are currently
|
||||
letting elves learn up to level {formatWhole(schools.amount.value)}.
|
||||
</div>
|
||||
<div>
|
||||
Costs {format(schoolCost.value.wood)} logs, {format(schoolCost.value.coal)}{" "}
|
||||
coal, {format(schoolCost.value.paper)} paper, {format(schoolCost.value.boxes)}{" "}
|
||||
boxes, {format(schoolCost.value.metalIngots)} metal ingots,{" "}
|
||||
{format(schoolCost.value.cloth)} cloth, {format(schoolCost.value.plastic)}{" "}
|
||||
plastic, and requires {format(schoolCost.value.dye)} of red, yellow, and blue
|
||||
dye
|
||||
</div>
|
||||
{Decimal.lt(schools.amount.value, unref(schools.purchaseLimit)) ? (
|
||||
<div>
|
||||
Costs {format(schoolCost.value.wood)} logs, {format(schoolCost.value.coal)}{" "}
|
||||
coal, {format(schoolCost.value.paper)} paper,{" "}
|
||||
{format(schoolCost.value.boxes)} boxes,{" "}
|
||||
{format(schoolCost.value.metalIngots)} metal ingots,{" "}
|
||||
{format(schoolCost.value.cloth)} cloth, {format(schoolCost.value.plastic)}{" "}
|
||||
plastic, and requires {format(schoolCost.value.dye)} of red, yellow, and
|
||||
blue dye
|
||||
</div>
|
||||
) : null}
|
||||
</>
|
||||
)),
|
||||
canPurchase(): boolean {
|
||||
|
@ -1421,7 +1442,7 @@ const layer = createLayer(id, () => {
|
|||
},
|
||||
visibility: computed(() => showIf(teaching.bought.value)),
|
||||
style: "width: 600px"
|
||||
}));
|
||||
})) as GenericBuyable;
|
||||
|
||||
const classroomCost = computed(() => {
|
||||
const classroomFactor = Decimal.add(classrooms.amount.value, 1).pow(1.5);
|
||||
|
@ -1616,6 +1637,7 @@ const layer = createLayer(id, () => {
|
|||
schools,
|
||||
classrooms,
|
||||
classroomUpgrade,
|
||||
advancedUpgrade,
|
||||
|
||||
focusMultiplier: focusMulti,
|
||||
upgrades,
|
||||
|
@ -1643,7 +1665,7 @@ const layer = createLayer(id, () => {
|
|||
{render(dayProgress)}
|
||||
<br />
|
||||
{renderCol(schools, classrooms)}
|
||||
{renderGrid([teaching, classroomUpgrade])}
|
||||
{renderGrid([teaching, classroomUpgrade, advancedUpgrade])}
|
||||
<Spacer />
|
||||
{Decimal.gt(schools.amount.value, 0) ? (
|
||||
<>
|
||||
|
|
|
@ -32,7 +32,7 @@ import { globalBus } from "game/events";
|
|||
import coal from "./coal";
|
||||
import { createUpgrade, GenericUpgrade } from "features/upgrades/upgrade";
|
||||
import { createMilestone, GenericMilestone } from "features/milestones/milestone";
|
||||
import { formatGain } from "util/bignum";
|
||||
import { formatGain, formatSmall } from "util/bignum";
|
||||
import plastic from "./plastic";
|
||||
import paper from "./paper";
|
||||
import dyes from "./dyes";
|
||||
|
@ -100,6 +100,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
resource: metal.metal,
|
||||
cost() {
|
||||
let v = new Decimal(this.amount.value);
|
||||
if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100);
|
||||
v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v);
|
||||
return Decimal.pow(1.3, v).times(2.5e4);
|
||||
},
|
||||
|
@ -157,6 +158,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
resource: metal.metal,
|
||||
cost() {
|
||||
let v = new Decimal(this.amount.value);
|
||||
if (Decimal.gte(v, 50)) v = Decimal.pow(v, 4).div(50);
|
||||
v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v);
|
||||
return Decimal.pow(2, v).times(1e5);
|
||||
},
|
||||
|
@ -212,6 +214,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
resource: metal.metal,
|
||||
cost() {
|
||||
let v = new Decimal(this.amount.value);
|
||||
if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100);
|
||||
v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v);
|
||||
return Decimal.pow(8, v).times(2e5);
|
||||
},
|
||||
|
@ -225,7 +228,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
<br />
|
||||
<br />
|
||||
Currently:
|
||||
<br />×{format(extractorPower.value)} drill power
|
||||
<br />×{formatSmall(extractorPower.value)} drill power
|
||||
<br />×{format(extractorCoal.value)} coal/sec
|
||||
<br />×{format(extractorOre.value)} ore/sec
|
||||
<br />
|
||||
|
@ -274,6 +277,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
resource: metal.metal,
|
||||
cost() {
|
||||
let v = new Decimal(this.amount.value);
|
||||
if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100);
|
||||
v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v);
|
||||
let price = Decimal.pow(16, v).times(2e6);
|
||||
if (row2Upgrades[4].bought.value) {
|
||||
|
@ -335,6 +339,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
resource: noPersist(oil),
|
||||
cost() {
|
||||
let v = new Decimal(this.amount.value);
|
||||
if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100);
|
||||
v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v);
|
||||
return Decimal.pow(2, v).times(50);
|
||||
},
|
||||
|
@ -388,6 +393,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
resource: metal.metal,
|
||||
cost() {
|
||||
let v = new Decimal(this.amount.value);
|
||||
if (Decimal.gte(v, 50)) v = Decimal.pow(v, 2).div(50);
|
||||
if (Decimal.gte(v, 200)) v = Decimal.pow(v, 2).div(200);
|
||||
if (Decimal.gte(v, 1e4)) v = Decimal.pow(v, 2).div(1e4);
|
||||
v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v);
|
||||
let price = Decimal.pow(10, v).times(1e7);
|
||||
if (row2Upgrades[4].bought.value)
|
||||
|
|
|
@ -17,7 +17,7 @@ import { globalBus } from "game/events";
|
|||
import { BaseLayer, createLayer } from "game/layers";
|
||||
import { createMultiplicativeModifier, createSequentialModifier, Modifier } from "game/modifiers";
|
||||
import { noPersist } from "game/persistence";
|
||||
import Decimal, { DecimalSource, format, formatWhole } from "util/bignum";
|
||||
import Decimal, { DecimalSource, format, formatSmall, formatWhole } from "util/bignum";
|
||||
import { WithRequired } from "util/common";
|
||||
import { render, renderCol, renderRow } from "util/vue";
|
||||
import { computed, ComputedRef, ref, unref } from "vue";
|
||||
|
@ -104,7 +104,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
description: `Print a copy of "${options.name}", which ${options.elfName} will use to improve their skills! Each copy printed will reduce the "${options.buyableName}" price scaling by 0.95x and make ${options.elfName} purchase +10% faster!`,
|
||||
effectDisplay: jsx(() => (
|
||||
<>
|
||||
{format(Decimal.pow(0.95, buyable.totalAmount.value))}x price scaling,{" "}
|
||||
{formatSmall(Decimal.pow(0.95, buyable.totalAmount.value))}x price scaling,{" "}
|
||||
{format(Decimal.div(buyable.totalAmount.value, 10).add(1))}x auto-purchase
|
||||
speed
|
||||
</>
|
||||
|
|
|
@ -278,7 +278,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
enabled: workshop.milestones.extraExpansionMilestone4.earned
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: () => Decimal.add(oil.buildExtractor.amount.value, 1).sqrt(),
|
||||
multiplier: () => Decimal.add(oil.buildExtractor.amount.value, 1),
|
||||
description: "Snowball Level 4",
|
||||
enabled: management.elfTraining.kilnElfTraining.milestones[3].earned
|
||||
}))
|
||||
|
|
|
@ -27,7 +27,7 @@ import { noPersist, persistent } from "game/persistence";
|
|||
import Decimal, { DecimalSource, format, formatGain, formatLimit, formatWhole } from "util/bignum";
|
||||
import { Direction, WithRequired } from "util/common";
|
||||
import { render, renderGrid, renderRow } from "util/vue";
|
||||
import { computed, ref, watch } from "vue";
|
||||
import { computed, ref } from "vue";
|
||||
import boxes from "./boxes";
|
||||
import cloth from "./cloth";
|
||||
import coal from "./coal";
|
||||
|
@ -54,6 +54,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
|
||||
const ema = ref<DecimalSource>(0);
|
||||
|
||||
const lastAutoCuttingAmount = ref<DecimalSource>(0);
|
||||
const lastAutoPlantedAmount = ref<DecimalSource>(0);
|
||||
|
||||
const totalTrees = createSequentialModifier(() => [
|
||||
createAdditiveModifier(() => ({
|
||||
addend: () => Decimal.times(expandingForestBuyable.amount.value, 10),
|
||||
|
@ -326,20 +329,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
})),
|
||||
createAdditiveModifier(() => ({
|
||||
addend: () =>
|
||||
Decimal.sub(lastAutoCuttingAmount.value, lastAutoPlantedAmount.value).max(0),
|
||||
Decimal.sub(lastAutoPlantedAmount.value, lastAutoCuttingAmount.value).max(0),
|
||||
description: "Ivy Level 5",
|
||||
enabled: management.elfTraining.planterElfTraining.milestones[4].earned
|
||||
}))
|
||||
]) as WithRequired<Modifier, "description" | "revert">;
|
||||
const computedAutoCuttingAmount = computed(() => autoCuttingAmount.apply(0));
|
||||
const lastAutoCuttingAmount = ref<DecimalSource>(0);
|
||||
setInterval(
|
||||
() =>
|
||||
watch(computedAutoCuttingAmount, cut => {
|
||||
lastAutoCuttingAmount.value = cut;
|
||||
}),
|
||||
0
|
||||
);
|
||||
|
||||
const manualPlantingAmount = createSequentialModifier(() => [
|
||||
createAdditiveModifier(() => ({
|
||||
|
@ -421,20 +416,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
})),
|
||||
createAdditiveModifier(() => ({
|
||||
addend: () =>
|
||||
Decimal.sub(lastAutoPlantedAmount.value, lastAutoCuttingAmount.value).max(0),
|
||||
Decimal.sub(lastAutoCuttingAmount.value, lastAutoPlantedAmount.value).max(0),
|
||||
description: "Ivy Level 5",
|
||||
enabled: management.elfTraining.planterElfTraining.milestones[4].earned
|
||||
}))
|
||||
]) as WithRequired<Modifier, "description" | "revert">;
|
||||
const computedAutoPlantingAmount = computed(() => autoPlantingAmount.apply(0));
|
||||
const lastAutoPlantedAmount = ref<DecimalSource>(0);
|
||||
setInterval(
|
||||
() =>
|
||||
watch(computedAutoPlantingAmount, planted => {
|
||||
lastAutoPlantedAmount.value = planted;
|
||||
}),
|
||||
0
|
||||
);
|
||||
|
||||
const logGain = createSequentialModifier(() => [
|
||||
createMultiplicativeModifier(() => ({
|
||||
|
@ -711,6 +698,17 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
}
|
||||
}
|
||||
|
||||
const plantingAmount = Decimal.sub(
|
||||
computedAutoPlantingAmount.value,
|
||||
Decimal.sub(lastAutoCuttingAmount.value, lastAutoPlantedAmount.value).max(0)
|
||||
);
|
||||
const cuttingAmount = Decimal.sub(
|
||||
computedAutoCuttingAmount.value,
|
||||
Decimal.sub(lastAutoPlantedAmount.value, lastAutoCuttingAmount.value).max(0)
|
||||
);
|
||||
lastAutoPlantedAmount.value = plantingAmount;
|
||||
lastAutoCuttingAmount.value = cuttingAmount;
|
||||
|
||||
const amountCut = Decimal.min(
|
||||
trees.value,
|
||||
Decimal.times(computedAutoCuttingAmount.value, diff)
|
||||
|
|
|
@ -17,7 +17,11 @@ import { createHotkey } from "features/hotkey";
|
|||
import { createMilestone } from "features/milestones/milestone";
|
||||
import { createResource, displayResource } from "features/resources/resource";
|
||||
import { BaseLayer, createLayer } from "game/layers";
|
||||
import { createExponentialModifier, createMultiplicativeModifier, createSequentialModifier } from "game/modifiers";
|
||||
import {
|
||||
createExponentialModifier,
|
||||
createMultiplicativeModifier,
|
||||
createSequentialModifier
|
||||
} from "game/modifiers";
|
||||
import { noPersist } from "game/persistence";
|
||||
import Decimal, { DecimalSource, format, formatWhole } from "util/bignum";
|
||||
import { Direction } from "util/common";
|
||||
|
@ -54,10 +58,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
createMultiplicativeModifier(() => ({
|
||||
multiplier: computed(() => wrappingPaper.boosts.beach1.value),
|
||||
description: "Beach Wrapping Paper",
|
||||
enabled: computed(() => Decimal.gt(wrappingPaper.boosts.beach1.value,1))
|
||||
enabled: computed(() => Decimal.gt(wrappingPaper.boosts.beach1.value, 1))
|
||||
})),
|
||||
createExponentialModifier(() => ({
|
||||
exponent: 0.95, // Needs fixing
|
||||
exponent: 1 / 0.99,
|
||||
description: "Holly Level 5",
|
||||
enabled: management.elfTraining.cutterElfTraining.milestones[4].earned
|
||||
}))
|
||||
|
|
Loading…
Add table
Reference in a new issue