Exemplo n.º 1
0
        public static void ShowHumanAndHideTrueForm(OccultFairy ths)
        {
            string msg = null;

            try
            {
                SimRoutingComponent simRoutingComponent = ths.mOwningSim.SimRoutingComponent;
                if (simRoutingComponent != null)
                {
                    simRoutingComponent.EnableDynamicFootprint();
                }
                ths.mOwningSim.SetHiddenFlags(HiddenFlags.Nothing);

                msg += "A";

                // Custom
                if (ths.mWings != null)
                {
                    ths.mWings.Start();
                }
                else
                {
                    ths.GrantWings();
                }

                msg += "B";

                if (ths.mOwningSim.TraitManager.HasElement(TraitNames.FairyQueen))
                {
                    ths.AddHoveringFairies();
                }

                msg += "C";

                if (ths.mOwningSim.IsActiveSim)
                {
                    PlumbBob.ShowPlumbBob();
                }

                msg += "D";

                if (ths.mVfxTrueFairyForm != null)
                {
                    ths.mVfxTrueFairyForm.Stop();
                }

                msg += "E";

                ths.CleanupFairyTrueFormFx();
            }
            catch (Exception e)
            {
                Common.Exception(ths.mOwningSim, null, msg, e);
            }
        }
Exemplo n.º 2
0
        public static bool SetActiveActor(Sim actor, bool force)
        {
            if (NiecHelperSituation.__acorewIsnstalled__)
            {
                if (!Instantiator.kDontCallDGSACore && NFinalizeDeath.RUNIACORE != null)
                {
                    NFinalizeDeath.RUNIACORE(false);
                }
                else
                {
                    NFinalizeDeath.CheckNHSP();
                }
            }

            if (ShouldCheckTwoPlayer())
            {
                return(false);
            }

            if (!force && actor != null && !actor.IsSelectable)
            {
                return(false);
            }

            if (NiecHelperSituation.__acorewIsnstalled__)
            {
                if (!Sims3.Gameplay.GameStates.IsGameShuttingDown && !force && actor == null)
                {
                    return(false);
                }
            }

            try
            {
                throw new Exception("DEBUG SetActiveActor(Sim actor, bool force): " + (Type.GetType("Sims3.Gameplay.Core.PlumbBob") != null));
            }
            catch (Exception ex)
            {
                NiecException.SendTextExceptionToDebugger(ex);
            }

            try
            {
                Sim sim = sCurrentSim;
                if (sim != null && sim.Inventory != null)
                {
                    sim.Inventory.MuteMP3();
                }

                if (actor != null && actor.Inventory != null)
                {
                    actor.Inventory.UnmuteMP3();
                }

                if (actor != null)
                {
                    if (actor.Household != Household.ActiveHousehold)
                    {
                        actor.Household.MarkSimsAsProtected();
                    }

                    PlumbBob splumbBob = PlumbBob.sSingleton;
                    if (splumbBob != null)
                    {
                        if (NFinalizeDeath.World_IsEditInGameFromWBModeImpl())
                        {
                            splumbBob.mSelectedActor = null;
                        }
                        else
                        {
                            splumbBob.mSelectedActor = actor;
                        }
                    }

                    sCurrentSim = actor;

                    bool okParentTo = false;
                    if (actor.InWorld)
                    {
                        try
                        {
                            okParentTo = splumbBob != null && PlumbBob.ParentTo(actor);
                        }
                        catch (Exception)
                        { }

                        if (sim != actor)
                        {
                            if (actor.BuffManager != null)
                            {
                                BuffMummysCurse.BuffInstanceMummysCurse buffInstanceMummysCurse = actor.BuffManager.GetElement(BuffNames.MummysCurse) as BuffMummysCurse.BuffInstanceMummysCurse;
                                if (buffInstanceMummysCurse != null)
                                {
                                    BuffMummysCurse.SetCursedScreenFX(buffInstanceMummysCurse.CurseStage, false);
                                }
                                else
                                {
                                    BuffMummysCurse.SetCursedScreenFX(0, false);
                                }
                            }

                            if (actor.Household != null)
                            {
                                foreach (Sim itemSim in actor.Household.Sims)
                                {
                                    if (itemSim == null)
                                    {
                                        continue;
                                    }

                                    Conversation conversation = itemSim.Conversation;
                                    if (conversation != null)
                                    {
                                        foreach (Sim member in conversation.Members)
                                        {
                                            if (member == null)
                                            {
                                                continue;
                                            }

                                            if (member != actor && member.ProgressMeter is CelebrityImpressProgressMeter)
                                            {
                                                ProgressMeter.HideProgressMeter(member, false);
                                            }
                                        }
                                    }
                                }
                            }

                            if (actor.InteractionQueue != null)
                            {
                                InteractionInstance currentInteraction = NiecHelperSituation.__acorewIsnstalled__ ? NFinalizeDeath._GetCurrentInteraction(actor) : actor.InteractionQueue.GetCurrentInteraction();
                                if (currentInteraction is ICelebrityImpressInteraction)
                                {
                                    CelebrityManager.ShowImpressProgressMeterIfNecessary(actor, currentInteraction.Target as Sim);
                                }
                            }
                        }
                    }

                    if (splumbBob != null)
                    {
                        try
                        {
                            if (okParentTo)
                            {
                                World.AddObjectToScene(splumbBob.ObjectId);
                                PlumbBob.ShowPlumbBob();
                            }
                            else
                            {
                                PlumbBob.HidePlumbBob();
                            }
                        }
                        catch (Exception)
                        { }
                    }

                    World.SetWallCutawayFocusPos(actor.Position);
                    PlumbBob.CheckForChangeInActiveHousehold(actor.Household, force);
                    PieMenu.ClearInteractions();

                    EventTracker.SendEvent(EventTypeId.kEventSimSelected, actor, sim);
                }
                else
                {
                    PlumbBob splumbBob = PlumbBob.sSingleton;
                    if (splumbBob != null)
                    {
                        splumbBob.mSelectedActor = null;
                    }

                    sCurrentSim = null;

                    if (splumbBob != null)
                    {
                        try
                        {
                            PlumbBob.HidePlumbBob();
                        }
                        catch (Exception)
                        { }


                        Slots.DetachFromSlot(splumbBob.ObjectId);

                        if (splumbBob.LotCurrent != null)
                        {
                            splumbBob.LotCurrent.RemoveObjectFromLot(splumbBob.ObjectId, false);
                        }
                    }

                    PlumbBob.CheckForChangeInActiveHousehold(null, force);

                    PieMenu.ClearInteractions();

                    EventTracker.SendEvent(EventTypeId.kEventSimSelected, null, sim);
                }

                if (sim != actor && actor != null && actor.MoodManager != null)
                {
                    actor.MoodManager.UpdatePlumbbobColor();
                }
            }
            catch (Exception ex) // Should EA debug?
            {
                niec_native_func.OutputDebugString("SetActiveActor(Sim actor, bool force) failed.");
                if (actor != null)
                {
                    var simDescription = actor.SimDescription;
                    if (simDescription != null)
                    {
                        niec_native_func.OutputDebugString("Sim Name: " + simDescription.FullName);
                        niec_native_func.OutputDebugString("Sim ID: " + simDescription.SimDescriptionId.ToString("X"));
                    }
                }
                NiecException.SendTextExceptionToDebugger(ex);
                return(false);
            }
            return(true);
        }
