hedgewars/uGearsHandlersMess.pas
changeset 14749 533ac9774279
parent 14748 2ad6f0555e61
child 14750 ab7bf5036314
equal deleted inserted replaced
14748:2ad6f0555e61 14749:533ac9774279
  2389     if (Gear^.Health > 0) and ((Gear^.Health * 100 div cBarrelHealth) < random(90)) and ((GameTicks and $FF) = 0) then
  2389     if (Gear^.Health > 0) and ((Gear^.Health * 100 div cBarrelHealth) < random(90)) and ((GameTicks and $FF) = 0) then
  2390         if (cBarrelHealth div Gear^.Health) > 2 then
  2390         if (cBarrelHealth div Gear^.Health) > 2 then
  2391             AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmoke)
  2391             AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmoke)
  2392     else
  2392     else
  2393         AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmokeWhite);
  2393         AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmokeWhite);
       
  2394     // health texture
       
  2395     FreeAndNilTexture(Gear^.Tex);
       
  2396     Gear^.Tex := RenderStringTex(ansistring(inttostr(Gear^.Health)), $ff808080, fnt16);
  2394     dec(Gear^.Health, Gear^.Damage);
  2397     dec(Gear^.Health, Gear^.Damage);
  2395     Gear^.Damage := 0;
  2398     Gear^.Damage := 0;
  2396     if Gear^.Health <= 0 then
  2399     if Gear^.Health <= 0 then
  2397         doStepCase(Gear);
  2400         doStepCase(Gear);
  2398 end;
  2401 end;
  2463                 AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmoke)
  2466                 AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmoke)
  2464             else
  2467             else
  2465                 AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmokeWhite);
  2468                 AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmokeWhite);
  2466         dec(Gear^.Health, Gear^.Damage);
  2469         dec(Gear^.Health, Gear^.Damage);
  2467         Gear^.Damage := 0;
  2470         Gear^.Damage := 0;
       
  2471         // health texture
       
  2472         FreeAndNilTexture(Gear^.Tex);
       
  2473         Gear^.Tex := RenderStringTex(ansistring(inttostr(Gear^.Health)), $ff808080, fnt16);
  2468         end
  2474         end
  2469     else
  2475     else
  2470         begin
  2476         begin
       
  2477         // health texture for health crate
       
  2478         if (k = gtCase) and ((Gear^.Pos and $02) <> 0) then
       
  2479             begin
       
  2480             FreeAndNilTexture(Gear^.Tex);
       
  2481             if ((Gear^.State and gstFrozen) = 0) then
       
  2482                 Gear^.Tex := RenderStringTex(ansistring(inttostr(Gear^.Health)), $ff80ff80, fnt16);
       
  2483             end;
  2471         if Gear^.Timer = 500 then
  2484         if Gear^.Timer = 500 then
  2472             begin
  2485             begin
  2473 (* Can't make sparkles team coloured without working out what the next team is going to be. This should be solved, really, since it also screws up
  2486 (* Can't make sparkles team coloured without working out what the next team is going to be. This should be solved, really, since it also screws up
  2474    voices. Reinforcements voices is heard for active team, not team-to-be.  Either that or change crate spawn from end of turn to start, although that
  2487    voices. Reinforcements voices is heard for active team, not team-to-be.  Either that or change crate spawn from end of turn to start, although that
  2475    has its own complexities. *)
  2488    has its own complexities. *)