ACE3/addons/medical_engine/XEH_postInit.sqf
PabstMirror e56cc0d74e
Limping / Splint Treatment (#6947)
* Improve adjustment calcs / wound blood loss / medications

fix func descriptions

Calc wound blood loss on events

reorder includes so scritpmacroMed has global effect

trivial optimization for getCardiacOutput

Fix var

Fix wounds not reopening (nil _category)

Fix surgical kit inherting canBandage conditional

debug hitpoints

Update ACE_Medical_Treatment_Actions.hpp

Use woundBleeding for IS_BLEEDING macro

rework medication vars

comments

Reset var in init / fullHeal

Update addons/medical_treatment/functions/fnc_onMedicationUsage.sqf

Co-Authored-By: PabstMirror <pabstmirror@gmail.com>

* Change wound data array

Drop unique id and merge classId and category

* Splinting and treatment and gui

* Add arm fractures and aim effects

* localizations and event

* fix

* cleanup

* Apply suggestions from code review

Co-Authored-By: PabstMirror <pabstmirror@gmail.com>

* formating, rename bone images

* Apply suggestions from code review

Co-Authored-By: PabstMirror <pabstmirror@gmail.com>

* disable calls to extension

* Update fnc_onMedicationUsage.sqf

* Medical - Skip unneeded setVars on initUnit (#6949)

*  Medical - Transfer state machine state on locality (#6950)

* Medical - Transfer state machine state on locality

* Fix feedback isUnconscious var

* Exclude AI

* Make UAV excludes consistant, formating

* Update fnc_treatmentFullHealLocal.sqf

* reset fractures on respawn
2019-05-11 23:13:59 -05:00

51 lines
2.0 KiB
Plaintext

#include "script_component.hpp"
[QGVAR(updateDamageEffects), LINKFUNC(updateDamageEffects)] call CBA_fnc_addEventHandler;
["unit", {
params ["_new"];
[_new] call FUNC(updateDamageEffects); // Run on new controlled unit to update QGVAR(aimFracture)
}, true] call CBA_fnc_addPlayerEventHandler;
["CAManBase", "init", {
params ["_unit"];
// Check if last hit point is our dummy.
private _allHitPoints = getAllHitPointsDamage _unit param [0, []];
reverse _allHitPoints;
if (_allHitPoints param [0, ""] != "ACE_HDBracket") then {
private _config = [_unit] call CBA_fnc_getObjectConfig;
if (getText (_config >> "simulation") == "UAVPilot") exitWith {TRACE_1("ignore UAV AI",typeOf _unit);};
if (getNumber (_config >> "isPlayableLogic") == 1) exitWith {TRACE_1("ignore logic unit",typeOf _unit)};
ERROR_1("Bad hitpoints for unit type ""%1""",typeOf _unit);
} else {
// Calling this function inside curly brackets allows the usage of
// "exitWith", which would be broken with "HandleDamage" otherwise.
_unit setVariable [
QEGVAR(medical,HandleDamageEHID),
_unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]
];
};
}, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler;
#ifdef DEBUG_MODE_FULL
[QEGVAR(medical,woundReceived), {
params ["_unit", "_woundedHitPoint", "_receivedDamage", "_shooter", "_ammo"];
TRACE_5("wound",_unit,_woundedHitPoint, _receivedDamage, _shooter, _ammo);
//systemChat str _this;
}] call CBA_fnc_addEventHandler;
#endif
// this handles moving units into vehicles via load functions or zeus
// needed, because the vanilla INCAPACITATED state does not handle vehicles
["CAManBase", "GetInMan", {
params ["_unit"];
if (!local _unit) exitWith {};
if (lifeState _unit == "INCAPACITATED") then {
[_unit, true] call FUNC(setUnconsciousAnim);
};
}] call CBA_fnc_addClassEventHandler;