333 if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind <> gtTardis) then |
345 if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind <> gtTardis) then |
334 begin |
346 begin |
335 case CurAmmoGear^.Kind of |
347 case CurAmmoGear^.Kind of |
336 gtShotgunShot: begin |
348 gtShotgunShot: begin |
337 if (CurAmmoGear^.State and gstAnimation <> 0) then |
349 if (CurAmmoGear^.State and gstAnimation <> 0) then |
338 DrawRotated(sprShotgun, hx, hy, sign, aangle) |
350 DrawSpriteRotated(sprShotgun, hx, hy, sign, aangle) |
339 else |
351 else |
340 DrawRotated(sprHandShotgun, hx, hy, sign, aangle); |
352 DrawSpriteRotated(sprHandShotgun, hx, hy, sign, aangle); |
341 end; |
353 end; |
342 gtDEagleShot: DrawRotated(sprDEagle, hx, hy, sign, aangle); |
354 gtDEagleShot: DrawSpriteRotated(sprDEagle, hx, hy, sign, aangle); |
343 gtSniperRifleShot: begin |
355 gtSniperRifleShot: begin |
344 if (CurAmmoGear^.State and gstAnimation <> 0) then |
356 if (CurAmmoGear^.State and gstAnimation <> 0) then |
345 DrawRotatedF(sprSniperRifle, hx, hy, 1, sign, aangle) |
357 DrawSpriteRotatedF(sprSniperRifle, hx, hy, 1, sign, aangle) |
346 else |
358 else |
347 DrawRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle) |
359 DrawSpriteRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle) |
348 end; |
360 end; |
349 gtBallgun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle); |
361 gtBallgun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle); |
350 gtRCPlane: begin |
362 gtRCPlane: begin |
351 DrawRotated(sprHandPlane, hx, hy, sign, 0); |
363 DrawSpriteRotated(sprHandPlane, hx, hy, sign, 0); |
352 defaultPos:= false |
364 defaultPos:= false |
353 end; |
365 end; |
354 gtRope: begin |
366 gtRope: begin |
355 if Gear^.X < CurAmmoGear^.X then |
367 if Gear^.X < CurAmmoGear^.X then |
356 begin |
368 begin |
357 dAngle:= 0; |
369 dAngle:= 0; |
358 hAngle:= 180; |
370 hAngle:= 180; |
359 i:= 1 |
371 i:= 1 |
360 end else |
372 end |
|
373 else |
361 begin |
374 begin |
362 dAngle:= 180; |
375 dAngle:= 180; |
363 hAngle:= 0; |
376 hAngle:= 0; |
364 i:= -1 |
377 i:= -1 |
365 end; |
378 end; |
366 if ((Gear^.State and gstWinner) = 0) then |
379 if ((Gear^.State and gstWinner) = 0) then |
367 begin |
380 begin |
368 DrawHedgehog(ox, oy, |
381 DrawHedgehog(ox, oy, |
369 i, |
382 i, |
370 1, |
383 1, |
371 0, |
384 0, |
372 DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle); |
385 DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle); |
373 with HH^ do |
386 with HH^ do |
374 if (HatTex <> nil) then |
387 if (HatTex <> nil) then |
375 begin |
|
376 DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32, |
|
377 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
|
378 if HatTex^.w > 64 then |
|
379 begin |
388 begin |
380 Tint(HH^.Team^.Clan^.Color shl 8 or $FF); |
389 DrawTextureRotatedF(HatTex, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32, |
381 DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32, |
|
382 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
390 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
383 Tint($FF, $FF, $FF, $FF) |
391 if HatTex^.w > 64 then |
|
392 begin |
|
393 Tint(HH^.Team^.Clan^.Color shl 8 or $FF); |
|
394 DrawTextureRotatedF(HatTex, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32, |
|
395 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
|
396 Tint($FF, $FF, $FF, $FF) |
|
397 end |
384 end |
398 end |
385 end |
|
386 end; |
399 end; |
387 DrawAltWeapon(Gear, ox, oy); |
400 DrawAltWeapon(Gear, ox, oy); |
388 defaultPos:= false |
401 defaultPos:= false |
389 end; |
402 end; |
390 gtBlowTorch: begin |
403 gtBlowTorch: |
391 DrawRotated(sprBlowTorch, hx, hy, sign, aangle); |
404 begin |
|
405 DrawSpriteRotated(sprBlowTorch, hx, hy, sign, aangle); |
392 DrawHedgehog(sx, sy, |
406 DrawHedgehog(sx, sy, |
393 sign, |
407 sign, |
394 3, |
408 3, |
395 HH^.visStepPos div 2, |
409 HH^.visStepPos div 2, |
396 0); |
410 0); |
559 if ((Gear^.State and gstAttacked) = 0) then |
586 if ((Gear^.State and gstAttacked) = 0) then |
560 begin |
587 begin |
561 if HH^.Timer > 0 then |
588 if HH^.Timer > 0 then |
562 begin |
589 begin |
563 // There must be a tidier way to do this. Anyone? |
590 // There must be a tidier way to do this. Anyone? |
564 if aangle <= 90 then aangle:= aangle+360; |
591 if aangle <= 90 then |
565 if Gear^.dX > _0 then aangle:= aangle-((aangle-240)*HH^.Timer/10) |
592 aangle:= aangle+360; |
566 else aangle:= aangle+((240-aangle)*HH^.Timer/10); |
593 if Gear^.dX > _0 then |
|
594 aangle:= aangle-((aangle-240)*HH^.Timer/10) |
|
595 else |
|
596 aangle:= aangle+((240-aangle)*HH^.Timer/10); |
567 dec(HH^.Timer) |
597 dec(HH^.Timer) |
568 end; |
598 end; |
569 amt:= CurrentHedgehog^.CurAmmoType; |
599 amt:= CurrentHedgehog^.CurAmmoType; |
570 CurWeapon:= GetAmmoEntry(HH^); |
600 CurWeapon:= GetCurAmmoEntry(HH^); |
571 case amt of |
601 case amt of |
572 amBazooka: DrawRotated(sprHandBazooka, hx, hy, sign, aangle); |
602 amBazooka: DrawSpriteRotated(sprHandBazooka, hx, hy, sign, aangle); |
573 amSnowball: DrawRotated(sprHandSnowball, hx, hy, sign, aangle); |
603 amSnowball: DrawSpriteRotated(sprHandSnowball, hx, hy, sign, aangle); |
574 amMortar: DrawRotated(sprHandMortar, hx, hy, sign, aangle); |
604 amMortar: DrawSpriteRotated(sprHandMortar, hx, hy, sign, aangle); |
575 amMolotov: DrawRotated(sprHandMolotov, hx, hy, sign, aangle); |
605 amMolotov: DrawSpriteRotated(sprHandMolotov, hx, hy, sign, aangle); |
576 amBallgun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle); |
606 amBallgun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle); |
577 amDrill: DrawRotated(sprHandDrill, hx, hy, sign, aangle); |
607 amDrill: DrawSpriteRotated(sprHandDrill, hx, hy, sign, aangle); |
578 amRope: DrawRotated(sprHandRope, hx, hy, sign, aangle); |
608 amRope: DrawSpriteRotated(sprHandRope, hx, hy, sign, aangle); |
579 amShotgun: DrawRotated(sprHandShotgun, hx, hy, sign, aangle); |
609 amShotgun: DrawSpriteRotated(sprHandShotgun, hx, hy, sign, aangle); |
580 amDEagle: DrawRotated(sprHandDEagle, hx, hy, sign, aangle); |
610 amDEagle: DrawSpriteRotated(sprHandDEagle, hx, hy, sign, aangle); |
581 amSineGun: DrawRotatedF(sprHandSinegun, hx, hy, 73 + (sign * LongInt(RealTicks div 73)) mod 8, sign, aangle); |
611 amSineGun: DrawSpriteRotatedF(sprHandSinegun, hx, hy, 73 + (sign * LongInt(RealTicks div 73)) mod 8, sign, aangle); |
582 amPortalGun: if (CurWeapon^.Timer and 2) <> 0 then // Add a new Hedgehog value instead of abusing timer? |
612 |
583 DrawRotatedF(sprPortalGun, hx, hy, 0, sign, aangle) |
613 amPortalGun: |
584 else |
614 if (CurWeapon^.Timer and 2) <> 0 then // Add a new Hedgehog value instead of abusing timer? |
585 DrawRotatedF(sprPortalGun, hx, hy, 1+CurWeapon^.Pos, sign, aangle); |
615 DrawSpriteRotatedF(sprPortalGun, hx, hy, 0, sign, aangle) |
586 amSniperRifle: DrawRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle); |
616 else |
587 amBlowTorch: DrawRotated(sprHandBlowTorch, hx, hy, sign, aangle); |
617 DrawSpriteRotatedF(sprPortalGun, hx, hy, 1+CurWeapon^.Pos, sign, aangle); |
588 amCake: DrawRotated(sprHandCake, hx, hy, sign, aangle); |
618 |
589 amGrenade: DrawRotated(sprHandGrenade, hx, hy, sign, aangle); |
619 amSniperRifle: DrawSpriteRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle); |
590 amWatermelon: DrawRotated(sprHandMelon, hx, hy, sign, aangle); |
620 amBlowTorch: DrawSpriteRotated(sprHandBlowTorch, hx, hy, sign, aangle); |
591 amSkip: DrawRotated(sprHandSkip, hx, hy, sign, aangle); |
621 amCake: DrawSpriteRotated(sprHandCake, hx, hy, sign, aangle); |
592 amClusterBomb: DrawRotated(sprHandCluster, hx, hy, sign, aangle); |
622 amGrenade: DrawSpriteRotated(sprHandGrenade, hx, hy, sign, aangle); |
593 amDynamite: DrawRotated(sprHandDynamite, hx, hy, sign, aangle); |
623 amWatermelon: DrawSpriteRotated(sprHandMelon, hx, hy, sign, aangle); |
594 amHellishBomb: DrawRotated(sprHandHellish, hx, hy, sign, aangle); |
624 amSkip: DrawSpriteRotated(sprHandSkip, hx, hy, sign, aangle); |
595 amGasBomb: DrawRotated(sprHandCheese, hx, hy, sign, aangle); |
625 amClusterBomb: DrawSpriteRotated(sprHandCluster, hx, hy, sign, aangle); |
596 amMine: DrawRotated(sprHandMine, hx, hy, sign, aangle); |
626 amDynamite: DrawSpriteRotated(sprHandDynamite, hx, hy, sign, aangle); |
597 amSMine: DrawRotated(sprHandSMine, hx, hy, sign, aangle); |
627 amHellishBomb: DrawSpriteRotated(sprHandHellish, hx, hy, sign, aangle); |
|
628 amGasBomb: DrawSpriteRotated(sprHandCheese, hx, hy, sign, aangle); |
|
629 amMine: DrawSpriteRotated(sprHandMine, hx, hy, sign, aangle); |
|
630 amSMine: DrawSpriteRotated(sprHandSMine, hx, hy, sign, aangle); |
|
631 amKnife: DrawSpriteRotatedF(sprHandKnife, hx, hy, 0, sign, aangle); |
598 amSeduction: begin |
632 amSeduction: begin |
599 DrawRotated(sprHandSeduction, hx, hy, sign, aangle); |
633 DrawSpriteRotated(sprHandSeduction, hx, hy, sign, aangle); |
600 DrawCircle(ox, oy, 248, 4, $FF, $00, $00, $AA); |
634 DrawCircle(ox, oy, 248, 4, $FF, $00, $00, $AA); |
601 //Tint($FF, $0, $0, $AA); |
635 //Tint($FF, $0, $0, $AA); |
602 //DrawTexture(ox - 240, oy - 240, SpritesData[sprVampiric].Texture, 10); |
636 //DrawTexture(ox - 240, oy - 240, SpritesData[sprVampiric].Texture, 10); |
603 //Tint($FF, $FF, $FF, $FF); |
637 //Tint($FF, $FF, $FF, $FF); |
604 end; |
638 end; |
605 amVampiric: DrawRotatedF(sprHandVamp, hx, hy, (RealTicks div 125) mod 4, sign, aangle); |
639 amVampiric: DrawSpriteRotatedF(sprHandVamp, hx, hy, (RealTicks div 125) mod 4, sign, aangle); |
606 amRCPlane: begin |
640 amRCPlane: begin |
607 DrawRotated(sprHandPlane, hx, hy, sign, 0); |
641 DrawSpriteRotated(sprHandPlane, hx, hy, sign, 0); |
608 defaultPos:= false |
642 defaultPos:= false |
609 end; |
643 end; |
610 amGirder: begin |
644 amGirder: begin |
611 DrawRotated(sprHandConstruction, hx, hy, sign, aangle); |
645 DrawSpriteRotated(sprHandConstruction, hx, hy, sign, aangle); |
612 DrawSpriteClipped(sprGirder, |
646 DrawSpriteClipped(sprGirder, |
613 ox-256, |
647 ox-256, |
614 oy-256, |
648 oy-256, |
615 LongInt(topY)+WorldDy, |
649 LongInt(topY)+WorldDy, |
616 LongInt(rightX)+WorldDx, |
650 LongInt(rightX)+WorldDx, |
617 cWaterLine+WorldDy, |
651 cWaterLine+WorldDy, |
618 LongInt(leftX)+WorldDx) |
652 LongInt(leftX)+WorldDx) |
619 end; |
653 end; |
620 amBee: DrawRotatedF(sprHandBee, hx, hy, (RealTicks div 125) mod 4, sign, aangle); |
654 amBee: DrawSpriteRotatedF(sprHandBee, hx, hy, (RealTicks div 125) mod 4, sign, aangle); |
621 amFlamethrower: DrawRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle); |
655 amFlamethrower: DrawSpriteRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle); |
622 amLandGun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle); |
656 amLandGun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle); |
|
657 amIceGun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle); |
623 amResurrector: DrawCircle(ox, oy, 98, 4, $F5, $DB, $35, $AA); // I'd rather not like to hardcode 100 here |
658 amResurrector: DrawCircle(ox, oy, 98, 4, $F5, $DB, $35, $AA); // I'd rather not like to hardcode 100 here |
624 end; |
659 end; |
625 |
660 |
626 case amt of |
661 case amt of |
627 amAirAttack, |
662 amAirAttack, |
628 amMineStrike, |
663 amMineStrike, |
629 amDrillStrike: DrawRotated(sprHandAirAttack, sx, oy, sign, 0); |
664 amDrillStrike: DrawSpriteRotated(sprHandAirAttack, sx, oy, sign, 0); |
630 amPickHammer: DrawHedgehog(sx, sy, |
665 amPickHammer: DrawHedgehog(sx, sy, |
631 sign, |
666 sign, |
632 1, |
667 1, |
633 2, |
668 2, |
634 0); |
669 0); |
635 amTeleport: DrawRotatedF(sprTeleport, sx, sy, 0, sign, 0); |
670 amTeleport: DrawSpriteRotatedF(sprTeleport, sx, sy, 0, sign, 0); |
636 amKamikaze: DrawHedgehog(sx, sy, |
671 amKamikaze: DrawHedgehog(sx, sy, |
637 sign, |
672 sign, |
638 1, |
673 1, |
639 5, |
674 5, |
640 0); |
675 0); |
641 amWhip: DrawRotatedF(sprWhip, |
676 amWhip: DrawSpriteRotatedF(sprWhip, |
642 sx, |
677 sx, |
643 sy, |
678 sy, |
644 0, |
679 0, |
645 sign, |
680 sign, |
646 0); |
681 0); |
647 amHammer: DrawRotatedF(sprHammer, |
682 amHammer: DrawSpriteRotatedF(sprHammer, |
648 sx, |
683 sx, |
649 sy, |
684 sy, |
650 0, |
685 0, |
651 sign, |
686 sign, |
652 0); |
687 0); |
790 case CurAmmoGear^.Kind of |
825 case CurAmmoGear^.Kind of |
791 gtJetpack: begin |
826 gtJetpack: begin |
792 DrawSprite(sprJetpack, sx-32, sy-32, 0); |
827 DrawSprite(sprJetpack, sx-32, sy-32, 0); |
793 if cWaterLine > hwRound(Gear^.Y) + Gear^.Radius then |
828 if cWaterLine > hwRound(Gear^.Y) + Gear^.Radius then |
794 begin |
829 begin |
795 if (CurAmmoGear^.MsgParam and gmUp) <> 0 then DrawSprite(sprJetpack, sx-32, sy-28, 1); |
830 if (CurAmmoGear^.MsgParam and gmUp) <> 0 then |
796 if (CurAmmoGear^.MsgParam and gmLeft) <> 0 then DrawSprite(sprJetpack, sx-28, sy-28, 2); |
831 DrawSprite(sprJetpack, sx-32, sy-28, 1); |
797 if (CurAmmoGear^.MsgParam and gmRight) <> 0 then DrawSprite(sprJetpack, sx-36, sy-28, 3) |
832 if (CurAmmoGear^.MsgParam and gmLeft) <> 0 then |
|
833 DrawSprite(sprJetpack, sx-28, sy-28, 2); |
|
834 if (CurAmmoGear^.MsgParam and gmRight) <> 0 then |
|
835 DrawSprite(sprJetpack, sx-36, sy-28, 3) |
798 end; |
836 end; |
799 if CurAmmoGear^.Tex <> nil then DrawCentered(sx, sy - 40, CurAmmoGear^.Tex); |
837 if CurAmmoGear^.Tex <> nil then |
|
838 DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex); |
800 DrawAltWeapon(Gear, sx, sy) |
839 DrawAltWeapon(Gear, sx, sy) |
801 end; |
840 end; |
802 end; |
841 end; |
803 end |
842 end |
804 end; |
843 end; |
805 |
844 |
806 with HH^ do |
845 with HH^ do |
807 begin |
846 begin |
808 if ((Gear^.State and not gstWinner) = 0) |
847 if ((Gear^.State and (not gstWinner)) = 0) |
809 or ((Gear^.State = gstWait) and (Gear^.dY.QWordValue = 0)) |
848 or ((Gear^.State = gstWait) and (Gear^.dY.QWordValue = 0)) |
810 or (bShowFinger and ((Gear^.State and gstHHDriven) <> 0)) then |
849 or (bShowFinger and ((Gear^.State and gstHHDriven) <> 0)) then |
811 begin |
850 begin |
812 t:= sy - cHHRadius - 9; |
851 t:= sy - cHHRadius - 9; |
813 if (cTagsMask and htTransparent) <> 0 then |
852 if (cTagsMask and htTransparent) <> 0 then |
814 Tint($FF, $FF, $FF, $80); |
853 Tint($FF, $FF, $FF, $80); |
815 if ((cTagsMask and htHealth) <> 0) then |
854 if ((cTagsMask and htHealth) <> 0) then |
816 begin |
855 begin |
817 dec(t, HealthTagTex^.h + 2); |
856 dec(t, HealthTagTex^.h + 2); |
818 DrawCentered(ox, t, HealthTagTex) |
857 DrawTextureCentered(ox, t, HealthTagTex) |
819 end; |
858 end; |
820 if (cTagsMask and htName) <> 0 then |
859 if (cTagsMask and htName) <> 0 then |
821 begin |
860 begin |
822 dec(t, NameTagTex^.h + 2); |
861 dec(t, NameTagTex^.h + 2); |
823 DrawCentered(ox, t, NameTagTex) |
862 DrawTextureCentered(ox, t, NameTagTex) |
824 end; |
863 end; |
825 if (cTagsMask and htTeamName) <> 0 then |
864 if (cTagsMask and htTeamName) <> 0 then |
826 begin |
865 begin |
827 dec(t, Team^.NameTagTex^.h + 2); |
866 dec(t, Team^.NameTagTex^.h + 2); |
828 DrawCentered(ox, t, Team^.NameTagTex) |
867 DrawTextureCentered(ox, t, Team^.NameTagTex) |
829 end; |
868 end; |
830 if (cTagsMask and htTransparent) <> 0 then |
869 if (cTagsMask and htTransparent) <> 0 then |
831 Tint($FF, $FF, $FF, $FF) |
870 Tint($FF, $FF, $FF, $FF) |
832 end; |
871 end; |
833 if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog |
872 if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog |
834 begin |
873 begin |
835 if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtResurrector) then |
874 if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtResurrector) then |
836 DrawCentered(ox, sy - cHHRadius - 7 - HealthTagTex^.h, HealthTagTex); |
875 DrawTextureCentered(ox, sy - cHHRadius - 7 - HealthTagTex^.h, HealthTagTex); |
837 |
876 |
838 if bShowFinger and ((Gear^.State and gstHHDriven) <> 0) then |
877 if bShowFinger and ((Gear^.State and gstHHDriven) <> 0) then |
839 DrawSprite(sprFinger, ox - 16, oy - 64, |
878 DrawSprite(sprFinger, ox - 16, oy - 64, |
840 GameTicks div 32 mod 16); |
879 GameTicks div 32 mod 16); |
841 |
880 |
873 |
912 |
874 |
913 |
875 procedure RenderGear(Gear: PGear; x, y: LongInt); |
914 procedure RenderGear(Gear: PGear; x, y: LongInt); |
876 var |
915 var |
877 HHGear: PGear; |
916 HHGear: PGear; |
|
917 vg: PVisualGear; |
878 i: Longword; |
918 i: Longword; |
|
919 aAngle: real; |
879 startX, endX, startY, endY: LongInt; |
920 startX, endX, startY, endY: LongInt; |
880 begin |
921 begin |
881 if Gear^.Target.X <> NoPointX then |
922 if Gear^.Target.X <> NoPointX then |
882 if Gear^.AmmoType = amBee then |
923 if Gear^.AmmoType = amBee then |
883 DrawRotatedF(sprTargetBee, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) |
924 DrawSpriteRotatedF(sprTargetBee, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) |
884 else |
925 else if Gear^.AmmoType = amIceGun then |
885 DrawRotatedF(sprTargetP, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360); |
926 //DrawSprite(sprSnowDust, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, (RealTicks shr 2) mod 8) |
|
927 //DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1, 0, 0, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, (RealTicks shr 2) mod 8, 1, 22, 22, (RealTicks shr 3) mod 360) |
|
928 DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1/(1+(RealTicks shr 8) mod 5), 0, 0, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, (RealTicks shr 2) mod 8, 1, 22, 22, (RealTicks shr 3) mod 360) |
|
929 else |
|
930 DrawSpriteRotatedF(sprTargetP, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360); |
886 |
931 |
887 case Gear^.Kind of |
932 case Gear^.Kind of |
888 gtGrenade: DrawRotated(sprBomb, x, y, 0, Gear^.DirAngle); |
933 gtGrenade: DrawSpriteRotated(sprBomb, x, y, 0, Gear^.DirAngle); |
889 gtSnowball: DrawRotated(sprSnowball, x, y, 0, Gear^.DirAngle); |
934 gtSnowball: DrawSpriteRotated(sprSnowball, x, y, 0, Gear^.DirAngle); |
890 gtGasBomb: DrawRotated(sprCheese, x, y, 0, Gear^.DirAngle); |
935 gtGasBomb: DrawSpriteRotated(sprCheese, x, y, 0, Gear^.DirAngle); |
891 |
936 |
892 gtMolotov: if (Gear^.State and gstDrowning) = 0 then |
937 gtMolotov: if (Gear^.State and gstDrowning) = 0 then |
893 DrawRotatedF(sprMolotov, x, y, (RealTicks div 125) mod 8, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX)) |
938 DrawSpriteRotatedF(sprMolotov, x, y, (RealTicks div 125) mod 8, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX)) |
894 else DrawSprite(sprMolotov, x, y, 8); |
939 else DrawSprite(sprMolotov, x, y, 8); |
895 |
940 |
896 gtRCPlane: begin |
941 gtRCPlane: begin |
|
942 aangle:= Gear^.Angle * 360 / 4096; |
|
943 if Gear^.Tag < 0 then aangle:= 360-aangle; |
897 Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF); |
944 Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF); |
898 if Gear^.Tag = -1 then |
945 DrawSpriteRotatedF(sprPlane, x, y, 0, Gear^.Tag, aangle - 90); |
899 begin |
946 Tint($FF, $FF, $FF, $FF); |
900 DrawRotatedF(sprPlane, x, y, 0, -1, DxDy2Angle(Gear^.dX, Gear^.dY) + 90); |
947 DrawSpriteRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90) |
901 Tint($FF, $FF, $FF, $FF); |
|
902 DrawRotatedF(sprPlane, x, y, 1, -1, DxDy2Angle(Gear^.dX, Gear^.dY) + 90) |
|
903 end |
|
904 else |
|
905 begin |
|
906 DrawRotatedF(sprPlane, x, y, 0, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
|
907 Tint($FF, $FF, $FF, $FF); |
|
908 DrawRotatedF(sprPlane, x, y, 1, 0, DxDy2Angle(Gear^.dY, Gear^.dX)) |
|
909 end |
|
910 end; |
948 end; |
911 gtBall: DrawRotatedf(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle); |
949 gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle); |
912 |
950 |
913 gtPortal: if ((Gear^.Tag and 1) = 0) // still moving? |
951 gtPortal: if ((Gear^.Tag and 1) = 0) // still moving? |
914 or (Gear^.IntersectGear = nil) or (Gear^.IntersectGear^.IntersectGear <> Gear) // not linked&backlinked? |
952 or (Gear^.LinkedGear = nil) or (Gear^.LinkedGear^.LinkedGear <> Gear) // not linked&backlinked? |
915 or ((Gear^.IntersectGear^.Tag and 1) = 0) then // linked portal still moving? |
953 or ((Gear^.LinkedGear^.Tag and 1) = 0) then // linked portal still moving? |
916 DrawRotatedf(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle) |
954 DrawSpriteRotatedF(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle) |
917 else DrawRotatedf(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle); |
955 else DrawSpriteRotatedF(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle); |
918 |
956 |
919 gtDrill: if (Gear^.State and gsttmpFlag) <> 0 then |
957 gtDrill: if (Gear^.State and gsttmpFlag) <> 0 then |
920 DrawRotated(sprAirDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)) |
958 DrawSpriteRotated(sprAirDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)) |
921 else |
959 else |
922 DrawRotated(sprDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
960 DrawSpriteRotated(sprDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
923 |
961 |
924 gtHedgehog: DrawHH(Gear, x, y); |
962 gtHedgehog: DrawHH(Gear, x, y); |
925 |
963 |
926 gtShell: DrawRotated(sprBazookaShell, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
964 gtShell: DrawSpriteRotated(sprBazookaShell, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
927 |
965 |
928 gtGrave: begin |
966 gtGrave: begin |
929 DrawTextureF(Gear^.Hedgehog^.Team^.GraveTex, 1, x, y, (GameTicks shr 7+Gear^.uid) and 7, 1, 32, 32); |
967 DrawTextureF(Gear^.Hedgehog^.Team^.GraveTex, 1, x, y, (GameTicks shr 7+Gear^.uid) and 7, 1, 32, 32); |
930 if Gear^.Health > 0 then |
968 if Gear^.Health > 0 then |
931 begin |
969 begin |
934 //Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750)))); |
972 //Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750)))); |
935 DrawSprite(sprVampiric, x - 24, y - 24, 0); |
973 DrawSprite(sprVampiric, x - 24, y - 24, 0); |
936 Tint($FF, $FF, $FF, $FF) |
974 Tint($FF, $FF, $FF, $FF) |
937 end |
975 end |
938 end; |
976 end; |
939 gtBee: DrawRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
977 gtBee: DrawSpriteRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
940 gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0); |
978 gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0); |
941 gtRope: DrawRope(Gear); |
979 gtRope: DrawRope(Gear); |
|
980 |
942 gtMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
981 gtMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
943 DrawRotated(sprMineOff, x, y, 0, Gear^.DirAngle) |
982 DrawSpriteRotated(sprMineOff, x, y, 0, Gear^.DirAngle) |
944 else if Gear^.Health <> 0 then DrawRotated(sprMineOn, x, y, 0, Gear^.DirAngle) |
983 else if Gear^.Health <> 0 then |
945 else DrawRotated(sprMineDead, x, y, 0, Gear^.DirAngle); |
984 DrawSpriteRotated(sprMineOn, x, y, 0, Gear^.DirAngle) |
|
985 else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle); |
|
986 |
946 gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
987 gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
947 DrawRotated(sprSMineOff, x, y, 0, Gear^.DirAngle) |
988 DrawSpriteRotated(sprSMineOff, x, y, 0, Gear^.DirAngle) |
948 else if Gear^.Health <> 0 then DrawRotated(sprSMineOn, x, y, 0, Gear^.DirAngle) |
989 else if Gear^.Health <> 0 then |
949 else DrawRotated(sprMineDead, x, y, 0, Gear^.DirAngle); |
990 DrawSpriteRotated(sprSMineOn, x, y, 0, Gear^.DirAngle) |
950 gtCase: if ((Gear^.Pos and posCaseAmmo) <> 0) then |
991 else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle); |
951 begin |
992 gtKnife: DrawSpriteRotatedF(sprKnife, x, y, 0, hwSign(Gear^.dX), Gear^.DirAngle); |
952 i:= (GameTicks shr 6) mod 64; |
993 |
953 if i > 18 then i:= 0; |
994 gtCase: begin |
954 DrawSprite(sprCase, x - 24, y - 24, i); |
995 if Gear^.Timer > 1000 then |
|
996 begin |
|
997 if ((Gear^.Pos and posCaseAmmo) <> 0) then |
|
998 begin |
|
999 i:= (GameTicks shr 6) mod 64; |
|
1000 if i > 18 then |
|
1001 i:= 0; |
|
1002 DrawSprite(sprCase, x - 24, y - 24, i); |
|
1003 end |
|
1004 else if ((Gear^.Pos and posCaseHealth) <> 0) then |
|
1005 begin |
|
1006 i:= ((GameTicks shr 6) + 38) mod 64; |
|
1007 if i > 13 then |
|
1008 i:= 0; |
|
1009 DrawSprite(sprFAid, x - 24, y - 24, i); |
|
1010 end |
|
1011 else if ((Gear^.Pos and posCaseUtility) <> 0) then |
|
1012 begin |
|
1013 i:= (GameTicks shr 6) mod 70; |
|
1014 if i > 23 then |
|
1015 i:= 0; |
|
1016 i:= i mod 12; |
|
1017 DrawSprite(sprUtility, x - 24, y - 24, i); |
|
1018 end; |
|
1019 end; |
|
1020 if Gear^.Timer < 1833 then |
|
1021 begin |
|
1022 DrawTextureRotatedF(SpritesData[sprPortal].texture, min(abs(1.25 - (Gear^.Timer mod 1333) / 400), 1.25), 0, 0, |
|
1023 x, LongInt(Gear^.Angle) + WorldDy - 16, 4 + Gear^.Tag, 1, 32, 32, 270); |
955 end |
1024 end |
956 else if ((Gear^.Pos and posCaseHealth) <> 0) then |
1025 end; |
957 begin |
|
958 i:= ((GameTicks shr 6) + 38) mod 64; |
|
959 if i > 13 then i:= 0; |
|
960 DrawSprite(sprFAid, x - 24, y - 24, i); |
|
961 end |
|
962 else if ((Gear^.Pos and posCaseUtility) <> 0) then |
|
963 begin |
|
964 i:= (GameTicks shr 6) mod 70; |
|
965 if i > 23 then i:= 0; |
|
966 i:= i mod 12; |
|
967 DrawSprite(sprUtility, x - 24, y - 24, i); |
|
968 end; |
|
969 gtExplosives: begin |
1026 gtExplosives: begin |
970 if ((Gear^.State and gstDrowning) <> 0) then |
1027 if ((Gear^.State and gstDrowning) <> 0) then |
971 DrawSprite(sprExplosivesRoll, x - 24, y - 24, 0) |
1028 DrawSprite(sprExplosivesRoll, x - 24, y - 24, 0) |
972 else if Gear^.State and gstAnimation = 0 then |
1029 else if Gear^.State and gstAnimation = 0 then |
973 begin |
1030 begin |
974 i:= (GameTicks shr 6 + Gear^.uid*3) mod 64; |
1031 i:= (GameTicks shr 6 + Gear^.uid*3) mod 64; |
975 if i > 18 then i:= 0; |
1032 if i > 18 then |
|
1033 i:= 0; |
976 DrawSprite(sprExplosives, x - 24, y - 24, i) |
1034 DrawSprite(sprExplosives, x - 24, y - 24, i) |
977 end |
1035 end |
978 else if Gear^.State and gsttmpFlag = 0 then |
1036 else if Gear^.State and gsttmpFlag = 0 then |
979 DrawRotatedF(sprExplosivesRoll, x, y + 4, 0, 0, Gear^.DirAngle) |
1037 DrawSpriteRotatedF(sprExplosivesRoll, x, y + 4, 0, 0, Gear^.DirAngle) |
980 else |
1038 else |
981 DrawRotatedF(sprExplosivesRoll, x, y + 4, 1, 0, Gear^.DirAngle); |
1039 DrawSpriteRotatedF(sprExplosivesRoll, x, y + 4, 1, 0, Gear^.DirAngle); |
982 end; |
1040 end; |
983 gtDynamite: DrawSprite2(sprDynamite, x - 16, y - 25, Gear^.Tag and 1, Gear^.Tag shr 1); |
1041 gtDynamite: DrawSprite(sprDynamite, x - 16, y - 25, Gear^.Tag and 1, Gear^.Tag shr 1); |
984 gtClusterBomb: DrawRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle); |
1042 gtClusterBomb: DrawSpriteRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle); |
985 gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0); |
1043 gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0); |
986 gtFlame: if Gear^.Tag and 1 = 0 then |
1044 gtFlame: if Gear^.Tag and 1 = 0 then |
987 DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16) |
1045 DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16) |
988 else DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, -1, 16, 16); |
1046 else DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, -1, 16, 16); |
989 gtParachute: begin |
1047 gtParachute: begin |
990 DrawSprite(sprParachute, x - 24, y - 48, 0); |
1048 DrawSprite(sprParachute, x - 24, y - 48, 0); |
991 DrawAltWeapon(Gear, x + 1, y - 3) |
1049 DrawAltWeapon(Gear, x + 1, y - 3) |
992 end; |
1050 end; |
993 gtAirAttack: begin |
1051 gtAirAttack: begin |
994 Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF); |
1052 Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF); |
995 DrawRotatedF(sprAirplane, x, y, 0, Gear^.Tag, 0); |
1053 DrawSpriteRotatedF(sprAirplane, x, y, 0, Gear^.Tag, 0); |
996 Tint($FF, $FF, $FF, $FF); |
1054 Tint($FF, $FF, $FF, $FF); |
997 DrawRotatedF(sprAirplane, x, y, 1, Gear^.Tag, 0); |
1055 DrawSpriteRotatedF(sprAirplane, x, y, 1, Gear^.Tag, 0); |
998 end; |
1056 end; |
999 gtAirBomb: DrawRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
1057 gtAirBomb: DrawSpriteRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
1000 gtTeleport: begin |
1058 gtTeleport: begin |
1001 HHGear:= Gear^.Hedgehog^.Gear; |
1059 HHGear:= Gear^.Hedgehog^.Gear; |
1002 if not Gear^.Hedgehog^.Unplaced then DrawRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0); |
1060 if not Gear^.Hedgehog^.Unplaced then |
1003 DrawRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0); |
1061 DrawSpriteRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0); |
|
1062 DrawSpriteRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0); |
1004 end; |
1063 end; |
1005 gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (GameTicks shr 6) mod 12); |
1064 gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (GameTicks shr 6) mod 12); |
1006 gtTarget: begin |
1065 gtTarget: begin |
1007 Tint($FF, $FF, $FF, round($FF * Gear^.Timer / 1000)); |
1066 Tint($FF, $FF, $FF, round($FF * Gear^.Timer / 1000)); |
1008 DrawSprite(sprTarget, x - 16, y - 16, 0); |
1067 DrawSprite(sprTarget, x - 16, y - 16, 0); |
1009 Tint($FF, $FF, $FF, $FF); |
1068 Tint($FF, $FF, $FF, $FF); |
1010 end; |
1069 end; |
1011 gtMortar: DrawRotated(sprMortar, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
1070 gtMortar: DrawSpriteRotated(sprMortar, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
1012 gtCake: if Gear^.Pos = 6 then |
1071 gtCake: if Gear^.Pos = 6 then |
1013 DrawRotatedf(sprCakeWalk, x, y, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90) |
1072 DrawSpriteRotatedF(sprCakeWalk, x, y, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90) |
1014 else |
1073 else |
1015 DrawRotatedf(sprCakeDown, x, y, 5 - Gear^.Pos, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90); |
1074 DrawSpriteRotatedF(sprCakeDown, x, y, 5 - Gear^.Pos, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90); |
1016 gtSeduction: if Gear^.Pos >= 14 then DrawSprite(sprSeduction, x - 16, y - 16, 0); |
1075 gtSeduction: if Gear^.Pos >= 14 then |
1017 gtWatermelon: DrawRotatedf(sprWatermelon, x, y, 0, 0, Gear^.DirAngle); |
1076 DrawSprite(sprSeduction, x - 16, y - 16, 0); |
1018 gtMelonPiece: DrawRotatedf(sprWatermelon, x, y, 1, 0, Gear^.DirAngle); |
1077 |
1019 gtHellishBomb: DrawRotated(sprHellishBomb, x, y, 0, Gear^.DirAngle); |
1078 gtWatermelon: DrawSpriteRotatedF(sprWatermelon, x, y, 0, 0, Gear^.DirAngle); |
|
1079 gtMelonPiece: DrawSpriteRotatedF(sprWatermelon, x, y, 1, 0, Gear^.DirAngle); |
|
1080 gtHellishBomb: DrawSpriteRotated(sprHellishBomb, x, y, 0, Gear^.DirAngle); |
1020 gtBirdy: begin |
1081 gtBirdy: begin |
1021 if Gear^.State and gstAnimation = gstAnimation then |
1082 if Gear^.State and gstAnimation = gstAnimation then |
1022 begin |
1083 begin |
1023 if Gear^.State and gstTmpFlag = 0 then // Appearing |
1084 if Gear^.State and gstTmpFlag = 0 then // Appearing |
1024 begin |
1085 begin |
1025 endX:= x - WorldDx; |
1086 endX:= x - WorldDx; |
1026 endY:= y - WorldDy; |
1087 endY:= y - WorldDy; |
1027 if Gear^.Tag < 0 then |
1088 if Gear^.Tag < 0 then |
1028 startX:= max(LAND_WIDTH + 1024, endX + 2048) |
1089 startX:= max(max(LAND_WIDTH,4096) + 1024, endX + 2048) |
1029 else |
1090 else |
1030 startX:= max(-LAND_WIDTH - 1024, endX - 2048); |
1091 startX:= max(-max(LAND_WIDTH,4096) - 1024, endX - 2048); |
1031 startY:= endY - 256; |
1092 startY:= endY - 256; |
1032 DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + LongInt(round((endX - startX) * (-power(2, -10 * LongInt(Gear^.Timer)/2000) + 1))), startY + WorldDy + LongInt(round((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); |
1093 DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + LongInt(round((endX - startX) * (-power(2, -10 * LongInt(Gear^.Timer)/2000) + 1))), startY + WorldDy + LongInt(round((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); |
1033 end |
1094 end |
1034 else // Disappearing |
1095 else // Disappearing |
1035 begin |
1096 begin |
1036 startX:= x - WorldDx; |
1097 startX:= x - WorldDx; |
1037 startY:= y - WorldDy; |
1098 startY:= y - WorldDy; |
1038 if Gear^.Tag > 0 then |
1099 if Gear^.Tag > 0 then |
1039 endX:= max(LAND_WIDTH + 1024, startX + 2048) |
1100 endX:= max(max(LAND_WIDTH,4096) + 1024, startX + 2048) |
1040 else |
1101 else |
1041 endX:= max(-LAND_WIDTH - 1024, startX - 2048); |
1102 endX:= max(-max(LAND_WIDTH,4096) - 1024, startX - 2048); |
1042 endY:= startY + 256; |
1103 endY:= startY + 256; |
1043 DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + LongInt(round((endX - startX) * power(2, 10 * (LongInt(Gear^.Timer)/2000 - 1)))) + hwRound(Gear^.dX * Gear^.Timer), startY + WorldDy + LongInt(round((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); |
1104 DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + LongInt(round((endX - startX) * power(2, 10 * (LongInt(Gear^.Timer)/2000 - 1)))) + hwRound(Gear^.dX * Gear^.Timer), startY + WorldDy + LongInt(round((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); |
1044 end; |
1105 end; |
1045 end |
1106 end |
1046 else |
1107 else |
1067 Tint($C0, $C0, $00, Gear^.Timer div 8) |
1128 Tint($C0, $C0, $00, Gear^.Timer div 8) |
1068 else if Gear^.Timer > 3980 then |
1129 else if Gear^.Timer > 3980 then |
1069 Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8) |
1130 Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8) |
1070 else |
1131 else |
1071 Tint($C0, $C0, $00, $C0); |
1132 Tint($C0, $C0, $00, $C0); |
1072 DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360); |
1133 DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360); |
1073 Tint($FF, $FF, $FF, $FF) |
1134 Tint($FF, $FF, $FF, $FF) |
1074 end; |
1135 end; |
1075 gtResurrector: begin |
1136 gtResurrector: begin |
1076 DrawRotated(sprCross, x, y, 0, 0); |
1137 DrawSpriteRotated(sprCross, x, y, 0, 0); |
1077 Tint($f5, $db, $35, max($00, round($C0 * abs(1 - (GameTicks mod 6000) / 3000)))); |
1138 Tint($f5, $db, $35, max($00, round($C0 * abs(1 - (GameTicks mod 6000) / 3000)))); |
1078 DrawTexture(x - 108, y - 108, SpritesData[sprVampiric].Texture, 4.5); |
1139 DrawTexture(x - 108, y - 108, SpritesData[sprVampiric].Texture, 4.5); |
1079 Tint($FF, $FF, $FF, $FF); |
1140 Tint($FF, $FF, $FF, $FF); |
1080 end; |
1141 end; |
1081 gtNapalmBomb: DrawRotated(sprNapalmBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
1142 gtNapalmBomb: DrawSpriteRotated(sprNapalmBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
1082 gtFlake: if Gear^.State and (gstDrowning or gstTmpFlag) <> 0 then |
1143 gtFlake: if Gear^.State and (gstDrowning or gstTmpFlag) <> 0 then |
1083 begin |
1144 begin |
1084 Tint((cExplosionBorderColor shr RShift) and $FF, |
1145 Tint((ExplosionBorderColor shr RShift) and $FF, |
1085 (cExplosionBorderColor shr GShift) and $FF, |
1146 (ExplosionBorderColor shr GShift) and $FF, |
1086 (cExplosionBorderColor shr BShift) and $FF, |
1147 (ExplosionBorderColor shr BShift) and $FF, |
1087 $FF); |
1148 $FF); |
1088 // Needs a nicer white texture to tint |
1149 // Needs a nicer white texture to tint |
1089 DrawRotatedTextureF(SpritesData[sprSnowDust].Texture, 1, 0, 0, x, y, 0, 1, 8, 8, Gear^.DirAngle); |
1150 DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1, 0, 0, x, y, 0, 1, 8, 8, Gear^.DirAngle); |
1090 //DrawRotated(sprSnowDust, x, y, 0, Gear^.DirAngle); |
1151 //DrawSpriteRotated(sprSnowDust, x, y, 0, Gear^.DirAngle); |
1091 //DrawTexture(x, y, SpritesData[sprVampiric].Texture, 0.1); |
1152 //DrawTexture(x, y, SpritesData[sprVampiric].Texture, 0.1); |
1092 Tint($FF, $FF, $FF, $FF); |
1153 Tint($FF, $FF, $FF, $FF); |
1093 end |
1154 end |
1094 else //if not isInLag then |
1155 else //if not isInLag then |
1095 begin |
1156 begin |
1096 if isInLag and (Gear^.FlightTime < 256) then inc(Gear^.FlightTime, 8) |
1157 if isInLag and (Gear^.FlightTime < 256) then |
1097 else if not isInLag and (Gear^.FlightTime > 0) then dec(Gear^.FlightTime, 8); |
1158 inc(Gear^.FlightTime, 8) |
1098 if Gear^.FlightTime > 0 then Tint($FF, $FF, $FF, $FF-min(255,Gear^.FlightTime)); |
1159 else if not isInLag and (Gear^.FlightTime > 0) then |
|
1160 dec(Gear^.FlightTime, 8); |
|
1161 if Gear^.FlightTime > 0 then |
|
1162 Tint($FF, $FF, $FF, $FF-min(255,Gear^.FlightTime)); |
1099 if vobVelocity = 0 then |
1163 if vobVelocity = 0 then |
1100 DrawSprite(sprFlake, x, y, Gear^.Timer) |
1164 DrawSprite(sprFlake, x, y, Gear^.Timer) |
1101 else |
1165 else |
1102 DrawRotatedF(sprFlake, x, y, Gear^.Timer, 1, Gear^.DirAngle); |
1166 DrawSpriteRotatedF(sprFlake, x, y, Gear^.Timer, 1, Gear^.DirAngle); |
1103 //DrawSprite(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer) |
1167 //DrawSprite(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer) |
1104 //DrawRotatedF(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer, 1, Gear^.DirAngle); |
1168 //DrawSpriteRotatedF(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer, 1, Gear^.DirAngle); |
1105 if Gear^.FlightTime > 0 then Tint($FF, $FF, $FF, $FF); |
1169 if Gear^.FlightTime > 0 then |
|
1170 Tint($FF, $FF, $FF, $FF); |
1106 end; |
1171 end; |
1107 gtStructure: DrawSprite(sprTarget, x - 16, y - 16, 0); |
1172 gtStructure: DrawSprite(sprTarget, x - 16, y - 16, 0); |
1108 gtTardis: if Gear^.Pos <> 4 then |
1173 gtTardis: if Gear^.Pos <> 4 then |
1109 begin |
1174 begin |
1110 if Gear^.Pos = 2 then Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF) |
1175 if Gear^.Pos = 2 then |
1111 else Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or max($00, round(Gear^.Power * (1-abs(0.5 - (GameTicks mod 2000) / 2000))))); |
1176 Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF) |
|
1177 else |
|
1178 Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or max($00, round(Gear^.Power * (1-abs(0.5 - (GameTicks mod 2000) / 2000))))); |
1112 DrawSprite(sprTardis, x-24, y-63,0); |
1179 DrawSprite(sprTardis, x-24, y-63,0); |
1113 if Gear^.Pos = 2 then Tint($FF, $FF, $FF, $FF) |
1180 if Gear^.Pos = 2 then |
1114 else Tint($FF,$FF,$FF,max($00, round(Gear^.Power * (1-abs(0.5 - (GameTicks mod 2000) / 2000))))); |
1181 Tint($FF, $FF, $FF, $FF) |
|
1182 else |
|
1183 Tint($FF,$FF,$FF,max($00, round(Gear^.Power * (1-abs(0.5 - (GameTicks mod 2000) / 2000))))); |
1115 DrawSprite(sprTardis, x-24, y-63,1); |
1184 DrawSprite(sprTardis, x-24, y-63,1); |
1116 if Gear^.Pos <> 2 then Tint($FF, $FF, $FF, $FF) |
1185 if Gear^.Pos <> 2 then |
|
1186 Tint($FF, $FF, $FF, $FF) |
1117 (* |
1187 (* |
1118 Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or max($00, round(Gear^.Power * abs(1 - (RealTicks mod 500) / 250)))); |
1188 Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or max($00, round(Gear^.Power * abs(1 - (RealTicks mod 500) / 250)))); |
1119 DrawTexture(x-6, y-70, SpritesData[sprVampiric].Texture, 0.25); |
1189 DrawTexture(x-6, y-70, SpritesData[sprVampiric].Texture, 0.25); |
1120 Tint($FF, $FF, $FF, $FF) |
1190 Tint($FF, $FF, $FF, $FF) |
1121 *) |
1191 *) |
1122 end; |
1192 end; |
1123 |
1193 gtIceGun: begin |
1124 |
1194 HHGear := Gear^.Hedgehog^.Gear; |
|
1195 if HHGear <> nil then |
|
1196 begin |
|
1197 i:= hwRound(hwSqr(Gear^.X - HHGear^.X) + hwSqr(Gear^.Y - HHGear^.Y)); |
|
1198 if RealTicks mod max(1,50 - (round(sqrt(i)) div 4)) = 0 then // experiment in "intensifying" might not get used |
|
1199 begin |
|
1200 vg:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1); |
|
1201 if vg <> nil then |
|
1202 begin |
|
1203 i:= random(100) + 155; |
|
1204 vg^.Tint:= i shl 24 or i shl 16 or $FF shl 8 or Longword(random(200) + 55); |
|
1205 vg^.Angle:= random(360); |
|
1206 vg^.dx:= 0.001 * random(80); |
|
1207 vg^.dy:= 0.001 * random(80) |
|
1208 end |
|
1209 end; |
|
1210 if RealTicks mod 2 = 0 then |
|
1211 begin |
|
1212 i:= random(100)+100; |
|
1213 if Gear^.Target.X <> NoPointX then |
|
1214 DrawLine(Gear^.Target.X, Gear^.Target.Y, hwRound(HHGear^.X), hwRound(HHGear^.Y), 4.0, i, i, $FF, $40) |
|
1215 else DrawLine(hwRound(HHGear^.X), hwRound(HHGear^.Y), hwRound(Gear^.X), hwRound(Gear^.Y), 4.0, i, i, $FF, $40); |
|
1216 end |
|
1217 end |
|
1218 end; |
|
1219 gtGenericFaller: DrawCircle(x, y, 3, 3, $FF, $00, $00, $FF); // debug |
1125 end; |
1220 end; |
1126 if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(x + 8, y + 8, Gear^.Tex); |
1221 if Gear^.RenderTimer and (Gear^.Tex <> nil) then |
|
1222 DrawTextureCentered(x + 8, y + 8, Gear^.Tex); |
1127 end; |
1223 end; |
1128 |
1224 |
1129 end. |
1225 end. |