ACE3/addons/medical_treatment/functions/fnc_treatment_success.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

72 lines
2.0 KiB
Plaintext

#include "script_component.hpp"
/*
* Author: KoffeinFlummi, Glowbal
* Callback when the treatment is completed
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
* 2: Body part <STRING>
* 3: Treatment class name <STRING>
* 4: Items available <ARRAY<STRING>>
*
* Return Value:
* None
*
* Public: No
*/
params ["_args"];
_args params ["_caller", "_target", "_bodyPart", "_className", "_items", "_usersOfItems"];
// switch to end anim immediately
private _endInAnim = _caller getVariable QGVAR(endInAnim);
if (!isNil "_endInAnim") then {
if (animationState _caller != _endInAnim) then {
[_caller, _endInAnim, 2] call EFUNC(common,doAnimation);
};
_caller setVariable [QGVAR(endInAnim), nil];
TRACE_1("abort",_endInAnim);
};
// reset sped up animations
[QEGVAR(common,setAnimSpeedCoef), [_caller, 1]] call CBA_fnc_globalEvent;
// Record specific callback
private _config = configFile >> QGVAR(Actions) >> _className;
private _callback = getText (_config >> "callbackSuccess");
if (isNil _callback) then {
_callback = compile _callback;
} else {
_callback = missionNamespace getVariable _callback;
};
if !(_callback isEqualType {}) then {
_callback = {TRACE_1("callback was NOT code",_callback)};
};
//Get current blood loose on limb (for "bloody" litter)
private _bloodLossOnBodyPart = 0;
private _partIndex = (ALL_BODY_PARTS find toLower _bodyPart) max 0;
// Add all bleeding from wounds on selection
private _openWounds = _target getVariable [QEGVAR(medical,openWounds), []];
{
_x params ["", "_bodyPartN", "_amountOf", "_percentageOpen"];
if (_bodyPartN isEqualTo _partIndex) then {
_bloodLossOnBodyPart = _bloodLossOnBodyPart + (_amountOf * _percentageOpen);
};
} forEach _openWounds;
TRACE_1("advanced",_bloodLossOnBodyPart);
_args call _callback;
_args pushBack _bloodLossOnBodyPart;
_args call FUNC(litterCreate);
["ace_treatmentSucceded", [_caller, _target, _bodyPart, _className]] call CBA_fnc_localEvent;