From 1a3bce1a238b53cbca3f2f9072509f1e7f9f490c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Dahlgren?= Date: Sun, 3 Sep 2023 18:31:26 +0200 Subject: [PATCH] Add compatibility mod for CSLA CDLC (#8839) * Add compatibility mod for CSLA CDLC * Fix syntax issue * Add open bolt property to machine guns * Move to addons and update UBC * Update addon.toml * Update addons/compat_csla/CfgWeapons.hpp Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/compat_csla/CfgMagazines.hpp Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * split explosives to sub config * ifndef * reduce range on stinger backblast (is soft-launch) --------- Co-authored-by: PabstMirror Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/compat_csla/$PBOPREFIX$ | 1 + addons/compat_csla/CfgMagazines.hpp | 22 ++++++ addons/compat_csla/CfgWeapons.hpp | 72 +++++++++++++++++++ addons/compat_csla/addon.toml | 2 + .../compat_csla_explosives/CfgMagazines.hpp | 14 ++++ .../compat_csla_explosives/CfgVehicles.hpp | 18 +++++ .../compat_csla_explosives/config.cpp | 37 ++++++++++ .../script_component.hpp | 5 ++ addons/compat_csla/config.cpp | 30 ++++++++ addons/compat_csla/script_component.hpp | 5 ++ 10 files changed, 206 insertions(+) create mode 100644 addons/compat_csla/$PBOPREFIX$ create mode 100644 addons/compat_csla/CfgMagazines.hpp create mode 100644 addons/compat_csla/CfgWeapons.hpp create mode 100644 addons/compat_csla/addon.toml create mode 100644 addons/compat_csla/compat_csla_explosives/CfgMagazines.hpp create mode 100644 addons/compat_csla/compat_csla_explosives/CfgVehicles.hpp create mode 100644 addons/compat_csla/compat_csla_explosives/config.cpp create mode 100644 addons/compat_csla/compat_csla_explosives/script_component.hpp create mode 100644 addons/compat_csla/config.cpp create mode 100644 addons/compat_csla/script_component.hpp diff --git a/addons/compat_csla/$PBOPREFIX$ b/addons/compat_csla/$PBOPREFIX$ new file mode 100644 index 0000000000..4d7b298fef --- /dev/null +++ b/addons/compat_csla/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_csla diff --git a/addons/compat_csla/CfgMagazines.hpp b/addons/compat_csla/CfgMagazines.hpp new file mode 100644 index 0000000000..f938272c8b --- /dev/null +++ b/addons/compat_csla/CfgMagazines.hpp @@ -0,0 +1,22 @@ +class CfgMagazines { + + class CSLA_UK59_50rnd_7_62vz59; + class CSLA_UK59_50rnd_7_62Sv59: CSLA_UK59_50rnd_7_62vz59 { + ace_isBelt = 1; + }; + + class US85_Magazine; + class US85_50Rnd_762x51: US85_Magazine { + ace_isBelt = 1; + }; + + class US85_20Rnd_762x51; + class US85_100Rnd_762x51: US85_20Rnd_762x51 { + ace_isBelt = 1; + }; + + class US85_30Rnd_556x45; + class US85_200Rnd_556x45: US85_30Rnd_556x45 { + ace_isBelt = 1; + }; +}; diff --git a/addons/compat_csla/CfgWeapons.hpp b/addons/compat_csla/CfgWeapons.hpp new file mode 100644 index 0000000000..dcfa6744cc --- /dev/null +++ b/addons/compat_csla/CfgWeapons.hpp @@ -0,0 +1,72 @@ +class CfgWeapons { + + class CSLA_LauncherBase; + class CSLA_Launcher_AT; + class CSLA_MachinegunBase_7_62; + + class CSLA_RPG7: CSLA_Launcher_AT { + EGVAR(reloadlaunchers,enabled) = 1; + }; + + // class CSLA_RPG75: CSLA_Launcher_AT {}; + + class CSLA_Strela: CSLA_LauncherBase { + EGVAR(overpressure,angle) = 30; + EGVAR(overpressure,damage) = 0.5; + EGVAR(overpressure,range) = 2; + }; + + class CSLA_UK59L: CSLA_MachinegunBase_7_62 { + EGVAR(overheating,allowSwapBarrel) = 1; + EGVAR(overheating,closedBolt) = 0; + }; + + class US85_Launcher_AA; + class US85_Launcher_AT; + class US85_MachinegunBase_5_56; + class US85_MachinegunBase_7_62; + class US85_weaponBase; + + // class US85_M16_base: US85_weaponBase {}; + + class US85_M249: US85_MachinegunBase_5_56 { + EGVAR(overheating,allowSwapBarrel) = 1; + EGVAR(overheating,closedBolt) = 0; + }; + + class US85_M60: US85_MachinegunBase_7_62 { + EGVAR(overheating,allowSwapBarrel) = 1; + EGVAR(overheating,closedBolt) = 0; + }; + + class US85_FIM92: US85_Launcher_AA { + EGVAR(overpressure,angle) = 45; + EGVAR(overpressure,damage) = 0.3; + EGVAR(overpressure,range) = 6; + }; + + class US85_LAW72: US85_Launcher_AT { + EGVAR(overpressure,angle) = 40; + EGVAR(overpressure,damage) = 0.5; + EGVAR(overpressure,range) = 15; + }; + + class US85_M136: US85_Launcher_AT { + EGVAR(overpressure,angle) = 45; + EGVAR(overpressure,damage) = 0.3; + EGVAR(overpressure,range) = 10; + }; + + class US85_MAAWS: US85_Launcher_AT { + EGVAR(reloadlaunchers,enabled) = 1; + EGVAR(overpressure,angle) = 60; + EGVAR(overpressure,damage) = 0.7; + EGVAR(overpressure,priority) = 1; + EGVAR(overpressure,range) = 10; + }; + + class US85_SMAW: US85_Launcher_AT { + EGVAR(reloadlaunchers,enabled) = 1; + EGVAR(overpressure,angle) = 45; + }; +}; diff --git a/addons/compat_csla/addon.toml b/addons/compat_csla/addon.toml new file mode 100644 index 0000000000..7cfef775ee --- /dev/null +++ b/addons/compat_csla/addon.toml @@ -0,0 +1,2 @@ +[preprocess] +enabled = false diff --git a/addons/compat_csla/compat_csla_explosives/CfgMagazines.hpp b/addons/compat_csla/compat_csla_explosives/CfgMagazines.hpp new file mode 100644 index 0000000000..635e6f253a --- /dev/null +++ b/addons/compat_csla/compat_csla_explosives/CfgMagazines.hpp @@ -0,0 +1,14 @@ +class CfgMagazines { + class US85_ATMine_mag: US85_Magazine { + EGVAR(explosive,SetupObject) = "ACE_Explosives_Place_US85_ATMine_mag"; + useAction = 0; + }; + class US85_M14Mine_mag: US85_Magazine { + EGVAR(explosive,SetupObject) = "ACE_Explosives_Place_US85_M14Mine"; + useAction = 0; + }; + class US85_SatchelCharge_Mag: US85_Magazine { + EGVAR(explosive,SetupObject) = "ACE_Explosives_Place_US85_SatchelCharge_Mag"; + useAction = 0; + }; +}; diff --git a/addons/compat_csla/compat_csla_explosives/CfgVehicles.hpp b/addons/compat_csla/compat_csla_explosives/CfgVehicles.hpp new file mode 100644 index 0000000000..02dd9367ea --- /dev/null +++ b/addons/compat_csla/compat_csla_explosives/CfgVehicles.hpp @@ -0,0 +1,18 @@ +class CfgVehicles { + + // ACE Explosives + class ACE_Explosives_Place; + + class ACE_Explosives_Place_US85_ATMine_mag: ACE_Explosives_Place { + model = "\a3\weapons_f\explosives\mine_at.p3d"; + }; + + class ACE_Explosives_Place_US85_M14Mine: ACE_Explosives_Place { + model = "\a3\weapons_f\explosives\mine_ap.p3d"; + }; + + class ACE_Explosives_Place_US85_SatchelCharge_Mag: ACE_Explosives_Place { + model = "\a3\weapons_f\explosives\satchel.p3d"; + }; + +}; diff --git a/addons/compat_csla/compat_csla_explosives/config.cpp b/addons/compat_csla/compat_csla_explosives/config.cpp new file mode 100644 index 0000000000..934d6787f4 --- /dev/null +++ b/addons/compat_csla/compat_csla_explosives/config.cpp @@ -0,0 +1,37 @@ +#include "script_component.hpp" + +#if __has_include("\csla_cfg\config.bin") +#else +#define PATCH_SKIP "CSLA - Iron Curtain" +#endif + +#if __has_include("\z\ace\addons\explosives\script_component.hpp") +#else + #ifndef PATCH_SKIP + #define PATCH_SKIP "ACE Explosives" + #endif +#endif + +#ifdef PATCH_SKIP +ACE_PATCH_NOT_LOADED(ADDON,PATCH_SKIP) +#else + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_explosives", "CSLA", "US85"}; + skipWhenMissingDependencies = 1; // drop __has_include and addon.toml after 2.14 + author = ECSTRING(common,ACETeam); + authors[] = {"Dahlgren"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgMagazines.hpp" +#include "CfgVehicles.hpp" + +#endif diff --git a/addons/compat_csla/compat_csla_explosives/script_component.hpp b/addons/compat_csla/compat_csla_explosives/script_component.hpp new file mode 100644 index 0000000000..cdcfa0c070 --- /dev/null +++ b/addons/compat_csla/compat_csla_explosives/script_component.hpp @@ -0,0 +1,5 @@ +#include "\z\ace\addons\compat_csla\script_component.hpp" + +#define SUBCOMPONENT explosives +#undef ADDON +#define ADDON TRIPLES(PREFIX,COMPONENT,SUBCOMPONENT) diff --git a/addons/compat_csla/config.cpp b/addons/compat_csla/config.cpp new file mode 100644 index 0000000000..0cf6c52f68 --- /dev/null +++ b/addons/compat_csla/config.cpp @@ -0,0 +1,30 @@ +#include "script_component.hpp" + +#if __has_include("\csla_cfg\config.bin") +#else +#define PATCH_SKIP "CSLA - Iron Curtain" +#endif + +#ifdef PATCH_SKIP +ACE_PATCH_NOT_LOADED(ADDON,PATCH_SKIP) +#else + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"CSLA", "US85"}; + skipWhenMissingDependencies = 1; // drop __has_include and addon.toml after 2.14 + author = ECSTRING(common,ACETeam); + authors[] = {"Dahlgren"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgMagazines.hpp" +#include "CfgWeapons.hpp" + +#endif diff --git a/addons/compat_csla/script_component.hpp b/addons/compat_csla/script_component.hpp new file mode 100644 index 0000000000..480a8cc4cc --- /dev/null +++ b/addons/compat_csla/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT compat_csla +#define COMPONENT_BEAUTIFIED CSLA Compatibility + +#include "\z\ace\addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_macros.hpp"