672 end; |
672 end; |
673 if cVampiric and |
673 if cVampiric and |
674 (CurrentHedgehog^.Gear <> nil) and |
674 (CurrentHedgehog^.Gear <> nil) and |
675 (CurrentHedgehog^.Gear = Gear) then |
675 (CurrentHedgehog^.Gear = Gear) then |
676 begin |
676 begin |
677 Tint($FF, $FF, $FF, max($40, floor($FF * abs(1 - (RealTicks mod 1500) / 750)))); |
677 Tint($FF, 0, 0, max($40, floor($FF * abs(1 - (RealTicks mod 1500) / 750)))); |
678 DrawSprite(sprVampiric, sx - 24, sy - 24, 0); |
678 DrawSprite(sprVampiric, sx - 24, sy - 24, 0); |
679 end; |
679 end; |
680 Tint($FF, $FF, $FF, $FF) |
680 Tint($FF, $FF, $FF, $FF) |
681 end; |
681 end; |
682 |
682 |
683 procedure DrawGears; |
683 procedure DrawGears; |
684 var Gear, HHGear: PGear; |
684 var Gear, HHGear: PGear; |
685 i: Longword; |
685 i: Longword; |
686 startX, endX, startY, endY: LongInt; |
686 x, y, startX, endX, startY, endY: LongInt; |
687 begin |
687 begin |
688 Gear:= GearsList; |
688 Gear:= GearsList; |
689 while Gear<>nil do |
689 while Gear<>nil do |
690 begin |
690 begin |
|
691 x:= hwRound(Gear^.X) + WorldDx; |
|
692 y:= hwRound(Gear^.Y) + WorldDy; |
691 case Gear^.Kind of |
693 case Gear^.Kind of |
692 gtAmmo_Bomb: DrawRotated(sprBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); |
694 gtAmmo_Bomb: DrawRotated(sprBomb, x, y, 0, Gear^.DirAngle); |
693 gtGasBomb: DrawRotated(sprCheese, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); |
695 gtGasBomb: DrawRotated(sprCheese, x, y, 0, Gear^.DirAngle); |
694 gtMolotov: DrawRotated(sprMolotov, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); |
696 gtMolotov: DrawRotated(sprMolotov, x, y, 0, Gear^.DirAngle); |
695 |
697 |
696 gtRCPlane: begin |
698 gtRCPlane: begin |
697 if (Gear^.Tag = -1) then |
699 if (Gear^.Tag = -1) then |
698 DrawRotated(sprPlane, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, -1, DxDy2Angle(Gear^.dX, Gear^.dY) + 90) |
700 DrawRotated(sprPlane, x, y, -1, DxDy2Angle(Gear^.dX, Gear^.dY) + 90) |
699 else |
701 else |
700 DrawRotated(sprPlane, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy,0,DxDy2Angle(Gear^.dY, Gear^.dX)); |
702 DrawRotated(sprPlane, x, y,0,DxDy2Angle(Gear^.dY, Gear^.dX)); |
701 if ((TrainingFlags and tfRCPlane) <> 0) and (TrainingTargetGear <> nil) and ((Gear^.State and gstDrowning) = 0) then |
703 if ((TrainingFlags and tfRCPlane) <> 0) and (TrainingTargetGear <> nil) and ((Gear^.State and gstDrowning) = 0) then |
702 DrawRotatedf(sprFinger, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, GameTicks div 32 mod 16, 0, DxDy2Angle(Gear^.X - TrainingTargetGear^.X, TrainingTargetGear^.Y - Gear^.Y)); |
704 DrawRotatedf(sprFinger, x, y, GameTicks div 32 mod 16, 0, DxDy2Angle(Gear^.X - TrainingTargetGear^.X, TrainingTargetGear^.Y - Gear^.Y)); |
703 end; |
705 end; |
704 gtBall: DrawRotatedf(sprBalls, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tag,0, Gear^.DirAngle); |
706 gtBall: DrawRotatedf(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle); |
705 |
707 |
706 gtPortal: if ((Gear^.Tag and 1) = 0) // still moving? |
708 gtPortal: if ((Gear^.Tag and 1) = 0) // still moving? |
707 or (Gear^.IntersectGear = nil) or (Gear^.IntersectGear^.IntersectGear <> Gear) // not linked&backlinked? |
709 or (Gear^.IntersectGear = nil) or (Gear^.IntersectGear^.IntersectGear <> Gear) // not linked&backlinked? |
708 or ((Gear^.IntersectGear^.Tag and 1) = 0) then // linked portal still moving? |
710 or ((Gear^.IntersectGear^.Tag and 1) = 0) then // linked portal still moving? |
709 DrawRotatedf(sprPortal, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle) |
711 DrawRotatedf(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle) |
710 else DrawRotatedf(sprPortal, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle); |
712 else DrawRotatedf(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle); |
711 |
713 |
712 gtDrill: DrawRotated(sprDrill, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
714 gtDrill: DrawRotated(sprDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
713 |
715 |
714 gtHedgehog: DrawHH(Gear); |
716 gtHedgehog: DrawHH(Gear); |
715 |
717 |
716 gtAmmo_Grenade: DrawRotated(sprGrenade, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
718 gtAmmo_Grenade: DrawRotated(sprGrenade, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
717 |
719 |
718 gtGrave: DrawTextureF(PHedgehog(Gear^.Hedgehog)^.Team^.GraveTex, 1, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks shr 7+Gear^.uid) and 7, 1, 32, 32); |
720 gtGrave: begin |
719 |
721 DrawTextureF(PHedgehog(Gear^.Hedgehog)^.Team^.GraveTex, 1, x, y, (GameTicks shr 7+Gear^.uid) and 7, 1, 32, 32); |
720 gtBee: DrawRotatedF(sprBee, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
722 if Gear^.Health > 0 then |
721 |
723 begin |
722 gtPickHammer: DrawSprite(sprPHammer, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 50 + LongInt(((GameTicks shr 5) and 1) * 2) + WorldDy, 0); |
724 //Tint($33, $33, $FF, max($40, floor($FF * abs(1 - (GameTicks mod (6000 div Gear^.Health)) / 750)))); |
|
725 Tint($33, $33, $FF, max($40, floor($FF * abs(1 - (GameTicks mod 1500) / (750 + Gear^.Health))))); |
|
726 //Tint($FF, $FF, $FF, max($40, floor($FF * abs(1 - (RealTicks mod 1500) / 750)))); |
|
727 DrawSprite(sprVampiric, x - 24, y - 24, 0); |
|
728 Tint($FF, $FF, $FF, $FF) |
|
729 end |
|
730 end; |
|
731 |
|
732 gtBee: DrawRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
|
733 |
|
734 gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0); |
723 gtRope: DrawRope(Gear); |
735 gtRope: DrawRope(Gear); |
724 gtMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
736 gtMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
725 DrawRotated(sprMineOff, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle) |
737 DrawRotated(sprMineOff, x, y, 0, Gear^.DirAngle) |
726 else if Gear^.Health <> 0 then DrawRotated(sprMineOn, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle) |
738 else if Gear^.Health <> 0 then DrawRotated(sprMineOn, x, y, 0, Gear^.DirAngle) |
727 else DrawRotated(sprMineDead, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); |
739 else DrawRotated(sprMineDead, x, y, 0, Gear^.DirAngle); |
728 gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
740 gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
729 DrawRotated(sprSMineOff, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle) |
741 DrawRotated(sprSMineOff, x, y, 0, Gear^.DirAngle) |
730 else if Gear^.Health <> 0 then DrawRotated(sprSMineOn, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle) |
742 else if Gear^.Health <> 0 then DrawRotated(sprSMineOn, x, y, 0, Gear^.DirAngle) |
731 else DrawRotated(sprMineDead, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); |
743 else DrawRotated(sprMineDead, x, y, 0, Gear^.DirAngle); |
732 gtCase: case Gear^.Pos of |
744 gtCase: case Gear^.Pos of |
733 posCaseAmmo : begin |
745 posCaseAmmo : begin |
734 i:= (GameTicks shr 6) mod 64; |
746 i:= (GameTicks shr 6) mod 64; |
735 if i > 18 then i:= 0; |
747 if i > 18 then i:= 0; |
736 DrawSprite(sprCase, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, i); |
748 DrawSprite(sprCase, x - 24, y - 24, i); |
737 end; |
749 end; |
738 posCaseHealth: begin |
750 posCaseHealth: begin |
739 i:= ((GameTicks shr 6) + 38) mod 64; |
751 i:= ((GameTicks shr 6) + 38) mod 64; |
740 if i > 13 then i:= 0; |
752 if i > 13 then i:= 0; |
741 DrawSprite(sprFAid, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, i); |
753 DrawSprite(sprFAid, x - 24, y - 24, i); |
742 end; |
754 end; |
743 posCaseUtility: begin |
755 posCaseUtility: begin |
744 i:= (GameTicks shr 6) mod 70; |
756 i:= (GameTicks shr 6) mod 70; |
745 if i > 23 then i:= 0; |
757 if i > 23 then i:= 0; |
746 i:= i mod 12; |
758 i:= i mod 12; |
747 DrawSprite(sprUtility, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, i); |
759 DrawSprite(sprUtility, x - 24, y - 24, i); |
748 end; |
760 end; |
749 end; |
761 end; |
750 gtExplosives: begin |
762 gtExplosives: begin |
751 if ((Gear^.State and gstDrowning) <> 0) then |
763 if ((Gear^.State and gstDrowning) <> 0) then |
752 DrawSprite(sprExplosivesRoll, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, 0) |
764 DrawSprite(sprExplosivesRoll, x - 24, y - 24, 0) |
753 else if Gear^.State and gstAnimation = 0 then |
765 else if Gear^.State and gstAnimation = 0 then |
754 begin |
766 begin |
755 i:= (GameTicks shr 6 + Gear^.uid*3) mod 64; |
767 i:= (GameTicks shr 6 + Gear^.uid*3) mod 64; |
756 if i > 18 then i:= 0; |
768 if i > 18 then i:= 0; |
757 DrawSprite(sprExplosives, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, i) |
769 DrawSprite(sprExplosives, x - 24, y - 24, i) |
758 end |
770 end |
759 else if Gear^.State and gsttmpFlag = 0 then |
771 else if Gear^.State and gsttmpFlag = 0 then |
760 DrawRotatedF(sprExplosivesRoll, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) +4 + WorldDy, 0, 0, Gear^.DirAngle) |
772 DrawRotatedF(sprExplosivesRoll, x, y + 4, 0, 0, Gear^.DirAngle) |
761 else |
773 else |
762 DrawRotatedF(sprExplosivesRoll, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) +4 + WorldDy, 1, 0, Gear^.DirAngle); |
774 DrawRotatedF(sprExplosivesRoll, x, y + 4, 1, 0, Gear^.DirAngle); |
763 end; |
775 end; |
764 gtDynamite: DrawSprite2(sprDynamite, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, Gear^.Tag and 1, Gear^.Tag shr 1); |
776 gtDynamite: DrawSprite2(sprDynamite, x - 16, y - 25, Gear^.Tag and 1, Gear^.Tag shr 1); |
765 gtClusterBomb: DrawRotated(sprClusterBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); |
777 gtClusterBomb: DrawRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle); |
766 gtCluster: DrawSprite(sprClusterParticle, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy, 0); |
778 gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0); |
767 gtFlame: DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16); |
779 gtFlame: DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16); |
768 gtParachute: begin |
780 gtParachute: begin |
769 DrawSprite(sprParachute, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 48 + WorldDy, 0); |
781 DrawSprite(sprParachute, x - 24, y - 48, 0); |
770 DrawAltWeapon(Gear, hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy) |
782 DrawAltWeapon(Gear, x + 1, y - 3) |
771 end; |
783 end; |
772 gtAirAttack: if Gear^.Tag > 0 then DrawSprite(sprAirplane, hwRound(Gear^.X) - SpritesData[sprAirplane].Width div 2 + WorldDx, hwRound(Gear^.Y) - SpritesData[sprAirplane].Height div 2 + WorldDy, 0) |
784 gtAirAttack: if Gear^.Tag > 0 then DrawSprite(sprAirplane, x - SpritesData[sprAirplane].Width div 2, y - SpritesData[sprAirplane].Height div 2, 0) |
773 else DrawSprite(sprAirplane, hwRound(Gear^.X) - SpritesData[sprAirplane].Width div 2 + WorldDx, hwRound(Gear^.Y) - SpritesData[sprAirplane].Height div 2 + WorldDy, 1); |
785 else DrawSprite(sprAirplane, x - SpritesData[sprAirplane].Width div 2, y - SpritesData[sprAirplane].Height div 2, 1); |
774 gtAirBomb: DrawRotated(sprAirBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
786 gtAirBomb: DrawRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
775 gtTeleport: begin |
787 gtTeleport: begin |
776 HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
788 HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
777 if not PHedgehog(Gear^.Hedgehog)^.Unplaced then DrawRotatedF(sprTeleport, hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, Gear^.Pos, hwSign(Gear^.dX), 0); |
789 if not PHedgehog(Gear^.Hedgehog)^.Unplaced then DrawRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0); |
778 DrawRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0); |
790 DrawRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0); |
779 end; |
791 end; |
780 gtSwitcher: DrawSprite(sprSwitch, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 56 + WorldDy, (GameTicks shr 6) mod 12); |
792 gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (GameTicks shr 6) mod 12); |
781 gtTarget: begin |
793 gtTarget: begin |
782 Tint($FF, $FF, $FF, floor($FF * Gear^.Timer / 1000)); |
794 Tint($FF, $FF, $FF, floor($FF * Gear^.Timer / 1000)); |
783 DrawSprite(sprTarget, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0); |
795 DrawSprite(sprTarget, x - 16, y - 16, 0); |
784 Tint($FF, $FF, $FF, $FF); |
796 Tint($FF, $FF, $FF, $FF); |
785 end; |
797 end; |
786 gtMortar: DrawRotated(sprMortar, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
798 gtMortar: DrawRotated(sprMortar, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
787 gtCake: if Gear^.Pos = 6 then |
799 gtCake: if Gear^.Pos = 6 then |
788 DrawRotatedf(sprCakeWalk, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90) |
800 DrawRotatedf(sprCakeWalk, x, y, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90) |
789 else |
801 else |
790 DrawRotatedf(sprCakeDown, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 5 - Gear^.Pos, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90); |
802 DrawRotatedf(sprCakeDown, x, y, 5 - Gear^.Pos, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90); |
791 gtSeduction: if Gear^.Pos >= 14 then DrawSprite(sprSeduction, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0); |
803 gtSeduction: if Gear^.Pos >= 14 then DrawSprite(sprSeduction, x - 16, y - 16, 0); |
792 gtWatermelon: DrawRotatedf(sprWatermelon, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 0, Gear^.DirAngle); |
804 gtWatermelon: DrawRotatedf(sprWatermelon, x, y, 0, 0, Gear^.DirAngle); |
793 gtMelonPiece: DrawRotatedf(sprWatermelon, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 1, 0, Gear^.DirAngle); |
805 gtMelonPiece: DrawRotatedf(sprWatermelon, x, y, 1, 0, Gear^.DirAngle); |
794 gtHellishBomb: DrawRotated(sprHellishBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); |
806 gtHellishBomb: DrawRotated(sprHellishBomb, x, y, 0, Gear^.DirAngle); |
795 gtBirdy: begin |
807 gtBirdy: begin |
796 if Gear^.State and gstAnimation = gstAnimation then |
808 if Gear^.State and gstAnimation = gstAnimation then |
797 begin |
809 begin |
798 if Gear^.State and gstTmpFlag = 0 then // Appearing |
810 if Gear^.State and gstTmpFlag = 0 then // Appearing |
799 begin |
811 begin |
800 endX:= hwRound(Gear^.X); |
812 endX:= x - WorldDx; |
801 endY:= hwRound(Gear^.Y); |
813 endY:= y - WorldDy; |
802 if Gear^.Tag < 0 then |
814 if Gear^.Tag < 0 then |
803 startX:= max(LAND_WIDTH + 1024, endX + 2048) |
815 startX:= max(LAND_WIDTH + 1024, endX + 2048) |
804 else |
816 else |
805 startX:= max(-LAND_WIDTH - 1024, endX - 2048); |
817 startX:= max(-LAND_WIDTH - 1024, endX - 2048); |
806 startY:= endY - 256; |
818 startY:= endY - 256; |
807 DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + floor((endX - startX) * (-power(2, -10 * LongInt(Gear^.Timer)/2000) + 1)), startY + WorldDy + floor((endY - startY) * sqrt(1 - power((LongInt(Gear^.Timer)/2000)-1, 2))), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75); |
819 DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + floor((endX - startX) * (-power(2, -10 * LongInt(Gear^.Timer)/2000) + 1)), startY + WorldDy + floor((endY - startY) * sqrt(1 - power((LongInt(Gear^.Timer)/2000)-1, 2))), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75); |
808 end |
820 end |
809 else // Disappearing |
821 else // Disappearing |
810 begin |
822 begin |
811 startX:= hwRound(Gear^.X); |
823 startX:= x - WorldDx; |
812 startY:= hwRound(Gear^.Y); |
824 startY:= y - WorldDy; |
813 if Gear^.Tag > 0 then |
825 if Gear^.Tag > 0 then |
814 endX:= max(LAND_WIDTH + 1024, startX + 2048) |
826 endX:= max(LAND_WIDTH + 1024, startX + 2048) |
815 else |
827 else |
816 endX:= max(-LAND_WIDTH - 1024, startX - 2048); |
828 endX:= max(-LAND_WIDTH - 1024, startX - 2048); |
817 endY:= startY + 256; |
829 endY:= startY + 256; |
818 DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + floor((endX - startX) * power(2, 10 * (LongInt(Gear^.Timer)/2000 - 1))) + hwRound(Gear^.dX * Gear^.Timer), startY + WorldDy + floor((endY - startY) * cos(LongInt(Gear^.Timer)/2000 * (Pi/2)) - (endY - startY)) + hwRound(Gear^.dY * Gear^.Timer), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75); |
830 DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + floor((endX - startX) * power(2, 10 * (LongInt(Gear^.Timer)/2000 - 1))) + hwRound(Gear^.dX * Gear^.Timer), startY + WorldDy + floor((endY - startY) * cos(LongInt(Gear^.Timer)/2000 * (Pi/2)) - (endY - startY)) + hwRound(Gear^.dY * Gear^.Timer), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75); |
819 end; |
831 end; |
820 end |
832 end |
821 else |
833 else |
822 DrawTextureF(SpritesData[sprBirdy].Texture, 1, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75); |
834 DrawTextureF(SpritesData[sprBirdy].Texture, 1, x, y, ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75); |
823 end; |
835 end; |
824 gtEgg: DrawRotatedTextureF(SpritesData[sprEgg].Texture, 1, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 16, 16, Gear^.DirAngle); |
836 gtEgg: DrawRotatedTextureF(SpritesData[sprEgg].Texture, 1, 0, 0, x, y, 0, 1, 16, 16, Gear^.DirAngle); |
825 gtPiano: begin |
837 gtPiano: begin |
826 if (Gear^.State and gstDrowning) = 0 then |
838 if (Gear^.State and gstDrowning) = 0 then |
827 begin |
839 begin |
828 Tint($FF, $FF, $FF, $10); |
840 Tint($FF, $FF, $FF, $10); |
829 for i:= 8 downto 1 do |
841 for i:= 8 downto 1 do |
830 DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy - hwRound(Gear^.dY * 4 * i), 0, 1, 128, 128, 0); |
842 DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, x, y - hwRound(Gear^.dY * 4 * i), 0, 1, 128, 128, 0); |
831 Tint($FF, $FF, $FF, $FF) |
843 Tint($FF, $FF, $FF, $FF) |
832 end; |
844 end; |
833 DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 128, 128, 0); |
845 DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, x, y, 0, 1, 128, 128, 0); |
834 end; |
846 end; |
835 gtPoisonCloud: begin |
847 gtPoisonCloud: begin |
836 if Gear^.Timer < 1020 then |
848 if Gear^.Timer < 1020 then |
837 Tint($C0, $C0, $00, Gear^.Timer div 8) |
849 Tint($C0, $C0, $00, Gear^.Timer div 8) |
838 else if Gear^.Timer > 3980 then |
850 else if Gear^.Timer > 3980 then |
839 Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8) |
851 Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8) |
840 else |
852 else |
841 Tint($C0, $C0, $00, $C0); |
853 Tint($C0, $C0, $00, $C0); |
842 DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360); |
854 DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360); |
843 Tint($FF, $FF, $FF, $FF) |
855 Tint($FF, $FF, $FF, $FF) |
844 end; |
856 end; |
845 end; |
857 end; |
846 if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(hwRound(Gear^.X) + 8 + WorldDx, hwRound(Gear^.Y) + 8 + WorldDy, Gear^.Tex); |
858 if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(x + 8, y + 8, Gear^.Tex); |
847 Gear:= Gear^.NextGear |
859 Gear:= Gear^.NextGear |
848 end; |
860 end; |
849 end; |
861 end; |