Merge pull request #687 from acemod/streamlinedBasicDiagnosis

Streamlined basic diagnosis
This commit is contained in:
Glowbal 2015-04-25 15:19:29 +02:00
commit 8d12f57d0f
10 changed files with 130 additions and 11 deletions

View File

@ -3,6 +3,7 @@ class ACE_Head {
displayName = "$STR_ACE_Interaction_Head";
runOnHover = 1;
statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,0,_this select 3)] call FUNC(modifyMedicalAction));
condition = "true";
EXCEPTIONS
icon = PATHTOF(UI\icons\medical_cross.paa);
@ -70,11 +71,18 @@ 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";
runOnHover = 1;
statement = QUOTE([ARR_3(_target, true, 1)] call DFUNC(displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,1,_this select 3)] call FUNC(modifyMedicalAction));
condition = "true";
EXCEPTIONS
icon = PATHTOF(UI\icons\medical_cross.paa);
@ -175,6 +183,7 @@ class ACE_ArmLeft {
displayName = "$STR_ACE_Interaction_ArmLeft";
runOnHover = 1;
statement = QUOTE([ARR_3(_target, true, 2)] call DFUNC(displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,2,_this select 3)] call FUNC(modifyMedicalAction));
condition = "true";
EXCEPTIONS
icon = PATHTOF(UI\icons\medical_cross.paa);
@ -332,6 +341,7 @@ class ACE_ArmRight {
displayName = "$STR_ACE_Interaction_ArmRight";
runOnHover = 1;
statement = QUOTE([ARR_3(_target, true, 3)] call DFUNC(displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,3,_this select 3)] call FUNC(modifyMedicalAction));
condition = "true";
EXCEPTIONS
icon = PATHTOF(UI\icons\medical_cross.paa);
@ -486,6 +496,7 @@ class ACE_LegLeft {
displayName = "$STR_ACE_Interaction_LegLeft";
runOnHover = 1;
statement = QUOTE([ARR_3(_target, true, 4)] call DFUNC(displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,4,_this select 3)] call FUNC(modifyMedicalAction));
condition = "true";
EXCEPTIONS
icon = PATHTOF(UI\icons\medical_cross.paa);
@ -628,6 +639,7 @@ class ACE_LegRight {
displayName = "$STR_ACE_Interaction_LegRight";
runOnHover = 1;
statement = QUOTE([ARR_3(_target, true, 5)] call DFUNC(displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,5,_this select 3)] call FUNC(modifyMedicalAction));
condition = "true";
EXCEPTIONS
icon = PATHTOF(UI\icons\medical_cross.paa);

View File

