// Token: 0x06001B4E RID: 6990 RVA: 0x0007F918 File Offset: 0x0007DB18
        public static Texture GetSurvivorPortrait(SurvivorIndex survivorIndex)
        {
            SurvivorDef survivorDef = SurvivorCatalog.GetSurvivorDef(survivorIndex);

            if (survivorDef.bodyPrefab != null)
            {
                CharacterBody component = survivorDef.bodyPrefab.GetComponent <CharacterBody>();
                if (component)
                {
                    return(component.portraitIcon);
                }
            }
            return(null);
        }
예제 #2
0
        private static void RegisterMage()
        {
            var bodyPrefab   = BodyCatalog.FindBodyPrefab("MageBody");
            var skillLocator = bodyPrefab.GetComponent <SkillLocator>();

            var passiveSkill = skillLocator.passiveSkill;

            passiveSkill.skillNameToken        = "Arcane Affinity";
            passiveSkill.skillDescriptionToken = "Absorb energy from all current items. Gaining <style=cIsUtility>1-3% bonus damage</style> per item, depending on its tier.";
            passiveSkill.enabled      = true;
            passiveSkill.icon         = passiveSkill.icon;
            skillLocator.passiveSkill = passiveSkill;

            SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Mage, new SurvivorDef
            {
                bodyPrefab       = bodyPrefab,
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/MageDisplay"),
                descriptionToken = "MAGE_DESCRIPTION",
                primaryColor     = new Color(0.968627453f, 0.75686276f, 0.992156863f),
                unlockableName   = "Characters.Mage"
            });
        }
예제 #3
0
        private static void Init()
        {
            SurvivorCatalog.idealSurvivorOrder = new[]
            {
                SurvivorIndex.Commando,
                SurvivorIndex.Toolbot,
                SurvivorIndex.Huntress,
                SurvivorIndex.Engineer,
                SurvivorIndex.Mage,
                SurvivorIndex.Merc,
                SurvivorIndex.Bandit
            };

            SurvivorCatalog.survivorMaxCount = SurvivorCatalog.idealSurvivorOrder.Length;

            SurvivorCatalog.survivorDefs = new SurvivorDef[SurvivorCatalog.survivorMaxCount];

            Debug.LogFormat("[Debug] Defined Survivor Array with {0} survivor slots and max survivor count of {1}",
                            SurvivorCatalog.survivorDefs.Length, SurvivorCatalog.survivorMaxCount);

            SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Commando, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("CommandoBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/CommandoDisplay"),
                descriptionToken = "COMMANDO_DESCRIPTION",
                primaryColor     = new Color(0.929411769f, 0.5882353f, 0.07058824f)
            });

            SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Huntress, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("HuntressBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/HuntressDisplay"),
                primaryColor     = new Color(0.8352941f, 0.235294119f, 0.235294119f),
                descriptionToken = "HUNTRESS_DESCRIPTION",
                unlockableName   = "Characters.Huntress"
            });

            SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Toolbot, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("ToolbotBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/ToolbotDisplay"),
                descriptionToken = "TOOLBOT_DESCRIPTION",
                primaryColor     = new Color(0.827451f, 0.768627465f, 0.3137255f),
                unlockableName   = "Characters.Toolbot"
            });

            SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Engineer, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("EngiBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/EngiDisplay"),
                descriptionToken = "ENGI_DESCRIPTION",
                primaryColor     = new Color(0.372549027f, 0.8862745f, 0.5254902f),
                unlockableName   = "Characters.Engineer"
            });

            RegisterMage();

            SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Merc, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("MercBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/MercDisplay"),
                descriptionToken = "MERC_DESCRIPTION",
                primaryColor     = new Color(0.423529416f, 0.819607854f, 0.917647064f),
                unlockableName   = "Characters.Mercenary"
            });

            RegisterBandit();

            for (var survivorIndex = 0; survivorIndex < SurvivorCatalog.survivorDefs.Length; survivorIndex++)
            {
                Debug.LogFormat("[Debug] Survivor index {0}: {1}", survivorIndex,
                                SurvivorCatalog.survivorDefs.ElementAt(survivorIndex).bodyPrefab);
                if (SurvivorCatalog.survivorDefs[survivorIndex] == null)
                {
                    Debug.LogWarningFormat("Unregistered survivor {0}!", survivorIndex);
                }
            }

            SurvivorCatalog._allSurvivorDefs = (from v in SurvivorCatalog.survivorDefs
                                                where v != null
                                                select v).ToArray();

            var node = new ViewablesCatalog.Node("Survivors", true);

            using (var enumerator = SurvivorCatalog.allSurvivorDefs.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    var survivor = enumerator.Current;

                    if (survivor == null)
                    {
                        continue;
                    }

                    Debug.LogFormat("[DEBUG] Creating node for {0}.", survivor.displayNameToken);

                    var survivorEntryNode =
                        new ViewablesCatalog.Node(survivor.displayNameToken, false, node);

                    survivorEntryNode.shouldShowUnviewed = userProfile =>
                                                           !userProfile.HasViewedViewable(survivorEntryNode.fullName) &&
                                                           userProfile.HasSurvivorUnlocked(survivor.survivorIndex) &&
                                                           !string.IsNullOrEmpty(survivor.unlockableName);

                    Debug.LogFormat("[DEBUG] Created node {0}", survivorEntryNode.name);
                }
            }

            ViewablesCatalog.AddNodeToRoot(node);
        }
