fix...faut pas faire 2 choses en même temps

This commit is contained in:
jeffcheasey88 2023-10-01 23:27:11 +02:00
parent 4f11822c12
commit 8041ddb470

View file

@ -65,10 +65,13 @@ public class Completion{
public void addTry(Puzzle currentPuzzle, byte[] response, int chapter){
if (score <= 0){
tries++;
if(chapter < 4) return;
if (response != null && Arrays.equals(currentPuzzle.getSoluce(), response)){
if (tries > 1) { // Loose 5% each try with a minimum of 1 for score
score = (int) Math.ceil(currentPuzzle.getScoreMax() * (1 - ((tries - 1) / 20.)));
if(chapter < 4){
score = currentPuzzle.getScoreMax();
}else{
score = (int) Math.ceil(currentPuzzle.getScoreMax() * (1 - ((tries - 1) / 20.)));
}
// score = currentPuzzle.getScoreMax();
if (score < 1)
score = 1;