1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-21 16:13:55 +00:00
This commit is contained in:
Acamaeda 2020-12-03 23:19:14 -05:00
parent e8ebd07e3a
commit 595d4916a6
10 changed files with 52 additions and 13 deletions

View file

@ -1,5 +1,12 @@
# The Modding Tree changelog:
### v2.2.8 12/03/20
- Double-clicking a layer node brings you to the main subtab for that layer.
- Attempted to fix challenges visually updating a different way.
- Added a softcap function for use in formulas.
- Added displayRow feature, which lets layers be shown somewhere separate from where they are in the reset order (e.g. side layers)
- Fixed autoupgrade issue.
### v2.2.7 11/30/20
- Added autoUpgrade feature.
- resource-display now shows resource gain per second if passiveGain is active.

View file

@ -27,6 +27,8 @@ You can make almost any value dynamic by using a function in its place, includin
Using "side" instead of a number will cause the layer to appear off to the side as a smaller node (useful for achievements and statistics). Side layers are not affected by resets unless you add a doReset to them.
- displayRow: **OVERRIDE** Changes where the layer node appears without changing where it is in the reset order.
- resource: Name of the main currency you gain by resetting on this layer.
- effect(): **optional**. A function that calculates and returns the current values of any bonuses inherent to the main currency. Can return a value or an object containing multiple values. *You will also have to implement the effect where it is applied.*

View file

@ -15,7 +15,6 @@ addLayer("c", {
beep: false,
}},
color: "#4BDC13",
autoUpgrade: true,
requires: new Decimal(10), // Can be a function that takes requirement increases into account
resource: "lollipops", // Name of prestige currency
baseResource: "candies", // Name of resource prestige is based on

View file

