Make 3 stars possible in ep, stalemate, piece value and protection

pull/2113/head
Niklas Fiekas 2016-07-21 12:23:18 +02:00
parent 105e328f86
commit 481e660617
2 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@
"watchify": "~3.7"
},
"dependencies": {
"chess": "github:ornicar/chess.js#learn",
"chess.js": "github:ornicar/chess.js#learn",
"chessground": "github:ornicar/chessground#v3.8.0",
"mithril": "github:ornicar/mithril.js#v1.0.0"
}

View File

@ -39,7 +39,7 @@ function getStageMaxScore(s) {
function getStageRank(s, score) {
var max = getStageMaxScore(s);
if (typeof score !== 'number') score = score.reduce(function(a, b) { return a + b; }, 0);
if (score === max) return 1;
if (score >= max) return 1;
if (score >= max - Math.max(200, s.levels.length * 150)) return 2;
return 3;
}