Merge remote-tracking branch 'origin/main' into days-15-16

This commit is contained in:
Chunkybanana 2022-12-15 01:12:24 +00:00
commit c808cad0d1
6 changed files with 41 additions and 22 deletions

View file

@ -169,7 +169,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
return Decimal.pow(0.95, paper.books.bonfireBook.totalAmount.value).times(10);
},
inverseCost(x: DecimalSource) {
return Decimal.div(x, Decimal.pow(0.95, paper.books.bonfireBook.totalAmount.value).times(10)).floor();
return Decimal.div(
x,
Decimal.pow(0.95, paper.books.bonfireBook.totalAmount.value).times(10)
).floor();
},
display: jsx(() => (
<>
@ -301,10 +304,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
inverseCost(x: DecimalSource) {
if (management.elfTraining.coalDrillElfTraining.milestones[2].earned.value) {
x = Decimal.div(x, 10);
x = Decimal.mul(x, 10);
}
if (management.elfTraining.fertilizerElfTraining.milestones[2].earned.value) {
x = Decimal.div(x, Decimal.add(trees.totalLogs.value, Math.E).ln());
x = Decimal.mul(x, Decimal.add(trees.totalLogs.value, Math.E).ln());
}
let v = Decimal.div(x, 10).log(1.15);
v = v.div(Decimal.pow(0.95, paper.books.coalDrillBook.totalAmount.value));

View file

@ -11,7 +11,7 @@ import { main } from "data/projEntry";
import { createBar, GenericBar } from "features/bars/bar";
import { GenericBuyable } from "features/buyable";
import { ClickableOptions } from "features/clickables/clickable";
import { jsx, showIf } from "features/feature";
import { jsx, showIf, Visibility } from "features/feature";
import { createMilestone } from "features/milestones/milestone";
import { createReset } from "features/reset";
import { Resource } from "features/resources/resource";
@ -110,6 +110,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
coal.betterFertilizer.bought.value = true;
coal.unlockKiln.bought.value = true;
coal.efficientSmelther.bought.value = true;
coal.arsonistAssistance.bought.value = true;
coal.refinedCoal.bought.value = true;
coal.coloredFire.bought.value = true;
}
});
}
@ -585,6 +588,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
(isArray(options.buyable) ? options.buyable : [options.buyable]).forEach(
buyable => {
if (unref(buyable.visibility) !== Visibility.Visible) {
return;
}
const buyAmount = Decimal.min(
Decimal.sub(
buyable.inverseCost(buyable.resource?.value),

View file

@ -185,7 +185,7 @@ const layer = createLayer(id, () => {
});
const expRequiredForNextLevel = computed(() =>
Decimal.pow(5, level.value).mul(costBase.value)
)
);
const level = computed(() =>
Decimal.affordGeometricSeries(exp.value, costBase.value, 5, 0)
.min(schools.amount.value)
@ -423,7 +423,7 @@ const layer = createLayer(id, () => {
createMilestone(() => ({
display: {
requirement: "Hope Level 4",
effectDisplay: "Unlock an elf that autobuys mining drills."
effectDisplay: "Unlock an elf that autobuys coal drills."
},
visibility: () => showIf(expanderElfMilestones[2].earned.value && main.day.value >= 13),
shouldEarn: () => expandersElfTraining.level.value >= 4
@ -601,7 +601,7 @@ const layer = createLayer(id, () => {
createMilestone(() => ({
display: {
requirement: "Joy Level 3",
effectDisplay: "Mining drill is 2x more powerful"
effectDisplay: "Coal drill is 2x more powerful"
},
visibility: () => showIf(smallfireElfMilestones[1].earned.value),
shouldEarn: () => smallfireElfTraining.level.value >= 3
@ -644,7 +644,7 @@ const layer = createLayer(id, () => {
createMilestone(() => ({
display: {
requirement: "Faith Level 3",
effectDisplay: "Mining drill is 2x more powerful"
effectDisplay: "Coal drill is 2x more powerful"
},
visibility: () => showIf(bonfireElfMilestones[1].earned.value),
shouldEarn: () => bonfireElfTraining.level.value >= 3
@ -685,7 +685,7 @@ const layer = createLayer(id, () => {
createMilestone(() => ({
display: {
requirement: "Snowball Level 3",
effectDisplay: "Mining drill is 2x more powerful"
effectDisplay: "Coal drill is 2x more powerful"
},
visibility: () => showIf(kilnElfMilestones[1].earned.value),
shouldEarn: () => kilnElfTraining.level.value >= 3
@ -861,7 +861,7 @@ const layer = createLayer(id, () => {
createMilestone(() => ({
display: {
requirement: "Peppermint Level 1",
effectDisplay: "The mining drill exponent is increased from 2 to 2.5"
effectDisplay: "The coal drill exponent is increased from 2 to 2.5"
},
shouldEarn: () => coalDrillElfTraining.level.value >= 1
})),
@ -1396,7 +1396,8 @@ 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.days[13].opened.value ? 5 : 3} schools.
elves by 1, maximum of {main.days[advancedDay - 1].opened.value ? 5 : 3}{" "}
schools.
</div>
<div>
You have {formatWhole(schools.amount.value)} schools, which are currently

View file

@ -101,14 +101,14 @@ 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**3);
if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100 ** 3);
v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v);
return Decimal.pow(1.3, v).times(2.5e4);
},
inverseCost(x: DecimalSource) {
let v = Decimal.div(x, 2.5e4).log(1.3);
v = v.div(Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value));
if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100**3).root(4);
if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100 ** 3).root(4);
return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
},
display: jsx(() => (
@ -165,14 +165,14 @@ 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**3);
if (Decimal.gte(v, 50)) v = Decimal.pow(v, 4).div(50 ** 3);
v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v);
return Decimal.pow(2, v).times(1e5);
},
inverseCost(x: DecimalSource) {
let v = Decimal.div(x, 1e5).log(2);
v = v.div(Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value));
if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50**3).root(4);
if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50 ** 3).root(4);
return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
},
display: jsx(() => (
@ -227,14 +227,16 @@ const layer = createLayer(id, function (this: BaseLayer) {
resource: metal.metal,
cost() {
let v = new Decimal(this.amount.value);
if (Decimal.gte(v, 10)) v = Decimal.pow(v, 4).div(10**3);
if (Decimal.gte(v, 10)) v = Decimal.pow(v, 4).div(10 ** 3);
if (Decimal.gte(v, 1e3)) v = Decimal.pow(v, 4).div(1e3 ** 3);
v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v);
return Decimal.pow(8, v).times(2e5);
},
inverseCost(x: DecimalSource) {
let v = Decimal.div(x, 2e5).log(8);
v = v.div(Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value));
if (Decimal.gte(v, 10)) v = Decimal.mul(v, 10**3).root(4);
if (Decimal.gte(v, 1e3)) v = Decimal.mul(v, 1e3 ** 3).root(4);
if (Decimal.gte(v, 10)) v = Decimal.mul(v, 10 ** 3).root(4);
return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
},
display: jsx(() => (

View file

@ -125,6 +125,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
scaling--;
}
let cost = Decimal.pow(scaling, v).times(10);
if(["Peppermint", "Twinkle", "Cocoa", "Frosty"].includes(options.elfName)){
cost = cost.mul(1e31)
}
if (management.elfTraining.paperElfTraining.milestones[0].earned.value) {
cost = Decimal.div(cost, sumBooks.value.max(1));
}
@ -146,7 +149,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
scaling--;
}
let v = Decimal.div(x, 10).log(scaling);
let v = Decimal.div(x, 10)
if(["Peppermint", "Twinkle", "Cocoa", "Frosty"].includes(options.elfName)){
v = v.div(1e31)
}
v = v.log(scaling);
v = v.div(Decimal.pow(0.95, paperBook.totalAmount.value));
if (Decimal.gte(v, 10000)) v = Decimal.mul(v, 10000).root(2);

View file

@ -210,14 +210,14 @@ const layer = createLayer(id, function (this: BaseLayer) {
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, 2e6)) v = Decimal.pow(v, 2).div(2e6);
if (Decimal.gte(v, 2e30)) v = Decimal.pow(v, 10000).div(Decimal.pow(2e30, 9999));
if (Decimal.gte(v, 2e30)) v = Decimal.pow(v, 10).div(Decimal.pow(2e30, 9));
v = Decimal.pow(0.95, paper.books.cuttersBook.totalAmount.value).times(v);
return Decimal.times(100, v).add(200);
},
inverseCost(x: DecimalSource) {
let v = Decimal.sub(x, 200).div(100);
v = v.div(Decimal.pow(0.95, paper.books.cuttersBook.totalAmount.value));
if (Decimal.gte(v, 2e30)) v = Decimal.mul(v, Decimal.pow(2e30, 9999)).root(10000);
if (Decimal.gte(v, 2e30)) v = Decimal.mul(v, Decimal.pow(2e30, 9)).root(10);
if (Decimal.gte(v, 2e6)) v = Decimal.mul(v, 2e6).root(2);
if (Decimal.gte(v, 200)) v = Decimal.mul(v, 200).root(2);
if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50).root(2);
@ -236,7 +236,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
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, 2e6)) v = Decimal.pow(v, 2).div(2e6);
if (Decimal.gte(v, 2e30)) v = Decimal.pow(v, 10000).div(Decimal.pow(2e30, 9999));
if (Decimal.gte(v, 2e30)) v = Decimal.pow(v, 10).div(Decimal.pow(2e30, 9));
v = Decimal.pow(0.95, paper.books.plantersBook.totalAmount.value).times(v);
let cost = Decimal.times(100, v).add(200);
if (management.elfTraining.planterElfTraining.milestones[3].earned.value) {
@ -250,7 +250,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
let v = Decimal.sub(x, 200).div(100);
v = v.div(Decimal.pow(0.95, paper.books.plantersBook.totalAmount.value));
if (Decimal.gte(v, 2e30)) v = Decimal.mul(v, Decimal.pow(2e30, 9999)).root(10000);
if (Decimal.gte(v, 2e30)) v = Decimal.mul(v, Decimal.pow(2e30, 9)).root(10);
if (Decimal.gte(v, 2e6)) v = Decimal.mul(v, 2e6).root(2);
if (Decimal.gte(v, 200)) v = Decimal.mul(v, 200).root(2);
if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50).root(2);