84 if Actions.Score + Score > BestActions.Score then |
84 if Actions.Score + Score > BestActions.Score then |
85 if (BestActions.Score < 0) or (Actions.Score + Score > BestActions.Score + Byte(BotLevel) * 2048) then |
85 if (BestActions.Score < 0) or (Actions.Score + Score > BestActions.Score + Byte(BotLevel) * 2048) then |
86 begin |
86 begin |
87 BestActions:= Actions; |
87 BestActions:= Actions; |
88 inc(BestActions.Score, Score); |
88 inc(BestActions.Score, Score); |
89 addfilelog('AI: curr score ' + inttostr(bestactions.score)); |
|
90 |
89 |
91 if (ap.Angle > 0) then AddAction(BestActions, aia_LookRight, 0, 200, 0, 0) |
90 if (ap.Angle > 0) then AddAction(BestActions, aia_LookRight, 0, 200, 0, 0) |
92 else if (ap.Angle < 0) then AddAction(BestActions, aia_LookLeft, 0, 200, 0, 0); |
91 else if (ap.Angle < 0) then AddAction(BestActions, aia_LookLeft, 0, 200, 0, 0); |
93 |
92 |
94 AddAction(BestActions, aia_Weapon, Longword(a), 300 + random(400), 0, 0); |
93 AddAction(BestActions, aia_Weapon, Longword(a), 300 + random(400), 0, 0); |