Ejemplo n.º 1
0
    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);
        }
    }
Ejemplo n.º 2
0
    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);
    }
Ejemplo n.º 3
0
    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);
    }