Added examine actions

This commit is contained in:
Glowbal 2015-02-23 20:35:36 +01:00
parent 4a64716420
commit 65eb69fece
8 changed files with 255 additions and 0 deletions

View File

@ -134,6 +134,28 @@ class ACE_Medical_Actions {
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_aidKit));
itemConsumed = 0;
};
class CheckPulse: fieldDressing {
treatmentLocations[] = {"All"};
requiredMedic = 0;
treatmentTime = 2;
items[] = {};
callbackSuccess = QUOTE(DFUNC(actionCheckPulse));
callbackFailure = "";
callbackProgress = "";
animationPatient = "";
animationCaller = ""; // TODO
itemConsumed = 0;
};
class CheckBloodPressure: CheckPulse {
callbackSuccess = QUOTE(DFUNC(actionCheckBloodPressure));
};
class CheckResponse: CheckPulse {
callbackSuccess = QUOTE(DFUNC(actionCheckResponse));
};
class RemoveTourniquet: CheckPulse {
treatmentTime = 2.5;
callbackSuccess = QUOTE(DFUNC(actionRemoveTourniquet));
};
};
};

View File

@ -40,6 +40,12 @@ PREP(treatmentTourniquetLocal);
PREP(addToLog);
PREP(addToTriageCard);
PREP(actionPlaceInBodyBag);
PREP(actionCheckBloodPressure);
PREP(actionCheckBloodPressureLocal);
PREP(actionCheckPulse);
PREP(actionCheckPulseLocal);
PREP(actionCheckResponse);
PREP(actionRemoveTourniquet);
PREP(onTreatmentCompleted);
PREP(onMedicationUsed);
PREP(reactionToDamage);

View File

