コード例 #1
0
            public override bool Test(Sim actor, TimePortal target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (TravelUtil.PlayerMadeTravelRequest)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("PlayerMadeTravelRequest");
                    return(false);
                }

                if (!TimePortal.sTimeTravelerHasBeenSummoned)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("sTimeTravelerHasBeenSummoned");
                    return(false);
                }

                if (target.InUse && !target.IsActorUsingMe(actor))
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("InUse");
                    return(false);
                }

                if (!target.Active)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Active Fail");
                    return(false);
                }

                if (target.IsBroken)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(actor.IsFemale, TimePortal.sLocalizationKey + ":MustRepairTimePortal", new object[] { actor }));
                    return(false);
                }

                return(PublicTest(actor, target, isAutonomous, ref greyedOutTooltipCallback));
            }
コード例 #2
0
ファイル: TimePortalTravelEx.cs プロジェクト: yakoder/NRaas
        public static bool PreTimeTravel1(InteractionInstance ths)
        {
            if (!UIUtils.IsOkayToStartModalDialog())
            {
                return(false);
            }

            Sim actor = ths.InstanceActor as Sim;

            TravelUtil.PlayerMadeTravelRequest = true;
            OpportunityNames guid = CheckOpportunities(actor);

            string prompt;

            if (GameUtils.IsFutureWorld())
            {
                prompt = TimePortal.LocalizeString("ConfirmReturn", new object[0x0]);
            }
            else if (guid != OpportunityNames.Undefined)
            {
                prompt = TimePortal.LocalizeString("ConfirmWarningTravel", new object[0x0]);
            }
            else
            {
                prompt = TimePortal.LocalizeString("ConfirmTravel", new object[0x0]);
            }
            if (!TwoButtonDialog.Show(prompt, Localization.LocalizeString("Ui/Caption/Global:Accept", new object[0x0]), Localization.LocalizeString("Ui/Caption/Global:Cancel", new object[0x0])))
            {
                TravelUtil.PlayerMadeTravelRequest = false;
                return(false);
            }

            //Sims3.Gameplay.Gameflow.Singleton.DisableSave(this, "Ui/Caption/HUD/DisasterSaveError:Traveling");
            ths.CancellableByPlayer = false;
            if ((guid != OpportunityNames.Undefined) && (actor.OpportunityManager != null))
            {
                actor.OpportunityManager.CancelOpportunity(guid);
            }

            if (actor.OpportunityManager != null)
            {
                if (actor.OpportunityManager.HasOpportunity(OpportunityNames.EP11_HelpingTheTimeTraveler01))
                {
                    actor.OpportunityManager.CancelOpportunity(OpportunityNames.EP11_HelpingTheTimeTraveler01);
                }

                if (actor.OpportunityManager.HasOpportunity(OpportunityNames.EP11_HelpingTheTimeTraveler02))
                {
                    actor.OpportunityManager.CancelOpportunity(OpportunityNames.EP11_HelpingTheTimeTraveler02);
                }

                if (GameUtils.IsFutureWorld() && actor.OpportunityManager.HasOpportunity(OpportunityNames.EP11_RecalibrateDefenseGrid))
                {
                    actor.OpportunityManager.CancelOpportunity(OpportunityNames.EP11_RecalibrateDefenseGrid);
                }
            }

            return(true);
        }
コード例 #3
0
 public override string GetInteractionName(Sim actor, AncientPortal target, InteractionObjectPair iop)
 {
     if (GameUtils.IsFutureWorld())
     {
         return(TimePortal.LocalizeString("TravelHome", new object[0x0]));
     }
     return(TimePortal.LocalizeString("TravelWith", new object[0x0]) + Localization.Ellipsis);
 }
コード例 #4
0
 public override string GetInteractionName(Sim actor, TimeMachine target, InteractionObjectPair iop)
 {
     if (GameUtils.IsFutureWorld())
     {
         return(TimePortal.LocalizeString("TravelHome", new object[0x0]));
     }
     return(TimePortal.LocalizeString("Travel", new object[0x0]));
 }
コード例 #5
0
 public TravelControl(TimePortal ths, Sim Actor, List <Sim> Followers, List <ulong> SimGuids)
     : base(2, TimeUnit.Minutes)
 {
     mPortal    = ths;
     mActor     = Actor;
     mFollowers = Followers;
     mSimGuids  = SimGuids;
 }
コード例 #6
0
ファイル: TimePortalEx.cs プロジェクト: Robobeurre/NRaas
 public TravelControl(TimePortal ths, Sim Actor, List<Sim> Followers, List<ulong> SimGuids)
     : base(2, TimeUnit.Minutes)
 {
     mPortal = ths;
     mActor = Actor;
     mFollowers = Followers;
     mSimGuids = SimGuids;
 }
コード例 #7
0
            public bool TestUse(TimePortal obj)
            {
                if (!TestRepaired(obj))
                {
                    return(false);
                }

                return(obj.UseCount == 0 && obj.InWorld);
            }
