From 1765c806ecf3e8462d15a3198568501ffa0722ad Mon Sep 17 00:00:00 2001 From: Thayol Date: Wed, 23 Jun 2021 21:13:23 +0200 Subject: [PATCH] Added fixed options --- script.js | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index 13a2f22..f9245e0 100644 --- a/script.js +++ b/script.js @@ -3,8 +3,15 @@ var colors = [ "red", "blue", "yellow" ]; // the available numbers var handSize = (colors.length * 2) - 1; // the maximum hand size var seriesLength = colors.length; // the minimum required length of series var pointsMultiplier = 10; // useless "big number feel" multiplier + var sameNumberExtra = 1; // extra points given for sets of same numbers +var sameNumberFixed = false; // if this is true, "sameNumberExtra" will be constant instead of additive + +var seriesExtra = 0; // extra points given for series +var seriesFixed = false; // if this is true, "seriesExtra" will be constant instead of additive + var sameColorExtra = 4; // extra points given for sets of the same color if they are in a series +var sameColorFixed = false; // if this is true, "sameColorExtra" will be constant instead of additive var autoDraw = false; // whether the script should automatically draw on start and on discard var autoRecommend = true; // whether the script should automatically recommend on change @@ -23,6 +30,9 @@ var handElement = document.getElementById('hand'); var recommendElement = document.getElementById('result'); var pointsElement = document.getElementById('points'); +sameColorFixed = true; // for some reason the live game does not work like the wiki says +sameColorExtra = 10; // it gives 100 for 1-2-3* too + reset(); function toggleAutoDraw(element) { @@ -255,6 +265,10 @@ function getPatterns(thisHand = null) { // "i" is lagging behind, adjustment needed let points = (i + 1 + sameNumberExtra) + if (sameNumberFixed) { + points = sameNumberExtra; + } + patterns[patternName] = {}; patterns[patternName].pattern = patternName; patterns[patternName].points = points; @@ -288,10 +302,19 @@ function getPatterns(thisHand = null) { } // "i" is lagging behind, adjustment needed - let points = (i + 1); + let points = (i + 1 + seriesExtra); + if (seriesFixed) { + points = seriesExtra; + } if (sameColor) { - points = ((i + 1) + sameColorExtra); + if (sameColorFixed) { + points = sameColorExtra; + } + else { + points = ((i + 1) + sameColorExtra); + } + patternName += "*"; }