hedgewars/GSHandlers.inc
changeset 2603 abed6070a669
parent 2602 3deb9ff104da
child 2608 cebfea02f8b5
--- a/hedgewars/GSHandlers.inc	Thu Nov 05 20:47:42 2009 +0000
+++ b/hedgewars/GSHandlers.inc	Thu Nov 05 20:48:13 2009 +0000
@@ -16,32 +16,6 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  *)
 
-procedure makeHogsWorry(x, y: hwFloat; r: LongInt);
-var gi: PGear;
-     d: LongInt;
-begin
-	gi:= GearsList;
-	while gi <> nil do
-		begin
-		d:= r - hwRound(Distance(gi^.X - x, gi^.Y - y));
-		if (d > 1) and (gi^.Kind = gtHedgehog) and not gi^.Invulnerable then
-			begin
-			if (gi^.State and gstMoving) = 0 then
-				gi^.State:= gi^.State or gstLoser;
-			if (CurrentHedgehog^.Gear = gi) then
-				PlaySound(sndOops, false, PHedgehog(gi^.Hedgehog)^.Team^.voicepack)
-			else
-				begin
-				if d > r div 2 then
-					PlaySound(sndNooo, false, PHedgehog(gi^.Hedgehog)^.Team^.voicepack)
-				else
-					PlaySound(sndUhOh, false, PHedgehog(gi^.Hedgehog)^.Team^.voicepack);
-				end;
-			end;
-		gi:= gi^.NextGear
-		end;
-end;
-////////////////////////////////////////////////////////////////////////////////
 procedure doStepDrowningGear(Gear: PGear); forward;
 
 function CheckGearDrowning(Gear: PGear): boolean;
@@ -187,13 +161,6 @@
 doStepFallingGear(Gear);
 
 dec(Gear^.Timer);
-if Gear^.Timer = 1000 then // might need adjustments
-	case Gear^.Kind of
-		gtAmmo_Bomb: makeHogsWorry(Gear^.X, Gear^.Y, 50);
-		gtClusterBomb: makeHogsWorry(Gear^.X, Gear^.Y, 20);
-		gtWatermelon: makeHogsWorry(Gear^.X, Gear^.Y, 75);
-		gtHellishBomb: makeHogsWorry(Gear^.X, Gear^.Y, 90);
-	end;
 if Gear^.Timer = 0 then
 	begin
 	case Gear^.Kind of
@@ -284,6 +251,7 @@
 procedure doStepWatermelon(Gear: PGear);
 begin
 AllInactive:= false;
+PlaySound(sndMelon, false, nil);
 Gear^.doStep:= @doStepBomb
 end;
 
@@ -1191,8 +1159,6 @@
 doStepFallingGear(Gear);
 AllInactive:= false;
 if Gear^.Timer mod 166 = 0 then inc(Gear^.Tag);
-if Gear^.Timer = 1000 then // might need better timing
-	makeHogsWorry(Gear^.X, Gear^.Y, 75);
 if Gear^.Timer = 0 then
 	begin
 	doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 75, EXPLAutoSound);
@@ -1358,8 +1324,10 @@
 	if (hwRound(Gear^.Y) > cWaterLine) then
 		begin
 		for i:= 0 to 3 do
+			begin
 			AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 16 + Random(16), vgtSteam);
-		PlaySound(sndVaporize, false, nil);
+			PlaySound(sndVaporize, false, nil);
+			end;
 		DeleteGear(Gear);
 		exit
 		end
@@ -1562,6 +1530,7 @@
 
 Gear^.Health:= 6;
 Gear^.doStep:= @doStepAirAttackWork;
+PlaySound(sndIncoming, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack)
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2454,7 +2423,6 @@
 	end
 end;
 
-////////////////////////////////////////////////////////////////////////////////
 procedure doStepJetpack(Gear: PGear);
 var HHGear: PGear;
 begin