예제 #4
0
        private static void Init()
        {
            SurvivorCatalog.idealSurvivorOrder = ModLoader.BuildIdealOrder(SurvivorCatalog.idealSurvivorOrder);
            if (ModLoader.SurvivorCount > SurvivorCatalog.survivorMaxCount)
            {
                SurvivorCatalog.survivorMaxCount = ModLoader.SurvivorCount;
            }
            SurvivorCatalog.survivorDefs = new SurvivorDef[ModLoader.SurvivorCount];
            Debug.LogFormat("[Debug] Defined Survivor Array with {0} survivor slots and max survivor count of {1}",
                            new object[]
                            { SurvivorCatalog.survivorDefs.Length, SurvivorCatalog.survivorMaxCount });
            SurvivorCatalog.RegisterSurvivor((SurvivorIndex)0, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("CommandoBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/CommandoDisplay"),
                descriptionToken = "COMMANDO_DESCRIPTION",
                primaryColor     = new Color(0.929411769f, 0.5882353f, 0.07058824f)
            });
            SurvivorCatalog.RegisterSurvivor((SurvivorIndex)1, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("HuntressBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/HuntressDisplay"),
                primaryColor     = new Color(0.8352941f, 0.235294119f, 0.235294119f),
                descriptionToken = "HUNTRESS_DESCRIPTION",
                unlockableName   = "Characters.Huntress"
            });
            SurvivorCatalog.RegisterSurvivor((SurvivorIndex)2, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("ToolbotBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/ToolbotDisplay"),
                descriptionToken = "TOOLBOT_DESCRIPTION",
                primaryColor     = new Color(0.827451f, 0.768627465f, 0.3137255f),
                unlockableName   = "Characters.Toolbot"
            });
            SurvivorCatalog.RegisterSurvivor((SurvivorIndex)3, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("EngiBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/EngiDisplay"),
                descriptionToken = "ENGI_DESCRIPTION",
                primaryColor     = new Color(0.372549027f, 0.8862745f, 0.5254902f),
                unlockableName   = "Characters.Engineer"
            });
            SurvivorCatalog.RegisterSurvivor((SurvivorIndex)4, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("MageBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/MageDisplay"),
                descriptionToken = "MAGE_DESCRIPTION",
                primaryColor     = new Color(0.968627453f, 0.75686276f, 0.992156863f),
                unlockableName   = "Characters.Mage"
            });
            SurvivorCatalog.RegisterSurvivor((SurvivorIndex)5, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("MercBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/MercDisplay"),
                descriptionToken = "MERC_DESCRIPTION",
                primaryColor     = new Color(0.423529416f, 0.819607854f, 0.917647064f),
                unlockableName   = "Characters.Mercenary"
            });

            ModLoader.AddSurvivors(ref SurvivorCatalog.survivorDefs);
            for (int survivorIndex = 0; survivorIndex < SurvivorCatalog.survivorDefs.Length; survivorIndex++)
            {
                Debug.LogFormat("[Debug] Survivor index {0}: {1}", new object[]
                {
                    survivorIndex,
                    SurvivorCatalog.survivorDefs.ElementAt(survivorIndex).bodyPrefab
                });
                if (SurvivorCatalog.survivorDefs[survivorIndex] == null)
                {
                    Debug.LogWarningFormat("Unregistered survivor {0}!", new object[]
                    {
                        survivorIndex
                    });
                }
            }
            SurvivorCatalog._allSurvivorDefs = (from v in SurvivorCatalog.survivorDefs
                                                where v != null
                                                select v).ToArray <SurvivorDef>();
            ViewablesCatalog.Node node = new ViewablesCatalog.Node("Survivors", true, null);
            using (IEnumerator <SurvivorDef> enumerator = SurvivorCatalog.allSurvivorDefs.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    SurvivorDef survivor = new SurvivorDef();
                    survivor = enumerator.Current;
                    Debug.LogFormat("[DEBUG] Creating node for {0}.", new object[] { survivor.displayNameToken });
                    ViewablesCatalog.Node survivorEntryNode = new ViewablesCatalog.Node(survivor.displayNameToken, false, node);
                    survivorEntryNode.shouldShowUnviewed = ((UserProfile userProfile) => !userProfile.HasViewedViewable(survivorEntryNode.fullName) && userProfile.HasSurvivorUnlocked(survivor.survivorIndex) && !string.IsNullOrEmpty(survivor.unlockableName));
                    Debug.LogFormat("[DEBUG] Created node {0}", new object[] { survivorEntryNode.name });
                }
            }
            ViewablesCatalog.AddNodeToRoot(node);
        }
