Simple diagnose

This commit is contained in:
esteldunedain 2015-04-17 19:38:03 -03:00
parent 1d208b4efc
commit cce9e1f04c
5 changed files with 77 additions and 11 deletions

View File

@ -70,6 +70,12 @@ class ACE_Head {
statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckResponse')] call DFUNC(treatment));
EXCEPTIONS
};
class Diagnose: CheckPulse {
displayName = "Diagnose";
condition = QUOTE([ARR_4(_player, _target, 'head', 'Diagnose')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'head', 'Diagnose')] call DFUNC(treatment));
EXCEPTIONS
};
};
class ACE_Torso {
displayName = "$STR_ACE_Interaction_Torso";

View File

@ -71,14 +71,14 @@ class ACE_Medical_Actions {
itemConsumed = 1;
litter[] = {};
};
class CheckPulse: Bandage {
displayName = "";
displayNameProgress = "";
class Diagnose: Bandage {
displayName = "Diagnose";
displayNameProgress = "Diagnosing...";
treatmentLocations[] = {"All"};
requiredMedic = 0;
treatmentTime = 2;
treatmentTime = 1;
items[] = {};
callbackSuccess = QUOTE(DFUNC(actionCheckPulse));
callbackSuccess = QUOTE(DFUNC(actionDiagnose));
callbackFailure = "";
callbackProgress = "";
animationPatient = "";
@ -86,12 +86,6 @@ class ACE_Medical_Actions {
itemConsumed = 0;
litter[] = {};
};
class CheckBloodPressure: CheckPulse {
callbackSuccess = QUOTE(DFUNC(actionCheckBloodPressure));
};
class CheckResponse: CheckPulse {
callbackSuccess = QUOTE(DFUNC(actionCheckResponse));
};
};
class Advanced {

View File

@ -7,6 +7,8 @@ PREP(actionCheckBloodPressureLocal);
PREP(actionCheckPulse);
PREP(actionCheckPulseLocal);
PREP(actionCheckResponse);
PREP(actionDiagnose);
PREP(actionDiagnoseLocal);
PREP(actionPlaceInBodyBag);
PREP(actionRemoveTourniquet);
PREP(actionLoadUnit);

View File

@ -0,0 +1,22 @@
/*
* Author: Glowbal
* Action for diagnosing in basic medical
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
*
* Return Value:
* NONE
*
* Public: No
*/
#include "script_component.hpp"
systemChat "actionDiagnose";
private ["_caller","_target","_title","_content"];
_caller = _this select 0;
_target = _this select 1;
[[_caller, _target], QUOTE(DFUNC(actionDiagnoseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -0,0 +1,42 @@
/*
* 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"
systemChat "actionDiagnoseLocal";
_caller = _this select 0;
_unit = _this select 1;
_genericMessages = ["Patient %1 is %2. %3. %4"];
_genericMessages pushBack ([_unit] call EFUNC(common,getName));
if (alive _unit) then {
_genericMessages pushback "alive";
} else {
_genericMessages pushback "dead";
};
if (_target getvariable[QGVAR(hasLostBlood), false]) then {
_genericMessages pushback "He's lost some blood";
} else {
_genericMessages pushback "He hasn't lost blood";
;
if (_target getvariable[QGVAR(hasPain), false]) then {
_genericMessages pushback localize "He is in pain";
} else {
_genericMessages pushback localize "He is not in pain";
};
["displayTextStructured", [_caller], [format _genericMessages, 1.5, _caller]] call EFUNC(common,targetEvent);