# HG changeset patch # User tiyuri@gmail.com # Date 1282827768 -3600 # Node ID f54e8cb9a12bdd9869108142d96da1273a6c68be # Parent bb9ecd0346d815c55e67d73e420c3b89debf9d0a Add kill counter to Survival Mode -Burp diff -r bb9ecd0346d8 -r f54e8cb9a12b hedgewars/uGears.pas --- a/hedgewars/uGears.pas Thu Aug 26 06:06:28 2010 -0400 +++ b/hedgewars/uGears.pas Thu Aug 26 14:02:48 2010 +0100 @@ -1549,7 +1549,8 @@ gear^.dX := _0; gear^.dY := _0; gear^.State := gstWait; - FindPlace(Gear, false, 0, LAND_WIDTH); + inc(CurrentHedgehog^.Team^.stats.AIKills); + FindPlace(gear, false, 0, LAND_WIDTH); RenderHealth(PHedgehog(gear^.Hedgehog)^); RecountTeamHealth(PHedgehog(gear^.Hedgehog)^.Team); ScriptCall('onResurrect', gear^.uid); diff -r bb9ecd0346d8 -r f54e8cb9a12b hedgewars/uStats.pas --- a/hedgewars/uStats.pas Thu Aug 26 06:06:28 2010 -0400 +++ b/hedgewars/uStats.pas Thu Aug 26 14:02:48 2010 +0100 @@ -32,8 +32,13 @@ MaxStepDamageGiven, MaxStepKills: Longword; FinishedTurns: Longword; + AIKills : LongInt; end; +type TTeamStats = record + AIKills : LongInt; +end; + var TotalRounds: LongInt; FinishedTurnsTotal: LongInt; diff -r bb9ecd0346d8 -r f54e8cb9a12b hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Thu Aug 26 06:06:28 2010 -0400 +++ b/hedgewars/uTeams.pas Thu Aug 26 14:02:48 2010 +0100 @@ -76,6 +76,7 @@ hasGone: boolean; voicepack: PVoicepack; PlayerHash: shortstring; // md5 hash of player name. For temporary enabling of hats as thank you. Hashed for privacy of players + stats: TTeamStats; end; TClan = record diff -r bb9ecd0346d8 -r f54e8cb9a12b hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Thu Aug 26 06:06:28 2010 -0400 +++ b/hedgewars/uWorld.pas Thu Aug 26 14:02:48 2010 +0100 @@ -778,6 +778,13 @@ inc(r.x, cTeamHealthWidth + 2); r.w:= 3; DrawFromRect(TeamHealthBarWidth + 16, cScreenHeight + DrawHealthY, @r, HealthTex); + + // draw ai kill counter for gfAISurvival + if (GameFlags and gfAISurvival) <> 0 then begin + DrawTexture(TeamHealthBarWidth + 22, cScreenHeight + DrawHealthY, + RenderStringTex(''+inttostr(stats.AIKills)+'', Clan^.Color, fnt16)); + end; + // if highlighted, draw flag and other contents again to keep their colors // this approach should be faster than drawing all borders one by one tinted or not if highlight then