# HG changeset patch # User Wuzzy # Date 1594026627 -7200 # Node ID 034955e721a1deb132cc4d2b782a21d563bb8d7e # Parent 78e383fff6050033c6df5e5d6345291e693fbbfa AI: Teach how to use resurrector fast diff -r 78e383fff605 -r 034955e721a1 hedgewars/uAI.pas --- a/hedgewars/uAI.pas Mon Jul 06 01:46:22 2020 +0200 +++ b/hedgewars/uAI.pas Mon Jul 06 11:10:27 2020 +0200 @@ -231,11 +231,15 @@ n:= 1 else n:= ap.AttacksNum; AddAction(BestActions, aia_attack, aim_push, 650 + random(300), 0, 0); + if (a = amResurrector) and (BotLevel < 4) then + AddAction(BestActions, aia_Up, aim_push, 1, 0, 0); for t:= 2 to n do begin AddAction(BestActions, aia_attack, aim_push, 150, 0, 0); AddAction(BestActions, aia_attack, aim_release, ap.Power, 0, 0); end; + 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); end; diff -r 78e383fff605 -r 034955e721a1 hedgewars/uAIAmmoTests.pas --- a/hedgewars/uAIAmmoTests.pas Mon Jul 06 01:46:22 2020 +0200 +++ b/hedgewars/uAIAmmoTests.pas Mon Jul 06 11:10:27 2020 +0200 @@ -1509,11 +1509,16 @@ ap.ExplR:= 0; ap.Time:= 0; -if (GameFlags and gfInfAttack) = 0 then - ap.Power:= max(min(500 * heal - 500, 10000), 10) +if (Level >= 4) then + // slow resurrect + ap.Power:= max(512 * heal - 512, 10) else - // Shorter attack duration in inf attack because the clock is ticking! - ap.Power:= max(min(500 * heal - 500, 3000), 10); + // fast resurrect + ap.Power:= max(16 * heal - 16, 10); + +// Time limit +ap.Power:= min(ap.Power, 5000) + ap.Angle:= 0; rate:= RateResurrector(Me);