hedgewars/GSHandlers.inc
changeset 7066 12cc2bd84b0b
parent 7062 7efe16575779
child 7068 b1b7eb9c8cc9
equal deleted inserted replaced
7065:e80e0d3273c5 7066:12cc2bd84b0b
   464             if glass <> nil then
   464             if glass <> nil then
   465                 with glass^ do
   465                 with glass^ do
   466                     begin
   466                     begin
   467                     Frame:= 2;
   467                     Frame:= 2;
   468                     Tint:= $41B83ED0 - i * $10081000;
   468                     Tint:= $41B83ED0 - i * $10081000;
   469                     Angle:= random * 360;
   469                     Angle:= random(360);
   470                     dx:= 0.0000001;
   470                     dx:= 0.0000001;
   471                     dy:= 0;
   471                     dy:= 0;
   472                     if random(2) = 0 then
   472                     if random(2) = 0 then
   473                         dx := -dx;
   473                         dx := -dx;
   474                     FrameTicks:= 750;
   474                     FrameTicks:= 750;
  1088     if not cLaserSighting then
  1088     if not cLaserSighting then
  1089         // game does not have default laser sight. turn it on and give them a chance to aim
  1089         // game does not have default laser sight. turn it on and give them a chance to aim
  1090         begin
  1090         begin
  1091         cLaserSighting := true;
  1091         cLaserSighting := true;
  1092         HHGear^.Message := 0;
  1092         HHGear^.Message := 0;
  1093         if (HHGear^.Angle - 32 >= 0) then
  1093         if (HHGear^.Angle >= 32) then
  1094             dec(HHGear^.Angle,32)
  1094             dec(HHGear^.Angle,32)
  1095         end;
  1095         end;
  1096 
  1096 
  1097     if (HHGear^.Message and gmAttack) <> 0 then
  1097     if (HHGear^.Message and gmAttack) <> 0 then
  1098         begin
  1098         begin
  1118                 begin
  1118                 begin
  1119                 if (HHGear^.Angle + 1 <= cMaxAngle) then
  1119                 if (HHGear^.Angle + 1 <= cMaxAngle) then
  1120                     inc(HHGear^.Angle)
  1120                     inc(HHGear^.Angle)
  1121                 end
  1121                 end
  1122     else
  1122     else
  1123         if (HHGear^.Angle - 1 >= 0) then
  1123         if (HHGear^.Angle >= 1) then
  1124             dec(HHGear^.Angle);
  1124             dec(HHGear^.Angle);
  1125 
  1125 
  1126     if (TurnTimeLeft > 0) then
  1126     if (TurnTimeLeft > 0) then
  1127         dec(TurnTimeLeft)
  1127         dec(TurnTimeLeft)
  1128     else
  1128     else
  2836         begin
  2836         begin
  2837         sparkles:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1);
  2837         sparkles:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1);
  2838         if sparkles <> nil then
  2838         if sparkles <> nil then
  2839             begin
  2839             begin
  2840             sparkles^.Tint:= ((random(210)+45) shl 24) or ((random(210)+45) shl 16) or ((random(210)+45) shl 8) or $FF;
  2840             sparkles^.Tint:= ((random(210)+45) shl 24) or ((random(210)+45) shl 16) or ((random(210)+45) shl 8) or $FF;
  2841             sparkles^.Angle:= random * 360;
  2841             sparkles^.Angle:= random(360);
  2842             end
  2842             end
  2843         end;
  2843         end;
  2844 
  2844 
  2845     i := 2;
  2845     i := 2;
  2846     repeat
  2846     repeat
  2891                 sparkles:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtStraightShot);
  2891                 sparkles:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtStraightShot);
  2892                 if sparkles <> nil then
  2892                 if sparkles <> nil then
  2893                     with sparkles^ do
  2893                     with sparkles^ do
  2894                         begin
  2894                         begin
  2895                         Tint:= ((random(210)+45) shl 24) or ((random(210)+45) shl 16) or ((random(210)+45) shl 8) or $FF;
  2895                         Tint:= ((random(210)+45) shl 24) or ((random(210)+45) shl 16) or ((random(210)+45) shl 8) or $FF;
  2896                         Angle:= random * 360;
  2896                         Angle:= random(360);
  2897                         dx:= 0.001 * (random(200));
  2897                         dx:= 0.001 * (random(200));
  2898                         dy:= 0.001 * (random(200));
  2898                         dy:= 0.001 * (random(200));
  2899                         if random(2) = 0 then
  2899                         if random(2) = 0 then
  2900                             dx := -dx;
  2900                             dx := -dx;
  2901                         if random(2) = 0 then
  2901                         if random(2) = 0 then
  4557         doMakeExplosion(hwRound(Gear^.X) - 30 - r0, hwRound(Gear^.Y) + 40, 40 + r1, Gear^.Hedgehog, 0);
  4557         doMakeExplosion(hwRound(Gear^.X) - 30 - r0, hwRound(Gear^.Y) + 40, 40 + r1, Gear^.Hedgehog, 0);
  4558         doMakeExplosion(hwRound(Gear^.X) + 30 + r1, hwRound(Gear^.Y) + 40, 40 + r0, Gear^.Hedgehog, 0);
  4558         doMakeExplosion(hwRound(Gear^.X) + 30 + r1, hwRound(Gear^.Y) + 40, 40 + r0, Gear^.Hedgehog, 0);
  4559         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 80 + r0, Gear^.Hedgehog, EXPLAutoSound);
  4559         doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 80 + r0, Gear^.Hedgehog, EXPLAutoSound);
  4560         for r0:= 0 to 4 do
  4560         for r0:= 0 to 4 do
  4561             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
  4561             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
  4562         Gear^.dY := odY * -1 + cGravity * 2;
  4562         Gear^.dY := cGravity * 2 - odY;
  4563         Gear^.Pos := Gear^.Pos + 1;
  4563         Gear^.Pos := Gear^.Pos + 1;
  4564         end
  4564         end
  4565     else
  4565     else
  4566         Gear^.dY := Gear^.dY + cGravity * 2;
  4566         Gear^.dY := Gear^.dY + cGravity * 2;
  4567     // let it fall faster so itdoesn't take too long for the whole attack
  4567     // let it fall faster so itdoesn't take too long for the whole attack