@ -0,0 +1,61 @@
/*
* Author: Glowbal
* Local callback for checking the blood pressure of a patient
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
*
* Return Value:
* NONE
*
* Public: No
*/
#include "script_component.hpp"
private ["_caller","_target","_bloodPressure","_bloodPressureHigh","_bloodPressureLow","_title","_content"];
_caller = _this select 0;
_target = _this select 1;
_bloodPressure = [_target] call FUNC(getBloodPressure);
if (!alive _target) then {
_bloodPressure = [0,0];
};
_bloodPressureHigh = _bloodPressure select 1;
_bloodPressureLow = _bloodPressure select 0;
_output = "";
_logOutPut = "";
if ([_caller] call FUNC(isMedic)) then {
_output = "STR_ACE_CHECK_BLOODPRESSURE_OUTPUT_1";
_logOutPut = format["%1/%2",round(_bloodPressureHigh),round(_bloodPressureLow)];
} else {
if (_bloodPressureHigh > 20) then {
_output = "STR_ACE_CHECK_BLOODPRESSURE_OUTPUT_2";
_logOutPut = "Low";
if (_bloodPressureHigh > 100) then {
_output = "STR_ACE_CHECK_BLOODPRESSURE_OUTPUT_3";
_logOutPut = "Normal";
if (_bloodPressureHigh > 160) then {
_output = "STR_ACE_CHECK_BLOODPRESSURE_OUTPUT_4";
_logOutPut = "High";
};
};
} else {
if (random(10) > 3) then {
_output = "STR_ACE_CHECK_BLOODPRESSURE_OUTPUT_5";
_logOutPut = "No Blood Pressure";
} else {
_output = "STR_ACE_CHECK_BLOODPRESSURE_OUTPUT_6";
};
};
};
// TODO build support in displayText for sending it across to a different client with localization + format support.
// [format[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)]] call EFUNC(common,displayTextStructured);
if (_logOutPut != "") then {
[_target,"examine", format["%1 checked Blood Pressure: %2", [_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog);
};

View File

@ -0,0 +1,21 @@
/*
* Author: Glowbal
* Action for checking the pulse or heart rate of the patient
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
*
* Return Value:
* NONE
*
* Public: No
*/
#include "script_component.hpp"
private ["_caller","_target","_title","_content"];
_caller = _this select 0;
_target = _this select 1;
[[_caller, _target], QUOTE(FUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc);

View File

@ -0,0 +1,55 @@
/*
* Author: Glowbal
* Local callback for checking the pulse of a patient
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
*
* Return Value:
* NONE
*
* Public: No
*/
#include "script_component.hpp"
private ["_caller","_unit", "_heartRateOutput", "_heartRate","_logOutPut","_content"];
_caller = _this select 0;
_unit = _this select 1;
_heartRate = [_unit,QGVAR(heartRate)] call EFUNC(common,getDefinedVariable);
if (!alive _unit) then {
_heartRate = 0;
};
_heartRateOutput = "STR_ACE_CHECK_PULSE_OUTPUT_5";
_logOutPut = "No heart rate";
if (_heartRate > 1.0) then {
if ([_caller] call FUNC(isMedic)) then {
_heartRateOutput = "STR_ACE_CHECK_PULSE_OUTPUT_1";
_logOutPut = format["%1",round(_heartRate)];
} else {
// non medical personel will only find a pulse/HR
_heartRateOutput = "STR_ACE_CHECK_PULSE_OUTPUT_2";
_logOutPut = "Weak";
if (_heartRate > 60) then {
if (_heartRate > 100) then {
_heartRateOutput = "STR_ACE_CHECK_PULSE_OUTPUT_3";
_logOutPut = "Strong";
} else {
_heartRateOutput = "STR_ACE_CHECK_PULSE_OUTPUT_4";
_logOutPut = "Normal";
};
};
};
};
_content = ["STR_ACE_CHECK_PULSE_CHECKED_MEDIC",_heartRateOutput];
// TODO build support in displayText for sending it across to a different client with localization + format support.
// [format[_content, [_unit] call EFUNC(common,getName), round(_heartRate)]] call EFUNC(common,displayTextStructured);
if (_logOutPut != "") then {
[_unit,"examine",format["%1 checked Heart Rate: %2",[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog);
};

View File

@ -0,0 +1,29 @@
/*
* Author: Glowbal
* Action for checking the response status of the patient
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
*
* Return Value:
* NONE
*
* Public: No
*/
#include "script_component.hpp"
private ["_caller","_target"];
_caller = _this select 0;
_target = _this select 1;
_output = "";
if ([_target] call EFUNC(common,isAwake)) then {
_output = format[localize "STR_ACE_CHECK_REPONSE_RESPONSIVE",[_target] call EFUNC(common,getName)];
} else {
_output = format[localize "STR_ACE_CHECK_REPONSE_UNRESPONSIVE",[_target] call EFUNC(common,getName)];
};
[_output] call EFUNC(common,displayTextStructured);
[_target,"examine",_output] call FUNC(addToLog);

View File

@ -0,0 +1,40 @@
/*
* Author: Glowbal
* Action for removing the tourniquet on specified selection
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
* 2: SelectionName <STRING>
*
* Return Value:
* NONE
*
* Public: Yes
*/
#include "script_component.hpp"
private ["_caller","_target","_part","_selectionName","_removeItem","_tourniquets"];
_caller = _this select 0;
_target = _this select 1;
_selectionName = _this select 2;
// grab the required data
_part = [_selectionName] call FUNC(selectionNameToNumber);
_tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]];
// Check if there is a tourniquet on this bodypart
if ((_tourniquets select _part) == 0) exitwith {
// TODO localization
["There is no tourniquet on this body part!"] call EFUNC(common,displayTextStructured);
};
// Removing the tourniquet
_tourniquets set[_part, 0];
_target setvariable [QGVAR(tourniquets), _tourniquets, true];
// Adding the tourniquet item to the caller
_caller addItem "ACE_tourniquet";
// "AinvPknlMstpSlayWrflDnon_medic

View File

@ -0,0 +1,21 @@
/*
* Author: Glowbal
* Action for checking the blood pressure of the patient
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
*
* Return Value:
* NONE
*
* Public: No
*/
#include "script_component.hpp"
private ["_caller","_target"];
_caller = _this select 0;
_target = _this select 1;
[[_caller, _target], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc);