merge
authorunc0rr
Sun, 27 Feb 2011 20:58:59 +0300
changeset 4967 5d6443a7ec03
parent 4965 e57a679943c2 (current diff)
parent 4966 fa612a614317 (diff)
child 4968 8e1673f0dc05
merge
--- a/hedgewars/GSHandlers.inc	Sun Feb 27 20:58:43 2011 +0300
+++ b/hedgewars/GSHandlers.inc	Sun Feb 27 20:58:59 2011 +0300
@@ -1692,6 +1692,27 @@
     else
         if ((GameTicks and $3F) = 25) then
             doStepFallingGear(Gear);
+    if (Gear^.Health = 0) then
+        begin
+            if not Gear^.dY.isNegative and (Gear^.dY > _0_2) and TestCollisionYwithGear(Gear, 1) then
+                inc(Gear^.Damage, hwRound(Gear^.dY * _70))
+            else if not Gear^.dX.isNegative and (Gear^.dX > _0_2) and TestCollisionXwithGear(Gear, 1) then
+                 inc(Gear^.Damage, hwRound(Gear^.dX * _70))
+            else if Gear^.dY.isNegative and (Gear^.dY < -_0_2) and TestCollisionYwithGear(Gear, -1) then
+                 inc(Gear^.Damage, hwRound(Gear^.dY * -_70))
+            else if Gear^.dX.isNegative and (Gear^.dX < -_0_2) and TestCollisionXwithGear(Gear, -1) then
+                 inc(Gear^.Damage, hwRound(Gear^.dX * -_70));
+        
+        if (Gear^.Damage > random(10)) and ((GameTicks and $FF) = 0) then
+            AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y), vgtSmoke);
+
+        if (Gear^.Damage > 35) then
+            begin
+            doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound);
+            DeleteGear(Gear);
+            exit
+            end
+        end;
 
     if ((Gear^.State and gsttmpFlag) <> 0) and (Gear^.Health <> 0) then
         if ((Gear^.State and gstAttacking) = 0) then
@@ -1719,6 +1740,8 @@
                     vgtSmoke);
                     PlaySound(sndVaporize);
                     Gear^.Health := 0;
+                    Gear^.Damage := 0;
+AddFileLog('initial mine damage:'+IntToStr(Gear^.Damage));
                     end;
                 exit
                 end;
--- a/hedgewars/uSound.pas	Sun Feb 27 20:58:43 2011 +0300
+++ b/hedgewars/uSound.pas	Sun Feb 27 20:58:59 2011 +0300
@@ -44,6 +44,7 @@
 procedure ChangeMusic;
 procedure StopSound(snd: TSound);
 procedure StopSound(chn: LongInt);
+procedure StopSound(chn, fadems: LongInt);
 function  ChangeVolume(voldelta: LongInt): LongInt;
 function  AskForVoicepack(name: shortstring): Pointer;