hedgewars/GSHandlers.inc
changeset 3136 326a8cb7d9b7
parent 3123 b0a02930a1dc
child 3139 a075f5344796
equal deleted inserted replaced
3135:a7d0e22eaf28 3136:326a8cb7d9b7
   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))) and
   239 if (Gear^.nImpactSounds > 0) then
   240    ((Gear^.dX.QWordValue > _0_1.QWordValue) or (Gear^.dY.QWordValue > _0_1.QWordValue)) then
   240     if ((Gear^.Damage <> 0) or ((Gear^.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving))) and
   241    PlaySound(Gear^.ImpactSound);
   241        ((Gear^.dX.QWordValue > _0_1.QWordValue) or (Gear^.dY.QWordValue > _0_1.QWordValue)) then
       
   242         PlaySound(TSound(ord(Gear^.ImpactSound) + GetRandom(Gear^.nImpactSounds)));
   242 end;
   243 end;
   243 
   244 
   244 ////////////////////////////////////////////////////////////////////////////////
   245 ////////////////////////////////////////////////////////////////////////////////
   245 procedure doStepBomb(Gear: PGear);
   246 procedure doStepBomb(Gear: PGear);
   246 var i, x, y: LongInt;
   247 var i, x, y: LongInt;
   316 
   317 
   317 CalcRotationDirAngle(Gear);
   318 CalcRotationDirAngle(Gear);
   318 
   319 
   319 if Gear^.Kind = gtHellishBomb then
   320 if Gear^.Kind = gtHellishBomb then
   320     begin
   321     begin
   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 
   322 
   330     if Gear^.Timer = 3000 then
   323     if Gear^.Timer = 3000 then
   331         begin
   324         begin
       
   325         Gear^.nImpactSounds:= 0;
   332         PlaySound(sndHellish);
   326         PlaySound(sndHellish);
   333         Gear^.ImpactSound:= sndNone
       
   334         end;
   327         end;
   335 
   328 
   336     if (GameTicks and $3F) = 0 then
   329     if (GameTicks and $3F) = 0 then
   337         if (Gear^.State and gstCollision) = 0 then
   330         if (Gear^.State and gstCollision) = 0 then
   338             AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtEvilTrace, 0, _0, _0, 0);
   331             AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtEvilTrace, 0, _0, _0, 0);