From b532d8b2aae7c2a953c32946db27c8d43499af04 Mon Sep 17 00:00:00 2001 From: adrien Date: Thu, 15 Jun 2023 09:00:08 +0200 Subject: [PATCH] b2b & combo properties --- app.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index ffc99f9..9ae8aad 100644 --- a/app.js +++ b/app.js @@ -616,6 +616,24 @@ class Stats { return this._level } + set combo(combo) { + this._combo = combo + if (combo > this.maxCombo) this.maxCombo = combo + } + + get combo() { + return this._combo + } + + set b2b(b2b) { + this._b2b = b2b + if (b2b > this.maxB2B) this.maxB2B = b2b + } + + get b2b() { + return this._b2b + } + set time(time) { this.startTime = new Date() - time } @@ -652,7 +670,6 @@ class Stats { // Combo if (nbClearedLines) { this.combo++ - if (this.combo > this.maxCombo) this.maxCombo = this.combo if (this.combo >= 1) { let comboScore = (nbClearedLines == 1 ? 20 : 50) * this.combo * this.level if (this.combo == 1) { @@ -677,7 +694,6 @@ class Stats { // Back to back sequence if ((nbClearedLines == 4) || (tSpin && nbClearedLines)) { this.b2b++ - if (this.b2b > this.maxB2B) this.maxB2B = this.b2b if (this.b2b >= 1) { let b2bScore = patternScore / 2 if (this.b2b == 1) {