mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
e56cc0d74e
* 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
43 lines
1.3 KiB
Plaintext
43 lines
1.3 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: esteldunedain, SilentSpike, mharis001
|
|
* Modifies the medical action icons to show blood loss and tourniquets.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
* 1: Body part index <NUMBER>
|
|
* 2: Action data <ARRAY>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [_target, 0, _actionData] call ace_medical_gui_fnc_modifyAction
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
#define COLOR_SCALE ["#ffffff", "#fff1a1", "#ffe075", "#ffcb55", "#ffb73c", "#ffa127", "#ff8815", "#ff6d05", "#ff4b00", "#ff0000"]
|
|
|
|
params ["_target", "_partIndex", "_actionData"];
|
|
|
|
private _bloodLossOnBodyPart = 0;
|
|
|
|
// Add all bleeding from wounds on selection
|
|
{
|
|
_x params ["", "_bodyPartN", "_amountOf", "_bleeding"];
|
|
|
|
if (_bodyPartN == _partIndex) then {
|
|
_bloodLossOnBodyPart = _bloodLossOnBodyPart + (_amountOf * _bleeding);
|
|
};
|
|
} forEach (_target getvariable [QEGVAR(medical,openWounds), []]);
|
|
|
|
private _frBL = 0 max (_bloodLossOnBodyPart / BLOOD_LOSS_RED_THRESHOLD) min 1;
|
|
private _colorInt = ceil (_frBL * (BLOOD_LOSS_TOTAL_COLORS - 1)); // ceil because any bleeding more than zero shouldn't be white
|
|
|
|
if (HAS_TOURNIQUET_APPLIED_ON(_target,_partIndex)) then {
|
|
_actionData set [2, format [QPATHTOF(ui\cross_t_%1.paa), _colorInt]];
|
|
} else {
|
|
_actionData set [2, [QPATHTOF(ui\cross.paa), COLOR_SCALE select _colorInt]];
|
|
};
|