This commit is contained in:
Glowbal 2015-03-22 23:24:24 +01:00
parent d7de92c60d
commit 15edb0bff2
6 changed files with 42 additions and 46 deletions

View File

@ -1072,27 +1072,27 @@ class CfgVehicles {
statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(treatment));
};
class PlasmaIV_500: PlasmaIV {
displayName = "Give Blood IV (500ml)";
displayName = "Give Plasma IV (500ml)";
condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_500')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_500')] call DFUNC(treatment));
};
class PlasmaIV_250: PlasmaIV {
displayName = "Give Blood IV (250ml)";
displayName = "Give Plasma IV (250ml)";
condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_250')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_250')] call DFUNC(treatment));
};
class SalineIV: BloodIV {
displayName = "Give Blood IV (1000ml)";
displayName = "Give Saline IV (1000ml)";
condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV')] call DFUNC(treatment));
};
class SalineIV_500: SalineIV {
displayName = "Give Blood IV (500ml)";
displayName = "Give Saline IV (500ml)";
condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_500')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_500')] call DFUNC(treatment));
};
class SalineIV_250: SalineIV {
displayName = "Give Blood IV (250ml)";
displayName = "Give Saline IV (250ml)";
condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_250')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_250')] call DFUNC(treatment));
};
@ -1197,32 +1197,32 @@ class CfgVehicles {
statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_250')] call DFUNC(treatment));
};
class PlasmaIV: BloodIV {
displayName = "Give Blood IV (1000ml)";
displayName = "Give Plasma IV (1000ml)";
condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(treatment));
};
class PlasmaIV_500: PlasmaIV {
displayName = "Give Blood IV (500ml)";
displayName = "Give Plasma IV (500ml)";
condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_500')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_500')] call DFUNC(treatment));
};
class PlasmaIV_250: PlasmaIV {
displayName = "Give Blood IV (250ml)";
displayName = "Give Plasma IV (250ml)";
condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_250')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_250')] call DFUNC(treatment));
};
class SalineIV: BloodIV {
displayName = "Give Blood IV (1000ml)";
displayName = "Give Saline IV (1000ml)";
condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV')] call DFUNC(treatment));
};
class SalineIV_500: SalineIV {
displayName = "Give Blood IV (500ml)";
displayName = "Give Saline IV (500ml)";
condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_500')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_500')] call DFUNC(treatment));
};
class SalineIV_250: SalineIV {
displayName = "Give Blood IV (250ml)";
displayName = "Give Saline IV (250ml)";
condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_250')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_250')] call DFUNC(treatment));
};
@ -1329,32 +1329,32 @@ class CfgVehicles {
statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_250')] call DFUNC(treatment));
};
class PlasmaIV: BloodIV {
displayName = "Give Blood IV (1000ml)";
displayName = "Give Plasma IV (1000ml)";
condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(treatment));
};
class PlasmaIV_500: PlasmaIV {
displayName = "Give Blood IV (500ml)";
displayName = "Give Plasma IV (500ml)";
condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_500')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_500')] call DFUNC(treatment));
};
class PlasmaIV_250: PlasmaIV {
displayName = "Give Blood IV (250ml)";
displayName = "Give Plasma IV (250ml)";
condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_250')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_250')] call DFUNC(treatment));
};
class SalineIV: BloodIV {
displayName = "Give Blood IV (1000ml)";
displayName = "Give saline IV (1000ml)";
condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV')] call DFUNC(treatment));
};
class SalineIV_500: SalineIV {
displayName = "Give Blood IV (500ml)";
displayName = "Give saline IV (500ml)";
condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_500')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_500')] call DFUNC(treatment));
};
class SalineIV_250: SalineIV {
displayName = "Give Blood IV (250ml)";
displayName = "Give saline IV (250ml)";
condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_250')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_250')] call DFUNC(treatment));
};
@ -1449,32 +1449,32 @@ class CfgVehicles {
statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_250')] call DFUNC(treatment));
};
class PlasmaIV: BloodIV {
displayName = "Give Blood IV (1000ml)";
displayName = "Give Plasma IV (1000ml)";
condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(treatment));
};
class PlasmaIV_500: PlasmaIV {
displayName = "Give Blood IV (500ml)";
displayName = "Give Plasma IV (500ml)";
condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_500')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_500')] call DFUNC(treatment));
};
class PlasmaIV_250: PlasmaIV {
displayName = "Give Blood IV (250ml)";
displayName = "Give Plasma IV (250ml)";
condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_250')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_250')] call DFUNC(treatment));
};
class SalineIV: BloodIV {
displayName = "Give Blood IV (1000ml)";
displayName = "Give Saline IV (1000ml)";
condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV')] call DFUNC(treatment));
};
class SalineIV_500: SalineIV {
displayName = "Give Blood IV (500ml)";
displayName = "Give Saline IV (500ml)";
condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_500')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_500')] call DFUNC(treatment));
};
class SalineIV_250: SalineIV {
displayName = "Give Blood IV (250ml)";
displayName = "Give Saline IV (250ml)";
condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_250')] call DFUNC(canTreatCached));
statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_250')] call DFUNC(treatment));
};

