Exemplo n.º 1
0
        protected void TriggerMoveToNewWorldEx()
        {
            RemoveTriggerAlarm();
            List <Sim> allTravelers = new List <Sim>(Followers);

            allTravelers.Add(Actor);

            // Custom
            string reason = null;

            if (Helpers.TravelUtilEx.FinalBoardingCall(Actor.Household, allTravelers, WorldName.Undefined, true, ref reason))
            {
                ForeignVisitorsSituation.ForceKillForeignVisitorsSituation();
                HolographicProjectionSituation.ForceKillHolographicVisitorsSituation();
                Camera.SetView(CameraView.MapView, false, true);

                // Custom
                GameStatesEx.MoveToNewWorld(DestinationWorldName, TravelingSimGuids, mMovingWorldSaved, mPackFurniture);
            }
            else
            {
                GameStates.WorldMoveRequested = false;
                Actor.ShowTNSIfSelectable(Common.LocalizeEAString(Actor.IsFemale, "Gameplay/Visa/TravelUtil:ForceMoveCancel") + Common.NewLine + Common.NewLine + reason, StyledNotification.NotificationStyle.kSystemMessage, ObjectGuid.InvalidObjectGuid);
                foreach (Sim sim in allTravelers)
                {
                    if (!sim.IsDying())
                    {
                        sim.AddExitReason(ExitReason.CanceledByScript);
                    }
                }
            }
        }
        private new void TriggerTravelToUniversityWorld()
        {
            RemoveTriggerAlarm();
            List <Sim> allTravelers = new List <Sim>(TravelingSims);

            allTravelers.Add(Actor);

            string reason = null;

            // Custom
            if (Helpers.TravelUtilEx.FinalBoardingCall(Actor.Household, allTravelers, WorldName.University, false, ref reason))
            {
                int travelDuration = (TravelDuration / 7) * Traveler.Settings.mUniversityTermLength;

                ForeignVisitorsSituation.ForceKillForeignVisitorsSituation();
                HolographicProjectionSituation.ForceKillHolographicVisitorsSituation();

                Camera.SetView(CameraView.MapView, false, true);
                int tripLength           = (TravelUtil.sOverriddenTripLength > 0x0) ? TravelUtil.sOverriddenTripLength : travelDuration;
                int lastTimeAtUniversity = -2147483648;
                foreach (Sim sim in allTravelers)
                {
                    if (lastTimeAtUniversity < sim.DegreeManager.LastTimeAtUniversity)
                    {
                        lastTimeAtUniversity = sim.DegreeManager.LastTimeAtUniversity;
                    }
                }

                int numDaysSinceLastInDestWorld = -1;
                if (lastTimeAtUniversity >= 0x0)
                {
                    numDaysSinceLastInDestWorld = SimClock.ElapsedCalendarDays() - lastTimeAtUniversity;
                }

                // Custom
                GameStatesEx.TravelToVacationWorld(kUniversityWorldName, mTravelingSimsGuids, tripLength, numDaysSinceLastInDestWorld);
            }
            else
            {
                Actor.ShowTNSIfSelectable(TravelUtil.LocalizeString(Actor.IsFemale, "CantTravelTNS", new object[] { TravelCost }) + Common.NewLine + Common.NewLine + reason, StyledNotification.NotificationStyle.kSystemMessage, ObjectGuid.InvalidObjectGuid);
                Actor.ModifyFunds(TravelCost);

                foreach (Sim sim2 in allTravelers)
                {
                    if (!sim2.IsDying())
                    {
                        sim2.AddExitReason(ExitReason.CanceledByScript);
                    }
                }
            }
        }
Exemplo n.º 3
0
            protected override void OnPerform()
            {
                if (!mSimGuids.Contains(mActor.SimDescription.SimDescriptionId))
                {
                    mSimGuids.Add(mActor.SimDescription.SimDescriptionId);
                }

                ForeignVisitorsSituation.ForceKillForeignVisitorsSituation();
                HolographicProjectionSituation.ForceKillHolographicVisitorsSituation();
                Camera.SetView(CameraView.MapView, false, true);

                // Custom
                CleanUpReservedVehicles(mActor, mFollowers);

                if (mPortal != null)
                {
                    mPortal.StopActiveFX();
                }

                // Custom
                GameStatesEx.TravelToVacationWorld(WorldName.FutureWorld, mSimGuids, 0x0, 0x0);
                CauseEffectService.GetInstance().SetDepartureTimePortal(mPortal.ObjectId);
            }
