private bool ClockworkHeartReplacement() { if ((!unlockTracker.spawn && !unlockTracker.spawn_clock) || (!unlockTracker.charms_heart) || ClockworkHeartRequest) { return(false); } Debug.Log("Hearts require replacing with clockwork"); textLog.NewLogEntry("The patient requests that their heart(s) be clockwork, not biological."); ClockworkHeartRequest = true; return(true); }
//assorted physical injury methods private bool StabOrgan() { Organ organ = RandomOrgan(); Debug.Log($"Stabbed {organ.name}"); textLog.NewLogEntry($"The {organ.name} has been stabbed."); organ.damage = Mathf.Clamp(organ.damage + 30, 0, organ.damageMax); organ.bloodLossRate += 10; if (organ.connectedBodyParts.Count() > 0) { organ.connectedBodyParts[0].damage = Mathf.Clamp(organ.connectedBodyParts[0].damage + 30, 0, organ.connectedBodyParts[0].damageMax); organ.connectedBodyParts[0].bloodLossRate += 10; } return(true); }
private IEnumerator VictoryCheckCoroutine() { textLog.NewLogEntry("Checking patient condition:"); bool victory = true; //check the vital statistics of every bodypart in the body if (VitalsCheck()) { victory = false; } //checking for an appropriate number of organs / bodyparts if (BodyPartCountCheck()) { victory = false; } //checking amounts of various drugs in the body if (DrugCheck()) { victory = false; } //currently, all charms are set to expire after 30 minutes anyway, but best to check just in case: if (CharmCheck()) { victory = false; } //check if there are any embedded objects in bodyparts //(later, we'll probably want specific embedded objects to be acceptable) if (EmbeddedObjectCheck()) { victory = false; } hasPlayerWon = victory; if (victory) { FindObjectOfType <GoldTracker>().goldAccumulated += FindObjectOfType <GameSetupScenarioTracker>().goldReward; textLog.NewLogEntry($"Congratulations, they'll live! Your payment is {FindObjectOfType<GameSetupScenarioTracker>().goldReward} gold. Transfer in 5 seconds..."); } else { textLog.NewLogEntry("Insufficient patient treatment. No payment for you. Transfer in 5 seconds..."); FindObjectOfType <GameSetupScenarioTracker>().unhappyPatients += 1; } FindObjectOfType <ButtonActions>().DisableAllButtons(); yield return(new WaitForSeconds(5 * Time.timeScale)); FindObjectOfType <SceneTransitionManager>().UnlockScreen(); }