X-Git-Url: https://troll.desast.re/troll.git/blobdiff_plain/21357ae2173926ec1eb908517ab7b1b3e9175ee5..505d4ac3e3dc4a8f143faed4e6d61f7b9c8e2c33:/src/main/java/com/codingame/game/Referee.java?ds=sidebyside diff --git a/src/main/java/com/codingame/game/Referee.java b/src/main/java/com/codingame/game/Referee.java index 19ef894..fb99ef9 100644 --- a/src/main/java/com/codingame/game/Referee.java +++ b/src/main/java/com/codingame/game/Referee.java @@ -105,6 +105,7 @@ public class Referee extends AbstractReferee { } player.view.displayMessage(player.messageString); } + if (disqual) return; /* Update game model and view, stones' part. * @@ -123,9 +124,19 @@ public class Referee extends AbstractReferee { delta += player.model.getMultiplier() * player.stoneThrow; if (player.stoneThrow < 0) { - disqualify(player, "CHEAT", "cheated. Banning account."); - player.view.markCheat(); - disqual = true; + switch(league.cheatLevel) { + case ALLOWED: + break; + case TOLERATED: + player.view.markCheat(); + if (model.random.nextInt(2) == 0) player.model.loseRound(); + break; + case FORBIDDEN: + disqualify(player, "CHEAT", "cheated. Banning account."); + player.view.markCheat(); + disqual = true; + break; + } } if (player.stoneThrow != 0) { player.view.animateStones(player.stoneThrow);