View File

@ -29,6 +29,7 @@ PREP(getBloodPressure);
PREP(getBloodVolumeChange);
PREP(getCardiacOutput);
PREP(getTypeOfDamage);
PREP(getHeartRateChange);
PREP(getTriageStatus);
PREP(getUnconsciousCondition);
PREP(handleDamage);
@ -97,6 +98,8 @@ PREP(copyDeadBody);
PREP(requestWoundSync);
GVAR(injuredUnitCollection) = [];
GVAR(IVBags) = [];
call FUNC(parseConfigForInjuries);
ADDON = true;

View File

@ -37,21 +37,13 @@ _bloodVolume = _unit getvariable [QGVAR(bloodVolume), 100];
_bloodVolumeChange = -(_unit call FUNC(getBloodLoss));
if (_bloodVolume < 100.0) then {
if ((_unit getvariable [QGVAR(salineIVVolume), 0]) > 0) then {
_bloodVolumeChange = _bloodVolumeChange + BLOOD_CHANGE_PER_SECOND;
_ivVolume = (_unit getvariable [QGVAR(salineIVVolume), 0]) + IV_CHANGE_PER_SECOND;
_unit setvariable [QGVAR(salineIVVolume),_ivVolume];
};
if ((_unit getvariable [QGVAR(plasmaIVVolume), 0]) > 0) then {
_bloodVolumeChange = _bloodVolumeChange + BLOOD_CHANGE_PER_SECOND;
_ivVolume = (_unit getvariable [QGVAR(plasmaIVVolume), 0]) + IV_CHANGE_PER_SECOND;
_unit setvariable [QGVAR(plasmaIVVolume),_ivVolume];
};
if ((_unit getvariable [QGVAR(bloodIVVolume), 0]) > 0) then {
_bloodVolumeChange = _bloodVolumeChange + BLOOD_CHANGE_PER_SECOND;
_ivVolume = (_unit getvariable [QGVAR(bloodIVVolume), 0]) + IV_CHANGE_PER_SECOND;
_unit setvariable [QGVAR(bloodIVVolume),_ivVolume];
};
{
if ((_unit getvariable [_x, 0]) > 0) then {
_bloodVolumeChange = _bloodVolumeChange + BLOOD_CHANGE_PER_SECOND;
_ivVolume = (_unit getvariable [_x, 0]) + IV_CHANGE_PER_SECOND;
_unit setvariable [_x,_ivVolume];
};
}foreach GVAR(IVBags);
};
_bloodVolumeChange;

View File

@ -105,7 +105,7 @@ if (GVAR(level) >= 2) then {
};
// Set the vitals
_heartRate = (_unit getvariable [QGVAR(heartRate), 0]) + ([_unit] call FUNC(getHeartRateChange)) * _interval;
_heartRate = (_unit getvariable [QGVAR(heartRate), 0]) + (([_unit] call FUNC(getHeartRateChange)) * _interval);
_unit setvariable [QGVAR(heartRate), _heartRate, _syncValues];
_bloodPressure = [_unit] call FUNC(getBloodPressure);

View File

@ -73,11 +73,7 @@ if (alive _target) then {
// Reduce the pain level
_pain = _target getvariable [QGVAR(pain), 0];
_pain = _pain * _painReduce;
if (_pain <= 0) then {
_pain = 0;
};
_target setvariable [QGVAR(pain), _pain];
_target setvariable [QGVAR(pain), (_pain - _painReduce) max 0];
_resistance = _unit getvariable [QGVAR(peripheralResistance), 100];
_resistance = _resistance + _viscosityChange;

View File

@ -21,8 +21,8 @@ _ivItem = _this select 1;
// Find the proper attributes for the used IV
_config = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "IV");
_volumeAdded = getNumber (_medicationConfig >> "volume");
_typeOf = getText (_medicationConfig >> "type");
_volumeAdded = getNumber (_config >> "volume");
_typeOf = getText (_config >> "type");
if (isClass (_config >> _className)) then {
_config = (_config >> _className);
@ -33,6 +33,11 @@ if (isClass (_config >> _className)) then {
_varName = format["ACE_Medical_IVVolume_%1",_typeOf];
_target setvariable [_varName, (_target getvariable [_varName, 0]) + _volumeAdded];
if !(_varName in GVAR(IVBags)) then {
GVAR(IVBags) pushback _varName;
publicVariable GVAR(IVBags);
};
// TODO localization
//[_target,"treatment",format["%1 has given %4 a %2(%3ml)",[_caller] call EFUNC(common,getName),_attributes select 2,_attributes select 1,_target]] call FUNC(addActivityToLog);
//[_target,_removeItem] call FUNC(addToTriageList);