mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-24 17:31:50 +00:00
Made point generation make sense
This commit is contained in:
parent
18898f519e
commit
e9d0f17d41
5 changed files with 20 additions and 18 deletions
|
@ -1,5 +1,6 @@
|
|||
#The Modding Tree changelog:
|
||||
|
||||
##v2.0
|
||||
Added clickables, a more generalized variant of buyables!
|
||||
Support for multiple completions of challenges.
|
||||
Added getter/setter functions for buyable amount and such
|
||||
|
@ -13,14 +14,18 @@ effectDisplay in Challenges and Upgrades no longer takes an argument, as well as
|
|||
Buyable cost can take an argument for amount of buyables, but if one is not supplied it should do the cost of the next buyable.
|
||||
All displays will update correctly.
|
||||
Changelog is no longer in index.html at all.
|
||||
Generation of Points now happens in the main game loop (not in a layer update function), enabled by canGenPoints in game.js
|
||||
|
||||
|
||||
##v1.3.5
|
||||
|
||||
- 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!
|
||||
- Created a tutorial for getting started with TMT and Github.
|
||||
- Page title is now automatically taken from mod name.
|
||||
|
||||
##v1.3.4: 10/8/20
|
||||
|
||||
- Added "midsection" feature to add things to a tab's layout while still keeping the standard layout.
|
||||
- Fix for being able to buy more buyables than you should.
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
<h2 id="points">{{format(player.points)}}</h2>
|
||||
<span v-if="player.points.lt('1e1e6')"> {{modInfo.pointsName}}</span>
|
||||
<br>
|
||||
<span v-if="showPointGen()">({{format(getPointGen())}}/sec)</span>
|
||||
<span v-if="canGenPoints()">({{format(getPointGen())}}/sec)</span>
|
||||
<br><br><br><br>
|
||||
<span v-for="row in TREE_LAYERS"><table>
|
||||
<td v-if="player.tab=='tree'&& someLayerUnlocked(row) && row != 0" class="left"><br><br><img class="remove" src="remove.png" onclick="resetRow(row)"></img></td>
|
||||
|
|
19
js/game.js
19
js/game.js
|
@ -22,13 +22,13 @@ let VERSION = {
|
|||
}
|
||||
|
||||
// Determines if it should show points/sec
|
||||
function showPointGen(){
|
||||
return (tmp.pointGen.neq(new Decimal(0)))
|
||||
}
|
||||
function canGenPoints(){
|
||||
return hasUpg("c", 11)
|
||||
}
|
||||
|
||||
// Calculate points/sec!
|
||||
function getPointGen() {
|
||||
if(!hasUpg("c", 11))
|
||||
if(!canGenPoints())
|
||||
return new Decimal(0)
|
||||
|
||||
let gain = new Decimal(1)
|
||||
|
@ -38,15 +38,6 @@ function getPointGen() {
|
|||
|
||||
|
||||
|
||||
// Function to determine if the player is in a challenge
|
||||
function inChallenge(layer, id){
|
||||
let chall = player[layer].active
|
||||
if (chall==toNumber(id)) return true
|
||||
|
||||
if (layers[layer].challs[chall].countsAs)
|
||||
return layers[layer].challs[id].countsAs.includes(id)
|
||||
}
|
||||
|
||||
function getResetGain(layer, useType = null) {
|
||||
let type = useType
|
||||
if (!useType) type = layers[layer].type
|
||||
|
@ -304,7 +295,7 @@ function gameLoop(diff) {
|
|||
if (player.devSpeed) diff *= player.devSpeed
|
||||
|
||||
addTime(diff)
|
||||
|
||||
player.points = player.points.add(tmp.pointGen.times(diff)).max(0)
|
||||
for (layer in layers){
|
||||
if (layers[layer].update) layers[layer].update(diff);
|
||||
}
|
||||
|
|
|
@ -178,9 +178,6 @@ addLayer("c", {
|
|||
if(layers[resettingLayer].row > this.row) fullLayerReset(this.layer) // This is actually the default behavior
|
||||
},
|
||||
layerShown() {return true}, // Condition for when layer appears on the tree
|
||||
update(diff) {
|
||||
if (player[this.layer].upgrades.includes(11)) player.points = player.points.add(tmp.pointGen.times(diff)).max(0)
|
||||
}, // Do any gameloop things (e.g. resource generation) inherent to this layer
|
||||
automate() {
|
||||
}, // Do any automation inherent to this layer if appropriate
|
||||
resetsNothing() {return false},
|
||||
|
|
|
@ -477,6 +477,15 @@ function clickClickable(layer, id) {
|
|||
updateClickableTemp(layer)
|
||||
}
|
||||
|
||||
// Function to determine if the player is in a challenge
|
||||
function inChallenge(layer, id){
|
||||
let chall = player[layer].active
|
||||
if (chall==toNumber(id)) return true
|
||||
|
||||
if (layers[layer].challs[chall].countsAs)
|
||||
return layers[layer].challs[id].countsAs.includes(id)
|
||||
}
|
||||
|
||||
// ************ Misc ************
|
||||
|
||||
var onTreeTab = true
|
||||
|
|
Loading…
Reference in a new issue