hedgewars/GSHandlers.inc
changeset 5728 aca2acfba4ca
parent 5722 3b7f2bfc8632
child 5738 a81fc23356e7
equal deleted inserted replaced
5726:f342e0cf4f34 5728:aca2acfba4ca
  4919 begin
  4919 begin
  4920 
  4920 
  4921 HH:= Gear^.Hedgehog;
  4921 HH:= Gear^.Hedgehog;
  4922 if Gear^.Pos = 2 then
  4922 if Gear^.Pos = 2 then
  4923     begin
  4923     begin
       
  4924     StopSound(Gear^.SoundChannel);
  4924     if (Gear^.Timer = 0) then
  4925     if (Gear^.Timer = 0) then
  4925         begin
  4926         begin
  4926         if (HH^.Gear <> nil) and (HH^.Gear^.State and gstInvisible = 0) then
  4927         if (HH^.Gear <> nil) and (HH^.Gear^.State and gstInvisible = 0) then
  4927             begin
  4928             begin
  4928 	    AfterAttack;
  4929 	    AfterAttack;
  4949         end;
  4950         end;
  4950 
  4951 
  4951     inc(Gear^.Timer);
  4952     inc(Gear^.Timer);
  4952     if (Gear^.Timer > 2000) and ((GameTicks mod 2000) = 1000) then
  4953     if (Gear^.Timer > 2000) and ((GameTicks mod 2000) = 1000) then
  4953         begin
  4954         begin
  4954         Gear^.Pos:= 3;
  4955         Gear^.SoundChannel := LoopSound(sndTardis);
  4955         end;
  4956         Gear^.Pos:= 3
       
  4957         end
  4956     end;
  4958     end;
  4957 
  4959 
  4958 if (Gear^.Pos = 1) and (GameTicks and $1F = 0) and (Gear^.Power < 255) then inc(Gear^.Power);
  4960 if (Gear^.Pos = 1) and (GameTicks and $1F = 0) and (Gear^.Power < 255) then inc(Gear^.Power);
  4959 if (Gear^.Pos = 3) and (GameTicks and $1F = 0) and (Gear^.Power > 0) then dec(Gear^.Power);
  4961 if (Gear^.Pos = 3) and (GameTicks and $1F = 0) and (Gear^.Power > 0) then dec(Gear^.Power);
  4960 if (Gear^.Pos = 1) and (Gear^.Power = 255) and ((GameTicks mod 2000) = 1000) then Gear^.Pos:= 2;
  4962 if (Gear^.Pos = 1) and (Gear^.Power = 255) and ((GameTicks mod 2000) = 1000) then Gear^.Pos:= 2;
  4961 if (Gear^.Pos = 3) and (Gear^.Power = 0) then
  4963 if (Gear^.Pos = 3) and (Gear^.Power = 0) then
  4962     begin
  4964     begin
       
  4965     StopSound(Gear^.SoundChannel);
  4963     if HH^.GearHidden = nil then
  4966     if HH^.GearHidden = nil then
  4964         begin
  4967         begin
  4965         DeleteGear(Gear);
  4968         DeleteGear(Gear);
  4966         exit
  4969         exit
  4967         end;
  4970         end;
  4979                ((HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.State and gstDrowning) = 0) and
  4982                ((HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.State and gstDrowning) = 0) and
  4980                (HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.Health >
  4983                (HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.Health >
  4981                 HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.Damage) then inc(cnt);
  4984                 HH^.Team^.Clan^.Teams[j]^.Hedgehogs[i].Gear^.Damage) then inc(cnt);
  4982     if (cnt = 0) or SuddenDeathDmg or (Gear^.Timer = 0) then
  4985     if (cnt = 0) or SuddenDeathDmg or (Gear^.Timer = 0) then
  4983         begin
  4986         begin
       
  4987         Gear^.SoundChannel := LoopSound(sndTardis);
  4984         Gear^.Pos:= 1;
  4988         Gear^.Pos:= 1;
  4985         Gear^.Power:= 0;
  4989         Gear^.Power:= 0;
  4986         Gear^.Timer:= 0;
  4990         Gear^.Timer:= 0;
  4987         if HH^.GearHidden <> nil then FindPlace(HH^.GearHidden, false, 0, LAND_WIDTH,true);
  4991         if HH^.GearHidden <> nil then FindPlace(HH^.GearHidden, false, 0, LAND_WIDTH,true);
  4988         if HH^.GearHidden <> nil then 
  4992         if HH^.GearHidden <> nil then 
  5037 	    end;
  5041 	    end;
  5038         PlaySound(sndDenied);
  5042         PlaySound(sndDenied);
  5039         DeleteGear(gear);
  5043         DeleteGear(gear);
  5040         exit
  5044         exit
  5041         end;
  5045         end;
       
  5046     Gear^.SoundChannel := LoopSound(sndTardis);
  5042     Gear^.doStep:= @doStepTardisWarp
  5047     Gear^.doStep:= @doStepTardisWarp
  5043 end;
  5048 end;
  5044 
  5049 
  5045 ////////////////////////////////////////////////////////////////////////////////
  5050 ////////////////////////////////////////////////////////////////////////////////
  5046 
  5051