hedgewars/uGearsRender.pas
branchicegun
changeset 8557 18330b24b92c
parent 8554 84a279d0556c
child 8560 134a098235fa
equal deleted inserted replaced
8554:84a279d0556c 8557:18330b24b92c
   209     sign, hx, hy, tx, ty, sx, sy, m: LongInt;  // hedgehog, crosshair, temp, sprite, direction
   209     sign, hx, hy, tx, ty, sx, sy, m: LongInt;  // hedgehog, crosshair, temp, sprite, direction
   210     dx, dy, ax, ay, aAngle, dAngle, hAngle, lx, ly: real;  // laser, change
   210     dx, dy, ax, ay, aAngle, dAngle, hAngle, lx, ly: real;  // laser, change
   211     defaultPos, HatVisible: boolean;
   211     defaultPos, HatVisible: boolean;
   212     HH: PHedgehog;
   212     HH: PHedgehog;
   213     CurWeapon: PAmmo;
   213     CurWeapon: PAmmo;
       
   214     iceOffset:Longint;
       
   215     r:TSDL_Rect;
   214 begin
   216 begin
   215     HH:= Gear^.Hedgehog;
   217     HH:= Gear^.Hedgehog;
   216     if HH^.Unplaced then
   218     if HH^.Unplaced then
   217         exit;
   219         exit;
   218     m:= 1;
   220     m:= 1;
   244         begin
   246         begin
   245         Tint($00, $FF, $40, $40);
   247         Tint($00, $FF, $40, $40);
   246         DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 2, 0, 0, sx, sy, 0, 1, 22, 22, (RealTicks shr 36) mod 360);
   248         DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 2, 0, 0, sx, sy, 0, 1, 22, 22, (RealTicks shr 36) mod 360);
   247         Tint($FF, $FF, $FF, $FF)
   249         Tint($FF, $FF, $FF, $FF)
   248         end;
   250         end;
       
   251 
   249 
   252 
   250     if ((Gear^.State and gstWinner) <> 0) and
   253     if ((Gear^.State and gstWinner) <> 0) and
   251     ((CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtPickHammer)) then
   254     ((CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtPickHammer)) then
   252         begin
   255         begin
   253         DrawHedgehog(sx, sy,
   256         DrawHedgehog(sx, sy,
   915     if Gear^.Invulnerable then
   918     if Gear^.Invulnerable then
   916         begin
   919         begin
   917         Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - ((RealTicks div 2 + Gear^.uid * 491) mod 1500) / 750))));
   920         Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - ((RealTicks div 2 + Gear^.uid * 491) mod 1500) / 750))));
   918         DrawSprite(sprInvulnerable, sx - 24, sy - 24, 0);
   921         DrawSprite(sprInvulnerable, sx - 24, sy - 24, 0);
   919         end;
   922         end;
       
   923 
       
   924     if HH^.Effects[heFrozen] <> 0 then
       
   925         begin
       
   926        /// Tint($00, $FF, $40, $40);
       
   927         iceOffset := trunc(HH^.Effects[heFrozen] / 256 * 64);
       
   928         Tint($FF, $FF, $FF, $FF);        
       
   929         r.x := 0;
       
   930         r.y := 64 - iceOffset;
       
   931         r.w := 64;
       
   932         r.h := iceOffset;
       
   933         DrawTextureFromRect(sx-32, sy-iceoffset+32, @r, SpritesData[sprFrozenHog].texture);
       
   934 
       
   935         Tint($FF, $FF, $FF, $FF);
       
   936         end;
       
   937 
       
   938 
   920     if cVampiric and
   939     if cVampiric and
   921     (CurrentHedgehog^.Gear <> nil) and
   940     (CurrentHedgehog^.Gear <> nil) and
   922     (CurrentHedgehog^.Gear = Gear) then
   941     (CurrentHedgehog^.Gear = Gear) then
   923         begin
   942         begin
   924         Tint($FF, 0, 0, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750))));
   943         Tint($FF, 0, 0, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750))));