Skip to content

Commit

Permalink
do certain updates + changes to some balancing
Browse files Browse the repository at this point in the history
sure
  • Loading branch information
QnoraeT committed Nov 3, 2023
1 parent 501fe0f commit 62e0697
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 56 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<br>
<button id="simplify_tab_simplify" onclick="switchTab(0, 1);">Main</button>
<button id="simplify_tab_tts" onclick="switchTab(1, 1);updateChallenge('all');">TTS Challenges</button>
<button id="simplify_tab_simpUpg" onclick="switchTab(2, 1);">Simplify Upgrades</button>
</div>
<br>
<div id = "simpExP">
Expand Down
18 changes: 9 additions & 9 deletions src/comp.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ let COMP_FUNCTIONS = {
player.comps.array[index].costFactors += "<br> MC4 Completion: -" + format(player.simplify.challenge.MC4effect, true, 3) + " (" + format(temp, true) + " buys)"
}

player.comps.array[index].trueCost = temp
player.comps.array[index].trueCost = temp;

let k = -1
let k = -1;
for (let i = Object.keys(player.scaling.ComPs).length - 1; i >= 0; i--) {
if (temp.gte(player.scaling.ComPs[i].start)) {
k = Math.max(k, i)
temp = scale(["P", "E", "P"][i], temp, false, player.scaling.ComPs[i].start, player.scaling.ComPs[i].strength, 3, 0)[0]
k = Math.max(k, i);
temp = scale(["P", "E", "P"][i], temp, false, player.scaling.ComPs[i].start, player.scaling.ComPs[i].strength, 3, 0)[0];
}
}

Expand All @@ -65,8 +65,8 @@ let COMP_FUNCTIONS = {
}

if (player.misc.inChallenge.includes("simp2") && index >= 2) {
cost = cost.mul(10000);
player.comps.array[index].costFactors += "<br> MC3 Scaling: x" + format(new Decimal(10000), true, 3) + " (" + format(cost, true) + ")"
cost = cost.mul(10);
player.comps.array[index].costFactors += "<br> MC3 Scaling: x" + format(new Decimal(10), true, 3) + " (" + format(cost, true) + ")"
}

