From 8263095ab9f8c14863dfe05d86fc85dab3a46939 Mon Sep 17 00:00:00 2001 From: Jonah Pool Date: Tue, 17 Oct 2023 07:33:23 -0400 Subject: [PATCH] Move weapon arsenal whitelists to init_logistics (#1051) * Move weapon arsenal whitelists to init_logistics * Fixed formating of arsenal items * More concise naming of UGL category --- cScripts/functions/init/fn_init_logistics.sqf | 211 ++++++++++++++++- .../systems/fn_getArsenalWhitelist.sqf | 213 +----------------- 2 files changed, 215 insertions(+), 209 deletions(-) diff --git a/cScripts/functions/init/fn_init_logistics.sqf b/cScripts/functions/init/fn_init_logistics.sqf index e6014167c..29de549a5 100644 --- a/cScripts/functions/init/fn_init_logistics.sqf +++ b/cScripts/functions/init/fn_init_logistics.sqf @@ -1342,7 +1342,7 @@ private _dataArray = [ ["ACE_1Rnd_82mm_Mo_HE_LaserGuided", 0], ["ACE_1Rnd_82mm_Mo_Smoke", 0] ]], - + // Roles ["arsenal_role_officer", [ ["ACE_microDAGR", 0], ["ACE_HuntIR_monitor", 0], @@ -1527,7 +1527,216 @@ private _dataArray = [ ["USP_TACTICAL_PACK_MCB_CCT7", 0], ["USP_TACTICAL_PACK_MCB_CCT8", 0], ["UK3CB_US_B_B_RIF_OCP_Radio", 0] + ]], + // Weapons + ["arsenal_weap_ugl", [ + ["rhs_weap_m4a1_m320", 0], + ["rhs_weap_mk18_m320", 0], + ["rhs_weap_M320", 0], + ["rhs_weap_m4a1_carryhandle", 0], + ["rhs_weap_m4a1_carryhandle_mstock", 0], + ["rhs_weap_m4a1", 0], + ["rhs_weap_m4a1_mstock", 0], + ["rhs_weap_m4a1_d", 0], + ["rhs_weap_m4a1_d_mstock", 0], + ["rhs_weap_m4a1_wd", 0], + ["rhs_weap_m4a1_wd_mstock", 0], + + ["rhs_weap_m4a1_blockII", 0], + ["rhs_weap_m4a1_blockII_KAC", 0], + ["rhs_weap_m4a1_blockII_bk", 0], + ["rhs_weap_m4a1_blockII_KAC_bk", 0], + ["rhs_weap_m4a1_blockII_d", 0], + ["rhs_weap_m4a1_blockII_KAC_d", 0], + ["rhs_weap_m4a1_blockII_wd", 0], + ["rhs_weap_m4a1_blockII_KAC_wd", 0], + + ["rhs_weap_mk18", 0], + ["rhs_weap_mk18_bk", 0], + ["rhs_weap_mk18_KAC_bk", 0], + ["rhs_weap_mk18_d", 0], + ["rhs_weap_mk18_KAC_d", 0], + ["rhs_weap_mk18_KAC", 0], + ["rhs_weap_mk18_wd", 0], + ["rhs_weap_mk18_KAC_wd", 0], + + //Attachments + ["rhsusf_acc_sf3p556", 0], + ["rhsusf_acc_eotech", 0], + ["rhsusf_acc_g33_t1", 0], + ["rhsusf_acc_g33_xps3", 0], + ["rhsusf_acc_g33_xps3_tan", 0], + ["rhsusf_acc_elcan", 0], + ["rhsusf_acc_acog", 0], + ["rhsusf_acc_acog2", 0], + ["rhsusf_acc_acog3", 0], + ["rhsusf_acc_eotech_552", 0], + ["rhsusf_acc_eotech_552_d", 0], + ["rhsusf_acc_eotech_552_wd", 0], + ["rhsusf_acc_compm4", 0], + ["rhsusf_acc_su230", 0], + ["rhsusf_acc_su230_c", 0], + ["rhsusf_acc_su230_mrds", 0], + ["rhsusf_acc_su230_mrds_c", 0], + ["rhsusf_acc_t1_high", 0], + ["rhsusf_acc_acog_rmr", 0], + ["rhsusf_acc_acog_d", 0], + ["rhsusf_acc_acog_wd", 0], + ["rhsusf_acc_grip2", 0], + ["rhsusf_acc_grip2_tan", 0], + ["rhsusf_acc_grip2_wd", 0], + ["rhsusf_acc_grip1", 0], + ["rhsusf_acc_kac_grip", 0], + ["rhsusf_acc_rvg_blk", 0], + ["rhsusf_acc_rvg_de", 0], + ["rhsusf_acc_tdstubby_blk", 0], + ["rhsusf_acc_tdstubby_tan", 0], + ["rhsusf_acc_grip3", 0], + ["rhsusf_acc_grip3_tan", 0], + ["rhsusf_acc_eotech_xps3", 0] + ]], + ["arsenal_weap_m4", [ + ["rhs_weap_m4a1_carryhandle", 0], + ["rhs_weap_m4a1_carryhandle_mstock", 0], + ["rhs_weap_m4a1", 0], + ["rhs_weap_m4a1_mstock", 0], + ["rhs_weap_m4a1_d", 0], + ["rhs_weap_m4a1_d_mstock", 0], + ["rhs_weap_m4a1_wd", 0], + ["rhs_weap_m4a1_wd_mstock", 0], + + ["rhs_weap_m4a1_blockII", 0], + ["rhs_weap_m4a1_blockII_KAC", 0], + ["rhs_weap_m4a1_blockII_bk", 0], + ["rhs_weap_m4a1_blockII_KAC_bk", 0], + ["rhs_weap_m4a1_blockII_d", 0], + ["rhs_weap_m4a1_blockII_KAC_d", 0], + ["rhs_weap_m4a1_blockII_wd", 0], + ["rhs_weap_m4a1_blockII_KAC_wd", 0], + + ["rhs_weap_mk18", 0], + ["rhs_weap_mk18_bk", 0], + ["rhs_weap_mk18_KAC_bk", 0], + ["rhs_weap_mk18_d", 0], + ["rhs_weap_mk18_KAC_d", 0], + ["rhs_weap_mk18_KAC", 0], + ["rhs_weap_mk18_wd", 0], + ["rhs_weap_mk18_KAC_wd", 0], + + //Attachments + ["rhsusf_acc_sf3p556", 0], + ["rhsusf_acc_eotech", 0], + ["rhsusf_acc_g33_t1", 0], + ["rhsusf_acc_g33_xps3", 0], + ["rhsusf_acc_g33_xps3_tan", 0], + ["rhsusf_acc_elcan", 0], + ["rhsusf_acc_acog", 0], + ["rhsusf_acc_acog2", 0], + ["rhsusf_acc_acog3", 0], + ["rhsusf_acc_eotech_552", 0], + ["rhsusf_acc_eotech_552_d", 0], + ["rhsusf_acc_eotech_552_wd", 0], + ["rhsusf_acc_compm4", 0], + ["rhsusf_acc_su230", 0], + ["rhsusf_acc_su230_c", 0], + ["rhsusf_acc_su230_mrds", 0], + ["rhsusf_acc_su230_mrds_c", 0], + ["rhsusf_acc_t1_high", 0], + ["rhsusf_acc_acog_rmr", 0], + ["rhsusf_acc_acog_d", 0], + ["rhsusf_acc_acog_wd", 0], + ["rhsusf_acc_grip2", 0], + ["rhsusf_acc_grip2_tan", 0], + ["rhsusf_acc_grip2_wd", 0], + ["rhsusf_acc_grip1", 0], + ["rhsusf_acc_kac_grip", 0], + ["rhsusf_acc_rvg_blk", 0], + ["rhsusf_acc_rvg_de", 0], + ["rhsusf_acc_tdstubby_blk", 0], + ["rhsusf_acc_tdstubby_tan", 0], + ["rhsusf_acc_grip3", 0], + ["rhsusf_acc_grip3_tan", 0], + ["rhsusf_acc_eotech_xps3", 0] + ]], + ["arsenal_weap_sr25", [ + ["rhs_weap_sr25_ec", 0], + ["rhs_weap_sr25_ec_d", 0], + ["rhs_weap_sr25_ec_wd", 0], + + //Magazines + ["rhsusf_20Rnd_762x51_SR25_m118_special_Mag", 0], + + //Attachments + ["rhsusf_acc_harris_bipod", 0], + ["rhsusf_acc_m8541_d", 0], + ["rhsusf_acc_m8541_mrds", 0], + ["rhsusf_acc_elcan_ard", 0], + ["rhsusf_acc_su230a", 0], + ["rhsusf_acc_su230a_c", 0], + ["rhsusf_acc_su230a_mrds", 0], + ["rhsusf_acc_su230a_mrds_c", 0], + ["rhsusf_acc_m8541_wd", 0], + ["rhsusf_acc_acog_mdo", 0] + ]], + ["arsenal_weap_m240", [ + ["rhs_weap_m240B", 0], + ["rhs_weap_m240G", 0], + + // Attachments + ["rhsusf_acc_eotech", 0], + ["rhsusf_acc_g33_t1", 0], + ["rhsusf_acc_g33_xps3", 0], + ["rhsusf_acc_g33_xps3_tan", 0], + ["rhsusf_acc_eotech_552", 0], + ["rhsusf_acc_eotech_552_d", 0], + ["rhsusf_acc_eotech_552_wd", 0], + ["rhsusf_acc_compm4", 0], + ["rhsusf_acc_t1_high", 0], + ["rhsusf_acc_elcan_ard", 0], + ["rhsusf_acc_anpeq16a", 0], + ["rhsusf_acc_su230a", 0], + ["rhsusf_acc_su230a_c", 0], + ["rhsusf_acc_su230a_mrds", 0], + ["rhsusf_acc_su230a_mrds_c", 0], + ["rhsusf_acc_acog_mdo", 0] + ]], + ["arsenal_weap_m249", [ + ["rhs_weap_m249_pip", 0], + ["rhs_weap_m249_light_L", 0], + ["rhs_weap_m249_pip_L_para", 0], + ["rhs_weap_m249_pip_L", 0], + ["rhs_weap_m249_pip_ris", 0], + ["rhs_weap_m249_light_S", 0], + ["rhs_weap_m249_pip_S_para", 0], + ["rhs_weap_m249_pip_S", 0], + + // Attachements + ["rhsusf_acc_eotech", 0], + ["rhsusf_acc_g33_t1", 0], + ["rhsusf_acc_g33_xps3", 0], + ["rhsusf_acc_g33_xps3_tan", 0], + ["rhsusf_acc_elcan", 0], + ["rhsusf_acc_acog", 0], + ["rhsusf_acc_acog2", 0], + ["rhsusf_acc_acog3", 0], + ["rhsusf_acc_eotech_552", 0], + ["rhsusf_acc_eotech_552_d", 0], + ["rhsusf_acc_eotech_552_wd", 0], + ["rhsusf_acc_compm4", 0], + ["rhsusf_acc_su230", 0], + ["rhsusf_acc_su230_c", 0], + ["rhsusf_acc_su230_mrds", 0], + ["rhsusf_acc_su230_mrds_c", 0], + ["rhsusf_acc_t1_high", 0], + ["rhsusf_acc_acog_rmr", 0], + ["rhsusf_acc_acog_d", 0], + ["rhsusf_acc_acog_wd", 0], + ["rhsusf_acc_kac_grip_saw_bipod", 0], + ["rhsusf_acc_grip4", 0], + ["rhsusf_acc_grip4_bipod", 0], + ["rhsusf_acc_saw_lw_bipod", 0] ]] + ]; private _return = createHashMapFromArray _dataArray; diff --git a/cScripts/functions/systems/fn_getArsenalWhitelist.sqf b/cScripts/functions/systems/fn_getArsenalWhitelist.sqf index 9b8795fb4..0705f9a13 100644 --- a/cScripts/functions/systems/fn_getArsenalWhitelist.sqf +++ b/cScripts/functions/systems/fn_getArsenalWhitelist.sqf @@ -58,221 +58,18 @@ private _roleSpecific = switch ([player] call EFUNC(gear,getLoadoutRole)) do { private _primaryWeapon = if (!isNil{_loadout#0#0}) then {_loadout#0#0} else {""}; private _weaponSystemSpecific = switch (true) do { case (_primaryWeapon isKindof ['rhs_weap_mk18_m320', configFile >> 'CfgWeapons'] - || _primaryWeapon isKindof ['rhs_weap_m16a4_carryhandle_M203', configFile >> 'CfgWeapons']): {[ - - "rhs_weap_m4a1_m320", - "rhs_weap_mk18_m320", - "rhs_weap_M320", - "rhs_weap_m4a1_carryhandle", - "rhs_weap_m4a1_carryhandle_mstock", - "rhs_weap_m4a1", - "rhs_weap_m4a1_mstock", - "rhs_weap_m4a1_d", - "rhs_weap_m4a1_d_mstock", - "rhs_weap_m4a1_wd", - "rhs_weap_m4a1_wd_mstock", - - "rhs_weap_m4a1_blockII", - "rhs_weap_m4a1_blockII_KAC", - "rhs_weap_m4a1_blockII_bk", - "rhs_weap_m4a1_blockII_KAC_bk", - "rhs_weap_m4a1_blockII_d", - "rhs_weap_m4a1_blockII_KAC_d", - "rhs_weap_m4a1_blockII_wd", - "rhs_weap_m4a1_blockII_KAC_wd", - - "rhs_weap_mk18", - "rhs_weap_mk18_bk", - "rhs_weap_mk18_KAC_bk", - "rhs_weap_mk18_d", - "rhs_weap_mk18_KAC_d", - "rhs_weap_mk18_KAC", - "rhs_weap_mk18_wd", - "rhs_weap_mk18_KAC_wd", - - //Attachments - "rhsusf_acc_sf3p556", - "rhsusf_acc_eotech", - "rhsusf_acc_g33_t1", - "rhsusf_acc_g33_xps3", - "rhsusf_acc_g33_xps3_tan", - "rhsusf_acc_elcan", - "rhsusf_acc_acog", - "rhsusf_acc_acog2", - "rhsusf_acc_acog3", - "rhsusf_acc_eotech_552", - "rhsusf_acc_eotech_552_d", - "rhsusf_acc_eotech_552_wd", - "rhsusf_acc_compm4", - "rhsusf_acc_su230", - "rhsusf_acc_su230_c", - "rhsusf_acc_su230_mrds", - "rhsusf_acc_su230_mrds_c", - "rhsusf_acc_t1_high", - "rhsusf_acc_acog_rmr", - "rhsusf_acc_acog_d", - "rhsusf_acc_acog_wd", - "rhsusf_acc_grip2", - "rhsusf_acc_grip2_tan", - "rhsusf_acc_grip2_wd", - "rhsusf_acc_grip1", - "rhsusf_acc_kac_grip", - "rhsusf_acc_rvg_blk", - "rhsusf_acc_rvg_de", - "rhsusf_acc_tdstubby_blk", - "rhsusf_acc_tdstubby_tan", - "rhsusf_acc_grip3", - "rhsusf_acc_grip3_tan", - "rhsusf_acc_eotech_xps3" - ]}; + || _primaryWeapon isKindof ['rhs_weap_m16a4_carryhandle_M203', configFile >> 'CfgWeapons']): {GET_CONTAINER_KEYS(arsenal_weap_ugl);}; case (_primaryWeapon isKindof ['rhs_weap_m4a1', configFile >> 'CfgWeapons'] - || _primaryWeapon isKindof ['rhs_weap_m16a4', configFile >> 'CfgWeapons']): {[ - "rhs_weap_m4a1_carryhandle", - "rhs_weap_m4a1_carryhandle_mstock", - "rhs_weap_m4a1", - "rhs_weap_m4a1_mstock", - "rhs_weap_m4a1_d", - "rhs_weap_m4a1_d_mstock", - "rhs_weap_m4a1_wd", - "rhs_weap_m4a1_wd_mstock", + || _primaryWeapon isKindof ['rhs_weap_m16a4', configFile >> 'CfgWeapons']): {GET_CONTAINER_KEYS(arsenal_weap_m4);}; - "rhs_weap_m4a1_blockII", - "rhs_weap_m4a1_blockII_KAC", - "rhs_weap_m4a1_blockII_bk", - "rhs_weap_m4a1_blockII_KAC_bk", - "rhs_weap_m4a1_blockII_d", - "rhs_weap_m4a1_blockII_KAC_d", - "rhs_weap_m4a1_blockII_wd", - "rhs_weap_m4a1_blockII_KAC_wd", - - "rhs_weap_mk18", - "rhs_weap_mk18_bk", - "rhs_weap_mk18_KAC_bk", - "rhs_weap_mk18_d", - "rhs_weap_mk18_KAC_d", - "rhs_weap_mk18_KAC", - "rhs_weap_mk18_wd", - "rhs_weap_mk18_KAC_wd", + case (_primaryWeapon isKindof ['rhs_weap_sr25_ec', configFile >> 'CfgWeapons']): {GET_CONTAINER_KEYS(arsenal_weap_sr25);}; - //Attachments - "rhsusf_acc_sf3p556", - "rhsusf_acc_eotech", - "rhsusf_acc_g33_t1", - "rhsusf_acc_g33_xps3", - "rhsusf_acc_g33_xps3_tan", - "rhsusf_acc_elcan", - "rhsusf_acc_acog", - "rhsusf_acc_acog2", - "rhsusf_acc_acog3", - "rhsusf_acc_eotech_552", - "rhsusf_acc_eotech_552_d", - "rhsusf_acc_eotech_552_wd", - "rhsusf_acc_compm4", - "rhsusf_acc_su230", - "rhsusf_acc_su230_c", - "rhsusf_acc_su230_mrds", - "rhsusf_acc_su230_mrds_c", - "rhsusf_acc_t1_high", - "rhsusf_acc_acog_rmr", - "rhsusf_acc_acog_d", - "rhsusf_acc_acog_wd", - "rhsusf_acc_grip2", - "rhsusf_acc_grip2_tan", - "rhsusf_acc_grip2_wd", - "rhsusf_acc_grip1", - "rhsusf_acc_kac_grip", - "rhsusf_acc_rvg_blk", - "rhsusf_acc_rvg_de", - "rhsusf_acc_tdstubby_blk", - "rhsusf_acc_tdstubby_tan", - "rhsusf_acc_grip3", - "rhsusf_acc_grip3_tan", - "rhsusf_acc_eotech_xps3" - ]}; - - case (_primaryWeapon isKindof ['rhs_weap_sr25_ec', configFile >> 'CfgWeapons']): {[ - "rhs_weap_sr25_ec", - "rhs_weap_sr25_ec_d", - "rhs_weap_sr25_ec_wd", - - //Magazines - "rhsusf_20Rnd_762x51_SR25_m118_special_Mag", - - //Attachments - "rhsusf_acc_harris_bipod", - "rhsusf_acc_m8541_d", - "rhsusf_acc_m8541_mrds", - "rhsusf_acc_elcan_ard", - "rhsusf_acc_su230a", - "rhsusf_acc_su230a_c", - "rhsusf_acc_su230a_mrds", - "rhsusf_acc_su230a_mrds_c", - "rhsusf_acc_m8541_wd", - "rhsusf_acc_acog_mdo" - ]}; - - case (primaryWeapon player isKindof ['rhs_weap_m240_base', configFile >> 'CfgWeapons']): {[ - "rhs_weap_m240B", - "rhs_weap_m240G", - - // Attachments - "rhsusf_acc_eotech", - "rhsusf_acc_g33_t1", - "rhsusf_acc_g33_xps3", - "rhsusf_acc_g33_xps3_tan", - "rhsusf_acc_eotech_552", - "rhsusf_acc_eotech_552_d", - "rhsusf_acc_eotech_552_wd", - "rhsusf_acc_compm4", - "rhsusf_acc_t1_high", - "rhsusf_acc_elcan_ard", - "rhsusf_acc_anpeq16a", - "rhsusf_acc_su230a", - "rhsusf_acc_su230a_c", - "rhsusf_acc_su230a_mrds", - "rhsusf_acc_su230a_mrds_c", - "rhsusf_acc_acog_mdo" - ]}; + case (primaryWeapon player isKindof ['rhs_weap_m240_base', configFile >> 'CfgWeapons']): {GET_CONTAINER_KEYS(arsenal_weap_m240);}; case (primaryWeapon player isKindof ['rhs_weap_m249_pip', configFile >> 'CfgWeapons'] || _primaryWeapon isKindof ['rhs_weap_m249_pip_L', configFile >> 'CfgWeapons'] - || _primaryWeapon isKindof ['rhs_weap_m249_pip_S', configFile >> 'CfgWeapons']): {[ - "rhs_weap_m249_pip", - "rhs_weap_m249_light_L", - "rhs_weap_m249_pip_L_para", - "rhs_weap_m249_pip_L", - "rhs_weap_m249_pip_ris", - "rhs_weap_m249_light_S", - "rhs_weap_m249_pip_S_para", - "rhs_weap_m249_pip_S", - - // Attachements - "rhsusf_acc_eotech", - "rhsusf_acc_g33_t1", - "rhsusf_acc_g33_xps3", - "rhsusf_acc_g33_xps3_tan", - "rhsusf_acc_elcan", - "rhsusf_acc_acog", - "rhsusf_acc_acog2", - "rhsusf_acc_acog3", - "rhsusf_acc_eotech_552", - "rhsusf_acc_eotech_552_d", - "rhsusf_acc_eotech_552_wd", - "rhsusf_acc_compm4", - "rhsusf_acc_su230", - "rhsusf_acc_su230_c", - "rhsusf_acc_su230_mrds", - "rhsusf_acc_su230_mrds_c", - "rhsusf_acc_t1_high", - "rhsusf_acc_acog_rmr", - "rhsusf_acc_acog_d", - "rhsusf_acc_acog_wd", - "rhsusf_acc_kac_grip_saw_bipod", - "rhsusf_acc_grip4", - "rhsusf_acc_grip4_bipod", - "rhsusf_acc_saw_lw_bipod" - ]}; + || _primaryWeapon isKindof ['rhs_weap_m249_pip_S', configFile >> 'CfgWeapons']): {GET_CONTAINER_KEYS(arsenal_weap_m249);}; default {[]}; };