hedgewars/GSHandlers.inc
changeset 3065 4afa5e3e27e4
parent 3036 c6ba6531cb4b
child 3071 f40a3fbe3b34
equal deleted inserted replaced
3064:7458ec3666c3 3065:4afa5e3e27e4
  2772        begin
  2772        begin
  2773        if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
  2773        if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
  2774        Gear^.Tex:= RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(round(Gear^.Health / 20)) + '%', cWhiteColor, fntSmall)
  2774        Gear^.Tex:= RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(round(Gear^.Health / 20)) + '%', cWhiteColor, fntSmall)
  2775        end;
  2775        end;
  2776 
  2776 
  2777 if HHGear^.Message and (gm_Attack or gm_Up or gm_Precise or gm_Left or gm_Right) <> 0 then Gear^.State:= Gear^.State and not gsttmpFlag;
  2777 if (HHGear^.Message and gm_Attack <> 0) then begin
       
  2778         HHGear^.Message := HHGear^.Message and not gm_Attack;
       
  2779 		if Gear^.FlightTime > 0 then begin
       
  2780 			AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtEgg, 0, Gear^.dX * _0_5, Gear^.dY, 0);
       
  2781 			dec(Gear^.FlightTime)
       
  2782 		end;
       
  2783 end;
       
  2784 
       
  2785 if HHGear^.Message and (gm_Up or gm_Precise or gm_Left or gm_Right) <> 0 then Gear^.State:= Gear^.State and not gsttmpFlag;
  2778 HHGear^.Message:= HHGear^.Message and not (gm_Up or gm_Precise or gm_Left or gm_Right);
  2786 HHGear^.Message:= HHGear^.Message and not (gm_Up or gm_Precise or gm_Left or gm_Right);
  2779 HHGear^.State:= HHGear^.State or gstMoving;
  2787 HHGear^.State:= HHGear^.State or gstMoving;
  2780 
  2788 
  2781 Gear^.X:= HHGear^.X;
  2789 Gear^.X:= HHGear^.X;
  2782 Gear^.Y:= HHGear^.Y - int2hwFloat(32);
  2790 Gear^.Y:= HHGear^.Y - int2hwFloat(32);
  2879 for i:= 0 to 46 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtFire);
  2887 for i:= 0 to 46 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtFire);
  2880 for i:= 0 to 15 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtExplPart);
  2888 for i:= 0 to 15 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtExplPart);
  2881 for i:= 0 to 15 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtExplPart2);
  2889 for i:= 0 to 15 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtExplPart2);
  2882 Gear^.doStep:= @doStepBigExplosionWork
  2890 Gear^.doStep:= @doStepBigExplosionWork
  2883 end;
  2891 end;
       
  2892 
       
  2893 ////////////////////////////////////////////////////////////////////////////////
       
  2894 procedure doStepEggWork(Gear: PGear);
       
  2895 begin
       
  2896 	AllInactive:= false;
       
  2897 	Gear^.dX:= Gear^.dX + cWindSpeed;
       
  2898 	doStepFallingGear(Gear);
       
  2899 	if (Gear^.State and gstCollision) <> 0 then
       
  2900 	begin
       
  2901 		doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, EXPLAutoSound);
       
  2902 		DeleteGear(Gear);
       
  2903 		exit
       
  2904 	end;
       
  2905 	if (GameTicks and $3F) = 0 then
       
  2906 		AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0)
       
  2907 end;