public void GiveRogueryXp(Hero heroTroop)
        {
            float xpValue = KleptomaniaSubModule.settings.StealXpValue;
            DefaultCharacterDevelopmentModel characterDevelopmentModel = new DefaultCharacterDevelopmentModel();
            float learningRateBonus = characterDevelopmentModel.CalculateLearningRate(heroTroop, DefaultSkills.Roguery);

            heroTroop.AddSkillXp(DefaultSkills.Roguery, xpValue);

            if (KleptomaniaSubModule.settings.ReceivedXpInConsole)
            {
                InformationManager.DisplayMessage(new InformationMessage(heroTroop.Name + " received " + Math.Round(xpValue * learningRateBonus, 1) + " Roguery XP for steal attempt.", Colors.Yellow));
            }
            KleptomaniaSubModule.Log.Info("Main Hero | " + heroTroop.Name + " received Roguery XP value of " + Math.Round(xpValue * learningRateBonus, 1));
        }
 static bool Prefix(DefaultCharacterDevelopmentModel __instance, int attributeValue, int focusValue, TextObject attributeName, StatExplainer explainer, ref int __result)
 {
     if (explainer != null)
     {
         ExplainedNumber explainedNumber = new ExplainedNumber(0.0f, explainer, (TextObject)null);
         explainedNumber.Add(SKILLLEVEL, _LevelText);
         explainedNumber.Add(attributeValue * Reworked_SkillsSubModule.__ATTR_VALUE, attributeName);
         explainedNumber.Add(focusValue * Reworked_SkillsSubModule.__FOCUS_VALUE, Patch3.desription);
         explainedNumber.LimitMin(0.0f);
         __result = (int)explainedNumber.ResultNumber;
         return(false);
     }
     __result = (int)Reworked_SkillsSubModule.__LEANRINGLIMIT;
     return(false);
 }
        static bool Prefix(DefaultCharacterDevelopmentModel __instance,
                           int attributeValue, int focusValue, int skillValue, int characterLevel, TextObject attributeName, StatExplainer explainer, ref float __result)
        {
            if (attributeValue == 11)
            {
                skillValue -= (int)(attributeValue * Reworked_SkillsSubModule.__ATTR_VALUE + focusValue * Reworked_SkillsSubModule.__FOCUS_VALUE);
            }
            ExplainedNumber explainedNumber = new ExplainedNumber(0, explainer, (TextObject)null);
            float           BaseByLevel     = (float)(20.0 / (10.0 + (double)characterLevel));
            float           Attribute       = 0.4f * (float)10;
            float           Focus           = (float)5 * 1f;

            if (Reworked_SkillsSubModule.__DEFAULTLEARNING)
            {
                explainedNumber.Add(BaseByLevel, _LevelText);
                explainedNumber.Add(Attribute, attributeName);
                explainedNumber.Add(Focus, _skillFocusText);
            }
            else if (Reworked_SkillsSubModule.__DEFAULTNORMALIZEDLEARNING)
            {
                float penalty = Math.Max(0, Reworked_SkillsSubModule.__SKILLPNLT - skillValue) / Reworked_SkillsSubModule.__SKILLPNLTDV;
                explainedNumber.Add(BaseByLevel, _LevelText);
                explainedNumber.Add(Attribute, attributeName);
                explainedNumber.Add(Focus, _skillFocusText);
                explainedNumber.Add(-penalty, _NormalizedPenaltyText);
            }
            else if (Reworked_SkillsSubModule.__FIXEDRATE)
            {
                explainedNumber.Add(Reworked_SkillsSubModule.__FIXEDLEARNINGRATE, _FixedRateText);
            }
            int learningLimit = Reworked_SkillsSubModule.__LEANRINGLIMIT;// __instance.CalculateLearningLimit(10, 5, (TextObject)null, (StatExplainer)null);

            if (skillValue > learningLimit)
            {
                int num = skillValue - learningLimit;
                explainedNumber.AddFactor((float)(-1.0 - 0.100000001490116 * (double)num), _overLimitText);
            }
            explainedNumber.LimitMin(0.0f);
            __result = explainedNumber.ResultNumber;
            return(false); // make sure you only skip if really necessary
        }
 static bool Prefix(DefaultCharacterDevelopmentModel __instance, Hero hero, SkillObject skill, StatExplainer explainer, ref int __result)
 {
     __result = Reworked_SkillsSubModule.__LEANRINGLIMIT;
     return(false); // make sure you only skip if really necessary
 }
        static void Postfix(TroopRoster __instance, CharacterObject troop, int numberToWound, UniqueTroopDescriptor troopSeed)
        {
            try
            {
                //Reflection gimmicks to get "internal PartyBase OwnerParty" from TroopRoster
                PropertyInfo prop       = __instance.GetType().GetProperty("OwnerParty", BindingFlags.NonPublic | BindingFlags.Instance);
                PartyBase    OwnerParty = (PartyBase)prop.GetValue(__instance);

                if (troop.IsHero)
                {
                    Hero heroTroop = troop.HeroObject;

                    float xpValue = WoundXpSubModule.settings.HeroWoundXpValue;
                    DefaultCharacterDevelopmentModel characterDevelopmentModel = new DefaultCharacterDevelopmentModel();
                    float learningRateBonus = characterDevelopmentModel.CalculateLearningRate(heroTroop, DefaultSkills.Athletics);

                    if (WoundXpSubModule.settings.ScalableSkillXp)
                    {
                        xpValue *= (float)Math.Round(learningRateBonus, 1);
                    }

                    heroTroop.AddSkillXp(DefaultSkills.Athletics, xpValue);

                    if (WoundXpSubModule.settings.DebugInfo || troop.IsPlayerCharacter || heroTroop.IsPlayerCompanion)
                    {
                        if (WoundXpSubModule.settings.ScalableSkillXp)
                        {
                            WoundXpSubModule.Log.Info("Hero Troop: " + troopSeed.ToString() + " | Calculated learning rate bonus = " + learningRateBonus.ToString());
                            if (WoundXpSubModule.settings.DebugInfo && WoundXpSubModule.settings.ReceivedXpInConsole)
                            {
                                InformationManager.DisplayMessage(new InformationMessage(heroTroop.Name + " calculated learning rate bonus = " + learningRateBonus.ToString(), Colors.Yellow));
                            }
                        }

                        if (WoundXpSubModule.settings.ReceivedXpInConsole)
                        {
                            InformationManager.DisplayMessage(new InformationMessage(heroTroop.Name + " received " + xpValue + " Athletics XP for surviving after being wounded.", Colors.Yellow));
                        }
                        WoundXpSubModule.Log.Info("Hero Troop: " + troopSeed.ToString() + " | " + heroTroop.Name + " received Athletics XP value of " + xpValue);
                    }
                }
                else
                {
                    int xpValue        = WoundXpSubModule.settings.TroopWoundXpValue;
                    int troopTierBonus = troop.Tier + 1;

                    if (WoundXpSubModule.settings.ScalableSkillXp)
                    {
                        xpValue *= troopTierBonus;
                    }

                    __instance.AddXpToTroop(xpValue, troop);

                    if (WoundXpSubModule.settings.DebugInfo || OwnerParty.Owner != null && OwnerParty.Owner.IsHumanPlayerCharacter)
                    {
                        if (WoundXpSubModule.settings.ScalableSkillXp)
                        {
                            WoundXpSubModule.Log.Info("Generic Troop: " + troopSeed.ToString() + " | Calculated learning troop tier bonus = " + troopTierBonus.ToString());
                            if (WoundXpSubModule.settings.DebugInfo && WoundXpSubModule.settings.ReceivedXpInConsole)
                            {
                                InformationManager.DisplayMessage(new InformationMessage(troop.Name + " calculated troop tier bonus = " + troopTierBonus.ToString(), Colors.Yellow));
                            }
                        }

                        if (WoundXpSubModule.settings.ReceivedXpInConsole)
                        {
                            InformationManager.DisplayMessage(new InformationMessage(troop.Name + " received " + xpValue + " XP for surviving after being wounded.", Colors.Yellow));
                        }
                        WoundXpSubModule.Log.Info("Generic Troop: " + troopSeed.ToString() + " | " + troop.Name + " received XP value of " + xpValue);
                    }
                }
            }
            catch (Exception ex)
            {
                WoundXpSubModule.Log.Error("Error on Harmony Patch for WoundTroop. | " + ex.Message);
                InformationManager.DisplayMessage(new InformationMessage("Something went wrong with Iron Will - Wound Experience: " + ex.Message, Colors.Red));
            }
        }