mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-28 02:51:55 +00:00
Automated temp and changed basically everything in the process
This commit is contained in:
parent
5fcf42d48d
commit
6268caea20
13 changed files with 206 additions and 452 deletions
|
@ -1,6 +1,9 @@
|
||||||
#The Modding Tree changelog:
|
#The Modding Tree changelog:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
effectDisplay in Challenges and Upgrades no longer takes an argument
|
||||||
|
|
||||||
##v1.3.5
|
##v1.3.5
|
||||||
- Completely automated convertToDecimal, now you never have to worry about it again.
|
- Completely automated convertToDecimal, now you never have to worry about it again.
|
||||||
- Branches can be defined without a color id. But they can also use hex values for color ids!
|
- Branches can be defined without a color id. But they can also use hex values for color ids!
|
||||||
|
|
|
@ -29,9 +29,9 @@ Features:
|
||||||
- title: **optional**, displayed at the top in a larger font
|
- title: **optional**, displayed at the top in a larger font
|
||||||
It can also be a function that returns updating text.
|
It can also be a function that returns updating text.
|
||||||
|
|
||||||
- cost(x): cost for buying xth buyable, can be an object if there are multiple currencies
|
- cost(): cost for buying xth buyable, can be an object if there are multiple currencies
|
||||||
|
|
||||||
- effect(x): **optional**, A function that calculates and returns the current values of bonuses
|
- effect(): **optional**, A function that calculates and returns the current values of bonuses
|
||||||
for having x of this buyable. Can return a value or an object containing multiple values.
|
for having x of this buyable. Can return a value or an object containing multiple values.
|
||||||
|
|
||||||
- display(): A function returning everything that should be displayed on the rebuyable after the title, likely
|
- display(): A function returning everything that should be displayed on the rebuyable after the title, likely
|
||||||
|
|
|
@ -35,7 +35,7 @@ Individual Challenges can have these features:
|
||||||
- effect(): **optional**, A function that calculates and returns the current values of any bonuses from the reward.
|
- effect(): **optional**, A function that calculates and returns the current values of any bonuses from the reward.
|
||||||
Can return a value or an object containing multiple values. Can use basic HTML.
|
Can return a value or an object containing multiple values. Can use basic HTML.
|
||||||
|
|
||||||
- effectDisplay(effects): **optional**, A function that returns a display of the current effects of the reward with
|
- effectDisplay(): **optional**, A function that returns a display of the current effects of the reward with
|
||||||
formatting. Default behavior is to just display the a number appropriately formatted.
|
formatting. Default behavior is to just display the a number appropriately formatted.
|
||||||
|
|
||||||
- goal: A Decimal for the cost of the upgrade. By default, the goal is in basic Points.
|
- goal: A Decimal for the cost of the upgrade. By default, the goal is in basic Points.
|
||||||
|
|
|
@ -138,10 +138,6 @@ Key:
|
||||||
- automate(): **optional**, this function is called every game tick, after production. Use it to activate any
|
- automate(): **optional**, this function is called every game tick, after production. Use it to activate any
|
||||||
autobuyers or auto-resets or similar on this layer, if appropriate.
|
autobuyers or auto-resets or similar on this layer, if appropriate.
|
||||||
|
|
||||||
- updateTemp(): **optional**, this function is called every game tick. use it to update anything in the "tmp" object.
|
|
||||||
You don't really need it. tmp is used as a way to store calculated values so it doesn't repeat
|
|
||||||
calculations.
|
|
||||||
|
|
||||||
- resetsNothing(): **optional**, returns true if this layer shouldn't trigger any resets when you prestige.
|
- resetsNothing(): **optional**, returns true if this layer shouldn't trigger any resets when you prestige.
|
||||||
|
|
||||||
- incr_order: **optional**, an array of layer ids. When this layer is unlocked for the first time, the "order" value
|
- incr_order: **optional**, an array of layer ids. When this layer is unlocked for the first time, the "order" value
|
||||||
|
|
|
@ -44,7 +44,7 @@ Normal subtabs and microtab subtabs both use the same features:
|
||||||
|
|
||||||
- content: The tab layout code for the subtab, in [the tab layout format](custom-tab-layouts.md)
|
- content: The tab layout code for the subtab, in [the tab layout format](custom-tab-layouts.md)
|
||||||
|
|
||||||
- style(: **Optional**, A function returning a CSS object, which affects the CSS when in that subtab.
|
- style(): **Optional**, A function returning a CSS object, which affects the CSS when in that subtab.
|
||||||
|
|
||||||
- buttonStyle(): **Optional**, A function returning a CSS object, which affects the appearance of the button for that subtab.
|
- buttonStyle(): **Optional**, A function returning a CSS object, which affects the appearance of the button for that subtab.
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ Individual upgrades can have these features:
|
||||||
- effect(): **optional**, A function that calculates and returns the current values of any bonuses from the upgrade.
|
- effect(): **optional**, A function that calculates and returns the current values of any bonuses from the upgrade.
|
||||||
Can return a value or an object containing multiple values.
|
Can return a value or an object containing multiple values.
|
||||||
|
|
||||||
- effectDisplay(effects): **optional**, A function that returns a display of the current effects of the upgrade with
|
- effectDisplay(): **optional**, A function that returns a display of the current effects of the upgrade with
|
||||||
formatting. Default behavior is to just display the a number appropriately formatted. Can use basic HTML.
|
formatting. Default behavior is to just display the a number appropriately formatted. Can use basic HTML.
|
||||||
|
|
||||||
- cost: A Decimal for the cost of the upgrade. By default, upgrades cost the main prestige currency for the layer.
|
- cost: A Decimal for the cost of the upgrade. By default, upgrades cost the main prestige currency for the layer.
|
||||||
|
|
31
index.html
31
index.html
|
@ -15,7 +15,6 @@
|
||||||
<script type="text/javascript" src="js/layerSupport.js"></script>
|
<script type="text/javascript" src="js/layerSupport.js"></script>
|
||||||
<script type="text/javascript" src="js/layers.js"></script>
|
<script type="text/javascript" src="js/layers.js"></script>
|
||||||
<script type="text/javascript" src="js/temp.js"></script>
|
<script type="text/javascript" src="js/temp.js"></script>
|
||||||
<script type="text/javascript" src="js/saves.js"></script>
|
|
||||||
<script type="text/javascript" src="js/utils.js"></script>
|
<script type="text/javascript" src="js/utils.js"></script>
|
||||||
<script type="text/javascript" src="js/game.js"></script>
|
<script type="text/javascript" src="js/game.js"></script>
|
||||||
<script type="text/javascript" src="js/v.js"></script>
|
<script type="text/javascript" src="js/v.js"></script>
|
||||||
|
@ -172,33 +171,33 @@
|
||||||
<canvas id="treeCanvas" class="canvas"></canvas>
|
<canvas id="treeCanvas" class="canvas"></canvas>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="layer in LAYERS">
|
<div v-for="layer in LAYERS">
|
||||||
<div v-if="player.tab==layer" v-bind:class="'col right'" v-bind:style="tmp.style[layer] ? tmp.style[layer] : {}">
|
<div v-if="player.tab==layer" v-bind:class="'col right'" v-bind:style="tmp[layer].style ? tmp[layer].style : {}">
|
||||||
<button class="back" onclick="showTab('tree')">←</button><br><br><br>
|
<button class="back" onclick="showTab('tree')">←</button><br><br><br>
|
||||||
<div v-if="!layers[layer].tabFormat">
|
<div v-if="!layers[layer].tabFormat">
|
||||||
<main-display v-bind:style="tmp.componentStyles[layer]['main-display']" :layer="layer"></main-display>
|
<main-display v-bind:style="tmp[layer].componentStyles['main-display']" :layer="layer"></main-display>
|
||||||
<prestige-button v-bind:style="tmp.componentStyles[layer]['prestige-button']" :layer="layer"></prestige-button>
|
<prestige-button v-bind:style="tmp[layer].componentStyles['prestige-button']" :layer="layer"></prestige-button>
|
||||||
<span v-if="layers[layer].type=='normal' && tmp.resetGain[layer].lt(100) && player[layer].points.lt(1e3)"><br>You have {{formatWhole(tmp.layerAmt[layer])}} {{layers[layer].baseResource}}</span>
|
<span v-if="tmp[layer].type=='normal' && tmp[layer].resetGain.lt(100) && player[layer].points.lt(1e3)"><br>You have {{formatWhole(tmp[layer].baseAmt)}} {{tmp[layer].baseResource}}</span>
|
||||||
<br><br>
|
<br><br>
|
||||||
<span v-if="player[layer].best != undefined">Your best {{layers[layer].resource}} is {{formatWhole(player[layer].best)}}<br></span>
|
<span v-if="player[layer].best != undefined">Your best {{tmp[layer].resource}} is {{formatWhole(player[layer].best)}}<br></span>
|
||||||
<span v-if="player[layer].total != undefined">You have made a total of {{formatWhole(player[layer].total)}} {{layers[layer].resource}}<br></span>
|
<span v-if="player[layer].total != undefined">You have made a total of {{formatWhole(player[layer].total)}} {{tmp[layer].resource}}<br></span>
|
||||||
<milestones v-bind:style="tmp.componentStyles[layer].milestones" :layer="layer"></milestones>
|
<milestones v-bind:style="tmp[layer].componentStyles.milestones" :layer="layer"></milestones>
|
||||||
<div v-if="Array.isArray(layers[layer].midsection)">
|
<div v-if="Array.isArray(layers[layer].midsection)">
|
||||||
<column :layer="layer" :data="layers[layer].midsection"></column>
|
<column :layer="layer" :data="tmp[layer].midsection"></column>
|
||||||
</div>
|
</div>
|
||||||
<buyables v-bind:style="tmp.componentStyles[layer].buyables" :layer="layer"></buyables>
|
<buyables v-bind:style="tmp[layer].componentStyles.buyables" :layer="layer"></buyables>
|
||||||
<upgrades v-bind:style="tmp.componentStyles[layer]['upgrades']" :layer="layer"></upgrades>
|
<upgrades v-bind:style="tmp[layer].componentStyles['upgrades']" :layer="layer"></upgrades>
|
||||||
<challs v-bind:style="tmp.componentStyles[layer]['challs']" :layer="layer"></challs>
|
<challs v-bind:style="tmp[layer].componentStyles['challs']" :layer="layer"></challs>
|
||||||
<br><br>
|
<br><br>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="layers[layer].tabFormat">
|
<div v-if="layers[layer].tabFormat">
|
||||||
<div v-if="Array.isArray(layers[layer].tabFormat)">
|
<div v-if="Array.isArray(layers[layer].tabFormat)">
|
||||||
<column :layer="layer" :data="layers[layer].tabFormat"></column>
|
<column :layer="layer" :data="tmp[layer].tabFormat"></column>
|
||||||
</div>
|
</div>
|
||||||
<div v-else v-bind:style="[{'margin-top': '-50px'}, readData(layers[layer].tabFormat[player.subtabs[layer].mainTabs].style)]">
|
<div v-else v-bind:style="[{'margin-top': '-50px'}, tmp[layer].tabFormat[player.subtabs[layer].mainTabs].style]">
|
||||||
<div class="upgTable" v-bind:style="{'padding-top': '25px', 'margin-bottom': '24px'}">
|
<div class="upgTable" v-bind:style="{'padding-top': '25px', 'margin-bottom': '24px'}">
|
||||||
<tab-buttons v-bind:style="tmp.componentStyles[layer]['tab-buttons']" :layer="layer" :data="layers[layer].tabFormat" :name="'mainTabs'"></tab-buttons>
|
<tab-buttons v-bind:style="tmp[layer].componentStyles['tab-buttons']" :layer="layer" :data="tmp[layer].tabFormat" :name="'mainTabs'"></tab-buttons>
|
||||||
</div>
|
</div>
|
||||||
<column :layer="layer" :data="layers[layer].tabFormat[player.subtabs[layer].mainTabs].content"></column>
|
<column :layer="layer" :data="tmp[layer].tabFormat[player.subtabs[layer].mainTabs].content"></column>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
68
js/game.js
68
js/game.js
|
@ -1,5 +1,4 @@
|
||||||
var player;
|
var player;
|
||||||
var tmp = {};
|
|
||||||
var needCanvasUpdate = true;
|
var needCanvasUpdate = true;
|
||||||
var NaNalert = false;
|
var NaNalert = false;
|
||||||
var gameEnded = false;
|
var gameEnded = false;
|
||||||
|
@ -39,14 +38,14 @@ function getResetGain(layer, useType = null) {
|
||||||
let type = useType
|
let type = useType
|
||||||
if (!useType) type = layers[layer].type
|
if (!useType) type = layers[layer].type
|
||||||
|
|
||||||
if (tmp.gainExp[layer].eq(0)) return new Decimal(0)
|
if (tmp[layer].gainExp.eq(0)) return new Decimal(0)
|
||||||
if (type=="static") {
|
if (type=="static") {
|
||||||
if ((!layers[layer].canBuyMax()) || tmp.layerAmt[layer].lt(tmp.layerReqs[layer])) return new Decimal(1)
|
if ((!layers[layer].canBuyMax()) || tmp[layer].baseAmount.lt(tmp[layer].requires)) return new Decimal(1)
|
||||||
let gain = tmp.layerAmt[layer].div(tmp.layerReqs[layer]).div(tmp.gainMults[layer]).max(1).log(layers[layer].base).times(tmp.gainExp[layer]).pow(Decimal.pow(layers[layer].exponent, -1))
|
let gain = tmp[layer].baseAmount.div(tmp[layer].requires).div(tmp[layer].gainMult).max(1).log(layers[layer].base).times(tmp[layer].gainExp).pow(Decimal.pow(layers[layer].exponent, -1))
|
||||||
return gain.floor().sub(player[layer].points).add(1).max(1);
|
return gain.floor().sub(player[layer].points).add(1).max(1);
|
||||||
} else if (type=="normal"){
|
} else if (type=="normal"){
|
||||||
if (tmp.layerAmt[layer].lt(tmp.layerReqs[layer])) return new Decimal(0)
|
if (tmp[layer].baseAmount.lt(tmp[layer].requires)) return new Decimal(0)
|
||||||
let gain = tmp.layerAmt[layer].div(tmp.layerReqs[layer]).pow(layers[layer].exponent).times(tmp.gainMults[layer]).pow(tmp.gainExp[layer])
|
let gain = tmp[layer].baseAmount.div(tmp[layer].requires).pow(layers[layer].exponent).times(tmp[layer].gainMult).pow(tmp[layer].gainExp)
|
||||||
if (gain.gte("e1e7")) gain = gain.sqrt().times("e5e6")
|
if (gain.gte("e1e7")) gain = gain.sqrt().times("e5e6")
|
||||||
return gain.floor().max(0);
|
return gain.floor().max(0);
|
||||||
} else if (type=="custom"){
|
} else if (type=="custom"){
|
||||||
|
@ -60,19 +59,19 @@ function getNextAt(layer, canMax=false, useType = null) {
|
||||||
let type = useType
|
let type = useType
|
||||||
if (!useType) type = layers[layer].type
|
if (!useType) type = layers[layer].type
|
||||||
|
|
||||||
if (tmp.gainExp[layer].eq(0)) return new Decimal(1/0)
|
if (tmp[layer].gainExp.eq(0)) return new Decimal(1/0)
|
||||||
if (type=="static")
|
if (type=="static")
|
||||||
{
|
{
|
||||||
if (!layers[layer].canBuyMax()) canMax = false
|
if (!layers[layer].canBuyMax()) canMax = false
|
||||||
let amt = player[layer].points.plus((canMax&&tmp.layerAmt[layer].gte(tmp.nextAt[layer]))?tmp.resetGain[layer]:0)
|
let amt = player[layer].points.plus((canMax&&tmp[layer].baseAmount.gte(tmp[layer].nextAt))?tmp[layer].resetGain:0)
|
||||||
let extraCost = Decimal.pow(layers[layer].base, amt.pow(layers[layer].exponent).div(tmp.gainExp[layer])).times(tmp.gainMults[layer])
|
let extraCost = Decimal.pow(layers[layer].base, amt.pow(layers[layer].exponent).div(tmp[layer].gainExp)).times(tmp[layer].gainMult)
|
||||||
let cost = extraCost.times(tmp.layerReqs[layer]).max(tmp.layerReqs[layer])
|
let cost = extraCost.times(tmp[layer].requires).max(tmp[layer].requires)
|
||||||
if (layers[layer].resCeil) cost = cost.ceil()
|
if (layers[layer].resCeil) cost = cost.ceil()
|
||||||
return cost;
|
return cost;
|
||||||
} else if (type=="normal"){
|
} else if (type=="normal"){
|
||||||
let next = tmp.resetGain[layer].add(1)
|
let next = tmp[layer].resetGain.add(1)
|
||||||
if (next.gte("e1e7")) next = next.div("e5e6").pow(2)
|
if (next.gte("e1e7")) next = next.div("e5e6").pow(2)
|
||||||
next = next.root(tmp.gainExp[layer]).div(tmp.gainMults[layer]).root(layers[layer].exponent).times(tmp.layerReqs[layer]).max(tmp.layerReqs[layer])
|
next = next.root(tmp[layer].gainExp.div(tmp[layer].gainMult).root(layers[layer].exponent).times(tmp[layer].requires).max(tmp[layer].requires))
|
||||||
if (layers[layer].resCeil) next = next.ceil()
|
if (layers[layer].resCeil) next = next.ceil()
|
||||||
return next;
|
return next;
|
||||||
} else if (type=="custom"){
|
} else if (type=="custom"){
|
||||||
|
@ -85,7 +84,7 @@ function getNextAt(layer, canMax=false, useType = null) {
|
||||||
function shouldNotify(layer){
|
function shouldNotify(layer){
|
||||||
for (id in layers[layer].upgrades){
|
for (id in layers[layer].upgrades){
|
||||||
if (!isNaN(id)){
|
if (!isNaN(id)){
|
||||||
if (canAffordUpg(layer, id) && !hasUpg(layer, id) && tmp.upgrades[layer][id].unl){
|
if (canAffordUpg(layer, id) && !hasUpg(layer, id) && tmp[layer].upgrades[id].unl){
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,6 +97,16 @@ function shouldNotify(layer){
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function canReset(layer)
|
||||||
|
{
|
||||||
|
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)
|
||||||
|
else
|
||||||
|
return layers[layer].canReset()
|
||||||
|
}
|
||||||
|
|
||||||
function rowReset(row, layer) {
|
function rowReset(row, layer) {
|
||||||
for (lr in ROW_LAYERS[row]){
|
for (lr in ROW_LAYERS[row]){
|
||||||
if(layers[lr].doReset) {
|
if(layers[lr].doReset) {
|
||||||
|
@ -150,7 +159,7 @@ function addPoints(layer, gain) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function generatePoints(layer, diff) {
|
function generatePoints(layer, diff) {
|
||||||
addPoints(layer, tmp.resetGain[layer].times(diff))
|
addPoints(layer, tmp[layer].resetGain.times(diff))
|
||||||
}
|
}
|
||||||
|
|
||||||
var prevOnReset
|
var prevOnReset
|
||||||
|
@ -158,14 +167,14 @@ var prevOnReset
|
||||||
function doReset(layer, force=false) {
|
function doReset(layer, force=false) {
|
||||||
let row = layers[layer].row
|
let row = layers[layer].row
|
||||||
if (!force) {
|
if (!force) {
|
||||||
if (tmp.layerAmt[layer].lt(tmp.layerReqs[layer])) return;
|
if (tmp[layer].baseAmount.lt(tmp[layer].requires)) return;
|
||||||
let gain = tmp.resetGain[layer]
|
let gain = tmp[layer].resetGain
|
||||||
if (layers[layer].type=="static") {
|
if (layers[layer].type=="static") {
|
||||||
if (tmp.layerAmt[layer].lt(tmp.nextAt[layer])) return;
|
if (tmp[layer].baseAmount.lt(tmp[layer].nextAt)) return;
|
||||||
gain =(layers[layer].canBuyMax() ? gain : 1)
|
gain =(layers[layer].canBuyMax() ? gain : 1)
|
||||||
}
|
}
|
||||||
if (layers[layer].type=="custom") {
|
if (layers[layer].type=="custom") {
|
||||||
if (!tmp.canReset[layer]) return;
|
if (!tmp[layer].canReset) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (layers[layer].onPrestige)
|
if (layers[layer].onPrestige)
|
||||||
|
@ -185,10 +194,10 @@ function doReset(layer, force=false) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp.layerAmt[layer] = new Decimal(0) // quick fix
|
tmp[layer].baseAmount = new Decimal(0) // quick fix
|
||||||
}
|
}
|
||||||
|
|
||||||
if (layers[layer].resetsNothing && layers[layer].resetsNothing()) return
|
if (tmp[layer].resetsNothing) return
|
||||||
|
|
||||||
|
|
||||||
for (layerResetting in layers) {
|
for (layerResetting in layers) {
|
||||||
|
@ -201,7 +210,6 @@ function doReset(layer, force=false) {
|
||||||
for (let x = row; x >= 0; x--) rowReset(x, layer)
|
for (let x = row; x >= 0; x--) rowReset(x, layer)
|
||||||
prevOnReset = undefined
|
prevOnReset = undefined
|
||||||
|
|
||||||
setupTemp();
|
|
||||||
updateTemp()
|
updateTemp()
|
||||||
updateTemp()
|
updateTemp()
|
||||||
}
|
}
|
||||||
|
@ -216,7 +224,7 @@ function respecBuyables(layer) {
|
||||||
|
|
||||||
function canAffordUpg(layer, id) {
|
function canAffordUpg(layer, id) {
|
||||||
let upg = layers[layer].upgrades[id]
|
let upg = layers[layer].upgrades[id]
|
||||||
let cost = tmp.upgrades[layer][id].cost
|
let cost = tmp[layer].upgrades[id].cost
|
||||||
return canAffordPurchase(layer, upg, cost)
|
return canAffordPurchase(layer, upg, cost)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,15 +241,15 @@ function hasChall(layer, id){
|
||||||
}
|
}
|
||||||
|
|
||||||
function upgEffect(layer, id){
|
function upgEffect(layer, id){
|
||||||
return (tmp.upgrades[layer][id].effect)
|
return (tmp[layer].upgrades[id].effect)
|
||||||
}
|
}
|
||||||
|
|
||||||
function challEffect(layer, id){
|
function challEffect(layer, id){
|
||||||
return (tmp.challs[layer][id].effect)
|
return (tmp[layer].challs[id].effect)
|
||||||
}
|
}
|
||||||
|
|
||||||
function buyableEffect(layer, id){
|
function buyableEffect(layer, id){
|
||||||
return (tmp.buyables[layer][id].effect)
|
return (tmp[layer].buyables[id].effect)
|
||||||
}
|
}
|
||||||
|
|
||||||
function canAffordPurchase(layer, thing, cost) {
|
function canAffordPurchase(layer, thing, cost) {
|
||||||
|
@ -265,7 +273,7 @@ function buyUpg(layer, id) {
|
||||||
if (!layers[layer].upgrades[id].unl()) return
|
if (!layers[layer].upgrades[id].unl()) return
|
||||||
if (player[layer].upgrades.includes(id)) return
|
if (player[layer].upgrades.includes(id)) return
|
||||||
let upg = layers[layer].upgrades[id]
|
let upg = layers[layer].upgrades[id]
|
||||||
let cost = tmp.upgrades[layer][id].cost
|
let cost = tmp[layer].upgrades[id].cost
|
||||||
|
|
||||||
if (upg.currencyInternalName){
|
if (upg.currencyInternalName){
|
||||||
let name = upg.currencyInternalName
|
let name = upg.currencyInternalName
|
||||||
|
@ -290,8 +298,8 @@ function buyUpg(layer, id) {
|
||||||
|
|
||||||
function buyMaxBuyable(layer, id) {
|
function buyMaxBuyable(layer, id) {
|
||||||
if (!player[layer].unl) return
|
if (!player[layer].unl) return
|
||||||
if (!tmp.buyables[layer][id].unl) return
|
if (!tmp[layer].buyables[id].unl) return
|
||||||
if (!tmp.buyables[layer][id].canAfford) return
|
if (!tmp[layer].buyables[id].canAfford) return
|
||||||
if (!layers[layer].buyables[id].buyMax) return
|
if (!layers[layer].buyables[id].buyMax) return
|
||||||
|
|
||||||
layers[layer].buyables[id].buyMax()
|
layers[layer].buyables[id].buyMax()
|
||||||
|
@ -300,8 +308,8 @@ function buyMaxBuyable(layer, id) {
|
||||||
|
|
||||||
function buyBuyable(layer, id) {
|
function buyBuyable(layer, id) {
|
||||||
if (!player[layer].unl) return
|
if (!player[layer].unl) return
|
||||||
if (!tmp.buyables[layer][id].unl) return
|
if (!tmp[layer].buyables[id].unl) return
|
||||||
if (!tmp.buyables[layer][id].canAfford) return
|
if (!tmp[layer].buyables[id].canAfford) return
|
||||||
|
|
||||||
layers[layer].buyables[id].buy()
|
layers[layer].buyables[id].buy()
|
||||||
updateBuyableTemp(layer)
|
updateBuyableTemp(layer)
|
||||||
|
|
29
js/layers.js
29
js/layers.js
|
@ -97,7 +97,7 @@ addLayer("c", {
|
||||||
if (ret.gte("1e20000000")) ret = ret.sqrt().times("1e10000000")
|
if (ret.gte("1e20000000")) ret = ret.sqrt().times("1e10000000")
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
effectDisplay(fx) { return format(fx)+"x" }, // Add formatting to the effect
|
effectDisplay() { return format(this.effect())+"x" }, // Add formatting to the effect
|
||||||
},
|
},
|
||||||
13: {
|
13: {
|
||||||
desc:() => "Unlock a <b>secret subtab</b> and make this layer act if you unlocked it first.",
|
desc:() => "Unlock a <b>secret subtab</b> and make this layer act if you unlocked it first.",
|
||||||
|
@ -132,12 +132,12 @@ addLayer("c", {
|
||||||
respecText:() => "Respec Thingies", // Text on Respec button, optional
|
respecText:() => "Respec Thingies", // Text on Respec button, optional
|
||||||
11: {
|
11: {
|
||||||
title:() => "Exhancers", // Optional, displayed at the top in a larger font
|
title:() => "Exhancers", // Optional, displayed at the top in a larger font
|
||||||
cost(x) { // cost for buying xth buyable, can be an object if there are multiple currencies
|
cost(x=player[this.layer].buyables[this.id]) { // cost for buying xth buyable, can be an object if there are multiple currencies
|
||||||
if (x.gte(25)) x = x.pow(2).div(25)
|
if (x.gte(25)) x = x.pow(2).div(25)
|
||||||
let cost = Decimal.pow(2, x.pow(1.5))
|
let cost = Decimal.pow(2, x.pow(1.5))
|
||||||
return cost.floor()
|
return cost.floor()
|
||||||
},
|
},
|
||||||
effect(x) { // Effects of owning x of the items, x is a decimal
|
effect(x=player[this.layer].buyables[this.id]) { // Effects of owning x of the items, x is a decimal
|
||||||
let eff = {}
|
let eff = {}
|
||||||
if (x.gte(0)) eff.first = Decimal.pow(25, x.pow(1.1))
|
if (x.gte(0)) eff.first = Decimal.pow(25, x.pow(1.1))
|
||||||
else eff.first = Decimal.pow(1/25, x.times(-1).pow(1.1))
|
else eff.first = Decimal.pow(1/25, x.times(-1).pow(1.1))
|
||||||
|
@ -147,16 +147,16 @@ addLayer("c", {
|
||||||
return eff;
|
return eff;
|
||||||
},
|
},
|
||||||
display() { // Everything else displayed in the buyable button after the title
|
display() { // Everything else displayed in the buyable button after the title
|
||||||
let data = tmp.buyables[this.layer][this.id]
|
let data = tmp[this.layer].buyables[this.id]
|
||||||
return "Cost: " + format(data.cost) + " lollipops\n\
|
return "Cost: " + format(data.cost) + " lollipops\n\
|
||||||
Amount: " + player[this.layer].buyables[this.id] + "\n\
|
Amount: " + player[this.layer].buyables[this.id] + "\n\
|
||||||
Adds + " + format(data.effect.first) + " things and multiplies stuff by " + format(data.effect.second)
|
Adds + " + format(data.effect.first) + " things and multiplies stuff by " + format(data.effect.second)
|
||||||
},
|
},
|
||||||
unl() { return player[this.layer].unl },
|
unl() { return player[this.layer].unl },
|
||||||
canAfford() {
|
canAfford() {
|
||||||
return player[this.layer].points.gte(tmp.buyables[this.layer][this.id].cost)},
|
return player[this.layer].points.gte(tmp[this.layer].buyables[this.id].cost)},
|
||||||
buy() {
|
buy() {
|
||||||
cost = tmp.buyables[this.layer][this.id].cost
|
cost = tmp[this.layer].buyables[this.id].cost
|
||||||
player[this.layer].points = player[this.layer].points.sub(cost)
|
player[this.layer].points = player[this.layer].points.sub(cost)
|
||||||
player[this.layer].buyables[this.id] = player[this.layer].buyables[this.id].add(1)
|
player[this.layer].buyables[this.id] = player[this.layer].buyables[this.id].add(1)
|
||||||
player[this.layer].spentOnBuyables = player[this.layer].spentOnBuyables.add(cost) // This is a built-in system that you can use for respeccing but it only works with a single Decimal value
|
player[this.layer].spentOnBuyables = player[this.layer].spentOnBuyables.add(cost) // This is a built-in system that you can use for respeccing but it only works with a single Decimal value
|
||||||
|
@ -173,8 +173,6 @@ addLayer("c", {
|
||||||
}, // Do any gameloop things (e.g. resource generation) inherent to this layer
|
}, // Do any gameloop things (e.g. resource generation) inherent to this layer
|
||||||
automate() {
|
automate() {
|
||||||
}, // Do any automation inherent to this layer if appropriate
|
}, // Do any automation inherent to this layer if appropriate
|
||||||
updateTemp() {
|
|
||||||
}, // Do any necessary temp updating, not that important usually
|
|
||||||
resetsNothing() {return false},
|
resetsNothing() {return false},
|
||||||
onPrestige(gain) {
|
onPrestige(gain) {
|
||||||
return
|
return
|
||||||
|
@ -232,7 +230,7 @@ addLayer("c", {
|
||||||
buttonStyle() {return {'color': 'orange'}},
|
buttonStyle() {return {'color': 'orange'}},
|
||||||
content:
|
content:
|
||||||
["main-display",
|
["main-display",
|
||||||
["prestige-button", function() {return "Melt your points into "}],
|
"prestige-button",
|
||||||
["blank", "5px"], // Height
|
["blank", "5px"], // Height
|
||||||
["raw-html", function() {return "<button onclick='console.log(`yeet`)'>'HI'</button>"}],
|
["raw-html", function() {return "<button onclick='console.log(`yeet`)'>'HI'</button>"}],
|
||||||
["display-text",
|
["display-text",
|
||||||
|
@ -249,8 +247,8 @@ addLayer("c", {
|
||||||
["toggle", ["c", "beep"]], ["blank", ["30px", "10px"]], // Width, height
|
["toggle", ["c", "beep"]], ["blank", ["30px", "10px"]], // Width, height
|
||||||
["display-text", function() {return "Beep"}], "blank", ["v-line", "200px"],
|
["display-text", function() {return "Beep"}], "blank", ["v-line", "200px"],
|
||||||
["column", [
|
["column", [
|
||||||
["prestige-button", function() {return "Be redundant for "}, {'width': '150px', 'height': '30px'}],
|
["prestige-button", "", {'width': '150px', 'height': '80px'}],
|
||||||
["prestige-button", function() {return "Be redundant for "}, {'width': '150px', 'height': '30px'}],
|
["prestige-button", "", {'width': '100px', 'height': '150px'}],
|
||||||
]],
|
]],
|
||||||
], {'width': '600px', 'height': '350px', 'background-color': 'green', 'border-style': 'solid'}],
|
], {'width': '600px', 'height': '350px', 'background-color': 'green', 'border-style': 'solid'}],
|
||||||
"blank",
|
"blank",
|
||||||
|
@ -284,7 +282,8 @@ addLayer("c", {
|
||||||
shouldNotify() { // Optional, layer will be highlighted on the tree if true.
|
shouldNotify() { // Optional, layer will be highlighted on the tree if true.
|
||||||
// Layer will automatically highlight if an upgrade is purchasable.
|
// Layer will automatically highlight if an upgrade is purchasable.
|
||||||
return (player.c.buyables[11] == 1)
|
return (player.c.buyables[11] == 1)
|
||||||
}
|
},
|
||||||
|
resetDesc: "Melt your points into ",
|
||||||
})
|
})
|
||||||
|
|
||||||
// This layer is mostly minimal but it uses a custom prestige type
|
// This layer is mostly minimal but it uses a custom prestige type
|
||||||
|
@ -325,8 +324,8 @@ addLayer("f", {
|
||||||
|
|
||||||
// The following are only currently used for "custom" Prestige type:
|
// The following are only currently used for "custom" Prestige type:
|
||||||
prestigeButtonText() { //Is secretly HTML
|
prestigeButtonText() { //Is secretly HTML
|
||||||
if (!this.canBuyMax()) return "Hi! I'm a <u>weird dinosaur</u> and I'll give you a Farm Point in exchange for all of your candies and lollipops! (At least " + formatWhole(tmp.nextAt[layer]) + " candies)"
|
if (!this.canBuyMax()) return "Hi! I'm a <u>weird dinosaur</u> and I'll give you a Farm Point in exchange for all of your candies and lollipops! (At least " + formatWhole(tmp[this.layer].nextAt) + " candies)"
|
||||||
if (this.canBuyMax()) return "Hi! I'm a <u>weird dinosaur</u> and I'll give you <b>" + formatWhole(tmp.resetGain[this.layer]) + "</b> Farm Points in exchange for all of your candies and lollipops! (You'll get another one at " + formatWhole(tmp.nextAtDisp[layer]) + " candies)"
|
if (this.canBuyMax()) return "Hi! I'm a <u>weird dinosaur</u> and I'll give you <b>" + formatWhole(tmp[this.layer].resetGain) + "</b> Farm Points in exchange for all of your candies and lollipops! (You'll get another one at " + formatWhole(tmp[layer].nextAtDisp) + " candies)"
|
||||||
},
|
},
|
||||||
getResetGain() {
|
getResetGain() {
|
||||||
return getResetGain(this.layer, useType = "static")
|
return getResetGain(this.layer, useType = "static")
|
||||||
|
@ -335,7 +334,7 @@ addLayer("f", {
|
||||||
return getNextAt(this.layer, canMax, useType = "static")
|
return getNextAt(this.layer, canMax, useType = "static")
|
||||||
},
|
},
|
||||||
canReset() {
|
canReset() {
|
||||||
return tmp.layerAmt[this.layer].gte(tmp.nextAt[this.layer])
|
return tmp[this.layer].baseAmount.gte(tmp[this.layer].nextAt)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
const SAVES = {
|
|
||||||
PRE_SUPER_BOOSTERS: "eyJ0YWIiOiJvcHRpb25zIiwidGltZSI6MTU5ODE5ODI4NjQ4OCwiYXV0b3NhdmUiOnRydWUsInBvaW50cyI6IjMuMzYwMTkyNjc5ODczNDgzZTQxNDMiLCJwIjp7InVubCI6dHJ1ZSwicG9pbnRzIjoiMi4xMjI1NzI5ODA3NjQzMTQ2ZTI3NjMiLCJ1cGdyYWRlcyI6WzExLDEyLDIxLDIyLDEzLDIzXSwiYmVzdCI6IjUxMDIyNjAwNiJ9LCJiIjp7InVubCI6dHJ1ZSwicG9pbnRzIjoiMTgwIiwidXBncmFkZXMiOlsxMSwxMiwxMywyMiwyMSwyM10sImJlc3QiOiIxODAiLCJhdXRvIjp0cnVlfSwiZyI6eyJ1bmwiOnRydWUsInBvaW50cyI6IjEzOSIsInBvd2VyIjoiMi4zNDMxNTg3NTczMjc0ODVlMzM5IiwidXBncmFkZXMiOlsxMSwxMiwxMywxNCwxNSwyMiwyMSwyMywyNCwyNV0sImJlc3QiOiIxMzkiLCJhdXRvIjp0cnVlfSwiZSI6eyJ1bmwiOnRydWUsInBvaW50cyI6IjEuNzAxNTAzNTMzMDU4MTA3NmU4NiIsImJlc3QiOiIxLjcwMTUwMzUzMzA1ODEwNzZlODYiLCJlbmhhbmNlcnMiOiIzMyIsInVwZ3JhZGVzIjpbMTEsMTIsMTMsMTQsMTUsMjEsMjMsMjIsMjQsMjVdLCJvcmRlciI6MH0sInQiOnsidW5sIjp0cnVlLCJvcmRlciI6MCwicG9pbnRzIjoiMTYiLCJiZXN0IjoiMTYiLCJlbmVyZ3kiOiIxLjA4MDMzODY3NDA5Mjg3NmU5NCIsImV4dENhcHN1bGVzIjoiMjYiLCJ1cGdyYWRlcyI6WzExLDEyLDEzLDE0LDIxLDIyLDIzLDI0LDMxLDMyLDMzXX0sInMiOnsidW5sIjp0cnVlLCJvcmRlciI6MCwicG9pbnRzIjoiMTYiLCJiZXN0IjoiMTYiLCJzcGVudCI6IjY4IiwiYnVpbGRpbmdzIjp7IjEiOiIxNyIsIjIiOiIyNiIsIjMiOiIxMyIsIjQiOiI4IiwiNSI6IjQifSwidXBncmFkZXMiOlsxMSwxMiwxMywxNCwyMSwyMywyNCwzMSwyMiwzMiwzMywzNF19LCJzYiI6eyJ1bmwiOmZhbHNlLCJvcmRlciI6MCwicG9pbnRzIjoiMCIsImJlc3QiOiIwIiwidXBncmFkZXMiOltdfSwidmVyc2lvblR5cGUiOiJhbHBoYSIsInZlcnNpb24iOjEwfQ==",
|
|
||||||
}
|
|
373
js/temp.js
373
js/temp.js
|
@ -1,338 +1,79 @@
|
||||||
function setupTemp(){
|
var tmp = {}
|
||||||
if (!tmp.challActive) {tmp.challActive = {}}
|
|
||||||
if (!tmp.challs) tmp.challs = {}
|
|
||||||
for (layer in layers) {
|
|
||||||
if(layers[layer].challs !== undefined){
|
|
||||||
tmp.challActive[layer] = {}
|
|
||||||
setupChallTemp(layer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!tmp.upgrades) tmp.upgrades = {}
|
// Tmp will not call these
|
||||||
for (layer in layers) {
|
var activeFunctions = [
|
||||||
if(layers[layer].upgrades !== undefined){
|
"startData", "onPrestige", "doReset", "update", "automate",
|
||||||
setupUpgradeTemp(layer)
|
"buy", "buyMax", "respec", "onComplete", "onPurchase", "onPress"
|
||||||
}
|
]
|
||||||
}
|
|
||||||
|
|
||||||
if (!tmp.milestones) tmp.milestones = {}
|
function setupTemp() {
|
||||||
for (layer in layers) {
|
tmp = {}
|
||||||
if(layers[layer].milestones !== undefined){
|
setupTempData(layers, tmp)
|
||||||
setupMilestoneTemp(layer)
|
|
||||||
|
for (layer in layers){
|
||||||
|
tmp[layer].resetGain = {}
|
||||||
|
tmp[layer].nextAt = {}
|
||||||
|
tmp[layer].nextAtDisp = {}
|
||||||
|
tmp[layer].notify = {}
|
||||||
|
tmp[layer].canReset = {}
|
||||||
|
tmp[layer].prestigeButtonText = {}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setupTempData(layerData, tmpData) {
|
||||||
|
tmp.pointGen = {}
|
||||||
|
|
||||||
|
|
||||||
|
for (item in layerData){
|
||||||
|
if (layerData[item] == null) {
|
||||||
|
tmpData[item] = null
|
||||||
}
|
}
|
||||||
if (!tmp.buyables) tmp.buyables = {}
|
else if (Array.isArray(layerData[item])) {
|
||||||
for (layer in layers) if (layers[layer].buyables) {
|
tmpData[item] = []
|
||||||
if(layers[layer].buyables !== undefined){
|
setupTempData(layerData[item], tmpData[item])
|
||||||
setupBuyableTemp(layer)
|
}
|
||||||
|
else if ((!!layerData[item]) && (layerData[item].constructor === Object)) {
|
||||||
|
tmpData[item] = {}
|
||||||
|
setupTempData(layerData[item], tmpData[item])
|
||||||
|
}
|
||||||
|
else if (isFunction(layerData[item]) && !activeFunctions.includes(item)){
|
||||||
|
tmpData[item] = {}
|
||||||
|
} else {
|
||||||
|
tmpData[item] = layerData[item]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateTemp() {
|
function updateTemp() {
|
||||||
for (layer in layers) tmp[layer] = {}
|
if (tmp === undefined)
|
||||||
|
setupTemp()
|
||||||
|
|
||||||
if (tmp.genPoints == undefined) tmp.genPoints = false
|
updateTempData(layers, tmp)
|
||||||
|
|
||||||
|
for (layer in layers){
|
||||||
|
tmp[layer].resetGain = getResetGain(layer)
|
||||||
|
tmp[layer].nextAt = getNextAt(layer)
|
||||||
|
tmp[layer].nextAtDisp = getNextAt(layer, true)
|
||||||
|
tmp[layer].notify = shouldNotify(layer)
|
||||||
|
tmp[layer].canReset = canReset(layer)
|
||||||
|
tmp[layer].prestigeButtonText = prestigeButtonText(layer)
|
||||||
|
|
||||||
if (!tmp.layerReqs) tmp.layerReqs = {}
|
|
||||||
for (layer in layers) tmp.layerReqs[layer] = layers[layer].requires()
|
|
||||||
|
|
||||||
if (!tmp.layerEffs) tmp.layerEffs = {}
|
|
||||||
for (layer in layers) if (layers[layer].effect) tmp.layerEffs[layer] = layers[layer].effect()
|
|
||||||
|
|
||||||
if (!tmp.gainMults) tmp.gainMults = {}
|
|
||||||
if (!tmp.gainExp) tmp.gainExp = {}
|
|
||||||
if (!tmp.resetGain) tmp.resetGain = {}
|
|
||||||
if (!tmp.nextAt) tmp.nextAt = {}
|
|
||||||
if (!tmp.layerAmt) tmp.layerAmt = {}
|
|
||||||
if (!tmp.layerColor) tmp.layerColor = {}
|
|
||||||
if (!tmp.layerShown) tmp.layerShown = {}
|
|
||||||
if (!tmp.effectDescription) tmp.effectDescription = {}
|
|
||||||
if (!tmp.style) tmp.style = {}
|
|
||||||
if (!tmp.nodeStyle) tmp.nodeStyle = {}
|
|
||||||
if (!tmp.notify) tmp.notify = {}
|
|
||||||
if (!tmp.nextAtDisp) tmp.nextAtDisp = {}
|
|
||||||
if (!tmp.prestigeButtonText) tmp.prestigeButtonText = {}
|
|
||||||
if (!tmp.canReset) tmp.canReset = {}
|
|
||||||
if (!tmp.tooltips) tmp.tooltips = {}
|
|
||||||
if (!tmp.tooltipsLocked) tmp.tooltipsLocked = {}
|
|
||||||
|
|
||||||
for (layer in layers) {
|
|
||||||
if (layers[layer].color) tmp.layerColor[layer] = layers[layer].color()
|
|
||||||
if (layers[layer].style) tmp.style[layer] = layers[layer].style()
|
|
||||||
tmp.layerShown[layer] = layers[layer].layerShown()
|
|
||||||
tmp.layerAmt[layer] = layers[layer].baseAmount()
|
|
||||||
tmp.gainMults[layer] = layers[layer].gainMult()
|
|
||||||
tmp.gainExp[layer] = layers[layer].gainExp()
|
|
||||||
tmp.resetGain[layer] = getResetGain(layer)
|
|
||||||
tmp.nextAt[layer] = getNextAt(layer)
|
|
||||||
tmp.notify[layer] = shouldNotify(layer)
|
|
||||||
tmp.nextAtDisp[layer] = getNextAt(layer, true)
|
|
||||||
if (layers[layer].effectDescription) tmp.effectDescription[layer] = layers[layer].effectDescription()
|
|
||||||
if (layers[layer].canReset) tmp.canReset[layer] = layers[layer].canReset()
|
|
||||||
if (layers[layer].prestigeButtonText) tmp.prestigeButtonText[layer] = layers[layer].prestigeButtonText()
|
|
||||||
if (layers[layer].tooltip) tmp.tooltips[layer] = layers[layer].tooltip()
|
|
||||||
if (layers[layer].tooltipLocked) tmp.tooltipsLocked[layer] = layers[layer].tooltipLocked()
|
|
||||||
if (layers[layer].nodeStyle) tmp.nodeStyle[layer] = layers[layer].nodeStyle()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp.pointGen = getPointGen()
|
tmp.pointGen = getPointGen()
|
||||||
|
}
|
||||||
|
|
||||||
for (layer in layers){
|
function updateTempData(layerData, tmpData) {
|
||||||
if (layers[layer].updateTemp) layers[layer].updateTemp()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!tmp.componentStyles) tmp.componentStyles = {}
|
for (item in layerData){
|
||||||
for (layer in layers) if (layers[layer].componentStyles) {
|
if (Array.isArray(layerData[item])) {
|
||||||
if(layers[layer].componentStyles !== undefined){
|
updateTempData(layerData[item], tmpData[item])
|
||||||
tmp.componentStyles[layer] = {}
|
|
||||||
for (item in layers[layer].componentStyles)
|
|
||||||
tmp.componentStyles[layer][item] = layers[layer].componentStyles[item]()
|
|
||||||
}
|
}
|
||||||
|
else if ((!!layerData[item]) && (layerData[item].constructor === Object)) {
|
||||||
|
updateTempData(layerData[item], tmpData[item])
|
||||||
}
|
}
|
||||||
|
else if (isFunction(layerData[item]) && !activeFunctions.includes(item)){
|
||||||
|
tmpData[item] = layerData[item]()
|
||||||
if (!tmp.microtabs) tmp.microtabs = {}
|
|
||||||
for (layer in layers) {
|
|
||||||
if (!tmp.microtabs[layer]) tmp.microtabs[layer] = {}
|
|
||||||
if (layers[layer].microtabs) {
|
|
||||||
if(layers[layer].microtabs !== undefined){
|
|
||||||
updateMicrotabTemp(layer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(layers[layer].tabFormat && !Array.isArray(layers[layer].tabFormat)){
|
|
||||||
let data2 = layers[layer].tabFormat
|
|
||||||
let set = "mainTabs"
|
|
||||||
if (!tmp.microtabs[layer][set]) tmp.microtabs[layer][set] = {}
|
|
||||||
for (tab in data2) {
|
|
||||||
if (!tmp.microtabs[layer][set][tab])
|
|
||||||
tmp.microtabs[layer][set][tab] = {}
|
|
||||||
if(data2[tab].style)
|
|
||||||
tmp.microtabs[layer][set][tab].style = data2[tab].style()
|
|
||||||
if(data2[tab].buttonStyle)
|
|
||||||
tmp.microtabs[layer][set][tab].buttonStyle = data2[tab].buttonStyle()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!tmp.challActive) {tmp.challActive = {}}
|
|
||||||
if (!tmp.challs) tmp.challs = {}
|
|
||||||
for (layer in layers) {
|
|
||||||
if(layers[layer].challs !== undefined){
|
|
||||||
tmp.challActive[layer] = {}
|
|
||||||
updateChallTemp(layer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!tmp.upgrades) tmp.upgrades = {}
|
|
||||||
for (layer in layers) {
|
|
||||||
if(layers[layer].upgrades !== undefined){
|
|
||||||
updateUpgradeTemp(layer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!tmp.milestones) tmp.milestones = {}
|
|
||||||
for (layer in layers) {
|
|
||||||
if(layers[layer].milestones !== undefined){
|
|
||||||
updateMilestoneTemp(layer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!tmp.buyables) tmp.buyables = {}
|
|
||||||
for (layer in layers) if (layers[layer].buyables) {
|
|
||||||
if(layers[layer].buyables !== undefined){
|
|
||||||
updateBuyableTemp(layer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (layer in layers) {
|
|
||||||
if(layers[layer].gagues !== undefined){
|
|
||||||
tmp[layer].gagues = {}
|
|
||||||
updateGagueTemp(layer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function updateChallTemp(layer) {
|
|
||||||
if (player[layer] === undefined) return
|
|
||||||
if (!tmp.challs[layer]) tmp.challs[layer] = {}
|
|
||||||
|
|
||||||
let data = tmp.challActive[layer]
|
|
||||||
let data2 = layers[layer].challs
|
|
||||||
let customActive = data2.active !== undefined
|
|
||||||
for (let row = 1; row <= data2.rows; row++) {
|
|
||||||
for (let col = 1; col <= data2.cols; col++) {
|
|
||||||
let id = row * 10 + col
|
|
||||||
tmp.challs[layer][id] = {}
|
|
||||||
|
|
||||||
if (customActive ? data2.active(id) : player[layer].active == id) data[id] = 1
|
|
||||||
else delete data[id]
|
|
||||||
|
|
||||||
tmp.challs[layer][id].unl = data2[id].unl()
|
|
||||||
if(data2[id].name) tmp.challs[layer][id].name = data2[id].name()
|
|
||||||
if(data2[id].desc) tmp.challs[layer][id].desc = data2[id].desc()
|
|
||||||
if(data2[id].reward) tmp.challs[layer][id].reward = data2[id].reward()
|
|
||||||
if(data2[id].effect) tmp.challs[layer][id].effect = data2[id].effect()
|
|
||||||
if(data2[id].effectDisplay) tmp.challs[layer][id].effectDisplay = data2[id].effectDisplay(tmp.challs[layer][id].effect)
|
|
||||||
tmp.challs[layer][id].goal = data2[id].goal()
|
|
||||||
if(data2[id].style) tmp.challs[layer][id].style = data2[id].style()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateUpgradeTemp(layer) {
|
|
||||||
if (layers[layer] === undefined) return
|
|
||||||
if (!tmp.upgrades[layer]) tmp.upgrades[layer] = {}
|
|
||||||
|
|
||||||
let data2 = layers[layer].upgrades
|
|
||||||
for (let row = 1; row <= data2.rows; row++) {
|
|
||||||
for (let col = 1; col <= data2.cols; col++) {
|
|
||||||
let id = row * 10 + col
|
|
||||||
tmp.upgrades[layer][id] = {}
|
|
||||||
tmp.upgrades[layer][id].unl = data2[id].unl()
|
|
||||||
if(data2[id].effect) tmp.upgrades[layer][id].effect = data2[id].effect()
|
|
||||||
tmp.upgrades[layer][id].cost = data2[id].cost()
|
|
||||||
if(data2[id].effectDisplay) tmp.upgrades[layer][id].effectDisplay = data2[id].effectDisplay(tmp.upgrades[layer][id].effect)
|
|
||||||
if(data2[id].desc) tmp.upgrades[layer][id].desc = data2[id].desc()
|
|
||||||
if(data2[id].title) tmp.upgrades[layer][id].title = data2[id].title()
|
|
||||||
if(data2[id].style) tmp.upgrades[layer][id].style = data2[id].style()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateMilestoneTemp(layer) {
|
|
||||||
if (layers[layer] === undefined) return
|
|
||||||
if (!tmp.milestones[layer]) tmp.milestones[layer] = {}
|
|
||||||
|
|
||||||
let data2 = layers[layer].milestones
|
|
||||||
for (id in data2) {
|
|
||||||
tmp.milestones[layer][id] = {}
|
|
||||||
if(data2[id].unl) tmp.milestones[layer][id].unl = data2[id].unl()
|
|
||||||
tmp.milestones[layer][id].done = data2[id].done()
|
|
||||||
if(data2[id].requirementDesc) tmp.milestones[layer][id].requirementDesc = data2[id].requirementDesc()
|
|
||||||
if(data2[id].effectDesc) tmp.milestones[layer][id].effectDesc = data2[id].effectDesc()
|
|
||||||
if(data2[id].style) tmp.milestones[layer][id].style = data2[id].style()
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateBuyableTemp(layer) {
|
|
||||||
if (layers[layer] === undefined) return
|
|
||||||
if (!tmp.buyables[layer]) tmp.buyables[layer] = {}
|
|
||||||
let data2 = layers[layer].buyables
|
|
||||||
if(data2.respecText) tmp.buyables[layer].respecText = data2.respecText()
|
|
||||||
for (let row = 1; row <= data2.rows; row++) {
|
|
||||||
for (let col = 1; col <= data2.cols; col++) {
|
|
||||||
let id = row * 10 + col
|
|
||||||
let amt = player[layer].buyables[id]
|
|
||||||
tmp.buyables[layer][id] = {}
|
|
||||||
tmp.buyables[layer][id].unl = data2[id].unl()
|
|
||||||
if(data2[id].effect) tmp.buyables[layer][id].effect = data2[id].effect(amt)
|
|
||||||
tmp.buyables[layer][id].cost = data2[id].cost(amt)
|
|
||||||
tmp.buyables[layer][id].canAfford = data2[id].canAfford()
|
|
||||||
if(data2[id].title) tmp.buyables[layer][id].title = data2[id].title()
|
|
||||||
if(data2[id].display) tmp.buyables[layer][id].display = data2[id].display()
|
|
||||||
if(data2[id].style) tmp.buyables[layer][id].style = data2[id].style()
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateMicrotabTemp(layer) {
|
|
||||||
if (layers[layer] === undefined) return
|
|
||||||
let data2 = layers[layer].microtabs
|
|
||||||
for (set in data2) {
|
|
||||||
if (!tmp.microtabs[layer][set]) tmp.microtabs[layer][set] = {}
|
|
||||||
for (tab in data2[set]) {
|
|
||||||
if (!tmp.microtabs[layer][set][tab])
|
|
||||||
tmp.microtabs[layer][set][tab] = {}
|
|
||||||
if(data2[set][tab].style)
|
|
||||||
tmp.microtabs[layer][set][tab].style = data2[set][tab].style()
|
|
||||||
if(data2[set][tab].buttonStyle)
|
|
||||||
tmp.microtabs[layer][set][tab].buttonStyle = data2[set][tab].buttonStyle()
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function setupChallTemp(layer) {
|
|
||||||
if (player[layer] === undefined) return
|
|
||||||
if (!tmp.challs[layer]) tmp.challs[layer] = {}
|
|
||||||
|
|
||||||
let data = tmp.challActive[layer]
|
|
||||||
let data2 = layers[layer].challs
|
|
||||||
let customActive = data2.active !== undefined
|
|
||||||
for (let row = 1; row <= data2.rows; row++) {
|
|
||||||
for (let col = 1; col <= data2.cols; col++) {
|
|
||||||
let id = row * 10 + col
|
|
||||||
|
|
||||||
tmp.challs[layer][id] = {}
|
|
||||||
if(data2[id].effect) tmp.challs[layer][id].effect = {}
|
|
||||||
if(data2[id].style) tmp.challs[layer][id].style = {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setupUpgradeTemp(layer) {
|
|
||||||
if (layers[layer] === undefined) return
|
|
||||||
if (!tmp.upgrades[layer]) tmp.upgrades[layer] = {}
|
|
||||||
|
|
||||||
let data2 = layers[layer].upgrades
|
|
||||||
for (let row = 1; row <= data2.rows; row++) {
|
|
||||||
for (let col = 1; col <= data2.cols; col++) {
|
|
||||||
let id = row * 10 + col
|
|
||||||
tmp.upgrades[layer][id] = {}
|
|
||||||
if(data2[id].effect) tmp.upgrades[layer][id].effect = {}
|
|
||||||
if(data2[id].style) tmp.upgrades[layer][id].style = {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setupMilestoneTemp(layer) {
|
|
||||||
if (layers[layer] === undefined) return
|
|
||||||
if (!tmp.milestones[layer]) tmp.milestones[layer] = {}
|
|
||||||
|
|
||||||
let data2 = layers[layer].milestones
|
|
||||||
for (id in data2) {
|
|
||||||
tmp.milestones[layer][id] = {}
|
|
||||||
if(data2[id].style) tmp.milestones[layer][id].style = {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setupBuyableTemp(layer) {
|
|
||||||
if (layers[layer] === undefined) return
|
|
||||||
if (!tmp.buyables[layer]) tmp.buyables[layer] = {}
|
|
||||||
let data2 = layers[layer].buyables
|
|
||||||
for (let row = 1; row <= data2.rows; row++) {
|
|
||||||
for (let col = 1; col <= data2.cols; col++) {
|
|
||||||
let id = row * 10 + col
|
|
||||||
let amt = player[layer].buyables[id]
|
|
||||||
tmp.buyables[layer][id] = {}
|
|
||||||
if(data2[id].effect) tmp.buyables[layer][id].effect = {}
|
|
||||||
tmp.buyables[layer][id].cost = {}
|
|
||||||
if(data2[id].style) tmp.buyables[layer][id].style = {}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// The start of not being backwards with tmp
|
|
||||||
function updateGagueTemp(layer) {
|
|
||||||
if (layers[layer] === undefined) return
|
|
||||||
let gagues = layers[layer].gagues
|
|
||||||
for (id in gagues) {
|
|
||||||
tmp[layer].gagues[id] = {}
|
|
||||||
for (item in gagues[id]) {
|
|
||||||
let thing = gagues[id][item]
|
|
||||||
if (isFunction(thing))
|
|
||||||
tmp[layer].gagues[id] = thing()
|
|
||||||
else
|
|
||||||
tmp[layer].gagues[id] = thing
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
19
js/utils.js
19
js/utils.js
|
@ -333,7 +333,7 @@ function notifyLayer(name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function nodeShown(layer) {
|
function nodeShown(layer) {
|
||||||
if (tmp.layerShown[layer]) return true
|
if (tmp[layer].layerShown) return true
|
||||||
switch(layer) {
|
switch(layer) {
|
||||||
case "idk":
|
case "idk":
|
||||||
return player.l.unl
|
return player.l.unl
|
||||||
|
@ -343,7 +343,7 @@ function nodeShown(layer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function layerUnl(layer) {
|
function layerUnl(layer) {
|
||||||
return LAYERS.includes(layer) && (player[layer].unl || (tmp.layerAmt[layer].gte(tmp.layerReqs[layer]) && layers[layer].layerShown()))
|
return LAYERS.includes(layer) && (player[layer].unl || (tmp[layer].baseAmount.gte(tmp[layer].requires) && layers[layer].layerShown()))
|
||||||
}
|
}
|
||||||
|
|
||||||
function keepGoing() {
|
function keepGoing() {
|
||||||
|
@ -408,6 +408,21 @@ function focused(x) {
|
||||||
onFocused = x
|
onFocused = x
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function prestigeButtonText(layer)
|
||||||
|
{
|
||||||
|
if(tmp[layer].type == "normal")
|
||||||
|
return `${ player[layer].points.lt(1e3) ? (tmp[layer].resetDesc !== undefined ? tmp[layer].resetDesc : "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].resCeil ? formatWhole(tmp[layer].nextAt) : format(tmp[layer].nextAt))}` : ""} ${ tmp[layer].baseResource }`
|
||||||
|
else if(tmp[layer].type== "static")
|
||||||
|
return `${tmp[layer].resetDesc !== undefined ? tmp[layer].resetDesc : "Reset for "}+<b>${formatWhole(tmp[layer].resetGain)}</b> ${tmp[layer].resource}<br><br>${player[layer].points.lt(20) ? (tmp[layer].baseAmount.gte(tmp[layer].nextAt)&&(tmp[layer].canBuyMax !== undefined) && tmp[layer].canBuyMax?"Next":"Req") : ""}: ${formatWhole(tmp[layer].baseAmount)} / ${(tmp[layer].resCeil ? formatWhole(tmp[layer].nextAtDisp) : format(tmp[layer].nextAtDisp))} ${ tmp[layer].baseResource }
|
||||||
|
`
|
||||||
|
else
|
||||||
|
return layers[layer].prestigeButtonText()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function isFunction(obj) {
|
function isFunction(obj) {
|
||||||
return !!(obj && obj.constructor && obj.call && obj.apply);
|
return !!(obj && obj.constructor && obj.call && obj.apply);
|
||||||
};
|
};
|
||||||
|
|
114
js/v.js
114
js/v.js
|
@ -44,9 +44,9 @@ function loadVue() {
|
||||||
<div class="upgTable">
|
<div class="upgTable">
|
||||||
<div class="upgRow">
|
<div class="upgRow">
|
||||||
<div v-for="item in data">
|
<div v-for="item in data">
|
||||||
<div v-if="!Array.isArray(item)" v-bind:is="item" :layer= "layer" v-bind:style="tmp.componentStyles[layer][item]"></div>
|
<div v-if="!Array.isArray(item)" v-bind:is="item" :layer= "layer" v-bind:style="tmp[layer].componentStyles[item]"></div>
|
||||||
<div v-else-if="item.length==3" v-bind:style="[tmp.componentStyles[layer][item], (item[2] ? item[2] : {})]" v-bind:is="item[0]" :layer= "layer" :data= "item[1]"></div>
|
<div v-else-if="item.length==3" v-bind:style="[tmp[layer].componentStyles[item], (item[2] ? item[2] : {})]" v-bind:is="item[0]" :layer= "layer" :data= "item[1]"></div>
|
||||||
<div v-else-if="item.length==2" v-bind:is="item[0]" :layer= "layer" :data= "item[1]" v-bind:style="tmp.componentStyles[layer][item]"></div>
|
<div v-else-if="item.length==2" v-bind:is="item[0]" :layer= "layer" :data= "item[1]" v-bind:style="tmp[layer].componentStyles[item]"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -60,9 +60,9 @@ function loadVue() {
|
||||||
<div class="upgTable">
|
<div class="upgTable">
|
||||||
<div class="upgCol">
|
<div class="upgCol">
|
||||||
<div v-for="item in data">
|
<div v-for="item in data">
|
||||||
<div v-if="!Array.isArray(item)" v-bind:is="item" :layer= "layer" v-bind:style="tmp.componentStyles[layer][item]"></div>
|
<div v-if="!Array.isArray(item)" v-bind:is="item" :layer= "layer" v-bind:style="tmp[layer].componentStyles[item]"></div>
|
||||||
<div v-else-if="item.length==3" v-bind:style="[tmp.componentStyles[layer][item], (item[2] ? item[2] : {})]" v-bind:is="item[0]" :layer= "layer" :data= "item[1]"></div>
|
<div v-else-if="item.length==3" v-bind:style="[tmp[layer].componentStyles[item], (item[2] ? item[2] : {})]" v-bind:is="item[0]" :layer= "layer" :data= "item[1]"></div>
|
||||||
<div v-else-if="item.length==2" v-bind:is="item[0]" :layer= "layer" :data= "item[1]" v-bind:style="tmp.componentStyles[layer][item]"></div>
|
<div v-else-if="item.length==2" v-bind:is="item[0]" :layer= "layer" :data= "item[1]" v-bind:style="tmp[layer].componentStyles[item]"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -90,9 +90,9 @@ function loadVue() {
|
||||||
props: ['layer'],
|
props: ['layer'],
|
||||||
template: `
|
template: `
|
||||||
<div v-if="layers[layer].challs" class="upgTable">
|
<div v-if="layers[layer].challs" class="upgTable">
|
||||||
<div v-for="row in layers[layer].challs.rows" class="upgRow">
|
<div v-for="row in tmp[layer].challs.rows" class="upgRow">
|
||||||
<div v-for="col in layers[layer].challs.cols">
|
<div v-for="col in tmp[layer].challs.cols">
|
||||||
<chall :layer = "layer" :data = "row*10+col" v-bind:style="tmp.componentStyles[layer].chall"></chall>
|
<chall :layer = "layer" :data = "row*10+col" v-bind:style="tmp[layer].componentStyles.chall"></chall>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -103,13 +103,13 @@ function loadVue() {
|
||||||
Vue.component('chall', {
|
Vue.component('chall', {
|
||||||
props: ['layer', 'data'],
|
props: ['layer', 'data'],
|
||||||
template: `
|
template: `
|
||||||
<div v-if="layers[layer].challs && tmp.challs[layer][data].unl && !(player.hideChalls && hasChall(layer, [data]))" v-bind:class="{hChall: true, done: player[layer].challs.includes(data), canComplete: tmp.challActive[layer][data]&&!player[layer].challs.includes(data)&&canCompleteChall(layer, data)}">
|
<div v-if="layers[layer].challs && tmp[layer].challs[data].unl && !(player.hideChalls && hasChall(layer, [data]))" v-bind:class="{hChall: true, done: player[layer].challs.includes(data), canComplete: player[layer].active == data&&!player[layer].challs.includes(data)&&canCompleteChall(layer, data)}">
|
||||||
<br><h3 v-html="tmp.challs[layer][data].name"></h3><br><br>
|
<br><h3 v-html="tmp[layer].challs[data].name"></h3><br><br>
|
||||||
<button v-bind:class="{ longUpg: true, can: true, [layer]: true }" v-bind:style="{'background-color': tmp.layerColor[layer]}" v-on:click="startChall(layer, data)">{{player[layer].active==(data)?(canCompleteChall(layer, data)?"Finish":"Exit Early"):(player[layer].challs.includes(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="startChall(layer, data)">{{player[layer].active==(data)?(canCompleteChall(layer, data)?"Finish":"Exit Early"):(player[layer].challs.includes(data)?"Completed":"Start")}}</button><br><br>
|
||||||
<span v-html="tmp.challs[layer][data].desc"></span><br>
|
<span v-html="tmp[layer].challs[data].desc"></span><br>
|
||||||
Goal: {{format(tmp.challs[layer][data].goal)}} {{layers[layer].challs[data].currencyDisplayName ? layers[layer].challs[data].currencyDisplayName : "points"}}<br>
|
Goal: {{format(tmp[layer].challs[data].goal)}} {{tmp[layer].challs[data].currencyDisplayName ? tmp[layer].challs[data].currencyDisplayName : "points"}}<br>
|
||||||
Reward: <span v-html="tmp.challs[layer][data].reward"></span><br>
|
Reward: <span v-html="tmp[layer].challs[data].reward"></span><br>
|
||||||
<span v-if="tmp.challs[layer][data].effect!==undefined">Currently: <span v-html="(tmp.challs[layer][data].effectDisplay) ? (tmp.challs[layer][data].effectDisplay) : format(tmp.challs[layer][data].effect)"></span></span>
|
<span v-if="tmp[layer].challs[data].effect!==undefined">Currently: <span v-html="(tmp[layer].challs[data].effectDisplay) ? (tmp[layer].challs[data].effectDisplay) : format(tmp[layer].challs[data].effect)"></span></span>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
@ -120,7 +120,7 @@ function loadVue() {
|
||||||
<div v-if="layers[layer].upgrades" class="upgTable">
|
<div v-if="layers[layer].upgrades" class="upgTable">
|
||||||
<div v-for="row in layers[layer].upgrades.rows" class="upgRow">
|
<div v-for="row in layers[layer].upgrades.rows" class="upgRow">
|
||||||
<div v-for="col in layers[layer].upgrades.cols" class="upgAlign">
|
<div v-for="col in layers[layer].upgrades.cols" class="upgAlign">
|
||||||
<upgrade :layer = "layer" :data = "row*10+col" v-bind:style="tmp.componentStyles[layer].upgrade"></upgrade>
|
<upgrade :layer = "layer" :data = "row*10+col" v-bind:style="tmp[layer].componentStyles.upgrade"></upgrade>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
@ -132,12 +132,12 @@ function loadVue() {
|
||||||
Vue.component('upgrade', {
|
Vue.component('upgrade', {
|
||||||
props: ['layer', 'data'],
|
props: ['layer', 'data'],
|
||||||
template: `
|
template: `
|
||||||
<button v-if="layers[layer].upgrades && tmp.upgrades[layer][data].unl" v-on:click="buyUpg(layer, data)" v-bind:class="{ [layer]: true, upg: true, bought: player[layer].upgrades.includes(data), locked: (!(canAffordUpg(layer, data))&&!player[layer].upgrades.includes(data)), can: (canAffordUpg(layer, data)&&!player[layer].upgrades.includes(data))}"
|
<button v-if="layers[layer].upgrades && tmp[layer].upgrades[data].unl" v-on:click="buyUpg(layer, data)" v-bind:class="{ [layer]: true, upg: true, bought: player[layer].upgrades.includes(data), locked: (!(canAffordUpg(layer, data))&&!player[layer].upgrades.includes(data)), can: (canAffordUpg(layer, data)&&!player[layer].upgrades.includes(data))}"
|
||||||
v-bind:style="[((!hasUpg(layer, data) && canAffordUpg(layer, data)) ? {'background-color': tmp.layerColor[layer]} : {}), tmp.upgrades[layer][data].style]">
|
v-bind:style="[((!hasUpg(layer, data) && canAffordUpg(layer, data)) ? {'background-color': tmp[layer].color} : {}), tmp[layer].upgrades[data].style]">
|
||||||
<span v-if= "tmp.upgrades[layer][data].title"><h3 v-html="tmp.upgrades[layer][data].title"></h3><br></span>
|
<span v-if= "tmp[layer].upgrades[data].title"><h3 v-html="tmp[layer].upgrades[data].title"></h3><br></span>
|
||||||
<span v-html="tmp.upgrades[layer][data].desc"></span>
|
<span v-html="tmp[layer].upgrades[data].desc"></span>
|
||||||
<span v-if="tmp.upgrades[layer][data].effect"><br>Currently: <span v-html="(tmp.upgrades[layer][data].effectDisplay) ? (tmp.upgrades[layer][data].effectDisplay) : format(tmp.upgrades[layer][data].effect)"></span></span>
|
<span v-if="tmp[layer].upgrades[data].effect"><br>Currently: <span v-html="(tmp[layer].upgrades[data].effectDisplay) ? (tmp[layer].upgrades[data].effectDisplay) : format(tmp[layer].upgrades[data].effect)"></span></span>
|
||||||
<br><br>Cost: {{ formatWhole(tmp.upgrades[layer][data].cost) }} {{(layers[layer].upgrades[data].currencyDisplayName ? layers[layer].upgrades[data].currencyDisplayName : layers[layer].resource)}}
|
<br><br>Cost: {{ formatWhole(tmp[layer].upgrades[data].cost) }} {{(layers[layer].upgrades[data].currencyDisplayName ? tmp[layer].upgrades[data].currencyDisplayName : tmp[layer].resource)}}
|
||||||
</button>
|
</button>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
@ -147,8 +147,8 @@ function loadVue() {
|
||||||
template: `
|
template: `
|
||||||
<div v-if="layers[layer].milestones">
|
<div v-if="layers[layer].milestones">
|
||||||
<table>
|
<table>
|
||||||
<tr v-for="id in Object.keys(layers[layer].milestones)">
|
<tr v-for="id in Object.keys(tmp[layer].milestones)">
|
||||||
<milestone :layer = "layer" :data = "id" v-bind:style="tmp.componentStyles[layer].milestone"></milestone>
|
<milestone :layer = "layer" :data = "id" v-bind:style="tmp[layer].componentStyles.milestone"></milestone>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<br>
|
<br>
|
||||||
|
@ -160,17 +160,17 @@ function loadVue() {
|
||||||
Vue.component('milestone', {
|
Vue.component('milestone', {
|
||||||
props: ['layer', 'data'],
|
props: ['layer', 'data'],
|
||||||
template: `
|
template: `
|
||||||
<td v-if="layers[layer].milestones && milestoneShown(layer, data)" v-bind:style="[(layers[layer].milestones[data].unl && !tmp.milestones[layer][data].unl) ? {'visibility': 'hidden'} : {}, tmp.milestones[layer][data].style]" v-bind:class="{milestone: !player[layer].milestones.includes(data), milestoneDone: player[layer].milestones.includes(data)}">
|
<td v-if="layers[layer].milestones && milestoneShown(layer, data)" v-bind:style="[(tmp[layer].milestones[data].unl && !tmp[layer].milestones[data].unl) ? {'visibility': 'hidden'} : {}, tmp[layer].milestones[data].style]" v-bind:class="{milestone: !player[layer].milestones.includes(data), milestoneDone: player[layer].milestones.includes(data)}">
|
||||||
<h3 v-html="tmp.milestones[layer][data].requirementDesc"></h3><br>
|
<h3 v-html="tmp[layer].milestones[data].requirementDesc"></h3><br>
|
||||||
<span v-html="tmp.milestones[layer][data].effectDesc"></span><br>
|
<span v-html="tmp[layer].milestones[data].effectDesc"></span><br>
|
||||||
<span v-if="(layers[layer].milestones[data].toggles)&&(player[layer].milestones.includes(data))" v-for="toggle in layers[layer].milestones[data].toggles"><toggle :layer= "layer" :data= "toggle" v-bind:style="tmp.componentStyles[layer].toggle"></toggle> </span></td></tr>
|
<span v-if="(tmp[layer].milestones[data].toggles)&&(player[layer].milestones.includes(data))" v-for="toggle in tmp[layer].milestones[data].toggles"><toggle :layer= "layer" :data= "toggle" v-bind:style="tmp[layer].componentStyles.toggle"></toggle> </span></td></tr>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|
||||||
Vue.component('toggle', {
|
Vue.component('toggle', {
|
||||||
props: ['layer', 'data'],
|
props: ['layer', 'data'],
|
||||||
template: `
|
template: `
|
||||||
<button class="smallUpg can" v-bind:style="{'background-color': tmp.layerColor[data[0]]}" v-on:click="toggleAuto(data)">{{player[data[0]][data[1]]?"ON":"OFF"}}</button>
|
<button class="smallUpg can" v-bind:style="{'background-color': tmp[data[0]].color}" v-on:click="toggleAuto(data)">{{player[data[0]][data[1]]?"ON":"OFF"}}</button>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -178,14 +178,10 @@ function loadVue() {
|
||||||
Vue.component('prestige-button', {
|
Vue.component('prestige-button', {
|
||||||
props: ['layer', 'data'],
|
props: ['layer', 'data'],
|
||||||
template: `
|
template: `
|
||||||
<span>
|
<button v-bind:class="{ [layer]: true, reset: true, locked: !tmp[layer].canReset, can: tmp[layer].canReset}"
|
||||||
<button v-if="layers[layer].type=='normal'" v-bind:class="{ [layer]: true, reset: true, locked: tmp.layerAmt[layer].lt(tmp.layerReqs[layer]), can: tmp.layerAmt[layer].gte(tmp.layerReqs[layer]) }"
|
v-bind:style="[tmp[layer].canReset ? {'background-color': tmp[layer].color} : {}, tmp[layer].componentStyles['prestige-button']]"
|
||||||
v-bind:style="[tmp.layerAmt[layer].gte(tmp.layerReqs[layer]) ? {'background-color': tmp.layerColor[layer]} : {}, tmp.componentStyles[layer]['prestige-button']]" v-on:click="doReset(layer)"><span v-if="player[layer].points.lt(1e3)">{{data ? data() : "Reset for "}}</span>+<b>{{formatWhole(tmp.resetGain[layer])}}</b> {{layers[layer].resource}}<span v-if="tmp.resetGain[layer].lt(100) && player[layer].points.lt(1e3)"><br><br>Next at {{ (layers[layer].resCeil ? formatWhole(tmp.nextAt[layer]) : format(tmp.nextAt[layer])) }} {{ layers[layer].baseResource }}</span></button>
|
v-html="tmp[layer].prestigeButtonText" v-on:click="doReset(layer)">
|
||||||
<button v-if="layers[layer].type=='static'" v-bind:class="{ [layer]: true, reset: true, locked: tmp.layerAmt[layer].lt(tmp.nextAt[layer]), can: tmp.layerAmt[layer].gte(tmp.nextAt[layer]) }"
|
</button>
|
||||||
v-bind:style="[tmp.layerAmt[layer].gte(tmp.nextAt[layer]) ? {'background-color': tmp.layerColor[layer]} : {}, tmp.componentStyles[layer]['prestige-button']]" v-on:click="doReset(layer)"><span v-if="player[layer].points.lt(10)">{{data ? data() : "Reset for "}}</span>+<b>{{formatWhole(tmp.resetGain[layer])}}</b> {{layers[layer].resource}}<br><br><span v-if="player[layer].points.lt(10)">{{(tmp.layerAmt[layer].gte(tmp.nextAt[layer])&&layers[layer].canBuyMax && layers[layer].canBuyMax())?"Next":"Req"}}: {{formatWhole(tmp.layerAmt[layer])}} / </span>{{(layers[layer].resCeil ? formatWhole(tmp.nextAtDisp[layer]) : format(tmp.nextAtDisp[layer]))}} {{ layers[layer].baseResource }}</button>
|
|
||||||
<button v-if="layers[layer].type=='custom'" v-bind:class="{ [layer]: true, reset: true, locked: !tmp.canReset[layer], can: tmp.canReset[layer] }"
|
|
||||||
v-bind:style="[tmp.canReset[layer] ? {'background-color': tmp.layerColor[layer]} : {}, tmp.componentStyles[layer]['prestige-button']]" v-on:click="doReset(layer)" v-html="tmp.prestigeButtonText[layer]"></button>
|
|
||||||
</span>
|
|
||||||
`
|
`
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -194,7 +190,7 @@ function loadVue() {
|
||||||
Vue.component('main-display', {
|
Vue.component('main-display', {
|
||||||
props: ['layer'],
|
props: ['layer'],
|
||||||
template: `
|
template: `
|
||||||
<div><span v-if="player[layer].points.lt('1e1000')">You have </span><h2 v-bind:style="{'color': tmp.layerColor[layer], 'text-shadow': '0px 0px 10px' + tmp.layerColor[layer]}">{{formatWhole(player[layer].points)}}</h2> {{layers[layer].resource}}<span v-if="layers[layer].effectDescription">, {{tmp.effectDescription[layer]}}</span><br><br></span>
|
<div><span v-if="player[layer].points.lt('1e1000')">You have </span><h2 v-bind:style="{'color': tmp[layer].color, 'text-shadow': '0px 0px 10px' + tmp[layer].color}">{{formatWhole(player[layer].points)}}</h2> {{tmp[layer].resource}}<span v-if="tmp[layer].effectDescription">, {{tmp[layer].effectDescription}}</span><br><br></span>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -203,10 +199,10 @@ function loadVue() {
|
||||||
props: ['layer', 'data'],
|
props: ['layer', 'data'],
|
||||||
template: `
|
template: `
|
||||||
<div v-if="layers[layer].buyables" class="upgTable">
|
<div v-if="layers[layer].buyables" class="upgTable">
|
||||||
<button v-if="layers[layer].buyables.respec" v-on:click="respecBuyables(layer)" v-bind:class="{ longUpg: true, can: player[layer].unl, locked: !player[layer].unl }">{{layers[layer].buyables.respecText ? tmp.buyables[layer].respecText : "Respec"}}</button><br>
|
<button v-if="tmp[layer].buyables.respec" v-on:click="respecBuyables(layer)" v-bind:class="{ longUpg: true, can: player[layer].unl, locked: !player[layer].unl }">{{tmp[layer].buyables.respecText ? tmp[layer].buyables.respecText : "Respec"}}</button><br>
|
||||||
<div v-for="row in layers[layer].buyables.rows" class="upgRow">
|
<div v-for="row in tmp[layer].buyables.rows" class="upgRow">
|
||||||
<div v-for="col in layers[layer].buyables.cols" class="upgAlign" v-bind:style="{'margin-left': '7px', 'margin-right': '7px', 'height': (data ? data : '200px'),}">
|
<div v-for="col in tmp[layer].buyables.cols" class="upgAlign" v-bind:style="{'margin-left': '7px', 'margin-right': '7px', 'height': (data ? data : '200px'),}">
|
||||||
<buyable :layer = "layer" :data = "row*10+col" :size = "data" v-bind:style="tmp.componentStyles[layer].buyable"></buyable>
|
<buyable :layer = "layer" :data = "row*10+col" :size = "data" v-bind:style="tmp[layer].componentStyles.buyable"></buyable>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
</div>
|
</div>
|
||||||
|
@ -219,12 +215,12 @@ function loadVue() {
|
||||||
props: ['layer', 'data', 'size'],
|
props: ['layer', 'data', 'size'],
|
||||||
template: `
|
template: `
|
||||||
<button
|
<button
|
||||||
v-if="layers[layer].buyables && tmp.buyables[layer][data].unl"
|
v-if="layers[layer].buyables && tmp[layer].buyables[data].unl"
|
||||||
v-bind:class="{ buyable: true, can: tmp.buyables[layer][data].canAfford, locked: !tmp.buyables[layer][data].canAfford}"
|
v-bind:class="{ buyable: true, can: tmp[layer].buyables[data].canAfford, locked: !tmp[layer].buyables[data].canAfford}"
|
||||||
v-bind:style="[tmp.buyables[layer][data].canAfford ? {'background-color': tmp.layerColor[layer]} : {}, {'height': (size ? size : 'inherit'), 'width': (size ? size : '200px')}, tmp.buyables[layer][data].style]"
|
v-bind:style="[tmp[layer].buyables[data].canAfford ? {'background-color': tmp[layer].color} : {}, {'height': (size ? size : 'inherit'), 'width': (size ? size : '200px')}, tmp[layer].buyables[data].style]"
|
||||||
v-on:click="buyBuyable(layer, data)">
|
v-on:click="buyBuyable(layer, data)">
|
||||||
<span v-if= "layers[layer].buyables[data].title"><h2 v-html="tmp.buyables[layer][data].title"></h2><br></span>
|
<span v-if= "tmp[layer].buyables[data].title"><h2 v-html="tmp[layer].buyables[data].title"></h2><br></span>
|
||||||
<span v-bind:style="{'white-space': 'pre-line'}" v-html="tmp.buyables[layer][data].display"></span>
|
<span v-bind:style="{'white-space': 'pre-line'}" v-html="tmp[layer].buyables[data].display"></span>
|
||||||
</button>
|
</button>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
@ -238,9 +234,9 @@ function loadVue() {
|
||||||
template: `
|
template: `
|
||||||
<div v-if="layers[layer].microtabs" :style="{'border-style': 'solid'}">
|
<div v-if="layers[layer].microtabs" :style="{'border-style': 'solid'}">
|
||||||
<div class="upgTable">
|
<div class="upgTable">
|
||||||
<tab-buttons :layer="layer" :data="layers[layer].microtabs[data]" :name="data" v-bind:style="tmp.componentStyles[layer]['tab-buttons']"></tab-buttons>
|
<tab-buttons :layer="layer" :data="tmp[layer].microtabs[data]" :name="data" v-bind:style="tmp[layer].componentStyles['tab-buttons']"></tab-buttons>
|
||||||
</div>
|
</div>
|
||||||
<column v-bind:style="tmp.microtabs[layer][data][player.subtabs[layer][data]].style" :layer="layer" :data="layers[layer].microtabs[data][player.subtabs[layer][data]].content"></column>
|
<column v-bind:style="tmp[layer].microtabs[data][player.subtabs[layer][data]].style" :layer="layer" :data="tmp[layer].microtabs[data][player.subtabs[layer][data]].content"></column>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
@ -249,7 +245,7 @@ function loadVue() {
|
||||||
Vue.component('gague', {
|
Vue.component('gague', {
|
||||||
props: ['layer', 'data'],
|
props: ['layer', 'data'],
|
||||||
template: `
|
template: `
|
||||||
<div v-if="layers[layer].gagues && tmp.gagues[layer][data].unl"
|
<div v-if="tmp[layer].gagues && tmp[layer].gagues[data].unl"
|
||||||
v-bind:style="{'border-style': 'solid}"
|
v-bind:style="{'border-style': 'solid}"
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -264,7 +260,7 @@ function loadVue() {
|
||||||
template: `
|
template: `
|
||||||
<div class="upgRow">
|
<div class="upgRow">
|
||||||
<div v-for="tab in Object.keys(data)">
|
<div v-for="tab in Object.keys(data)">
|
||||||
<button v-if="!data[tab].unl || data[tab].unl()" class="tabButton" v-bind:style="[{'border-color': tmp.layerColor[layer]}, tmp.componentStyles[layer]['tab-button'], tmp.microtabs[layer][name][tab].buttonStyle]" v-on:click="player.subtabs[layer][name] = tab">{{tab}}</button>
|
<button v-if="data[tab].unl == undefined || data[tab].unl" class="tabButton" v-bind:style="[{'border-color': tmp[layer].color}, tmp[layer].componentStyles['tab-button'], data[tab].buttonStyle]" v-on:click="player.subtabs[layer][name] = tab">{{tab}}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
@ -279,20 +275,20 @@ function loadVue() {
|
||||||
showTab(layer)
|
showTab(layer)
|
||||||
}"
|
}"
|
||||||
v-bind:tooltip="
|
v-bind:tooltip="
|
||||||
player[layer].unl ? (layers[layer].tooltip ? tmp.tooltips[layer] : formatWhole(player[layer].points) + ' ' + layers[layer].resource)
|
player[layer].unl ? (tmp[layer].tooltip ? tmp[layer].tooltip : formatWhole(player[layer].points) + ' ' + tmp[layer].resource)
|
||||||
: (layers[layer].tooltipLocked ? tmp.tooltipsLocked[layer] : 'Reach ' + formatWhole(tmp.layerReqs[layer]) + ' ' + layers[layer].baseResource + ' to unlock (You have ' + formatWhole(tmp.layerAmt[layer]) + ' ' + layers[layer].baseResource + ')')
|
: (tmp[layer].tooltipLocked ? tmp[layer].tooltipLocked : 'Reach ' + formatWhole(tmp[layer].requires) + ' ' + tmp[layer].baseResource + ' to unlock (You have ' + formatWhole(tmp[layer].baseAmount) + ' ' + tmp[layer].baseResource + ')')
|
||||||
"
|
"
|
||||||
v-bind:class="{
|
v-bind:class="{
|
||||||
treeNode: true,
|
treeNode: true,
|
||||||
[layer]: true,
|
[layer]: true,
|
||||||
hidden: !tmp.layerShown[layer],
|
hidden: !tmp[layer].layerShown,
|
||||||
locked: !player[layer].unl && !tmp.layerAmt[layer].gte(tmp.layerReqs[layer]),
|
locked: !player[layer].unl && !tmp[layer].baseAmount.gte(tmp[layer].requires),
|
||||||
notify: tmp.notify[layer],
|
notify: tmp[layer].notify,
|
||||||
can: layerUnl(layer),
|
can: layerUnl(layer),
|
||||||
}"
|
}"
|
||||||
v-bind:style="[layerUnl(layer) ? {
|
v-bind:style="[layerUnl(layer) ? {
|
||||||
'background-color': tmp.layerColor[layer],
|
'background-color': tmp[layer].color,
|
||||||
} : {}, tmp.nodeStyle[layer]]">
|
} : {}, tmp[layer].nodeStyle]">
|
||||||
{{abb}}
|
{{abb}}
|
||||||
</button>
|
</button>
|
||||||
`
|
`
|
||||||
|
|
Loading…
Reference in a new issue