// To turn on hold ADS and then press left on the D-Pad. Same to turn back off.
define SurrosToggleOnOff = PS4_LEFT;
define VerticleRecoil = PS4_RY;
define HorizontalRecoil = PS4_RX;
define Reload = PS4_SQUARE;
define WeaponChange = PS4_TRIANGLE;
int ToggleSuros = FALSE; // Keep off by default.
int Weapon_Switch_Check_Time, GunFlags;
int AntiRecoilP, anti_recoilP, ANTI_RECOILP;
int RecoilAmountP = 0;
int ADS, Shoot;
// Change this value to swap Fire and ADS buttons to top.
// A value of 1 uses the bottom triggers for shoot and ADS.
// A value of 2 uses the top bumpers for shoot and ADS.
int ButtonSwap = 1;
init {
if(ButtonSwap == 1) {
ADS = PS4_L2;
Shoot = PS4_R2;
} else if(ButtonSwap == 2) {
ADS = PS4_L1;
Shoot = PS4_R1;
}
combo_run(Initialize);
}
main {
vm_tctrl(-8);
if(event_press(PS4_R3)) combo_run(Initialize);
if (get_val(PS4_TRIANGLE) && ToggleSuros) {
Weapon_Switch_Check_Time = get_ptime(WeaponChange);
}
if(event_release(PS4_TRIANGLE) && ToggleSuros) combo_run(Check_Heavy_Weapon_Change);
if(get_val(Shoot) && test_bit(GunFlags, 1) && ToggleSuros) {
set_val(ADS, 100);
combo_run(RapidFire);
}
if(get_val(ADS) && event_press(SurrosToggleOnOff)) {
if(ToggleSuros) {
ToggleSuros = FALSE;
LED(0,1,0,0);
} else if(!ToggleSuros) {
ToggleSuros = TRUE;
combo_run(Initialize);
}
}
}
combo RapidFire {
set_val(Shoot, 0);
wait(39);
set_val(Shoot, 100);
wait(39);
}
combo Initialize {
clear_bit(GunFlags, 2);
clear_bit(GunFlags, 3);
set_bit(GunFlags, 1);
LED(1, 1, 1, 1);
}
combo Check_Heavy_Weapon_Change {
if (Weapon_Switch_Check_Time <= 200) {
if (test_bit(GunFlags, 1)){
clear_bit(GunFlags, 1);
set_bit(GunFlags, 2);
LED(0, 0, 1, 0);
}
else if (test_bit(GunFlags, 2) || test_bit(GunFlags, 3)){
clear_bit(GunFlags, 2);
clear_bit(GunFlags, 3);
set_bit(GunFlags, 1);
LED(1, 1, 1, 1);
}
}
else {
clear_bit(GunFlags, 1);
clear_bit(GunFlags, 2);
set_bit(GunFlags, 3);
LED(0, 0, 0, 1);
}
wait (10);
Weapon_Switch_Check_Time = 0;
}
function LED(a, b, c, d) {
set_led(0, a);
set_led(1, b);
set_led(2, c);
set_led(3, d);
}