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 damage handling for explosive damage while inside vehicles #9246

Merged

Conversation

LinkIsGrim
Copy link
Contributor

When merged this pull request will:

  • Add damage handling for all damage from explosives while inside a vehicle. This includes mines, artillery, explosive charges, AT, explosive projectiles like 40mm grenades, and most importantly catastrophic vehicle explosions.
  • Change vehicle checks in ace_medical_engine_fnc_handleDamage to objectParent. It's faster and handles dead units.

Continuation of @pterolatypus #8832. Includes #9216, should be merged alongside/after.

I wasn't able to figure out why damage from vehicle explosions can be negative, but just using abs value puts wounds at where they should be anyway.

Doesn't completely guarantee lethality from catastrophic explosions because of the random body part roll. Should it? I feel like the chance for survival is low enough anyway (have to not roll head or body six times at damage = 1).

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}.

pterolatypus and others added 29 commits March 2, 2022 13:12
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
@LinkIsGrim LinkIsGrim added the kind/enhancement Release Notes: **IMPROVED:** label Jul 9, 2023
@PabstMirror
Copy link
Contributor

PabstMirror commented Aug 31, 2023

might be able to remove this code after this PR
Guarantee aircraft crashes are more lethal
https://github.com/acemod/ACE3/blob/master/addons/medical_engine/XEH_postInit.sqf#L64-L76


// hitpoints are randomized, more damage means more wounds in different body parts
for "_i" from 1 to (_damageToApply * 6) do {
_newDamages pushBack [_damageToApply * 6, selectRandom ALL_BODY_PARTS, _damageToApply * 6]
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand the 6x on line 32, but not sure I get where the 6x on 33 is coming from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IIRC, scaling. Though looking at this again now I'd rather rewrite this loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remembered: damage here is only gotten from #structural hitpoint and only available in 0-1 range, typically very low. So it's multiplied by 6 to account for it representing damage to each limb, sorta. It feels right in game IMO.

private _realDamage = _newDamage * _armor;
if (_hitPoint isNotEqualTo "#structural") then {
_newDamage = _newDamage * (_armor/_armorScaled);
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 we could make this scaling a setting?
just a 0-1 lerp between old way and new

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why?

@PabstMirror
Copy link
Contributor

this is very subjective but I think it's ok if some explosions are survivable
e.g. hatchback setDamage 1, car's don't really explode, so I'm not sure if that should be fatal

@LinkIsGrim
Copy link
Contributor Author

I'm okay with vehicle explosions being sometimes survivable, though that is mostly going to be handled by selectRandom ALL_BODY_PARTS.

@LinkIsGrim
Copy link
Contributor Author

This needs testing/compatibility with AVD, as that damages crew based on damage sustained by the vehicle. Need to check if it doesn't become excessive.

@LinkIsGrim LinkIsGrim added this to the 3.16.1 milestone Sep 6, 2023
@LinkIsGrim LinkIsGrim modified the milestones: 3.16.1, 3.16.0 Sep 6, 2023
@LinkIsGrim
Copy link
Contributor Author

AVD doubles up on the damage inflicted.

@veteran29
Copy link
Member

Code looks ok, I did not test it.

@LinkIsGrim
Copy link
Contributor Author

Yell at me if this breaks. Focus testing concern on RC.

@LinkIsGrim LinkIsGrim merged commit aee47c9 into acemod:master Sep 24, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Release Notes: **IMPROVED:** status/needs-testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants