- try {
- final int stones = player.getAction();
- player.consumeStones(stones);
- gameManager.addToGameSummary(String.format("%s throws %d stone%s at the troll.", player.getNicknameToken(), stones, stones == 1 ? "" : "s"));
- delta += player.getMultiplier() * stones;
-
- if (stones > 0) {
- player.stone.setX(player.castle.getX());
- player.stone.setY(player.castle.getY() - 100);
- player.stone.setText(new Integer(stones).toString());
- player.stone.setAlpha(1);
- graphicEntityModule.commitEntityState(0, player.stone);
-
- int peakX = (player.castle.getX() + troll.getX()) / 2;
- int peakY = 540;
- player.stone.setX(peakX);
- player.stone.setY(peakY, Curve.EASE_OUT);
- graphicEntityModule.commitEntityState(0.25, player.stone,
- player.stoneCounter);
-
- player.stone.setX(troll.getX());
- player.stone.setY(troll.getY() - 50, Curve.EASE_IN);
- player.stone.setAlpha(0, Curve.EASE_IN);
- graphicEntityModule.commitEntityState(0.5, player.stone);
+ player.receiveGameTurn(); gm.transcend(player);
+ switch (player.type) {
+ case Timeout:
+ disqualify(player, "T/O", "timed out!");
+ player.view.markTimeout();
+ disqual = true;
+ break;
+ case Invalid:
+ disqualify(player, "INVALID", "provided an ill-formed action");
+ player.view.markIllegal();
+ disqual = true;
+ break;
+ case Throw:
+ try { player.model.consumeStones(player.stoneThrow); }
+ catch (Model.Player.ThrewMoreStonesThanHad e) {
+ if (model.random.nextInt(10) > 0) {
+ player.view.threwMoreStonesThanHad();
+ player.stoneThrow = player.model.consumeMaxStones();
+ }
+ else {
+ disqualify(player, "ILLEGAL", "tried to throw more stones than they had. They went into debt trying to provide. The economy tanked, recession and famine ensued; even the troll wouldn't have wanted to bash them anymore. But that's no victory.");
+ player.view.markIllegal();
+ disqual = true;
+ }