@ -12,7 +12,7 @@ let modInfo = {
// Set your version in num and name
let VERSION = {
num: "2.2.7",
num: "2.2.8",
name: "Uprooted",
}

View file

@ -119,9 +119,9 @@ function loadVue() {
Vue.component('challenge', {
props: ['layer', 'data'],
template: `
<div v-if="tmp[layer].challenges && tmp[layer].challenges[data]!== undefined && tmp[layer].challenges[data].unlocked && !(player.hideChallenges && maxedChallenge(layer, [data]))" v-bind:class="{hChallenge: true, done: hasChallenge(layer, data), canComplete: player[layer].activeChallenge == data && canCompleteChallenge(layer, data)}">
<div v-if="tmp[layer].challenges && tmp[layer].challenges[data]!== undefined && tmp[layer].challenges[data].unlocked && !(player.hideChallenges && maxedChallenge(layer, [data]))" v-bind:class="{hChallenge: true, done: tmp[layer].challenges[data].defaultStyle === 'done', canComplete:tmp[layer].challenges[data].defaultStyle === 'canComplete', locked: tmp[layer].challenges[data].defaultStyle === 'locked'}">
<br><h3 v-html="tmp[layer].challenges[data].name"></h3><br><br>
<button v-bind:class="{ longUpg: true, can: true, [layer]: true }" v-bind:style="{'background-color': tmp[layer].color}" v-on:click="startChallenge(layer, data)">{{player[layer].activeChallenge==(data)?(canCompleteChallenge(layer, data)?"Finish":"Exit Early"):(hasChallenge(layer, data)?"Completed":"Start")}}</button><br><br>
<button v-bind:class="{ longUpg: true, can: true, [layer]: true }" v-bind:style="{'background-color': tmp[layer].color}" v-on:click="startChallenge(layer, data)">{{tmp[layer].challenges[data].buttonText}}</button><br><br>
<span v-if="tmp[layer].challenges[data].fullDisplay" v-html="tmp[layer].challenges[data].fullDisplay"></span>
<span v-else>
<span v-html="tmp[layer].challenges[data].challengeDescription"></span><br>
@ -169,7 +169,7 @@ function loadVue() {
template: `
<div v-if="tmp[layer].milestones">
<table>
<tr v-for="id in Object.keys(tmp[layer].milestones)"><div v-if="tmp[layer].milestones[id]!== undefined && tmp[layer].milestones[id].unlocked"
<tr v-for="id in Object.keys(tmp[layer].milestones)"><div v-if="tmp[layer].milestones[id]!== undefined && tmp[layer].milestones[id].unlocked && milestoneShown(layer, id)"
<milestone :layer = "layer" :data = "id" v-bind:style="tmp[layer].componentStyles.milestone"></milestone>
</tr></div>
</table>

View file

@ -4,7 +4,7 @@ var gameEnded = false;
// Don't change this
const TMT_VERSION = {
tmtNum: "2.2.7.1",
tmtNum: "2.2.8",
tmtName: "Uprooted"
}
@ -59,6 +59,12 @@ function getNextAt(layer, canMax=false, useType = null) {
return new Decimal(0)
}}
function softcap(value, cap, power = 0.5) {
if (value.lte(cap)) return value
else
return value.pow(power).times(cap.pow(decimalOne.sub(power)))
}
// Return true if the layer should be highlighted. By default checks for upgrades only.
function shouldNotify(layer){
if (player.tab == layer || player.navTab == layer) return false

View file

@ -143,19 +143,23 @@ function updateLayers(){
if(layers[layer].base === undefined || layers[layer].base <= 1) layers[layer].base = 2
if(layers[layer].softcap === undefined) layers[layer].softcap = new Decimal("e1e7")
if(layers[layer].softcapPower === undefined) layers[layer].softcapPower = new Decimal("0.5")
if(layers[layer].displayRow === undefined) layers[layer].displayRow = layers[layer].row
let row = layers[layer].row
let displayRow = layers[layer].displayRow
if(!ROW_LAYERS[row]) ROW_LAYERS[row] = {}
if(!TREE_LAYERS[row] && !isNaN(row)) TREE_LAYERS[row] = []
if(!OTHER_LAYERS[row] && isNaN(row)) OTHER_LAYERS[row] = []
if(!TREE_LAYERS[displayRow] && !isNaN(displayRow)) TREE_LAYERS[displayRow] = []
if(!OTHER_LAYERS[displayRow] && isNaN(displayRow)) OTHER_LAYERS[displayRow] = []
ROW_LAYERS[row][layer]=layer;
let position = (layers[layer].position !== undefined ? layers[layer].position : layer)
if (!isNaN(row)) TREE_LAYERS[row].push({layer: layer, position: position})
else OTHER_LAYERS[row].push({layer: layer, position: position})
if (!isNaN(displayRow)) TREE_LAYERS[displayRow].push({layer: layer, position: position})
else OTHER_LAYERS[displayRow].push({layer: layer, position: position})
if (maxRow < layers[layer].row) maxRow = layers[layer].row
if (maxRow < layers[layer].displayRow) maxRow = layers[layer].displayRow
}
for (row in OTHER_LAYERS) {

View file

@ -1,4 +1,5 @@
var tmp = {}
var temp = tmp // Proxy for tmp
var NaNalert = false;
// Tmp will not call these
@ -32,6 +33,7 @@ function setupTemp() {
tmp[layer].prestigeButtonText = {}
setupBarStyles(layer)
}
temp = tmp
}
function setupTempData(layerData, tmpData) {
@ -75,6 +77,8 @@ function updateTemp() {
tmp[layer].prestigeNotify = prestigeNotify(layer)
tmp[layer].prestigeButtonText = prestigeButtonText(layer)
constructBarStyles(layer)
updateChallengeDisplay(layer)
}
tmp.pointGen = getPointGen()
@ -119,6 +123,20 @@ function updateTempData(layerData, tmpData) {
function updateChallengeTemp(layer)
{
updateTempData(layers[layer].challenges, tmp[layer].challenges)
updateChallengeDisplay(layer)
}
function updateChallengeDisplay(layer) {
for (id in player[layer].challenges) {
let style = "locked"
console.log(layer + " " + id)
if (player[layer].activeChallenge == id && canCompleteChallenge(layer, id)) style = "canComplete"
else if (hasChallenge(layer, id)) style = "done"
tmp[layer].challenges[id].defaultStyle = style
tmp[layer].challenges[id].buttonText = (player[layer].activeChallenge==(id)?(canCompleteChallenge(layer, id)?"Finish":"Exit Early"):(hasChallenge(layer, id)?"Completed":"Start"))
}
}
function updateBuyableTemp(layer)

View file

@ -627,7 +627,10 @@ function inChallenge(layer, id){
var onTreeTab = true
function showTab(name) {
if (LAYERS.includes(name) && !layerunlocked(name)) return
if (player.tab === name && player.subtabs[name] && player.subtabs[name].mainTabs) {
console.log("momo")
player.subtabs[name].mainTabs = Object.keys(layers[name].tabFormat)[0]
}
var toTreeTab = name == "none"
player.tab = name
if (player.navTab == "none" && (tmp[name].row !== "side") && (tmp[name].row !== "otherside")) player.lastSafeTab = name