Esempio n. 1
0
        protected override bool PrivateSatisfies(ManagerCareer manager, SimDescription sim, Lot newLot, bool inspecting)
        {
            if (inspecting)
            {
                return(true);
            }

            return(ManagerSituation.FindRabbitHole(RabbitHoleType.PoliceStation) != null);
        }
Esempio n. 2
0
        protected override bool PrivateSatisfies(ManagerCareer manager, SimDescription sim, Lot newLot, bool inspecting)
        {
            if (inspecting)
            {
                return(true);
            }

            if (sim.Occupation is Retired)
            {
                return(false);
            }

            return(ManagerSituation.FindRabbitHole(RabbitHoleType.ScienceLab) != null);
        }
Esempio n. 3
0
        protected override bool Push()
        {
            if (Sim.CreatedSim == null)
            {
                return(false);
            }

            if (!Situations.Allow(this, Sim))
            {
                return(false);
            }

            if (Sim.CreatedSim.InteractionQueue != null)
            {
                Sim.CreatedSim.InteractionQueue.CancelAllInteractions();
            }

            PoliceStation target = ManagerSituation.FindRabbitHole(RabbitHoleType.PoliceStation) as PoliceStation;

            if (target == null)
            {
                return(false);
            }

            if (OnPushInteraction == null)
            {
                return(false);
            }

            InteractionDefinition pushInteraction = OnPushInteraction();

            if (pushInteraction == null)
            {
                return(false);
            }

            InteractionInstance entry = pushInteraction.CreateInstance(target, Sim.CreatedSim, new InteractionPriority(InteractionPriorityLevel.High), false, false);

            Sim.CreatedSim.AddExitReason(ExitReason.CanceledByScript);
            Sim.CreatedSim.InteractionQueue.AddNext(entry);

            return(true);
        }
Esempio n. 4
0
        protected override bool PrivateSatisfies(ManagerCareer manager, SimDescription sim, Lot newLot, bool inspecting)
        {
            if (!inspecting)
            {
                if (sim.Occupation is Retired)
                {
                    return(false);
                }

                if (ManagerSituation.FindRabbitHole(RabbitHoleType.CityHall) == null)
                {
                    return(false);
                }
            }

            if ((newLot == null) || (newLot.CountObjects <DraftingTable>() == 0))
            {
                return(false);
            }

            return(true);
        }
Esempio n. 5
0
        protected bool ProgressPrivateEye(Occupation occupation)
        {
            if (!Test(Sim.CreatedSim, PoliceStation.LowLevelPoliceWork.Singleton))
            {
                PoliceStation.LowLevelPoliceWork interaction = Sim.CreatedSim.InteractionQueue.GetCurrentInteraction() as PoliceStation.LowLevelPoliceWork;
                if (interaction != null)
                {
                    if (interaction.CurrentTone == null)
                    {
                        List <ITone> allTones = new List <ITone>();

                        foreach (InteractionToneDisplay tone in interaction.AvailableTonesForDisplay())
                        {
                            allTones.Add(tone.InteractionTone);
                        }

                        string name = null;
                        if (CareerToneScenario.SetTone(interaction, allTones, ref name))
                        {
                            IncStat("Private Eye Tone");
                        }
                    }
                }

                return(true);
            }
            ;

            RabbitHole hole = ManagerSituation.FindRabbitHole(RabbitHoleType.PoliceStation);

            if (hole == null)
            {
                IncStat("No Police Station");
                return(false);
            }

            return(Situations.PushInteraction <RabbitHole>(this, Sim, hole, PoliceStation.LowLevelPoliceWork.Singleton));
        }