Пример #1
0
 public void Clean()
 {
     PreviousBodyPart     = RelatedBodyPart;
     RelatedBodyPart      = null;
     CurrentStep          = 0;
     SurgeryProcedureBase = null;
 }
Пример #2
0
 public void CancelSurgery()
 {
     RelatedBodyPart          = PreviousBodyPart;
     ISon.currentlyOn         = RelatedBodyPart?.gameObject;
     CurrentStep              = 0;
     SurgeryProcedureBase     = null;
     ISon.ProcedureInProgress = false;
 }
Пример #3
0
            public void SetupProcedure(Dissectible Dissectible, BodyPart bodyPart,
                                       SurgeryProcedureBase inSurgeryProcedureBase)
            {
                Clean();
                if (ISon != Dissectible)
                {
                    PreviousBodyPart = null;
                }

                ISon = Dissectible;
                ISon.ProcedureInProgress = true;
                RelatedBodyPart          = bodyPart;
                SurgeryProcedureBase     = inSurgeryProcedureBase;
            }
Пример #4
0
        public void ServerCheck(SurgeryProcedureBase SurgeryProcedureBase, BodyPart ONBodyPart)
        {
            if (ProcedureInProgress)
            {
                return;                 //Defer to server
            }
            if (BodyPartIsOn != null)
            {
                if (BodyPartIsopen)
                {
                    foreach (var organBodyPart in BodyPartIsOn.ContainBodyParts)
                    {
                        if (organBodyPart == ONBodyPart)
                        {
                            foreach (var Procedure in organBodyPart.SurgeryProcedureBase)
                            {
                                if (Procedure is CloseProcedure || Procedure is ImplantProcedure)
                                {
                                    continue;
                                }
                                if (SurgeryProcedureBase == Procedure)
                                {
                                    this.currentlyOn = organBodyPart.gameObject;
                                    this.ThisPresentProcedure.SetupProcedure(this, organBodyPart, Procedure);
                                    return;
                                }
                            }

                            return;
                        }
                    }

                    if (currentlyOn == ONBodyPart.gameObject)
                    {
                        foreach (var Procedure in BodyPartIsOn.SurgeryProcedureBase)
                        {
                            if (Procedure is CloseProcedure || Procedure is ImplantProcedure)
                            {
                                if (SurgeryProcedureBase == Procedure)
                                {
                                    this.currentlyOn = currentlyOn;
                                    this.ThisPresentProcedure.SetupProcedure(this, BodyPartIsOn, Procedure);
                                    return;
                                }
                            }
                        }

                        return;
                    }
                }
                else
                {
                    if (ONBodyPart.gameObject == currentlyOn)
                    {
                        foreach (var Procedure in BodyPartIsOn.SurgeryProcedureBase)
                        {
                            if (Procedure is CloseProcedure || Procedure is ImplantProcedure)
                            {
                                continue;
                            }
                            if (SurgeryProcedureBase == Procedure)
                            {
                                this.currentlyOn = currentlyOn;
                                this.ThisPresentProcedure.SetupProcedure(this, BodyPartIsOn, Procedure);
                                return;
                            }
                        }

                        return;
                    }
                }
            }
            else
            {
                foreach (var bodyPart in LivingHealthMasterBase.BodyPartList)
                {
                    if (bodyPart == ONBodyPart)
                    {
                        foreach (var Procedure in bodyPart.SurgeryProcedureBase)
                        {
                            if (Procedure is CloseProcedure || Procedure is ImplantProcedure)
                            {
                                continue;
                            }
                            if (SurgeryProcedureBase == Procedure)
                            {
                                this.currentlyOn = bodyPart.gameObject;
                                this.ThisPresentProcedure.SetupProcedure(this, bodyPart, Procedure);
                                return;
                            }
                        }
                    }
                }

                if (LivingHealthMasterBase.GetComponent <PlayerSprites>().RaceBodyparts.Base.RootImplantProcedure ==
                    SurgeryProcedureBase)
                {
                    this.currentlyOn = LivingHealthMasterBase.gameObject;
                    this.ThisPresentProcedure.SetupProcedure(this, null, SurgeryProcedureBase);
                }
            }
        }
Пример #5
0
        public void ServerCheck(SurgeryProcedureBase SurgeryProcedureBase, BodyPart ONBodyPart)
        {
            if (ProcedureInProgress == false)             //Defer to server
            {
                if (BodyPartIsOn != null)
                {
                    if (BodyPartIsopen)
                    {
                        foreach (var inBodyPart in BodyPartIsOn.ContainBodyParts)
                        {
                            if (inBodyPart == ONBodyPart)
                            {
                                foreach (var Procedure in inBodyPart.SurgeryProcedureBase)
                                {
                                    if (Procedure is CloseProcedure || Procedure is ImplantProcedure)
                                    {
                                        continue;
                                    }
                                    if (SurgeryProcedureBase == Procedure)
                                    {
                                        this.currentlyOn = inBodyPart.gameObject;
                                        this.ThisPresentProcedure.SetupProcedure(this, inBodyPart, Procedure);
                                        return;
                                    }
                                }

                                return;
                            }
                        }

                        if (currentlyOn == ONBodyPart.gameObject)
                        {
                            foreach (var Procedure in BodyPartIsOn.SurgeryProcedureBase)
                            {
                                if (Procedure is CloseProcedure || Procedure is ImplantProcedure)
                                {
                                    if (SurgeryProcedureBase == Procedure)
                                    {
                                        this.currentlyOn = currentlyOn;
                                        this.ThisPresentProcedure.SetupProcedure(this, BodyPartIsOn, Procedure);
                                        return;
                                    }
                                }
                            }

                            return;
                        }
                    }
                    else
                    {
                        if (ONBodyPart.gameObject == currentlyOn)
                        {
                            foreach (var Procedure in BodyPartIsOn.SurgeryProcedureBase)
                            {
                                if (Procedure is CloseProcedure || Procedure is ImplantProcedure)
                                {
                                    continue;
                                }
                                if (SurgeryProcedureBase == Procedure)
                                {
                                    this.currentlyOn = currentlyOn;
                                    this.ThisPresentProcedure.SetupProcedure(this, BodyPartIsOn, Procedure);
                                    return;
                                }
                            }

                            return;
                        }
                    }
                }
                else
                {
                    foreach (var RouteBody in LivingHealthMasterBase.RootBodyPartContainers)
                    {
                        foreach (var Limb in RouteBody.ContainsLimbs)
                        {
                            if (Limb == ONBodyPart)
                            {
                                foreach (var Procedure in Limb.SurgeryProcedureBase)
                                {
                                    if (Procedure is CloseProcedure || Procedure is ImplantProcedure)
                                    {
                                        continue;
                                    }
                                    if (SurgeryProcedureBase == Procedure)
                                    {
                                        this.currentlyOn = Limb.gameObject;
                                        this.ThisPresentProcedure.SetupProcedure(this, Limb, Procedure);
                                        return;
                                    }
                                }
                            }
                        }
                    }

                    if (LivingHealthMasterBase.GetComponent <PlayerSprites>().RaceBodyparts.Base.RootImplantProcedure ==
                        SurgeryProcedureBase)
                    {
                        this.currentlyOn = LivingHealthMasterBase.gameObject;
                        this.ThisPresentProcedure.SetupProcedure(this, null, SurgeryProcedureBase);
                    }
                }
            }
        }