AI: 0.01% chance to use kamikaze with "wishes" ;-)
authorWuzzy <Wuzzy2@mail.ru>
Mon, 06 Jul 2020 13:51:41 +0200
changeset 15710 31ca6451056a
parent 15709 326b024a24e3
child 15711 975232e840c7
AI: 0.01% chance to use kamikaze with "wishes" ;-)
hedgewars/uAI.pas
--- a/hedgewars/uAI.pas	Mon Jul 06 12:46:22 2020 +0200
+++ b/hedgewars/uAI.pas	Mon Jul 06 13:51:41 2020 +0200
@@ -241,6 +241,14 @@
                             if (a = amResurrector) and (BotLevel < 4) then
                                 AddAction(BestActions, aia_Up, aim_release, ap.Power, 0, 0);
                             AddAction(BestActions, aia_attack, aim_release, ap.Power, 0, 0);
+
+                            // Just for fun: 0.01% chance for kamikaze with "wishes" ;-)
+                            if (a = amKamikaze) and (random(10000) = 0) then
+                                begin
+                                AddAction(BestActions, aia_Switch, 0, 1, 0, 0);
+                                AddAction(BestActions, aia_Precise, aim_push, 1, 0, 0);
+                                AddAction(BestActions, aia_Precise, aim_release, 5000, 0, 0);
+                                end;
                             end;
 
                     if (Ammoz[a].Ammo.Propz and ammoprop_Track) <> 0 then