From 4f01c1e3dfd23e0bc62abbabbcf517de541c2123 Mon Sep 17 00:00:00 2001 From: deuce <> Date: Mon, 22 Sep 2008 22:02:13 +0000 Subject: [PATCH] Make Deep Blue fall back to paranoid unless he has his fair share of territories. --- xtrn/dicewarz/ai.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xtrn/dicewarz/ai.js b/xtrn/dicewarz/ai.js index 01a201ce35..25059abd9b 100644 --- a/xtrn/dicewarz/ai.js +++ b/xtrn/dicewarz/ai.js @@ -143,8 +143,13 @@ function UltraParanoidAICheck(gameNumber, playerNumber, base, target) g=games.gameData[gameNumber]; computerPlayer=g.players[playerNumber]; + /* If we don't have our "fair share" of territories, use paranoid attack */ + if(computerPlayer.territories <= g.playerTerr) { + return(ParanoidAICheck(gameNumber, playerNumber, base, target)); + } + /* If reserves + expected new dice - used reserves is still greater than seven, use the merely paranoid attack */ - if(computerPlayer.reserve + computerPlayer.territories - (computerPlayer.AI.moves*7) > 7) { + if(computerPlayer.reserve + computerPlayer.territories - (computerPlayer.AI.moves*8) > 7) { return(ParanoidAICheck(gameNumber, playerNumber, base, target)); } -- GitLab