Advertisement
Bagura32rus

новый игровой 20.09.2019

Sep 20th, 2019
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. #include <xb1.gph>
  2.  
  3. #define float fix32
  4.  
  5. // Rapidfire values
  6. #define RF_HOLD 40
  7. #define RF_RELEASE 90
  8.  
  9. //Anti Recoil value
  10. #define AR 26.00
  11. uint16 ARecoilDelay = 115;
  12. float MinARecoilPercent = 30.0;
  13. float StickNoise = 6.32;
  14.  
  15. bool rapidfire;
  16.  
  17. init {
  18. led(255,0,0);
  19. }
  20.  
  21. main {
  22. // ADS + DPAD UP to toggle rapidfire
  23. if (is_active(7) && event_active(9)) {
  24. rapidfire = !rapidfire;
  25. if(rapidfire) led(0,255,0);
  26. else led(255,0,0);
  27. }
  28.  
  29. if (get_actual(BUTTON_8) &&get_actual(BUTTON_5) && time_active(BUTTON_5) >= ARecoilDelay){
  30. if (abs(get_actual(STICK_1_X)) < StickNoise) set_val(STICK_1_X, 0.0);
  31. if (abs(get_actual(STICK_1_Y)) < StickNoise) set_val(STICK_1_Y, 0.0);
  32. if (abs(get_actual(STICK_2_X)) < StickNoise) set_val(STICK_2_X, 0.0);
  33. if (abs(get_actual(STICK_2_Y)) < StickNoise) set_val(STICK_2_Y, 0.0);
  34.  
  35. AntiRecoil(STICK_1_Y, AR);
  36. }
  37.  
  38. if(get_actual(4) && rapidfire) combo_run(RapidFire);
  39. ;
  40. ;
  41. if(is_active(XB1_UP) && is_active(XB1_DOWN)) {
  42. set_val(XB1_UP, 0); set_val(XB1_DOWN, 0);
  43. if(event_active(XB1_UP)) combo_run(prone);
  44. }
  45. }
  46.  
  47. combo RapidFire {
  48. set_val(4, 100);
  49. wait(RF_HOLD);
  50. set_val(4, 0);
  51. wait(RF_RELEASE);
  52. }
  53.  
  54. combo prone {
  55. set_val(XB1_B, 100);
  56. wait(300);
  57. }
  58.  
  59. void led(int8 r, int8 g, int8 b) {
  60. led_set(LED_1, (fix32)b, 0);
  61. led_set(LED_2, (fix32)r, 0);
  62. led_set(LED_3, (fix32)g, 0);
  63. return;
  64. }
  65.  
  66. void AntiRecoil(uint8 AxisToApply, float ARecoilToApply) {
  67. float CurrentX = get_val(STICK_1_X);
  68. float CurrentY = get_val(STICK_1_Y);
  69. float MinARecoilFactor = MinARecoilPercent / 100.0;
  70. float MinARecoilToApply = MinARecoilFactor * ARecoilToApply;
  71. //This sets the ARecoil to be dependent on both X and Y axis movement. With more emphasis on Y
  72. float MovementARecoilToApply = (1.0 - MinARecoilFactor) * ((ARecoilToApply * (100.0 - sqrt(CurrentX*CurrentX + CurrentY*CurrentY))) / (100.0 + abs(CurrentX) + (CurrentY*CurrentY*0.5)));
  73. set_val(AxisToApply,clamp(MinARecoilToApply + MovementARecoilToApply + get_val(AxisToApply),-100.00,100.00 - MinARecoilToApply));
  74. }
  75. bool run_flag;
  76.  
  77. main
  78. {
  79. if(!get_actual(BUTTON_5) && !get_actual(BUTTON_8) && !run_flag &&
  80. get_val(STICK_2_Y) < -99.0 && time_active(STICK_2_Y) > 300) {
  81. run_flag = 1;
  82. combo_run(run);
  83. }else if(get_val(STICK_2_Y) > -99.0 && event_release(STICK_2_Y)) {
  84. run_flag = 0;
  85. }
  86. }
  87.  
  88. combo run
  89. {
  90. set_val(BUTTON_9, 0.0);
  91. wait(200);
  92. set_val(BUTTON_9, 100.0);
  93. wait(400);
  94. set_val(BUTTON_9, 0.0);
  95. }
  96. bool toggle;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement