diff --git a/.hemtt/launch.toml b/.hemtt/launch.toml index ae05b1942a5..c5a5da34530 100644 --- a/.hemtt/launch.toml +++ b/.hemtt/launch.toml @@ -27,6 +27,12 @@ dlc = [ "Reaction Forces" ] +[gm] +extends = "default" +dlc = [ + "Global Mobilization - Cold War Germany" +] + [rhs] extends = "default" workshop = [ diff --git a/addons/compat_cup_terrains/CfgVehicles.hpp b/addons/compat_cup_terrains/CfgVehicles.hpp index e408f795955..4e3afbd22f7 100644 --- a/addons/compat_cup_terrains/CfgVehicles.hpp +++ b/addons/compat_cup_terrains/CfgVehicles.hpp @@ -109,4 +109,20 @@ class CfgVehicles { EGVAR(dragging,carryPosition)[] = {0, 0.75, 0.5}; EGVAR(dragging,carryDirection) = 270; }; + + class Land_stand_waterl_EP1: House_EP1 { + EXGVAR(field_rations,waterSupply) = 250; + EXGVAR(field_rations,offset)[] = {0, -0.33, 0.4}; + }; + + class Land_pumpa: House { + EXGVAR(field_rations,waterSupply) = -10; + EXGVAR(field_rations,offset)[] = {0.3, 0, 0.68}; + }; + + class Thing; + class Land_Barrel_water: Thing { + EXGVAR(field_rations,waterSupply) = 160; + EXGVAR(field_rations,offset)[] = {0, 0, 0.25}; + }; }; diff --git a/addons/compat_gm/CfgWeapons.hpp b/addons/compat_gm/CfgWeapons.hpp index 7c77827b2f4..d144c445900 100644 --- a/addons/compat_gm/CfgWeapons.hpp +++ b/addons/compat_gm/CfgWeapons.hpp @@ -95,22 +95,18 @@ class CfgWeapons { HEARING_PROTECTION_PELTOR; }; + class gm_ge_headgear_beret_crew_base; + class gm_ge_headgear_beret_crew_blk: gm_ge_headgear_beret_crew_base { + HEARING_PROTECTION_PELTOR; + }; + class gm_ge_headgear_beret_crew_bdx; - class gm_ge_headgear_beret_crew_blk; class gm_ge_headgear_beret_crew_grn; class gm_ge_headgear_beret_crew_red; + class gm_ge_headgear_beret_crew_red_antiair: gm_ge_headgear_beret_crew_red { HEARING_PROTECTION_PELTOR; }; - class gm_ge_headgear_beret_crew_blk_antitank: gm_ge_headgear_beret_crew_blk { - HEARING_PROTECTION_PELTOR; - }; - class gm_ge_headgear_beret_crew_blk_armor: gm_ge_headgear_beret_crew_blk { - HEARING_PROTECTION_PELTOR; - }; - class gm_ge_headgear_beret_crew_blk_armorrecon: gm_ge_headgear_beret_crew_blk { - HEARING_PROTECTION_PELTOR; - }; class gm_ge_headgear_beret_crew_red_artillery: gm_ge_headgear_beret_crew_red { HEARING_PROTECTION_PELTOR; }; @@ -123,6 +119,9 @@ class CfgWeapons { class gm_ge_headgear_beret_crew_grn_mechinf: gm_ge_headgear_beret_crew_grn { HEARING_PROTECTION_PELTOR; }; + class gm_ge_headgear_beret_crew_grn_infantry: gm_ge_headgear_beret_crew_grn { + HEARING_PROTECTION_PELTOR; + }; class gm_ge_headgear_beret_crew_red_militarypolice: gm_ge_headgear_beret_crew_red { HEARING_PROTECTION_PELTOR; }; @@ -135,7 +134,7 @@ class CfgWeapons { class gm_ge_headgear_beret_crew_bdx_paratrooper: gm_ge_headgear_beret_crew_bdx { HEARING_PROTECTION_PELTOR; }; - class gm_ge_headgear_beret_crew_blk_recon: gm_ge_headgear_beret_crew_blk { + class gm_ge_headgear_beret_crew_bdx_lrrp: gm_ge_headgear_beret_crew_bdx { HEARING_PROTECTION_PELTOR; }; class gm_ge_headgear_beret_crew_red_supply: gm_ge_headgear_beret_crew_red { @@ -144,4 +143,39 @@ class CfgWeapons { class gm_ge_headgear_beret_crew_red_signals: gm_ge_headgear_beret_crew_red { HEARING_PROTECTION_PELTOR; }; + + class gm_ge_bgs_headgear_beret_crew_grn: gm_ge_headgear_beret_crew_grn { + HEARING_PROTECTION_PELTOR; + }; + class gm_ge_bgs_headgear_beret_crew_grn_sf: gm_ge_headgear_beret_crew_grn { + HEARING_PROTECTION_PELTOR; + }; + + class gm_ge_headgear_hat_beanie_base; + class gm_ge_headgear_hat_beanie_crew_blk: gm_ge_headgear_hat_beanie_base { + HEARING_PROTECTION_PELTOR; + }; + + class gm_xx_headgear_headwrap_01_base; + class gm_xx_headgear_headwrap_crew_01_oli: gm_xx_headgear_headwrap_01_base { + HEARING_PROTECTION_PELTOR; + }; + class gm_xx_headgear_headwrap_crew_01_m84: gm_xx_headgear_headwrap_01_base { + HEARING_PROTECTION_PELTOR; + }; + class gm_xx_headgear_headwrap_crew_01_grn: gm_xx_headgear_headwrap_01_base { + HEARING_PROTECTION_PELTOR; + }; + class gm_xx_headgear_headwrap_crew_01_smp: gm_xx_headgear_headwrap_01_base { + HEARING_PROTECTION_PELTOR; + }; + class gm_xx_headgear_headwrap_crew_01_blk: gm_xx_headgear_headwrap_01_base { + HEARING_PROTECTION_PELTOR; + }; + class gm_xx_headgear_headwrap_crew_01_flk: gm_xx_headgear_headwrap_01_base { + HEARING_PROTECTION_PELTOR; + }; + class gm_xx_headgear_headwrap_crew_01_trp: gm_xx_headgear_headwrap_01_base { + HEARING_PROTECTION_PELTOR; + }; }; diff --git a/addons/compat_rf/CfgVehicles.hpp b/addons/compat_rf/CfgVehicles.hpp index f6165812db9..54f9a7b23ac 100644 --- a/addons/compat_rf/CfgVehicles.hpp +++ b/addons/compat_rf/CfgVehicles.hpp @@ -4,6 +4,10 @@ class CfgVehicles { class Pickup_01_base_rf: Offroad_01_unarmed_base_F { EXGVAR(field_rations,offset)[] = {-0.04, -2.45, -0.9}; }; + class Pickup_fuel_base_rf: Pickup_01_base_rf { + EGVAR(refuel,hooks)[] = {{-0.05, -2.4, -1.2}}; + EGVAR(refuel,fuelCargo) = 1526; // Bed on 2024 RAM 1500 is 53.9 cubic feet + }; // Enable Water Source by Default class C_IDAP_Pickup_rf; diff --git a/addons/compat_sog/CfgEventHandlers.hpp b/addons/compat_sog/CfgEventHandlers.hpp index d28b79fb991..f2a681ac80e 100644 --- a/addons/compat_sog/CfgEventHandlers.hpp +++ b/addons/compat_sog/CfgEventHandlers.hpp @@ -44,7 +44,7 @@ class Extended_InitPost_EventHandlers { }; class vn_bicycle_base { class ADDON { - init = QUOTE(call FUNC(disableCookoff)); + init = QUOTE(call EFUNC(cookoff,disableCookoff)); }; }; }; diff --git a/addons/compat_sog/CfgVehicles/land.hpp b/addons/compat_sog/CfgVehicles/land.hpp index 70b305a31d2..93444837074 100644 --- a/addons/compat_sog/CfgVehicles/land.hpp +++ b/addons/compat_sog/CfgVehicles/land.hpp @@ -65,3 +65,10 @@ class Land_vn_fuelcan: Land_vn_object_c_base { EGVAR(cargo,canLoad) = 1; EGVAR(cargo,noRename) = 1; }; + +// M149 +class Land_vn_b_prop_m149: Land_vn_object_b_base { + XEH_INHERITED; + EXGVAR(field_rations,waterSupply) = 1514.16; // 400 US gallons + EXGVAR(field_rations,offset)[] = {0, -0.3, -0.3}; +}; diff --git a/addons/compat_sog/CfgVehicles/wheeled.hpp b/addons/compat_sog/CfgVehicles/wheeled.hpp index 3a898519dd1..6d8d00d18f4 100644 --- a/addons/compat_sog/CfgVehicles/wheeled.hpp +++ b/addons/compat_sog/CfgVehicles/wheeled.hpp @@ -19,6 +19,23 @@ class vn_wheeled_m151_base: vn_wheeled_car_base { EGVAR(refuel,fuelCapacity) = 65; }; +// M149 +class Slingload_01_Base_F; +class Land_vn_b_prop_m149_01: Slingload_01_Base_F { + EXGVAR(field_rations,waterSupply) = 1514.16; // 400 US gallons + EXGVAR(field_rations,offset)[] = {0, -0.3, -0.3}; +}; +class vn_object_b_base_02; +class Land_vn_b_prop_m149_02: vn_object_b_base_02 { + EXGVAR(field_rations,waterSupply) = 1514.16; // 400 US gallons + EXGVAR(field_rations,offset)[] = {0, -0.3, -0.3}; +}; +class vn_object_b_base; +class Land_vn_b_prop_m149_03: vn_object_b_base { + EXGVAR(field_rations,waterSupply) = 1514.16; // 400 US gallons + EXGVAR(field_rations,offset)[] = {0, -0.3, -0.3}; +}; + // ZIL-157 class vn_wheeled_z157_base: vn_wheeled_truck_base { EGVAR(refuel,fuelCapacity) = 150; diff --git a/addons/compat_sog/XEH_PREP.hpp b/addons/compat_sog/XEH_PREP.hpp index b9f7907afed..af95ac7edc3 100644 --- a/addons/compat_sog/XEH_PREP.hpp +++ b/addons/compat_sog/XEH_PREP.hpp @@ -1,4 +1,3 @@ -PREP(disableCookoff); PREP(handleBikeMinePlace); PREP(handlePunjiTrapDamage); PREP(handlePunjiTrapPlace); diff --git a/addons/compat_sog/functions/fnc_disableCookoff.sqf b/addons/compat_sog/functions/fnc_disableCookoff.sqf deleted file mode 100644 index 07c36567a6c..00000000000 --- a/addons/compat_sog/functions/fnc_disableCookoff.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: BaerMitUmlaut - * Disables cookoff for bicycles. - * - * Arguments: - * 0: Bicycle - * - * Return Value: - * None - * - * Example: - * [bicycle] call ace_compat_sog_fnc_disableCookoff - * - * Public: No - */ - -params ["_bicycle"]; - -_bicycle setVariable [QEGVAR(cookoff,enable), false]; -_bicycle setVariable [QEGVAR(cookoff,enableAmmoCookoff), false]; diff --git a/addons/compat_ws/CfgEventHandlers.hpp b/addons/compat_ws/CfgEventHandlers.hpp new file mode 100644 index 00000000000..905e1e777c9 --- /dev/null +++ b/addons/compat_ws/CfgEventHandlers.hpp @@ -0,0 +1,13 @@ +class Extended_InitPost_EventHandlers { + class UAV_02_Base_lxWS { + class ADDON { + init = QUOTE(call EFUNC(cookoff,disableCookoff)); + }; + }; + + class UAV_02_IED_Base_lxWS { + class ADDON { + init = ""; // Enable cook-off for IED drone + }; + }; +}; diff --git a/addons/compat_ws/config.cpp b/addons/compat_ws/config.cpp index 54a6df99eec..9dc85f5d82a 100644 --- a/addons/compat_ws/config.cpp +++ b/addons/compat_ws/config.cpp @@ -15,5 +15,6 @@ class CfgPatches { }; }; +#include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" diff --git a/addons/cookoff/CfgEventHandlers.hpp b/addons/cookoff/CfgEventHandlers.hpp index f6503c2479b..80c41b909c9 100644 --- a/addons/cookoff/CfgEventHandlers.hpp +++ b/addons/cookoff/CfgEventHandlers.hpp @@ -15,3 +15,17 @@ class Extended_PostInit_EventHandlers { init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); }; }; + +class Extended_InitPost_EventHandlers { + class UGV_02_Demining_Base_F { + class ADDON { + init = QUOTE(call FUNC(disableCookoff)); + }; + }; + + class UGV_02_Science_Base_F { + class ADDON { + init = QUOTE(call FUNC(disableCookoff)); + }; + }; +}; diff --git a/addons/cookoff/XEH_PREP.hpp b/addons/cookoff/XEH_PREP.hpp index 94059089535..170bae5af2f 100644 --- a/addons/cookoff/XEH_PREP.hpp +++ b/addons/cookoff/XEH_PREP.hpp @@ -4,6 +4,7 @@ PREP(cookOffLocal); PREP(cookOffServer); PREP(detonateAmmunitionServer); PREP(detonateAmmunitionServerLoop); +PREP(disableCookoff); PREP(engineFireLocal); PREP(engineFireServer); PREP(getVehicleAmmo); diff --git a/addons/cookoff/functions/fnc_disableCookoff.sqf b/addons/cookoff/functions/fnc_disableCookoff.sqf new file mode 100644 index 00000000000..c55328889df --- /dev/null +++ b/addons/cookoff/functions/fnc_disableCookoff.sqf @@ -0,0 +1,21 @@ +#include "..\script_component.hpp" +/* + * Author: BaerMitUmlaut + * Disables cookoff for objects. Use in init fields. + * + * Arguments: + * 0: Object + * + * Return Value: + * None + * + * Example: + * cursorObject call ace_cookoff_fnc_disableCookoff + * + * Public: No + */ + +params ["_object"]; + +_object setVariable [QGVAR(enable), false]; +_object setVariable [QGVAR(enableAmmoCookoff), false]; diff --git a/addons/dragging/CfgVehicles.hpp b/addons/dragging/CfgVehicles.hpp index d0b34c43f53..63a5a5faa91 100644 --- a/addons/dragging/CfgVehicles.hpp +++ b/addons/dragging/CfgVehicles.hpp @@ -350,6 +350,11 @@ class CfgVehicles { GVAR(canDrag) = 1; GVAR(dragPosition)[] = {0,1,0}; }; + class Land_BarrelWater_grey_F: Items_base_F { + EGVAR(interaction,replaceTerrainObject) = 1; + GVAR(canDrag) = 1; + GVAR(dragPosition)[] = {0,1,0}; + }; class Land_Bucket_F: Items_base_F { EGVAR(interaction,replaceTerrainObject) = 1; GVAR(canCarry) = 1; diff --git a/addons/explosives/ACE_Medical_Injuries.hpp b/addons/explosives/ACE_Medical_Injuries.hpp new file mode 100644 index 00000000000..ef316361531 --- /dev/null +++ b/addons/explosives/ACE_Medical_Injuries.hpp @@ -0,0 +1,13 @@ +class ACE_Medical_Injuries { + class damageTypes { + class woundHandlers; + class explosive { + class woundHandlers: woundHandlers {}; + }; + class GVAR(toePopper): explosive { + class woundHandlers: woundHandlers { + ADDON = QFUNC(woundsHandlerToePopper); + }; + }; + }; +}; diff --git a/addons/explosives/CfgAmmo.hpp b/addons/explosives/CfgAmmo.hpp index ae67e4fe284..e009e9a1eee 100644 --- a/addons/explosives/CfgAmmo.hpp +++ b/addons/explosives/CfgAmmo.hpp @@ -175,6 +175,9 @@ class CfgAmmo { GVAR(defuseObjectPosition)[] = {0.0, -0.05, 0.15}; }; class APERSMine_Range_Ammo; + class ACE_APERSMine_ToePopper_Ammo: APERSMine_Range_Ammo { + ACE_damageType = QGVAR(toePopper); + }; class TrainingMine_Ammo: APERSMine_Range_Ammo { GVAR(magazine) = "TrainingMine_Mag"; GVAR(size) = 0; diff --git a/addons/explosives/CfgMagazines.hpp b/addons/explosives/CfgMagazines.hpp index 71e374be1d5..3a16d3eed62 100644 --- a/addons/explosives/CfgMagazines.hpp +++ b/addons/explosives/CfgMagazines.hpp @@ -29,6 +29,10 @@ class CfgMagazines { }; }; }; + class ACE_APERSMine_ToePopper_Mag: APERSMine_Range_Mag { + displayName = CSTRING(apersToePopper); + ammo = "ACE_APERSMine_ToePopper_Ammo"; + }; class APERSTripMine_Wire_Mag: ATMine_Range_Mag { GVAR(setupObject) = "ACE_Explosives_Place_APERSTripwireMine"; class ACE_Triggers { diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp index bf3eb1b12bd..a7066793a18 100644 --- a/addons/explosives/CfgVehicles.hpp +++ b/addons/explosives/CfgVehicles.hpp @@ -380,6 +380,12 @@ class CfgVehicles { class APERSBoundingMine: MineBase { ammo = "ACE_APERSBoundingMine_Range_Ammo"; }; + class APERSMine; + class ACE_APERSMine_ToePopper: APERSMine { + author = ECSTRING(common,aceteam); + ammo = "ACE_APERSMine_ToePopper_Ammo"; + displayName = CSTRING(apersToePopper); + }; class DemoCharge_F: MineBase { ammo = "ACE_DemoCharge_Remote_Ammo"; diff --git a/addons/explosives/CfgWeapons.hpp b/addons/explosives/CfgWeapons.hpp index 5c81cb9aec0..b5c91aaeb88 100644 --- a/addons/explosives/CfgWeapons.hpp +++ b/addons/explosives/CfgWeapons.hpp @@ -4,7 +4,7 @@ class CfgWeapons { muzzles[] += {QGVAR(muzzle)}; class PutMuzzle: Default {}; class GVAR(muzzle): PutMuzzle { - magazines[] = {"ACE_FlareTripMine_Mag"}; + magazines[] = {"ACE_FlareTripMine_Mag", "ACE_APERSMine_ToePopper_Mag"}; }; }; diff --git a/addons/explosives/XEH_PREP.hpp b/addons/explosives/XEH_PREP.hpp index 444b9db2ea0..d7c9e8824c3 100644 --- a/addons/explosives/XEH_PREP.hpp +++ b/addons/explosives/XEH_PREP.hpp @@ -41,3 +41,4 @@ PREP(triggerType); PREP(allowDefuse); PREP(isAllowedDefuse); PREP(checkDetonateHandlers); +PREP(woundsHandlerToePopper); diff --git a/addons/explosives/config.cpp b/addons/explosives/config.cpp index 00909533ac9..f5a17d44514 100644 --- a/addons/explosives/config.cpp +++ b/addons/explosives/config.cpp @@ -25,6 +25,7 @@ class CfgPatches { #include "ACE_Triggers.hpp" #include "ACE_Arsenal_Stats.hpp" +#include "ACE_Medical_Injuries.hpp" // UI stuff class RscText; diff --git a/addons/explosives/functions/fnc_woundsHandlerToePopper.sqf b/addons/explosives/functions/fnc_woundsHandlerToePopper.sqf new file mode 100644 index 00000000000..d08bfd4be9c --- /dev/null +++ b/addons/explosives/functions/fnc_woundsHandlerToePopper.sqf @@ -0,0 +1,30 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror + * Wound handler for the toe-popper ammo; only does damage to legs + * + * Arguments: + * 0: Unit + * 1: Damage + * + * Return Value: + * + * + * Example: + * [player, []] call ace_explosives_fnc_woundsHandlerToePopper + * + * Public: No + */ + +params ["", "_array"]; +TRACE_1("woundsHandlerToePopper",_this); + +_array = _array select { + _x params ["", "_part"]; + _part in ["LeftLeg", "RightLeg"] +}; + +_this set [1, _array]; + +_this + diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index 86d2276a7b7..c69ed023c4a 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -1209,5 +1209,8 @@ Zamanlayıcı Időzítő + + APERS Mine (Toe-Popper) + diff --git a/addons/intelitems/XEH_preInit.sqf b/addons/intelitems/XEH_preInit.sqf index ff09f6ea0e9..e2914443cce 100644 --- a/addons/intelitems/XEH_preInit.sqf +++ b/addons/intelitems/XEH_preInit.sqf @@ -27,7 +27,7 @@ if (hasInterface) then { GVAR(controlsGroups) = []; // Hash to track controls group positions on map between closing - GVAR(controlsData) = [] call CBA_fnc_hashCreate; + GVAR(controlsData) = createHashMap; }; ADDON = true; diff --git a/addons/intelitems/functions/fnc_addActions.sqf b/addons/intelitems/functions/fnc_addActions.sqf index 6b93a54eb1d..5e1501a7f0d 100644 --- a/addons/intelitems/functions/fnc_addActions.sqf +++ b/addons/intelitems/functions/fnc_addActions.sqf @@ -20,7 +20,6 @@ params ["_player"]; private _actions = []; private _cfgMagazines = configFile >> "CfgMagazines"; -private _magazines = magazines _player; private _openIndices = GVAR(controlsGroups) apply {_x getVariable QGVAR(index)}; @@ -53,6 +52,6 @@ private _openIndices = GVAR(controlsGroups) apply {_x getVariable QGVAR(index)}; }; } forEach _magazineIds; }; -} forEach (_magazines arrayIntersect _magazines); +} forEach ([_player, 2] call EFUNC(common,uniqueItems)); _actions diff --git a/addons/intelitems/functions/fnc_createControl.sqf b/addons/intelitems/functions/fnc_createControl.sqf index b56d3f36819..5f8fc61ca9a 100644 --- a/addons/intelitems/functions/fnc_createControl.sqf +++ b/addons/intelitems/functions/fnc_createControl.sqf @@ -44,7 +44,7 @@ private _ctrlContent = _controlsGroup controlsGroupCtrl IDC_CONTENT; _ctrlContent ctrlSetText GET_DATA(_index); // Restore position of controls group (center if not saved) -private _position = [GVAR(controlsData), _index] call CBA_fnc_hashGet; +private _position = GVAR(controlsData) get _index; if (isNil "_position") then { ctrlPosition _controlsGroup params ["", "", "_posW", "_posH"]; diff --git a/addons/intelitems/functions/fnc_deleteControl.sqf b/addons/intelitems/functions/fnc_deleteControl.sqf index c2b986b21f7..4d7d9cd2e28 100644 --- a/addons/intelitems/functions/fnc_deleteControl.sqf +++ b/addons/intelitems/functions/fnc_deleteControl.sqf @@ -21,7 +21,7 @@ private _index = _controlsGroup getVariable QGVAR(index); // Save position of controls group ctrlPosition _controlsGroup params ["_posX", "_posY"]; -[GVAR(controlsData), _index, [_posX, _posY]] call CBA_fnc_hashSet; +GVAR(controlsData) set [_index, [_posX, _posY]]; // Update data if modified private _ctrlContent = _controlsGroup controlsGroupCtrl IDC_CONTENT; diff --git a/addons/intelitems/functions/fnc_handleLoadout.sqf b/addons/intelitems/functions/fnc_handleLoadout.sqf index f4e2ed5b25f..47d0077cc68 100644 --- a/addons/intelitems/functions/fnc_handleLoadout.sqf +++ b/addons/intelitems/functions/fnc_handleLoadout.sqf @@ -21,7 +21,6 @@ private _allIndices = []; // Handle magazine ids with missing index assignments private _cfgMagazines = configFile >> "CfgMagazines"; -private _magazines = magazines _player; { if (getNumber (_cfgMagazines >> _x >> QGVAR(intel)) == 1) then { @@ -39,7 +38,7 @@ private _magazines = magazines _player; }; } forEach _magazineIds; }; -} forEach (_magazines arrayIntersect _magazines); +} forEach ([_player, 2] call EFUNC(common,uniqueItems)); // Close any open controls if player no longer has needed magazine { diff --git a/addons/interact_menu/CfgEventHandlers.hpp b/addons/interact_menu/CfgEventHandlers.hpp index 0704097f25d..ec9f209f5a9 100644 --- a/addons/interact_menu/CfgEventHandlers.hpp +++ b/addons/interact_menu/CfgEventHandlers.hpp @@ -18,9 +18,6 @@ class Extended_PostInit_EventHandlers { }; class Extended_DisplayLoad_EventHandlers { - class RscDiary { - ADDON = QUOTE(call COMPILE_SCRIPT(XEH_displayLoad)); - }; class RscDisplayInterrupt { ADDON = QUOTE(_this call FUNC(handleEscapeMenu)); }; diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index d0c6d93940e..663888e284c 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -42,7 +42,7 @@ GVAR(ParsedTextCached) = []; }; }] call CBA_fnc_addEventHandler; // Install the render EH on the main display - addMissionEventHandler ["Draw3D", {call FUNC(render)}]; + addMissionEventHandler ["Draw2D", {call FUNC(render)}]; }] call CBA_fnc_addEventHandler; //Add Actions to Houses: diff --git a/addons/interact_menu/XEH_displayLoad.sqf b/addons/interact_menu/XEH_displayLoad.sqf deleted file mode 100644 index 5d190e3d745..00000000000 --- a/addons/interact_menu/XEH_displayLoad.sqf +++ /dev/null @@ -1,9 +0,0 @@ -#include "script_component.hpp" - -disableSerialization; - -params ["_display"]; - -if (ctrlIDD _display == 12) then { // RscDisplayMainMap - (_display displayCtrl 51) ctrlAddEventHandler ["Draw", {_this call FUNC(render)}]; -}; diff --git a/addons/main/script_debug.hpp b/addons/main/script_debug.hpp index 72b6657094a..a64e202131c 100644 --- a/addons/main/script_debug.hpp +++ b/addons/main/script_debug.hpp @@ -43,7 +43,7 @@ PERFORMANCE COUNTERS SECTION // To Use: [] call ace_common_fnc_dumpPerformanceCounters; #ifdef ENABLE_PERFORMANCE_COUNTERS - #define CBA_fnc_addPerFrameHandler { _ret = [(_this select 0), (_this select 1), (_this select 2), #function] call CBA_fnc_addPerFrameHandler; if(isNil "ACE_PFH_COUNTER" ) then { ACE_PFH_COUNTER=[]; }; ACE_PFH_COUNTER pushBack [[_ret, __FILE__, __LINE__], [(_this select 0), (_this select 1), (_this select 2)]]; _ret } + #define CBA_fnc_addPerFrameHandler { private _ret = (_this select [0, 2]) call CBA_fnc_addPerFrameHandler; if(isNil "ACE_PFH_COUNTER" ) then { ACE_PFH_COUNTER=[]; }; ACE_PFH_COUNTER pushBack [[_ret, __FILE__, __LINE__], (_this select [0, 2])]; _ret } #define CREATE_COUNTER(x) if(isNil "ACE_COUNTERS" ) then { ACE_COUNTERS=[]; }; GVAR(DOUBLES(x,counter))=[]; GVAR(DOUBLES(x,counter)) set[0, QUOTE(GVAR(DOUBLES(x,counter)))]; GVAR(DOUBLES(x,counter)) set[1, diag_tickTime]; ACE_COUNTERS pushBack GVAR(DOUBLES(x,counter)); #define BEGIN_COUNTER(x) if(isNil QUOTE(GVAR(DOUBLES(x,counter)))) then { CREATE_COUNTER(x) }; GVAR(DOUBLES(x,counter)) set[2, diag_tickTime]; diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf index 5ce1e68892f..8635c8020ab 100644 --- a/addons/maptools/XEH_postInitClient.sqf +++ b/addons/maptools/XEH_postInitClient.sqf @@ -7,6 +7,7 @@ if (!hasInterface) exitWith {}; // Init variables GVAR(mapGpsShow) = true; GVAR(mapGpsNextUpdate) = -1; +GVAR(lastDrawnLine) = ""; GVAR(mapTool_Shown) = 0; GVAR(mapTool_pos) = [0, 0]; @@ -47,6 +48,12 @@ GVAR(plottingBoard_markers) = createHashMap; addMissionEventHandler ["MarkerCreated", { [_this, false] call FUNC(handlePlottingBoardMarkers); + + // Cache last user-drawn polyline marker + private _marker = _this select 0; + if ((markerPolyline _marker) isNotEqualTo []) then { + GVAR(lastDrawnLine) = _marker; + }; }]; addMissionEventHandler ["MarkerDeleted", { diff --git a/addons/maptools/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf index 5a00b1ab1b9..d0876b9e737 100644 --- a/addons/maptools/functions/fnc_handleMouseButton.sqf +++ b/addons/maptools/functions/fnc_handleMouseButton.sqf @@ -38,7 +38,7 @@ if ((_button == 0) && {GVAR(freedrawing) || _ctrlKey}) exitWith { if (_allMarkers isEqualTo []) exitWith {}; - private _markerName = _allMarkers select -1; + private _markerName = GVAR(lastDrawnLine); private _markerPos = getMarkerPos _markerName; private _distanceCheck = _markerPos distance2D GVAR(drawPosStart); diff --git a/addons/medical/dev/watchVariable.sqf b/addons/medical/dev/watchVariable.sqf index 7684c1a17d9..7c27acbac8d 100644 --- a/addons/medical/dev/watchVariable.sqf +++ b/addons/medical/dev/watchVariable.sqf @@ -59,7 +59,7 @@ GVAR(dev_watchVariableRunning) = true; _return pushBack format [" - [Pain: %1] [Suppress: %2]", _pain toFixed 3, _painSuppress toFixed 3]; // Damage: - private _damage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]; + private _damage = GET_BODYPART_DAMAGE(_unit); private _limping = ["", "[ Limping ]"] select (_unit getVariable [QEGVAR(medical,isLimping), false]); _return pushBack format ["BodyPartDamage: [H: %1] [B: %2]", (_damage select 0) toFixed 2, (_damage select 1) toFixed 2]; _return pushBack format ["[LA:%1] [RA: %2] [LL:%3] [RL: %4]", (_damage select 2) toFixed 2, (_damage select 3) toFixed 2, (_damage select 4) toFixed 2, (_damage select 5) toFixed 2]; diff --git a/addons/medical/functions/fnc_addDamageToUnit.sqf b/addons/medical/functions/fnc_addDamageToUnit.sqf index 2ffe8d77322..7d71888eb08 100644 --- a/addons/medical/functions/fnc_addDamageToUnit.sqf +++ b/addons/medical/functions/fnc_addDamageToUnit.sqf @@ -54,14 +54,14 @@ if (!isNull _instigator) then { }; #ifdef DEBUG_TESTRESULTS -private _startDmg = +(_unit getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]); +private _startDmg = +GET_BODYPART_DAMAGE(_unit); private _startPain = GET_PAIN(_unit); #endif [QEGVAR(medical,woundReceived), [_unit, [[_damageToAdd, _bodyPart, _damageToAdd]], _instigator, _typeOfDamage]] call CBA_fnc_localEvent; #ifdef DEBUG_TESTRESULTS -private _endDmg = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]; +private _endDmg = GET_BODYPART_DAMAGE(_unit); private _endPain = GET_PAIN(_unit); private _typeOfDamageAdj = _typeOfDamage call EFUNC(medical_damage,getTypeOfDamage); private _config = configFile >> "ACE_Medical_Injuries" >> "damageTypes" >> _typeOfDamageAdj; diff --git a/addons/medical/functions/fnc_deserializeState.sqf b/addons/medical/functions/fnc_deserializeState.sqf index 6fbb00985db..8416599bec5 100644 --- a/addons/medical/functions/fnc_deserializeState.sqf +++ b/addons/medical/functions/fnc_deserializeState.sqf @@ -97,7 +97,7 @@ private _state = [_json] call CBA_fnc_parseJSON; [QEGVAR(medical,ivBags), nil], [QEGVAR(medical,triageLevel), 0], [QEGVAR(medical,triageCard), []], - [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]] + [VAR_BODYPART_DAMAGE, DEFAULT_BODYPART_DAMAGE_VALUES] // Offset needs to be converted // [VAR_MEDICATIONS, []] ]; diff --git a/addons/medical/functions/fnc_serializeState.sqf b/addons/medical/functions/fnc_serializeState.sqf index 67783e85d94..b12cf781cd3 100644 --- a/addons/medical/functions/fnc_serializeState.sqf +++ b/addons/medical/functions/fnc_serializeState.sqf @@ -44,7 +44,7 @@ private _state = [] call CBA_fnc_createNamespace; [QEGVAR(medical,ivBags), nil], [QEGVAR(medical,triageLevel), 0], [QEGVAR(medical,triageCard), []], - [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]] + [VAR_BODYPART_DAMAGE, DEFAULT_BODYPART_DAMAGE_VALUES] // Time needs to be converted // [VAR_MEDICATIONS, []] ]; diff --git a/addons/medical_damage/functions/fnc_handleIncapacitation.sqf b/addons/medical_damage/functions/fnc_handleIncapacitation.sqf index 391d69c08bf..be9e80db8a0 100644 --- a/addons/medical_damage/functions/fnc_handleIncapacitation.sqf +++ b/addons/medical_damage/functions/fnc_handleIncapacitation.sqf @@ -18,7 +18,7 @@ params ["_unit"]; private _painLevel = GET_PAIN_PERCEIVED(_unit); -private _bodyPartDamage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]; +private _bodyPartDamage = GET_BODYPART_DAMAGE(_unit); _bodyPartDamage params ["_headDamage", "_bodyDamage"]; diff --git a/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf b/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf index 270e77b2513..402018353aa 100644 --- a/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandlerBase.sqf @@ -35,7 +35,7 @@ private _createdWounds = false; private _updateDamageEffects = false; private _painLevel = 0; private _criticalDamage = false; -private _bodyPartDamage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]; +private _bodyPartDamage = GET_BODYPART_DAMAGE(_unit); private _bodyPartVisParams = [_unit, false, false, false, false]; // params array for EFUNC(medical_engine,updateBodyPartVisuals); // process wounds separately for each body part hit @@ -197,7 +197,7 @@ if (_updateDamageEffects) then { if (_createdWounds) then { _unit setVariable [VAR_OPEN_WOUNDS, _openWounds, true]; - _unit setVariable [QEGVAR(medical,bodyPartDamage), _bodyPartDamage, true]; + _unit setVariable [VAR_BODYPART_DAMAGE, _bodyPartDamage, true]; _bodyPartVisParams call EFUNC(medical_engine,updateBodyPartVisuals); diff --git a/addons/medical_engine/functions/fnc_updateBodyPartVisuals.sqf b/addons/medical_engine/functions/fnc_updateBodyPartVisuals.sqf index a4403ffa7d5..219b46d5894 100644 --- a/addons/medical_engine/functions/fnc_updateBodyPartVisuals.sqf +++ b/addons/medical_engine/functions/fnc_updateBodyPartVisuals.sqf @@ -22,7 +22,7 @@ params ["_unit", "_updateHead", "_updateBody", "_updateArms", "_updateLegs"]; TRACE_5("updateBodyPartVisuals",_unit,_updateHead,_updateBody,_updateArms,_updateLegs); -private _bodyPartDamage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]; +private _bodyPartDamage = GET_BODYPART_DAMAGE(_unit); if (_updateHead) then { [_unit, "head", (_bodyPartDamage select 0) > VISUAL_BODY_DAMAGE_THRESHOLD] call FUNC(damageBodyPart); diff --git a/addons/medical_engine/script_macros_medical.hpp b/addons/medical_engine/script_macros_medical.hpp index 167765c5767..20a9a689209 100644 --- a/addons/medical_engine/script_macros_medical.hpp +++ b/addons/medical_engine/script_macros_medical.hpp @@ -134,6 +134,8 @@ #define DEFAULT_FRACTURE_VALUES [0,0,0,0,0,0] +#define DEFAULT_BODYPART_DAMAGE_VALUES [0,0,0,0,0,0] + // Triage colors, for consistency across UIs and functions #define TRIAGE_COLOR_NONE 0, 0, 0, 0.9 #define TRIAGE_COLOR_MINIMAL 0, 0.5, 0, 0.9 @@ -168,6 +170,7 @@ #define VAR_OPEN_WOUNDS QEGVAR(medical,openWounds) #define VAR_BANDAGED_WOUNDS QEGVAR(medical,bandagedWounds) #define VAR_STITCHED_WOUNDS QEGVAR(medical,stitchedWounds) +#define VAR_BODYPART_DAMAGE QEGVAR(medical,bodyPartDamage) // These variables track gradual adjustments (from medication, etc.) #define VAR_MEDICATIONS QEGVAR(medical,medications) // These variables track the current state of status values above @@ -197,6 +200,7 @@ #define GET_BANDAGED_WOUNDS(unit) (unit getVariable [VAR_BANDAGED_WOUNDS, createHashMap]) #define GET_STITCHED_WOUNDS(unit) (unit getVariable [VAR_STITCHED_WOUNDS, createHashMap]) #define GET_DAMAGE_THRESHOLD(unit) (unit getVariable [QEGVAR(medical,damageThreshold), [EGVAR(medical,AIDamageThreshold),EGVAR(medical,playerDamageThreshold)] select (isPlayer unit)]) +#define GET_BODYPART_DAMAGE(unit) (unit getVariable [VAR_BODYPART_DAMAGE, DEFAULT_BODYPART_DAMAGE_VALUES]) // The following function calls are defined here just for consistency #define GET_BLOOD_LOSS(unit) ([unit] call EFUNC(medical_status,getBloodLoss)) diff --git a/addons/medical_gui/functions/fnc_updateBodyImage.sqf b/addons/medical_gui/functions/fnc_updateBodyImage.sqf index 25204e4b6ac..e197ef96a4e 100644 --- a/addons/medical_gui/functions/fnc_updateBodyImage.sqf +++ b/addons/medical_gui/functions/fnc_updateBodyImage.sqf @@ -22,7 +22,7 @@ params ["_ctrlGroup", "_target", "_selectionN"]; // Get tourniquets, damage, and blood loss for target private _tourniquets = GET_TOURNIQUETS(_target); private _fractures = GET_FRACTURES(_target); -private _bodyPartDamage = _target getVariable [QEGVAR(medical,bodyPartDamage), [0, 0, 0, 0, 0, 0]]; +private _bodyPartDamage = GET_BODYPART_DAMAGE(_target); private _damageThreshold = GET_DAMAGE_THRESHOLD(_target); private _bodyPartBloodLoss = [0, 0, 0, 0, 0, 0]; diff --git a/addons/medical_gui/functions/fnc_updateCategories.sqf b/addons/medical_gui/functions/fnc_updateCategories.sqf index c2f1d2a11c8..c973aaf3cd6 100644 --- a/addons/medical_gui/functions/fnc_updateCategories.sqf +++ b/addons/medical_gui/functions/fnc_updateCategories.sqf @@ -26,6 +26,19 @@ params ["_display"]; }; _ctrl ctrlEnable _enable; + if (!_enable + && {isNull findDisplay 312} + && {!( + EGVAR(medical_treatment,holsterRequired) == 0 + || {!isNull objectParent ACE_player} // medic is in a vehicle, so weapon is considered holstered + || {!isNull objectParent GVAR(target)} // patient is in a vehicle, ^ + || {(EGVAR(medical_treatment,holsterRequired) in [2,4]) && {_category == "examine"}} // if examine bypass is on + || {currentWeapon ACE_player isEqualTo ""} // weapon is holstered + || {(EGVAR(medical_treatment,holsterRequired) <= 2) && {weaponLowered ACE_player}} // if just lowered is allowed + )}) then { + _ctrl ctrlSetTooltip LLSTRING(needToHolster); + }; + private _selectedColor = [ profileNamespace getVariable ["GUI_BCG_RGB_R", 0.13], profileNamespace getVariable ["GUI_BCG_RGB_G", 0.54], diff --git a/addons/medical_gui/functions/fnc_updateInjuryList.sqf b/addons/medical_gui/functions/fnc_updateInjuryList.sqf index c9c9694a445..8cd5ef2fb4a 100644 --- a/addons/medical_gui/functions/fnc_updateInjuryList.sqf +++ b/addons/medical_gui/functions/fnc_updateInjuryList.sqf @@ -163,7 +163,7 @@ _entries pushBack [localize _bodyPartName, [1, 1, 1, 1]]; // Damage taken tooltip if (GVAR(showDamageEntry)) then { - private _bodyPartDamage = (_target getVariable [QEGVAR(medical,bodyPartDamage), [0, 0, 0, 0, 0, 0]]) select _selectionN; + private _bodyPartDamage = GET_BODYPART_DAMAGE(_target) select _selectionN; if (_bodyPartDamage > 0) then { private _damageThreshold = GET_DAMAGE_THRESHOLD(_target); switch (true) do { diff --git a/addons/medical_gui/stringtable.xml b/addons/medical_gui/stringtable.xml index 93c2bed5dc9..5bb16e8b721 100644 --- a/addons/medical_gui/stringtable.xml +++ b/addons/medical_gui/stringtable.xml @@ -1693,5 +1693,8 @@ 重篤な外傷 慢性创伤 + + You must holster your weapon first! + diff --git a/addons/medical_status/functions/fnc_initUnit.sqf b/addons/medical_status/functions/fnc_initUnit.sqf index 278163d90b9..f1e5c1a4df3 100644 --- a/addons/medical_status/functions/fnc_initUnit.sqf +++ b/addons/medical_status/functions/fnc_initUnit.sqf @@ -70,7 +70,7 @@ if (_isRespawn) then { _unit setVariable [QEGVAR(medical,triageCard), [], true]; // Damage storage - _unit setVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0], true]; + _unit setVariable [VAR_BODYPART_DAMAGE, DEFAULT_BODYPART_DAMAGE_VALUES, true]; // Medication _unit setVariable [VAR_MEDICATIONS, [], true]; diff --git a/addons/medical_treatment/XEH_PREP.hpp b/addons/medical_treatment/XEH_PREP.hpp index d7165b59705..b0ebf325e76 100644 --- a/addons/medical_treatment/XEH_PREP.hpp +++ b/addons/medical_treatment/XEH_PREP.hpp @@ -1,6 +1,7 @@ PREP(addLoadPatientActions); PREP(addToLog); PREP(addToTriageCard); +PREP(addTrauma); PREP(bandage); PREP(bandageLocal); PREP(bodyCleanupLoop); @@ -58,6 +59,7 @@ PREP(scanMedicalItems); PREP(setTriageStatus); PREP(splint); PREP(splintLocal); +PREP(stitchWound); PREP(surgicalKitProgress); PREP(surgicalKitStart); PREP(tourniquet); diff --git a/addons/medical_treatment/functions/fnc_addTrauma.sqf b/addons/medical_treatment/functions/fnc_addTrauma.sqf new file mode 100644 index 00000000000..dab6f1d929c --- /dev/null +++ b/addons/medical_treatment/functions/fnc_addTrauma.sqf @@ -0,0 +1,43 @@ +#include "..\script_component.hpp" +/* + * Author: LinkIsGrim + * Add trauma to a body part. + * + * Arguments: + * 0: Patient + * 1: Body Part + * 2: Amount of trauma to add, negative to remove + * + * Return Value: + * None + * + * Example: + * [player, "head", -5] call ace_medical_treatment_fnc_addTrauma + * + * Public: No + */ + +params ["_unit", "_bodyPart", "_trauma"]; + +private _partIndex = ALL_BODY_PARTS find _bodyPart; +private _bodyPartDamage = GET_BODYPART_DAMAGE(_unit); +private _newDam = (_bodyPartDamage select _partIndex) + _trauma; + +// Prevent obscenely small damage from lack of floating precision +if (_trauma < 0 && _newDam < 0.05) then { + _bodyPartDamage set [_partIndex, 0]; +} else { + _bodyPartDamage set [_partIndex, _newDam]; +}; + +// Update body part visuals +switch (_bodyPart) do { + case "head": { [_unit, true, false, false, false] call EFUNC(medical_engine,updateBodyPartVisuals); }; + case "body": { [_unit, false, true, false, false] call EFUNC(medical_engine,updateBodyPartVisuals); }; + case "leftarm"; + case "rightarm": { [_unit, false, false, true, false] call EFUNC(medical_engine,updateBodyPartVisuals); }; + default { [_unit, false, false, false, true] call EFUNC(medical_engine,updateBodyPartVisuals); }; +}; + +TRACE_2("trauma - added damage",_trauma,_newDam); +_unit setVariable [VAR_BODYPART_DAMAGE, _bodyPartDamage, true]; diff --git a/addons/medical_treatment/functions/fnc_bandageLocal.sqf b/addons/medical_treatment/functions/fnc_bandageLocal.sqf index 2c59540fd12..74dce0bc40c 100644 --- a/addons/medical_treatment/functions/fnc_bandageLocal.sqf +++ b/addons/medical_treatment/functions/fnc_bandageLocal.sqf @@ -72,27 +72,8 @@ if ( }; if (GVAR(clearTrauma) == 2) then { - TRACE_2("clearTrauma - clearing trauma after bandage",_bodyPart,_openWounds); - private _partIndex = ALL_BODY_PARTS find _bodyPart; - private _bodyPartDamage = _patient getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]; - private _newDam = (_bodyPartDamage select _partIndex) - _treatedDamage; - - // Prevent obscenely small damage from lack of floating precision - if (_newDam < 0.05) then { - _bodyPartDamage set [_partIndex, 0]; - } else { - _bodyPartDamage set [_partIndex, _newDam]; - }; - _patient setVariable [QEGVAR(medical,bodyPartDamage), _bodyPartDamage, true]; - TRACE_2("clearTrauma - healed damage",_partIndex,_treatedDamage); - - switch (_bodyPart) do { - case "head": { [_patient, true, false, false, false] call EFUNC(medical_engine,updateBodyPartVisuals); }; - case "body": { [_patient, false, true, false, false] call EFUNC(medical_engine,updateBodyPartVisuals); }; - case "leftarm"; - case "rightarm": { [_patient, false, false, true, false] call EFUNC(medical_engine,updateBodyPartVisuals); }; - default { [_patient, false, false, false, true] call EFUNC(medical_engine,updateBodyPartVisuals); }; - }; + TRACE_2("trauma - clearing trauma after bandage",_bodyPart,_woundsOnPart); + [_patient, _bodyPart, -_treatedDamage] call FUNC(addTrauma); }; // Reset treatment condition cache for nearby players if we stopped all bleeding diff --git a/addons/medical_treatment/functions/fnc_fullHealLocal.sqf b/addons/medical_treatment/functions/fnc_fullHealLocal.sqf index 3d14380c776..059f33c01f2 100644 --- a/addons/medical_treatment/functions/fnc_fullHealLocal.sqf +++ b/addons/medical_treatment/functions/fnc_fullHealLocal.sqf @@ -73,7 +73,7 @@ _patient setVariable [VAR_OXYGEN_DEMAND, 0, true]; _patient setVariable [QEGVAR(medical,ivBags), nil, true]; // Damage storage -_patient setVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0], true]; +_patient setVariable [VAR_BODYPART_DAMAGE, DEFAULT_BODYPART_DAMAGE_VALUES, true]; // wakeup needs to be done after achieving stable vitals, but before manually reseting unconc var if IS_UNCONSCIOUS(_patient) then { diff --git a/addons/medical_treatment/functions/fnc_getHealTime.sqf b/addons/medical_treatment/functions/fnc_getHealTime.sqf index 74c2bb26d87..4e173579e21 100644 --- a/addons/medical_treatment/functions/fnc_getHealTime.sqf +++ b/addons/medical_treatment/functions/fnc_getHealTime.sqf @@ -24,6 +24,6 @@ private _bodyPartDamage = 0; { _bodyPartDamage = _bodyPartDamage + _x; -} forEach (_patient getVariable [QEGVAR(medical,bodyPartDamage), []]); +} forEach GET_BODYPART_DAMAGE(_patient); 10 max (((_bodyPartDamage * DAMAGE_SCALING_FACTOR) min 180) * GVAR(timeCoefficientPAK)) diff --git a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf index b90198f0eb6..1d6a1228035 100644 --- a/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical_treatment/functions/fnc_handleBandageOpening.sqf @@ -98,7 +98,7 @@ if (random 1 <= _reopeningChance * GVAR(woundReopenChance)) then { _injury params ["_classID"]; private _selectedInjury = _woundsOnPart select _injuryIndex; - _selectedInjury params ["_selClassID", "_selAmmount"]; + _selectedInjury params ["_selClassID", "_selAmount", "", "_selDamage"]; if (_selClassID == _classID) then { // matching the IDs private _bandagedWounds = GET_BANDAGED_WOUNDS(_target); private _exist = false; @@ -113,7 +113,7 @@ if (random 1 <= _reopeningChance * GVAR(woundReopenChance)) then { if (_exist) then { TRACE_2("Reopening Wound",_bandagedWounds,_openWounds); - _selectedInjury set [1, _selAmmount + _impact]; + _selectedInjury set [1, _selAmount + _impact]; _target setVariable [VAR_BANDAGED_WOUNDS, _bandagedWounds, true]; _target setVariable [VAR_OPEN_WOUNDS, _openWounds, true]; @@ -123,20 +123,7 @@ if (random 1 <= _reopeningChance * GVAR(woundReopenChance)) then { // Re-add trauma and damage visuals if (GVAR(clearTrauma) == 2) then { - private _injuryDamage = (_selectedInjury select 4) * _impact; - private _bodyPartDamage = _target getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]; - private _newDam = (_bodyPartDamage select _partIndex) + _injuryDamage; - _bodyPartDamage set [_partIndex, _newDam]; - - _target setVariable [QEGVAR(medical,bodyPartDamage), _bodyPartDamage, true]; - - switch (_partIndex) do { - case 0: { [_target, true, false, false, false] call EFUNC(medical_engine,updateBodyPartVisuals); }; - case 1: { [_target, false, true, false, false] call EFUNC(medical_engine,updateBodyPartVisuals); }; - case 2; - case 3: { [_target, false, false, true, false] call EFUNC(medical_engine,updateBodyPartVisuals); }; - default { [_target, false, false, false, true] call EFUNC(medical_engine,updateBodyPartVisuals); }; - }; + [_target, _part, _selDamage * _impact] call FUNC(addTrauma); }; // Check if we gained limping from this wound re-opening diff --git a/addons/medical_treatment/functions/fnc_stitchWound.sqf b/addons/medical_treatment/functions/fnc_stitchWound.sqf new file mode 100644 index 00000000000..c9e7d0aac18 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_stitchWound.sqf @@ -0,0 +1,75 @@ +#include "..\script_component.hpp" +/* + * Author: BaerMitUmlaut, mharis001, LinkIsGrim + * Stitches a wound (either the first or a specific wound) from a body part. + * + * Arguments: + * 0: Patient + * 1: Body Part + * 2: Wound Array, will close first wound on body part if empty (default: []) + * + * Return Value: + * Wound was stitched + * + * Example: + * [player, "head"] call ace_medical_treatment_fnc_stitchWound + * + * Public: No + */ + +params ["_patient", "_bodyPart", ["_treatedWound", []]]; + +private _bandagedWounds = GET_BANDAGED_WOUNDS(_patient); +private _bandagedWoundsOnPart = _bandagedWounds getOrDefault [_bodyPart, []]; + +// Get the first stitchable wound from bandaged wounds, or make sure the passed wound exists +private _bandagedIndex = (count _bandagedWoundsOnPart) - 1; +if (_treatedWound isEqualTo []) then { + _treatedWound = _bandagedWoundsOnPart param [_bandagedIndex, _treatedWound]; +} else { + _bandagedIndex = _bandagedWoundsOnPart find _treatedWound; +}; + +// Wound doesn't exist or there are no bandaged wounds to stitch +if (_bandagedIndex == -1) exitWith {false}; + +// Remove the wound from bandagedWounds +_bandagedWoundsOnPart deleteAt _bandagedIndex; + +_treatedWound params ["_treatedID", "_treatedAmountOf", "", "_treatedDamageOf"]; + +// Check if we need to add a new stitched wound or increase the amount of an existing one +private _stitchedWounds = GET_STITCHED_WOUNDS(_patient); +private _stitchedWoundsOnPart = _stitchedWounds getOrDefault [_bodyPart, [], true]; + +private _stitchedIndex = _stitchedWoundsOnPart findIf { + _x params ["_classID"]; + _classID == _treatedID +}; + +if (_stitchedIndex == -1) then { + _stitchedWoundsOnPart pushBack _treatedWound; +} else { + private _wound = _stitchedWoundsOnPart select _stitchedIndex; + _wound set [1, (_wound select 1) + _treatedAmountOf]; +}; + +if (GVAR(clearTrauma) == 1) then { + TRACE_2("trauma - clearing trauma after stitching",_bodyPart,_treatedWound); + [_patient, _bodyPart, -(_treatedDamageOf * _treatedAmountOf)] call FUNC(addTrauma); +}; + +_patient setVariable [VAR_BANDAGED_WOUNDS, _bandagedWounds, true]; +_patient setVariable [VAR_STITCHED_WOUNDS, _stitchedWounds, true]; + +// Check if we fixed limping by stitching this wound (only for leg wounds) +if ( + EGVAR(medical,limping) == 2 + && {_patient getVariable [QEGVAR(medical,isLimping), false]} + && {_bodyPart in ["leftleg", "rightleg"]} +) then { + TRACE_3("Updating damage effects",_patient,_bodyPart,local _patient); + [QEGVAR(medical_engine,updateDamageEffects), _patient, _patient] call CBA_fnc_targetEvent; +}; + +true // return diff --git a/addons/medical_treatment/functions/fnc_surgicalKitProgress.sqf b/addons/medical_treatment/functions/fnc_surgicalKitProgress.sqf index 477c8101f5d..a70a0d57b48 100644 --- a/addons/medical_treatment/functions/fnc_surgicalKitProgress.sqf +++ b/addons/medical_treatment/functions/fnc_surgicalKitProgress.sqf @@ -5,7 +5,7 @@ * * Arguments: * 0: Arguments - * 0: Medic (not used) + * 0: Medic * 1: Patient * 2: Body Part * 1: Elapsed Time @@ -32,54 +32,12 @@ if (_bandagedWoundsOnPart isEqualTo []) exitWith {false}; // Not enough time has elapsed to stitch a wound if (_totalTime - _elapsedTime > ([_patient, _patient, _bodyPart] call FUNC(getStitchTime)) - GVAR(woundStitchTime)) exitWith {true}; -// Remove the first stitchable wound from the bandaged wounds -private _treatedWound = _bandagedWoundsOnPart deleteAt (count _bandagedWoundsOnPart - 1); -_treatedWound params ["_treatedID", "_treatedAmountOf", "", "_treatedDamageOf"]; +// Stitch the first possible wound on the body part +private _stitched = [_patient, _bodyPart] call FUNC(stitchWound); -// Check if we need to add a new stitched wound or increase the amount of an existing one -private _stitchedWounds = GET_STITCHED_WOUNDS(_patient); -private _stitchedWoundsOnPart = _stitchedWounds getOrDefault [_bodyPart, [], true]; - -private _woundIndex = _stitchedWoundsOnPart findIf { - _x params ["_classID"]; - _classID == _treatedID -}; - -if (_woundIndex == -1) then { - _stitchedWoundsOnPart pushBack _treatedWound; -} else { - private _wound = _stitchedWoundsOnPart select _woundIndex; - _wound set [1, (_wound select 1) + _treatedAmountOf]; -}; - -if (GVAR(clearTrauma) == 1) then { - private _partIndex = ALL_BODY_PARTS find _bodyPart; - TRACE_2("clearTrauma - clearing trauma after stitching",_bodyPart,_treatedWound); - private _bodyPartDamage = _patient getVariable [QEGVAR(medical,bodyPartDamage), []]; - _bodyPartDamage set [_partIndex, (_bodyPartDamage select _partIndex) - (_treatedDamageOf * _treatedAmountOf)]; - _patient setVariable [QEGVAR(medical,bodyPartDamage), _bodyPartDamage, true]; - TRACE_2("clearTrauma - healed damage",_bodyPart,_treatedDamageOf); - - switch (_bodyPart) do { - case "head": { [_patient, true, false, false, false] call EFUNC(medical_engine,updateBodyPartVisuals); }; - case "body": { [_patient, false, true, false, false] call EFUNC(medical_engine,updateBodyPartVisuals); }; - case "leftarm"; - case "rightarm": { [_patient, false, false, true, false] call EFUNC(medical_engine,updateBodyPartVisuals); }; - default { [_patient, false, false, false, true] call EFUNC(medical_engine,updateBodyPartVisuals); }; - }; -}; - -_patient setVariable [VAR_BANDAGED_WOUNDS, _bandagedWounds, true]; -_patient setVariable [VAR_STITCHED_WOUNDS, _stitchedWounds, true]; - -// Check if we fixed limping by stitching this wound (only for leg wounds) -if ( - EGVAR(medical,limping) == 2 - && {_patient getVariable [QEGVAR(medical,isLimping), false]} - && {_bodyPart in ["leftleg", "rightleg"]} -) then { - TRACE_3("Updating damage effects",_patient,_bodyPart,local _patient); - [QEGVAR(medical_engine,updateDamageEffects), _patient, _patient] call CBA_fnc_targetEvent; +if (!_stitched) exitWith { + ERROR_1("failed to stitch wound on unit - %1",_patient); + false }; // Consume a suture for the next wound if one exists, stop stitching if none are left diff --git a/addons/realisticnames/compat_explosives/CfgMagazines.hpp b/addons/realisticnames/compat_explosives/CfgMagazines.hpp index 41a19345dbe..966735d1e04 100644 --- a/addons/realisticnames/compat_explosives/CfgMagazines.hpp +++ b/addons/realisticnames/compat_explosives/CfgMagazines.hpp @@ -6,4 +6,9 @@ class CfgMagazines { class ACE_DemoCharge_Remote_Mag_Throwable: ACE_SatchelCharge_Remote_Mag_Throwable { displayName = CSTRING(DemoChargeThrowable_Name); }; + + class APERSMine_Range_Mag; + class ACE_APERSMine_ToePopper_Mag: APERSMine_Range_Mag { + displayName = CSTRING(APERSMine_ToePopper_Name); + }; }; diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 44bb2d514c6..999f80bfeb0 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -188,6 +188,9 @@ VS-50 Anti-Personel Mayını VS-50 gyalogsági taposóakna + + VS-50 Anti-Personnel Mine (Toe-Popper) + PMR-3 Anti-Personnel Tripwire Mine PMR-3 Protipěchotní mina (drát)