Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to vitals and display #6444

Merged
merged 5 commits into from
Jul 18, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions addons/medical/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,15 @@
<Chinesesimp>大量失血中</Chinesesimp>
<Chinese>大量失血中</Chinese>
</Key>
<Key ID="STR_ACE_Medical_Status_Lost_Blood2">
<English>Lost some blood Class II Hemorrhage</English>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't seen how it looks in game, but it seems odd to me that the class directly runs on from the description in these strings

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the messages will be fine if we remove the class bit.

</Key>
<Key ID="STR_ACE_Medical_Status_Lost_Blood3">
<English>Lost a lot of blood Class III Hemorrhage</English>
</Key>
<Key ID="STR_ACE_Medical_Status_Lost_Blood4">
<English>Lost a massive amount of blood Class IV Hemorrhage</English>
</Key>
<Key ID="STR_ACE_Medical_Status_Tourniquet_Applied">
<English>Tourniquet [CAT]</English>
<German>Tourniquet [CAT]</German>
Expand Down
20 changes: 18 additions & 2 deletions addons/medical_gui/functions/fnc_displayPatientInformation.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,24 @@ if (_show == 1) then {
if IS_BLEEDING(_target) then {
_genericMessages pushback [localize ELSTRING(medical,Status_Bleeding), [1, 0.1, 0.1, 1]];
};
if (GET_HEMORRHAGE(_target) > 1) then {
_genericMessages pushback [localize ELSTRING(medical,Status_Lost_Blood), [1, 0.1, 0.1, 1]];

// Show more information if advancedDiagnose is enabled
if (EGVAR(medical,advancedDiagnose)) then {
if (GET_HEMORRHAGE(_target) == 1) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood2), [1, 0.1, 0.1, 1]];
};

if (GET_HEMORRHAGE(_target) == 2) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood3), [1, 0.1, 0.1, 1]];
};

if (GET_HEMORRHAGE(_target) == 3) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood4), [1, 0.1, 0.1, 1]];
};
} else {
if (GET_HEMORRHAGE(_target) > 1) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood), [1, 0.1, 0.1, 1]];
};
};

if (((_target getVariable [QEGVAR(medical,tourniquets), [0,0,0,0,0,0]]) select _selectionN) > 0) then {
Expand Down
19 changes: 17 additions & 2 deletions addons/medical_gui/functions/fnc_updateUIInfo.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,23 @@ if IS_BLEEDING(_target) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Bleeding), [1, 0.1, 0.1, 1]];
};

if (GET_HEMORRHAGE(_target) > 1) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood), [1, 0.1, 0.1, 1]];
// Show more information if advancedDiagnose is enabled
if (EGVAR(medical,advancedDiagnose)) then {
if (GET_HEMORRHAGE(_target) == 1) then {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be a switch statement.

_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood2), [1, 0.1, 0.1, 1]];
};

if (GET_HEMORRHAGE(_target) == 2) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood3), [1, 0.1, 0.1, 1]];
};

if (GET_HEMORRHAGE(_target) == 3) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood4), [1, 0.1, 0.1, 1]];
};
} else {
if (GET_HEMORRHAGE(_target) > 1) then {
_genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood), [1, 0.1, 0.1, 1]];
};
};

if (((_target getVariable [QEGVAR(medical,tourniquets), [0, 0, 0, 0, 0, 0]]) select _selectionN) > 0) then {
Expand Down
14 changes: 9 additions & 5 deletions addons/medical_vitals/functions/fnc_handleUnitVitals.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ _bloodVolume = 0 max _bloodVolume min DEFAULT_BLOOD_VOLUME;
_unit setVariable [VAR_BLOOD_VOL, _bloodVolume, _syncValues];

// Set variables for synchronizing information across the net
private _hemorrhage = [
0,
[1, 3] select (_bloodVolume < BLOOD_VOLUME_CLASS_3_HEMORRHAGE)
] select (_bloodVolume < BLOOD_VOLUME_CLASS_1_HEMORRHAGE);
private _hemorrhage = switch (true) do {
case (_bloodVolume < BLOOD_VOLUME_CLASS_4_HEMORRHAGE): { 3 };
case (_bloodVolume < BLOOD_VOLUME_CLASS_3_HEMORRHAGE): { 2 };
case (_bloodVolume < BLOOD_VOLUME_CLASS_2_HEMORRHAGE): { 1 };
case (_bloodVolume < BLOOD_VOLUME_CLASS_1_HEMORRHAGE): { 1 };
default {0};
};

if (_hemorrhage != GET_HEMORRHAGE(_unit)) then {
_unit setVariable [VAR_HEMORRHAGE, _hemorrhageClass, true];
_unit setVariable [VAR_HEMORRHAGE, _hemorrhage, true];
};

private _bloodLoss = GET_BLOOD_LOSS(_unit);
Expand Down Expand Up @@ -92,6 +95,7 @@ if (_bloodLoss > BLOOD_LOSS_KNOCK_OUT_THRESHOLD * _cardiacOutput) then {

#ifdef DEBUG_MODE_FULL
if (!isPlayer _unit) then {
private _painLevel = _unit getVariable [VAR_PAIN, 0];
hintSilent format["blood volume: %1, blood loss: [%2, %3]\nhr: %4, bp: %5, pain: %6", round(_bloodVolume * 100) / 100, round(_bloodLoss * 1000) / 1000, round((_bloodLoss / (0.001 max _cardiacOutput)) * 100) / 100, round(_heartRate), _bloodPressure, round(_painLevel * 100) / 100];
};
#endif
Expand Down