static void Postfix(BodyGenerator __instance)
 {
     if (__instance.Character is CharacterObject characterObject)
     {
         float bodyAge = __instance.CurrentBodyProperties.DynamicProperties.Age;
         CharacterBodyManager.ResetBirthDayForAge(characterObject, bodyAge);
         if (DCCSettingsUtil.Instance.DebugMode)
         {
             Debug.Print($"[CharacterCreation] Character {characterObject.Name} expected age: {bodyAge}, actual: {characterObject.Age}");
         }
     }
 }
Example #2
0
        public static string Age(List <string> strings)
        {
            if (CampaignCheats.CheckParameters(strings, 0) || CampaignCheats.CheckHelp(strings))
            {
                return($"{FormatMsgHeader} \"dcc.age [{AgeText}]\".");
            }

            if (!int.TryParse(strings[0], out int num))
            {
                return(EnterAgeMsg.ToString());
            }
            CharacterBodyManager.ResetBirthDayForAge(Hero.MainHero.CharacterObject, num, true);
            return(SuccessMsg.ToString());
        }
Example #3
0
        public static string AgeHero(List <string> strings)
        {
            if (!CampaignCheats.CheckParameters(strings, 2) || CampaignCheats.CheckHelp(strings))
            {
                return($"{FormatMsgHeader} \"dcc.age_hero [{HeroNameText}] [{AgeText}]\".");
            }
            Hero hero = CampaignCheats.GetHero(strings[0].Replace('_', ' '));

            if (hero == null)
            {
                return(HeroNotFoundMsg.ToString());
            }
            if (!int.TryParse(strings[1], out int num))
            {
                return(EnterAgeMsg.ToString());
            }
            CharacterBodyManager.ResetBirthDayForAge(hero.CharacterObject, num, true);
            return(SuccessMsg.ToString());
        }
 static bool Prefix(BodyGenerator __instance)
 {
     try
     {
         __instance.Character.UpdatePlayerCharacterBodyProperties(__instance.CurrentBodyProperties, __instance.IsFemale);
         if (__instance.Character is CharacterObject characterObject)
         {
             float bodyAge = __instance.CurrentBodyProperties.DynamicProperties.Age;
             CharacterBodyManager.ResetBirthDayForAge(characterObject, __instance.CurrentBodyProperties.DynamicProperties.Age);
             if (DCCSettingsUtil.Instance.DebugMode)
             {
                 Debug.Print($"[CharacterCreation] Character {characterObject.Name} expected age: {bodyAge}, actual: {characterObject.Age}");
             }
         }
         return(false);
     }
     catch (Exception ex)
     {
         MessageBox.Show($"{ErrorText}\n{ex.Message} \n\n{ex.InnerException?.Message}");
         return(true);
     }
 }