-
Notifications
You must be signed in to change notification settings - Fork 20
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 - Improve Epi status message in the event of critical injury #83
Open
alexgibbs606
wants to merge
16
commits into
acemod:master
Choose a base branch
from
alexgibbs606:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6d3dcab
Added damageManager method to determine if a patient can be healed wi…
alexgibbs606 5ca9ab7
Added new failreason for epi - critical injury
alexgibbs606 43e2f80
Updated method for determining if epi can be administered.
alexgibbs606 21dc7fb
Adjusted epi application logic to expect non-healable critical injuries
alexgibbs606 3afaf71
Correcting message localization addition of critical injury message
alexgibbs606 f15a738
Updating epi fail message to better convey patient condition
alexgibbs606 9af24c7
Addressed PR requests. Localization changes not included.
alexgibbs606 0ee9674
Re-added morphine description and updated new injury message
alexgibbs606 18c20cd
Updated CanBeHealed maxHeal default to .999 (any damage)
alexgibbs606 d640d9a
Updated failReason to match localization variable change.
alexgibbs606 cbecdf9
Updated localization table key to match it's reference in the Epi use…
alexgibbs606 589a9bf
Clarifying general too injured and med facility too injured message t…
alexgibbs606 c6927eb
Updated the canbehealed method to check if at a medical facility inst…
alexgibbs606 27209ce
Merge branch 'master' of github.com:acemod/ACE-Anvil
alexgibbs606 5743d5e
Streamlined maxHeal comprehension
alexgibbs606 20b5460
Resolved styleguide formatting
alexgibbs606 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
ACE_SettingsConfig { | ||
m_aInitialModSettings { | ||
ACE_Medical_Settings "{60FD72EFA3DB8236}" { | ||
m_bSecondChanceOnHeadEnabled 1 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -14,6 +14,7 @@ modded class SCR_CharacterDamageManagerComponent : SCR_DamageManagerComponent | |||||||
protected ACE_Medical_PainHitZone m_pACE_Medical_PainHitZone; | ||||||||
protected float m_fACE_Medical_ModeratePainThreshold; | ||||||||
protected float m_fACE_Medical_SeriousPainThreshold; | ||||||||
protected float m_fACE_Medical_MedicalKitMaxHeal; | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Settings needs to be replicated, move down to other Rpl props. Also needs a default value in case the settings are not there.
Suggested change
|
||||||||
|
||||||||
// We only notify the replication system about changes of these members on initialization | ||||||||
// After init, each proxy is itself responsible for updating these members | ||||||||
|
@@ -53,6 +54,7 @@ modded class SCR_CharacterDamageManagerComponent : SCR_DamageManagerComponent | |||||||
{ | ||||||||
m_bACE_Medical_SecondChanceOnHeadEnabled = settings.m_bSecondChanceOnHeadEnabled; | ||||||||
m_fACE_Medical_SecondChanceRegenScale = settings.m_fSecondChanceRegenScale; | ||||||||
m_fACE_Medical_MedicalKitMaxHeal = settings.m_fMedicalKitMaxHealScaled; | ||||||||
} | ||||||||
|
||||||||
ACE_Medical_EnableSecondChance(true); | ||||||||
|
@@ -84,12 +86,19 @@ modded class SCR_CharacterDamageManagerComponent : SCR_DamageManagerComponent | |||||||
} | ||||||||
|
||||||||
//------------------------------------------------------------------------------------------------ | ||||||||
//! Returns true if at least one physical hit zone is injured | ||||||||
bool ACE_Medical_CanBeHealed() | ||||||||
//! Returns true if at least one physical hit zone is below the provided max scaled health. | ||||||||
//! When atMedicalFacility is true, it will check for any damage (scaled health of 0.999), otherwise it will compare against the max scaled heal with a medical kit. | ||||||||
bool ACE_Medical_CanBeHealed(bool atMedicalFacility = false) | ||||||||
{ | ||||||||
// Calculating the maxHeal to check against | ||||||||
float maxHeal = 0.999; | ||||||||
if (!atMedicalFacility) | ||||||||
maxHeal = m_fACE_Medical_MedicalKitMaxHeal; | ||||||||
|
||||||||
// Iterating hitzones and checking max health | ||||||||
foreach (HitZone hitZone : m_aACE_Medical_PhysicalHitZones) | ||||||||
{ | ||||||||
if (hitZone.GetHealthScaled() < 0.999) | ||||||||
if (hitZone.GetHealthScaled() < maxHeal) | ||||||||
return true; | ||||||||
} | ||||||||
|
||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to edit default settings? @Kexanone ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that should remain disabled.