hedgewars/GSHandlers.inc
changeset 5415 94e26612e2ec
parent 5413 6786f672d30b
child 5417 c56a6be662bf
equal deleted inserted replaced
5413:6786f672d30b 5415:94e26612e2ec
   498     begin
   498     begin
   499         PlaySound(sndMolotov);
   499         PlaySound(sndMolotov);
   500         gX := hwRound(Gear^.X);
   500         gX := hwRound(Gear^.X);
   501         gY := hwRound(Gear^.Y);
   501         gY := hwRound(Gear^.Y);
   502         //doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 5, EXPLAutoSound);
   502         //doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 5, EXPLAutoSound);
   503         for i:= 0 to 20 do
   503         for i:= 0 to 24 do
   504         begin
   504         begin
   505             dX := AngleCos(i * 2) * ((_0_1*(i div 5))) * (GetRandom + _1);
   505             dX := AngleCos(i * 2) * ((_0_15*(i div 5))) * (GetRandom + _1);
   506             dY := AngleSin(i * 8) * _0_5 * (GetRandom + _1);
   506             dY := AngleSin(i * 8) * _0_5 * (GetRandom + _1);
   507             Fire := AddGear(gX, gY, gtFlame, 0, dX, dY, 0);
   507             Fire := AddGear(gX, gY, gtFlame, 0, dX, dY, 0);
   508             Fire^.State := Fire^.State or gsttmpFlag;
   508             Fire^.State := Fire^.State or gsttmpFlag;
   509             Fire := AddGear(gX, gY, gtFlame, 0, dX, -dY, 0);
   509             Fire := AddGear(gX, gY, gtFlame, 0, dX, -dY, 0);
   510             Fire^.State := Fire^.State or gsttmpFlag;
   510             Fire^.State := Fire^.State or gsttmpFlag;
  2112 procedure doStepFlame(Gear: PGear);
  2112 procedure doStepFlame(Gear: PGear);
  2113 var 
  2113 var 
  2114     gX,gY,i: LongInt;
  2114     gX,gY,i: LongInt;
  2115     sticky: Boolean;
  2115     sticky: Boolean;
  2116     vgt: PVisualGear;
  2116     vgt: PVisualGear;
       
  2117     tdX,tdY: HWFloat;
  2117 begin
  2118 begin
  2118     sticky:= (Gear^.State and gsttmpFlag) <> 0;
  2119     sticky:= (Gear^.State and gsttmpFlag) <> 0;
  2119     if not sticky then AllInactive := false;
  2120     if not sticky then AllInactive := false;
  2120 
  2121 
  2121     if not TestCollisionYwithGear(Gear, 1) then
  2122     if not TestCollisionYwithGear(Gear, 1) then
  2157     else
  2158     else
  2158     begin
  2159     begin
  2159         if sticky then
  2160         if sticky then
  2160             begin
  2161             begin
  2161             Gear^.Radius := 7;
  2162             Gear^.Radius := 7;
  2162             AmmoShove(Gear, 2, 30);
  2163             tdX:= Gear^.dX;
       
  2164             tdY:= Gear^.dY;
       
  2165             Gear^.dX.QWordValue:= 214748365;
       
  2166             Gear^.dY.QWordValue:= 429496730;
       
  2167             Gear^.dX.isNegative:= getrandom(2)<>1;
       
  2168             Gear^.dY.isNegative:= true;
       
  2169             AmmoShove(Gear, 2, 125);
       
  2170             Gear^.dX:= tdX;
       
  2171             Gear^.dY:= tdY;
  2163             Gear^.Radius := 1
  2172             Gear^.Radius := 1
  2164             end;
  2173             end;
  2165         if Gear^.Timer > 0 then
  2174         if Gear^.Timer > 0 then
  2166             begin
  2175             begin
  2167             dec(Gear^.Timer);
  2176             dec(Gear^.Timer);
  2175             if not sticky then
  2184             if not sticky then
  2176                 begin
  2185                 begin
  2177                 if ((GameTicks and $1) = 0) then
  2186                 if ((GameTicks and $1) = 0) then
  2178                     begin
  2187                     begin
  2179                     Gear^.Radius := 7;
  2188                     Gear^.Radius := 7;
  2180                     AmmoShove(Gear, 4, 150);
  2189                     tdX:= Gear^.dX;
       
  2190                     tdY:= Gear^.dY;
       
  2191                     Gear^.dX.QWordValue:= 214748365;
       
  2192                     Gear^.dY.QWordValue:= 429496730;
       
  2193                     Gear^.dX.isNegative:= getrandom(2)<>1;
       
  2194                     Gear^.dY.isNegative:= true;
       
  2195                     AmmoShove(Gear, 6, 100);
       
  2196                     Gear^.dX:= tdX;
       
  2197                     Gear^.dY:= tdY;
  2181                     Gear^.Radius := 1;
  2198                     Gear^.Radius := 1;
  2182                     end
  2199                     end
  2183                 else if ((GameTicks and $3) = 3) then doMakeExplosion(gX, gY, 6, Gear^.Hedgehog, 0);//, EXPLNoDamage); 
  2200                 else if ((GameTicks and $3) = 3) then doMakeExplosion(gX, gY, 8, Gear^.Hedgehog, 0);//, EXPLNoDamage); 
  2184                 //DrawExplosion(gX, gY, 4);
  2201                 //DrawExplosion(gX, gY, 4);
  2185                 if ((GameTicks and $7) = 0) and (Random(2) = 0) then
  2202                 if ((GameTicks and $7) = 0) and (Random(2) = 0) then
  2186                     for i:= 1 to Random(2)+1 do
  2203                     for i:= 1 to Random(2)+1 do
  2187                         AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
  2204                         AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
  2188                 if Gear^.Health > 0 then dec(Gear^.Health);
  2205                 if Gear^.Health > 0 then dec(Gear^.Health);