private void Session_Update(On.Session.orig_Update orig, Session self)
 {
     if (!displayedData)
     {
         Log("Number of Active Heroes: " + Hero.LocalPlayerActiveRecruitedHeroes.Count);
         foreach (Hero h in Hero.LocalPlayerActiveRecruitedHeroes)
         {
             try
             {
                 Log("Entering a check with Name: " + h.LocalizedName);
                 SimulationDescriptor dbdescriptorByName = SimMonoBehaviour.GetDBDescriptorByName(h.Config.Name);
                 Log("DBDescriptorByName: " + dbdescriptorByName.Name);
                 var obj = h.GetSimDescriptorByType(SimulationProperties.SimDescTypeHero);
                 Log("Name: " + obj.Name + " Type: " + obj.Type);
                 Log("Modifiers:");
                 if (obj.SimulationModifierDescriptors != null)
                 {
                     foreach (SimulationModifierDescriptor m in obj.SimulationModifierDescriptors)
                     {
                         Log("- " + m.TargetPropertyName);
                     }
                 }
                 Log("Properties:");
                 if (obj.SimulationPropertyDescriptors != null)
                 {
                     foreach (SimulationPropertyDescriptor d in obj.SimulationPropertyDescriptors)
                     {
                         Log("- " + d.Name + ": " + d.BaseValue);
                     }
                 }
                 Log("Level 1 Name: " + h.GetLevelDescriptorName(1));
                 displayedData = true;
             }
             catch (NullReferenceException e)
             {
                 // Thats ok for now
             }
         }
     }
     orig(self);
 }
        private HeroGameStatsData[] UserProfile_GetSelectableHeroes(On.UserProfile.orig_GetSelectableHeroes orig, bool hiddenHeroesOnly)
        {
            HeroConfig[] values = Databases.GetDatabase <HeroConfig>(false).GetValues();
            foreach (HeroConfig heroConfig in values)
            {
                Log("Loaded HeroConfig with name: " + heroConfig.Name + " while GettingSelectableHeroes");
                if (heroConfig.Name == "Hero_" + GetName() || heroConfig.Name == "Hero_H0001")
                {
                    Log("Found an important Hero!");
                    Log("Displaying Data: ");
                    Log("AITarget: " + heroConfig.AITargetType);
                    Log("AIConfig:");
                    var ai = Databases.GetDatabase <AIConfig>(false).GetValue(heroConfig.Name);
                    if (ai != null)
                    {
                        Log("- Name: " + ai.Name);
                        Log("- AI TargetInteractionConfigs:");
                        foreach (AITargetInteractionConfig c in ai.AITargetInteractionConfigs)
                        {
                            Log("-- TargetType: " + c.XmlSerializableTargetType + " Interaction: " + c.Interaction);
                        }
                    }
                    Log("Archetype: " + heroConfig.Archetype);
                    Log("AttackType: " + heroConfig.AttackType);
                    Log("Equipment Slots:");
                    foreach (EquipmentSlotConfig e in heroConfig.EquipmentSlots)
                    {
                        Log("- " + e.CategoryName + ", " + e.TypeName);
                    }
                    Log("Faction: " + heroConfig.Faction);
                    Log("Damages Stat: " + heroConfig.GetDamagesStat());
                    Log("SimObj: " + heroConfig.GetHeroSimObj());
                    IDatabase <SimulationDescriptor> simDescDatabase = SimMonoBehaviour.GetSimDescDatabase();
                    SimulationDescriptor             hDesc           = simDescDatabase.GetValue("Hero");
                    SimulationDescriptor             desc            = simDescDatabase.GetValue(heroConfig.Name);

                    //Log("Hero Descriptor:");
                    //Log("Modifiers:");
                    //foreach (SimulationModifierDescriptor d in hDesc.SimulationModifierDescriptors)
                    //{
                    //    Log("- " + d.TargetPropertyName + " With operation: " + d.Operation);
                    //}
                    //Log("Properties:");
                    //foreach (SimulationPropertyDescriptor p in hDesc.SimulationPropertyDescriptors)
                    //{
                    //    Log("- " + p.Name + ": " + p.BaseValue);
                    //}

                    Log("Personal Descriptor:");
                    Log("Name, Type: " + desc.Name + ", " + desc.Type);
                    Log("Modifiers:");
                    if (desc.SimulationModifierDescriptors != null)
                    {
                        foreach (SimulationModifierDescriptor d in desc.SimulationModifierDescriptors)
                        {
                            if (d == null)
                            {
                                continue;
                            }
                            Log("- " + d.TargetPropertyName + " With operation: " + d.Operation);
                        }
                    }
                    Log("Properties:");
                    if (desc.SimulationPropertyDescriptors != null)
                    {
                        foreach (SimulationPropertyDescriptor p in desc.SimulationPropertyDescriptors)
                        {
                            if (p == null)
                            {
                                continue;
                            }
                            Log("- " + p.Name + ": " + p.BaseValue);
                        }
                    }

                    Log("Life Stat: " + heroConfig.GetLifeStat());
                    Log("Random Weight: " + heroConfig.GetRandomSelectionWeight());
                    Log("Speed Stat: " + heroConfig.GetSpeedStat());
                    Log("Wit Stat: " + heroConfig.GetWitStat());
                    if (heroConfig.IntroDialogs != null)
                    {
                        Log("Intro Dialoges:");
                        foreach (DialogConfig c in heroConfig.IntroDialogs)
                        {
                            if (c == null)
                            {
                                continue;
                            }
                            Log("- " + c.Name + ": " + c.Text);
                        }
                    }
                    Log("Event Active: " + heroConfig.IsCommunityEventActive());
                    Log("Is Event Hero: " + heroConfig.IsCommunityEventHero());
                    Log("Is Hidden: " + heroConfig.IsHidden());
                    Log("Name: " + heroConfig.Name);
                    Log("Recruit Base Cost: " + heroConfig.RecruitmentFoodCost);
                    Log("Situation Dialogs:");
                    if (heroConfig.SituationDialogCount != null)
                    {
                        foreach (Amplitude.StaticString s in heroConfig.SituationDialogCount.Keys)
                        {
                            if (s == null)
                            {
                                continue;
                            }
                            Log("- " + s + ": " + heroConfig.SituationDialogCount[s]);
                        }
                    }
                    Log("Sprite animations path: " + heroConfig.SpriteAnimationsPath);
                    Log("Unlock Level Count: " + heroConfig.UnlockLevelCount);
                }
            }
            return(orig(hiddenHeroesOnly));
        }