284 t:= CheckGearsCollision(Gear, Sign(Gear.dX), true); |
284 t:= CheckGearsCollision(Gear, Sign(Gear.dX), true); |
285 if t = nil then t:= CheckGearsCollision(Gear, Sign(Gear.dY), false); |
285 if t = nil then t:= CheckGearsCollision(Gear, Sign(Gear.dY), false); |
286 if t <> nil then |
286 if t <> nil then |
287 begin |
287 begin |
288 AmmoShove(Gear, t, 12); |
288 AmmoShove(Gear, t, 12); |
|
289 inc(Gear.Damage, 10); |
289 if t.CollIndex < High(Longword) then DeleteCR(t) |
290 if t.CollIndex < High(Longword) then DeleteCR(t) |
290 end; |
291 end; |
291 dec(i) |
292 dec(i) |
292 until (i = 0) or (Gear.Damage > Gear.Health); |
293 until (i = 0) or (Gear.Damage > Gear.Health); |
293 if Gear.Damage > 0 then |
294 if Gear.Damage > 0 then |
603 end; |
604 end; |
604 |
605 |
605 //////////////////////////////////////////////////////////////////////////////// |
606 //////////////////////////////////////////////////////////////////////////////// |
606 procedure doStepMine(Gear: PGear); |
607 procedure doStepMine(Gear: PGear); |
607 begin |
608 begin |
608 if (Gear.dX <> 0) or (Gear.dY <> 0) {or not TestCollisionY(Gear, 1)} then |
609 if (Gear.dX <> 0) or (Gear.dY <> 0) then |
609 begin |
610 begin |
|
611 if Gear.CollIndex < High(Longword) then DeleteCR(Gear); |
610 doStepFallingGear(Gear); |
612 doStepFallingGear(Gear); |
611 if Gear.Active = false then |
613 if Gear.Active = false then |
612 begin |
614 begin |
|
615 if Gear.CollIndex = High(Longword) then AddGearCR(Gear); |
613 Gear.dX:= 0; |
616 Gear.dX:= 0; |
614 Gear.dY:= 0 |
617 Gear.dY:= 0 |
615 end; |
618 end; |
616 CalcRotationDirAngle(Gear); |
619 CalcRotationDirAngle(Gear); |
617 AllInactive:= false |
620 AllInactive:= false |
618 end; |
621 end; |
|
622 |
619 if ((Gear.State and gsttmpFlag) <> 0) then |
623 if ((Gear.State and gsttmpFlag) <> 0) then |
620 if ((Gear.State and gstAttacking) = 0) then |
624 if ((Gear.State and gstAttacking) = 0) then |
621 begin |
625 begin |
622 if (Gear.Tag = 0) then |
626 if ((GameTicks and $F) = 0) then |
623 begin |
|
624 Gear.Tag:= 10; |
|
625 if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then Gear.State:= Gear.State or gstAttacking |
627 if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then Gear.State:= Gear.State or gstAttacking |
626 end else dec(Gear.Tag) |
|
627 end else // gstAttacking <> 0 |
628 end else // gstAttacking <> 0 |
628 begin |
629 begin |
629 AllInactive:= false; |
630 AllInactive:= false; |
630 if (Gear.Timer and $FF) = 0 then PlaySound(sndMineTick); |
631 if (Gear.Timer and $FF) = 0 then PlaySound(sndMineTick); |
631 if Gear.Timer = 0 then |
632 if Gear.Timer = 0 then |
635 end; |
636 end; |
636 dec(Gear.Timer); |
637 dec(Gear.Timer); |
637 end else // gsttmpFlag = 0 |
638 end else // gsttmpFlag = 0 |
638 if TurnTimeLeft = 0 then Gear.State:= Gear.State or gsttmpFlag; |
639 if TurnTimeLeft = 0 then Gear.State:= Gear.State or gsttmpFlag; |
639 end; |
640 end; |
|
641 //////////////////////////////////////////////////////////////////////////////// |
|
642 procedure doStepDynamite(Gear: PGear); |
|
643 begin |
|
644 if (Gear.dX <> 0) or (Gear.dY <> 0) {or not TestCollisionY(Gear, 1)} then |
|
645 begin |
|
646 doStepFallingGear(Gear); |
|
647 if Gear.Active = false then |
|
648 begin |
|
649 Gear.dX:= 0; |
|
650 Gear.dY:= 0 |
|
651 end; |
|
652 // CalcRotationDirAngle(Gear); |
|
653 AllInactive:= false |
|
654 end; |
|
655 //if ((Gear.State and gsttmpFlag) <> 0) then |
|
656 // if ((Gear.State and gstAttacking) = 0) then |
|
657 begin |
|
658 // AllInactive:= true; |
|
659 if (Gear.Timer and $FF) = 0 then PlaySound(sndMineTick); |
|
660 if Gear.Timer = 0 then |
|
661 begin |
|
662 doMakeExplosion(round(Gear.X), round(Gear.Y), 85, EXPLAutoSound); |
|
663 DeleteGear(Gear) |
|
664 end; |
|
665 dec(Gear.Timer); |
|
666 end;{ else // gsttmpFlag = 0 |
|
667 if TurnTimeLeft = 0 then Gear.State:= Gear.State or gsttmpFlag;} |
|
668 end; |
640 |
669 |
641 //////////////////////////////////////////////////////////////////////////////// |
670 //////////////////////////////////////////////////////////////////////////////// |
642 procedure doStepCase(Gear: PGear); |
671 procedure doStepCase(Gear: PGear); |
643 begin |
672 begin |
644 if (Gear.Message and gm_Destroy) > 0 then |
673 if (Gear.Message and gm_Destroy) > 0 then |