예제 #5
0
        // Token: 0x060015BE RID: 5566 RVA: 0x0005CA4C File Offset: 0x0005AC4C
        protected void ClientSubmitLeaderboardScore(RunReport runReport)
        {
            if (runReport.gameResultType != GameResultType.Won)
            {
                return;
            }
            bool flag = false;

            using (IEnumerator <NetworkUser> enumerator = NetworkUser.readOnlyLocalPlayersList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    if (enumerator.Current.isParticipating)
                    {
                        flag = true;
                        break;
                    }
                }
            }
            if (!flag)
            {
                return;
            }
            int num = PlayerCharacterMasterController.instances.Count;

            if (num <= 0)
            {
                return;
            }
            if (num >= 3)
            {
                if (num > 4)
                {
                    return;
                }
                num = 4;
            }
            string text = WeeklyRun.GetLeaderboardName(num, this.serverSeedCycle);

            if (string.IsNullOrEmpty(text))
            {
                return;
            }
            int[]      subScores  = new int[64];
            GameObject bodyPrefab = BodyCatalog.GetBodyPrefab(NetworkUser.readOnlyLocalPlayersList[0].bodyIndexPreference);

            if (!bodyPrefab)
            {
                return;
            }
            SurvivorDef survivorDef = SurvivorCatalog.FindSurvivorDefFromBody(bodyPrefab);

            if (survivorDef == null)
            {
                return;
            }
            subScores[1] = (int)survivorDef.survivorIndex;
            Leaderboard leaderboard = Client.Instance.GetLeaderboard(text, Client.LeaderboardSortMethod.Ascending, Client.LeaderboardDisplayType.TimeMilliSeconds);

            leaderboard.OnBoardInformation = delegate()
            {
                leaderboard.AddScore(true, (int)Math.Ceiling((double)runReport.runStopwatchValue * 1000.0), subScores);
            };
        }
