Beispiel #1
0
        // Token: 0x06001786 RID: 6022 RVA: 0x0006F750 File Offset: 0x0006D950
        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 name = WeeklyRun.GetLeaderboardName(num, this.serverSeedCycle);

            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(name, Client.LeaderboardSortMethod.Ascending, Client.LeaderboardDisplayType.TimeMilliSeconds);

            leaderboard.OnBoardInformation = delegate()
            {
                leaderboard.AddScore(true, (int)Math.Ceiling((double)runReport.snapshotTime.t * 1000.0), subScores);
            };
        }
Beispiel #2
0
        // Token: 0x060014ED RID: 5357 RVA: 0x00059610 File Offset: 0x00057810
        private void Build()
        {
            List <SurvivorIndex> list = new List <SurvivorIndex>();

            for (int i = 0; i < SurvivorCatalog.idealSurvivorOrder.Length; i++)
            {
                SurvivorIndex survivorIndex = SurvivorCatalog.idealSurvivorOrder[i];
                SurvivorDef   survivorDef   = SurvivorCatalog.GetSurvivorDef(survivorIndex);
                if (this.ShouldDisplaySurvivor(survivorDef))
                {
                    list.Add(survivorIndex);
                }
            }
            this.survivorIconControllers.AllocateElements(list.Count);
            ReadOnlyCollection <SurvivorIconController> elements = this.survivorIconControllers.elements;

            for (int j = 0; j < list.Count; j++)
            {
                elements[j].survivorIndex = list[j];
            }
            for (int k = list.Count; k < SurvivorCatalog.survivorMaxCount; k++)
            {
                UnityEngine.Object.Instantiate <GameObject>(this.WIPButtonPrefab, this.iconContainer).gameObject.SetActive(true);
            }
        }
Beispiel #3
0
 // Token: 0x06001ADA RID: 6874 RVA: 0x00071C73 File Offset: 0x0006FE73
 private static void RegisterSurvivor(SurvivorIndex survivorIndex, SurvivorDef survivorDef)
 {
     if (survivorIndex < SurvivorIndex.Count)
     {
         survivorDef.name = survivorIndex.ToString();
     }
     survivorDef.survivorIndex = survivorIndex;
     SurvivorCatalog.survivorDefs[(int)survivorIndex] = survivorDef;
 }
Beispiel #4
0
 // Token: 0x06001AE0 RID: 6880 RVA: 0x00071D48 File Offset: 0x0006FF48
 public static SurvivorIndex FindSurvivorIndex(string survivorName)
 {
     for (int i = 0; i < SurvivorCatalog.survivorCount; i++)
     {
         SurvivorDef survivorDef = SurvivorCatalog.survivorDefs[i];
         if (((survivorDef != null) ? survivorDef.name : null) == survivorName)
         {
             return((SurvivorIndex)i);
         }
     }
     return(SurvivorIndex.None);
 }
 // Token: 0x06001B4D RID: 6989 RVA: 0x0007F8D8 File Offset: 0x0007DAD8
 public static SurvivorDef FindSurvivorDefFromBody(GameObject characterBodyPrefab)
 {
     for (int i = 0; i < SurvivorCatalog.survivorDefs.Length; i++)
     {
         SurvivorDef survivorDef = SurvivorCatalog.survivorDefs[i];
         GameObject  y           = (survivorDef != null) ? survivorDef.bodyPrefab : null;
         if (characterBodyPrefab == y)
         {
             return(survivorDef);
         }
     }
     return(null);
 }
Beispiel #6
0
 // Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
 public void Awake()
 {
     SurvivorAPI.SurvivorCatalogReady += delegate(object s, EventArgs e)
     {
         var display = Resources.Load <GameObject>("prefabs/characterbodies/HANDBody").GetComponent <ModelLocator>().modelTransform.gameObject;
         display.AddComponent <animation>();
         RoR2.SurvivorDef survivorDef = new RoR2.SurvivorDef
         {
             bodyPrefab       = RoR2.BodyCatalog.FindBodyPrefab("HANDBody"),
             descriptionToken = "HAND_DESCRIPTION",
             displayPrefab    = display,
             primaryColor     = new Color(0.8039216f, 0.482352942f, 0.843137264f),
             unlockableName   = "",
             survivorIndex    = SurvivorIndex.Count
         };
         survivorDef.bodyPrefab.GetComponent <RoR2.SkillLocator>().primary.noSprint   = false;
         survivorDef.bodyPrefab.GetComponent <RoR2.SkillLocator>().secondary.noSprint = false;
         survivorDef.bodyPrefab.GetComponent <RoR2.SkillLocator>().utility.noSprint   = false;
         survivorDef.bodyPrefab.GetComponent <RoR2.SkillLocator>().special.noSprint   = false;
         survivorDef.bodyPrefab.GetComponent <RoR2.CharacterBody>().crosshairPrefab   = RoR2.BodyCatalog.FindBodyPrefab("HuntressBody").GetComponent <RoR2.CharacterBody>().crosshairPrefab;
         SurvivorAPI.SurvivorDefinitions.Insert(6, survivorDef);
     };
     On.EntityStates.HAND.Overclock.FixedUpdate += delegate(On.EntityStates.HAND.Overclock.orig_FixedUpdate orig, EntityStates.HAND.Overclock self)
     {
         self.outer.commonComponents.characterBody.AddTimedBuff(BuffIndex.EnrageAncientWisp, 2f);
         orig(self);
     };
     On.RoR2.GlobalEventManager.OnHitEnemy += delegate(On.RoR2.GlobalEventManager.orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
     {
         orig(self, damageInfo, victim);
         bool flag = damageInfo.attacker && damageInfo.procCoefficient > 0f;
         if (flag)
         {
             RoR2.CharacterBody component = damageInfo.attacker.GetComponent <RoR2.CharacterBody>();
             bool flag2 = component.HasBuff(BuffIndex.EnrageAncientWisp) && component.baseNameToken == "HAND_BODY_NAME";
             if (flag2)
             {
                 component.AddTimedBuff(BuffIndex.EnrageAncientWisp, 2f);
                 component.healthComponent.Heal(EntityStates.HAND.Overclock.healPercentage * damageInfo.damage, default(RoR2.ProcChainMask), true);
             }
         }
     };
     On.RoR2.CharacterModel.UpdateMaterials += delegate(On.RoR2.CharacterModel.orig_UpdateMaterials orig, RoR2.CharacterModel self)
     {
         bool flag = self.body.baseNameToken != "HAND_BODY_NAME";
         if (flag)
         {
             orig(self);
         }
     };
 }
        // 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);
        }
Beispiel #8
0
 // Token: 0x060014EC RID: 5356 RVA: 0x00059608 File Offset: 0x00057808
 private bool ShouldDisplaySurvivor(SurvivorDef survivorDef)
 {
     return(survivorDef != null);
 }
Beispiel #9
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);
        }
Beispiel #10
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);
 }
Beispiel #11
0
 public extern static void RegisterSurvivor(SurvivorIndex survivorIndex, SurvivorDef survivorDef);
 // Token: 0x06001B4B RID: 6987 RVA: 0x0007F8B3 File Offset: 0x0007DAB3
 private static void RegisterSurvivor(SurvivorIndex survivorIndex, SurvivorDef survivorDef)
 {
     survivorDef.survivorIndex = survivorIndex;
     SurvivorCatalog.survivorDefs[(int)survivorIndex] = survivorDef;
 }
Beispiel #13
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);
        }