More work on basic callbacks.

This commit is contained in:
KoffeinFlummi 2015-02-24 22:09:31 +01:00
parent 65eb69fece
commit daff184f75
8 changed files with 70 additions and 15 deletions

View File

@ -1,44 +1,47 @@
class ACE_Medical_Actions {
class Basic {
// @todo: localization
class Bandage {
treatmentLocations[] = {"Field", "MedicalFacility", "MedicalVehicle"};
displayName = "Bandage";
displayNameProgress = "Bandaging ...";
treatmentLocations[] = {"Field", "MedicalFacility", "MedicalVehicle"};
requiredMedic = 0;
treatmentTime = 5;
treatmentTimeSelfCoef = 1;
items[] = {{QGVAR(fieldDressing), QGVAR(packingBandage), QGVAR(elasticBandage), QGVAR(quikClot)}};
itemConsumed = 1;
callbackSuccess = QUOTE(_this call FUNC(treatmentBasic_bandage));
callbackFailure = QUOTE(_this call FUNC(treatmentBasic_abort));
callbackSuccess = QUOTE(DFUNC(treatmentBasic_bandage));
callbackFailure = QUOTE(DFUNC(treatmentBasic_abort));
callbackProgress = "";
animationPatient = "";
animationCaller = "";
};
class Morphine: Bandage {
displayName = "Morphine";
displayNameProgress = "Injecting Morphine ...";
treatmentTime = 2;
items[] = {QGVAR(morphine)};
callbackSuccess = QUOTE(_this call FUNC(treatmentBasic_morphine));
callbackSuccess = QUOTE(DFUNC(treatmentBasic_morphine));
animationCaller = ""; // @todo
};
class Epipen: Bandage {
displayName = "Epinephrine";
displayNameProgress = "Injecting Epinephrine ...";
treatmentTime = 3;
items[] = {QGVAR(epinephrine)};
callbackSuccess = QUOTE(_this call FUNC(treatmentBasic_epipen));
callbackSuccess = QUOTE(DFUNC(treatmentBasic_epipen));
animationCaller = ""; // @todo
};
class Bloodbag: Bandage {
displayName = "Blood Bag";
displayNameProgress = "Transfusing Blood ...";
treatmentTime = 20;
items[] = {{QGVAR(bloodIV), QGVAR(bloodIV_500), QGVAR(bloodIV_250)}};
callbackSuccess = QUOTE(_this call FUNC(treatmentBasic_bloodbag));
animationCaller = ""; // @todo
};
class Diagnose: Bandage {
treatmentTime = 10;
treatmentTimeSelfCoef = 0;
items[] = {};
callbackSuccess = QUOTE(_this call FUNC(treatmentBasic_diagnose));
callbackSuccess = QUOTE(DFUNC(treatmentBasic_bloodbag));
animationCaller = ""; // @todo
};
};

View File

@ -33,6 +33,10 @@ PREP(treatmentAdvanced_bandage);
PREP(treatmentAdvanced_bandageLocal);
PREP(treatmentAdvanced_medication);
PREP(treatmentAdvanced_medicationLocal);
PREP(treatmentBasic_bandage);
PREP(treatmentBasic_morphine);
PREP(treatmentBasic_epipen);
PREP(treatmentBasic_bloodbag);
PREP(teatmentIV);
PREP(treatmentIVLocal);
PREP(treatmentTourniquet);

View File

@ -6,7 +6,7 @@
* 0: The unit that will be put in an unconscious state <OBJECT>
*
* ReturnValue:
* <NIL>
* nil
*
* Public: yes
*/

View File

@ -65,7 +65,7 @@ if (isNil _callbackFailure) then {
_callbackFailure = missionNamespace getvariable _callbackFailure;
};
// Parse the config for the callbackProgress callback
// Parse the config for the progress callback
_callbackProgress = getText (_config >> "callbackProgress");
if (isNil _callbackProgress) then {
_callbackProgress = compile _callbackProgress;

View File

@ -0,0 +1,24 @@
/*
* Author: KoffeinFlummi
* Epipen treatment.
*
* Arguments:
* 0: Medic <OBJECT>
* 1: Patient <OBJECT>
* 2: Selection Name <STRING>
* 3: Treatment Classname <STRING>
* 4: Items required <ARRAY<STRING>>
*
* Return Value:
* nil
*
* Public: No
*/
#include "script_component.hpp"
_medic = _this select 0;
_patient = _this select 1:
_items = _this select 4;
[_patient, false] call FUNC(setUnconscious);

View File

@ -0,0 +1,24 @@
/*
* Author: KoffeinFlummi
* Epipen treatment.
*
* Arguments:
* 0: Medic <OBJECT>
* 1: Patient <OBJECT>
* 2: Selection Name <STRING>
* 3: Treatment Classname <STRING>
* 4: Items required <ARRAY<STRING>>
*
* Return Value:
* nil
*
* Public: No
*/
#include "script_component.hpp"
_medic = _this select 0;
_patient = _this select 1:
_items = _this select 4;
[_patient, false] call FUNC(setUnconscious);