mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2025-03-14 01:51:40 +00:00
Merge branch 'main' of https://github.com/thepaperpilot/Advent-Incremental into main
This commit is contained in:
commit
28920e6835
2 changed files with 230 additions and 13 deletions
|
@ -324,7 +324,139 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
)
|
||||
})) as BoxesBuyable;
|
||||
const buyables = { logBoxesBuyable, ashBoxesBuyable, coalBoxesBuyable };
|
||||
|
||||
const oreBoxesBuyable = createBuyable(() => ({
|
||||
display: {
|
||||
title: "Carry more ore",
|
||||
description: jsx(() => (
|
||||
<>
|
||||
Use boxes to carry even more ore, boosting their gain
|
||||
<br />
|
||||
<br />
|
||||
<div>
|
||||
Amount: {formatWhole(oreBoxesBuyable.amount.value)}
|
||||
{Decimal.gt(oreBoxesBuyable.freeLevels.value, 0) ? (
|
||||
<> (+{formatWhole(oreBoxesBuyable.freeLevels.value)})</>
|
||||
) : null}
|
||||
</div>
|
||||
</>
|
||||
)),
|
||||
effectDisplay: jsx(() => (
|
||||
<>{format(Decimal.div(oreBoxesBuyable.totalAmount.value, 2).add(1))}x</>
|
||||
)),
|
||||
showAmount: false
|
||||
},
|
||||
resource: noPersist(boxes),
|
||||
cost() {
|
||||
let v = this.amount.value;
|
||||
v = Decimal.pow(0.95, paper.books.boxBook.amount.value).times(v);
|
||||
let scaling = 10;
|
||||
if (management.elfTraining.boxElfTraining.milestones[2].earned.value) {
|
||||
scaling--;
|
||||
}
|
||||
return Decimal.pow(scaling, v).times(1e25).div(dyes.boosts.orange2.value).div(wrappingPaper.boosts.ocean1.value);
|
||||
},
|
||||
visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[3].earned.value),
|
||||
freeLevels: computed(() =>
|
||||
management.elfTraining.boxElfTraining.milestones[0].earned.value
|
||||
? Decimal.max(metalBoxesBuyable.amount.value, 1)
|
||||
.sqrt()
|
||||
.floor()
|
||||
.add(Decimal.max(plasticBoxesBuyable.amount.value, 1).sqrt().floor())
|
||||
: 0
|
||||
),
|
||||
totalAmount: computed(() =>
|
||||
Decimal.add(oreBoxesBuyable.amount.value, oreBoxesBuyable.freeLevels.value)
|
||||
)
|
||||
})) as BoxesBuyable;
|
||||
const metalBoxesBuyable = createBuyable(() => ({
|
||||
display: {
|
||||
title: "Carry more metal",
|
||||
description: jsx(() => (
|
||||
<>
|
||||
Use boxes to carry even more metal, boosting its gain
|
||||
<br />
|
||||
<br />
|
||||
<div>
|
||||
Amount: {formatWhole(metalBoxesBuyable.amount.value)}
|
||||
{Decimal.gt(metalBoxesBuyable.freeLevels.value, 0) ? (
|
||||
<> (+{formatWhole(metalBoxesBuyable.freeLevels.value)})</>
|
||||
) : null}
|
||||
</div>
|
||||
</>
|
||||
)),
|
||||
effectDisplay: jsx(() => (
|
||||
<>{format(Decimal.div(metalBoxesBuyable.totalAmount.value, 2).add(1))}x</>
|
||||
)),
|
||||
showAmount: false
|
||||
},
|
||||
resource: noPersist(boxes),
|
||||
cost() {
|
||||
let v = this.amount.value;
|
||||
v = Decimal.pow(0.95, paper.books.boxBook.amount.value).times(v);
|
||||
let scaling = 15;
|
||||
if (management.elfTraining.boxElfTraining.milestones[2].earned.value) {
|
||||
scaling--;
|
||||
}
|
||||
return Decimal.pow(scaling, v).times(1e28).div(dyes.boosts.orange2.value);
|
||||
},
|
||||
visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[3].earned.value),
|
||||
freeLevels: computed(() =>
|
||||
management.elfTraining.boxElfTraining.milestones[0].earned.value
|
||||
? Decimal.max(oreBoxesBuyable.amount.value, 1)
|
||||
.sqrt()
|
||||
.floor()
|
||||
.add(Decimal.max(plasticBoxesBuyable.amount.value, 1).sqrt().floor())
|
||||
: 0
|
||||
),
|
||||
totalAmount: computed(() =>
|
||||
Decimal.add(metalBoxesBuyable.amount.value, metalBoxesBuyable.freeLevels.value)
|
||||
)
|
||||
})) as BoxesBuyable;
|
||||
const plasticBoxesBuyable = createBuyable(() => ({
|
||||
display: {
|
||||
title: "Carry more plastic",
|
||||
description: jsx(() => (
|
||||
<>
|
||||
Use boxes to carry even more plastic, boosting its gain
|
||||
<br />
|
||||
<br />
|
||||
<div>
|
||||
Amount: {formatWhole(plasticBoxesBuyable.amount.value)}
|
||||
{Decimal.gt(plasticBoxesBuyable.freeLevels.value, 0) ? (
|
||||
<> (+{formatWhole(plasticBoxesBuyable.freeLevels.value)})</>
|
||||
) : null}
|
||||
</div>
|
||||
</>
|
||||
)),
|
||||
effectDisplay: jsx(() => (
|
||||
<>{format(Decimal.div(plasticBoxesBuyable.totalAmount.value, 2).add(1))}x</>
|
||||
)),
|
||||
showAmount: false
|
||||
},
|
||||
resource: noPersist(boxes),
|
||||
cost() {
|
||||
let v = this.amount.value;
|
||||
v = Decimal.pow(0.95, paper.books.boxBook.amount.value).times(v);
|
||||
let scaling = 20;
|
||||
if (management.elfTraining.boxElfTraining.milestones[2].earned.value) {
|
||||
scaling--;
|
||||
}
|
||||
return Decimal.pow(scaling, v).times(1000).div(dyes.boosts.orange2.value);
|
||||
},
|
||||
visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[3].earned.value),
|
||||
freeLevels: computed(() =>
|
||||
management.elfTraining.boxElfTraining.milestones[0].earned.value
|
||||
? Decimal.max(oreBoxesBuyable.amount.value, 1)
|
||||
.sqrt()
|
||||
.floor()
|
||||
.add(Decimal.max(metalBoxesBuyable.amount.value, 1).sqrt().floor())
|
||||
: 0
|
||||
),
|
||||
totalAmount: computed(() =>
|
||||
Decimal.add(plasticBoxesBuyable.amount.value, plasticBoxesBuyable.freeLevels.value)
|
||||
)
|
||||
})) as BoxesBuyable;
|
||||
const buyables2 = { oreBoxesBuyable, metalBoxesBuyable, plasticBoxesBuyable };
|
||||
globalBus.on("update", diff => {
|
||||
if (Decimal.lt(main.day.value, day)) {
|
||||
return;
|
||||
|
@ -378,6 +510,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
row2Upgrades,
|
||||
row3Upgrades,
|
||||
buyables,
|
||||
buyables2,
|
||||
minWidth: 700,
|
||||
generalTabCollapsed,
|
||||
display: jsx(() => (
|
||||
|
|
|
@ -147,7 +147,7 @@ const layer = createLayer(id, () => {
|
|||
if (elf.name == "Star" || elf.name == "Bell") {
|
||||
costMulti /= 3;
|
||||
}
|
||||
const costBase = Decimal.mul(4000, costMulti);
|
||||
const costBase = Decimal.mul(paperElfMilestones[3].earned.value ? 2000 : 4000, costMulti);
|
||||
const expRequiredForNextLevel = computed(() => Decimal.pow(5, level.value).mul(costBase));
|
||||
const level = computed(() =>
|
||||
Decimal.affordGeometricSeries(exp.value, costBase, 5, 0)
|
||||
|
@ -507,7 +507,7 @@ const layer = createLayer(id, () => {
|
|||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Noel Level 3",
|
||||
effectDisplay: "Divide the mining drill cost by ln(Total logs + e)"
|
||||
effectDisplay: "Divide the coal drill cost by ln(Total logs + e)"
|
||||
},
|
||||
visibility: () => showIf(fertilizerElfMilestones[1].earned.value),
|
||||
shouldEarn: () => fertilizerElfTraining.level.value >= 3
|
||||
|
@ -687,11 +687,7 @@ const layer = createLayer(id, () => {
|
|||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Star Level 4",
|
||||
effectDisplay: jsx(() => (
|
||||
<>
|
||||
Multiply XP requirements by 0.95<sup>(total books)</sup>
|
||||
</>
|
||||
))
|
||||
effectDisplay: "Halve xp requirements"
|
||||
},
|
||||
visibility: () => showIf(paperElfMilestones[2].earned.value && main.day.value >= 13),
|
||||
shouldEarn: () => paperElfTraining.level.value >= 4
|
||||
|
@ -849,7 +845,7 @@ const layer = createLayer(id, () => {
|
|||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Peppermint Level 4",
|
||||
effectDisplay: "Unlock another row of coal upgrades"
|
||||
effectDisplay: "Unlock 3 coal upgrades"
|
||||
},
|
||||
visibility: () => showIf(coalDrillElfMilestones[2].earned.value && main.day.value >= 13),
|
||||
shouldEarn: () => coalDrillElfTraining.level.value >= 4
|
||||
|
@ -904,6 +900,88 @@ const layer = createLayer(id, () => {
|
|||
shouldEarn: () => metalElfTraining.level.value >= 5
|
||||
}))
|
||||
] as Array<GenericMilestone>;
|
||||
const oilElfMilestones = [
|
||||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Cocoa Level 1",
|
||||
effectDisplay: "The depth boost to oil gain is better"
|
||||
},
|
||||
shouldEarn: () => oilElfTraining.level.value >= 1
|
||||
})),
|
||||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Cocoa Level 2",
|
||||
effectDisplay: "Total oil gained boosts drill power"
|
||||
},
|
||||
visibility: () => showIf(oilElfMilestones[0].earned.value),
|
||||
shouldEarn: () => oilElfTraining.level.value >= 2
|
||||
})),
|
||||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Cocoa Level 3",
|
||||
effectDisplay: "Double drill power and oil gain"
|
||||
},
|
||||
visibility: () => showIf(oilElfMilestones[1].earned.value),
|
||||
shouldEarn: () => oilElfTraining.level.value >= 3
|
||||
})),
|
||||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Cocoa Level 4",
|
||||
effectDisplay: "Plastics are produced 5x faster but cost 5x as much oil"
|
||||
},
|
||||
visibility: () => showIf(oilElfMilestones[2].earned.value && main.day.value >= 13),
|
||||
shouldEarn: () => oilElfTraining.level.value >= 4
|
||||
})),
|
||||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Cocoa Level 5",
|
||||
effectDisplay: "Unlock another row of oil upgrades"
|
||||
},
|
||||
visibility: () => showIf(oilElfMilestones[3].earned.value && main.day.value >= 13),
|
||||
shouldEarn: () => oilElfTraining.level.value >= 5
|
||||
}))
|
||||
] as Array<GenericMilestone>;
|
||||
const heavyDrillElfMilestones = [
|
||||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Frosty Level 1",
|
||||
effectDisplay: "Oil boosts Star and Bell's xp gain"
|
||||
},
|
||||
shouldEarn: () => heavyDrillElfTraining.level.value >= 1
|
||||
})),
|
||||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Frosty Level 2",
|
||||
effectDisplay: "Oil pumps are cheaper"
|
||||
},
|
||||
visibility: () => showIf(heavyDrillElfMilestones[0].earned.value),
|
||||
shouldEarn: () => heavyDrillElfTraining.level.value >= 2
|
||||
})),
|
||||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Frosty Level 3",
|
||||
effectDisplay: "Oil burners act like there are ^1.5 of them"
|
||||
},
|
||||
visibility: () => showIf(heavyDrillElfMilestones[1].earned.value),
|
||||
shouldEarn: () => heavyDrillElfTraining.level.value >= 3
|
||||
})),
|
||||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Frosty Level 4",
|
||||
effectDisplay: "Heavy drill's ln is now log2.5"
|
||||
},
|
||||
visibility: () => showIf(heavyDrillElfMilestones[2].earned.value && main.day.value >= 13),
|
||||
shouldEarn: () => heavyDrillElfTraining.level.value >= 4
|
||||
})),
|
||||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Frosty Level 5",
|
||||
effectDisplay: "Unlock another row of paper upgrades"
|
||||
},
|
||||
visibility: () => showIf(heavyDrillElfMilestones[3].earned.value && main.day.value >= 13),
|
||||
shouldEarn: () => heavyDrillElfTraining.level.value >= 5
|
||||
}))
|
||||
] as Array<GenericMilestone>;
|
||||
// ------------------------------------------------------------------------------- Milestone display
|
||||
|
||||
const currentShown = persistent<string>("Holly");
|
||||
|
@ -958,7 +1036,9 @@ const layer = createLayer(id, () => {
|
|||
const plasticElfTraining = [paperElfTraining, boxElfTraining, clothElfTraining];
|
||||
const coalDrillElfTraining = createElfTraining(elves.elves.coalDrillElf, coalDrillElfMilestones);
|
||||
const metalElfTraining = createElfTraining(elves.elves.metalElf, metalElfMilestones);
|
||||
const row5Elves = [coalDrillElfTraining, metalElfTraining]
|
||||
const oilElfTraining = createElfTraining(elves.elves.oilElf, oilElfMilestones);
|
||||
const heavyDrillElfTraining = createElfTraining(elves.elves.heavyDrillElf, heavyDrillElfMilestones);
|
||||
const row5Elves = [coalDrillElfTraining, metalElfTraining, oilElfTraining, heavyDrillElfTraining]
|
||||
const elfTraining = {
|
||||
cutterElfTraining,
|
||||
planterElfTraining,
|
||||
|
@ -973,7 +1053,9 @@ const layer = createLayer(id, () => {
|
|||
boxElfTraining,
|
||||
clothElfTraining,
|
||||
coalDrillElfTraining,
|
||||
metalElfTraining
|
||||
metalElfTraining,
|
||||
oilElfTraining,
|
||||
heavyDrillElfTraining
|
||||
};
|
||||
const day12Elves = [
|
||||
cutterElfTraining,
|
||||
|
@ -1003,7 +1085,9 @@ const layer = createLayer(id, () => {
|
|||
boxElfTraining,
|
||||
clothElfTraining,
|
||||
coalDrillElfTraining,
|
||||
metalElfTraining
|
||||
metalElfTraining,
|
||||
oilElfTraining,
|
||||
heavyDrillElfTraining
|
||||
];
|
||||
|
||||
// ------------------------------------------------------------------------------- Update
|
||||
|
@ -1187,7 +1271,7 @@ const layer = createLayer(id, () => {
|
|||
<h3>Build a School</h3>
|
||||
<div>
|
||||
You gotta start somewhere, right? Each school increases the maximum level for
|
||||
elves by 1, maximum of {main.day.value === 12 ? 3 : 5} schools.
|
||||
elves by 1, maximum of {main.days[13].opened ? 5 : 3} schools.
|
||||
</div>
|
||||
<div>
|
||||
You have {formatWhole(schools.amount.value)} schools, which are currently
|
||||
|
|
Loading…
Add table
Reference in a new issue