Beispiel #1
0
        public static Dictionary<SimDescription, string> GetTravelChoices(Sim travelInitiator, Type filter, bool forUniversity)
        {
            Dictionary<SimDescription, string> results = new Dictionary<SimDescription, string>();

            foreach (Sim sim in LotManager.Actors)
            {
                if (sim.Household != travelInitiator.Household)
                {
                    if (GameStates.sTravelData != null) continue;
                }

                if ((sim.Household != travelInitiator.Household) || (!SimTypes.IsSelectable(sim)))
                {
                    bool allow = false;

                    if ((filter & Type.Friends) != Type.None)
                    {
                        foreach (Sim member in Households.AllSims(travelInitiator.Household))
                        {
                            if (member == sim) continue;

                            Relationship relation = Relationship.Get(sim, travelInitiator, false);
                            if (relation == null) continue;

                            if (relation.AreFriendsOrRomantic())
                            {
                                allow = true;
                                break;
                            }
                        }
                    }

                    if (!allow) continue;
                }

                results[sim.SimDescription] = TravelUtilEx.CheckForReasonsToFailTravel(sim.SimDescription, filter, forUniversity ? WorldName.University : WorldName.Undefined, false, false);
            }

            return results;
        }
Beispiel #2
0
        public static Pregnancy Start(Sim woman, SimDescription man, bool handlePlantSim)
        {
            if (handlePlantSim)
            {
                if ((SimTypes.IsSelectable(woman)) || (SimTypes.IsSelectable(man)))
                {
                    if (woman.SimDescription.IsPlantSim || man.IsPlantSim)
                    {
                        IGameObject obj2 = GlobalFunctions.CreateObjectOutOfWorld("forbiddenFruit", ProductVersion.EP9, "Sims3.Gameplay.Objects.Gardening.ForbiddenFruit", null);
                        if (obj2 != null)
                        {
                            Inventories.TryToMove(obj2, woman);
                            Audio.StartSound("sting_baby_conception");
                        }

                        return(null);
                    }
                }
            }

            AgingManager.Singleton.CancelAgingAlarmsForSim(woman.SimDescription.AgingState);
            Pregnancy p = null;

            if (woman.IsHuman)
            {
                p = new Pregnancy(woman, man);
            }
            else
            {
                p = new PetPregnancy(woman, man);
            }

            p.PreggersAlarm = woman.AddAlarmRepeating(1f, TimeUnit.Hours, p.HourlyCallback, 1f, TimeUnit.Hours, "Hourly Pregnancy Update Alarm", AlarmType.AlwaysPersisted);
            woman.SimDescription.Pregnancy = p;

            EventTracker.SendEvent(new PregnancyEvent(EventTypeId.kGotPregnant, woman, man.CreatedSim, p, null));
            return(p);
        }