Add sounds to girder
authorunc0rr
Sun, 22 Mar 2009 21:51:30 +0000
changeset 1914 aab686a4e0c5
parent 1913 73d2da2df3c2
child 1915 c357f5b55320
Add sounds to girder
hedgewars/GSHandlers.inc
hedgewars/uConsts.pas
share/hedgewars/Data/Sounds/denied.ogg
share/hedgewars/Data/Sounds/placed.ogg
--- a/hedgewars/GSHandlers.inc	Sun Mar 22 21:44:48 2009 +0000
+++ b/hedgewars/GSHandlers.inc	Sun Mar 22 21:51:30 2009 +0000
@@ -1425,22 +1425,26 @@
 y:= hwRound(HHGear^.Y);
 
 // use a circle instead?
-if (abs(tx-x) > 256) or 
+if (abs(tx-x) > 256) or
    (abs(ty-y) > 256) or
    not TryPlaceOnLand(tx - SpritesData[sprAmGirder].Width div 2,
                       ty - SpritesData[sprAmGirder].Height div 2,
                       sprAmGirder, Gear^.State, true) then
 	begin
+    PlaySound(sndDenied, false, nil);
+	HHGear^.Message:= HHGear^.Message and not gm_Attack;
+	HHGear^.State:= HHGear^.State and not gstAttacking;
 	HHGear^.State:= HHGear^.State or gstHHChooseTarget;
-	DeleteGear(Gear);
-    isCursorVisible:= true
+	isCursorVisible:= true;
+	DeleteGear(Gear)
 	end
 else begin
+    PlaySound(sndPlaced, false, nil);
 	DeleteGear(Gear);
     OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^);
-    ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^);
-    isCursorVisible:= false
- 	end;
+    ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^)
+	end;
+
 HHGear^.State:= HHGear^.State and not (gstAttacking or gstAttacked);
 HHGear^.Message:= HHGear^.Message and not gm_Attack;
 TargetPoint.X:= NoPointX
--- a/hedgewars/uConsts.pas	Sun Mar 22 21:44:48 2009 +0000
+++ b/hedgewars/uConsts.pas	Sun Mar 22 21:51:30 2009 +0000
@@ -86,7 +86,7 @@
 			sndCake, sndOw1, sndOw4, sndFirePunch1, sndFirePunch2,
 			sndFirePunch3, sndFirePunch4, sndFirePunch5, sndFirePunch6,
 			sndMelon, sndHellish, sndYoohoo, sndRCPlane, sndWhipCrack,
-			sndRideOfTheValkyries);
+			sndRideOfTheValkyries, sndDenied, sndPlaced);
 
 	TAmmoType  = (amGrenade, amClusterBomb, amBazooka, amUFO, amShotgun, amPickHammer,
 			amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip,
@@ -565,7 +565,9 @@
 			(FileName:               'Yoohoo.ogg'; Path: ptSounds),// sndYoohoo
 			(FileName:              'rcplane.ogg'; Path: ptSounds),// sndRCPlane
 			(FileName:            'whipcrack.ogg'; Path: ptSounds),// sndWhipCrack
-			(FileName:'ride_of_the_valkyries.ogg'; Path: ptSounds) // sndRideOfTheValkyries
+			(FileName:'ride_of_the_valkyries.ogg'; Path: ptSounds),// sndRideOfTheValkyries
+			(FileName:               'denied.ogg'; Path: ptSounds),// sndDenied
+			(FileName:               'placed.ogg'; Path: ptSounds) // sndPlaced
 			);
 
 	Ammoz: array [TAmmoType] of record
Binary file share/hedgewars/Data/Sounds/denied.ogg has changed
Binary file share/hedgewars/Data/Sounds/placed.ogg has changed