예제 #6
0
 private static void Init()
 {
     SurvivorCatalog.survivorDefs = new SurvivorDef[BaseFramework.SurvivorCount];
     SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Commando, new SurvivorDef
     {
         bodyPrefab       = BodyCatalog.FindBodyPrefab("CommandoBody"),
         displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/CommandoDisplay"),
         descriptionToken = "COMMANDO_DESCRIPTION",
         primaryColor     = new Color(0.929411769f, 0.5882353f, 0.07058824f)
     });
     SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Huntress, new SurvivorDef
     {
         bodyPrefab       = BodyCatalog.FindBodyPrefab("HuntressBody"),
         displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/HuntressDisplay"),
         primaryColor     = new Color(0.8352941f, 0.235294119f, 0.235294119f),
         descriptionToken = "HUNTRESS_DESCRIPTION",
         unlockableName   = "Characters.Huntress"
     });
     SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Toolbot, new SurvivorDef
     {
         bodyPrefab       = BodyCatalog.FindBodyPrefab("ToolbotBody"),
         displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/ToolbotDisplay"),
         descriptionToken = "TOOLBOT_DESCRIPTION",
         primaryColor     = new Color(0.827451f, 0.768627465f, 0.3137255f),
         unlockableName   = "Characters.Toolbot"
     });
     SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Engineer, new SurvivorDef
     {
         bodyPrefab       = BodyCatalog.FindBodyPrefab("EngiBody"),
         displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/EngiDisplay"),
         descriptionToken = "ENGI_DESCRIPTION",
         primaryColor     = new Color(0.372549027f, 0.8862745f, 0.5254902f),
         unlockableName   = "Characters.Engineer"
     });
     SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Mage, new SurvivorDef
     {
         bodyPrefab       = BodyCatalog.FindBodyPrefab("MageBody"),
         displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/MageDisplay"),
         descriptionToken = "MAGE_DESCRIPTION",
         primaryColor     = new Color(0.968627453f, 0.75686276f, 0.992156863f),
         unlockableName   = "Characters.Mage"
     });
     SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Merc, new SurvivorDef
     {
         bodyPrefab       = BodyCatalog.FindBodyPrefab("MercBody"),
         displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/MercDisplay"),
         descriptionToken = "MERC_DESCRIPTION",
         primaryColor     = new Color(0.423529416f, 0.819607854f, 0.917647064f),
         unlockableName   = "Characters.Mercenary"
     });
     BaseFramework.addSurvivors();
     for (SurvivorIndex survivorIndex = 0; survivorIndex < (SurvivorIndex)SurvivorCatalog.survivorDefs.Count(); survivorIndex++)
     {
         if (SurvivorCatalog.survivorDefs[(int)survivorIndex] == null)
         {
             Debug.LogWarningFormat("Unregistered survivor {0}!", new object[]
             {
                 Enum.GetName(typeof(SurvivorIndex), survivorIndex)
             });
         }
     }
     SurvivorCatalog._allSurvivorDefs = (from v in SurvivorCatalog.survivorDefs
                                         where v != null
                                         select v).ToArray <SurvivorDef>();
     ViewablesCatalog.Node node = new ViewablesCatalog.Node("Survivors", true, null);
     using (IEnumerator <SurvivorDef> enumerator = SurvivorCatalog.allSurvivorDefs.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             SurvivorDef survivor = new SurvivorDef();
             survivor = enumerator.Current;
             ViewablesCatalog.Node survivorEntryNode = new ViewablesCatalog.Node(survivor.survivorIndex.ToString(), false, node);
             survivorEntryNode.shouldShowUnviewed = ((UserProfile userProfile) => !userProfile.HasViewedViewable(survivorEntryNode.fullName) && userProfile.HasSurvivorUnlocked(survivor.survivorIndex) && !string.IsNullOrEmpty(survivor.unlockableName));
         }
     }
     ViewablesCatalog.AddNodeToRoot(node);
 }