Exemplo n.º 4
0
            private new bool CanMakeBabyWith(Sim actor, Sim target)
            {
                BuffBetrayed.BuffInstanceBetrayed betrayed;
                if (actor == target)
                {
                    return(false);
                }
                if (actor.SimDescription.Species != target.SimDescription.Species)
                {
                    return(false);
                }
                if ((target.IsRobot || target.OccultManager.HasOccultType(OccultTypes.Mummy)) || (target.OccultManager.HasOccultType(OccultTypes.PlantSim) || HolographicProjectionSituation.IsSimHolographicallyProjected(target)))
                {
                    return(false);
                }
                if (target.OccultManager.HasOccultType(OccultTypes.TimeTraveler))
                {
                    return(false);
                }
                if (target.Service is GrimReaper)
                {
                    return(false);
                }
                if (BuffBetrayed.DoesSimFeelBetrayed(actor, target.SimDescription, out betrayed))
                {
                    return(false);
                }
                if (!OccultImaginaryFriend.CanSimGetRomanticWithSim(actor, target))
                {
                    return(false);
                }
                if ((target.CurrentInteraction != null) && (target.InteractionQueue.HasInteractionOfType(this) || target.InteractionQueue.HasInteractionOfType(Hospital.BeForcedToMakeBabyWith.Singleton)))
                {
                    return(false);
                }
                GreyedOutTooltipCallback callback = null;
                string reason;

                if (!CommonSocials.CanGetRomantic(actor, target, false, true, true, ref callback, out reason))
                {
                    return(false);
                }
                CASAgeGenderFlags flags = CASAgeGenderFlags.YoungAdult | CASAgeGenderFlags.Elder | CASAgeGenderFlags.Adult;

                if (Woohooer.Settings.AllowTeen(true))
                {
                    flags = flags | CASAgeGenderFlags.Teen;
                }
                return(((actor.SimDescription.Age & flags) != CASAgeGenderFlags.None) && ((target.SimDescription.Age & flags) != CASAgeGenderFlags.None));
            }
Exemplo n.º 5
0
        protected new void TriggerTravelToVacationWorld()
        {
            RemoveTriggerAlarm();

            List <Sim> allTravelers = new List <Sim>(Followers);

            allTravelers.Add(Actor);

            string reason = null;

            // Custom
            if ((TravelingSimGuids.Count == 0) || (Helpers.TravelUtilEx.FinalBoardingCall(Actor.Household, allTravelers, DestinationWorldName, false, ref reason)))
            {
                ForeignVisitorsSituation.ForceKillForeignVisitorsSituation();
                HolographicProjectionSituation.ForceKillHolographicVisitorsSituation();

                int lastTimeOnVacation = -2147483648;
                foreach (Sim sim in allTravelers)
                {
                    if (lastTimeOnVacation < sim.VisaManager.LastTimeOnVacation)
                    {
                        lastTimeOnVacation = sim.VisaManager.LastTimeOnVacation;
                    }
                }
                int numDaysSinceLastInDestWorld = -1;
                if (lastTimeOnVacation > 0)
                {
                    numDaysSinceLastInDestWorld = SimClock.ElapsedCalendarDays() - lastTimeOnVacation;
                }

                Camera.SetView(CameraView.MapView, false, true);
                int tripLength = (TravelUtil.sOverriddenTripLength > 0x0) ? TravelUtil.sOverriddenTripLength : TravelDuration;

                // Custom
                GameStatesEx.TravelToVacationWorld(DestinationWorldName, TravelingSimGuids, tripLength, numDaysSinceLastInDestWorld);

                TelemetryStats.VacationTelemetryInfo vacationTelemetryInfo = new TelemetryStats.VacationTelemetryInfo();
                vacationTelemetryInfo.LeavingHomeWorld = true;
                vacationTelemetryInfo.WorldId          = DestinationWorldName;

                int num2 = 0x0;

                if (TravelingSimGuids.Count > 0)
                {
                    vacationTelemetryInfo.NumberOfSimsInHoushold    = Households.NumSims(Actor.Household);
                    vacationTelemetryInfo.NumberOfSimsThatDidTravel = allTravelers.Count;

                    foreach (Sim sim in Households.AllSims(Actor.Household))
                    {
                        // Custom
                        if (CommonSpace.Helpers.TravelUtilEx.CheckForReasonsToFailTravel(sim.SimDescription, Traveler.Settings.mTravelFilter, DestinationWorldName, false, false) == null)
                        {
                            num2++;
                        }
                    }
                }
                else
                {
                    vacationTelemetryInfo.NumberOfSimsInHoushold    = 0;
                    vacationTelemetryInfo.NumberOfSimsThatDidTravel = 0;
                }

                vacationTelemetryInfo.NumberOfSimsAbleToTravel = num2;
                vacationTelemetryInfo.VisaLevels = new PairedListDictionary <ulong, int>();
                foreach (Sim sim2 in allTravelers)
                {
                    int visaLevel = sim2.VisaManager.GetVisaLevel(DestinationWorldName);
                    vacationTelemetryInfo.VisaLevels.Add(sim2.SimDescription.SimDescriptionId, visaLevel);
                }

                vacationTelemetryInfo.TravelDateAndTime = SimClock.CurrentTime();
                EventTracker.SendEvent(new VacationInfoEvent(EventTypeId.kVacationTelemetryInfo, vacationTelemetryInfo));
            }
            else
            {
                if (DestinationWorldName == WorldName.FutureWorld)
                {
                    Actor.ShowTNSIfSelectable(TravelUtil.LocalizeString(Actor.IsFemale, "CantTravelFutureTNS", new object[] { TravelCost }), StyledNotification.NotificationStyle.kSystemMessage, ObjectGuid.InvalidObjectGuid);
                }
                else
                {
                    Actor.ShowTNSIfSelectable(TravelUtil.LocalizeString(Actor.IsFemale, "CantTravelTNS", new object[] { TravelCost }) + Common.NewLine + Common.NewLine + reason, StyledNotification.NotificationStyle.kSystemMessage, ObjectGuid.InvalidObjectGuid);
                }

                Actor.ModifyFunds(TravelCost);

                foreach (Sim sim3 in allTravelers)
                {
                    if (!sim3.IsDying())
                    {
                        sim3.AddExitReason(ExitReason.CanceledByScript);
                    }
                }
            }
        }