/// <summary> /// Checks how big is the cut is right now. /// Additonally ensures that all Trauma damage levels are updated to make sure cut size logic is correct everywhere. /// </summary> private void CheckCutSize() { currentBurnDamageLevel = CheckTraumaDamageLevels(currentBurnDamage); currentSlashDamageLevel = CheckTraumaDamageLevels(currentSlashCutDamage); currentPierceDamageLevel = CheckTraumaDamageLevels(currentPierceDamage); CheckCharredBodyPart(); currentCutSize = GetCutSize(currentSlashDamageLevel); currentCutSize = GetCutSize(currentPierceDamageLevel); }
/// <summary> /// Updates the reported severity of injuries for examine based off of current health /// </summary> private void UpdateSeverity() { var oldSeverity = Severity; // update UI limbs depending on their severity of damage float severity = 1 - (Mathf.Max(maxHealth - TotalDamageWithoutOxyCloneRadStam, 0) / maxHealth); // If the limb is uninjured if (severity <= 0) { Severity = DamageSeverity.None; currentCutSize = BodyPartCutSize.NONE; } // If the limb is under 10% damage else if (severity < 0.1) { Severity = DamageSeverity.Light; } // If the limb is under 25% damage else if (severity < 0.25) { Severity = DamageSeverity.LightModerate; } // If the limb is under 45% damage else if (severity < 0.45) { Severity = DamageSeverity.Moderate; } // If the limb is under 85% damage else if (severity < 0.85) { Severity = DamageSeverity.Bad; } // If the limb is under 95% damage else if (severity < 0.95f) { Severity = DamageSeverity.Critical; } // If the limb is 95% damage or over else if (severity >= 0.95f) { Severity = DamageSeverity.Max; } if (DamageContributesToOverallHealth && oldSeverity != Severity && healthMaster != null) { UpdateIcons(); } }
/// <summary> /// Checks how big is the cut is right now. /// </summary> private void CheckCutSize() { if (currentSlashCutDamage <= 0) { currentCutSize = BodyPartCutSize.NONE; } else if (currentSlashCutDamage > 25) { currentCutSize = BodyPartCutSize.SMALL; } else if (currentSlashCutDamage > 50) { currentCutSize = BodyPartCutSize.MEDIUM; } else if (currentSlashCutDamage > 75) { currentCutSize = BodyPartCutSize.LARGE; } if (currentCutSize >= BodyPartSlashLogicOnCutSize && CanBleedExternally) { StartCoroutine(ExternalBleedingLogic()); } }