Changed: IVs are now synced and medics can see a unit is receiving an IV

This commit is contained in:
Glowbal 2015-04-05 20:11:54 +02:00
parent 89015c94d4
commit 7ffd690a71
5 changed files with 36 additions and 1 deletions

View File

@ -61,6 +61,18 @@ if (_show) then {
_genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_PAIN", [1, 1, 1, 1]]; _genericMessages pushback [localize "STR_ACE_MEDICAL_STATUS_PAIN", [1, 1, 1, 1]];
}; };
_totalIvVolume = 0;
{
private "_value";
_value = _target getvariable _x;
if !(isnil "_value") then {
_totalIvVolume = _totalIvVolume + (_target getvariable [_x, 0]);
};
}foreach GVAR(IVBags);
if (_totalIvVolume >= 1) then {
_genericMessages pushback [format[localize "STR_ACE_MEDICAL_receivingIvVolume", floor _totalIvVolume], [1, 1, 1, 1]];
};
_selectionBloodLoss = [0,0,0,0,0,0]; _selectionBloodLoss = [0,0,0,0,0,0];
if (GVAR(level) >= 2) then { if (GVAR(level) >= 2) then {
_openWounds = _target getvariable [QGVAR(openWounds), []]; _openWounds = _target getvariable [QGVAR(openWounds), []];

View File

@ -44,6 +44,12 @@ if (_bloodVolume < 100.0) then {
_unit setvariable [_x,_ivVolume]; _unit setvariable [_x,_ivVolume];
}; };
}foreach GVAR(IVBags); }foreach GVAR(IVBags);
} else {
{
if ((_unit getvariable [_x, 0]) > 0) then {
_unit setvariable [_x, 0]; // lets get rid of exessive IV volume
};
}foreach GVAR(IVBags);
}; };
_bloodVolumeChange; _bloodVolumeChange;

View File

@ -167,4 +167,15 @@ if (GVAR(level) >= 2) then {
[_unit] call FUNC(setCardiacArrest); [_unit] call FUNC(setCardiacArrest);
}; };
}; };
// syncing any remaining values
if (_syncValues) then {
{
private "_value";
_value = _unit getvariable _x;
if !(isnil "_value") then {
_unit setvariable [_x,(_unit getvariable [_x, 0]), true];
};
}foreach GVAR(IVBags);
};
}; };

View File

@ -19,6 +19,9 @@ private ["_target", "_ivItem", "_config", "_volumeAdded", "_typeOf", "_varName"]
_target = _this select 0; _target = _this select 0;
_ivItem = _this select 1; _ivItem = _this select 1;
_bloodVolume = _target getvariable [QGVAR(bloodVolume), 100];
if (_bloodVolume >= 100) exitwith {};
// Find the proper attributes for the used IV // Find the proper attributes for the used IV
_config = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "IV"); _config = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "IV");
_volumeAdded = getNumber (_config >> "volume"); _volumeAdded = getNumber (_config >> "volume");
@ -31,7 +34,7 @@ if (isClass (_config >> _className)) then {
}; };
_varName = format["ACE_Medical_IVVolume_%1",_typeOf]; _varName = format["ACE_Medical_IVVolume_%1",_typeOf];
_target setvariable [_varName, (_target getvariable [_varName, 0]) + _volumeAdded]; _target setvariable [_varName, (_target getvariable [_varName, 0]) + _volumeAdded, true];
if !(_varName in GVAR(IVBags)) then { if !(_varName in GVAR(IVBags)) then {
GVAR(IVBags) pushback _varName; GVAR(IVBags) pushback _varName;

View File

@ -336,6 +336,9 @@
<French>Garot [CAT]</French> <French>Garot [CAT]</French>
<Polish>Opaska uciskowa [CAT]</Polish> <Polish>Opaska uciskowa [CAT]</Polish>
</Key> </Key>
<Key ID="STR_ACE_MEDICAL_receivingIvVolume">
<English>Receiving IV [%1ml]</English>
</Key>
</Container> </Container>
<Container name="CfgWeapons"> <Container name="CfgWeapons">
<Key ID="STR_ACE_MEDICAL_BANDAGE_BASIC_DISPLAY"> <Key ID="STR_ACE_MEDICAL_BANDAGE_BASIC_DISPLAY">