fixed triple points calculation

This commit is contained in:
Lurkars
2017-04-15 01:40:42 +02:00
parent 4bd9ba3d65
commit 035303ab10
+6 -2
View File
@@ -258,10 +258,14 @@ Game.prototype.calculatePoints = function(diceIndex) {
} else if (pairs == 3) {
points += 1500;
} else if (triple1) {
points += triple1 * (triple1 == 1 ? 1000 : 100) * (result[triple1 - 1] - 2);
var triple1Points = triple1 * (triple1 == 1 ? 1000 : 100);
for (var i = 0; i < result[triple1 - 1] - 3; i++) {
triple1Points *= 2;
}
points += triple1Points;
if (triple2) {
points += triple2 * (triple2 == 1 ? 1000 : 100) * (result[triple2 - 1] - 2);
points += triple2 * (triple2 == 1 ? 1000 : 100);
}
}