From 5191569e3e9b5a69b1516d1ea677efe28ec580a8 Mon Sep 17 00:00:00 2001 From: sora233 Date: Fri, 3 Sep 2021 16:44:52 +0800 Subject: [PATCH] fix point bug --- .gitignore | 4 +++- src/app.js | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d0398e8..263ed35 100644 --- a/.gitignore +++ b/.gitignore @@ -103,4 +103,6 @@ dist # TernJS port file .tern-port -utils/xlsxTransform-* \ No newline at end of file +utils/xlsxTransform-* + +/.idea \ No newline at end of file diff --git a/src/app.js b/src/app.js index 293a252..7ccb099 100644 --- a/src/app.js +++ b/src/app.js @@ -166,7 +166,7 @@ class App{ freshTotal(); } btnAdd.click(()=>{ - if(total() == this.#totalMax) { + if(total() >= this.#totalMax) { this.hint('没用可分配的点数了'); return; } @@ -223,9 +223,12 @@ class App{ propertyPage .find('#start') .click(()=>{ - if(total()!=this.#totalMax) { + if(total() < this.#totalMax) { this.hint(`你还有${this.#totalMax-total()}属性点没有分配完`); return; + } else if (total() > this.#totalMax) { + this.hint(`你多使用了${total() - this.#totalMax}属性点`); + return; } this.#life.restart({ CHR: groups.CHR.get(),