public static void Listener(Pawn __instance, ref IEnumerable <Gizmo> __result)
            {
                try
                {
                    CompSkyMind csm = __instance.TryGetComp <CompSkyMind>();

                    //Si prisonnier et possede une VX2 on va obtenir les GIZMOS associés OU virusé
                    if (__instance.IsPrisoner || (csm != null && csm.Hacked == 1))
                    {
                        IEnumerable <Gizmo> tmp;
                        //Si posseseur d'une VX2

                        if (__instance.VXChipPresent())
                        {
                            CompSurrogateOwner cso = __instance.TryGetComp <CompSurrogateOwner>();
                            if (cso != null)
                            {
                                tmp = cso.CompGetGizmosExtra();
                                if (tmp != null)
                                {
                                    __result = __result.Concat(tmp);
                                }
                            }
                        }

                        //Si android prisonier ou virusé
                        if (__instance.IsAndroidTier())
                        {
                            CompAndroidState cas = __instance.TryGetComp <CompAndroidState>();

                            if (cas != null)
                            {
                                tmp = cas.CompGetGizmosExtra();
                                if (tmp != null)
                                {
                                    __result = __result.Concat(tmp);
                                }
                            }
                        }

                        if (csm != null && csm.Hacked == -1)
                        {
                            tmp = csm.CompGetGizmosExtra();
                            if (tmp != null)
                            {
                                __result = __result.Concat(tmp);
                            }
                        }
                    }

                    //Si animal posséder par player
                    if (__instance.IsPoweredAnimalAndroids())
                    {
                        CompAndroidState cas = null;
                        cas = __instance.TryGetComp <CompAndroidState>();
                        if (cas != null)
                        {
                            IEnumerable <Gizmo> tmp = cas.CompGetGizmosExtra();
                            if (tmp != null)
                            {
                                __result = __result.Concat(tmp);
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    Log.Message("[ATPP] Pawn.GetGizmos " + e.Message + " " + e.StackTrace);
                }
            }
Пример #2
0
            public static void Listener(Pawn __instance, ref IEnumerable <Gizmo> __result)
            {
                try
                {
                    var csm = __instance.TryGetComp <CompSkyMind>();


                    if (__instance.IsPrisoner || csm != null && csm.Hacked == 1)
                    {
                        IEnumerable <Gizmo> tmp;


                        if (__instance.VXChipPresent())
                        {
                            var cso = __instance.TryGetComp <CompSurrogateOwner>();
                            if (cso != null)
                            {
                                tmp = cso.CompGetGizmosExtra();
                                if (tmp != null)
                                {
                                    __result = __result.Concat(tmp);
                                }
                            }
                        }


                        if (__instance.IsAndroidTier())
                        {
                            var cas = __instance.TryGetComp <CompAndroidState>();

                            if (cas != null)
                            {
                                tmp = cas.CompGetGizmosExtra();
                                if (tmp != null)
                                {
                                    __result = __result.Concat(tmp);
                                }
                            }
                        }

                        if (csm != null && csm.Hacked == -1)
                        {
                            tmp = csm.CompGetGizmosExtra();
                            if (tmp != null)
                            {
                                __result = __result.Concat(tmp);
                            }
                        }
                    }


                    if (!__instance.IsPoweredAnimalAndroids())
                    {
                        return;
                    }

                    {
                        CompAndroidState cas = null;
                        cas = __instance.TryGetComp <CompAndroidState>();
                        if (cas == null)
                        {
                            return;
                        }

                        var tmp = cas.CompGetGizmosExtra();
                        if (tmp != null)
                        {
                            __result = __result.Concat(tmp);
                        }
                    }
                }
                catch (Exception e)
                {
                    Log.Message("[ATPP] Pawn.GetGizmos " + e.Message + " " + e.StackTrace);
                }
            }