213 //if _0_6 < Gear^.dY then |
213 //if _0_6 < Gear^.dY then |
214 // PlaySound(sndOw4, Gear^.Hedgehog^.Team^.voicepack) |
214 // PlaySound(sndOw4, Gear^.Hedgehog^.Team^.voicepack) |
215 //else |
215 //else |
216 // PlaySound(sndOw1, Gear^.Hedgehog^.Team^.voicepack); |
216 // PlaySound(sndOw1, Gear^.Hedgehog^.Team^.voicepack); |
217 |
217 |
218 ApplyDamage(Gear, CurrentHedgehog^.Gear, dmg, dsFall); |
218 ApplyDamage(Gear, CurrentHedgehog, dmg, dsFall); |
219 end |
219 end |
220 end; |
220 end; |
221 |
221 |
222 //////////////////////////////////////////////////////////////////////////////// |
222 //////////////////////////////////////////////////////////////////////////////// |
223 //////////////////////////////////////////////////////////////////////////////// |
223 //////////////////////////////////////////////////////////////////////////////// |
373 |
373 |
374 if (Gear^.Kind = gtBall) and ((Gear^.State and gstTmpFlag) <> 0) then |
374 if (Gear^.Kind = gtBall) and ((Gear^.State and gstTmpFlag) <> 0) then |
375 begin |
375 begin |
376 CheckCollision(Gear); |
376 CheckCollision(Gear); |
377 if (Gear^.State and gstCollision) <> 0 then |
377 if (Gear^.State and gstCollision) <> 0 then |
378 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, Gear, EXPLDontDraw or EXPLNoGfx); |
378 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, Gear^.Hedgehog, EXPLDontDraw or EXPLNoGfx); |
379 end; |
379 end; |
380 |
380 |
381 if (Gear^.Kind = gtGasBomb) and ((GameTicks mod 200) = 0) then |
381 if (Gear^.Kind = gtGasBomb) and ((GameTicks mod 200) = 0) then |
382 begin |
382 begin |
383 vg:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeWhite); |
383 vg:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeWhite); |
386 end; |
386 end; |
387 |
387 |
388 if Gear^.Timer = 0 then |
388 if Gear^.Timer = 0 then |
389 begin |
389 begin |
390 case Gear^.Kind of |
390 case Gear^.Kind of |
391 gtBomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear, EXPLAutoSound); |
391 gtBomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound); |
392 gtBall: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 40, Gear, EXPLAutoSound); |
392 gtBall: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 40, Gear^.Hedgehog, EXPLAutoSound); |
393 gtClusterBomb: |
393 gtClusterBomb: |
394 begin |
394 begin |
395 x := hwRound(Gear^.X); |
395 x := hwRound(Gear^.X); |
396 y := hwRound(Gear^.Y); |
396 y := hwRound(Gear^.Y); |
397 doMakeExplosion(x, y, 20, Gear, EXPLAutoSound); |
397 doMakeExplosion(x, y, 20, Gear^.Hedgehog, EXPLAutoSound); |
398 for i:= 0 to 4 do |
398 for i:= 0 to 4 do |
399 begin |
399 begin |
400 dX := rndSign(GetRandom * _0_1) + Gear^.dX / 5; |
400 dX := rndSign(GetRandom * _0_1) + Gear^.dX / 5; |
401 dY := (GetRandom - _3) * _0_08; |
401 dY := (GetRandom - _3) * _0_08; |
402 AddGear(x, y, gtCluster, 0, dX, dY, 25); |
402 AddGear(x, y, gtCluster, 0, dX, dY, 25); |
404 end; |
404 end; |
405 gtWatermelon: |
405 gtWatermelon: |
406 begin |
406 begin |
407 x := hwRound(Gear^.X); |
407 x := hwRound(Gear^.X); |
408 y := hwRound(Gear^.Y); |
408 y := hwRound(Gear^.Y); |
409 doMakeExplosion(x, y, 75, Gear, EXPLAutoSound); |
409 doMakeExplosion(x, y, 75, Gear^.Hedgehog, EXPLAutoSound); |
410 for i:= 0 to 5 do |
410 for i:= 0 to 5 do |
411 begin |
411 begin |
412 dX := rndSign(GetRandom * _0_1) + Gear^.dX / 5; |
412 dX := rndSign(GetRandom * _0_1) + Gear^.dX / 5; |
413 dY := (GetRandom - _1_5) * _0_3; |
413 dY := (GetRandom - _1_5) * _0_3; |
414 AddGear(x, y, gtMelonPiece, 0, dX, dY, 75)^.DirAngle := i * 60; |
414 AddGear(x, y, gtMelonPiece, 0, dX, dY, 75)^.DirAngle := i * 60; |
416 end; |
416 end; |
417 gtHellishBomb: |
417 gtHellishBomb: |
418 begin |
418 begin |
419 x := hwRound(Gear^.X); |
419 x := hwRound(Gear^.X); |
420 y := hwRound(Gear^.Y); |
420 y := hwRound(Gear^.Y); |
421 doMakeExplosion(x, y, 90, Gear, EXPLAutoSound); |
421 doMakeExplosion(x, y, 90, Gear^.Hedgehog, EXPLAutoSound); |
422 |
422 |
423 for i:= 0 to 127 do |
423 for i:= 0 to 127 do |
424 begin |
424 begin |
425 dX := AngleCos(i * 16) * _0_5 * (GetRandom + _1); |
425 dX := AngleCos(i * 16) * _0_5 * (GetRandom + _1); |
426 dY := AngleSin(i * 16) * _0_5 * (GetRandom + _1); |
426 dY := AngleSin(i * 16) * _0_5 * (GetRandom + _1); |
430 if i mod 2 <> 0 then Fire^.State := Fire^.State or gsttmpFlag; |
430 if i mod 2 <> 0 then Fire^.State := Fire^.State or gsttmpFlag; |
431 end |
431 end |
432 end; |
432 end; |
433 gtGasBomb: |
433 gtGasBomb: |
434 begin |
434 begin |
435 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, Gear, EXPLAutoSound); |
435 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, Gear^.Hedgehog, EXPLAutoSound); |
436 for i:= 0 to 2 do |
436 for i:= 0 to 2 do |
437 begin |
437 begin |
438 x:= GetRandom(60); |
438 x:= GetRandom(60); |
439 y:= GetRandom(40); |
439 y:= GetRandom(40); |
440 AddGear(hwRound(Gear^.X) - 30 + x, hwRound(Gear^.Y) - 20 + y, gtPoisonCloud, 0, _0, _0, 0); |
440 AddGear(hwRound(Gear^.X) - 30 + x, hwRound(Gear^.Y) - 20 + y, gtPoisonCloud, 0, _0, _0, 0); |
507 begin |
507 begin |
508 AllInactive := false; |
508 AllInactive := false; |
509 doStepFallingGear(Gear); |
509 doStepFallingGear(Gear); |
510 if (Gear^.State and gstCollision) <> 0 then |
510 if (Gear^.State and gstCollision) <> 0 then |
511 begin |
511 begin |
512 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), Gear^.Timer, Gear, EXPLAutoSound); |
512 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), Gear^.Timer, Gear^.Hedgehog, EXPLAutoSound); |
513 DeleteGear(Gear); |
513 DeleteGear(Gear); |
514 exit |
514 exit |
515 end; |
515 end; |
516 |
516 |
517 if (Gear^.Kind = gtMelonPiece) or (Gear^.Kind = gtBall) then |
517 if (Gear^.Kind = gtMelonPiece) or (Gear^.Kind = gtBall) then |
526 AllInactive := false; |
526 AllInactive := false; |
527 if (GameFlags and gfMoreWind) = 0 then Gear^.dX := Gear^.dX + cWindSpeed; |
527 if (GameFlags and gfMoreWind) = 0 then Gear^.dX := Gear^.dX + cWindSpeed; |
528 doStepFallingGear(Gear); |
528 doStepFallingGear(Gear); |
529 if (Gear^.State and gstCollision) <> 0 then |
529 if (Gear^.State and gstCollision) <> 0 then |
530 begin |
530 begin |
531 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear, EXPLAutoSound); |
531 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound); |
532 DeleteGear(Gear); |
532 DeleteGear(Gear); |
533 exit |
533 exit |
534 end; |
534 end; |
535 if (GameTicks and $3F) = 0 then |
535 if (GameTicks and $3F) = 0 then |
536 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace); |
536 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace); |
764 CheckCollision(Gear); |
764 CheckCollision(Gear); |
765 dec(Gear^.Timer); |
765 dec(Gear^.Timer); |
766 if ((Gear^.State and gstCollision) <> 0) or (Gear^.Timer = 0) then |
766 if ((Gear^.State and gstCollision) <> 0) or (Gear^.Timer = 0) then |
767 begin |
767 begin |
768 StopSound(Gear^.SoundChannel); |
768 StopSound(Gear^.SoundChannel); |
769 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear, EXPLAutoSound); |
769 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound); |
770 DeleteGear(Gear); |
770 DeleteGear(Gear); |
771 end; |
771 end; |
772 end; |
772 end; |
773 |
773 |
774 procedure doStepBee(Gear: PGear); |
774 procedure doStepBee(Gear: PGear); |
778 Gear^.Y := Gear^.Y + Gear^.dY; |
778 Gear^.Y := Gear^.Y + Gear^.dY; |
779 Gear^.dY := Gear^.dY + cGravity; |
779 Gear^.dY := Gear^.dY + cGravity; |
780 CheckCollision(Gear); |
780 CheckCollision(Gear); |
781 if (Gear^.State and gstCollision) <> 0 then |
781 if (Gear^.State and gstCollision) <> 0 then |
782 begin |
782 begin |
783 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear, EXPLAutoSound); |
783 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound); |
784 DeleteGear(Gear); |
784 DeleteGear(Gear); |
785 exit |
785 exit |
786 end; |
786 end; |
787 dec(Gear^.Timer); |
787 dec(Gear^.Timer); |
788 if Gear^.Timer = 0 then |
788 if Gear^.Timer = 0 then |
1081 x:= hwRound(Gear^.X); |
1081 x:= hwRound(Gear^.X); |
1082 y:= hwRound(Gear^.Y); |
1082 y:= hwRound(Gear^.Y); |
1083 if (Gear^.Timer mod 33) = 0 then |
1083 if (Gear^.Timer mod 33) = 0 then |
1084 begin |
1084 begin |
1085 HHGear^.State := HHGear^.State or gstNoDamage; |
1085 HHGear^.State := HHGear^.State or gstNoDamage; |
1086 doMakeExplosion(x, y + 7, 6, Gear, EXPLDontDraw); |
1086 doMakeExplosion(x, y + 7, 6, Gear^.Hedgehog, EXPLDontDraw); |
1087 HHGear^.State := HHGear^.State and not gstNoDamage |
1087 HHGear^.State := HHGear^.State and not gstNoDamage |
1088 end; |
1088 end; |
1089 |
1089 |
1090 if (Gear^.Timer mod 47) = 0 then |
1090 if (Gear^.Timer mod 47) = 0 then |
1091 begin |
1091 begin |
1708 begin |
1708 begin |
1709 if ((Gear^.State and gstWait) <> 0) or |
1709 if ((Gear^.State and gstWait) <> 0) or |
1710 (cMineDudPercent = 0) or |
1710 (cMineDudPercent = 0) or |
1711 (getRandom(100) > cMineDudPercent) then |
1711 (getRandom(100) > cMineDudPercent) then |
1712 begin |
1712 begin |
1713 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear, EXPLAutoSound); |
1713 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound); |
1714 DeleteGear(Gear) |
1714 DeleteGear(Gear) |
1715 end |
1715 end |
1716 else |
1716 else |
1717 begin |
1717 begin |
1718 AddVisualGear(hwRound(Gear^.X) - 4 + Random(8), hwRound(Gear^.Y) - 4 - Random(4), |
1718 AddVisualGear(hwRound(Gear^.X) - 4 + Random(8), hwRound(Gear^.Y) - 4 - Random(4), |
1759 begin |
1759 begin |
1760 AllInactive := false; |
1760 AllInactive := false; |
1761 if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick); |
1761 if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick); |
1762 if Gear^.Timer = 0 then |
1762 if Gear^.Timer = 0 then |
1763 begin |
1763 begin |
1764 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear, EXPLAutoSound); |
1764 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound); |
1765 DeleteGear(Gear); |
1765 DeleteGear(Gear); |
1766 exit |
1766 exit |
1767 end; |
1767 end; |
1768 dec(Gear^.Timer); |
1768 dec(Gear^.Timer); |
1769 end |
1769 end |
1779 if Gear^.Timer mod 166 = 0 then inc(Gear^.Tag); |
1779 if Gear^.Timer mod 166 = 0 then inc(Gear^.Tag); |
1780 if Gear^.Timer = 1000 then // might need better timing |
1780 if Gear^.Timer = 1000 then // might need better timing |
1781 makeHogsWorry(Gear^.X, Gear^.Y, 75); |
1781 makeHogsWorry(Gear^.X, Gear^.Y, 75); |
1782 if Gear^.Timer = 0 then |
1782 if Gear^.Timer = 0 then |
1783 begin |
1783 begin |
1784 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 75, Gear, EXPLAutoSound); |
1784 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 75, Gear^.Hedgehog, EXPLAutoSound); |
1785 DeleteGear(Gear); |
1785 DeleteGear(Gear); |
1786 exit |
1786 exit |
1787 end; |
1787 end; |
1788 dec(Gear^.Timer); |
1788 dec(Gear^.Timer); |
1789 end; |
1789 end; |
1908 |
1909 |
1909 if (Gear^.Damage > 0) or exBoom then |
1910 if (Gear^.Damage > 0) or exBoom then |
1910 begin |
1911 begin |
1911 x := hwRound(Gear^.X); |
1912 x := hwRound(Gear^.X); |
1912 y := hwRound(Gear^.Y); |
1913 y := hwRound(Gear^.Y); |
|
1914 hog:= Gear^.Hedgehog; |
|
1915 |
1913 DeleteGear(Gear); |
1916 DeleteGear(Gear); |
1914 // <-- delete gear! |
1917 // <-- delete gear! |
1915 |
1918 |
1916 if k = gtCase then |
1919 if k = gtCase then |
1917 begin |
1920 begin |
1918 doMakeExplosion(x, y, 25, Gear, EXPLAutoSound); |
1921 doMakeExplosion(x, y, 25, hog, EXPLAutoSound); |
1919 for i:= 0 to 63 do |
1922 for i:= 0 to 63 do |
1920 AddGear(x, y, gtFlame, 0, _0, _0, 0); |
1923 AddGear(x, y, gtFlame, 0, _0, _0, 0); |
1921 end |
1924 end |
1922 else if k = gtExplosives then |
1925 else if k = gtExplosives then |
1923 begin |
1926 begin |
1924 doMakeExplosion(x, y, 75, Gear, EXPLAutoSound); |
1927 doMakeExplosion(x, y, 75, hog, EXPLAutoSound); |
1925 for i:= 0 to 31 do |
1928 for i:= 0 to 31 do |
1926 begin |
1929 begin |
1927 dX := AngleCos(i * 64) * _0_5 * (getrandom + _1); |
1930 dX := AngleCos(i * 64) * _0_5 * (getrandom + _1); |
1928 dY := AngleSin(i * 64) * _0_5 * (getrandom + _1); |
1931 dY := AngleSin(i * 64) * _0_5 * (getrandom + _1); |
1929 AddGear(x, y, gtFlame, 0, dX, dY, 0); |
1932 AddGear(x, y, gtFlame, 0, dX, dY, 0); |
2104 begin |
2107 begin |
2105 Gear^.Radius := 7; |
2108 Gear^.Radius := 7; |
2106 AmmoShove(Gear, 4, 150); |
2109 AmmoShove(Gear, 4, 150); |
2107 Gear^.Radius := 1; |
2110 Gear^.Radius := 1; |
2108 end |
2111 end |
2109 else if ((GameTicks and $3) = 3) then doMakeExplosion(gX, gY, 6, Gear, 0);//, EXPLNoDamage); |
2112 else if ((GameTicks and $3) = 3) then doMakeExplosion(gX, gY, 6, Gear^.Hedgehog, 0);//, EXPLNoDamage); |
2110 //DrawExplosion(gX, gY, 4); |
2113 //DrawExplosion(gX, gY, 4); |
2111 if ((GameTicks and $7) = 0) and (Random(2) = 0) then |
2114 if ((GameTicks and $7) = 0) and (Random(2) = 0) then |
2112 for i:= 1 to Random(2)+1 do |
2115 for i:= 1 to Random(2)+1 do |
2113 AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke); |
2116 AddVisualGear(gX - 3 + Random(6), gY - 2, vgtSmoke); |
2114 if Gear^.Health > 0 then dec(Gear^.Health); |
2117 if Gear^.Health > 0 then dec(Gear^.Health); |
2345 begin |
2348 begin |
2346 AllInactive := false; |
2349 AllInactive := false; |
2347 doStepFallingGear(Gear); |
2350 doStepFallingGear(Gear); |
2348 if (Gear^.State and gstCollision) <> 0 then |
2351 if (Gear^.State and gstCollision) <> 0 then |
2349 begin |
2352 begin |
2350 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear, EXPLAutoSound); |
2353 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound); |
2351 DeleteGear(Gear); |
2354 DeleteGear(Gear); |
2352 performRumble(); |
2355 performRumble(); |
2353 exit |
2356 exit |
2354 end; |
2357 end; |
2355 if (GameTicks and $3F) = 0 then |
2358 if (GameTicks and $3F) = 0 then |
2544 dyn := Gear^.dY.isNegative; |
2547 dyn := Gear^.dY.isNegative; |
2545 |
2548 |
2546 doStepFallingGear(Gear); |
2549 doStepFallingGear(Gear); |
2547 if (Gear^.State and gstCollision) <> 0 then |
2550 if (Gear^.State and gstCollision) <> 0 then |
2548 begin |
2551 begin |
2549 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, Gear, EXPLAutoSound); |
2552 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, Gear^.Hedgehog, EXPLAutoSound); |
2550 |
2553 |
2551 Gear^.dX.isNegative := not dxn; |
2554 Gear^.dX.isNegative := not dxn; |
2552 Gear^.dY.isNegative := not dyn; |
2555 Gear^.dY.isNegative := not dyn; |
2553 for i:= 0 to 4 do |
2556 for i:= 0 to 4 do |
2554 begin |
2557 begin |
2674 AllInactive := false; |
2677 AllInactive := false; |
2675 |
2678 |
2676 inc(Gear^.Tag); |
2679 inc(Gear^.Tag); |
2677 if Gear^.Tag < 2250 then exit; |
2680 if Gear^.Tag < 2250 then exit; |
2678 |
2681 |
2679 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), cakeDmg, Gear, EXPLAutoSound); |
2682 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), cakeDmg, Gear^.Hedgehog, EXPLAutoSound); |
2680 AfterAttack; |
2683 AfterAttack; |
2681 DeleteGear(Gear) |
2684 DeleteGear(Gear) |
2682 end; |
2685 end; |
2683 |
2686 |
2684 procedure doStepCakeDown(Gear: PGear); |
2687 procedure doStepCakeDown(Gear: PGear); |
2967 or not CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y), lfIndestructible) then |
2970 or not CheckLandValue(hwRound(Gear^.X), hwRound(Gear^.Y), lfIndestructible) then |
2968 begin |
2971 begin |
2969 //out of time or exited ground |
2972 //out of time or exited ground |
2970 StopSound(Gear^.SoundChannel); |
2973 StopSound(Gear^.SoundChannel); |
2971 if (Gear^.State and gsttmpFlag) <> 0 then |
2974 if (Gear^.State and gsttmpFlag) <> 0 then |
2972 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear, EXPLAutoSound) |
2975 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound) |
2973 else |
2976 else |
2974 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear, EXPLAutoSound); |
2977 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound); |
2975 DeleteGear(Gear); |
2978 DeleteGear(Gear); |
2976 exit |
2979 exit |
2977 end |
2980 end |
2978 else if not TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) and not TestCollisionXWithGear(Gear, hwSign(Gear^.dX)) then |
2981 else if not TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) and not TestCollisionXWithGear(Gear, hwSign(Gear^.dX)) then |
2979 begin |
2982 begin |
3019 end |
3022 end |
3020 else |
3023 else |
3021 begin |
3024 begin |
3022 //explode right on contact with HH |
3025 //explode right on contact with HH |
3023 if (Gear^.State and gsttmpFlag) <> 0 then |
3026 if (Gear^.State and gsttmpFlag) <> 0 then |
3024 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear, EXPLAutoSound) |
3027 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, Gear^.Hedgehog, EXPLAutoSound) |
3025 else |
3028 else |
3026 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear, EXPLAutoSound); |
3029 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, Gear^.Hedgehog, EXPLAutoSound); |
3027 DeleteGear(Gear); |
3030 DeleteGear(Gear); |
3028 exit; |
3031 exit; |
3029 end; |
3032 end; |
3030 |
3033 |
3031 Gear^.SoundChannel := LoopSound(sndDrillRocket); |
3034 Gear^.SoundChannel := LoopSound(sndDrillRocket); |
3168 StopSound(sndRideOfTheValkyries); |
3171 StopSound(sndRideOfTheValkyries); |
3169 ResumeMusic; |
3172 ResumeMusic; |
3170 |
3173 |
3171 if ((Gear^.State and gstCollision) <> 0) then |
3174 if ((Gear^.State and gstCollision) <> 0) then |
3172 begin |
3175 begin |
3173 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, Gear, EXPLAutoSound); |
3176 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, Gear^.Hedgehog, EXPLAutoSound); |
3174 for i:= 0 to 32 do |
3177 for i:= 0 to 32 do |
3175 begin |
3178 begin |
3176 dX := AngleCos(i * 64) * _0_5 * (GetRandom + _1); |
3179 dX := AngleCos(i * 64) * _0_5 * (GetRandom + _1); |
3177 dY := AngleSin(i * 64) * _0_5 * (GetRandom + _1); |
3180 dY := AngleSin(i * 64) * _0_5 * (GetRandom + _1); |
3178 AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, dY, 0); |
3181 AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, dY, 0); |
3543 // CheckGearDrowning(Gear); // already checked for in doStepFallingGear |
3546 // CheckGearDrowning(Gear); // already checked for in doStepFallingGear |
3544 CalcRotationDirAngle(Gear); |
3547 CalcRotationDirAngle(Gear); |
3545 |
3548 |
3546 if (Gear^.State and gstCollision) <> 0 then |
3549 if (Gear^.State and gstCollision) <> 0 then |
3547 begin |
3550 begin |
3548 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 10, Gear, EXPLPoisoned, $C0E0FFE0); |
3551 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 10, Gear^.Hedgehog, EXPLPoisoned, $C0E0FFE0); |
3549 PlaySound(sndEggBreak); |
3552 PlaySound(sndEggBreak); |
3550 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtEgg); |
3553 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtEgg); |
3551 vg := AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtEgg); |
3554 vg := AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtEgg); |
3552 if vg <> nil then vg^.Frame := 2; |
3555 if vg <> nil then vg^.Frame := 2; |
3553 |
3556 |
4049 end |
4052 end |
4050 else if (Gear^.State and gstCollision) <> 0 then |
4053 else if (Gear^.State and gstCollision) <> 0 then |
4051 begin |
4054 begin |
4052 r0 := GetRandom(21); |
4055 r0 := GetRandom(21); |
4053 r1 := GetRandom(21); |
4056 r1 := GetRandom(21); |
4054 doMakeExplosion(hwRound(Gear^.X) - 30 - r0, hwRound(Gear^.Y) + 40, 40 + r1, Gear, 0); |
4057 doMakeExplosion(hwRound(Gear^.X) - 30 - r0, hwRound(Gear^.Y) + 40, 40 + r1, Gear^.Hedgehog, 0); |
4055 doMakeExplosion(hwRound(Gear^.X) + 30 + r1, hwRound(Gear^.Y) + 40, 40 + r0, Gear, 0); |
4058 doMakeExplosion(hwRound(Gear^.X) + 30 + r1, hwRound(Gear^.Y) + 40, 40 + r0, Gear^.Hedgehog, 0); |
4056 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 80 + r0, Gear, EXPLAutoSound); |
4059 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 80 + r0, Gear^.Hedgehog, EXPLAutoSound); |
4057 for r0:= 0 to 4 do |
4060 for r0:= 0 to 4 do |
4058 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote); |
4061 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote); |
4059 Gear^.dY := odY * -1 + cGravity * 2; |
4062 Gear^.dY := odY * -1 + cGravity * 2; |
4060 Gear^.Pos := Gear^.Pos + 1; |
4063 Gear^.Pos := Gear^.Pos + 1; |
4061 end |
4064 end |
4292 Gear^.X:= Gear^.X + Gear^.dX; |
4295 Gear^.X:= Gear^.X + Gear^.dX; |
4293 Gear^.Y:= Gear^.Y + Gear^.dY; |
4296 Gear^.Y:= Gear^.Y + Gear^.dY; |
4294 Gear^.dX := Gear^.dX + cWindSpeed / 4; |
4297 Gear^.dX := Gear^.dX + cWindSpeed / 4; |
4295 Gear^.dY := Gear^.dY + cGravity / 100; |
4298 Gear^.dY := Gear^.dY + cGravity / 100; |
4296 if (GameTicks mod 250) = 0 then |
4299 if (GameTicks mod 250) = 0 then |
4297 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, Gear, EXPLDontDraw or EXPLNoGfx or EXPLNoDamage or EXPLDoNotTouchAny or EXPLPoisoned); |
4300 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, Gear^.Hedgehog, EXPLDontDraw or EXPLNoGfx or EXPLNoDamage or EXPLDoNotTouchAny or EXPLPoisoned); |
4298 AllInactive:= false; |
4301 AllInactive:= false; |
4299 end; |
4302 end; |
4300 |
4303 |
4301 //////////////////////////////////////////////////////////////////////////////// |
4304 //////////////////////////////////////////////////////////////////////////////// |
4302 procedure doStepHammer(Gear: PGear); |
4305 procedure doStepHammer(Gear: PGear); |
4320 tmp:= t^.ar[i]; |
4323 tmp:= t^.ar[i]; |
4321 if (tmp^.State and gstNoDamage) = 0 then |
4324 if (tmp^.State and gstNoDamage) = 0 then |
4322 if (tmp^.Kind = gtHedgehog) then |
4325 if (tmp^.Kind = gtHedgehog) then |
4323 begin |
4326 begin |
4324 //tmp^.State:= tmp^.State or gstFlatened; |
4327 //tmp^.State:= tmp^.State or gstFlatened; |
4325 ApplyDamage(tmp, CurrentHedgehog^.Gear, tmp^.Health div 3, dsUnknown); |
4328 ApplyDamage(tmp, CurrentHedgehog, tmp^.Health div 3, dsUnknown); |
4326 //DrawTunnel(tmp^.X, tmp^.Y - _1, _0, _0_5, cHHRadius * 6, cHHRadius * 3); |
4329 //DrawTunnel(tmp^.X, tmp^.Y - _1, _0, _0_5, cHHRadius * 6, cHHRadius * 3); |
4327 tmp2:= AddGear(hwRound(tmp^.X), hwRound(tmp^.Y), gtHammerHit, 0, _0, _0, 0); |
4330 tmp2:= AddGear(hwRound(tmp^.X), hwRound(tmp^.Y), gtHammerHit, 0, _0, _0, 0); |
4328 tmp2^.Hedgehog:= tmp^.Hedgehog; |
4331 tmp2^.Hedgehog:= tmp^.Hedgehog; |
4329 SetAllToActive |
4332 SetAllToActive |
4330 end |
4333 end |
4543 begin |
4546 begin |
4544 AllInactive := false; |
4547 AllInactive := false; |
4545 doStepFallingGear(Gear); |
4548 doStepFallingGear(Gear); |
4546 if (Gear^.Timer > 0) and ((Gear^.State and gstCollision) <> 0) then |
4549 if (Gear^.Timer > 0) and ((Gear^.State and gstCollision) <> 0) then |
4547 begin |
4550 begin |
4548 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 10, Gear, EXPLAutoSound); |
4551 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 10, Gear^.Hedgehog, EXPLAutoSound); |
4549 gX := hwRound(Gear^.X); |
4552 gX := hwRound(Gear^.X); |
4550 gY := hwRound(Gear^.Y); |
4553 gY := hwRound(Gear^.Y); |
4551 for i:= 0 to 10 do |
4554 for i:= 0 to 10 do |
4552 begin |
4555 begin |
4553 dX := AngleCos(i * 2) * ((_0_1*(i div 5))) * (GetRandom + _1); |
4556 dX := AngleCos(i * 2) * ((_0_1*(i div 5))) * (GetRandom + _1); |
4560 DeleteGear(Gear); |
4563 DeleteGear(Gear); |
4561 exit |
4564 exit |
4562 end; |
4565 end; |
4563 if (Gear^.Timer = 0) then |
4566 if (Gear^.Timer = 0) then |
4564 begin |
4567 begin |
4565 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 10, Gear, EXPLAutoSound); |
4568 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 10, Gear^.Hedgehog, EXPLAutoSound); |
4566 for i:= -19 to 19 do |
4569 for i:= -19 to 19 do |
4567 FollowGear := AddGear(hwRound(Gear^.X) + i div 3, hwRound(Gear^.Y), gtFlame, 0, _0_001 * i, _0, 0); |
4570 FollowGear := AddGear(hwRound(Gear^.X) + i div 3, hwRound(Gear^.Y), gtFlame, 0, _0_001 * i, _0, 0); |
4568 DeleteGear(Gear); |
4571 DeleteGear(Gear); |
4569 exit |
4572 exit |
4570 end; |
4573 end; |