mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2025-05-11 20:41:10 +00:00
Many minor additions
Effect-getter functions, components for individual Big Feature things, points/sec display
This commit is contained in:
parent
942e5a2a4b
commit
4ae1cad2eb
10 changed files with 108 additions and 37 deletions
js
22
js/game.js
22
js/game.js
|
@ -6,15 +6,21 @@ var gameEnded = false;
|
|||
|
||||
let VERSION = {
|
||||
num: "1.3",
|
||||
name: "Finally some real progress!"
|
||||
name: "Tabbing Out"
|
||||
}
|
||||
|
||||
// Calculate points/sec!
|
||||
function getPointGen() {
|
||||
let gain = new Decimal(1)
|
||||
if (hasUpg("c", 12)) gain = gain.times(layers.c.upgrades[12].effect())
|
||||
if (hasUpg("c", 12)) gain = gain.times(upgEffect("c", 12))
|
||||
return gain
|
||||
}
|
||||
|
||||
// Determines if it should show points/sec
|
||||
function showPointGen(){
|
||||
return (true)
|
||||
}
|
||||
|
||||
// Function to determine if the player is in a challenge
|
||||
function inChallenge(layer, id){
|
||||
let chall = player[layer].active
|
||||
|
@ -206,6 +212,18 @@ function hasChall(layer, id){
|
|||
return (player[layer].challs.includes(toNumber(id)))
|
||||
}
|
||||
|
||||
function upgEffect(layer, id){
|
||||
return (tmp.upgrades[layer][id].effect)
|
||||
}
|
||||
|
||||
function challEffect(layer, id){
|
||||
return (tmp.challs[layer][id].effect)
|
||||
}
|
||||
|
||||
function buyableEffect(layer, id){
|
||||
return (tmp.buyables[layer][id].effect)
|
||||
}
|
||||
|
||||
function canAffordPurchase(layer, thing, cost) {
|
||||
if (thing.currencyInternalName){
|
||||
let name = thing.currencyInternalName
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue