Beispiel #1
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);
                    }
                }
            }
        }
        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);
                    }
                }
            }
        }