コード例 #8
0
            protected override bool Satisfies(Sim actor, Sim target, TimePortal obj, bool isAutonomous, ref GreyedOutTooltipCallback callback)
            {
                if (!base.Satisfies(actor, target, obj, isAutonomous, ref callback))
                {
                    return(false);
                }

                return(CommonPregnancy.SatisfiesTryForBaby(actor, target, "TimePortalTryForBaby", isAutonomous, true, ref callback));
            }
コード例 #9
0
            protected override bool Satisfies(Sim actor, Sim target, TimePortal obj, bool isAutonomous, ref GreyedOutTooltipCallback callback)
            {
                if (!base.Satisfies(actor, target, obj, isAutonomous, ref callback))
                {
                    return(false);
                }

                return(CommonWoohoo.SatisfiesWoohoo(actor, target, "TimePortalWoohoo", isAutonomous, true, true, ref callback));
            }
コード例 #10
0
ファイル: TimePortalTravelEx.cs プロジェクト: yakoder/NRaas
            public override bool Test(Sim actor, TimePortal target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!target.Active)
                {
                    return(false);
                }

                if (target.IsBroken)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(actor.IsFemale, TimePortal.sLocalizationKey + ":MustRepairTimePortal", new object[] { actor }));
                    return(false);
                }

                return(PublicTest(actor, target, isAutonomous, ref greyedOutTooltipCallback));
            }
コード例 #11
0
ファイル: TimePortalEx.cs プロジェクト: Robobeurre/NRaas
        public static bool TravelToFuture(TimePortal ths, Sim Actor, List<Sim> Followers, List<ulong> SimGuids)
        {
            // Custom
            string reason = null;
            if (TravelUtilEx.FinalBoardingCall(Actor.Household, Followers, WorldName.FutureWorld, false, ref reason))
            {
                new TravelControl(ths, Actor, Followers, SimGuids);

                Traveler.SaveGame();

                return true;
            }

            Actor.ShowTNSIfSelectable(Localization.LocalizeString(Actor.IsFemale, "Gameplay/Visa/TravelUtil:CantTravelFutureTNS", new object[0x0]) + Common.NewLine + Common.NewLine + reason, StyledNotification.NotificationStyle.kSystemMessage, ObjectGuid.InvalidObjectGuid);
            return false;
        }
コード例 #12
0
        public static bool TravelToFuture(TimePortal ths, Sim Actor, List <Sim> Followers, List <ulong> SimGuids)
        {
            // Custom
            string reason = null;

            if (TravelUtilEx.FinalBoardingCall(Actor.Household, Followers, WorldName.FutureWorld, false, ref reason))
            {
                new TravelControl(ths, Actor, Followers, SimGuids);

                Traveler.SaveGame();

                return(true);
            }

            Actor.ShowTNSIfSelectable(Localization.LocalizeString(Actor.IsFemale, "Gameplay/Visa/TravelUtil:CantTravelFutureTNS", new object[0x0]) + Common.NewLine + Common.NewLine + reason, StyledNotification.NotificationStyle.kSystemMessage, ObjectGuid.InvalidObjectGuid);
            return(false);
        }
コード例 #13
0
        public static bool PreTimeTravel1(InteractionInstance ths, ITravelWith travelWith, List <Sim> travelers)
        {
            Sim actor = ths.InstanceActor as Sim;

            if (!UIUtils.IsOkayToStartModalDialog())
            {
                return(false);
            }

            if (GameUtils.IsFutureWorld())
            {
                foreach (Sim sim in actor.Household.Sims)
                {
                    if (sim != actor)
                    {
                        GreyedOutTooltipCallback callback = null;
                        if (TravelerSpace.Helpers.TravelUtilEx.CanSimTriggerTravelToFutureWorld(sim, true, ref callback))
                        {
                            Lazy.Add <List <Sim>, Sim>(ref travelers, sim);
                        }
                    }
                }
            }
            else
            {
                travelers.AddRange(ths.GetSelectedObjectsAsSims());
            }

            if (travelers.Count == 0)
            {
                return(false);
            }

            if ((actor.OpportunityManager != null) && actor.OpportunityManager.HasOpportunity(OpportunityNames.EP11_HelpingTheTimeTraveler01))
            {
                return(false);
            }

            string portal;

            TravelUtil.PlayerMadeTravelRequest = true;
            Dictionary <Sim, OpportunityNames> dictionary = CheckOpportunities(actor, travelers);

            if (GameUtils.IsFutureWorld())
            {
                portal = TimePortal.LocalizeString("ConfirmReturnWith", new object[0x0]);
            }
            else if (dictionary.Count > 0x0)
            {
                portal = TimePortal.LocalizeString("ConfirmTravelWith", new object[0x0]) + TimePortal.LocalizeString("ConfirmWarningTravelWith", new object[0x0]);
            }
            else
            {
                portal = TimePortal.LocalizeString("ConfirmTravelWith", new object[0x0]);
            }

            if (!TwoButtonDialog.Show(portal, Localization.LocalizeString("Ui/Caption/Global:Accept", new object[0x0]), Localization.LocalizeString("Ui/Caption/Global:Cancel", new object[0x0])))
            {
                return(false);
            }

            ths.CancellableByPlayer = false;
            //Sims3.Gameplay.Gameflow.Singleton.DisableSave(this, "Ui/Caption/HUD/DisasterSaveError:Traveling");
            if (dictionary.Count > 0x0)
            {
                foreach (Sim sim2 in dictionary.Keys)
                {
                    if (sim2.OpportunityManager != null)
                    {
                        sim2.OpportunityManager.CancelOpportunity(dictionary[sim2]);
                    }
                }
            }

            if ((GameUtils.IsFutureWorld() && (actor.OpportunityManager != null)) && actor.OpportunityManager.HasOpportunity(OpportunityNames.EP11_RecalibrateDefenseGrid))
            {
                actor.OpportunityManager.CancelOpportunity(OpportunityNames.EP11_RecalibrateDefenseGrid);
            }

            foreach (Sim sim3 in travelers)
            {
                travelWith.AddFollower(sim3);
            }

            return(true);
        }
