hedgewars/uAI.pas
changeset 7204 522f165cd2e7
parent 7197 5a9775b97c7e
child 7216 53f5e48b8375
--- a/hedgewars/uAI.pas	Sat Jun 09 12:15:05 2012 +0200
+++ b/hedgewars/uAI.pas	Sat Jun 09 17:05:16 2012 +0400
@@ -178,6 +178,10 @@
                         begin
                         AddAction(BestActions, aia_attack, aim_push, 350 + random(200), 0, 0);
                         AddAction(BestActions, aia_attack, aim_release, 1, 0, 0);
+                                                
+                        AddAction(BestActions, aia_Down, aim_push, 100 + random(150), 0, 0);
+                        AddAction(BestActions, aia_Down, aim_release, 32, 0, 0);
+                        
                         AddAction(BestActions, aia_waitAngle, ap.Angle, 250, 0, 0);
                         AddAction(BestActions, aia_attack, aim_push, 1, 0, 0);
                         AddAction(BestActions, aia_attack, aim_release, 1, 0, 0);
@@ -431,6 +435,8 @@
 AddFileLog('Thread started');
 end;
 
+var scoreShown: boolean = false;
+
 procedure ProcessBot;
 const cStopThinkTime = 40;
 begin
@@ -447,13 +453,23 @@
                     StopMessages(Gear^.Message);
                     TryDo((Gear^.Message and gmAllStoppable) = 0, 'Engine bug: AI may break demos playing', true);
                     end;
+                    
                 if Gear^.Message <> 0 then
                     exit;
+                    
+                scoreShown:= false;   
                 StartThink(Gear);
                 StartTicks:= GameTicks
                 
-                end else
-                    ProcessAction(BestActions, Gear)
+            end else
+                begin
+                if not scoreShown then
+                    begin
+                    if BestActions.Score > 0 then ParseCommand('/say Expected score = ' + inttostr(BestActions.Score div 1024), true);
+                    scoreShown:= true
+                    end;
+                ProcessAction(BestActions, Gear)
+                end
         else if ((GameTicks - StartTicks) > cMaxAIThinkTime)
             or (TurnTimeLeft <= cStopThinkTime) then
                 StopThinking:= true