private static void _removeAbortionMotherInHeroPregnancies(Hero hero)
        {
            if (hero == null)
            {
                return;
            }
            PregnancyControlBehavior pregnancyControlInst = Utillty.GetPregnancyControlBehaviorInstance();

            if (pregnancyControlInst == null || !pregnancyControlInst.PreAbortionMap.ContainsKey(hero))
            {
                return;
            }
            object pregnanciesObject = PregCampHelper.GetHeroPregnanciesObject();

            if (pregnanciesObject == null)
            {
                return;
            }
            MethodInfo pregnanciesMethodInfo = PregCampHelper.GetHeroPregnanciesMethodInfo("RemoveAll");

            if (pregnanciesMethodInfo == (MethodInfo)null)
            {
                return;
            }
            Predicate <object> predicate = (Predicate <object>)(pregnancyObj => PregnancyCheckOffspringsToDeliverPatch._removeAbortionMotherPredicate(ref pregnancyControlInst, hero, pregnancyObj));

            Utillty.DebugDisplayMessage("_removeAbortionMotherInHeroPregnancies Success! RemoveNums : " + ((int)pregnanciesMethodInfo.Invoke(pregnanciesObject, new object[1]
            {
                (object)predicate
            })).ToString());
            pregnancyControlInst.CleanPreAbortionList();
        }
Ejemplo n.º 2
0
        public bool conversation_player_abortion_ask_on_condition()
        {
            Hero       conversationHero = Hero.OneToOneConversationHero;
            TextObject empty            = (TextObject)TextObject.Empty;

            MBTextManager.SetTextVariable("ABORTION_ASK", ((object)new TextObject(Utillty.ET("{=pcm_abor_ask_1}I don't want our unborn child anymore."), null)).ToString(), false);
            return(PregCampHelper.IsInPregnancies(conversationHero, Hero.MainHero) && !this.IsPreAbortion(conversationHero));
        }
Ejemplo n.º 3
0
 public void RecordPreAbortion(Hero mother, Hero caused)
 {
     if (mother == null || !PregCampHelper.IsInPregnancies(mother, (Hero)null) || this.m_preAbortionMap.ContainsKey(mother))
     {
         return;
     }
     this.m_preAbortionMap.Add(mother, caused);
     Utillty.DebugDisplayMessage("_recordAbortion Success! Mother : " + ((object)mother.Name).ToString());
 }
Ejemplo n.º 4
0
 public bool CheckAddNewPregnancies(Hero hero)
 {
     if (!this.IsTimeToAddNewPregnant(hero, (Hero)null))
     {
         return(false);
     }
     MakePregnantAction.Apply(hero);
     PregCampHelper.DoChildConceivedMethod(hero);
     this.m_prePregnancyInfoMap.Remove(hero);
     return(true);
 }
Ejemplo n.º 5
0
        private bool _isShowAbortionButton()
        {
            if (!UIHelper.IsSelectedMember())
            {
                return(false);
            }
            Hero curSelectedMember = UIHelper.GetCurSelectedMember();

            if (curSelectedMember == null)
            {
                return(false);
            }
            PregnancyControlBehavior behaviorInstance = Utillty.GetPregnancyControlBehaviorInstance();

            return(behaviorInstance != null && PregCampHelper.IsInPregnancies(curSelectedMember, (Hero)null) && !behaviorInstance.IsPreAbortion(curSelectedMember));
        }
        private static bool _removeAbortionMotherPredicate(
            ref PregnancyControlBehavior pregnancyControlInst,
            Hero hero,
            object heroPregnancyObj)
        {
            if (heroPregnancyObj == null)
            {
                return(false);
            }
            Hero pregnancyMother = PregCampHelper.GetPregnancyMother(heroPregnancyObj);

            if (pregnancyMother != hero)
            {
                return(false);
            }
            pregnancyControlInst.DoAbortionNotificationAndLog(pregnancyMother, pregnancyControlInst.PreAbortionMap[pregnancyMother]);
            return(true);
        }
        private static void _changeFatherInCurPregnancy()
        {
            if (PregnancyChildConceivedPatch.m_mother == null || PregnancyChildConceivedPatch.m_father == null)
            {
                return;
            }
            IEnumerable pregnanciesObject = (IEnumerable)PregCampHelper.GetHeroPregnanciesObject();

            if (pregnanciesObject == null)
            {
                return;
            }
            foreach (object pregnancyObj in pregnanciesObject)
            {
                if (PregCampHelper.GetPregnancyMother(pregnancyObj) == PregnancyChildConceivedPatch.m_mother)
                {
                    PregCampHelper.SetPregnancyFather(pregnancyObj, PregnancyChildConceivedPatch.m_father);
                    Utillty.DebugDisplayMessage("_changeFatherInCurPregnancy Make Pregnant! Mother : " + ((object)PregnancyChildConceivedPatch.m_mother.Name).ToString() + " Father : " + ((object)PregnancyChildConceivedPatch.m_father.Name).ToString());
                    break;
                }
            }
        }
        public static bool IsInPregnancies(Hero mother, Hero father)
        {
            if (mother == null && father == null)
            {
                return(false);
            }
            IEnumerable pregnanciesObject = (IEnumerable)PregCampHelper.GetHeroPregnanciesObject();

            if (pregnanciesObject == null)
            {
                return(false);
            }
            bool flag = false;

            foreach (object pregnancyObj in pregnanciesObject)
            {
                if ((uint)((mother == null ? 1 : (PregCampHelper.GetPregnancyMother(pregnancyObj) == mother ? 1 : 0)) & (father == null ? 1 : (PregCampHelper.GetPregnancyFather(pregnancyObj) == father ? 1 : 0))) > 0U)
                {
                    flag = true;
                    break;
                }
            }
            return(flag);
        }