hedgewars/GSHandlers.inc
changeset 4293 d79ffcdd77df
parent 4282 46c3c5cf89e4
child 4295 1f5604cd99be
equal deleted inserted replaced
4291:7e489fe1b49c 4293:d79ffcdd77df
  2082             1: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine,    0, cBombsSpeed *
  2082             1: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine,    0, cBombsSpeed *
  2083                              Gear^.Tag, _0, 0);
  2083                              Gear^.Tag, _0, 0);
  2084             2: for i:= -19 to 19 do
  2084             2: for i:= -19 to 19 do
  2085                    FollowGear := AddGear(hwRound(Gear^.X) + i div 3, hwRound(Gear^.Y), gtFlame, 0,
  2085                    FollowGear := AddGear(hwRound(Gear^.X) + i div 3, hwRound(Gear^.Y), gtFlame, 0,
  2086                                  _0_001 * i, _0, 0);
  2086                                  _0_001 * i, _0, 0);
  2087             3: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtDrill, 0, cBombsSpeed *
  2087             3: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtDrill, gsttmpFlag, cBombsSpeed *
  2088                              Gear^.Tag, _0, 0);
  2088                              Gear^.Tag, _0, 0);
  2089             //4: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtWaterMelon, 0, cBombsSpeed *
  2089             //4: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtWaterMelon, 0, cBombsSpeed *
  2090             //                 Gear^.Tag, _0, 5000);
  2090             //                 Gear^.Tag, _0, 5000);
  2091         end;
  2091         end;
  2092         Gear^.dX := Gear^.dX + int2hwFloat(30 * Gear^.Tag)
  2092         Gear^.dX := Gear^.dX + int2hwFloat(30 * Gear^.Tag)
  2747 // CheckLandValue returns true if the type isn't matched
  2747 // CheckLandValue returns true if the type isn't matched
  2748        or not CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y), lfIndestructible) then
  2748        or not CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y), lfIndestructible) then
  2749     begin
  2749     begin
  2750         //out of time or exited ground
  2750         //out of time or exited ground
  2751         StopSound(Gear^.SoundChannel);
  2751         StopSound(Gear^.SoundChannel);
  2752         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound);
  2752         if (Gear^.State and gsttmpFlag) <> 0 then
       
  2753             doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, EXPLAutoSound)
       
  2754         else
       
  2755             doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound);
  2753         DeleteGear(Gear);
  2756         DeleteGear(Gear);
  2754         exit
  2757         exit
  2755     end;
  2758     end;
  2756 
  2759 
  2757     dec(Gear^.Timer);
  2760     dec(Gear^.Timer);
  2763     oldDx, oldDy: hwFloat;
  2766     oldDx, oldDy: hwFloat;
  2764     t2: hwFloat;
  2767     t2: hwFloat;
  2765 begin
  2768 begin
  2766     AllInactive := false;
  2769     AllInactive := false;
  2767 
  2770 
  2768     Gear^.dX := Gear^.dX + cWindSpeed;
  2771     if (Gear^.State and gsttmpFlag) = 0 then
       
  2772         Gear^.dX := Gear^.dX + cWindSpeed;
       
  2773 
  2769     oldDx := Gear^.dX;
  2774     oldDx := Gear^.dX;
  2770     oldDy := Gear^.dY;
  2775     oldDy := Gear^.dY;
  2771 
  2776 
  2772     doStepFallingGear(Gear);
  2777     doStepFallingGear(Gear);
  2773 
  2778 
  2789             Gear^.dY := Gear^.dY * t2;
  2794             Gear^.dY := Gear^.dY * t2;
  2790         end
  2795         end
  2791         else
  2796         else
  2792         begin
  2797         begin
  2793             //explode right on contact with HH
  2798             //explode right on contact with HH
  2794             doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound);
  2799             if (Gear^.State and gsttmpFlag) <> 0 then
       
  2800                 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, EXPLAutoSound)
       
  2801             else
       
  2802                 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound);
  2795             DeleteGear(Gear);
  2803             DeleteGear(Gear);
  2796             exit;
  2804             exit;
  2797         end;
  2805         end;
  2798 
  2806 
  2799         Gear^.SoundChannel := LoopSound(sndDrillRocket);
  2807         Gear^.SoundChannel := LoopSound(sndDrillRocket);
  4228 
  4236 
  4229     doStepHammerHitWork(Gear);
  4237     doStepHammerHitWork(Gear);
  4230     Gear^.doStep := @doStepHammerHitWork
  4238     Gear^.doStep := @doStepHammerHitWork
  4231 end;
  4239 end;
  4232 
  4240 
  4233 
  4241 ////////////////////////////////////////////////////////////////////////////////
  4234 procedure doStepResurrectorWork(Gear: PGear);
  4242 procedure doStepResurrectorWork(Gear: PGear);
  4235 var
  4243 var
  4236     graves: TPGearArray;
  4244     graves: TPGearArray;
  4237     resgear: PGear;
  4245     resgear: PGear;
  4238     hh: PHedgehog;
  4246     hh: PHedgehog;
  4343         Gear^.Timer := 250;
  4351         Gear^.Timer := 250;
  4344         Gear^.doStep := @doStepIdle;
  4352         Gear^.doStep := @doStepIdle;
  4345         end
  4353         end
  4346 end;
  4354 end;
  4347 
  4355 
       
  4356 ////////////////////////////////////////////////////////////////////////////////
       
  4357