frozen hog impact. koda says he'll add the beam
authornemo
Tue, 28 May 2013 14:09:19 -0400
changeset 9071 df85fad2c7f7
parent 9070 604273fb8a58
child 9072 e7bcdf4f492f
frozen hog impact. koda says he'll add the beam
hedgewars/uGearsUtils.pas
hedgewars/uSound.pas
hedgewars/uTypes.pas
share/hedgewars/Data/Sounds/frozen_hog_impact.ogg
--- a/hedgewars/uGearsUtils.pas	Tue May 28 13:58:01 2013 -0400
+++ b/hedgewars/uGearsUtils.pas	Tue May 28 14:09:19 2013 -0400
@@ -263,6 +263,7 @@
     
 procedure HHHurt(Hedgehog: PHedgehog; Source: TDamageSource);
 begin
+if Hedgehog^.Effects[heFrozen] <> 0 then exit;
 if (Source = dsFall) or (Source = dsExplosion) then
     case random(3) of
         0: PlaySoundV(sndOoff1, Hedgehog^.Team^.voicepack);
@@ -289,32 +290,34 @@
     i: LongWord;
     particle: PVisualGear;
 begin
-    if _0_4 < Gear^.dY then
-        begin
-        dmg := ModifyDamage(1 + hwRound((Gear^.dY - _0_4) * 70), Gear);
-        PlaySound(sndBump);
-        if dmg < 1 then
-            exit;
+if _0_4 < Gear^.dY then
+    begin
+    dmg := ModifyDamage(1 + hwRound((Gear^.dY - _0_4) * 70), Gear);
+    if Gear^.Hedgehog^.Effects[heFrozen] = 0 then
+         PlaySound(sndBump)
+    else PlaySound(sndFrozenHogImpact);
+    if dmg < 1 then
+        exit;
 
-        for i:= min(12, (3 + dmg div 10)) downto 0 do
-            begin
-            particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust);
-            if particle <> nil then
-                particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480);
-            end;
+    for i:= min(12, (3 + dmg div 10)) downto 0 do
+        begin
+        particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust);
+        if particle <> nil then
+            particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480);
+        end;
 
-        if (Gear^.Invulnerable) then
-            exit;
+    if (Gear^.Invulnerable) then
+        exit;
 
-        //if _0_6 < Gear^.dY then
-        //    PlaySound(sndOw4, Gear^.Hedgehog^.Team^.voicepack)
-        //else
-        //    PlaySound(sndOw1, Gear^.Hedgehog^.Team^.voicepack);
+    //if _0_6 < Gear^.dY then
+    //    PlaySound(sndOw4, Gear^.Hedgehog^.Team^.voicepack)
+    //else
+    //    PlaySound(sndOw1, Gear^.Hedgehog^.Team^.voicepack);
 
-        if Gear^.LastDamage <> nil then
-            ApplyDamage(Gear, Gear^.LastDamage, dmg, dsFall)
-        else
-            ApplyDamage(Gear, CurrentHedgehog, dmg, dsFall);
+    if Gear^.LastDamage <> nil then
+        ApplyDamage(Gear, Gear^.LastDamage, dmg, dsFall)
+    else
+        ApplyDamage(Gear, CurrentHedgehog, dmg, dsFall);
     end
 end;
 
--- a/hedgewars/uSound.pas	Tue May 28 13:58:01 2013 -0400
+++ b/hedgewars/uSound.pas	Tue May 28 14:09:19 2013 -0400
@@ -248,7 +248,8 @@
             (FileName:                 'bump.ogg'; Path: ptSounds),// sndBump
             (FileName:            'hogchant3.ogg'; Path: ptSounds),// sndResurrector
             (FileName:                'plane.ogg'; Path: ptSounds),// sndPlane
-            (FileName:               'TARDIS.ogg'; Path: ptSounds) // sndTardis
+            (FileName:               'TARDIS.ogg'; Path: ptSounds),// sndTardis
+            (FileName:    'frozen_hog_impact.ogg'; Path: ptSounds) // sndFrozenHogImpact
             );
 
 
--- a/hedgewars/uTypes.pas	Tue May 28 13:58:01 2013 -0400
+++ b/hedgewars/uTypes.pas	Tue May 28 14:09:19 2013 -0400
@@ -140,7 +140,7 @@
             sndPoisonCough, sndPoisonMoan, sndBirdyLay, sndWhistle, sndBeeWater,
             sndPiano0, sndPiano1, sndPiano2, sndPiano3, sndPiano4, sndPiano5, sndPiano6, sndPiano7, sndPiano8,
             sndSkip, sndSineGun, sndOoff1, sndOoff2, sndOoff3, sndWhack,
-            sndComeonthen, sndParachute, sndBump, sndResurrector, sndPlane, sndTardis);
+            sndComeonthen, sndParachute, sndBump, sndResurrector, sndPlane, sndTardis, sndFrozenHogImpact);
 
     // Available ammo types to be used by hedgehogs
     TAmmoType  = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer, // 6
Binary file share/hedgewars/Data/Sounds/frozen_hog_impact.ogg has changed