Example #1
0
        public override void Init(ArrestSuspectSituation parent)
        {
            IPoliceStation objects = (IPoliceStation)RabbitHole.GetRandomRabbitHoleOfType(RabbitHoleType.PoliceStation);

            if (objects == null)
            {
                base.Exit();
            }
            else
            {
                IPoliceStation randomObjectFromList = RandomUtil.GetRandomObjectFromList <IPoliceStation>(objects);
                parent.Station = randomObjectFromList;
            }
            SimDescription description = parent.CreateNewCopFromPool();

            if (description == null)
            {
                base.Exit();
            }
            else
            {
                if (description.CreatedSim != null)
                {
                    parent.Cop = description.CreatedSim;
                    parent.Cop.SwitchToOutfitWithoutSpin(OutfitCategories.Career);
                }
                else
                {
                    SimOutfit outfit = description.GetOutfit(OutfitCategories.Career, 0);
                    parent.Cop = description.Instantiate(Vector3.OutOfWorld, outfit.Key);
                }
                parent.CopCar = CarNpcManager.Singleton.CreateServiceCar(ServiceType.Police);
                base.ForceSituationSpecificInteraction(parent.Cop, parent.Cop, new ArrestSuspectSituation.GoToCulpritsLocation.Definition(base.Parent), null, new Callback(this.OnCompletion), new Callback(this.OnFailure), new InteractionPriority(InteractionPriorityLevel.High));
            }
        }
Example #2
0
 private ArrestSuspectSituation(Lot lot, Sim simToArrest)
     : base(lot)
 {
     this.SimToArrest    = simToArrest;
     this.ArrestLocation = lot;
     this.SimsLocation   = RabbitHole.GetRandomRabbitHoleOfType(RabbitHoleType.PoliceStation);
     base.SetState(new CreateCopAndRoute(this));
 }