예제 #7
0
        private static void Init()
        {
            SurvivorCatalog.survivorDefs = new SurvivorDef[10];
            SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Commando, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("CommandoBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/CommandoDisplay"),
                descriptionToken = "COMMANDO_DESCRIPTION",
                primaryColor     = new Color(0.92941177f, 0.5882353f, 0.07058824f)
            });
            SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Huntress, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("HuntressBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/HuntressDisplay"),
                primaryColor     = new Color(0.8352941f, 0.23529412f, 0.23529412f),
                descriptionToken = "HUNTRESS_DESCRIPTION",
                unlockableName   = "Characters.Huntress"
            });
            SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Toolbot, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("ToolbotBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/ToolbotDisplay"),
                descriptionToken = "TOOLBOT_DESCRIPTION",
                primaryColor     = new Color(0.827451f, 0.76862746f, 0.3137255f),
                unlockableName   = "Characters.Toolbot"
            });
            SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Engi, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("EngiBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/EngiDisplay"),
                descriptionToken = "ENGI_DESCRIPTION",
                primaryColor     = new Color(0.37254903f, 0.8862745f, 0.5254902f),
                unlockableName   = "Characters.Engineer"
            });
            SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Mage, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("MageBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/MageDisplay"),
                descriptionToken = "MAGE_DESCRIPTION",
                primaryColor     = new Color(0.96862745f, 0.75686276f, 0.99215686f),
                unlockableName   = "Characters.Mage"
            });
            SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Merc, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("MercBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/MercDisplay"),
                descriptionToken = "MERC_DESCRIPTION",
                primaryColor     = new Color(0.42352942f, 0.81960785f, 0.91764706f),
                unlockableName   = "Characters.Mercenary"
            });
            SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Treebot, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("TreebotBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/TreebotDisplay"),
                descriptionToken = "TREEBOT_DESCRIPTION",
                primaryColor     = new Color(0.5254902f, 0.61960787f, 0.32941177f),
                unlockableName   = "Characters.Treebot"
            });
            SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Loader, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("LoaderBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/LoaderDisplay"),
                descriptionToken = "LOADER_DESCRIPTION",
                primaryColor     = new Color(0.40392157f, 0.4392157f, 0.87058824f),
                unlockableName   = "Characters.Loader"
            });
            SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Croco, new SurvivorDef
            {
                bodyPrefab       = BodyCatalog.FindBodyPrefab("CrocoBody"),
                displayPrefab    = Resources.Load <GameObject>("Prefabs/CharacterDisplays/CrocoDisplay"),
                descriptionToken = "CROCO_DESCRIPTION",
                primaryColor     = new Color(0.7882353f, 0.9490196f, 0.3019608f),
                unlockableName   = "Characters.Croco"
            });
            for (SurvivorIndex survivorIndex = SurvivorIndex.Commando; survivorIndex < SurvivorIndex.Count; survivorIndex++)
            {
                if (SurvivorCatalog.survivorDefs[(int)survivorIndex] == null)
                {
                    Debug.LogWarningFormat("Unregistered survivor {0}!", new object[]
                    {
                        Enum.GetName(typeof(SurvivorIndex), survivorIndex)
                    });
                }
            }
            List <SurvivorDef>           list   = new List <SurvivorDef>();
            Action <List <SurvivorDef> > action = SurvivorCatalog.getAdditionalSurvivorDefs;

            if (action != null)
            {
                action(list);
            }
            Array.Resize <SurvivorDef>(ref SurvivorCatalog.survivorDefs, SurvivorCatalog.survivorDefs.Length + list.Count);
            for (int i = 0; i < list.Count; i++)
            {
                SurvivorCatalog.RegisterSurvivor(SurvivorIndex.Count + i, list[i]);
            }
            SurvivorCatalog.survivorIndexToBodyIndex = new int[SurvivorCatalog.survivorCount];
            SurvivorCatalog.bodyIndexToSurvivorIndex = new SurvivorIndex[BodyCatalog.bodyCount];
            HGArrayUtilities.SetAll <int>(SurvivorCatalog.survivorIndexToBodyIndex, -1);
            HGArrayUtilities.SetAll <SurvivorIndex>(SurvivorCatalog.bodyIndexToSurvivorIndex, SurvivorIndex.None);
            for (int j = 0; j < SurvivorCatalog.survivorDefs.Length; j++)
            {
                SurvivorDef survivorDef = SurvivorCatalog.survivorDefs[j];
                int         num         = (survivorDef != null) ? survivorDef.bodyPrefab.GetComponent <CharacterBody>().bodyIndex : -1;
                SurvivorCatalog.survivorIndexToBodyIndex[j] = num;
                if (num != -1)
                {
                    SurvivorCatalog.bodyIndexToSurvivorIndex[num] = (SurvivorIndex)j;
                }
            }
            SurvivorCatalog._allSurvivorDefs = (from v in SurvivorCatalog.survivorDefs
                                                where v != null
                                                select v).ToArray <SurvivorDef>();
            ViewablesCatalog.Node node = new ViewablesCatalog.Node("Survivors", true, null);
            using (IEnumerator <SurvivorDef> enumerator = SurvivorCatalog.allSurvivorDefs.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    SurvivorCatalog.< > c__DisplayClass22_0 CS$ < > 8__locals1 = new SurvivorCatalog.< > c__DisplayClass22_0();
                    CS$ < > 8__locals1.survivorDef = enumerator.Current;
                    ViewablesCatalog.Node survivorEntryNode = new ViewablesCatalog.Node(CS$ < > 8__locals1.survivorDef.survivorIndex.ToString(), false, node);
                    survivorEntryNode.shouldShowUnviewed = ((UserProfile userProfile) => !userProfile.HasViewedViewable(survivorEntryNode.fullName) && userProfile.HasSurvivorUnlocked(CS$ < > 8__locals1.survivorDef.survivorIndex) && !string.IsNullOrEmpty(CS$ < > 8__locals1.survivorDef.unlockableName));
                }
            }
            ViewablesCatalog.AddNodeToRoot(node);
        }