Winners clan hedgehogs smiling with big smile
authorunc0rr
Wed, 18 Jun 2008 18:57:34 +0000
changeset 1011 4fe2c4c57d10
parent 1010 583667e81d21
child 1012 36b5cc8264e8
Winners clan hedgehogs smiling with big smile
hedgewars/uConsts.pas
hedgewars/uGears.pas
hedgewars/uTeams.pas
share/hedgewars/Data/Graphics/Hedgehog.png
--- a/hedgewars/uConsts.pas	Wed Jun 18 18:46:11 2008 +0000
+++ b/hedgewars/uConsts.pas	Wed Jun 18 18:57:34 2008 +0000
@@ -173,6 +173,7 @@
       gstHHHJump        = $00002000;
       gstAnimation      = $00004000;
       gstHHDeath        = $00008000;
+      gstWinner         = $00010000;
 
       gm_Left   = $00000001;
       gm_Right  = $00000002;
--- a/hedgewars/uGears.pas	Wed Jun 18 18:46:11 2008 +0000
+++ b/hedgewars/uGears.pas	Wed Jun 18 18:57:34 2008 +0000
@@ -523,6 +523,16 @@
 	defaultPos:= false
 	end else
 
+if (Gear^.State and gstWinner) <> 0 then
+	begin
+	DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
+			hwSign(Gear^.dX),
+			2,
+			0,
+			0);
+	defaultPos:= false
+	end else
+
 if (Gear^.State and gstHHDriven) <> 0 then
 	begin
 	hx:= hwRound(Gear^.X) + 1 + 8 * hwSign(Gear^.dX) + WorldDx;
@@ -737,7 +747,7 @@
 
 with PHedgehog(Gear^.Hedgehog)^ do
 	begin
-	if ((Gear^.State{ and not gstAnimation}) = 0)
+	if ((Gear^.State and not gstWinner) = 0)
 		or (bShowFinger and ((Gear^.State and gstHHDriven) <> 0)) then
 	begin
 	t:= hwRound(Gear^.Y) - cHHRadius - 12 + WorldDy;
--- a/hedgewars/uTeams.pas	Wed Jun 18 18:46:11 2008 +0000
+++ b/hedgewars/uTeams.pas	Wed Jun 18 18:57:34 2008 +0000
@@ -96,7 +96,7 @@
 function CheckForWin: boolean;
 var AliveClan: PClan;
     s: shortstring;
-    t, AliveCount: LongInt;
+    t, AliveCount, i, j: LongInt;
 begin
 AliveCount:= 0;
 for t:= 0 to Pred(ClansCount) do
@@ -112,22 +112,29 @@
 
 TurnTimeLeft:= 0;
 if AliveCount = 0 then
-   begin // draw
-   AddCaption(trmsg[sidDraw], $FFFFFF, capgrpGameState);
-   SendStat(siGameResult, trmsg[sidDraw]);
-   AddGear(0, 0, gtATFinishGame, 0, _0, _0, 2000)
-   end else // win
-   with AliveClan^ do
-     begin
-     if TeamsNumber = 1 then
-        s:= Format(trmsg[sidWinner], Teams[0]^.TeamName)  // team wins
-     else
-        s:= Format(trmsg[sidWinner], Teams[0]^.TeamName); // clan wins
+	begin // draw
+	AddCaption(trmsg[sidDraw], $FFFFFF, capgrpGameState);
+	SendStat(siGameResult, trmsg[sidDraw]);
+	AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000)
+	end else // win
+	with AliveClan^ do
+		begin
+		if TeamsNumber = 1 then
+			s:= Format(trmsg[sidWinner], Teams[0]^.TeamName)  // team wins
+		else
+			s:= Format(trmsg[sidWinner], Teams[0]^.TeamName); // clan wins
 
-     AddCaption(s, $FFFFFF, capgrpGameState);
-     SendStat(siGameResult, s);
-     AddGear(0, 0, gtATFinishGame, 0, _0, _0, 2000)
-     end;
+		for j:= 0 to Pred(TeamsNumber) do
+			with Teams[j]^ do
+				for i:= 0 to cMaxHHIndex do
+					with Hedgehogs[i] do
+						if (Gear <> nil) then
+							Gear^.State:= gstWinner;
+		
+		AddCaption(s, $FFFFFF, capgrpGameState);
+		SendStat(siGameResult, s);
+		AddGear(0, 0, gtATFinishGame, 0, _0, _0, 3000)
+		end;
 SendStats
 end;
 
Binary file share/hedgewars/Data/Graphics/Hedgehog.png has changed