Added local treatment through remoteExec for basic

This commit is contained in:
Glowbal 2015-04-28 20:32:02 +02:00
parent c38fe384e3
commit 95d83554da
5 changed files with 54 additions and 14 deletions

View File

@ -80,8 +80,10 @@ PREP(treatmentAdvanced_medication);
PREP(treatmentAdvanced_medicationLocal);
PREP(treatmentBasic_bandage);
PREP(treatmentBasic_bloodbag);
PREP(treatmentBasic_bloodbagLocal);
PREP(treatmentBasic_epipen);
PREP(treatmentBasic_morphine);
PREP(treatmentBasic_morphineLocal);
PREP(treatmentIV);
PREP(treatmentIVLocal);
PREP(treatmentTourniquet);

View File

@ -15,12 +15,9 @@
*/
#include "script_component.hpp"
#define BLOODBAGHEAL 70
private ["_caller", "_target","_className","_blood"];
private ["_caller", "_target"];
_caller = _this select 0;
_target = _this select 1;
_className = _this select 3;
_blood = ((_target getVariable [QGVAR(bloodVolume), 100]) + BLOODBAGHEAL) min 100;
_target setVariable [QGVAR(bloodVolume), _blood, true];
[[_target], QUOTE(DFUNC(treatmentBasic_bloodbagLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -0,0 +1,21 @@
/*
* Author: KoffeinFlummi
* Local callback when the bloodbag treatment is complete
*
* Arguments:
* 0: The patient <OBJECT>
*
* Return Value:
* nil
*
* Public: No
*/
#include "script_component.hpp"
#define BLOODBAGHEAL 70
private ["_target","_blood"];
_target = _this select 0;
_blood = ((_target getVariable [QGVAR(bloodVolume), 100]) + BLOODBAGHEAL) min 100;
_target setVariable [QGVAR(bloodVolume), _blood, true];

View File

@ -17,15 +17,8 @@
#include "script_component.hpp"
#define MORPHINEHEAL 0.4
private ["_caller", "_target","_className","_blood","_morphine","_pain"];
private ["_caller", "_target"];
_caller = _this select 0;
_target = _this select 1;
_className = _this select 3;
// reduce pain, pain sensitivity
_morphine = ((_target getVariable [QGVAR(morphine), 0]) + MORPHINEHEAL) min 1;
_target setVariable [QGVAR(morphine), _morphine, true];
_pain = ((_target getVariable [QGVAR(pain), 0]) - MORPHINEHEAL) max 0;
_target setVariable [QGVAR(pain), _pain, true];
// @todo overdose
[[_target], QUOTE(DFUNC(treatmentBasic_morphineLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -0,0 +1,27 @@
/*
* Author: KoffeinFlummi
* Local callback when the morphine treatment is complete
*
* Arguments:
* 0: The medic <OBJECT>
* 1: The patient <OBJECT>
*
* Return Value:
* nil
*
* Public: No
*/
#include "script_component.hpp"
#define MORPHINEHEAL 0.4
private ["_target", "_morphine", "_pain"];
_target = _this select 0;
// reduce pain, pain sensitivity
_morphine = ((_target getVariable [QGVAR(morphine), 0]) + MORPHINEHEAL) min 1;
_target setVariable [QGVAR(morphine), _morphine, true];
_pain = ((_target getVariable [QGVAR(pain), 0]) - MORPHINEHEAL) max 0;
_target setVariable [QGVAR(pain), _pain, true];
// @todo overdose