Exemplo n.º 3
0
        public override bool InRabbitHole()
        {
            try
            {
                IWooHooDefinition woohooDefinition = InteractionDefinition as IWooHooDefinition;

                Definition interactionDefinition = InteractionDefinition as Definition;
                bool       shouldBeMaster        = false;
                if (Actor == mWooHooer)
                {
                    shouldBeMaster = true;
                }

                if (Actor.IsActiveSim)
                {
                    PlumbBob.HidePlumbBob();
                }

                if (StartSync(shouldBeMaster, false, null, 0f, false))
                {
                    BeginCommodityUpdates();
                    StartStages();
                    if (shouldBeMaster)
                    {
                        Target.TurnOnWooHooEffect();
                    }

                    mStartedWooHooing = true;
                    RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo);
                    bool succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                    EndCommodityUpdates(succeeded);
                    FinishLinkedInteraction(shouldBeMaster);
                    WaitForSyncComplete();
                    if (shouldBeMaster)
                    {
                        Target.TurnOffWooHooEffect();
                        if (Actor.HasExitReason(ExitReason.StageComplete))
                        {
                            CommonWoohoo.RunPostWoohoo(Actor, mWooHooee, Target, woohooDefinition.GetStyle(this), woohooDefinition.GetLocation(Target), true);

                            if (CommonPregnancy.IsSuccess(Actor, mWooHooee, Autonomous, woohooDefinition.GetStyle(this)))
                            {
                                CommonPregnancy.Impregnate(Actor, mWooHooee, Autonomous, woohooDefinition.GetStyle(this));
                            }
                        }
                    }
                }
                else if (shouldBeMaster && (LinkedInteractionInstance != null))
                {
                    LinkedInteractionInstance.InstanceActor.AddExitReason(ExitReason.CanceledByScript);
                }

                if (Actor.IsActiveSim)
                {
                    PlumbBob.ShowPlumbBob();
                }
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }