hedgewars/GSHandlers.inc
changeset 7396 7c0e07c23aad
parent 7395 d0d38cd0d27c
child 7399 e7ce559d8c94
equal deleted inserted replaced
7395:d0d38cd0d27c 7396:7c0e07c23aad
  2079 
  2079 
  2080 end;
  2080 end;
  2081 
  2081 
  2082 procedure doStepCase(Gear: PGear);
  2082 procedure doStepCase(Gear: PGear);
  2083 var 
  2083 var 
  2084     i, x, y: LongInt;
  2084     i, x, y, rx, ry: LongInt;
  2085     k: TGearType;
  2085     k: TGearType;
  2086     exBoom: boolean;
  2086     exBoom: boolean;
  2087     dX, dY: HWFloat;
  2087     dX, dY, rdx, rdy: HWFloat;
  2088     hog: PHedgehog;
  2088     hog: PHedgehog;
  2089     sparkles: PVisualGear;
  2089     sparkles: PVisualGear;
  2090 begin
  2090 begin
  2091     k := Gear^.Kind;
  2091     k := Gear^.Kind;
  2092     exBoom := false;
  2092     exBoom := false;
  2119         if Gear^.Health <= 0 then
  2119         if Gear^.Health <= 0 then
  2120             exBoom := true;
  2120             exBoom := true;
  2121         end
  2121         end
  2122     else
  2122     else
  2123         begin 
  2123         begin 
       
  2124         if (Gear^.Pos <> posCaseHealth) and (GameTicks and $3FF = 0) then
       
  2125             begin
       
  2126             for i:= 0 to GetRandom(3) do
       
  2127                 begin
       
  2128                 rx:= GetRandom(rightX-leftX)+leftX;
       
  2129                 ry:= GetRandom(LAND_HEIGHT-topY)+topY;
       
  2130                 rdx:= _90-(GetRandomf*_360);
       
  2131                 rdy:= _90-(GetRandomf*_360);
       
  2132                 AddGear(rx, ry, gtGenericFaller, gstInvisible, rdx, rdy, GetRandom(1000)+1000)
       
  2133                 end;
       
  2134             end;
       
  2135 
  2124         if Gear^.Timer = 500 then
  2136         if Gear^.Timer = 500 then
  2125             begin
  2137             begin
  2126 (* 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
  2138 (* 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
  2127    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
  2139    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
  2128    has its own complexities. *)
  2140    has its own complexities. *)