Esempio n. 1
0
        public override bool Run()
        {
            try
            {
                List <InteractionObjectPair> interactions = DebugMenu.GetInteractions(Actor, Target, Hit);
                if (interactions == null)
                {
                    return(false);
                }

                for (int i = interactions.Count - 1; i >= 0; i--)
                {
                    if (!DebugEnabler.Settings.mInteractions.ContainsKey(interactions[i].InteractionDefinition.GetType()))
                    {
                        interactions.RemoveAt(i);
                    }
                }

                if (interactions.Count == 0)
                {
                    Common.Notify(Common.Localize("HotKeys:Failure"));
                    return(true);
                }

                InteractionDefinitionOptionList.Perform(Actor, Hit, interactions);
                return(true);
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Esempio n. 2
0
        protected override OptionResult Run(GameHitParameters <GameObject> parameters)
        {
            List <InteractionObjectPair> interactions = GetInteractions(parameters.mActor, parameters.mTarget, parameters.mHit);

            if (interactions == null)
            {
                return(OptionResult.Failure);
            }

            return(InteractionDefinitionOptionList.Perform(parameters.mActor, parameters.mHit, interactions));
        }
Esempio n. 3
0
        public override bool Run()
        {
            try
            {
                List <Item> choices = new List <Item>();

                foreach (RabbitHole hole in Sims3.Gameplay.Queries.GetObjects <RabbitHole>())
                {
                    choices.Add(new Item(hole));
                }

                Item choice = new CommonSelection <Item>(Common.Localize("GoToRabbithole:MenuName", Target.IsFemale), choices).SelectSingle();
                if (choice == null)
                {
                    return(false);
                }

                List <InteractionObjectPair> interactions = choice.Value.GetAllInteractionsForActor(Target);
                if (interactions == null)
                {
                    return(false);
                }

                for (int i = interactions.Count - 1; i >= 0; i--)
                {
                    if (interactions[i].InteractionDefinition is IImmediateInteractionDefinition)
                    {
                        interactions.RemoveAt(i);
                    }
                }

                if (InteractionDefinitionOptionList.Perform(Target, GameObjectHit.NoHit, interactions) == OptionResult.Failure)
                {
                    InteractionInstance interaction = VisitCommunityLotEx.Singleton.CreateInstance(choice.Value.LotCurrent, Target, GetPriority(), Autonomous, CancellableByPlayer);

                    Target.InteractionQueue.Add(interaction);
                }

                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Esempio n. 4
0
        public override bool Run()
        {
            try
            {
                Definition definition = InteractionDefinition as Definition;

                List <InteractionObjectPair> interactions = definition.Hole.GetAllInteractionsForActor(Actor);
                if (interactions == null)
                {
                    return(false);
                }

                InteractionDefinitionOptionList.Perform(Actor, definition.Hit, interactions, true);
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
            }
            return(true);
        }
Esempio n. 5
0
 protected override OptionResult Run(GameHitParameters <Sim> parameters)
 {
     return(InteractionDefinitionOptionList.Perform(parameters.mActor, parameters.mHit, SelectLoopingAnimation.Item.GetInteractions(parameters.mTarget)));
 }
Esempio n. 6
0
            protected override void OnPerform()
            {
                Sims3.Gameplay.UI.PieMenu.ClearInteractions();
                Sims3.Gameplay.UI.PieMenu.HidePieMenuSimHead = true;

                Sim activeActor = Sim.ActiveActor;

                if (activeActor != null)
                {
                    Sim sim = null;

                    SimDescription simDesc = mSim as SimDescription;
                    if (simDesc != null)
                    {
                        sim = simDesc.CreatedSim;
                    }

                    if (sim != null)
                    {
                        if (activeActor.InteractionQueue.CanPlayerQueue())
                        {
                            bool success = false;
                            try
                            {
                                List <InteractionObjectPair> interactions = new List <InteractionObjectPair>();
                                interactions.Add(new InteractionObjectPair(CallOver.Singleton, sim));

                                List <InteractionObjectPair> others = sim.GetAllInteractionsForActor(activeActor);
                                if (others != null)
                                {
                                    interactions.AddRange(others);
                                }

                                InteractionDefinitionOptionList.Perform(activeActor, new GameObjectHit(GameObjectHitType.Object), interactions);
                                success = true;
                            }
                            catch (Exception e)
                            {
                                Common.Exception(activeActor, sim, e);
                            }

                            if (!success)
                            {
                                List <InteractionObjectPair> immediateInteractions = new List <InteractionObjectPair>();

                                foreach (InteractionObjectPair interaction in sim.mInteractions)
                                {
                                    if (interaction.InteractionDefinition is IImmediateInteractionDefinition)
                                    {
                                        immediateInteractions.Add(interaction);
                                    }
                                }

                                List <InteractionObjectPair> interactions = sim.BuildInteractions(activeActor, immediateInteractions);

                                InteractionDefinitionOptionList.Perform(activeActor, new GameObjectHit(GameObjectHitType.Object), interactions);
                            }
                        }
                    }
                    else
                    {
                        List <InteractionObjectPair> interactions = new List <InteractionObjectPair>();

                        interactions.Add(new InteractionObjectPair(NRaas.MasterControllerSpace.Interactions.SimDescriptionInteraction.Singleton, new SimDescriptionObject(mSim)));

                        InteractionDefinitionOptionList.Perform(activeActor, new GameObjectHit(GameObjectHitType.Object), interactions);
                    }
                }
            }