hedgewars/GSHandlers.inc
changeset 4262 154253f77b03
parent 4260 472fd2fc1f31
child 4265 039b08012887
equal deleted inserted replaced
4260:472fd2fc1f31 4262:154253f77b03
  3051             end
  3051             end
  3052         end;
  3052         end;
  3053 
  3053 
  3054     // erases them all at once :-/
  3054     // erases them all at once :-/
  3055     if (Gear^.Timer <> 0) and (GameTicks - Gear^.Timer > 250) then
  3055     if (Gear^.Timer <> 0) and (GameTicks - Gear^.Timer > 250) then
  3056     begin
  3056         begin
  3057         Gear^.Timer := 0;
  3057         Gear^.Timer := 0;
  3058         Gear^.MsgParam := 0
  3058         Gear^.MsgParam := 0
  3059     end;
  3059         end;
  3060 
  3060 
  3061     if Gear^.Health < 0 then Gear^.Health := 0;
  3061     if Gear^.Health < 0 then Gear^.Health := 0;
  3062     i:= Gear^.Health div 20;
  3062     i:= Gear^.Health div 20;
  3063     if i <> Gear^.Damage then
  3063     if (i <> Gear^.Damage) and ((GameTicks and $3F) = 0) then
  3064         begin
  3064         begin
  3065         Gear^.Damage:= i;
  3065         Gear^.Damage:= i;
  3066         //AddCaption('Fuel: '+inttostr(round(Gear^.Health/20))+'%', cWhiteColor, capgrpAmmostate);
  3066         //AddCaption('Fuel: '+inttostr(round(Gear^.Health/20))+'%', cWhiteColor, capgrpAmmostate);
  3067         if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
  3067         if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
  3068         Gear^.Tex := RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(i) +
  3068         Gear^.Tex := RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(i) +
  4044         AfterAttack
  4044         AfterAttack
  4045         end
  4045         end
  4046     else
  4046     else
  4047         begin
  4047         begin
  4048         i:= Gear^.Health div 5;
  4048         i:= Gear^.Health div 5;
  4049         if i <> Gear^.Damage then
  4049         if (i <> Gear^.Damage) and ((GameTicks and $3F) = 0) then
  4050             begin
  4050             begin
  4051             Gear^.Damage:= i;
  4051             Gear^.Damage:= i;
  4052             if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
  4052             if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);
  4053             Gear^.Tex := RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(i) +
  4053             Gear^.Tex := RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(i) +
  4054                          '%', cWhiteColor, fntSmall)
  4054                          '%', cWhiteColor, fntSmall)