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 - Improve Epi status message in the event of critical injury #83

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,16 @@ modded class SCR_CharacterDamageManagerComponent : SCR_DamageManagerComponent
}

//------------------------------------------------------------------------------------------------
//! Returns true if at least one physical hit zone is below the provided scaled health.
//! maxHeal defaults to any damage (0.999), and any negative number will be replaced with the medical kit's max heal value.
bool ACE_Medical_CanBeHealed(float maxHeal = 0.999)
//! 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)
{
// Checking default argument
if (maxHeal < 0)
maxHeal = m_fACE_Medical_MedicalKitMaxHeal;
// Calculating the maxHeal to check against
float maxHeal = 0;
if (atMedicalFacility)
maxHeal = 0.999;
else
m_fACE_Medical_MedicalKitMaxHeal;
alexgibbs606 marked this conversation as resolved.
Show resolved Hide resolved

// Iterating hitzones and checking max health
foreach (HitZone hitZone : m_aACE_Medical_PhysicalHitZones)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class ACE_Medical_ConsumableEpinephrine : SCR_ConsumableEffectHealthItems
}

// In the event the patient is critically injured, we don't allow epi
if (damageManager.ACE_Medical_HasCriticalHealth() && damageManager.ACE_Medical_CanBeHealed())
if (damageManager.ACE_Medical_HasCriticalHealth() && damageManager.ACE_Medical_CanBeHealed(atMedicalFacility:true))
alexgibbs606 marked this conversation as resolved.
Show resolved Hide resolved
{
// If the patient can still be healed with the medicalkit, we'll just say that the patient is too injured
if (damageManager.ACE_Medical_CanBeHealed(-1))
if (damageManager.ACE_Medical_CanBeHealed(atMedicalFacility:false))
alexgibbs606 marked this conversation as resolved.
Show resolved Hide resolved
failReason = SCR_EConsumableFailReason.ACE_MEDICAL_TOO_DAMAGED;
// Otherwise, we'll display a seperate message showing the patient as critically injured
else
Expand Down