mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Move medical facility, vehicle and unit functions (#6440)
This commit is contained in:
parent
c9c8d25017
commit
68ff7575eb
@ -19,7 +19,7 @@
|
||||
|
||||
private _medic = objNull;
|
||||
{
|
||||
if ((!isPlayer _x) && {[_x] call EFUNC(medical_status,isMedic)}) exitWith {
|
||||
if ((!isPlayer _x) && {[_x] call EFUNC(medical_treatment,isMedic)}) exitWith {
|
||||
_medic = _x;
|
||||
};
|
||||
} forEach (units _unit);
|
||||
|
@ -19,10 +19,10 @@
|
||||
// we ignore this here. We need to "notice" the medic that he should
|
||||
// treat other units, or else he won't do anything on his own.
|
||||
|
||||
if ([_this] call EFUNC(medical_status,isMedic) || {vehicle _this != _this}) exitWith {false};
|
||||
if ([_this] call EFUNC(medical_treatment,isMedic) || {vehicle _this != _this}) exitWith {false};
|
||||
|
||||
{
|
||||
if ([_x] call EFUNC(medical_status,isMedic) && {!([_x] call EFUNC(common,isPlayer))}) exitWith {
|
||||
if ([_x] call EFUNC(medical_treatment,isMedic) && {!([_x] call EFUNC(common,isPlayer))}) exitWith {
|
||||
_this setVariable [QGVAR(assignedMedic), _x];
|
||||
true
|
||||
};
|
||||
|
@ -62,7 +62,7 @@ if (_show == 1) then {
|
||||
if (((_target getVariable [QEGVAR(medical,tourniquets), [0,0,0,0,0,0]]) select _selectionN) > 0) then {
|
||||
_genericMessages pushback [localize ELSTRING(medical,Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]];
|
||||
};
|
||||
if (EGVAR(medical,showPainInMenu) && {[ACE_player, EGVAR(medical,medicSetting_PainVisualization)] call EFUNC(medical_status,isMedic)}) then {
|
||||
if (EGVAR(medical,showPainInMenu) && {[ACE_player, EGVAR(medical,medicSetting_PainVisualization)] call EFUNC(medical_treatment,isMedic)}) then {
|
||||
private _painLevel = GET_PAIN_PERCEIVED(_target);
|
||||
if (_painLevel > 0) then {
|
||||
private _painText = localize ELSTRING(medical,Status_Pain);
|
||||
|
@ -39,7 +39,7 @@ if (((_target getVariable [QEGVAR(medical,tourniquets), [0, 0, 0, 0, 0, 0]]) sel
|
||||
_genericMessages pushBack [localize ELSTRING(medical,Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]];
|
||||
};
|
||||
|
||||
if (EGVAR(medical,showPainInMenu) && {[ACE_player, EGVAR(medical,medicSetting_PainVisualization)] call EFUNC(medical_status,isMedic)}) then {
|
||||
if (EGVAR(medical,showPainInMenu) && {[ACE_player, EGVAR(medical,medicSetting_PainVisualization)] call EFUNC(medical_treatment,isMedic)}) then {
|
||||
private _painLevel = GET_PAIN_PERCEIVED(_target);
|
||||
if (_painLevel > 0) then {
|
||||
private _painText = localize ELSTRING(medical,Status_Pain);
|
||||
|
@ -4,15 +4,10 @@ PREP(getBloodPressure);
|
||||
PREP(getBloodVolumeChange);
|
||||
PREP(getCardiacOutput);
|
||||
PREP(hasStableVitals);
|
||||
PREP(hasTourniquetAppliedTo);
|
||||
PREP(initUnit);
|
||||
PREP(isBeingCarried);
|
||||
PREP(isBeingDragged);
|
||||
PREP(isInMedicalFacility);
|
||||
PREP(isInMedicalVehicle);
|
||||
PREP(isInStableCondition);
|
||||
PREP(isMedic);
|
||||
PREP(isMedicalVehicle);
|
||||
PREP(setCardiacArrest);
|
||||
PREP(setDead);
|
||||
PREP(setUnconscious);
|
||||
|
@ -77,7 +77,7 @@ class GVAR(Actions) {
|
||||
items[] = {"ACE_tourniquet"};
|
||||
treatmentTime = 7;
|
||||
callbackSuccess = QFUNC(treatmentTourniquet);
|
||||
condition = QUOTE(!([ARR_2(_target,_bodyPart)] call EFUNC(medical_status,hasTourniquetAppliedTo)));
|
||||
condition = QUOTE(!([ARR_2(_target,_bodyPart)] call FUNC(hasTourniquetAppliedTo)));
|
||||
litter[] = {};
|
||||
};
|
||||
class RemoveTourniquet: Tourniquet {
|
||||
@ -85,7 +85,7 @@ class GVAR(Actions) {
|
||||
displayNameProgress = ECSTRING(medical,RemovingTourniquet);
|
||||
items[] = {};
|
||||
callbackSuccess = QFUNC(treatmentTourniquetRemove);
|
||||
condition = QUOTE([ARR_2(_target,_bodyPart)] call EFUNC(medical_status,hasTourniquetAppliedTo));
|
||||
condition = QUOTE([ARR_2(_target,_bodyPart)] call FUNC(hasTourniquetAppliedTo));
|
||||
};
|
||||
|
||||
// --- syringes
|
||||
|
@ -46,8 +46,13 @@ PREP(canAccessMedicalEquipment);
|
||||
PREP(dropDownTriageCard);
|
||||
PREP(getTriageStatus);
|
||||
PREP(handleBandageOpening);
|
||||
PREP(hasTourniquetAppliedTo);
|
||||
PREP(healTime);
|
||||
PREP(HealTimeMedkit);
|
||||
PREP(isInMedicalFacility);
|
||||
PREP(isInMedicalVehicle);
|
||||
PREP(isMedic);
|
||||
PREP(isMedicalVehicle);
|
||||
PREP(onMedicationUsage);
|
||||
|
||||
// items
|
||||
|
@ -18,7 +18,7 @@ params ["_caller", "_target", "_bodyPart"];
|
||||
|
||||
private _bloodPressure = [0, 0];
|
||||
|
||||
if (alive _target && !([_target, _bodyPart] call EFUNC(medical_status,hasTourniquetAppliedTo))) then {
|
||||
if (alive _target && !([_target, _bodyPart] call FUNC(hasTourniquetAppliedTo))) then {
|
||||
_bloodPressure = GET_BLOOD_PRESSURE(_target);
|
||||
};
|
||||
|
||||
@ -28,7 +28,7 @@ private _logOutPut = ELSTRING(medical,Check_Bloodpressure_NoBloodpressure);
|
||||
_bloodPressure params ["_bloodPressureLow", "_bloodPressureHigh"];
|
||||
|
||||
if (_bloodPressureHigh > 20) then {
|
||||
if (_caller call EFUNC(medical_status,isMedic)) then {
|
||||
if (_caller call FUNC(isMedic)) then {
|
||||
_bloodPressureOutput = ELSTRING(medical,Check_Bloodpressure_Output_1);
|
||||
_logOutPut = format ["%1/%2", round _bloodPressureHigh, round _bloodPressureLow];
|
||||
} else {
|
||||
|
@ -18,7 +18,7 @@ params ["_caller", "_target", "_bodyPart"];
|
||||
|
||||
private _heartRate = 0;
|
||||
|
||||
if (alive _target && !([_target, _bodyPart] call EFUNC(medical_status,hasTourniquetAppliedTo))) then {
|
||||
if (alive _target && !([_target, _bodyPart] call FUNC(hasTourniquetAppliedTo))) then {
|
||||
_heartRate = GET_HEART_RATE(_target);
|
||||
};
|
||||
|
||||
@ -26,7 +26,7 @@ private _heartRateOutput = ELSTRING(medical,Check_Pulse_Output_5);
|
||||
private _logOutPut = ELSTRING(medical,Check_Pulse_None);
|
||||
|
||||
if (_heartRate > 1.0) then {
|
||||
if (_caller call EFUNC(medical_status,isMedic)) then {
|
||||
if (_caller call FUNC(isMedic)) then {
|
||||
_heartRateOutput = ELSTRING(medical,Check_Pulse_Output_1);
|
||||
_logOutPut = format ["%1", round(_heartRate)];
|
||||
} else {
|
||||
|
@ -52,7 +52,7 @@ if (isNumber (_config >> "requiredMedic")) then {
|
||||
};
|
||||
};
|
||||
|
||||
if !([_caller, _medicRequired] call EFUNC(medical_status,isMedic)) exitWith {false};
|
||||
if !([_caller, _medicRequired] call FUNC(isMedic)) exitWith {false};
|
||||
|
||||
// check selection
|
||||
private _allowedSelections = getArray (_config >> "allowedSelections") apply {toLower _x};
|
||||
@ -92,8 +92,8 @@ private _locations = getArray (_config >> "treatmentLocations") apply {toLower _
|
||||
if ("all" in _locations) then {
|
||||
_locations = true;
|
||||
} else {
|
||||
private _medFacility = {([_caller] call EFUNC(medical_status,isInMedicalFacility)) || ([_target] call EFUNC(medical_status,isInMedicalFacility))};
|
||||
private _medVeh = {([_caller] call EFUNC(medical_status,isInMedicalVehicle)) || ([_target] call EFUNC(medical_status,isInMedicalVehicle))};
|
||||
private _medFacility = {([_caller] call FUNC(isInMedicalFacility)) || ([_target] call FUNC(isInMedicalFacility))};
|
||||
private _medVeh = {([_caller] call FUNC(isInMedicalVehicle)) || ([_target] call FUNC(isInMedicalVehicle))};
|
||||
|
||||
{
|
||||
if (_x == "field") exitWith { _locations = true; };
|
||||
|
@ -33,7 +33,7 @@ if ([_medic, _item] call EFUNC(common,hasItem)) exitWith {
|
||||
|
||||
private _return = false;
|
||||
|
||||
if (vehicle _medic != _medic && {vehicle _medic call EFUNC(medical_status,isMedicalVehicle)}) then {
|
||||
if (vehicle _medic != _medic && {vehicle _medic call FUNC(isMedicalVehicle)}) then {
|
||||
{
|
||||
if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {[_x, _item] call EFUNC(common,hasItem)}) exitWith {
|
||||
_return = true;
|
||||
|
@ -10,9 +10,9 @@
|
||||
* Has tourniquet applied <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [player, "leftleg"] call ace_medical_status_fnc_hasTourniquetAppliedTo
|
||||
* [player, "leftleg"] call ace_medical_treatment_fnc_hasTourniquetAppliedTo
|
||||
*
|
||||
* Public: Yes
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
@ -9,9 +9,9 @@
|
||||
* Is in medical facility <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [player] call ace_medical_status_fnc_isInMedicalFacility
|
||||
* [player] call ace_medical_treatment_fnc_isInMedicalFacility
|
||||
*
|
||||
* Public: Yes
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
@ -9,9 +9,9 @@
|
||||
* Is unit in medical vehicle? <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [player] call ace_medical_status_fnc_isInMedicalVehicle
|
||||
* [player] call ace_medical_treatment_fnc_isInMedicalVehicle
|
||||
*
|
||||
* Public: Yes
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
@ -10,9 +10,9 @@
|
||||
* Is in of medic class <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [player] call ace_medical_status_fnc_isMedic
|
||||
* [player] call ace_medical_treatment_fnc_isMedic
|
||||
*
|
||||
* Public: Yes
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
@ -9,7 +9,7 @@
|
||||
* Is in of medic class <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [cursorObject] call ace_medical_status_fnc_isMedicalVehicle
|
||||
* [cursorObject] call ace_medical_treatment_fnc_isMedicalVehicle
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
@ -33,7 +33,7 @@ if ([_medic, _item] call EFUNC(common,hasItem)) exitWith {
|
||||
|
||||
private _return = [false, objNull];
|
||||
|
||||
if (vehicle _medic != _medic && {vehicle _medic call EFUNC(medical_status,isMedicalVehicle)}) then {
|
||||
if (vehicle _medic != _medic && {vehicle _medic call FUNC(isMedicalVehicle)}) then {
|
||||
{
|
||||
if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {[_x, _item] call EFUNC(common,hasItem)}) exitWith {
|
||||
["ace_useItem", [_x, _item], _x] call CBA_fnc_targetEvent;
|
||||
|
Loading…
Reference in New Issue
Block a user