/// Add any missing systems:
    private void InitSystems()
    {
        registerTile = GetComponent <RegisterTile>();
        //Always include blood for living entities:
        bloodSystem = GetComponent <BloodSystem>();
        if (bloodSystem == null)
        {
            bloodSystem = gameObject.AddComponent <BloodSystem>();
        }

        //Always include respiratory for living entities:
        respiratorySystem = GetComponent <RespiratorySystem>();
        if (respiratorySystem == null)
        {
            respiratorySystem = gameObject.AddComponent <RespiratorySystem>();
        }

        var tryGetHead = FindBodyPart(BodyPartType.Head);

        if (tryGetHead != null && brainSystem == null)
        {
            if (tryGetHead.Type != BodyPartType.Chest)
            {
                //Head exists, install a brain system
                brainSystem = gameObject.AddComponent <BrainSystem>();
            }
        }
    }
Example #2
0
 void Awake()
 {
     bloodSystem           = GetComponent <BloodSystem>();
     livingHealthBehaviour = GetComponent <LivingHealthBehaviour>();
     playerScript          = GetComponent <PlayerScript>();
     equipment             = GetComponent <Equipment>();
 }
 void Awake()
 {
     bloodSystem           = GetComponent <BloodSystem>();
     livingHealthBehaviour = GetComponent <LivingHealthBehaviour>();
     playerScript          = GetComponent <PlayerScript>();
     registerTile          = GetComponent <RegisterTile>();
     equipment             = GetComponent <Equipment>();
     objectBehaviour       = GetComponent <ObjectBehaviour>();
 }
Example #4
0
    void InitSystem()
    {
        playerScript          = GetComponent <PlayerScript>();
        bloodSystem           = GetComponent <BloodSystem>();
        respiratorySystem     = GetComponent <RespiratorySystem>();
        livingHealthBehaviour = GetComponent <LivingHealthBehaviour>();

        //Server only
        if (CustomNetworkManager.Instance._isServer)
        {
            //Spawn a brain and connect the brain to this living entity
            brain = new Brain();
            brain.ConnectBrainToBody(gameObject);
            if (playerScript != null)
            {
                //TODO: See https://github.com/unitystation/unitystation/issues/1429
            }
            init = true;
        }
    }
Example #5
0
 void Awake()
 {
     bloodSystem = GetComponent <BloodSystem>();
     playerMove  = GetComponent <PlayerMove>();
 }
Example #6
0
 public Physical(Anthropometrics metrics = null, Head head = null, Chest chest = null, Abdomen abdomen = null, BloodSystem blood = null, Limbs limbs = null, Infections infections = null, VascularSystem vascularSystem = null)
 {
     _anthropometrics = metrics ?? new Anthropometrics();
     Head             = head ?? new Head();
     Chest            = chest ?? new Chest();
     Abdomen          = abdomen ?? new Abdomen();
     Blood            = blood ?? new BloodSystem();
     Limbs            = limbs ?? new Limbs();
     Infections       = infections ?? new Infections();
     VascularSystem   = vascularSystem ?? new VascularSystem();
 }
Example #7
0
    protected virtual void Start()
    {
        instance = this;

        PreSpawnAllBloods();
    }
Example #8
0
        static void Main(string[] args)
        {
            PatientPod Pod = new PatientPod();

            #region SetupPatient
            Blood bs = new Blood(new BloodType()
            {
                ABO = BloodABO.AB, Rhesus = BloodRhesus.Positive
            });
            BloodSystem     blood   = new BloodSystem(bs);
            Abdomen         abs     = new Abdomen(reproductives: new Reproductive_Male());
            Anthropometrics metrics = new Anthropometrics(21, 181, 120);
            Physical        body    = new Physical(blood: blood, abdomen: abs);
            Patient         pt      = new Patient(body: body);
            #endregion //This sucks
            Pod.TryAddPatient(pt);


            pt.Body.VascularSystem.OxygenatedVessels["LeftCoronary"].Patency = 0.25f;

            Pod.PerformProceedure(new ExamineHeartCoronaryAngiogram(), out bool _);


            //VascularSystem vs = new VascularSystem();

            //vs.OxygenatedVessels["AscendingAorta"].Patency = 0.35f;
            //vs.OxygenatedVessels["LeftCoronary"].Patency = 0.25f;

            //System.Console.WriteLine(vs.GetSupply(new  Heart()));
            //Vessel restrictionPoint = vs.OxygenatedVessels["LeftAnteriorDescending"].GetLowestPatencyVessel();
            //System.Console.WriteLine($"{restrictionPoint.Name}: {restrictionPoint.Patency}");

            //Console.WriteLine(pt.Body.Anthropometrics.BMI);
            //LeftLung left = new LeftLung();
            //RightLung right = new RightLung();

            //RespiratorySystem respiratorySystem = new RespiratorySystem(left, right);

            ////respiratorySystem.RemoveLung(true, out Lung temp);
            ////respiratorySystem.InsertLung(left);

            //PatientExamination exam = new ExamineLungsAuscultateLungs();
            //Pod.PerformProceedure(exam, out bool _);

            //exam = new ExamineLungsPrecussLungs();
            //Pod.PerformProceedure(exam, out bool _);


            //var t = pt.Body.Infections.Chest.GetInfections();

            //System.Console.WriteLine(Pod.PatientResults.RespiratorySystem.LeftLung.BreathSounds[LungLobeLocation.Upper]);
            //System.Console.WriteLine(Pod.TotalWasteProduced);
            //PatientProceedure intervention = new PerformLumbarPuncture();
            //Pod.PerformProceedure(intervention, out bool _);
            //System.Console.WriteLine(Pod.TotalWasteProduced);


            //Lung test = new RightLung();
            //test.Lobes[LungLobeLocation.Upper]._organHealth = 0.045f;
            //test.Lobes[LungLobeLocation.Lower]._organHealth = 0.065f;
            //OrganState t = test.OrganState;

            //System.Console.WriteLine(    test.OxygenRequirement);

            System.Console.WriteLine("FOR DEBUGGING");
        }