316 begin |
316 begin |
317 case Gear^.Kind of |
317 case Gear^.Kind of |
318 gtAmmo_Bomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
318 gtAmmo_Bomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
319 gtBall: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 40, EXPLAutoSound); |
319 gtBall: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 40, EXPLAutoSound); |
320 gtClusterBomb: |
320 gtClusterBomb: |
321 begin |
321 begin |
322 x := hwRound(Gear^.X); |
322 x := hwRound(Gear^.X); |
323 y := hwRound(Gear^.Y); |
323 y := hwRound(Gear^.Y); |
324 doMakeExplosion(x, y, 20, EXPLAutoSound); |
324 doMakeExplosion(x, y, 20, EXPLAutoSound); |
325 for i:= 0 to 4 do |
325 for i:= 0 to 4 do |
326 begin |
326 begin |
327 dX := rndSign(GetRandom * _0_1); |
327 dX := rndSign(GetRandom * _0_1); |
328 dY := (GetRandom - _3) * _0_08; |
328 dY := (GetRandom - _3) * _0_08; |
329 AddGear(x, y, gtCluster, 0, dX, dY, 25); |
329 AddGear(x, y, gtCluster, 0, dX, dY, 25); |
330 end |
330 end |
331 end; |
331 end; |
332 gtWatermelon: |
332 gtWatermelon: |
333 begin |
333 begin |
334 x := hwRound(Gear^.X); |
334 x := hwRound(Gear^.X); |
335 y := hwRound(Gear^.Y); |
335 y := hwRound(Gear^.Y); |
336 doMakeExplosion(x, y, 75, EXPLAutoSound); |
336 doMakeExplosion(x, y, 75, EXPLAutoSound); |
337 for i:= 0 to 5 do |
337 for i:= 0 to 5 do |
338 begin |
338 begin |
339 dX := rndSign(GetRandom * _0_1); |
339 dX := rndSign(GetRandom * _0_1); |
340 dY := (GetRandom - _1_5) * _0_3; |
340 dY := (GetRandom - _1_5) * _0_3; |
341 AddGear(x, y, gtMelonPiece, 0, dX, dY, 75)^.DirAngle := i * 60; |
341 AddGear(x, y, gtMelonPiece, 0, dX, dY, 75)^.DirAngle := i * 60; |
342 end |
342 end |
343 end; |
343 end; |
344 gtHellishBomb: |
344 gtHellishBomb: |
345 begin |
345 begin |
346 x := hwRound(Gear^.X); |
346 x := hwRound(Gear^.X); |
347 y := hwRound(Gear^.Y); |
347 y := hwRound(Gear^.Y); |
348 doMakeExplosion(x, y, 90, EXPLAutoSound); |
348 doMakeExplosion(x, y, 90, EXPLAutoSound); |
349 |
349 |
350 for i:= 0 to 127 do |
350 for i:= 0 to 127 do |
351 begin |
351 begin |
352 dX := AngleCos(i * 16) * _0_5 * (GetRandom + _1); |
352 dX := AngleCos(i * 16) * _0_5 * (GetRandom + _1); |
353 dY := AngleSin(i * 16) * _0_5 * (GetRandom + _1); |
353 dY := AngleSin(i * 16) * _0_5 * (GetRandom + _1); |
354 Fire := AddGear(x, y, gtFlame, 0, dX, dY, 0); |
354 Fire := AddGear(x, y, gtFlame, 0, dX, dY, 0); |
355 if i mod 2 = 0 then Fire^.State := Fire^.State or gsttmpFlag; |
355 if i mod 2 = 0 then Fire^.State := Fire^.State or gsttmpFlag; |
356 Fire := AddGear(x, y, gtFlame, 0, dX, -dY, 0); |
356 Fire := AddGear(x, y, gtFlame, 0, dX, -dY, 0); |
357 if i mod 2 <> 0 then Fire^.State := Fire^.State or gsttmpFlag; |
357 if i mod 2 <> 0 then Fire^.State := Fire^.State or gsttmpFlag; |
358 end |
358 end |
359 end; |
359 end; |
360 gtGasBomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound or EXPLPoisoned, $FFFFC000); |
360 gtGasBomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLAutoSound or EXPLPoisoned); |
361 end; |
361 end; |
362 DeleteGear(Gear); |
362 DeleteGear(Gear); |
363 exit |
363 exit |
364 end; |
364 end; |
365 |
365 |
366 CalcRotationDirAngle(Gear); |
366 CalcRotationDirAngle(Gear); |
367 |
367 |
368 if Gear^.Kind = gtHellishBomb then |
368 if Gear^.Kind = gtHellishBomb then |
1668 begin |
1668 begin |
1669 AllInactive := false; |
1669 AllInactive := false; |
1670 if Gear^.dX.QWordValue > _0_01.QWordValue then |
1670 if Gear^.dX.QWordValue > _0_01.QWordValue then |
1671 Gear^.dX := Gear^.dX * _0_995; |
1671 Gear^.dX := Gear^.dX * _0_995; |
1672 Gear^.dY := Gear^.dY + cGravity; |
1672 Gear^.dY := Gear^.dY + cGravity; |
1673 if (Gear^.State and gsttmpFlag) <> 0 then Gear^.dY := Gear^.dY + cGravity; |
1673 {if (Gear^.State and gsttmpFlag) <> 0 then Gear^.dY := Gear^.dY + cGravity;} |
1674 if Gear^.dY.QWordValue > _0_2.QWordValue then Gear^.dY := Gear^.dY * _0_995; |
1674 if Gear^.dY.QWordValue > _0_2.QWordValue then Gear^.dY := Gear^.dY * _0_995; |
1675 |
1675 |
1676 if (Gear^.State and gsttmpFlag) <> 0 then Gear^.X := Gear^.X + Gear^.dX |
1676 {if (Gear^.State and gsttmpFlag) <> 0 then Gear^.X := Gear^.X + Gear^.dX |
1677 else |
1677 else} |
1678 Gear^.X := Gear^.X + Gear^.dX + cWindSpeed * 640; |
1678 Gear^.X := Gear^.X + Gear^.dX + cWindSpeed * 640; |
1679 Gear^.Y := Gear^.Y + Gear^.dY; |
1679 Gear^.Y := Gear^.Y + Gear^.dY; |
1680 |
1680 |
1681 if (hwRound(Gear^.Y) > cWaterLine) then |
1681 if (hwRound(Gear^.Y) > cWaterLine) then |
1682 begin |
1682 begin |
3622 Gear^.dX.isNegative := not Gear^.dX.isNegative; |
3622 Gear^.dX.isNegative := not Gear^.dX.isNegative; |
3623 Gear^.dY.isNegative := not Gear^.dY.isNegative; |
3623 Gear^.dY.isNegative := not Gear^.dY.isNegative; |
3624 |
3624 |
3625 Gear^.doStep := @doStepSineGunShotWork; |
3625 Gear^.doStep := @doStepSineGunShotWork; |
3626 end; |
3626 end; |
|
3627 |
|
3628 //////////////////////////////////////////////////////////////////////////////// |
|
3629 procedure doStepFlamethrowerWork(Gear: PGear); |
|
3630 var |
|
3631 HHGear: PGear; |
|
3632 rx, ry: hwFloat; |
|
3633 gX, gY: LongInt; |
|
3634 Fire: PGear; |
|
3635 begin |
|
3636 AllInactive := false; |
|
3637 dec(Gear^.Timer); |
|
3638 HHGear := PHedgehog(Gear^.Hedgehog)^.Gear; |
|
3639 HedgehogChAngle(HHGear); |
|
3640 gX := hwRound(Gear^.X); |
|
3641 gY := hwRound(Gear^.Y); |
|
3642 if (Gear^.Timer mod 100) = 0 then |
|
3643 begin |
|
3644 rx := rndSign(getRandom * _0_1); |
|
3645 ry := rndSign(getRandom * _0_1); |
|
3646 |
|
3647 Fire := AddGear(gx, gy, gtFlame, 0, |
|
3648 SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx, |
|
3649 AngleCos(HHGear^.Angle) * ( - _0_8) + ry, 0); |
|
3650 Fire^.State := Fire^.State or gsttmpFlag; |
|
3651 |
|
3652 if (Gear^.Timer mod 200) = 0 then |
|
3653 Fire := AddGear(gx, gy, gtFlame, 0, |
|
3654 SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx, |
|
3655 AngleCos(HHGear^.Angle) * ( - _0_8) + ry, 0); |
|
3656 end; |
|
3657 |
|
3658 if (Gear^.Timer = 0) or (HHGear^.Damage <> 0) then |
|
3659 begin |
|
3660 DeleteGear(Gear); |
|
3661 AfterAttack |
|
3662 end |
|
3663 end; |
|
3664 |
|
3665 procedure doStepFlamethrower(Gear: PGear); |
|
3666 var |
|
3667 HHGear: PGear; |
|
3668 begin |
|
3669 HHGear := PHedgehog(Gear^.Hedgehog)^.Gear; |
|
3670 HHGear^.Message := HHGear^.Message and not (gm_Up or gm_Down); |
|
3671 HHGear^.State := HHGear^.State or gstNotKickable; |
|
3672 Gear^.doStep := @doStepFlamethrowerWork |
|
3673 end; |
|
3674 |
|
3675 |