public void Explode() { if (!hasDetonated) { hasDetonated = true; if (!(parentBodyPart == null)) { FindObjectOfType <TextLog>().NewLogEntry($"A bomb just exploded, taking the {parentBodyPart.name} with it!"); parentBodyPart.SeverAllConnections(30); //I can't shake the feeling that invoking surgery to do this is not going to end particulary well //but, it has all the setup and cleanup required to make it work Actions_Surgery.DeleteBodyPartProcess(parentBodyPart); Destroy(this); } FindObjectOfType <TextLog>().NewLogEntry("A bomb just exploded!"); ButtonActions buttonActions = FindObjectOfType <ButtonActions>(); if (buttonActions.selectedGameObject == this.gameObject) { FindObjectOfType <ButtonActions>().selectedGameObject = null; } FindObjectOfType <BodyPartSelectorManager>().ResetSelectors(); FindObjectOfType <EmbeddedObjectSelectorManager>().ResetSelectors(); Destroy(this); } }
private bool RemoveOrganMedium() { Organ organ = RandomOrgan(); // int n = 0; // bool x = false; // //x = x || (organ is Heart && !unlockTracker.charms_heart); // //x = x || (organ is Lung && !unlockTracker.charms_lung); // //x = x || (organ is Brain && !unlockTracker.charms_lung && !unlockTracker.charms_heart); // while (x && n < 5) // { // organ = RandomOrgan(); // x = false; // //x = x || (organ is Heart && !unlockTracker.charms_heart); // //x = x || (organ is Lung && !unlockTracker.charms_lung); // //x = x || (organ is Brain && !unlockTracker.charms_lung && !unlockTracker.charms_heart); // n += 1; // } // if (n > 5) // { // return false; // } if (organ.connectedBodyParts.Count() > 0 && !(organ is Brain)) { Debug.Log($"{organ.name} external"); textLog.NewLogEntry($"The {organ.name} requires re-implanting."); Actions_Surgery.RemoveOrganProcess(organ); return(true); } return(false); }
private bool RemoveOrganHard() { Organ organ = RandomOrgan(); if (organ.connectedBodyParts.Count() > 0) { Debug.Log($"{organ.name} external"); textLog.NewLogEntry($"The {organ.name} requires re-implanting."); Actions_Surgery.RemoveOrganProcess(organ); return(true); } return(false); }
private bool MissingOrganHard() { Organ organ = RandomOrgan(); if (organ.connectedBodyParts.Count() > 0 && organ.gameObject.GetComponent <PetrificationCharm>() is null) { Debug.Log($"{organ.name} missing"); textLog.NewLogEntry($"The {organ.name} is missing?!"); Actions_Surgery.RemoveOrganProcess(organ); Actions_Surgery.DeleteBodyPartProcess(organ); return(true); } return(false); }
private bool MissingOrganMedium() { Organ organ = RandomOrgan(); if (!(organ is Brain) & !(organ.gameObject.GetComponent <PetrificationCharm>() is null)) { Debug.Log($"{organ.name} missing"); textLog.NewLogEntry($"The {organ.name} is missing?!"); Actions_Surgery.RemoveOrganProcess(organ); Actions_Surgery.DeleteBodyPartProcess(organ); return(true); } return(false); }
private bool SeverLimbMedium() { BodyPart limb = RandomLimb(); if (!(limb is Head) && !(limb.connectedBodyParts.Count() == 0)) { Debug.Log($"Severed {limb.name}"); textLog.NewLogEntry($"The {limb.name} has been severed from all limbs."); limb.damage += 50; foreach (BodyPart connectedBodyPart in limb.connectedBodyParts) { connectedBodyPart.bloodLossRate += 20.0f; } Actions_Surgery.RemoveBodyPartProcess(limb); limb.bloodLossRate += 20.0f; return(true); } return(false); }
private bool SeverHead() { BodyPart head = FindObjectOfType <Head>(); if (head.connectedBodyParts.Count() == 0) { return(false); } Debug.Log($"Severed {head.name}"); textLog.NewLogEntry($"The {head.name} has been severed from all limbs."); head.damage += 50; foreach (BodyPart connectedBodyPart in head.connectedBodyParts) { connectedBodyPart.bloodLossRate += 20.0f; } Actions_Surgery.RemoveBodyPartProcess(head); head.bloodLossRate += 20.0f; return(true); }
private bool SeverTorso() { BodyPart torso = FindObjectOfType <Torso>(); if (torso.connectedBodyParts.Count() == 0) { return(false); } Debug.Log($"Severed {torso.name}"); textLog.NewLogEntry($"The {torso.name} has been severed from all limbs."); torso.damage += 50; foreach (BodyPart connectedBodyPart in torso.connectedBodyParts) { connectedBodyPart.bloodLossRate += 20.0f; } Actions_Surgery.RemoveBodyPartProcess(torso); torso.bloodLossRate += 20.0f; return(true); }