Exemple #1
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            int elapsedCalendarDays = SimClock.ElapsedCalendarDays();

            RabbitHole.RabbitHoleInteraction <Sim, RabbitHole> work = Sim.CreatedSim.InteractionQueue.GetCurrentInteraction() as RabbitHole.RabbitHoleInteraction <Sim, RabbitHole>;
            if (work == null)
            {
                return(false);
            }

            if (work.Actor == null)
            {
                return(false);
            }

            if (work.mAvailableTones != null)
            {
                int index = 0;
                while (index < work.mAvailableTones.Count)
                {
                    if (work.mAvailableTones[index] == null)
                    {
                        work.mAvailableTones.RemoveAt(index);
                    }
                    else
                    {
                        index++;
                    }
                }
            }

            List <InteractionToneDisplay> displayTones = work.AvailableTonesForDisplay();

            if (displayTones == null)
            {
                IncStat("No Choices");
                return(false);
            }

            List <ITone> tones = new List <ITone>();

            foreach (InteractionToneDisplay tone in displayTones)
            {
                if (tone.InteractionTone == null)
                {
                    continue;
                }

                if (tone.InteractionTone.ToString() == mTone)
                {
                    continue;
                }

                if (!ManagerCareer.VerifyTone(tone.InteractionTone as CareerTone))
                {
                    continue;
                }

                // can't put this in VerifyTone because ActiveCareer tones aren't inherited from CareerTone
                // and that function needs that
                AcademicCourse.SuckUpToProfessorTone professorTone = tone.InteractionTone as AcademicCourse.SuckUpToProfessorTone;
                if (professorTone != null && work.Actor.CareerManager.DegreeManager != null)
                {
                    SimDescription sim = AcademicCareer.GetProfessorForMajor(work.Actor.CareerManager.DegreeManager.EnrollmentAcademicDegreeName);
                    if (sim != null && sim.SimDescriptionId == work.Actor.SimDescription.SimDescriptionId)
                    {
                        continue;
                    }
                }

                tones.Add(tone.InteractionTone);
            }

            return(ConfigureInteraction(work, tones));
        }