From 50e7ac23d26d5ea50acc0db4c5a52b235f41a62b Mon Sep 17 00:00:00 2001 From: Harley White Date: Thu, 10 Jun 2021 00:32:07 -0400 Subject: [PATCH] doReset on non-numeric rows --- changelog.md | 1 + docs/other.md | 5 ++++- js/game.js | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index eb60799..2014990 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ - Added buyable and clickable trees. - Fixed the passiveGeneration display. - Fixed "marked" feature. +- doReset now will function on non-numeric rows besides "side". ## v2.6.1 - 6/7/21 - Added global background style to mod.js. diff --git a/docs/other.md b/docs/other.md index 77fbf1e..34fb791 100644 --- a/docs/other.md +++ b/docs/other.md @@ -2,4 +2,7 @@ ## CSS A good way to give your game a unique feel is to customize the appearance of it. Modifying the CSS files helps you to do that on a global level. The CSS is broken up into several files to make it easier to find what is relevant to you. -CSS tip: Every component is automatically given a CSS class with the same name as its layer id. You can use this toapply something specifically for a single layer! You can also combine classes, such as .p.achievement or .c.locked, to change specific things in specific layers. \ No newline at end of file +CSS tip: Every component is automatically given a CSS class with the same name as its layer id. You can use this toapply something specifically for a single layer! You can also combine classes, such as .p.achievement or .c.locked, to change specific things in specific layers. + +## Temp +temp/tmp (either works) is a data structure that is a copy of layers (which contains all of the layer data you defined plus default things), but it replaces most functions with the result of calling those functions. e.g. if layer p's baseAmount is based on points, layers.p.baseAmount is a function that returns player.points. The player currently has 54 points, so temp.p.baseAmount is 54 (as a Decimal). You can use temp to improve performance. \ No newline at end of file diff --git a/js/game.js b/js/game.js index 73bcc12..774326e 100644 --- a/js/game.js +++ b/js/game.js @@ -228,7 +228,9 @@ function doReset(layer, force=false) { player.points = (row == 0 ? decimalZero : getStartPoints()) for (let x = row; x >= 0; x--) rowReset(x, layer) - rowReset("side", layer) + for (r in OTHER_LAYERS){ + rowReset(r, layer) + } prevOnReset = undefined player[layer].resetTime = 0