if (player.misc.inChallenge.includes("simp2")) {
Expand Down Expand Up @@ -152,8 +152,8 @@ let COMP_FUNCTIONS = {
let temp = Decimal.clamp(player.simplify.challenge.JC1Time.div(40), 0, 1)
player.comps.array[index].multi = player.comps.array[index].multi.pow(Decimal.add(0.3, temp.mul(0.3)));
player.comps.array[index].multiFactors += "<br> Japanese Symbol Challenge 1: ^" + format(new Decimal(Decimal.add(0.3, temp.mul(0.3))), true, 3) + " (" + format(player.comps.array[index].multi, true) + "x)"
player.comps.array[index].multi = player.comps.array[index].multi.div(Decimal.pow(10, Decimal.sub(15, temp.mul(8))));
player.comps.array[index].multiFactors += "<br> Japanese Symbol Challenge 1: /" + format(Decimal.pow(10, Decimal.sub(15, temp.mul(8))), true) + " (" + format(player.comps.array[index].multi, true) + "x)"
player.comps.array[index].multi = player.comps.array[index].multi.div(Decimal.pow(10, Decimal.sub(12, temp.mul(8))));
player.comps.array[index].multiFactors += "<br> Japanese Symbol Challenge 1: /" + format(Decimal.pow(10, Decimal.sub(12, temp.mul(8))), true) + " (" + format(player.comps.array[index].multi, true) + "x)"
}

if (player.misc.inChallenge.includes("simp7")) {
Expand All @@ -170,7 +170,7 @@ let COMP_FUNCTIONS = {
if (player.simplify.challenge.completed[4]) {
let temp = dOne
for (let comp = index; comp > 1; --comp) {
temp = temp.mul(player.comps.array[comp].multi.pow(0.1))
temp = temp.mul(player.comps.array[comp].multi.pow(0.033))
}
player.comps.array[index].multi = player.comps.array[index].multi.mul(temp);
player.comps.array[index].multiFactors += "<br> JC1 Effect: x" + format(temp, true) + " (" + format(player.comps.array[index].multi, true) + "x)"
Expand Down
8 changes: 5 additions & 3 deletions src/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ function setupHTMLSimplifyGeneral() {
toHTMLvar(`simplify`);
toHTMLvar(`simplify_tab_simplify`);
toHTMLvar(`simplify_tab_tts`);
toHTMLvar(`simplify_tab_simpUpg`);
toHTMLvar(`SER`);
toHTMLvar(`SEUPG1`);
toHTMLvar(`simpEnergy`);
Expand All @@ -223,6 +224,7 @@ function setupHTMLSimplifyGeneral() {
html[`simplify_tab_tts`].setClasses({ defaultButton: true });
html[`SER`].setClasses({ defaultButton: true, defaultSimplifyTab: true });
html[`SEUPG1`].setClasses({ defaultButton: true, defaultSimplifyTab: true });
html[`simplify_tab_simpUpg`].setClasses({ defaultButton: true, defaultSimplifyTab: true });
}

function setupHTMLSimplifyXP() {
Expand Down Expand Up @@ -301,10 +303,10 @@ function updateCompHTML() {
for (let comp = 1; comp <= 8; ++comp) {
html[`gen-comp${comp}`].setDisplay(comp < player.comps.compVisible);
let tr = calcCompxPerSecond(comp).add(player.comps.array[comp].amount).pow(player.comps.compExp).sub(player.comps.array[comp].amount.pow(player.comps.compExp));
const perSecondText = " (" + format(tr, false, tr < 10 ? 1 : 3) + "/s),";
const perSecondText = " (" + format(tr, false, tr < 10 ? 1 : 0, 3) + "/s),";
const boughtText = " [ " + format(player.comps.array[comp].bought) + " ] ";
const text = tr.gt(0) ? perSecondText + boughtText : boughtText;
html[`gen-comp${comp}-amount`].setTxt(format(player.comps.array[comp].trueAmount, false, 3) + " " + text);
html[`gen-comp${comp}-amount`].setTxt(format(player.comps.array[comp].trueAmount, true, 3) + " " + text);
html[`gen-comp${comp}-cost`].setTxt("Cost: " + format(player.comps.array[comp].cost, true, 3));
let can = player.misc.points.gte(player.comps.array[comp].cost);
html[`gen-comp${comp}-cost`].setClasses({ buttonRight: true, defaultButton: true, compNo: !can, compYes: can });
Expand Down Expand Up @@ -346,7 +348,7 @@ function updateSimpHTML() {
case 0:
if (player.simplify.upgrades.simplifyMainUPG < 1) { break; }
for (let i = 0; i < 4; i++) {
html[`simpEXP${i + 1}`].setTxt(`You have ${format(player.simplify[simplifyXPTypes[i]].allocated, true)} SE allocated to ${format(player.simplify[simplifyXPTypes[i]].trueValue, true, 1)} ${simplifyXPTypes[i]}, ${simplifyXPDesc[i]}${format(player.simplify[simplifyXPTypes[i]].effect, true, 3)}.`);
html[`simpEXP${i + 1}`].setTxt(`You have ${format(player.simplify[simplifyXPTypes[i]].allocated, true, 0)} SE allocated to ${format(player.simplify[simplifyXPTypes[i]].trueValue, true, 3, 3)} ${simplifyXPTypes[i]}, ${simplifyXPDesc[i]}${format(player.simplify[simplifyXPTypes[i]].effect, true, 3)}.`);
}
break;
case 1:
Expand Down
9 changes: 5 additions & 4 deletions src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const simpChal = {
simpChalDesc: {
1: "Max All is disabled. ComP costs grow by 2^x per purchase. Multipliers are ^0.75 then /" + format(new Decimal(1000), true) + ".",
2: "Max All is disabled. ComP's post-150 scaling now starts at 1. Multiplier per bought is lowered by 1, PP and MP's effect is ^0.5 and MP's effect is then /" + format(new Decimal(1000), true) + ".",
3: "Max All is disabled. ComP's costs are squared. 2nd and further ComP's costs are multiplied by " + format(new Decimal(10_000), true) + " before being squared. Gain is ^0.5, and your goal is " + format(new Decimal(1e20), true) + ".",
3: "Max All is disabled. ComP's costs are squared. 2nd and further ComP's costs are multiplied by " + format(new Decimal(10), true) + " before being squared. Your gain is also square-rooted.",
4: "Max All is disabled. ComP's costs act like their bought amount is squared. This also means that post-150 scaling starts earlier, and that MC3's effect is slightly stronger. All multipliers to ComPs and all xP effects are ^0.4.",
5: "All ComP multipliers get severely reduced every time any ComP gets bought. This multiplier slowly goes back to /" + format(new Decimal(1e8), true) + " in 40 seconds. PP has no effect.",
5: "All ComP multipliers get severely reduced every time any ComP gets bought. This multiplier slowly goes back to /" + format(new Decimal(1e4), true) + " in 40 seconds. PP has no effect.",
6: "Your base gain is effected by the same power that the ComP amount is being affected by. You must have " + format(new Decimal("1e395"), true) + " to complete this challenge.",
7: "All xP effects are neutralized.",
8: "All ComP's multipliers are affected by the ComP exponent to amount, and PP, MP, 1P, and DP's effects are ^0.5.",
7: `All xP effects are neutralized. Your goal is ${format(new Decimal(1e15))}.`,
8: "All ComP's multipliers are affected by the ComP exponent to amount, and PP, MP, 1P, and DP's effects are cube rooted. The ComP exponent has also been reduced to 0.4.",
9: "Max All is disabled. Your ComP costs scale entirely based off your total ComPs bought. MP, 1P, and DP's effects now only boost PP, Gain is reduced, and their individual effects are set to as if you had none.",
10: "ComP's post 150 scaling slowly gets earlier over time, and gets delayed by some amount per purchase. Your gain is ^0.5 with /" + format(new Decimal(1e150), true) + ".",
11: "ComP's multipliers are only effective for 400ms before they quickly decay. This is reset every time you buy any ComP. All ComPs' multipliers are rooted by 2.",
Expand Down Expand Up @@ -54,6 +54,7 @@ const dOne = new Decimal(1);
const dTwo = new Decimal(2);
const dTen = new Decimal(10);
const ln10 = dTen.ln();
const cbr2 = new Decimal(2).cbrt();
const simplifyChalTypes = ["🔎", "🔰", "🚛", "777"];
const simplifyXPTypes = ["PP", "MP", "OP", "DP"];
const simplifyXPColor = ["#FF0000", "#FFFF00", "#00FF00", "#0000FF"];
Expand Down
88 changes: 50 additions & 38 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,58 +12,69 @@ function calcPointsPerSecond() {
let temp = player.comps.array[1].trueAmount.mul(player.comps.array[1].multi);
if (player.misc.inChallenge.includes("simp2")) { temp = temp.root(2); }
if (player.misc.inChallenge.includes("simp5")) { temp = temp.pow(player.comps.compExp); }
if (player.misc.inChallenge.includes("simp8")) { temp = temp.root(3); }
if (player.misc.inChallenge.includes("simp8")) { temp = temp.root(4); }
if (player.misc.inChallenge.includes("simp9")) { temp = temp.root(2).div(1e150); }
if (player.misc.inChallenge.includes("simp13")) { temp = temp.pow(0.05); }
return temp;
}

function getProgress() { // progressBar = 0-1
progressBar = dOne
progressBarText = "All done! "
if (player.misc.inSChallenge) {
progressBar = dOne;
progressBarProg = (progressBar.toNumber() * 100).toFixed(2) + "%";
progressBarText = "All done! ";
let canSet = true
let m
if (player.misc.inSChallenge && canSet) {
progressBar = player.misc.totalPointsInSimplify.add(1).log(player.simplify.main.simplifyReq);
progressBarText = "Complete Challenge: ";
return;
m = progressBar.clamp(0, 1);
progressBarText = `Complete Challenge: ${(m.toNumber() * 100).toFixed(2)}% ( ${format(player.misc.totalPointsInSimplify)} / ${format(player.simplify.main.simplifyReq)} )`;
canSet = false
}
if (player.simplify.upgrades.simplifyMainUPG == 6) {
progressBar = player.simplify.main.simplifyEnergy.add(getSimplifyGain()).div(1.2e27).add(1).log(Decimal.div(7.2e38, 1.2e27));
progressBarText = "Next feature: ";
return;
if (player.simplify.upgrades.simplifyMainUPG == 6 && canSet) {
progressBar = player.simplify.main.simplifyEnergy.add(getSimplifyGain()).div(1.2e27).max(1).log(Decimal.div(7.2e38, 1.2e27));
m = progressBar.clamp(0, 1);
progressBarText = `Next feature: ${(m.toNumber() * 100).toFixed(2)}% ( ${format(player.simplify.main.simplifyEnergy.add(getSimplifyGain()))} / 720.000 UDc )`;
canSet = false
}
if (player.simplify.upgrades.simplifyMainUPG == 5) {
progressBar = player.simplify.main.simplifyEnergy.add(getSimplifyGain()).div(2.4e17).add(1).log(Decimal.div(1.2e27, 2.4e17));
progressBarText = "Next feature: ";
return;
if (player.simplify.upgrades.simplifyMainUPG == 5 && canSet) {
progressBar = player.simplify.main.simplifyEnergy.add(getSimplifyGain()).div(2.4e17).max(1).log(Decimal.div(1.2e27, 2.4e17));
m = progressBar.clamp(0, 1);
progressBarText = `Next feature: ${(m.toNumber() * 100).toFixed(2)}% ( ${format(player.simplify.main.simplifyEnergy.add(getSimplifyGain()))} / 1.200 Oc )`;
canSet = false
}
if (player.simplify.upgrades.simplifyMainUPG == 4) {
progressBar = player.simplify.main.simplifyEnergy.add(getSimplifyGain()).div(6e9).add(1).log(Decimal.div(2.4e17, 6e9));
progressBarText = "Next feature: ";
return;
if (player.simplify.upgrades.simplifyMainUPG == 4 && canSet) {
progressBar = player.simplify.main.simplifyEnergy.add(getSimplifyGain()).div(6e9).max(1).log(Decimal.div(2.4e17, 6e9));
m = progressBar.clamp(0, 1);
progressBarText = `Next feature: ${(m.toNumber() * 100).toFixed(2)}% ( ${format(player.simplify.main.simplifyEnergy.add(getSimplifyGain()))} / 240.000 Qa )`;
canSet = false
}
if (player.simplify.upgrades.simplifyMainUPG == 3) {
progressBar = player.simplify.main.simplifyEnergy.add(getSimplifyGain().add(1)).div(20000).max(1).log(Decimal.div(6e9, 20000));
progressBarText = "Next feature: ";
return;
if (player.simplify.upgrades.simplifyMainUPG == 3 && canSet) {
progressBar = player.simplify.main.simplifyEnergy.add(getSimplifyGain()).div(20000).max(1).log(Decimal.div(6e9, 20000));
m = progressBar.clamp(0, 1);
progressBarText = `Next feature: ${(m.toNumber() * 100).toFixed(2)}% ( ${format(player.simplify.main.simplifyEnergy.add(getSimplifyGain()))} / 6.000 B )`;
canSet = false
}
if (player.simplify.upgrades.simplifyMainUPG == 2) {
progressBar = player.simplify.main.simplifyEnergy.add(getSimplifyGain().add(1)).log(Decimal.div(20000, 10));
progressBarText = "Next feature: ";
return;
if (player.simplify.upgrades.simplifyMainUPG == 2 && canSet) {
progressBar = player.simplify.main.simplifyEnergy.add(getSimplifyGain()).div(10).max(1).log(Decimal.div(20000, 10));
m = progressBar.clamp(0, 1);
progressBarText = `Next feature: ${(m.toNumber() * 100).toFixed(2)}% ( ${format(player.simplify.main.simplifyEnergy.add(getSimplifyGain()))} / 20,000 )`;
canSet = false
}
if (player.simplify.upgrades.simplifyMainUPG == 1) {
if (player.simplify.upgrades.simplifyMainUPG == 1 && canSet) {
progressBar = player.simplify.main.simplifyEnergy.add(getSimplifyGain()).div(10);
progressBarText = "Next feature: ";
return;
m = progressBar.clamp(0, 1);
progressBarText = `Next feature: ${(m.toNumber() * 100).toFixed(2)}% ( ${format(player.simplify.main.simplifyEnergy.add(getSimplifyGain()))} / 10.000 )`;
canSet = false
}
if (player.misc.totalPoints.lt(1e12)) {
if (player.misc.totalPoints.lt(1e12) && canSet) {
progressBar = player.misc.totalPoints.div(10).max(1).log(1e11);
progressBarText = "Next layer: ";
return;
m = progressBar.clamp(0, 1);
progressBarText = `Next layer: ${(m.toNumber() * 100).toFixed(2)}% ( ${format(player.misc.totalPoints)} / 1.000e12 )`;
canSet = false
}
if (player.simplify.upgrades.simplifyMainUPG == 0) {
progressBarText = "Look in the \"Simplify\" tab! ";
return;
if (player.simplify.upgrades.simplifyMainUPG == 0 && canSet) {
progressBarText = `Look in the \"Simplify\" tab! `;
canSet = false
}
}

Expand All @@ -78,13 +89,14 @@ function getChalEffects() {
player.simplify.challenge.SC3effect = temp;

temp = dOne;
if (player.simplify.challenge.completed[3]) { temp = player.misc.points.max(10).log(10).sub(1).div(4).add(1).pow(0.4).sub(1); }
if (player.simplify.challenge.completed[3]) { temp = player.misc.points.max(10).log(10).log(10).pow(2); }
temp = Decimal.pow(10, scale("EP", temp.add(1).log(10), false, 2.30102999, 1, 1.5, 0)[0]); // this is a double log softcap lmfao
player.simplify.challenge.MC4effect = temp;

temp = new Decimal(0.8);
if (player.simplify.challenge.completed[5]) { temp = temp.add(0.025); }
if (player.misc.inChallenge.includes("simp11")) { temp = new Decimal(0.5); }
if (player.misc.inChallenge.includes("simp7")) { temp = new Decimal(0.4); }
player.comps.compExp = temp;

temp = new Decimal(150);
Expand All @@ -111,8 +123,8 @@ function getChalEffects() {
player.simplify.main.SEExp = temp;

temp = new Decimal(1e12);
if (player.misc.inChallenge.includes("simp2")) { temp = new Decimal(1e20); }
if (player.misc.inChallenge.includes("simp5")) { temp = new Decimal("1e395"); }
if (player.misc.inChallenge.includes("simp6")) { temp = new Decimal("1e15"); }
if (player.misc.inChallenge.includes("simp12")) { temp = new Decimal(1.111e111); }
if (player.misc.inChallenge.includes("simp14")) { temp = new Decimal(1e55); }
if (player.misc.inChallenge.includes("simp15")) { temp = new Decimal(1.797693e308); }
Expand Down Expand Up @@ -324,7 +336,7 @@ window.addEventListener('DOMContentLoaded', () => {
}

// display
document.getElementById("progressBar1").innerText = progressBarText + (progressBar.toNumber() * 100).toFixed(2) + "%";
document.getElementById("progressBar1").innerText = progressBarText;
document.getElementById("progressBar1").style.width = `calc(${progressBar.toNumber() * 100}% - 20px)`;
document.getElementById("progBarBase").style.width = `calc(100% - 20px)`;
updateHTML();
Expand Down
2 changes: 1 addition & 1 deletion src/simplify.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function simplifyXPtick(type, tickRate) {
}
if (player.misc.inChallenge.includes("simp3")) { temp = temp.pow(0.4); }
if (player.misc.inChallenge.includes("simp6")) { temp = dOne; }
if (player.misc.inChallenge.includes("simp7")) { temp = temp.pow(0.5); }
if (player.misc.inChallenge.includes("simp7")) { temp = temp.root(3); }
player.simplify[simplifyXPTypes[type]].effect = temp;
}

Expand Down
22 changes: 22 additions & 0 deletions src/utils/funcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,26 @@ function altFactorial(input) {
t += 163879 / (209018880 * (i ** 5))
t += 5246819 / (75246796800 * (i ** 6))
return Decimal.mul(r, t)
}

function inverseQuad(x, a, b, c) { // inverse of ax^2+bx+c
x = new Decimal(x)
a = new Decimal(a)
b = new Decimal(b)
c = new Decimal(c)

return b.pow(2).add(x.mul(a).mul(4)).sub(a.mul(c).mul(4)).sqrt().sub(b).div(a.mul(2))
}

function inverseCube(x, a, b, c, d) { // inverse of ax^3+bx^2+cx+d
x = new Decimal(x)
a = new Decimal(a)
b = new Decimal(b)
c = new Decimal(c)
d = new Decimal(d)

let w = a.pow(2).mul(d).mul(27).sub(x.mul(a.pow(2)).mul(27)).sub(a.mul(b).mul(c).mul(9)).add(b.pow(3).mul(2))
let m = a.mul(c).mul(3).sub(b.pow(2))
let we = w.pow(2).add(m.pow(3).mul(4)).sqrt().add(w).cbrt()
return m.mul(cbr2).div(a.mul(3).mul(we)).sub(b.div(a.mul(3))).sub(we.div(a.mul(cbr2).mul(3)))
}
2 changes: 1 addition & 1 deletion src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function format(number, fixed, dec = 3, expdec = 3) {
return numberWithCommas(n.toNumber().toFixed(dec));
} else if (n.lt(abbExp)) {
let abb = n.log(1000).mul(1.000000001).floor()
return `${n.div(Decimal.pow(1000, abb)).toNumber().toFixed(dec)} ${abbSuffixes[abb]}`
return `${n.div(Decimal.pow(1000, abb)).toNumber().toFixed(expdec)} ${abbSuffixes[abb]}`
} else if (n.lt("e1e6")) {
let exp = n.log(10).mul(1.000001).floor()
return `${n.div(Decimal.pow(10, exp)).toNumber().toFixed(expdec)}e${format(exp, fixed, 0, expdec)}`
Expand Down

0 comments on commit 62e0697

Please sign in to comment.