hedgewars/uGears.pas
changeset 4792 68f9b331014a
parent 4790 4cb3f7890fbd
child 4806 48c1a395f0a7
--- a/hedgewars/uGears.pas	Fri Dec 31 00:37:39 2010 +0100
+++ b/hedgewars/uGears.pas	Fri Dec 31 01:05:23 2010 +0100
@@ -557,7 +557,7 @@
             begin
             t:= max(Gear^.Damage, Gear^.Health);
             Gear^.Damage:= t;
-            if (cWaterOpacity < $FF) and (hwRound(Gear^.Y) < cWaterLine + 256) then
+            if ((not SuddenDeathDmg and (cWaterOpacity < $FF)) or (SuddenDeathDmg and (cWaterOpacity < $FF))) and (hwRound(Gear^.Y) < cWaterLine + 256) then
                 spawnHealthTagForHH(Gear, t);
             uStats.HedgehogDamaged(Gear)
             end;
@@ -793,9 +793,14 @@
     stHealth: begin
             if (cWaterRise <> 0) or (cHealthDecrease <> 0) then
                 begin
-                if (TotalRounds = cSuddenDTurns) and not SuddenDeathDmg and not isInMultiShoot then
+                if (TotalRounds = cSuddenDTurns) and not SuddenDeath and not isInMultiShoot then
                     begin
-                    SuddenDeathDmg:= true;
+                    SuddenDeath:= true;
+                    if cHealthDecrease <> 0 then
+                        begin
+                        SuddenDeathDmg:= true;
+                        ChangeToSDClouds
+                        end;
                     AddCaption(trmsg[sidSuddenDeath], cWhiteColor, capgrpGameState);
                     playSound(sndSuddenDeath);
                     MusicFN:= SDMusic;
@@ -1885,6 +1890,7 @@
     CurAmmoGear:= nil;
     GearsList:= nil;
     KilledHHs:= 0;
+    SuddenDeath:= false;
     SuddenDeathDmg:= false;
     SpeechType:= 1;
     TrainingTargetGear:= nil;