Basic - Bloodbag size matters

This commit is contained in:
PabstMirror 2015-05-23 01:16:18 -05:00
parent 437db22ab8
commit d752dd50d0
3 changed files with 21 additions and 6 deletions

View File

@ -50,11 +50,17 @@ class ACE_Medical_Actions {
displayNameProgress = "$STR_ACE_Medical_Transfusing_Blood";
requiredMedic = 1;
treatmentTime = 20;
items[] = {{"ACE_bloodIV", "ACE_bloodIV_500", "ACE_bloodIV_250"}};
items[] = {"ACE_bloodIV"};
callbackSuccess = QUOTE(DFUNC(treatmentBasic_bloodbag));
animationCaller = "AinvPknlMstpSnonWnonDnon_medic1";
litter[] = {};
};
class BloodIV_500: BloodIV {
items[] = {"ACE_bloodIV_500"};
};
class BloodIV_250: BloodIV {
items[] = {"ACE_bloodIV_250"};
};
class BodyBag: Bandage {
displayName = "$STR_ACE_Medical_PlaceInBodyBag";
displayNameProgress = "$STR_ACE_Medical_PlacingInBodyBag";

View File

@ -16,8 +16,9 @@
#include "script_component.hpp"
private ["_caller", "_target"];
private ["_caller", "_target", "_treatmentClassname"];
_caller = _this select 0;
_target = _this select 1;
_treatmentClassname = _this select 3;
[[_target], QUOTE(DFUNC(treatmentBasic_bloodbagLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
[[_target, _treatmentClassname], QUOTE(DFUNC(treatmentBasic_bloodbagLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */

View File

@ -4,6 +4,7 @@
*
* Arguments:
* 0: The patient <OBJECT>
* 1: Treatment Classname <STRING>
*
* Return Value:
* nil
@ -14,8 +15,15 @@
#include "script_component.hpp"
#define BLOODBAGHEAL 70
private ["_target","_blood"];
_target = _this select 0;
PARAMS_2(_target,_treatmentClassname);
_blood = ((_target getVariable [QGVAR(bloodVolume), 100]) + BLOODBAGHEAL) min 100;
private ["_blood", "_bloodAdded"];
_bloodAdded = switch (true) do {
case (_treatmentClassname == "BloodIV_250"): {0.25 * BLOODBAGHEAL};
case (_treatmentClassname == "BloodIV_500"): {0.5 * BLOODBAGHEAL};
default {BLOODBAGHEAL};
};
_blood = ((_target getVariable [QGVAR(bloodVolume), 100]) + _bloodAdded) min 100;
_target setVariable [QGVAR(bloodVolume), _blood, true];