Heal hitpoint after bandage sets bodyPartStatus

This commit is contained in:
PabstMirror 2016-08-07 13:58:09 -05:00
parent ff297e307b
commit c46b2d09cf

View File

@ -108,8 +108,10 @@ if (GVAR(healHitPointAfterAdvBandage) || {GVAR(level) < 2}) then {
// Tally of unbandaged wounds to each body part. // Tally of unbandaged wounds to each body part.
private _headWounds = 0; private _headWounds = 0;
private _bodyWounds = 0; private _bodyWounds = 0;
private _legsWounds = 0; private _leftArmWounds = 0;
private _armWounds = 0; private _leftLegWounds = 0;
private _rightArmWounds = 0;
private _rightLegWounds = 0;
// Loop through all current wounds and add up the number of unbandaged wounds on each body part. // Loop through all current wounds and add up the number of unbandaged wounds on each body part.
{ {
@ -132,42 +134,52 @@ if (GVAR(healHitPointAfterAdvBandage) || {GVAR(level) < 2}) then {
// Left Arm // Left Arm
case 2: { case 2: {
_armWounds = _armWounds + (_numOpenWounds * _bloodLoss); _leftArmWounds = _leftArmWounds + (_numOpenWounds * _bloodLoss);
}; };
// Right Arm // Right Arm
case 3: { case 3: {
_armWounds = _armWounds + (_numOpenWounds * _bloodLoss); _rightArmWounds = _rightArmWounds + (_numOpenWounds * _bloodLoss);
}; };
// Left Leg // Left Leg
case 4: { case 4: {
_legsWounds = _legsWounds + (_numOpenWounds * _bloodLoss); _leftLegWounds = _leftLegWounds + (_numOpenWounds * _bloodLoss);
}; };
// Right Leg // Right Leg
case 5: { case 5: {
_legsWounds = _legsWounds + (_numOpenWounds * _bloodLoss); _rightLegWounds = _rightLegWounds + (_numOpenWounds * _bloodLoss);
}; };
}; };
} forEach _currentWounds; } forEach _currentWounds;
// ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]
private _bodyStatus = _target getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]];
// Any body part that has no wounds is healed to full health // Any body part that has no wounds is healed to full health
if (_headWounds == 0) then { if (_headWounds == 0) then {
_target setHitPointDamage ["hitHead", 0.0]; _bodyStatus set [0, 0];
}; };
if (_bodyWounds == 0) then { if (_bodyWounds == 0) then {
_target setHitPointDamage ["hitBody", 0.0]; _bodyStatus set [1, 0];
};
if (_leftArmWounds == 0) then {
_bodyStatus set [2, 0];
};
if (_rightArmWounds == 0) then {
_bodyStatus set [3, 0];
};
if (_leftLegWounds == 0) then {
_bodyStatus set [4, 0];
};
if (_rightLegWounds == 0) then {
_bodyStatus set [5, 0];
}; };
if (_armWounds == 0) then { _target setVariable [QGVAR(bodyPartStatus), _bodyStatus, true];
_target setHitPointDamage ["hitHands", 0.0];
};
if (_legsWounds == 0) then { [_target] call FUNC(handleDamage_advancedSetDamage);
_target setHitPointDamage ["hitLegs", 0.0];
};
}; };
true; true;