Beispiel #1
0
 public BreakupMoveOutScenario(SimDescription go, SimDescription stay, HouseholdBreakdown.ChildrenMove childMove)
     : base(go, stay)
 {
     mChildMove = childMove;
 }
Beispiel #2
0
 protected BreakupMoveOutScenario(BreakupMoveOutScenario scenario)
     : base(scenario)
 {
     mChildMove = scenario.mChildMove;
 }
Beispiel #3
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            bool wasMarried = Sim.IsMarried;

            if (!Romances.BumpToLowerState(this, Sim, Target, false))
            {
                IncStat("Bump Fail");
                return(false);
            }

            if (wasMarried)
            {
                if (GetValue <RenameDivorceeOption, bool>())
                {
                    RenameDivorcee(Sim);
                    RenameDivorcee(Target);
                }
            }

            if (Sim.Household == Target.Household)
            {
                SimDescription go   = Sim;
                SimDescription stay = Target;

                SimDescription head = SimTypes.HeadOfFamily(Sim.Household);
                if (head != null)
                {
                    if (Relationships.IsCloselyRelated(Target, head, false))
                    {
                        stay = Target;
                        go   = Sim;
                    }
                    else if (Relationships.IsCloselyRelated(Sim, head, false))
                    {
                        stay = Sim;
                        go   = Target;
                    }
                    else if (RandomUtil.CoinFlip())
                    {
                        stay = Sim;
                        go   = Target;
                    }
                }

                HouseholdBreakdown.ChildrenMove goScore   = HouseholdBreakdown.ChildrenMove.Scoring;
                HouseholdBreakdown.ChildrenMove stayScore = HouseholdBreakdown.ChildrenMove.Scoring;
                if (mAffair)
                {
                    // Sim is cheater, so keep children with other parent
                    if (go == Sim)
                    {
                        if (mRelatedStay)
                        {
                            goScore   = HouseholdBreakdown.ChildrenMove.RelatedStay;
                            stayScore = HouseholdBreakdown.ChildrenMove.RelatedGo;
                        }
                        else
                        {
                            goScore   = HouseholdBreakdown.ChildrenMove.Stay;
                            stayScore = HouseholdBreakdown.ChildrenMove.Go;
                        }
                    }
                    else
                    {
                        if (mRelatedStay)
                        {
                            goScore   = HouseholdBreakdown.ChildrenMove.RelatedGo;
                            stayScore = HouseholdBreakdown.ChildrenMove.RelatedStay;
                        }
                        else
                        {
                            goScore   = HouseholdBreakdown.ChildrenMove.Go;
                            stayScore = HouseholdBreakdown.ChildrenMove.Stay;
                        }
                    }
                }

                Add(frame, new BreakupMoveOutScenario(go, stay, goScore), ScenarioResult.Failure);
                Add(frame, new BreakupMoveOutScenario(stay, go, stayScore), ScenarioResult.Failure);
            }

            return(true);
        }