Example #1
0
        public override bool Run()
        {
            try
            {
                if (!IntroTutorial.IsRunning || IntroTutorial.AreYouExitingTutorial())
                {
                    SocialJig = GlobalFunctions.CreateObjectOutOfWorld("horseMountDismountJig", ProductVersion.EP5) as SocialJig;
                    SocialJig.RegisterParticipants(Actor, Target);
                    bool succeeded = false;
                    if (!BeginSocialInteraction(new SocialInteractionB.Definition(null, Saddle.LocalizeString(Target.IsFemale, "HaveOutfitEdited", new object[0x0]), false), true, false))
                    {
                        return(succeeded);
                    }
                    StandardEntry();
                    if (Responder.Instance.OptionsModel.SaveGameInProgress)
                    {
                        BeginCommodityUpdates();
                        EndCommodityUpdates(true);
                        StandardExit();
                        return(true);
                    }
                    mTookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(Target, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                    if (!mTookSemaphore)
                    {
                        StandardExit();
                        return(false);
                    }
                    if (Target.IsSelectable)
                    {
                        while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                        {
                            SpeedTrap.Sleep();
                        }

                        BeginCommodityUpdates();
                        SimDescription simDescription = Target.SimDescription;
                        if (simDescription == null)
                        {
                            throw new Exception("ChangeOutfit:  sim doesn't have a description!");
                        }
                        CASChangeReporter.Instance.ClearChanges();

                        new Sims.Dresser().Perform(new GameHitParameters <GameObject>(Target, Target, GameObjectHit.NoHit));

                        while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                        {
                            SpeedTrap.Sleep();
                        }

                        EndCommodityUpdates(true);

                        /*
                         * if (Target.CurrentOutfitIndex > simDescription.GetOutfitCount(Target.CurrentOutfitCategory))
                         * {
                         *  Target.UpdateOutfitInfo();
                         * }
                         *
                         * (Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).NotifySimChanged(Target.ObjectId);
                         */

                        StandardExit();
                        return(true);
                    }
                    StandardExit();
                }
                return(false);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }

            return(false);
        }
Example #2
0
        public override bool Run()
        {
            try
            {
                if (Target.Route(this))
                {
                    StandardEntry();
                    Mirror.EnterStateMachine(this);
                    AnimateSim("ChangeAppearance");
                    StartStages();

                    if (Responder.Instance.OptionsModel.SaveGameInProgress)
                    {
                        StandardExit();
                        return(false);
                    }

                    mTookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(Actor, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                    if (!mTookSemaphore)
                    {
                        StandardExit();
                        return(false);
                    }
                    if (!Actor.IsSelectable)
                    {
                        StandardExit();
                        return(false);
                    }

                    if (!IntroTutorial.IsRunning || IntroTutorial.AreYouExitingTutorial())
                    {
                        while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                        {
                            SpeedTrap.Sleep();
                        }

                        int careerOutfitIndex = Actor.SimDescription.CareerOutfitIndex;
                        if (Actor.CurrentOutfitCategory == OutfitCategories.Career)
                        {
                            ArrayList outfits = Actor.SimDescription.GetOutfits(Actor.CurrentOutfitCategory);
                            for (int i = 0; i < outfits.Count; i++)
                            {
                                if (Actor.CurrentOutfit.Key == (outfits[i] as SimOutfit).Key)
                                {
                                    Actor.SimDescription.CareerOutfitIndex = i;
                                    break;
                                }
                            }
                        }

                        new Sims.Mirror().Perform(new GameHitParameters <GameObject>(Actor, Actor, GameObjectHit.NoHit));

                        while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                        {
                            SpeedTrap.Sleep();
                        }

                        AnimateSim("NodAsApproval");
                        AnimateSim("LeaveMirror");

                        if (Actor.CurrentOutfitCategory == OutfitCategories.Career)
                        {
                            Actor.SimDescription.CareerOutfitIndex = careerOutfitIndex;
                        }

                        StandardExit();

                        /*
                         * Actor.RecreateOccupationOutfits();
                         * (Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).NotifySimChanged(Actor.ObjectId);
                         */
                        return(true);
                    }

                    StandardExit();
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }

            return(false);
        }
Example #3
0
        public override bool Run()
        {
            try
            {
                if (Actor.IsHuman)
                {
                    InteractionInstance entry = Singleton.CreateInstance(Target, Target, GetPriority(), false, true);
                    return(Target.InteractionQueue.Add(entry));
                }
                if (!IntroTutorial.IsRunning || IntroTutorial.AreYouExitingTutorial())
                {
                    if (Responder.Instance.OptionsModel.SaveGameInProgress)
                    {
                        return(false);
                    }
                    mTookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(Actor, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                    if (!mTookSemaphore)
                    {
                        return(false);
                    }
                    if (Actor.IsSelectable)
                    {
                        while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                        {
                            SpeedTrap.Sleep();
                        }

                        BeginCommodityUpdates();
                        SimDescription simDescription = Actor.SimDescription;
                        if (simDescription == null)
                        {
                            throw new Exception("CustomizeCollarAndCoats: Sim doesn't have a description!");
                        }
                        CASChangeReporter.Instance.ClearChanges();

                        new Sims.Dresser().Perform(new GameHitParameters <GameObject>(Target, Target, GameObjectHit.NoHit));

                        while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                        {
                            SpeedTrap.Sleep();
                        }

                        EndCommodityUpdates(true);

                        /*
                         * (Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).NotifySimChanged(Actor.ObjectId);
                         */
                        return(true);
                    }
                }
                return(false);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }

            return(false);
        }
Example #4
0
        public static void DisplayCAS(Sim simInCAS, ref bool tookSemaphore)
        {
            if (!Responder.Instance.OptionsModel.SaveGameInProgress)
            {
                bool flag = GameStates.WaitForInteractionStateChangeSemaphore(simInCAS, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                tookSemaphore = flag;
                if (tookSemaphore)
                {
                    while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                    {
                        SpeedTrap.Sleep();
                    }

                    new Sims.Basic.Tattoo().Perform(new GameHitParameters <GameObject>(simInCAS, simInCAS, GameObjectHit.NoHit));

                    while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                    {
                        SpeedTrap.Sleep();
                    }
                }
            }
        }
Example #5
0
        public static bool DisplayCAS(Sim simInCAS, Sim stylerSim, ref bool tookSemaphore, bool forceFailureOutfit)
        {
            if (!Responder.Instance.OptionsModel.SaveGameInProgress)
            {
                tookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(simInCAS, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                if (!tookSemaphore)
                {
                    return(false);
                }
                Sim sim = stylerSim ?? simInCAS;
                if (sim.Household == Household.ActiveHousehold)
                {
                    while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                    {
                        SpeedTrap.Sleep();
                    }

                    StyledNotification notification = null;
                    if (stylerSim != null)
                    {
                        Stylist occupation = stylerSim.Occupation as Stylist;
                        if (occupation != null)
                        {
                            Stylist.Makeover currentJob = occupation.CurrentJob as Stylist.Makeover;
                            if ((currentJob != null) && (currentJob.MakeoverTarget == simInCAS))
                            {
                                string titleText = currentJob.JobTitle + ":" + Common.NewLine + Common.NewLine;
                                foreach (TaskInfo info in occupation.GetTaskNames().Values)
                                {
                                    titleText = titleText + "- " + info.TaskDescription + Common.NewLine;
                                }
                                StyledNotification.Format format = new StyledNotification.Format(titleText, StyledNotification.NotificationStyle.kGameMessagePositive);
                                notification = StyledNotification.Show(format);
                            }
                        }
                    }

                    new Sims.Stylist().Perform(new GameHitParameters <GameObject>(simInCAS, simInCAS, GameObjectHit.NoHit));

                    if (forceFailureOutfit)
                    {
                        CASLogic.GetSingleton().SetOverrideExitOutfit(OutfitCategories.Makeover, 0x0);
                    }

                    while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                    {
                        SpeedTrap.Sleep();
                    }

                    if (notification != null)
                    {
                        notification.CloseNow();
                    }

                    Styling.UpdateJobTrackerIfNecessary(simInCAS, stylerSim, forceFailureOutfit);
                    return(true);
                }
            }
            return(false);
        }
Example #6
0
        public override bool Run()
        {
            try
            {
                if (!IntroTutorial.IsRunning || IntroTutorial.AreYouExitingTutorial())
                {
                    if (!Target.RouteAndOpenDrawer(this, Actor))
                    {
                        return(false);
                    }
                    if (Responder.Instance.OptionsModel.SaveGameInProgress)
                    {
                        BeginCommodityUpdates();
                        bool succeeded = Target.CloseDrawerAndExit(this, Actor);
                        EndCommodityUpdates(succeeded);
                        return(succeeded);
                    }

                    mTookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(Actor, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                    if (!mTookSemaphore)
                    {
                        StandardExit();
                        return(false);
                    }

                    if (Actor.IsSelectable)
                    {
                        while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                        {
                            SpeedTrap.Sleep();
                        }

                        BeginCommodityUpdates();

                        new Sims.Dresser().Perform(new GameHitParameters <GameObject>(Actor, Actor, GameObjectHit.NoHit));

                        while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                        {
                            SpeedTrap.Sleep();
                        }

                        bool flag2 = Target.CloseDrawerAndExit(this, Actor);
                        Actor.InteractionQueue.CancelAllInteractionsByType(Dresser.ChangeClothes.Singleton);

                        EndCommodityUpdates(flag2);

                        /*
                         * (Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).NotifySimChanged(Actor.ObjectId);
                         */
                        return(flag2);
                    }

                    StandardExit();
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }

            return(false);
        }
Example #7
0
        private new void OnDisplayCAS()
        {
            while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
            {
                SpeedTrap.Sleep();
            }

            if (Actor.IsSelectable)
            {
                Definition interactionDefinition = InteractionDefinition as Definition;
                switch (interactionDefinition.GetSurgeryType())
                {
                case Hospital.SurgeryTypes.PlasticSurgeryFaceCheap:
                    ApplySurgery(Hospital.SurgeryTypes.PlasticSurgeryFaceCheap, Hospital.kCheapSurgeryFaceCost, Hospital.kCheapSurgeryFailureChance, "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryFaceFailure", "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryFaceSuccess");
                    break;

                case Hospital.SurgeryTypes.PlasticSurgeryFaceExpensive:
                    ApplySurgery(Hospital.SurgeryTypes.PlasticSurgeryFaceExpensive, Hospital.kExpensiveSurgeryFaceCost, Hospital.kExpensiveSurgeryFailureChance, "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryFaceFailure", "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryFaceSuccess");
                    break;

                case Hospital.SurgeryTypes.PlasticSurgeryBodyCheap:
                    ApplySurgery(Hospital.SurgeryTypes.PlasticSurgeryBodyCheap, Hospital.kCheapSurgeryBodyCost, Hospital.kCheapSurgeryFailureChance, "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryBodyFailure", "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryBodySuccess");
                    break;

                case Hospital.SurgeryTypes.PlasticSurgeryBodyExpensive:
                    ApplySurgery(Hospital.SurgeryTypes.PlasticSurgeryBodyExpensive, Hospital.kExpensiveSurgeryBodyCost, Hospital.kExpensiveSurgeryFailureChance, "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryBodyFailure", "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryBodySuccess");
                    break;

                case Hospital.SurgeryTypes.PlasticSurgeryCorrectiveFace:
                    if ((Actor.SimDescription.PreSurgeryFacialBlends != null) && (Actor.FamilyFunds >= Hospital.kCorrectiveFaceSurgeryCost))
                    {
                        Actor.ModifyFunds(-Hospital.kCorrectiveFaceSurgeryCost);
                        OutfitUtils.RestoreFace(Actor);
                        Actor.ShowTNSAndPlayStingIfSelectable(Common.LocalizeEAString(Actor.IsFemale, "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:CorrectiveSurgerySuccess", new object[] { Actor }), StyledNotification.NotificationStyle.kGameMessagePositive, Target.ObjectId, ObjectGuid.InvalidObjectGuid, "sting_plastic_surgery_undo");
                        mReaction = Reaction.Happy;
                    }
                    break;

                case Hospital.SurgeryTypes.PlasticSurgeryCorrectiveBody:
                    if ((Actor.SimDescription.PreSurgeryBodyFitness != -1f) && (Actor.FamilyFunds >= Hospital.kCorrectiveBodySurgeryCost))
                    {
                        Actor.ModifyFunds(-Hospital.kCorrectiveBodySurgeryCost);
                        OutfitUtils.RestoreBody(Actor);
                        Actor.ShowTNSAndPlayStingIfSelectable(Common.LocalizeEAString(Actor.IsFemale, "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:CorrectiveSurgerySuccess", new object[] { Actor }), StyledNotification.NotificationStyle.kGameMessagePositive, Target.ObjectId, ObjectGuid.InvalidObjectGuid, "sting_plastic_surgery_undo");
                        mReaction = Reaction.Happy;
                    }
                    break;
                }

                /*
                 * if (mReaction != Reaction.None)
                 * {
                 *  Actor.RecreateOccupationOutfits();
                 *  (Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).NotifySimChanged(Actor.ObjectId);
                 * }
                 */
            }
        }
Example #8
0
            // Methods
            public override bool Run()
            {
                if (!IntroTutorial.IsRunning || IntroTutorial.AreYouExitingTutorial())
                {
                    if (!RouteAndAnimate(this, base.Actor))
                    {
                        return(false);
                    }

                    if (Sims3.Gameplay.UI.Responder.Instance.OptionsModel.SaveGameInProgress)
                    {
                        base.BeginCommodityUpdates();
                        base.EndCommodityUpdates(true);
                        return(true);
                    }
                    this.mTookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(base.Actor, ~(ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                    if (!this.mTookSemaphore)
                    {
                        base.StandardExit();
                        return(false);
                    }
                    //  if (base.Actor.IsSelectable)
                    {
                        while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                        {
                            Simulator.Sleep(0);
                        }
                        base.BeginCommodityUpdates();
                        SimDescription simDescription = base.Actor.SimDescription;
                        if (simDescription == null)
                        {
                            throw new Exception("ChangeOutfit:  sim doesn't have a description!");
                        }
                        CASChangeReporter.Instance.ClearChanges();
                        GameStates.TransitionToCASDresserMode();
                        CASLogic singleton = CASLogic.GetSingleton();
                        bool     flag2     = false;

                        try
                        {
                            singleton.LoadSim(simDescription, base.Actor.CurrentOutfitCategory, 0);
                            while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                            {
                                Simulator.Sleep(0);
                            }
                            CASChangeReporter.Instance.SendChangedEvents(base.Actor);
                            CASChangeReporter.Instance.ClearChanges();
                            EventTracker.SendEvent(EventTypeId.kPlannedOutfit, base.Actor, base.Target);
                            flag2 = true;
                            base.Actor.InteractionQueue.CancelAllInteractionsByType(Dresser.ChangeClothes.Singleton);
                        }
                        finally
                        {
                        }
                        base.EndCommodityUpdates(flag2);
                        if (base.Actor.CurrentOutfitIndex > simDescription.GetOutfitCount(base.Actor.CurrentOutfitCategory))
                        {
                            base.Actor.UpdateOutfitInfo();
                        }
                        base.Actor.RecreateOccupationOutfits();
                        (Sims3.Gameplay.UI.Responder.Instance.HudModel as HudModel).NotifySimChanged(base.Actor.ObjectId);

                        //Animate View object, and handle the purchases
                        this.AcquireStateMachine("viewobjectinteraction");
                        this.SetActor("x", Actor);
                        this.EnterSim("Enter");
                        this.AnimateSim("1");

                        logic_ClosingDown(this.Actor);

                        return(flag2);
                    }
                }

                return(false);
            }
        public override bool Run()
        {
            try
            {
                if (!IntroTutorial.IsRunning || IntroTutorial.AreYouExitingTutorial())
                {
                    bool flag = true;
                    if (!Target.RouteToPedestal(Actor, true))
                    {
                        return(false);
                    }

                    if (Responder.Instance.OptionsModel.SaveGameInProgress)
                    {
                        return(false);
                    }

                    mTookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(Actor, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                    if (!mTookSemaphore)
                    {
                        return(false);
                    }

                    if (Actor.IsSelectable)
                    {
                        while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                        {
                            SpeedTrap.Sleep(0x0);
                        }

                        StandardEntry();
                        BeginCommodityUpdates();
                        EnterStateMachine("ShoppingPedestal", "Enter", "x");
                        SetParameter("x:Age", Actor.SimDescription.Age);
                        AnimateSim("Change Item");

                        SimDescription simDesc = Actor.SimDescription;
                        if (Actor.FamilyFunds >= ClothingPedestal.kCostToPlanPurchaseOutfit)
                        {
                            simDesc = Actor.SimDescription;
                            if (simDesc == null)
                            {
                                throw new Exception("ChangeOutfit:  sim doesn't have a description!");
                            }

                            if (GameUtils.IsInstalled(ProductVersion.EP2))
                            {
                                new Sims.Stylist(Sims.CASBase.EditType.None, Target.DisplayCategory).Perform(new GameHitParameters <GameObject>(Actor, Actor, GameObjectHit.NoHit));
                            }
                            else
                            {
                                new Sims.Dresser(Sims.CASBase.EditType.None, Target.DisplayCategory).Perform(new GameHitParameters <GameObject>(Actor, Actor, GameObjectHit.NoHit));
                            }

                            while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                            {
                                SpeedTrap.Sleep(0x0);
                            }

                            if (!CASChangeReporter.Instance.CasCancelled && !Actor.IsOnHomeLot(Target))
                            {
                                simDesc.Household.ModifyFamilyFunds(-ClothingPedestal.kCostToPlanPurchaseOutfit);
                            }
                        }

                        AnimateSim("Exit");
                        EndCommodityUpdates(true);
                        StandardExit();
                        if (Actor.CurrentOutfitIndex > simDesc.GetOutfitCount(Actor.CurrentOutfitCategory))
                        {
                            Actor.UpdateOutfitInfo();
                        }
                        Actor.RecreateOccupationOutfits();
                        (Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).NotifySimChanged(Actor.ObjectId);
                        EventTracker.SendEvent(EventTypeId.kBoughtOutfitFromPedestal, Actor, Target);
                        return(flag);
                    }
                }
                return(false);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }

            return(false);
        }