コード例 #14
0
 public override string GetInteractionName(Sim actor, TimePortal target, InteractionObjectPair iop)
 {
     return(Common.LocalizeEAString(actor.IsFemale, "Gameplay/Excel/Socializing/Action:NRaasTryForBaby", new object[0]));
 }
コード例 #15
0
 public override string GetInteractionName(Sim actor, TimePortal target, InteractionObjectPair iop)
 {
     return(base.GetInteractionName(actor, target, new InteractionObjectPair(sOldSingleton, target)));
 }
コード例 #16
0
 public override string GetInteractionName(Sim actor, TimePortal target, InteractionObjectPair iop)
 {
     return base.GetInteractionName(actor, target, new InteractionObjectPair(sOldSingleton, target));
 }
コード例 #17
0
            public override bool Test(Sim actor, TimePortal target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!target.Active)
                {
                    return false;
                }

                if (target.IsBroken)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(actor.IsFemale, TimePortal.sLocalizationKey + ":MustRepairTimePortal", new object[] { actor }));
                    return false;
                }

                return PublicTest(actor, target, isAutonomous, ref greyedOutTooltipCallback);
            }
コード例 #18
0
        public static void SpawnInPortal(SimDescription sim)
        {
            if (sim == null || sim.CreatedSim == null)
            {
                return;
            }

            ITimePortal[] portals = Sims3.Gameplay.Queries.GetObjects <ITimePortal>();
            foreach (ITimePortal portal in portals)
            {
                TimePortal usePortal = portal as TimePortal;
                if (usePortal != null && usePortal.HasTimeTravelerBeenSummoned() && usePortal.LotCurrent != null && usePortal.InWorld && !usePortal.InUse)
                {
                    bool wasInactive = false;
                    if (usePortal.State == TimePortal.PortalState.Inactive)
                    {
                        wasInactive = true;
                        usePortal.UpdateState(TimePortal.PortalState.Active);
                    }

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

                        /*
                         * while(sim != null && sim.CreatedSim != null && sim.CreatedSim.CurrentInteraction != null)
                         * {
                         *  Common.Sleep(5);
                         * }
                         */
                    }

                    usePortal.PushArriveInteraction(new List <SimDescription> {
                        sim
                    });

                    if (wasInactive)
                    {
                        while (sim != null && sim.CreatedSim != null && sim.CreatedSim.CurrentInteraction is TimePortal.Arrive)
                        {
                            Common.Sleep(10);
                        }
                        usePortal.UpdateState(TimePortal.PortalState.Inactive);
                    }

                    //usePortal.PushDeactivatePortal(usePortal, sim.CreatedSim);

                    if (sim.CreatedSim != null)
                    {
                        List <Lot> randomList = new List <Lot>();
                        foreach (Lot lot in LotManager.AllLots)
                        {
                            if ((((lot != sim.CreatedSim.LotCurrent) && !lot.IsWorldLot) && (lot.IsCommunityLot && !lot.IsNeighborOfPlayer())))
                            {
                                randomList.Add(lot);
                            }
                        }

                        Lot choosen = null;
                        if (randomList.Count != 0)
                        {
                            choosen = RandomUtil.GetRandomObjectFromList <Lot>(randomList);
                        }

                        if (choosen != null)
                        {
                            sim.CreatedSim.InteractionQueue.Add(VisitCommunityLot.Singleton.CreateInstance(choosen, sim.CreatedSim, new InteractionPriority(InteractionPriorityLevel.Autonomous), false, true));
                        }
                    }
                }
                break;
            }
        }
コード例 #19
0
 public override string GetInteractionName(Sim actor, TimePortal target, InteractionObjectPair iop)
 {
     return(Common.LocalizeEAString(actor.IsFemale, "Gameplay/Excel/Socializing/Action:NRaasRiskyWooHoo", new object[0]) + Common.LocalizeEAString(false, "NRaas.Woohooer:RiskyChance", new object[] { Woohooer.Settings.GetRiskyBabyMadeChance(actor) }));
 }