Пример #1
0
        public override void OnPhoneFinished()
        {
            try
            {
                if (GameUtils.gGameUtils.GetCurrentWorldName() == WorldName.University)
                {
                    if (mIsEnrolled)
                    {
                        if (mTravelers != null)
                        {
                            Actor.ModifyFunds(-mTuitionCost);

                            AcademicCareerEx.Enroll(mTravelers);
                        }
                    }
                }
                else
                {
                    base.OnPhoneFinished();
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }
        }
        public override bool Run()
        {
            try
            {
                StandardEntry();
                if (!Target.StartComputing(this, SurfaceHeight.Table, true))
                {
                    StandardExit();
                    return(false);
                }

                Target.StartVideo(Computer.VideoType.Browse);
                AnimateSim("GenericTyping");
                bool flag = DoTimedLoop(kTimeToSpendEnrolling, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                if (flag)
                {
                    List <SimDescription> others = null;
                    int tuitionCost = 0;

                    flag = AcademicCareerEx.EnrollInAcademicCareer(Actor, Traveler.Settings.mTravelFilter, out others, out tuitionCost);
                    if (flag)
                    {
                        if (GameUtils.gGameUtils.GetCurrentWorldName() == WorldName.University)
                        {
                            if (others != null)
                            {
                                Actor.ModifyFunds(-tuitionCost);

                                AcademicCareerEx.Enroll(others);
                            }
                        }
                        else
                        {
                            TravelUtil.TriggerTravelToUniversityWorld(others, tuitionCost);
                        }
                    }
                }

                Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false);
                StandardExit();
                return(flag);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Пример #3
0
        public override bool InRabbitHole()
        {
            try
            {
                List <SimDescription> others = null;
                int tuitionCost = 0;

                try
                {
                    List <SimDescription> choices = new List <SimDescription>();
                    foreach (SimDescription sim in Households.Humans(Actor.Household))
                    {
                        if (sim.TeenOrAbove)
                        {
                            choices.Add(sim);
                        }
                    }

                    if (AcademicCareerEx.EnrollInAcademicCareer(Actor, choices, out others, out tuitionCost))
                    {
                        if (others != null)
                        {
                            Actor.ModifyFunds(-tuitionCost);

                            foreach (SimDescription sim in others)
                            {
                                AcademicHelper.AddAcademic(sim, AcademicCareer.GlobalTermLength);
                            }

                            AcademicCareerEx.Enroll(others);
                        }
                    }
                }
                finally
                {
                    TravelUtil.PlayerMadeTravelRequest = false;
                }

                return(true);
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
            }
            return(true);
        }