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 - Refactoring #73

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

Conversation

MichaelJRM
Copy link

Refactored the code.

Taken from #72

Kexanone and others added 8 commits May 26, 2024 16:06
Use new method for adding bleedings
Update signature of ToggleActive
* Use the new SCR_DotDamageEffect approach to healing

* Rename to CalculatePassiveRegenDPS and apply regen scale for resilience

* Use new method for adding bleeding

* GetBleedingHitZones changed signature
Copy link
Member

@Kexanone Kexanone left a comment

Choose a reason for hiding this comment

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

  • This is a refactoring PR, so it shouldn't remove SCR_BandageUserAction.c, since that would introduce a behavioral change.
  • As mentioned, we follow MarioE's convention for the folder structure and naming of modded scripts, so you should revert the renaming.

@@ -2,78 2,74 @@
//! Introduce a second chance, which gets triggered when the character would have died without
//! falling unconscious.
//! Add methods for interacting with pain hit zone.
modded class SCR_CharacterDamageManagerComponent : SCR_DamageManagerComponent
modded class SCR_CharacterDamageManagerComponent
Copy link
Member

Choose a reason for hiding this comment

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

We prefer to have the parent class specification for clarity.

Copy link
Author

Choose a reason for hiding this comment

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

Ok that makes sense, actually I didn't know this was possible. I wish I knew it before

ACE_Medical_Settings settings = ACE_SettingsHelperT<ACE_Medical_Settings>.GetModSettings();

const ACE_Medical_Settings settings = ACE_SettingsHelperT<ACE_Medical_Settings>.GetModSettings();
Copy link
Member

Choose a reason for hiding this comment

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

While thinking about constant correctness isn't inherently bad, we prefer to have it more consistent with the rest of the code base. The current convention for this repo is to have const only for primitive members.

@MichaelJRM
Copy link
Author

I would consider removing SCR_BandageUserAction.c as refactoring since it doesn't solve the issue it was purposed to solve; in fact, it's only adding an additional check on top of the current one.

@MichaelJRM
Copy link
Author

Having the prefix helps maintainability as it is much easier to find what you're looking for. If I want to go to the modded version I can just type Prefix_****, without the prefix it will take me to the vanilla code and that is annoying.

@Kexanone
Copy link
Member

Kexanone commented Jun 14, 2024

I would consider removing SCR_BandageUserAction.c as refactoring since it doesn't solve the issue it was purposed to solve; in fact, it's only adding an additional check on top of the current one.

I agree that reverting the approach for detecting, if a bandage can be applied, is refactoring, but that's not all it does. The actual behavioral change is whether the check is done in CanBePerformedScript or CanBeShownScript. So if you want to do this, just make sure that the check is still done in CanBePerformedScript.

Having the prefix helps maintainability as it is much easier to find what you're looking for. If I want to go to the modded version I can just type Prefix_****, without the prefix it will take me to the vanilla code and that is annoying.

I don't see your issue. One version is in ACE_Medical, the other isn't. Besides in practice, one would usually search for classes and methods via the symbol search anyway and the modded one is always the second entry. The file names should match the class they contain for consistency.

@Kexanone Kexanone added kind/cleanup Release Notes: Excluded 1.2.0.x Arma Reforger version 1.2.0.x labels Jun 14, 2024
@Kexanone Kexanone added this to the 1.1.0 milestone Jun 14, 2024
@Kexanone Kexanone changed the base branch from experimental to master June 26, 2024 18:43
@Kexanone Kexanone modified the milestones: 1.1.0, 1.1.1, Ongoing Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.2.0.x Arma Reforger version 1.2.0.x kind/cleanup Release Notes: Excluded
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants