void checkOverallDamage() { if (bloodSystem.OxygenDamage > 200) { if (!livingHealthBehaviour.IsDead) { livingHealthBehaviour.Death(); } } }
/// <summary> /// Determine Brain Damage from Oxygen Loss /// (25% brain damage for each minute of starvation after the 2 minute mark) /// </summary> void CheckOxygenLossDamage() { noOxygenTime += Time.deltaTime; //If player starts breathing again stop calculating oxygen loss: if (!respiratorySystem.IsSuffocating && bloodSystem.OxygenLevel >= 5) { countOxygenLoss = false; return; } if (noOxygenTime > 120f && noOxygenTime <= 180f && BrainDamageAmt < 25) { if (brain != null) { brain.BrainDamage = 25; } } if (noOxygenTime > 180f && noOxygenTime <= 240f && BrainDamageAmt < 50) { if (brain != null) { brain.BrainDamage = 50; } } if (noOxygenTime > 240f && noOxygenTime <= 300f && BrainDamageAmt < 75) { if (brain != null) { brain.BrainDamage = 75; } } if (noOxygenTime > 300f && noOxygenTime <= 360f && BrainDamageAmt < 100) { if (brain != null) { brain.BrainDamage = 100; //Player cannot survive full brain damage amounts if (!livingHealthBehaviour.IsDead) { livingHealthBehaviour.Death(); countOxygenLoss = false; } } } }