public override void FinalizeDesignationSucceeded()
        {
            base.FinalizeDesignationSucceeded();


            CompSurrogateOwner cso = controller.ATCompSurrogateOwner;

            if (cso != null)
            {
                if (kindOfTarget == 1)
                {
                    cso.controlMode = true;
                    cso.setControlledSurrogate((Pawn)target);
                }
                else if (kindOfTarget == 2)
                {
                    if (cso.skyCloudHost != null)
                    {
                        CompSkyCloudCore csc = cso.skyCloudHost.TryGetComp <CompSkyCloudCore>();
                        if (csc != null)
                        {
                            csc.setRemotelyControlledTurret(controller, (Building)target);
                        }
                    }
                }
            }

            if (!controller.VX3ChipPresent())
            {
                Find.DesignatorManager.Deselect();
            }
        }
        public override string CompInspectStringExtra()
        {
            string   ret   = "";
            Building build = (Building)parent;

            if (parent.Map == null)
            {
                return(base.CompInspectStringExtra());
            }

            ret += getName() + "\n";
            ret += "ATPP_CentralCoreNbStoredMind".Translate(storedMinds.Count) + "\n";
            ret += "ATPP_CentralCoreNbAssistingMinds".Translate(assistingMinds.Count) + "\n";

            if (build.TryGetComp <CompPowerTrader>().PowerOn)
            {
                if (!Booted())
                {
                    ret += "ATPP_SkyCloudCoreBooting".Translate((int)(Math.Max(0, bootGT - Find.TickManager.TicksGame)).TicksToSeconds());
                }
                else
                {
                    //Check migration en cours de mind
                    foreach (var m in storedMinds)
                    {
                        CompSurrogateOwner cso = m.ATCompSurrogateOwner;

                        if (cso == null)
                        {
                            continue;
                        }

                        if (cso.replicationEndingGT != -1)
                        {
                            float p = Math.Min(1.0f, (float)(Find.TickManager.TicksGame - cso.replicationStartGT) / (float)(cso.replicationEndingGT - cso.replicationStartGT));

                            ret += "=>" + ("ATPP_CentralCoreReplicationInProgress".Translate(m.LabelShortCap, ((int)(p * (float)100)).ToString())) + "\n";
                        }
                        //ATPP_CentralCoreReplicationInProgress

                        else if (cso.migrationEndingGT != -1 && cso.migrationSkyCloudHostDest != null)
                        {
                            CompSkyCloudCore csc2 = cso.migrationSkyCloudHostDest.TryGetComp <CompSkyCloudCore>();
                            float            p    = Math.Min(1.0f, (float)(Find.TickManager.TicksGame - cso.migrationStartGT) / (float)(cso.migrationEndingGT - cso.migrationStartGT));

                            ret += "=>" + ("ATPP_CentralCoreMigrationInProgress".Translate(m.LabelShortCap, csc2.getName(), ((int)(p * (float)100)).ToString())) + "\n";
                        }

                        else if (inMentalBreak.ContainsKey(m))
                        {
                            ret += "=>" + "ATPP_CentralCoreProcessInMentalBreak".Translate(m.LabelShortCap) + "\n";
                        }
                    }
                }
            }

            return(ret.TrimEnd('\r', '\n') + base.CompInspectStringExtra());
        }
 private void disconnectConnectedMind()
 {
     if (controller != null)
     {
         CompSurrogateOwner cso = controller.ATCompSurrogateOwner;
         if (cso != null)
         {
             if (cso.skyCloudHost != null)
             {
                 CompSkyCloudCore csc = cso.skyCloudHost.TryGetComp <CompSkyCloudCore>();
                 if (csc != null)
                 {
                     csc.stopRemotelyControlledTurret(controller);
                 }
             }
         }
     }
 }
            public static void Listener(MentalStateDef stateDef, string reason, bool forceWake, bool causedByMood, Pawn otherPawn, bool transitionSilently, Pawn ___pawn, MentalStateHandler __instance, ref bool __result)
            {
                if (__result && ___pawn.IsSurrogateAndroid())
                {
                    CompAndroidState cas = ___pawn.ATCompState;

                    if (cas == null || cas.surrogateController == null)
                        return;

                    CompSurrogateOwner cso = cas.surrogateController.ATCompSurrogateOwner;
                    if(cso.skyCloudHost != null)
                    {
                        CompSkyCloudCore csc = cso.skyCloudHost.TryGetComp<CompSkyCloudCore>();
                        if (csc == null)
                            return;


                        //Ajout a une liste de minds boudant avec timeout
                        csc.setMentalBreak(cas.surrogateController);
                    }
                }
            }