hedgewars/GSHandlers.inc
changeset 4297 88714b6f3676
parent 4281 e033cf015b2c
parent 4295 1f5604cd99be
child 4299 d23f8a25fc3f
equal deleted inserted replaced
4290:82f1f1d819c0 4297:88714b6f3676
  2083             1: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine,    0, cBombsSpeed *
  2083             1: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine,    0, cBombsSpeed *
  2084                              Gear^.Tag, _0, 0);
  2084                              Gear^.Tag, _0, 0);
  2085             2: for i:= -19 to 19 do
  2085             2: for i:= -19 to 19 do
  2086                    FollowGear := AddGear(hwRound(Gear^.X) + i div 3, hwRound(Gear^.Y), gtFlame, 0,
  2086                    FollowGear := AddGear(hwRound(Gear^.X) + i div 3, hwRound(Gear^.Y), gtFlame, 0,
  2087                                  _0_001 * i, _0, 0);
  2087                                  _0_001 * i, _0, 0);
  2088             3: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtDrill, 0, cBombsSpeed *
  2088             3: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtDrill, gsttmpFlag, cBombsSpeed *
  2089                              Gear^.Tag, _0, 0);
  2089                              Gear^.Tag, _0, 0);
  2090             //4: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtWaterMelon, 0, cBombsSpeed *
  2090             //4: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtWaterMelon, 0, cBombsSpeed *
  2091             //                 Gear^.Tag, _0, 5000);
  2091             //                 Gear^.Tag, _0, 5000);
  2092         end;
  2092         end;
  2093         Gear^.dX := Gear^.dX + int2hwFloat(30 * Gear^.Tag)
  2093         Gear^.dX := Gear^.dX + int2hwFloat(30 * Gear^.Tag)
  2728         ox := Gear^.X;
  2728         ox := Gear^.X;
  2729         oy := Gear^.Y;
  2729         oy := Gear^.Y;
  2730         Gear^.X := Gear^.X + Gear^.dX;
  2730         Gear^.X := Gear^.X + Gear^.dX;
  2731         Gear^.Y := Gear^.Y + Gear^.dY;
  2731         Gear^.Y := Gear^.Y + Gear^.dY;
  2732         DrawTunnel(oX, oY, Gear^.dX, Gear^.dY, 2, 6);
  2732         DrawTunnel(oX, oY, Gear^.dX, Gear^.dY, 2, 6);
       
  2733         if (Gear^.Timer mod 30) = 0 then
       
  2734             AddVisualGear(hwRound(Gear^.X + _20 * Gear^.dX), hwRound(Gear^.Y + _20 * Gear^.dY), vgtDust);
  2733         if (CheckGearDrowning(Gear)) then
  2735         if (CheckGearDrowning(Gear)) then
  2734         begin
  2736         begin
  2735             StopSound(Gear^.SoundChannel);
  2737             StopSound(Gear^.SoundChannel);
  2736             exit
  2738             exit
  2737         end
  2739         end
  2746 // CheckLandValue returns true if the type isn't matched
  2748 // CheckLandValue returns true if the type isn't matched
  2747        or not CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y), lfIndestructible) then
  2749        or not CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y), lfIndestructible) then
  2748     begin
  2750     begin
  2749         //out of time or exited ground
  2751         //out of time or exited ground
  2750         StopSound(Gear^.SoundChannel);
  2752         StopSound(Gear^.SoundChannel);
  2751         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound);
  2753         if (Gear^.State and gsttmpFlag) <> 0 then
       
  2754             doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, EXPLAutoSound)
       
  2755         else
       
  2756             doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound);
  2752         DeleteGear(Gear);
  2757         DeleteGear(Gear);
  2753         exit
  2758         exit
  2754     end;
  2759     end;
  2755 
  2760 
  2756     dec(Gear^.Timer);
  2761     dec(Gear^.Timer);
  2762     oldDx, oldDy: hwFloat;
  2767     oldDx, oldDy: hwFloat;
  2763     t2: hwFloat;
  2768     t2: hwFloat;
  2764 begin
  2769 begin
  2765     AllInactive := false;
  2770     AllInactive := false;
  2766 
  2771 
  2767     Gear^.dX := Gear^.dX + cWindSpeed;
  2772     if (Gear^.State and gsttmpFlag) = 0 then
       
  2773         Gear^.dX := Gear^.dX + cWindSpeed;
       
  2774 
  2768     oldDx := Gear^.dX;
  2775     oldDx := Gear^.dX;
  2769     oldDy := Gear^.dY;
  2776     oldDy := Gear^.dY;
  2770 
  2777 
  2771     doStepFallingGear(Gear);
  2778     doStepFallingGear(Gear);
  2772 
  2779 
  2788             Gear^.dY := Gear^.dY * t2;
  2795             Gear^.dY := Gear^.dY * t2;
  2789         end
  2796         end
  2790         else
  2797         else
  2791         begin
  2798         begin
  2792             //explode right on contact with HH
  2799             //explode right on contact with HH
  2793             doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound);
  2800             if (Gear^.State and gsttmpFlag) <> 0 then
       
  2801                 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, EXPLAutoSound)
       
  2802             else
       
  2803                 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound);
  2794             DeleteGear(Gear);
  2804             DeleteGear(Gear);
  2795             exit;
  2805             exit;
  2796         end;
  2806         end;
  2797 
  2807 
  2798         Gear^.SoundChannel := LoopSound(sndDrillRocket);
  2808         Gear^.SoundChannel := LoopSound(sndDrillRocket);
  4227 
  4237 
  4228     doStepHammerHitWork(Gear);
  4238     doStepHammerHitWork(Gear);
  4229     Gear^.doStep := @doStepHammerHitWork
  4239     Gear^.doStep := @doStepHammerHitWork
  4230 end;
  4240 end;
  4231 
  4241 
  4232 
  4242 ////////////////////////////////////////////////////////////////////////////////
  4233 procedure doStepResurrectorWork(Gear: PGear);
  4243 procedure doStepResurrectorWork(Gear: PGear);
  4234 var
  4244 var
  4235     graves: TPGearArray;
  4245     graves: TPGearArray;
  4236     resgear: PGear;
  4246     resgear: PGear;
  4237     hh: PHedgehog;
  4247     hh: PHedgehog;
  4342         Gear^.Timer := 250;
  4352         Gear^.Timer := 250;
  4343         Gear^.doStep := @doStepIdle;
  4353         Gear^.doStep := @doStepIdle;
  4344         end
  4354         end
  4345 end;
  4355 end;
  4346 
  4356 
       
  4357 ////////////////////////////////////////////////////////////////////////////////
       
  4358