Add basic treatments, rename onProgress

This commit is contained in:
KoffeinFlummi 2015-02-22 17:45:46 +01:00
parent ab6bc998c2
commit ca930a5717
2 changed files with 42 additions and 18 deletions

View File

@ -1,22 +1,46 @@
class ACE_Medical_Actions { class ACE_Medical_Actions {
class Basic { class Basic {
class ACE_Bandaging { class Bandage {
// Which locations can this treatment action be used? Available: Field, MedicalFacility, MedicalVehicle, All.
treatmentLocations[] = {"Field", "MedicalFacility", "MedicalVehicle"}; treatmentLocations[] = {"Field", "MedicalFacility", "MedicalVehicle"};
// What is the level of medical skill required for this treatment action? 0 = all soldiers, 1 = medic, 2 = doctor
requiredMedic = 0; requiredMedic = 0;
// The time it takes for a treatment action to complete. Time is in seconds.
treatmentTime = 5; treatmentTime = 5;
// Item required for the action. Leave empty for no item required. treatmentTimeSelfCoef = 1;
items[] = {"ace_sampleItem"}; items[] = {QGVAR(bandage)};
// Callbacks itemConsumed = 1;
callbackSuccess = "hint ""Success"";";
callbackFailure = "hint ""Failure "";"; callbackSuccess = QUOTE(_this call FUNC(treatmentBasic_bandage));
onProgress = ""; callbackFailure = QUOTE(_this call FUNC(treatmentBasic_abort));
callbackProgress = "";
animationPatient = ""; animationPatient = "";
animationCaller = ""; animationCaller = "";
}; };
class Morphine: Bandage {
treatmentTime = 2;
items[] = {QGVAR(morphine)};
callbackSuccess = QUOTE(_this call FUNC(treatmentBasic_morphine));
animationCaller = ""; // @todo
};
class Epipen: Bandage {
treatmentTime = 3;
items[] = {QGVAR(epipen)};
callbackSuccess = QUOTE(_this call FUNC(treatmentBasic_epipen));
animationCaller = ""; // @todo
};
class Bloodbag: Bandage {
treatmentTime = 20;
items[] = {QGVAR(bloodbag)};
callbackSuccess = QUOTE(_this call FUNC(treatmentBasic_bloodbag));
animationCaller = ""; // @todo
};
class Diagnose: Bandage {
treatmentTime = 10;
treatmentTimeSelfCoef = 0;
items[] = {};
callbackSuccess = QUOTE(_this call FUNC(treatmentBasic_diagnose));
animationCaller = ""; // @todo
};
}; };
class Advanced { class Advanced {
@ -32,7 +56,7 @@ class ACE_Medical_Actions {
// Callbacks // Callbacks
callbackSuccess = "hint ""Success"";"; callbackSuccess = "hint ""Success"";";
callbackFailure = "hint ""Failure "";"; callbackFailure = "hint ""Failure "";";
onProgress = ""; callbackProgress = "";
animationPatient = ""; animationPatient = "";
animationCaller = ""; animationCaller = "";
}; };

View File

@ -16,7 +16,7 @@
#include "script_component.hpp" #include "script_component.hpp"
private ["_caller", "_target", "_selectionName", "_className", "_config", "_availableLevels", "_medicRequired", "_items", "_locations", "_return", "_callbackSuccess", "_callbackFailure", "_onProgress", "_treatmentTime", "_callerAnim", "_patietAnim"]; private ["_caller", "_target", "_selectionName", "_className", "_config", "_availableLevels", "_medicRequired", "_items", "_locations", "_return", "_callbackSuccess", "_callbackFailure", "_callbackProgress", "_treatmentTime", "_callerAnim", "_patietAnim"];
_caller = _this select 0; _caller = _this select 0;
_target = _this select 1; _target = _this select 1;
_selectionName = _this select 2; _selectionName = _this select 2;
@ -65,16 +65,16 @@ if (isNil _callbackFailure) then {
_callbackFailure = missionNamespace getvariable _callbackFailure; _callbackFailure = missionNamespace getvariable _callbackFailure;
}; };
// Parse the config for the onProgress callback // Parse the config for the callbackProgress callback
_onProgress = getText (_config >> "onProgress"); _callbackProgress = getText (_config >> "callbackProgress");
if (isNil _onProgress) then { if (isNil _callbackProgress) then {
_onProgress = compile _onProgress; _callbackProgress = compile _callbackProgress;
} else { } else {
_onProgress = missionNamespace getvariable _onProgress; _callbackProgress = missionNamespace getvariable _callbackProgress;
}; };
_treatmentTime = getNumber (_config >> "treatmentTime"); _treatmentTime = getNumber (_config >> "treatmentTime");
[_treatmentTime, [_caller, _target, _selectionName, _className, _items], _callbackSuccess, _callbackFailure, (localize ""), _onProgress] call EFUNC(common,progressBar); [_treatmentTime, [_caller, _target, _selectionName, _className, _items], _callbackSuccess, _callbackFailure, (localize ""), _callbackProgress] call EFUNC(common,progressBar);
_callerAnim = getText (_config >> "animationCaller"); _callerAnim = getText (_config >> "animationCaller");
_patietAnim = getText (_confg >> "animationPatient"); _patietAnim = getText (_confg >> "animationPatient");