@ -12,6 +12,7 @@ class Medical {
icon = PATHTOF(UI\icons\medical_cross.paa);
exceptions[] = {"isNotInside"};
statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,0,_this select 3)] call FUNC(modifyMedicalAction));
condition = "true";
runOnHover = 1;
@ -80,6 +81,7 @@ class Medical {
runOnHover = 1;
exceptions[] = {"isNotInside"};
statement = QUOTE([ARR_3(_target, true, 1)] call DFUNC(displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,1,_this select 3)] call FUNC(modifyMedicalAction));
showDisabled = 1;
priority = 2;
hotkey = "";
@ -148,6 +150,7 @@ class Medical {
runOnHover = 1;
exceptions[] = {"isNotInside"};
statement = QUOTE([ARR_3(_target, true, 2)] call DFUNC(displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,2,_this select 3)] call FUNC(modifyMedicalAction));
condition = "true";
icon = PATHTOF(UI\icons\medical_cross.paa);
@ -249,6 +252,7 @@ class Medical {
runOnHover = 1;
exceptions[] = {"isNotInside"};
statement = QUOTE([ARR_3(_target, true, 3)] call DFUNC(displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,3,_this select 3)] call FUNC(modifyMedicalAction));
condition = "true";
icon = PATHTOF(UI\icons\medical_cross.paa);
@ -346,6 +350,7 @@ class Medical {
runOnHover = 1;
exceptions[] = {"isNotInside"};
statement = QUOTE([ARR_3(_target, true, 4)] call DFUNC(displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,4,_this select 3)] call FUNC(modifyMedicalAction));
condition = "true";
icon = PATHTOF(UI\icons\medical_cross.paa);
@ -432,6 +437,7 @@ class Medical {
runOnHover = 1;
exceptions[] = {"isNotInside"};
statement = QUOTE([ARR_3(_target, true, 5)] call DFUNC(displayPatientInformation));
modifierFunction = QUOTE([ARR_4(_target,_player,5,_this select 3)] call FUNC(modifyMedicalAction));
condition = "true";
icon = PATHTOF(UI\icons\medical_cross.paa);

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,7 @@ PREP(actionCheckBloodPressureLocal);
PREP(actionCheckPulse);
PREP(actionCheckPulseLocal);
PREP(actionCheckResponse);
PREP(actionDiagnose);
PREP(actionPlaceInBodyBag);
PREP(actionRemoveTourniquet);
PREP(actionLoadUnit);
@ -55,6 +56,7 @@ PREP(isInMedicalVehicle);
PREP(isMedic);
PREP(isMedicalVehicle);
PREP(itemCheck);
PREP(modifyMedicalAction);
PREP(onMedicationUsage);
PREP(onWoundUpdateRequest);
PREP(onPropagateWound);

View File

@ -0,0 +1,41 @@
/*
* 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"
private ["_caller","_target","_title","_content"];
_caller = _this select 0;
_target = _this select 1;
_genericMessages = ["STR_ACE_MEDICAL_diagnoseMessage"];
_genericMessages pushBack ([_target] call EFUNC(common,getName));
if (alive _target) then {
_genericMessages pushback "STR_ACE_MEDICAL_diagnoseAlive";
} else {
_genericMessages pushback "STR_ACE_MEDICAL_diagnoseDead";
};
if (_target getvariable[QGVAR(hasLostBlood), false]) then {
_genericMessages pushback "STR_ACE_MEDICAL_lostBlood";
} else {
_genericMessages pushback "STR_ACE_MEDICAL_noBloodloss";
};
if (_target getvariable[QGVAR(hasPain), false]) then {
_genericMessages pushback "STR_ACE_MEDICAL_inPain";
} else {
_genericMessages pushback "STR_ACE_MEDICAL_noPain";
};
["displayTextStructured", [_caller], [_genericMessages, 3.0, _caller]] call EFUNC(common,targetEvent);

View File

@ -14,6 +14,8 @@
#include "script_component.hpp"
// Exit for basic medical
if (GVAR(level) < 2) exitWith {};
private ["_target", "_show", "_selectionN"];
_target = _this select 0;
_show = if (count _this > 1) then {_this select 1} else {true};

View File

@ -0,0 +1,40 @@
/*
* Author: esteldunedain
* Modify the visuals of a medical action point.
* On Basic medical: modify the icon color based on damage on that body part.
*
* Arguments:
* 0: The Patient Unit <OBJECT>
* 1: The Diagnosing Unit <OBJECT>
* 2: Selection Number <NUMBER>
* 3: The action to modify <OBJECT>
*
* ReturnValue:
* nil
*
* Public: No
*/
#include "script_component.hpp"
EXPLODE_4_PVT(_this,_target,_player,_selectionN,_actionData);
if (GVAR(level) < 2) exitwith {
private ["_pointDamage"];
_pointDamage = _target getHitPointDamage (["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"] select _selectionN);
if (_pointDamage >= 0.8) exitWith {
_actionData set [2, QUOTE(PATHTOF(UI\icons\medical_crossRed.paa))];
};
if (_pointDamage > 0) exitWith {
_actionData set [2, QUOTE(PATHTOF(UI\icons\medical_crossYellow.paa))];
};
};
private ["_openWounds", "_amountOf"];
_openWounds = _target getvariable [QGVAR(openWounds), []];
{
_amountOf = _x select 3;
if (_amountOf > 0 && {(_selectionN == (_x select 2))}) exitwith {
_actionData set [2, QUOTE(PATHTOF(UI\icons\medical_crossRed.paa))];
};
}foreach _openWounds;

View File

@ -1322,6 +1322,28 @@
<Hungarian>Megnézted %1-t</Hungarian>
<Italian>Hai controllato %1</Italian>
</Key>
<Key ID="STR_ACE_MEDICAL_diagnoseMessage">
<English>Patient %1&lt;br/&gt;is %2.&lt;br/&gt;%3.&lt;br/&gt;%4</English>
</Key>
<Key ID="STR_ACE_MEDICAL_diagnoseAlive">
<English>alive</English>
</Key>
<Key ID="STR_ACE_MEDICAL_diagnoseDead">
<English>dead</English>
</Key>
<Key ID="STR_ACE_MEDICAL_lostBlood">
<English>He's lost some blood</English>
</Key>
<Key ID="STR_ACE_MEDICAL_noBloodloss">
<English>He hasn't lost blood</English>
</Key>
<Key ID="STR_ACE_MEDICAL_inPain">
<English>He is in pain</English>
</Key>
<Key ID="STR_ACE_MEDICAL_noPain">
<English>He is not in pain</English>
</Key>
<Key ID="STR_ACE_MEDICAL_BANDAGED">
<English>Bandaged</English>
<French>Bandé</French>

Binary file not shown.

Binary file not shown.