Esempio n. 1
0
        protected override OptionResult Run(IActor actor, IMausoleum mausoleum)
        {
            if (CameraController.IsMapViewModeEnabled())
            {
                Sims3.Gameplay.Core.Camera.ToggleMapView();
            }

            HudModel.OpenObjectInventoryForOwner(mausoleum);
            return(OptionResult.SuccessClose);
        }
Esempio n. 2
0
        public override bool Run()
        {
            try
            {
                if (!Target.RouteToCan(Actor, true))
                {
                    return(false);
                }
                StateMachineClient stateMachine = Target.GetStateMachine(Actor, false);
                stateMachine.AddOneShotScriptEventHandler(0x65, Target.EventCallbackRemoveLid);
                stateMachine.AddOneShotScriptEventHandler(0x66, Target.EventCallbackAddLid);

                Trashcan target = Target as Trashcan;
                if (target != null)
                {
                    mLidGuid = target.SetupLidProp(stateMachine);
                }

                IFairyBoobyTrap trap = Target as IFairyBoobyTrap;
                if (((trap != null) && ((trap.BoobyTrapComponent != null) ? trap.BoobyTrapComponent.CanTriggerTrap(Actor.SimDescription) : false)) && trap.TriggerTrap(Actor))
                {
                    TrashcanOutside outsideCan = Target as TrashcanOutside;
                    if (outsideCan != null)
                    {
                        TrashPile.CreateFairyTrapTrashPiles(outsideCan);
                    }
                    return(false);
                }

                StandardEntry();
                BeginCommodityUpdates();

                try
                {
                    if (!Autonomous)
                    {
                        Target.HasBeenRummagedByPlayer = true;
                    }
                    Target.SetRummagingSim(Actor);
                    Target.RummageBroadcasterCreate();
                    stateMachine.RequestState("x", "LoopRummage");
                    if ((!Autonomous && (HudController.InfoState != InfoState.Inventory)) && Actor.IsActiveSim)
                    {
                        HudController.SetInfoState(InfoState.Inventory);
                    }
                    mNetWorth = Target.LotCurrent.Household.NetWorth();
                    DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), LoopDel, stateMachine);
                    Target.RummageBroadcasterDestroy();
                    stateMachine.RequestState("x", "Exit");
                    if (!Autonomous)
                    {
                        HudModel.OpenObjectInventoryForOwner(null);
                    }
                }
                finally
                {
                    EndCommodityUpdates(true);
                }

                BuffInstance element = Actor.BuffManager.GetElement(BuffNames.Smelly);
                if (element != null)
                {
                    element.mBuffOrigin = Origin.FromDumpsterDiving;
                }
                StandardExit();
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }