hedgewars/GSHandlers.inc
changeset 7426 55b49cc1f33a
parent 7416 2f2f78fc65a3
child 7468 1333ca7554dc
equal deleted inserted replaced
7423:ec8f690f3e0f 7426:55b49cc1f33a
  2404                 else if ((GameTicks and $3) = 3) then
  2404                 else if ((GameTicks and $3) = 3) then
  2405                     doMakeExplosion(gX, gY, 8, Gear^.Hedgehog, 0);//, EXPLNoDamage); 
  2405                     doMakeExplosion(gX, gY, 8, Gear^.Hedgehog, 0);//, EXPLNoDamage); 
  2406                 //DrawExplosion(gX, gY, 4);
  2406                 //DrawExplosion(gX, gY, 4);
  2407                 
  2407                 
  2408                 if ((GameTicks and $7) = 0) and (Random(2) = 0) then
  2408                 if ((GameTicks and $7) = 0) and (Random(2) = 0) then
  2409                     for i:= 1 to Random(2)+1 do
  2409                     for i:= Random(2) downto 0 do
  2410                         AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
  2410                         AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
  2411                         
  2411                         
  2412                 if Gear^.Health > 0 then
  2412                 if Gear^.Health > 0 then
  2413                     dec(Gear^.Health);
  2413                     dec(Gear^.Health);
  2414                 Gear^.Timer := 450 - Gear^.Tag * 8
  2414                 Gear^.Timer := 450 - Gear^.Tag * 8
  2418                 // Modified fire
  2418                 // Modified fire
  2419                 if ((GameTicks and $7FF) = 0) and ((GameFlags and gfSolidLand) = 0) then
  2419                 if ((GameTicks and $7FF) = 0) and ((GameFlags and gfSolidLand) = 0) then
  2420                     begin
  2420                     begin
  2421                     DrawExplosion(gX, gY, 4);
  2421                     DrawExplosion(gX, gY, 4);
  2422 
  2422 
  2423                     for i:= 0 to Random(3) do
  2423                     for i:= Random(3) downto 0 do
  2424                         AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
  2424                         AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
  2425                     end;
  2425                     end;
  2426 
  2426 
  2427 // This one is interesting.  I think I understand the purpose, but I wonder if a bit more fuzzy of kicking could be done with getrandom.
  2427 // This one is interesting.  I think I understand the purpose, but I wonder if a bit more fuzzy of kicking could be done with getrandom.
  2428                 Gear^.Timer := 100 - Gear^.Tag * 3;
  2428                 Gear^.Timer := 100 - Gear^.Tag * 3;
  2436         gX := hwRound(Gear^.X);
  2436         gX := hwRound(Gear^.X);
  2437         gY := hwRound(Gear^.Y);
  2437         gY := hwRound(Gear^.Y);
  2438         if not sticky then
  2438         if not sticky then
  2439             begin
  2439             begin
  2440             if ((GameTicks and $3) = 0) and (Random(1) = 0) then
  2440             if ((GameTicks and $3) = 0) and (Random(1) = 0) then
  2441                 begin
  2441                 for i:= Random(2) downto 0 do
  2442                 for i:= 1 to Random(2)+1 do
       
  2443                     begin
       
  2444                     AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
  2442                     AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
  2445                     end;
       
  2446                 end;
       
  2447             end
  2443             end
  2448         else
  2444         else
  2449             begin
  2445             for i:= Random(3) downto 0 do
  2450             for i:= 0 to Random(3) do
       
  2451                 begin
       
  2452                 AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
  2446                 AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke);
  2453                 end;
       
  2454             end;
       
  2455 
  2447 
  2456         DeleteGear(Gear)
  2448         DeleteGear(Gear)
  2457         end;
  2449         end;
  2458 end;
  2450 end;
  2459 
  2451 
  4396         begin
  4388         begin
  4397         Gear^.State := Gear^.State or gstCollision;
  4389         Gear^.State := Gear^.State or gstCollision;
  4398         Gear^.State := Gear^.State and (not gstMoving);
  4390         Gear^.State := Gear^.State and (not gstMoving);
  4399         
  4391         
  4400         if (Land[y, x] and lfBouncy <> 0)
  4392         if (Land[y, x] and lfBouncy <> 0)
  4401         or not CalcSlopeTangent(Gear, x, y, tx, ty, 255)
  4393         or (not CalcSlopeTangent(Gear, x, y, tx, ty, 255))
  4402         or (DistanceI(tx,ty) < _12) then // reject shots at too irregular terrain
  4394         or (DistanceI(tx,ty) < _12) then // reject shots at too irregular terrain
  4403             begin
  4395             begin
  4404             loadNewPortalBall(Gear, true);
  4396             loadNewPortalBall(Gear, true);
  4405             EXIT;
  4397             EXIT;
  4406             end;
  4398             end;