Advertisement
Chronos_Ouroboros

Sprint System 2

Aug 3rd, 2014
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  1. // DECORATE
  2. Actor NullWeapon : Weapon {
  3. Tag "Unarmed"
  4. +Inventory.Undroppable +Weapon.Wimpy_Weapon +Weapon.CheatNotWeapon +NoInteraction
  5. +Weapon.NoAlert
  6. Height 0
  7. Radius 0
  8. States {
  9. Spawn:
  10. TNT1 A 0
  11. Stop
  12. Select:
  13. TNT1 A 1 A_Raise
  14. TNT1 A 0 A_Raise
  15. Wait
  16. Deselect:
  17. TNT1 A 0 A_Lower
  18. Wait
  19. Ready:
  20. TNT1 A 1 A_WeaponReady (WRF_NOFIRE|WRF_NOBOB|WRF_NOSWITCH)
  21. Loop
  22. Fire:
  23. TNT1 A 1
  24. Goto Ready
  25. }
  26. }
  27.  
  28. Actor FDSprinting : Boolean { }
  29. Actor SprintWeapon : NullWeapon {
  30. States {
  31. Ready:
  32. TNT1 A 1 A_WeaponReady (WRF_NOFIRE|WRF_NOBOB|WRF_NOSWITCH)
  33. TNT1 A 1 A_GiveInventory ("FDSprinting", 1)
  34. TNT1 A 1 A_WeaponReady (WRF_NOFIRE|WRF_NOBOB|WRF_NOSWITCH)
  35. Wait
  36. Deselect:
  37. TNT1 A 1 A_TakeInventory ("FDSprinting", 99999)
  38. TNT1 A 1 A_Lower
  39. TNT1 A 0 A_Lower
  40. Wait
  41. }
  42. }
  43.  
  44. // ACS
  45. int FD_SS_OldSpeed [MAXPLAYERS];
  46. int FD_SS_Sprinting [MAXPLAYERS];
  47. int FD_SR_StaminaEmpty [MAXPLAYERS];
  48. script "FDSprintSystem" ENTER {
  49. if (GameType () == Game_Title_Map) Terminate;
  50. int tics = 0;
  51. While (TRUE) {
  52. if (CheckInventory ("SprintWeapon") && FD_SS_Sprinting [PlayerNumber ()] == 0) {
  53. SetActorProperty (0, APROP_Speed, FD_SS_OldSpeed [PlayerNumber ()]);
  54. DisableWeapon ("SprintWeapon");
  55. FD_SS_Sprinting [PlayerNumber ()] = 0;
  56. tics = 0;
  57. }
  58. if (keyDown (BT_USER1) && FD_SS_Sprinting [PlayerNumber ()] == 0 && CheckInventory ("FDStamina") >= 5 && !FD_SR_StaminaEmpty [PlayerNumber ()]) {
  59. DisableWeapon ("SprintWeapon");
  60. FD_SS_Sprinting [PlayerNumber ()] = 1;
  61. FD_SS_OldSpeed [PlayerNumber ()] = GetActorProperty (0, APROP_Speed);
  62. }
  63. if (keyUp (BT_USER1) && FD_SS_Sprinting [PlayerNumber ()] && !FD_SR_StaminaEmpty [PlayerNumber ()]) {
  64. SetActorProperty (0, APROP_Speed, FD_SS_OldSpeed [PlayerNumber ()]);
  65. DisableWeapon ("SprintWeapon");
  66. FD_SS_Sprinting [PlayerNumber ()] = 0;
  67. tics = 0;
  68. }
  69. if (CheckInventory ("FDSprinting") && FD_SS_Sprinting [PlayerNumber ()]) {
  70. if (CheckInventory ("FDStamina") >= 5)
  71. {
  72. if (CheckInventory ("FDSprinting") && tics >= 5) {
  73. tics = 0;
  74. if (!CheckInventory("PowerAgilityRune") && GetVelocity () > 0)
  75. TakeInventory ("FDStamina", 5);
  76. }
  77. if (CheckInventory ("FDStamina") < 5) {
  78. SetActorProperty (0, APROP_Speed, FD_SS_OldSpeed [PlayerNumber ()]);
  79. DisableWeapon ("SprintWeapon");
  80. FD_SS_Sprinting [PlayerNumber ()] = 0;
  81. FD_SR_StaminaEmpty [PlayerNumber ()] = 1;
  82. restart;
  83. }
  84. if (CheckInventory ("FDSprinting") && ((abs (GetPlayerInput (-1, INPUT_FORWARDMOVE)) > 6400) || (abs (GetPlayerInput(-1, INPUT_SIDEMOVE)) > 6400)))
  85. SetActorProperty (0, APROP_Speed, 1.6);
  86. else if (CheckInventory ("FDSprinting") && !((abs (GetPlayerInput (-1, INPUT_FORWARDMOVE)) > 6400) || (abs (GetPlayerInput(-1, INPUT_SIDEMOVE)) > 6400)))
  87. SetActorProperty (0, APROP_Speed, 2.6);
  88. else if (!CheckInventory ("FDSprinting"))
  89. SetActorProperty (0, APROP_Speed, FD_SS_OldSpeed [PlayerNumber ()]);
  90. }
  91. }
  92. Delay (1);
  93. if (FD_SS_Sprinting [PlayerNumber ()])
  94. tics++;
  95. }
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement