hedgewars/GSHandlers.inc
changeset 3118 1320933fd651
parent 3115 831bd0f7050d
child 3119 6e081232b8a8
equal deleted inserted replaced
3117:f3e363a9b7db 3118:1320933fd651
   234     (not isFalling) then
   234     (not isFalling) then
   235     Gear^.State:= Gear^.State and not gstMoving
   235     Gear^.State:= Gear^.State and not gstMoving
   236 else
   236 else
   237     Gear^.State:= Gear^.State or      gstMoving;
   237     Gear^.State:= Gear^.State or      gstMoving;
   238 
   238 
   239 if ((Gear^.Damage <> 0) or ((Gear^.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving))) then
   239 if ((Gear^.Damage <> 0) or ((Gear^.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving))) and
   240     if ((Gear^.dX.QWordValue > _0_1.QWordValue)
   240    ((Gear^.dX.QWordValue > _0_1.QWordValue) or (Gear^.dY.QWordValue > _0_1.QWordValue)) then
   241     or  (Gear^.dY.QWordValue > _0_1.QWordValue)) then
   241    PlaySound(Gear^.ImpactSound);
   242         PlaySound(Gear^.ImpactSound);
       
   243 end;
   242 end;
   244 
   243 
   245 ////////////////////////////////////////////////////////////////////////////////
   244 ////////////////////////////////////////////////////////////////////////////////
   246 procedure doStepBomb(Gear: PGear);
   245 procedure doStepBomb(Gear: PGear);
   247 var i, x, y: LongInt;
   246 var i, x, y: LongInt;
   317 
   316 
   318 CalcRotationDirAngle(Gear);
   317 CalcRotationDirAngle(Gear);
   319 
   318 
   320 if Gear^.Kind = gtHellishBomb then
   319 if Gear^.Kind = gtHellishBomb then
   321     begin
   320     begin
   322     if Gear^.Timer = 3000 then PlaySound(sndHellish);
   321     if (Gear^.Timer > 3000) and ((Gear^.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving)) and
       
   322        ((Gear^.dX.QWordValue > _0_1.QWordValue) or (Gear^.dY.QWordValue > _0_1.QWordValue)) then
       
   323         case random(4) of
       
   324             0: Gear^.ImpactSound:= sndHellishImpact1;
       
   325             1: Gear^.ImpactSound:= sndHellishImpact2;
       
   326             2: Gear^.ImpactSound:= sndHellishImpact3;
       
   327             3: Gear^.ImpactSound:= sndHellishImpact4
       
   328         end;
       
   329 
       
   330     if Gear^.Timer = 3000 then
       
   331         begin
       
   332         PlaySound(sndHellish);
       
   333         Gear^.ImpactSound:= sndNone
       
   334         end;
   323 
   335 
   324     if (GameTicks and $3F) = 0 then
   336     if (GameTicks and $3F) = 0 then
   325         if (Gear^.State and gstCollision) = 0 then
   337         if (Gear^.State and gstCollision) = 0 then
   326             AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtEvilTrace, 0, _0, _0, 0);
   338             AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtEvilTrace, 0, _0, _0, 0);
   327     end;
   339     end;