mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fire - Remove medical_engine
dependency (#10122)
* Remove medical dependency from fire * Update initSettings.inc.sqf
This commit is contained in:
parent
5d133bd793
commit
a7ce63a536
@ -1,25 +1,25 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
[QGVAR(burn), LINKFUNC(burn)] call CBA_fnc_addEventHandler;
|
|
||||||
[QGVAR(burnEffects), LINKFUNC(burnEffects)] call CBA_fnc_addEventHandler;
|
|
||||||
[QGVAR(burnSimulation), LINKFUNC(burnSimulation)] call CBA_fnc_addEventHandler;
|
|
||||||
|
|
||||||
[QGVAR(playScream), {
|
|
||||||
params ["_scream", "_source"];
|
|
||||||
|
|
||||||
// Only play sound if enabled in settings and enabled for the unit
|
|
||||||
if (GVAR(enableScreams) && {_source getVariable [QGVAR(enableScreams), true]}) then {
|
|
||||||
_source say3D _scream;
|
|
||||||
};
|
|
||||||
}] call CBA_fnc_addEventHandler;
|
|
||||||
|
|
||||||
if (!isServer) exitWith {};
|
|
||||||
|
|
||||||
["CBA_settingsInitialized", {
|
["CBA_settingsInitialized", {
|
||||||
TRACE_1("settingsInit",GVAR(enabled));
|
TRACE_1("settingsInitialized",GVAR(enabled));
|
||||||
|
|
||||||
if (!GVAR(enabled)) exitWith {};
|
if (!GVAR(enabled)) exitWith {};
|
||||||
|
|
||||||
|
[QGVAR(burn), LINKFUNC(burn)] call CBA_fnc_addEventHandler;
|
||||||
|
[QGVAR(burnEffects), LINKFUNC(burnEffects)] call CBA_fnc_addEventHandler;
|
||||||
|
[QGVAR(burnSimulation), LINKFUNC(burnSimulation)] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
|
[QGVAR(playScream), {
|
||||||
|
params ["_scream", "_source"];
|
||||||
|
|
||||||
|
// Only play sound if enabled in settings and enabled for the unit
|
||||||
|
if (GVAR(enableScreams) && {_source getVariable [QGVAR(enableScreams), true]}) then {
|
||||||
|
_source say3D _scream;
|
||||||
|
};
|
||||||
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
|
if (!isServer) exitWith {};
|
||||||
|
|
||||||
GVAR(fireSources) = createHashMap;
|
GVAR(fireSources) = createHashMap;
|
||||||
|
|
||||||
[QGVAR(addFireSource), {
|
[QGVAR(addFireSource), {
|
||||||
|
20
addons/fire/compat_medical_engine/config.cpp
Normal file
20
addons/fire/compat_medical_engine/config.cpp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
class CfgPatches {
|
||||||
|
class SUBADDON {
|
||||||
|
name = COMPONENT_NAME;
|
||||||
|
units[] = {};
|
||||||
|
weapons[] = {};
|
||||||
|
requiredVersion = REQUIRED_VERSION;
|
||||||
|
requiredAddons[] = {"ace_medical_engine"};
|
||||||
|
skipWhenMissingDependencies = 1;
|
||||||
|
author = ECSTRING(common,ACETeam);
|
||||||
|
authors[] = {};
|
||||||
|
url = ECSTRING(main,URL);
|
||||||
|
VERSION_CONFIG;
|
||||||
|
|
||||||
|
addonRootClass = QUOTE(ADDON);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "ACE_Medical_Treatment_Actions.hpp"
|
3
addons/fire/compat_medical_engine/script_component.hpp
Normal file
3
addons/fire/compat_medical_engine/script_component.hpp
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#define SUBCOMPONENT medical_engine
|
||||||
|
#define SUBCOMPONENT_BEAUTIFIED Medical Engine
|
||||||
|
#include "..\script_component.hpp"
|
@ -1,20 +1,12 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
#pragma hemtt flag pe23_ignore_has_include
|
|
||||||
#if __has_include("\z\ace\addons\nomedical\script_component.hpp")
|
|
||||||
#define PATCH_SKIP "No Medical"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PATCH_SKIP
|
|
||||||
ACE_PATCH_NOT_LOADED(ADDON,PATCH_SKIP)
|
|
||||||
#else
|
|
||||||
class CfgPatches {
|
class CfgPatches {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
name = COMPONENT_NAME;
|
name = COMPONENT_NAME;
|
||||||
units[] = {};
|
units[] = {};
|
||||||
weapons[] = {};
|
weapons[] = {};
|
||||||
requiredVersion = REQUIRED_VERSION;
|
requiredVersion = REQUIRED_VERSION;
|
||||||
requiredAddons[] = {"ace_common", "ace_medical_engine"};
|
requiredAddons[] = {"ace_common"};
|
||||||
author = ECSTRING(common,ACETeam);
|
author = ECSTRING(common,ACETeam);
|
||||||
authors[] = {"commy2", "tcvm"};
|
authors[] = {"commy2", "tcvm"};
|
||||||
url = ECSTRING(main,URL);
|
url = ECSTRING(main,URL);
|
||||||
@ -25,7 +17,4 @@ class CfgPatches {
|
|||||||
#include "CfgEventHandlers.hpp"
|
#include "CfgEventHandlers.hpp"
|
||||||
#include "CfgSounds.hpp"
|
#include "CfgSounds.hpp"
|
||||||
#include "CfgVehicles.hpp"
|
#include "CfgVehicles.hpp"
|
||||||
#include "ACE_Medical_Treatment_Actions.hpp"
|
|
||||||
#include "RscTitles.hpp"
|
#include "RscTitles.hpp"
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -148,19 +148,27 @@ params ["_unit", "_instigator"];
|
|||||||
_unit call FUNC(burnReaction);
|
_unit call FUNC(burnReaction);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!isNull _instigator) then {
|
// Keep pain around unconsciousness limit to allow for more fun interactions
|
||||||
_unit setVariable [QEGVAR(medical,lastDamageSource), _instigator];
|
|
||||||
_unit setVariable [QEGVAR(medical,lastInstigator), _instigator];
|
|
||||||
};
|
|
||||||
|
|
||||||
// Common burn areas are the hands and face https://www.ncbi.nlm.nih.gov/pubmed/16899341/
|
|
||||||
private _bodyPart = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"] selectRandomWeighted [0.77, 0.5, 0.8, 0.8, 0.3, 0.3];
|
|
||||||
|
|
||||||
// Keep pain around unconciousness limit to allow for more fun interactions
|
|
||||||
private _damageToAdd = [0.15, _intensity / BURN_MAX_INTENSITY] select (!alive _unit || {GET_PAIN_PERCEIVED(_unit) < (PAIN_UNCONSCIOUS + random 0.2)});
|
private _damageToAdd = [0.15, _intensity / BURN_MAX_INTENSITY] select (!alive _unit || {GET_PAIN_PERCEIVED(_unit) < (PAIN_UNCONSCIOUS + random 0.2)});
|
||||||
|
|
||||||
// Use event directly, as ace_medical_fnc_addDamageToUnit requires unit to be alive
|
if (GETEGVAR(medical,enabled,false)) then {
|
||||||
[QEGVAR(medical,woundReceived), [_unit, [[_damageToAdd, _bodyPart, _damageToAdd]], _instigator, "burn"]] call CBA_fnc_localEvent;
|
if (!isNull _instigator) then {
|
||||||
|
_unit setVariable [QEGVAR(medical,lastDamageSource), _instigator];
|
||||||
|
_unit setVariable [QEGVAR(medical,lastInstigator), _instigator];
|
||||||
|
};
|
||||||
|
|
||||||
|
// Common burn areas are the hands and face https://www.ncbi.nlm.nih.gov/pubmed/16899341/
|
||||||
|
private _bodyPart = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"] selectRandomWeighted [0.77, 0.5, 0.8, 0.8, 0.3, 0.3];
|
||||||
|
|
||||||
|
// Use event directly, as ace_medical_fnc_addDamageToUnit requires unit to be alive
|
||||||
|
[QEGVAR(medical,woundReceived), [_unit, [[_damageToAdd, _bodyPart, _damageToAdd]], _instigator, "burn"]] call CBA_fnc_localEvent;
|
||||||
|
} else {
|
||||||
|
private _bodyParts = [["HitFace", "HitNeck", "HitHead"], ["HitPelvis", "HitAbdomen", "HitDiaphragm", "HitChest", "HitBody"], ["HitArms", "HitHands"], ["HitLegs"]] selectRandomWeighted [0.77, 0.5, 0.8, 0.3];
|
||||||
|
|
||||||
|
{
|
||||||
|
_unit setHitPointDamage [_x, (_unit getHitPointDamage _x) + _damageToAdd, true, _instigator, _instigator];
|
||||||
|
} forEach _bodyParts;
|
||||||
|
};
|
||||||
|
|
||||||
_unit setVariable [QGVAR(intensity), _intensity, true]; // Globally sync intensity across all clients to make sure simulation is deterministic
|
_unit setVariable [QGVAR(intensity), _intensity, true]; // Globally sync intensity across all clients to make sure simulation is deterministic
|
||||||
};
|
};
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
LSTRING(Category_DisplayName),
|
LSTRING(Category_DisplayName),
|
||||||
true,
|
true,
|
||||||
1,
|
1,
|
||||||
{[QGVAR(fireEnabled), _this] call EFUNC(common,cbaSettings_settingChanged)},
|
{[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)},
|
||||||
true // Needs mission restart
|
true // Needs mission restart
|
||||||
] call CBA_fnc_addSetting;
|
] call CBA_fnc_addSetting;
|
||||||
|
|
||||||
|
@ -16,7 +16,14 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "\z\ace\addons\main\script_macros.hpp"
|
#include "\z\ace\addons\main\script_macros.hpp"
|
||||||
|
|
||||||
|
#pragma hemtt flag pe23_ignore_has_include
|
||||||
|
#if __has_include("\z\ace\addons\medical_engine\script_macros_medical.hpp")
|
||||||
#include "\z\ace\addons\medical_engine\script_macros_medical.hpp"
|
#include "\z\ace\addons\medical_engine\script_macros_medical.hpp"
|
||||||
|
#else
|
||||||
|
#define GET_PAIN_PERCEIVED(var) 0
|
||||||
|
#define PAIN_UNCONSCIOUS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#define FIRE_MANAGER_PFH_DELAY 0.25
|
#define FIRE_MANAGER_PFH_DELAY 0.25
|
||||||
#define FLARE_SIZE_MODIFIER 5
|
#define FLARE_SIZE_MODIFIER 5
|
||||||
|
Loading…
Reference in New Issue
Block a user