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

Medical - Add Additional Hitpoints to the medical system #10482

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

Cplhardcore
Copy link
Contributor

When merged this pull request will:

  • Adds 6 new hitpoints to the ace medical system (Neck, Chest, and four upper limbs) for better compatibility and modularity to other medical mods

ToDo
-GUI

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

@veteran29 veteran29 self-requested a review November 5, 2024 02:13
addons/medical_damage/script_component.hpp Outdated Show resolved Hide resolved
addons/medical_engine/functions/fnc_handleDamage.sqf Outdated Show resolved Hide resolved
@@ -97,7 +97,7 @@ private _state = [_json] call CBA_fnc_parseJSON;
[QEGVAR(medical,ivBags), nil],
[QEGVAR(medical,triageLevel), 0],
[QEGVAR(medical,triageCard), []],
[QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]
[QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0,0,0,0,0,0,0]]
// Offset needs to be converted
// [VAR_MEDICATIONS, []]
];
Copy link
Member

Choose a reason for hiding this comment

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

This function needs handling of previous format of bodyPartDamage array.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For BWC? or is there something else I am oblivious to

addons/medical_damage/functions/fnc_woundsHandlerBase.sqf Outdated Show resolved Hide resolved
addons/medical_engine/script_component.hpp Outdated Show resolved Hide resolved
@@ -124,7 +124,7 @@ if (random 1 <= _reopeningChance * GVAR(woundReopenChance)) then {
// Re-add trauma and damage visuals
if (GVAR(clearTrauma) == 2) then {
private _injuryDamage = (_selectedInjury select 4) * _impact;
private _bodyPartDamage = _target getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]];
private _bodyPartDamage = _target getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0,0,0,0,0,0,0]];
Copy link
Member

Choose a reason for hiding this comment

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

Looking at how frequently the default state array of body parts damage is being used would be nice to move it to a macro.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ive attempted that, hopefully its correct

@veteran29
Copy link
Member

cc @pterolatypus

@Drofseh
Copy link
Contributor

Drofseh commented Nov 5, 2024

If the upper limbs are called upper the lower limbs should be called lower.
Upper Arm and Arm sounds weird compared to Upper Arm and Lower Arm.

@LinkIsGrim
Copy link
Contributor

cc @pterolatypus

MIA

@LinkIsGrim
Copy link
Contributor

I don't hate this on principle but oh dear this can break in so many ways (both itself and BWC)

@Cplhardcore
Copy link
Contributor Author

I don't hate this on principle but oh dear this can break in so many ways (both itself and BWC)

I know, its horrible for BWC, but its a very much needed update as KAM needs more granularity in terms of hitpoints (and overwrites are not great

I had a differing path as well, but that would have had me make hitpoints for everything, down to the granularity of individual hands and joints, which would have been worse

Copy link
Contributor

@LinkIsGrim LinkIsGrim left a comment

Choose a reason for hiding this comment

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

Surprisingly few changes necessary to make this work (though I'll admit I haven't looked at this under a microscope), which is good, but this is a big enough change this late into the lifecycle that I'd put it under a setting. Which you can't do, because hitpoints are tied too strongly into how the system works and was balanced.

This warrants similar testing as the wound handler rework and medical rewrite IMO.

Some other considerations:
Do you bleed twice as much for explosions now? (I have a feeling you do)
Is sway just twice as strong on the worst case too?

This is a pretty big change so we're going to be nitpicky. You're going to see "Requested Changes" a lot. Sorry, not sorry (please use hemtt), I still have an armor penetration PR that hasn't been reviewed because no one wants to touch medical.

addons/interaction/CfgVehicles.hpp Outdated Show resolved Hide resolved
private _bodyPartVisParams = [_unit, false, false, false, false]; // params array for EFUNC(medical_engine,updateBodyPartVisuals);

// process wounds separately for each body part hit
{ // forEach _allDamages
_x params ["_damage", "_bodyPart"];
_bodyPart = toLowerANSI _bodyPart;

if (_bodyPart == "head") then {
private _isNeck = (random 1) < 0.1; // 15% chance for neck damage
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems arbitrary. Can this not be handled via medical_engine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, as the hitbox for neck damage is unbelievably small, to the point its impossible to hit
Plus jaw/lower head damage still affects the neck area

addons/medical_engine/functions/fnc_handleDamage.sqf Outdated Show resolved Hide resolved
addons/medical_engine/functions/fnc_handleDamage.sqf Outdated Show resolved Hide resolved

if (_updateHead) then {
[_unit, "head", (_bodyPartDamage select 0) > VISUAL_BODY_DAMAGE_THRESHOLD] call FUNC(damageBodyPart);
[_unit, "head", ((_bodyPartDamage select 0) max (_bodyPartDamage select 1)) > VISUAL_BODY_DAMAGE_THRESHOLD] call FUNC(damageBodyPart);
Copy link
Contributor

Choose a reason for hiding this comment

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

This will break KAM FYI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh i am aware, ill have to do my own refactor of KAM with these changes if they do get merged

Comment on lines +10 to +20
#define HITPOINT_INDEX_NECK 1
#define HITPOINT_INDEX_CHEST 2
#define HITPOINT_INDEX_BODY 3
#define HITPOINT_INDEX_LARM 4
#define HITPOINT_INDEX_ULARM 5
#define HITPOINT_INDEX_RARM 6
#define HITPOINT_INDEX_URARM 7
#define HITPOINT_INDEX_LLEG 8
#define HITPOINT_INDEX_ULLEG 9
#define HITPOINT_INDEX_RLEG 10
#define HITPOINT_INDEX_URLEG 11
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer if the new hitpoints were added on at the end, even if it seems less logical, less places to break

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reason why it's like that is for update body image using a series of greater-than-checks

@@ -130,9 +136,9 @@
#define DEFAULT_BANDAGE_REOPENING_MIN_DELAY 120
#define DEFAULT_BANDAGE_REOPENING_MAX_DELAY 200

#define DEFAULT_TOURNIQUET_VALUES [0,0,0,0,0,0]
#define DEFAULT_TOURNIQUET_VALUES [0,0,0,0,0,0,0,0,0,0,0,0]
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need upper/lower limb tourniquets/splints? If either end of the limb is broken, you still can't use it, and a tourniquet on the upper limb will still cut off blood flow to the whole thing.

I get that this can be interesting for something like numbness/necrosis in the case of tourniquets, but there's no reason in baseline medical to not throw the tourniquet on the upper limb (assuming that works as expected).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its for compatibility with KAM, as tissue necrosis will be a thing soon plus we have IVs so a lower limb TQ wont occlude upper IV access

addons/medical_gui/functions/fnc_updateBodyImage.sqf Outdated Show resolved Hide resolved
@Cplhardcore
Copy link
Contributor Author

Cplhardcore commented Nov 5, 2024

Some other considerations:
Do you bleed twice as much for explosions now? (I have a feeling you do),

Yes, but there is another PR in the pipe that reworks wounds and their creation, so in the end it will be equivalent to how it was before

Is sway just twice as strong on the worst case too?

Yes, and I'm looking at making a change to that

@Cplhardcore
Copy link
Contributor Author

Cplhardcore commented Nov 5, 2024

Current issues
GUI, i need to do it Done

Explosions are kinda weird for damage, likes to leave parts of limbs untouched, might need the damage randomizer to be a flip flop instead, unless its all one EH and if so ill need to work at explosive damage

End key is broken, somehow, no idea where or how (it was a keybind issue)

Chest and torso can be fractured, to be fixed (its fixed, didn't change a number)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants