1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-05-04 15:21:11 +00:00
This commit is contained in:
Acamaeda 2020-12-13 22:23:12 -05:00
parent e148df8e00
commit 797447faa6
9 changed files with 49 additions and 22 deletions

View file

@ -484,7 +484,6 @@ addLayer("a", {
color: "yellow",
resource: "achievement power",
row: "side",
layerShown() {return true},
tooltip() { // Optional, tooltip displays when the layer is locked
return ("Achievements")
},

View file

@ -11,7 +11,7 @@ let modInfo = {
// Set your version in num and name
let VERSION = {
num: "2.3.2",
num: "2.3.3",
name: "Cooler and Newer Edition",
}

View file

@ -388,10 +388,10 @@ function loadVue() {
key() {return this.$vnode.key}
},
template: `<div>
<span v-for="(row, r) in data"><table>
<td v-for="(node, id) in row" style = "{width: 0px}">
<tree-node :layer='node' :abb='tmp[node].symbol' :key="key + '-' + r + '-' + id"></tree-node>
</td>
<span class="nodeRow" v-for="(row, r) in data"><table>
<span v-for="(node, id) in row" style = "{width: 0px}">
<tree-node :layer='node' :abb='tmp[node].symbol' :key="key + '-' + r + '-' + id"></tree-node>
</span>
<tr><table><button class="treeNode hidden"></button></table></tr>
</span></div>

View file

@ -4,13 +4,17 @@ var gameEnded = false;
// Don't change this
const TMT_VERSION = {
tmtNum: "2.3.2",
tmtNum: "2.3.3",
tmtName: "Cooler and Newer Edition"
}
function getResetGain(layer, useType = null) {
let type = useType
if (!useType) type = tmp[layer].type
if (!useType){
type = tmp[layer].type
if (layers[layer].getResetGain !== undefined)
return layers[layer].getResetGain()
}
if(tmp[layer].type == "none")
return new Decimal (0)
if (tmp[layer].gainExp.eq(0)) return new Decimal(0)
@ -32,7 +36,12 @@ function getResetGain(layer, useType = null) {
function getNextAt(layer, canMax=false, useType = null) {
let type = useType
if (!useType) type = tmp[layer].type
if (!useType) {
type = tmp[layer].type
if (layers[layer].getNextAt !== undefined)
return layers[layer].getNextAt(canMax)
}
if(tmp[layer].type == "none")
return new Decimal (Infinity)
@ -87,14 +96,14 @@ function shouldNotify(layer){
function canReset(layer)
{
if(tmp[layer].type == "normal")
if (layers[layer].canReset!== undefined)
return run(layers[layer].canReset, layers[layer])
else if(tmp[layer].type == "normal")
return tmp[layer].baseAmount.gte(tmp[layer].requires)
else if(tmp[layer].type== "static")
return tmp[layer].baseAmount.gte(tmp[layer].nextAt)
if(tmp[layer].type == "none")
else
return false
else
return run(layers[layer].canReset, layers[layer])
}
function rowReset(row, layer) {

View file

@ -5,7 +5,7 @@ const decimalOne = new Decimal(1)
const decimalNaN = new Decimal(NaN)
function layerShown(layer){
return layers[layer].layerShown();
return tmp[layer].layerShown;
}
var LAYERS = Object.keys(layers);
@ -166,6 +166,7 @@ function setupLayer(layer){
if(layers[layer].softcapPower === undefined) layers[layer].softcapPower = new Decimal("0.5")
if(layers[layer].displayRow === undefined) layers[layer].displayRow = layers[layer].row
if(layers[layer].name === undefined) layers[layer].name = layer
if(layers[layer].layerShown === undefined) layers[layer].layerShown = true
let row = layers[layer].row

View file

@ -59,7 +59,7 @@ function format(decimal, precision=2,) {
function formatWhole(decimal) {
decimal = new Decimal(decimal)
if (decimal.gte(1e9)) return format(decimal, 2)
if (decimal.lte(0.95) && !decimal.eq(0)) return format(decimal, 2)
if (decimal.lte(0.98) && !decimal.eq(0)) return format(decimal, 2)
return format(decimal, 0)
}
@ -698,7 +698,7 @@ function subtabResetNotify(layer, family, id){
}
function nodeShown(layer) {
if (tmp[layer].layerShown) return true
if (layerShown(layer)) return true
switch(layer) {
case "idk":
return player.idk.unlocked
@ -788,7 +788,9 @@ function focused(x) {
function prestigeButtonText(layer)
{
if(tmp[layer].type == "normal")
if (layers[layer].prestigeButtonTest !== undefined)
return layers[layer].prestigeButtonText()
else if(tmp[layer].type == "normal")
return `${ player[layer].points.lt(1e3) ? (tmp[layer].resetDescription !== undefined ? tmp[layer].resetDescription : "Reset for ") : ""}+<b>${formatWhole(tmp[layer].resetGain)}</b> ${tmp[layer].resource} ${tmp[layer].resetGain.lt(100) && player[layer].points.lt(1e3) ? `<br><br>Next at ${ (tmp[layer].roundUpCost ? formatWhole(tmp[layer].nextAt) : format(tmp[layer].nextAt))} ${ tmp[layer].baseResource }` : ""}`
else if(tmp[layer].type== "static")
return `${tmp[layer].resetDescription !== undefined ? tmp[layer].resetDescription : "Reset for "}+<b>${formatWhole(tmp[layer].resetGain)}</b> ${tmp[layer].resource}<br><br>${player[layer].points.lt(30) ? (tmp[layer].baseAmount.gte(tmp[layer].nextAt)&&(tmp[layer].canBuyMax !== undefined) && tmp[layer].canBuyMax?"Next:":"Req:") : ""} ${formatWhole(tmp[layer].baseAmount)} / ${(tmp[layer].roundUpCost ? formatWhole(tmp[layer].nextAtDisp) : format(tmp[layer].nextAtDisp))} ${ tmp[layer].baseResource }
@ -796,7 +798,7 @@ function prestigeButtonText(layer)
else if(tmp[layer].type == "none")
return ""
else
return layers[layer].prestigeButtonText()
return "You need prestige button text"
}
function isFunction(obj) {