From b956a8ef9ddf942e7987d8ab8b01db43ab2ed31a Mon Sep 17 00:00:00 2001 From: wktr <94459237+WiktorProj@users.noreply.github.com> Date: Sat, 5 Oct 2024 12:10:48 +0200 Subject: [PATCH] 0.6 --- MeTMT/index.html | 4 +- MeTMT/js/layers.js | 175 +++++++++++++++++++++++++----- MeTMT/js/mod.js | 31 +++--- MeTMT/js/utils/NumberFormating.js | 33 ++++++ MeTMT/js/utils/options.js | 5 + 5 files changed, 204 insertions(+), 44 deletions(-) diff --git a/MeTMT/index.html b/MeTMT/index.html index ccda4ea..600620c 100644 --- a/MeTMT/index.html +++ b/MeTMT/index.html @@ -90,7 +90,9 @@

Please check the Discord to see if there are new content updates!


The Modding Tree Discord
  • Main Prestige Tree server
  • + v-bind:style="{'font-size': '16px'}">Main Prestige Tree server
    +
  • MetaTree server
  • diff --git a/MeTMT/js/layers.js b/MeTMT/js/layers.js index 10f842f..a341c57 100644 --- a/MeTMT/js/layers.js +++ b/MeTMT/js/layers.js @@ -65,9 +65,15 @@ addLayer("+", { ["display-text", function() { if (player['+'].points.gte(20)) {return "- +3 Upgrades for infinity layer"} },], ["display-text", - function() { if (player['+'].points.gte(21)) {return "- ^0.96 point gain"} },], + function() { if (player['+'].points.gte(21)) {return "- ^0.98 point gain"} },], ["display-text", function() { if (player['+'].points.gte(22)) {return `- Start gaining omega, and unlock omega upgrades`} },], + ["display-text", + function() { if (player['+'].points.gte(23)) {return `- x2 omega`} },], + ["display-text", + function() { if (player['+'].points.gte(24)) {return `- Automate ultra upgrades`} },], + ["display-text", + function() { if (player['+'].points.gte(25)) {return `- Unlock multiplier`} },], ["display-text", "

    Please like this game the colors took so long ;-;

    " ], @@ -80,7 +86,7 @@ addLayer("+", { help: { title: "Help for colors and sizes", body() { - return "

    Big text

    means that something is dynamic
    Colored text with a shadow mean layers/layer points
    There are currently 8 colors that mean something:
    Points
    Addition layer
    " + (player['+'].points.gte(1) ? "Prestige" : makeid(8)) + " layer
    " + (player['+'].points.gte(5) ? "Rebirth" : makeid(7)) + " layer
    " + (player['+'].points.gte(8) ? "Mega" : makeid(4)) + " layer
    " + (player['+'].points.gte(11) ? "Ultra" : makeid(5)) + " layer
    " + (player['+'].points.gte(19) ? "Infinity" : makeid(8)) + ` layer
    ` + (player['+'].points.gte(19) ? "Omega" : makeid(5)) + "
    Colored dynamic text means that it uses a formula based off of the colors above" + return "

    Big text

    means that something is dynamic
    Colored text with a shadow mean layers/layer points
    There are currently 9 colors that mean something:
    Points
    Addition layer
    " + (player['+'].points.gte(1) ? "Prestige" : makeid(8)) + " layer
    " + (player['+'].points.gte(5) ? "Rebirth" : makeid(7)) + " layer
    " + (player['+'].points.gte(8) ? "Mega" : makeid(4)) + " layer
    " + (player['+'].points.gte(11) ? "Ultra" : makeid(5)) + " layer
    " + (player['+'].points.gte(19) ? "Infinity" : makeid(8)) + ` layer
    ` + (player['+'].points.gte(22) ? "Omega" : makeid(5)) + "
    " + (player['+'].points.gte(25) ? "Multiplier" : makeid(10)) + " layer
    Colored dynamic text means that it uses a formula based off of the colors above" }, }, cap: { @@ -96,7 +102,7 @@ addLayer("+", { width: 700, height: 50, progress() { return player.points.div(getNextAt('+')) }, - fillStyle: {'background-color': "#5f6f7f"}, + fillStyle: {'background': "linear-gradient(270deg, rgba(95,111,127,1) 0%, rgba(255,0,0,1) 100%)"}, display() { return `${this.progress().gte(1) ? `` : ""}${format(player.points) + " / " + format(getNextAt('+')) + " points (" + format(this.progress().times(100)) + "%)"}` }, @@ -115,7 +121,15 @@ addLayer("+", { if (hasUpgrade('r', 21)) mult = mult.div(5) if (hasUpgrade('m', 13)) mult = mult.div(100) if (player['+'].points.gte(10)) mult = mult.times(5e20) - if (player['+'].points.gte(14)) mult = mult.times(5e5) + if (player['+'].points.gte(14)) mult = mult.times(5e10) + if (player['+'].points.gte(15)) mult = mult.times(5e30) + if (player['+'].points.gte(16)) mult = mult.times(5e10) + if (player['+'].points.gte(17)) mult = mult.times(5e40) + if (player['+'].points.gte(18)) mult = mult.times(5e20) + if (player['+'].points.gte(20)) mult = mult.times(5e120) + if (player['+'].points.gte(22)) mult = mult.times(5e50) + if (player['+'].points.gte(24)) mult = mult.times(5e25) + if (overginded) mult = new Decimal("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1000000") return mult }, gainExp() { // Calculate the exponent on main currency from bonuses @@ -228,26 +242,41 @@ addLayer("a", { done() {return hasUpgrade('i', 14)} }, 29: { + name: "Break Infinity", + tooltip: "Get 2^1024 points", + done() {return player.points.gte(new Decimal(2).pow(1024))} + }, + 31: { name: "v0.4.x complete", tooltip: "Get infinity upgrade 17", done() {return hasUpgrade('i', 17)} }, - 31: { + 32: { name: "You tried ¯\\_(ツ)_/¯", tooltip: "Try to overgrind for additions", done() {return overginded} }, - 32: { + 33: { name: "ω", tooltip: "Get 1 omega", - done() {return player.OMEGA.gte(1)} + done() {return player['i'].omega.gte(1)} }, - 33: { - name: "0.5.x complete", + 34: { + name: "v0.5.x complete", tooltip: "Get 1000 omega", - done() {return player.OMEGA.gte(1000)} + done() {return player['i'].omega.gte(1000)} }, - 34: { + 35: { + name: "There's a softcap??", + tooltip: "Get 5000 omega", + done() {return player['i'].omega.gte(5000)} + }, + 36: { + name: function() {return `

    OMEGA

    `}, + tooltip: "Get 1000000 omega", + done() {return player['i'].omega.gte(1000000)} + }, + 37: { name: "Infinity of infinities", tooltip: "Get 2^1024 infinities", done() {return player['i'].points.gte(new Decimal(2).pow(1024))} @@ -690,13 +719,13 @@ addLayer("u", { 13: { title: "Oh, already?", description: "Autobuy the ultra buyable", - cost: new Decimal(100000), + cost: new Decimal(1e17), unlocked() {return player['+'].points.gte(15)} }, }, buyables: { 11: { - cost(x) { return new Decimal(2).mul(x.pow(2)).pow(15).pow(3) }, + cost(x) { return new Decimal(2).mul(x.pow(2)).pow(15).pow(3).add(1) }, title: "Ultra Buyable!", display() { return "Amount: " + format(getBuyableAmount(this.layer, this.id).floor()) + "\nCost: " + format(this.cost().floor()) + " ultra points\nEffect: x" + format(this.effect()) + " point gain"}, canAfford() { return player[this.layer].points.gte(this.cost()) }, @@ -705,7 +734,7 @@ addLayer("u", { setBuyableAmount(this.layer, this.id, getBuyableAmount(this.layer, this.id).add(1)) }, effect() { - return new Decimal(1).mul(this.cost().sub(1)).times(50 + (hasUpgrade('i', 16) ? -40 : 0)).pow(0.3).add(0.99) + return new Decimal(1).mul(this.cost().sub(1)).times(50 + (hasUpgrade('i', 16) ? -40 : 0)).pow(0.3).add(0.99).clampMin(1) }, unlocked() {return player['+'].points.gte(12)} }, @@ -728,6 +757,11 @@ addLayer("u", { if (tmp['u'].buyables[11].canAfford && hasUpgrade("u", 13)) { addBuyables('u', 11, 1) } + if (player['+'].points.gte(24)) { + buyUpgrade('u', 11) + buyUpgrade('u', 12) + buyUpgrade('u', 13) + } }, row: 3, // Row the layer is in on the tree (0 is the first row) hotkeys: [ @@ -743,6 +777,7 @@ addLayer("i", { startData() { return { unlocked: true, points: new Decimal(0), + omega: new Decimal(0) }}, branches: "u", color: "#777", @@ -768,11 +803,13 @@ addLayer("i", { "prestige-button", "resource-display", "blank", - ["display-text", function() {return `You have

    ${format(player.OMEGA)}

    omega` }], - ["display-text", function() {return `You have gaining ${format(player.OMEGAGAIN)} omega per second` }], + ["display-text", function() {return `You have

    ${format(player['i'].omega)}

    omega` }], + ["display-text", function() {return `You are gaining ${format(og)} omega per second` }], ["display-text", function() {return `You need 22 additions to gain omega` }], - ["display-text", function() {return `Omega is boosting point gain by x${format(player.OMEGA.pow(0.05))}` }] + ["display-text", function() {return `Omega gain is softcapped after 5000 omega; Currently x${format(omegaSC)} omega gain` }], + ["display-text", function() {return `Omega is boosting point gain by x${format(player['i'].omega.pow(0.05))}` }] ], + unlocked: function() {return player['+'].points.gte(22)} }, }, upgrades: { @@ -815,48 +852,59 @@ addLayer("i", { 17: { title: "Nice", description: "x69,420 point gain, oh, and win", - cost: new Decimal(1000), + cost: new Decimal(200), unlocked() {return player['+'].points.gte(20)} }, 1001: { pay() { - player.OMEGA = player.OMEGA.sub(10) + player['i'].omega = player['i'].omega.sub(10) }, canAfford() { - return player.OMEGA.gte(10) + return player['i'].omega.gte(10) }, unlocked() {return player['+'].points.gte(22)}, fullDisplay() {return `

    Omega


    x2 omega gain

    Cost: ${format(new Decimal(10))} omega` }, }, 1002: { pay() { - player.OMEGA = player.OMEGA.sub(150) + player['i'].omega = player['i'].omega.sub(150) }, canAfford() { - return player.OMEGA.gte(150) + return player['i'].omega.gte(150) }, unlocked() {return player['+'].points.gte(22)}, fullDisplay() {return `

    Extraordinary


    x3 omega gain

    Cost: ${format(new Decimal(150))} omega` }, }, 1003: { pay() { - player.OMEGA = player.OMEGA.sub(250) + player['i'].omega = player['i'].omega.sub(250) }, canAfford() { - return player.OMEGA.gte(250) + return player['i'].omega.gte(250) }, unlocked() {return player['+'].points.gte(22)}, fullDisplay() {return `

    Round


    +4 omega gain

    Cost: ${format(new Decimal(250))} omega` }, }, + 1004: { + canAfford() { + return player['i'].omega.gte(400) + }, + unlocked() {return player['+'].points.gte(22)}, + fullDisplay() {return `

    Require


    x3 omega gain

    Req: ${format(new Decimal(400))} omega` }, + }, }, - automate() { + update(diff) { let gain = new Decimal(0) if (player['+'].points.gte(22)) gain = new Decimal(1) if (hasUpgrade('i', 1001)) gain = gain.times(2) if (hasUpgrade('i', 1002)) gain = gain.times(3) if (hasUpgrade('i', 1003)) gain = gain.add(4) - player.OMEGAGAIN = gain - player.OMEGA = player.OMEGA.add(player.OMEGAGAIN.div(20)) + if (hasUpgrade('i', 1004)) gain = gain.times(3) + if (player['+'].points.gte(23)) gain = gain.times(2) + omegaSC = softcap(player['i'].omega, new Decimal(5000), 0.001).max(5000).minus(4999).pow(-1) + gain = gain.times(omegaSC) + og = gain + player['i'].omega = player['i'].omega.add(gain.times(diff)) }, gainMult() { // Calculate the multiplier for main currency from bonuses mult = new Decimal(1) @@ -868,7 +916,78 @@ addLayer("i", { }, row: 4, // Row the layer is in on the tree (0 is the first row) hotkeys: [ - {key: "i", description: "I: Reset for infinity points", onPress(){if (canReset(this.layer)) doReset(this.layer)}, unlocked() {return player['+'].points.gte(19)}}, + {key: "i", description: "I: Reset for infinities", onPress(){if (canReset(this.layer)) doReset(this.layer)}, unlocked() {return player['+'].points.gte(19)}}, ], layerShown(){return player['+'].points.gte(19)} +}) + +addLayer("x", { + name: "multiplier", // This is optional, only used in a few places, If absent it just uses the layer id. + symbol: "×", // This appears on the layer's node. Default is the id with the first letter capitalized + position: 0, // Horizontal position within a row. By default it uses the layer id and sorts in alphabetical order + startData() { return { + unlocked: true, + points: new Decimal(0), + }}, + branches: "r", + color: "#F00", + requires: new Decimal(50), // Can be a function that takes requirement increases into account + resource: "multiplier", // Name of prestige currency + baseResource: "rebirth points", // Name of resource prestige is based on + baseAmount() {return player.r.points}, // Get the current amount of baseResource + type: "none", // normal: cost to gain currency depends on amount gained. static: cost depends on how much you already have + exponent: 0.1, // Prestige currency exponent + tabFormat: { + "Multiplier": { + content: [ + "main-display", + ["display-text", function() {return "You are gaining " + format(mg) + " multiplier per second"}], + "blank", + "upgrades" + ], + }, + }, + upgrades: { + 11: { + title: "Multiplication", + description: "x5 point and multiplier gain", + cost: new Decimal(20), + unlocked() {return player['+'].points.gte(25)} + }, + 12: { + title: "Multiplication, but better", + description: "x10 point and multiplier gain", + cost: new Decimal(100), + unlocked() {return player['+'].points.gte(25)} + }, + 13: { + title: "Scaling Multiplier", + description: "Multiply multiplier gain by multiplier", + effect() { + return player.x.points.add(1).pow(0.05) + }, + effectDisplay() {return 'x' + format(upgradeEffect(this.layer, this.id))}, + tooltip: "(mult+1)0.05", + cost: new Decimal(500), + unlocked() {return player['+'].points.gte(25)} + }, + }, + gainMult() { // Calculate the multiplier for main currency from bonuses + mult = new Decimal(1) + return mult + }, + gainExp() { // Calculate the exponent on main currency from bonuses + return new Decimal(1) + }, + update(diff){ + let gain = new Decimal(0) + if (player['+'].points.gte(25)) gain = gain.add(1) + if (hasUpgrade('x', 11)) gain = gain.times(5) + if (hasUpgrade('x', 12)) gain = gain.times(10) + if (hasUpgrade('x', 13)) gain = gain.times(upgradeEffect('x', 13)) + mg = gain + player['x'].points = player['x'].points.add(gain.times(diff)) + }, + row: 2, // Row the layer is in on the tree (0 is the first row) + layerShown(){return player['+'].points.gte(25)} }) \ No newline at end of file diff --git a/MeTMT/js/mod.js b/MeTMT/js/mod.js index 26e9510..768c27d 100644 --- a/MeTMT/js/mod.js +++ b/MeTMT/js/mod.js @@ -13,15 +13,21 @@ let modInfo = { // Set your version in num and name let VERSION = { - num: "0.5", - name: "ωOMEGAω", + num: "0.6", + name: "It's not a line anymore", } let changelog = `galaxy has a changelog you don't need this one!` let winText = `Wow! You won! But there will be more soon...` -let additionCap = 22 +let additionCap = 25 + +let og = new Decimal(0) + +let omegaSC = new Decimal(0) + +let mg = new Decimal(0) // If you add new functions anywhere inside of a layer, and those functions have an effect when called, add them here. // (The ones here are examples, all official functions are already taken care of) @@ -68,21 +74,21 @@ function getPointGen() { if (hasUpgrade('i', 14)) gain = gain.times(5) if (hasUpgrade('i', 16)) gain = gain.times(9) if (hasUpgrade('i', 17)) gain = gain.times(69420) - if (player['+'].points.gte(21)) gain = gain.pow(0.96) - if (player.OMEGA.gte(1)) gain = gain.times(player.OMEGA.pow(0.05)) + if (player['+'].points.gte(21)) gain = gain.pow(0.98) + if (player['i'].omega.gte(1)) gain = gain.times(player['i'].omega.pow(0.05)) + if (hasUpgrade('x', 11)) gain = gain.times(5) + if (hasUpgrade('x', 12)) gain = gain.times(10) return gain } // You can add non-layer related variables that should to into "player" and be saved here, along with default values function addedPlayerData() { return { - OMEGA: new Decimal(0), - OMEGAGAIN: new Decimal(0) }} // Display extra things at the top of the page var displayThings = [ - function() {return 'You have ' + format(player['+'].points, 0) + ' additions'}, - "Endgame: 1,000 omega", + function() {return 'You have ' + format(player['+'].points) + '/' + format(additionCap) + ' additions'}, + "Endgame: 10,000 multiplier", function() { if (player.points.lte(100)) { return "If 1 point is a centimeter, you'd have " + format(player.points) + "cm" @@ -102,9 +108,6 @@ var displayThings = [ if (player.points.lte(1798754748000*60*24)) { return "If 1 point is a centimeter, you'd have " + format(player.points.div(1798754748000*60)) + " light hours" } - if (player.points.lte(7.10030834 * 1e15)) { - return "If 1 point is a second, you'd have " + format(player.points.div(1798754748000*60*24*365)) + " galactic years" - } if (player.points.lte(1798754748000*60*24*365)) { return "If 1 point is a centimeter, you'd have " + format(player.points.div(1798754748000*60*24)) + " light days" } @@ -129,11 +132,9 @@ var displayThings = [ // Determines when the game "ends" function isEndgame() { - return player.OMEGA.gte(1000) + return player.x.points.gte(10000) } - - // Less important things beyond this point! // Style for the background, can be a function diff --git a/MeTMT/js/utils/NumberFormating.js b/MeTMT/js/utils/NumberFormating.js index 7993bb4..6468d79 100644 --- a/MeTMT/js/utils/NumberFormating.js +++ b/MeTMT/js/utils/NumberFormating.js @@ -158,6 +158,39 @@ function standardFormat(decimal) { prefix += symbols[1][e.div(10).floor().mod(10)] prefix += symbols[2][e.div(100).floor().mod(10)] } + if (e.div(1000000).floor().gt(10)) return defaultFormat(decimal) + return (e.lt(3000) ? defaultFormat(decimal.div(new Decimal(10).pow(e.times(3)))) : "1") + prefix +} + +function altStandardFormat(decimal) { + first = ["", "k", "M", "B"] + symbols = [ + [ + "", "U", "D", "T", "q", "Q", "s", "S", "O", "N" + ], + [ + "", "Dc", "Vg", "Tg", "qg", "Qg", "sg", "Sg", "Og", "Ng" + ], + [ + "", "C", "Du", "Tc", "qc", "Qc", "sc", "Sc", "Oc", "Nc" + ], + ] + decimal = new Decimal(decimal) + if (decimal.eq(0)) return "0" + e = decimal.log10().div(3).floor().clampMin(0) + prefix = "" + if (first[e] != undefined) { prefix = first[e] } else { + decimal = decimal.div(1000) + e = decimal.log10().div(3).floor().clampMin(0) + prefix += symbols[0][e.div(10000).floor().mod(10)] + prefix += symbols[1][e.div(100000).floor().mod(10)] + prefix += symbols[2][e.div(1000000).floor().mod(10)] + prefix += e.div(1000).floor().mod(10).neq(0) ? "Mi" : "" + prefix += symbols[0][e.mod(10)] + prefix += symbols[1][e.div(10).floor().mod(10)] + prefix += symbols[2][e.div(100).floor().mod(10)] + } + if (e.div(1000000).floor().gt(10)) return standardFormat(decimal) return (e.lt(3000) ? defaultFormat(decimal.div(new Decimal(10).pow(e.times(3)))) : "1") + prefix } diff --git a/MeTMT/js/utils/options.js b/MeTMT/js/utils/options.js index 43ffd90..0560cf6 100644 --- a/MeTMT/js/utils/options.js +++ b/MeTMT/js/utils/options.js @@ -80,6 +80,9 @@ function changeFormat() { options.formatting = "standard"; break; case "standard": + options.formatting = "altstandard"; + break; + case "altstandard": options.formatting = "default"; break; } @@ -131,6 +134,8 @@ function format(decimal, precision = 2) { return ""; case "standard": return standardFormat(decimal); + case "altstandard": + return altStandardFormat(decimal); } } function changeMTL() {