hedgewars/GSHandlers.inc
changeset 7186 013deb83086b
parent 7170 84ac6c6d2d8e
child 7195 9e6e8e5a4c2e
equal deleted inserted replaced
7138:f8248bcba8f1 7186:013deb83086b
   700             
   700             
   701             // Why is this here.  For one thing, there's no test on +1 being safe. 
   701             // Why is this here.  For one thing, there's no test on +1 being safe. 
   702             //Land[py, px+1]:= lfBasic;
   702             //Land[py, px+1]:= lfBasic;
   703             
   703             
   704             if allpx then
   704             if allpx then
   705                 UpdateLandTexture(xx, Pred(s^.h), yy, Pred(s^.w))
   705                 UpdateLandTexture(xx, Pred(s^.h), yy, Pred(s^.w), true)
   706             else
   706             else
   707                 begin
   707                 begin
   708                 UpdateLandTexture(
   708                 UpdateLandTexture(
   709                     max(0, min(LAND_WIDTH, xx)),
   709                     max(0, min(LAND_WIDTH, xx)),
   710                     min(LAND_WIDTH - xx, Pred(s^.w)),
   710                     min(LAND_WIDTH - xx, Pred(s^.w)),
   711                     max(0, min(LAND_WIDTH, yy)),
   711                     max(0, min(LAND_WIDTH, yy)),
   712                     min(LAND_HEIGHT - yy, Pred(s^.h))
   712                     min(LAND_HEIGHT - yy, Pred(s^.h)), false // could this be true without unnecessarily creating blanks?
   713                 );
   713                 );
   714                 end;
   714                 end;
   715 ////////////////////////////////// TODO - ASK UNC0RR FOR A GOOD HOME FOR THIS ////////////////////////////////////
   715 ////////////////////////////////// TODO - ASK UNC0RR FOR A GOOD HOME FOR THIS ////////////////////////////////////
   716             end
   716             end
   717         end;
   717         end;
  2075     i, x, y: LongInt;
  2075     i, x, y: LongInt;
  2076     k: TGearType;
  2076     k: TGearType;
  2077     exBoom: boolean;
  2077     exBoom: boolean;
  2078     dX, dY: HWFloat;
  2078     dX, dY: HWFloat;
  2079     hog: PHedgehog;
  2079     hog: PHedgehog;
       
  2080     sparkles: PVisualGear;
  2080 begin
  2081 begin
  2081     k := Gear^.Kind;
  2082     k := Gear^.Kind;
  2082     exBoom := false;
  2083     exBoom := false;
  2083 
  2084 
  2084     if (Gear^.Message and gmDestroy) > 0 then
  2085     if (Gear^.Message and gmDestroy) > 0 then
  2106             AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmokeWhite);
  2107             AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 2, vgtSmokeWhite);
  2107         dec(Gear^.Health, Gear^.Damage);
  2108         dec(Gear^.Health, Gear^.Damage);
  2108         Gear^.Damage := 0;
  2109         Gear^.Damage := 0;
  2109         if Gear^.Health <= 0 then
  2110         if Gear^.Health <= 0 then
  2110             exBoom := true;
  2111             exBoom := true;
       
  2112         end
       
  2113     else
       
  2114         begin 
       
  2115         if Gear^.Timer = 0 then
       
  2116         begin
       
  2117 (* 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
       
  2118    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
       
  2119    has its own complexities. *)
       
  2120         sparkles:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1);
       
  2121         if sparkles <> nil then
       
  2122             begin
       
  2123             sparkles^.Tint:= $FAB22CFF
       
  2124             end
       
  2125         end;
       
  2126         if (GameTicks and $1 = 0) and (Gear^.Timer < 255) then inc(Gear^.Timer)
  2111         end;
  2127         end;
  2112 
  2128 
  2113     if (Gear^.Damage > 0) or exBoom then
  2129     if (Gear^.Damage > 0) or exBoom then
  2114         begin
  2130         begin
  2115         x := hwRound(Gear^.X);
  2131         x := hwRound(Gear^.X);