Switched to callbackPogress for treatment

This commit is contained in:
BaerMitUmlaut 2015-05-27 00:45:50 +02:00
parent 890b568225
commit 30df0e8dc9
3 changed files with 32 additions and 4 deletions

View File

@ -200,8 +200,9 @@ class ACE_Medical_Actions {
items[] = {"ACE_surgicalKit"};
treatmentLocations[] = {QGVAR(useLocation_SurgicalKit)};
requiredMedic = QGVAR(medicSetting_SurgicalKit);
treatmentTime = 10;
callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_surgicalKit));
treatmentTime = "(count ((_this select 1) getVariable ['ACE_Medical_bandagedWounds', []]) * 5)";
callbackSuccess = "";
callbackProgress = QUOTE(DFUNC(treatmentAdvanced_surgicalKit_onProgress));
itemConsumed = QGVAR(consumeItem_SurgicalKit);
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"} }};

View File

@ -78,8 +78,7 @@ PREP(treatmentAdvanced_fullHeal);
PREP(treatmentAdvanced_fullHealLocal);
PREP(treatmentAdvanced_medication);
PREP(treatmentAdvanced_medicationLocal);
PREP(treatmentAdvanced_surgicalKit);
PREP(treatmentAdvanced_surgicalKitLocal);
PREP(treatmentAdvanced_surgicalKit_onProgress);
PREP(treatmentBasic_bandage);
PREP(treatmentBasic_bloodbag);
PREP(treatmentBasic_bloodbagLocal);

View File

@ -0,0 +1,28 @@
/*
* Author: BaerMitUmlaut
* Handles treatment via surgical kit per frame.
*
* Public: No
*/
#include "script_component.hpp"
private ["_args", "_target", "_caller", "_elapsedTime", "_totalTime", "_bandagedWounds"];
_args = _this select 0;
_caller = _args select 0;
_target = _args select 1;
_elapsedTime = _this select 1;
_totalTime = _this select 2;
_bandagedWounds = _target getVariable [QGVAR(bandagedWounds), []];
//In case two people stitch up one patient and the last wound has already been closed we can stop already
if (count _bandagedWounds == 0) exitWith {false};
//Has enough time elapsed that we can close another wound?
if ((_totalTime - _elapsedTime) <= (((count _bandagedWounds) - 1) * 5)) then {
_bandagedWounds deleteAt 0;
_target setVariable [QGVAR(bandagedWounds), _bandagedWounds, true];
};
true