# HG changeset patch # User nemo # Date 1291480254 18000 # Node ID a0c8779713f267ca3864d96e4d01fbf944298bc1 # Parent 42bfc1a7096870d17ba5336178024b3087c0313b In AI survival mode, have the AI score when it kills humans, instead of its own team, clear poison on an AI kill, and reset AI health using InitialHealth instead of 100. diff -r 42bfc1a70968 -r a0c8779713f2 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sat Dec 04 08:52:57 2010 +0100 +++ b/hedgewars/uGears.pas Sat Dec 04 11:30:54 2010 -0500 @@ -535,7 +535,14 @@ end end; inc(KilledHHs); - RecountTeamHealth(team) + RecountTeamHealth(team); + if (CurrentHedgehog <> nil) and CurrentHedgehog^.Effects[heResurrectable] and not Gear^.Hedgehog^.Effects[heResurrectable] then + with CurrentHedgehog^ do + begin + inc(Team^.stats.AIKills); + if Team^.AIKillsTex <> nil then FreeTexture(Team^.AIKillsTex); + Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16); + end end; {$IFDEF DEBUGFILE} with Gear^ do AddFileLog('Delete: #' + inttostr(uid) + ' (' + inttostr(hwRound(x)) + ',' + inttostr(hwRound(y)) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + EnumToStr(Kind)); @@ -1451,12 +1458,15 @@ gear^.State := gstWait; uStats.HedgehogDamaged(gear); gear^.Damage := 0; - gear^.Health := 100; - with CurrentHedgehog^ do begin - inc(Team^.stats.AIKills); - if Team^.AIKillsTex <> nil then FreeTexture(Team^.AIKillsTex); - Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16); - end; + gear^.Health := gear^.Hedgehog^.InitialHealth; + gear^.Hedgehog^.Effects[hePoisoned] := false; + if not CurrentHedgehog^.Effects[heResurrectable] then + with CurrentHedgehog^ do + begin + inc(Team^.stats.AIKills); + if Team^.AIKillsTex <> nil then FreeTexture(Team^.AIKillsTex); + Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16); + end; tempTeam := gear^.Hedgehog^.Team; DeleteCI(gear); FindPlace(gear, false, 0, LAND_WIDTH, true);