# HG changeset patch # User nemo # Date 1331519755 14400 # Node ID 13d13aefa4de08a4fcf404a679549f9d5f39fb69 # Parent 87a947097d000de29ecf6092d0316d3a1a4e820a small tweak. make drowning prefer higher health hogs diff -r 87a947097d00 -r 13d13aefa4de hedgewars/uAIAmmoTests.pas --- a/hedgewars/uAIAmmoTests.pas Sun Mar 11 20:36:50 2012 -0400 +++ b/hedgewars/uAIAmmoTests.pas Sun Mar 11 22:35:55 2012 -0400 @@ -174,7 +174,8 @@ valueResult:= value end; end -until (value > 204800) or (rTime > 4250); +//until (value > 204800) or (rTime > 4250); not so useful since adding score to the drowning +until rTime > 4250; TestBazooka:= valueResult end; @@ -328,7 +329,8 @@ valueResult:= Score end; end -until (Score > 204800) or (TestTime > 4000); +//until (Score > 204800) or (TestTime > 4000); +until TestTime > 4000; TestGrenade:= valueResult end; diff -r 87a947097d00 -r 13d13aefa4de hedgewars/uAIMisc.pas --- a/hedgewars/uAIMisc.pas Sun Mar 11 20:36:50 2012 -0400 +++ b/hedgewars/uAIMisc.pas Sun Mar 11 22:35:55 2012 -0400 @@ -319,9 +319,9 @@ end; if (Flags and 1 <> 0) and TraceDrown(x, y, Point.x, Point.y, dX, dY, erasure) then if Score > 0 then - inc(rate, KillScore) + inc(rate, KillScore + Score) // Add a bit of a bonus for bigger hog drownings else - dec(rate, KillScore * friendlyfactor div 100) + dec(rate, KillScore * friendlyfactor div 100 - Score) // and more of a punishment for drowning bigger friendly hogs else if dmg >= abs(Score) then if Score > 0 then inc(rate, KillScore) @@ -361,9 +361,9 @@ end; if (Flags and 1 <> 0) and TraceShoveDrown(Me, Point.x, Point.y, dX, dY) then if Score > 0 then - inc(rate, KillScore) + inc(rate, KillScore + Score) // Add a bit of a bonus for bigger hog drownings else - dec(rate, KillScore * friendlyfactor div 100) + dec(rate, KillScore * friendlyfactor div 100 - Score) // and more of a punishment for drowning bigger friendly hogs else if power >= abs(Score) then if Score > 0 then inc(rate, KillScore) @@ -412,9 +412,9 @@ else dX:= dX + 0.01; if TraceDrown(x, y, Point.x, Point.y, dX, dY, erasure) then if Score > 0 then - inc(rate, KillScore) + inc(rate, KillScore + Score) // Add a bit of a bonus for bigger hog drownings else - dec(rate, KillScore * friendlyfactor div 100) + dec(rate, KillScore * friendlyfactor div 100 - Score) // and more of a punishment for drowning bigger friendly hogs else if dmg >= abs(Score) then dmg := KillScore; if Score > 0 then