Exemplo n.º 1
0
            public override bool Test(Sim actor, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (isAutonomous)
                {
                    return(false);
                }

                if (actor == null || target == null)
                {
                    return(false);
                }

                if (actor.IsNPC)
                {
                    return(false);
                }

                NiecHelperSituation situationOfType = actor.GetSituationOfType <NiecHelperSituation>();

                if (situationOfType != null)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback("Already Added Situation\n" + "WorkingNHSCount: " + NiecHelperSituation.WorkingNiecHelperSituationCount + "\nAHWorkingNHSCount: " + NiecHelperSituation.Spawn.ActiveHouseholdWorkingNHS_Count() + "\nSimsCount: " + NFinalizeDeath.SC_GetObjects <Sim>().Length);
                    return(false);
                }

                return(true);
            }
Exemplo n.º 2
0
 public override void ConfigureInteraction()
 {
     if (Simulator.GetProxy(Actor.ObjectId) != null)
     {
         dataNHSInteraction = NiecHelperSituation.ExistsOrCreateAndAddToSituationList(Actor, null).CreateInteraction(Target);
     }
     base.ConfigureInteraction();
 }
Exemplo n.º 3
0
 public override InteractionInstance GetStandingTransition()
 {
     r_internal(_Actor);
     if (IsOpenDGSInstalled)
     {
         return(null);
     }
     else if (_Actor != null)
     {
         return(NiecHelperSituation.ExistsOrCreateAndAddToSituationList(_Actor).CreateInteraction(_Actor));
     }
     else
     {
         return(null);
     }
 }
Exemplo n.º 4
0
            public override InteractionInstance CreateInstance(ref InteractionInstanceParameters parameters)
            {
                Sim Actor = parameters.Actor as Sim;

                if (Actor != null && Actor.SimDescription != null)
                {
                    if ((Actor.Service as GrimReaper ?? Actor.SimDescription.CreatedByService as GrimReaper) != null)
                    {
                        var inty = new GRSOVInteraction.NGrimReaper_ReapSoulDiving();
                        inty.Init(ref parameters);
                        return(inty);
                    }
                    else if (NFinalizeDeath.SimIsNiecHelperSituation(Actor) && (ServiceSituation.FindServiceSituationInvolving(Actor) as GrimReaperSituation) == null)
                    {
                        return(NiecHelperSituation.ExistsOrCreateAndAddToSituationList(Actor, null).CreateInteraction(parameters.Target as Sim));
                    }
                }
                return(base.CreateInstance(ref parameters));
            }
Exemplo n.º 5
0
        public override bool Run() // Run
        {
            NiecHelperSituation situationOfType = Target.GetSituationOfType <NiecHelperSituation>();

            if (situationOfType != null)
            {
                situationOfType.Exit();
            }
            if (AnimationUtil.StopAllAnimation(Actor))
            {
                StyledNotification.Show(new StyledNotification.Format("Check Ok", StyledNotification.NotificationStyle.kGameMessagePositive));
                return(false);
            }
            else
            {
                StyledNotification.Show(new StyledNotification.Format("Check Failed", StyledNotification.NotificationStyle.kGameMessagePositive));
            }
            return(true);
        }
Exemplo n.º 6
0
            public override string GetInteractionName(Sim actor, Sim target, InteractionObjectPair interaction)
            {
                try
                {
                    NiecHelperSituation situationOfType = actor.GetSituationOfType <NiecHelperSituation>();
                    if (situationOfType != null)
                    {
                        return("Added Situation Done");
                    }

                    if (!target.IsInActiveHousehold && !(target.Service is GrimReaper))
                    {
                        return("Target Kill " + target.Name);
                    }
                    return("Create Niec Helper Situation");
                }
                catch
                {
                    return("Create Niec Helper Situation");
                }
            }
Exemplo n.º 7
0
        public static NiecHelperSituationPosture ExistsOrCreatePosture(Sim actor, bool bNeedMaxMood)
        {
            if (actor == null || Simulator.GetProxy(actor.ObjectId) == null)
            {
                throw new ArgumentNullException("actor");
            }

            if (actor.Posture is NiecHelperSituationPosture)
            {
                return(actor.Posture as NiecHelperSituationPosture);
            }

            if (NiecHelperSituation.ExistsOrCreateAndAddToSituationList(actor, null) != null)
            {
                NiecHelperSituationPosture nhsp = new NiecHelperSituationPosture(actor);
                nhsp.NeedMaxMood = bNeedMaxMood;
                actor.mPosture   = nhsp;
                return(nhsp);
            }
            throw new ArgumentException("actor is bad.", "actor");
        }
Exemplo n.º 8
0
            public override bool Test(Sim actor, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (isAutonomous)
                {
                    return(false);
                }

                if (actor.IsNPC)
                {
                    return(false);
                }

                NiecHelperSituation situationOfType = actor.GetSituationOfType <NiecHelperSituation>();

                if (situationOfType != null)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback("Already Added Situation");
                    return(false);
                }

                return(true);
            }
Exemplo n.º 9
0
        public override InteractionInstance GetStandingTransition()
        {
            if (IsOpenDGSInstalled)
            {
                return(null);
            }
            else if (_Actor != null && _Actor.Autonomy != null)
            {
                // TODO
                var tyy = NiecHelperSituation.ExistsOrCreateAndAddToSituationList(_Actor);
                if (tyy == null)
                {
                    return(null);
                }

                return(tyy.CreateInteraction(_Actor));
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 10
0
        public override bool Run() // Run
        {
            try
            {
                NiecHelperSituation situationOfType = Target.GetSituationOfType <NiecHelperSituation>();
                if (situationOfType != null)
                {
                    situationOfType.Exit();
                    Target.Autonomy.SituationComponent.RemoveRole(situationOfType);

                    foreach (var item in Situation.sAllSituations)
                    {
                        if (item == situationOfType)
                        {
                            Situation.sAllSituations.Remove(situationOfType);
                        }
                    }
                }
                if (AnimationUtil.StopAllAnimation(Actor))
                {
                    Actor.SetObjectToReset();
                    StyledNotification.Show(new StyledNotification.Format("Check Ok", StyledNotification.NotificationStyle.kGameMessagePositive));
                    return(false);
                }
                else
                {
                    StyledNotification.Show(new StyledNotification.Format("Check Failed", StyledNotification.NotificationStyle.kGameMessagePositive));
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch
            { }

            return(true);
        }
Exemplo n.º 11
0
        public override bool Run() // Run
        {
            if (Actor.IsInActiveHousehold)
            {
                Actor.Autonomy.SituationComponent.Situations.Add(NiecHelperSituation.Create(Actor.LotCurrent, Actor));
            }
            SpeedTrap.Sleep(0);
            NiecHelperSituation situationOfType = Actor.GetSituationOfType <NiecHelperSituation>();

            if (situationOfType != null)
            {
                StyledNotification.Show(new StyledNotification.Format("Check Ok", StyledNotification.NotificationStyle.kGameMessagePositive));
                if (Target != Actor)
                {
                    Actor.InteractionQueue.Add(NiecHelperSituation.NiecAppear.Singleton.CreateInstance(Target, Actor, new InteractionPriority((InteractionPriorityLevel)999, 999f), isAutonomous: false, cancellableByPlayer: false));
                }
            }
            else
            {
                StyledNotification.Show(new StyledNotification.Format("Check Failed", StyledNotification.NotificationStyle.kGameMessagePositive));
            }

            return(true);
        }
Exemplo n.º 12
0
        public static void OnScriptError(ScriptCore.ScriptProxy proxy, Exception ex)
        {
            if (dontcall)
            {
                return;
            }

            if (proxy == null)
            {
                NFinalizeDeath.ThrowResetException("");
            }

            if (safeerrorbool && !ShouldInjectedMethodOnScriptError)
            {
                if (_SafeOnScriptError != null && ex != null)
                {
                    try
                    {
                        _SafeOnScriptError(proxy, ex);
                    }
                    catch (Exception)
                    {
                        // NRaas Failed
                    }
                }
                return;
            }
            if (!Simulator.CheckYieldingContext(false))
            {
                if (NiecHelperSituation.___bOpenDGSIsInstalled_)
                {
                    if (_SafeOnScriptError != null && ex != null)
                    {
                        try
                        {
                            _SafeOnScriptError(proxy, ex);
                        }
                        catch (Exception)
                        {
                            // NRaas Failed
                        }
                    }
                }
                return;
            }

            else if (NiecHelperSituation.___bOpenDGSIsInstalled_)
            {
                if (_SafeOnScriptError != null && ex != null)
                {
                    try
                    {
                        _SafeOnScriptError(proxy, ex);
                    }
                    catch (Exception)
                    {
                        // NRaas Failed
                    }
                }
                return;
            }

            var proxyTarget = proxy.Target;

            if (proxyTarget == null)
            {
                NFinalizeDeath.ThrowResetException("");
            }

            global::Sims3.SimIFace.Simulator.Sleep(110);

            Sim proxySim = proxyTarget as Sim;

            if (proxySim != null)
            {
                if (proxySim.SimDescription == null)
                {
                    proxySim.mSimDescription      = Create.NiecNullSimDescription();
                    proxySim.mSimDescription.mSim = proxySim;
                }

                if (NFinalizeDeath.SimIsGRReaper(proxySim.SimDescription))
                {
                    while (true)
                    {
                        if (!(proxySim.mPosture is NiecHelperSituationPosture))
                        {
                            NiecRunCommand.fcreap_Icommand(proxySim, false, true);
                        }

                        if (mGrimReaperSmoke != null && !mGrimReaperSmoke.ParentTo(proxySim, Sim.FXJoints.Pelvis))
                        {
                            var p = mGrimReaperSmoke;
                            mGrimReaperSmoke = null;
                            p.Stop();
                            p.Dispose();
                            p = null;
                        }

                        if (mGrimReaperSmoke == null)
                        {
                            mGrimReaperSmoke = VisualEffect.Create("reaperSmokeConstant");
                            if (mGrimReaperSmoke != null)
                            {
                                proxySim.FadeIn();
                                mGrimReaperSmoke.ParentTo(proxySim, Sim.FXJoints.Pelvis);
                                mGrimReaperSmoke.Start();
                            }
                        }

                        if (NiecHelperSituation.ExistsOrCreateAndAddToSituationList(proxySim) != null)
                        {
                            NiecHelperSituationPosture.r_internal(proxySim);
                        }

                        NFinalizeDeath.CheckYieldingContext();

                        if (NFinalizeDeath.GetCurrentExecuteType() == Sims3.SimIFace.ScriptExecuteType.Task)
                        {
                            global::Sims3.SimIFace.Simulator.Sleep(10);
                        }
                        else
                        {
                            global::Sims3.SimIFace.Simulator.Sleep(0);
                        }
                    }
                }
                else
                {
                    while (true)
                    {
                        try
                        {
                            //proxySim.DoInteraction();
                            if (!Bim.AOrGROnlyRunningSim || NFinalizeDeath.SimIsGRReaper(proxySim.SimDescription) || proxySim == (NPlumbBob.DoneInitClass ? NFinalizeDeath.GetSafeSelectActor() : PlumbBob.SelectedActor))
                            {
                                Bim.FoundInteraction(proxySim);
                                Simulator.Sleep(0);
                            }
                            else
                            {
                                proxySim.LoopIdle();
                                Simulator.Sleep(0);
                            }
                        }
                        catch (ResetException)
                        {
                            throw;
                        }
                        catch
                        {
                            NFinalizeDeath.CheckYieldingContext();
                            if (!proxySim.IsSelectable)
                            {
                                NiecHelperSituationPosture.r_internal(proxySim);
                            }
                            else
                            {
                                global::Sims3.SimIFace.Simulator.Sleep(100);
                            }
                        }

                        NFinalizeDeath.CheckYieldingContext();

                        if (NFinalizeDeath.GetCurrentExecuteType() == Sims3.SimIFace.ScriptExecuteType.Task)
                        {
                            global::Sims3.SimIFace.Simulator.Sleep(10);
                        }
                        else
                        {
                            global::Sims3.SimIFace.Simulator.Sleep(0);
                        }
                    }
                }
            }

            SimUpdate proxySimUpdate = proxyTarget as SimUpdate;

            if (proxySimUpdate != null)
            {
                var sim = proxySimUpdate.mSim;
                if (sim == null || !NFinalizeDeath.GameObjectIsValid(sim.ObjectId.mValue))
                {
                    var p = proxySimUpdate.Proxy;
                    if (p != null)
                    {
                        Simulator.DestroyObject(p.ObjectId);
                    }

                    NFinalizeDeath.CheckYieldingContext();
                    Simulator.Sleep(uint.MaxValue);
                    NFinalizeDeath.ThrowResetException("");
                    return;
                }
                Simulator.Sleep(500);
                if (NiecHelperSituation.__acorewIsnstalled__)
                {
                    return;
                }
            }

            var proxyLot = proxyTarget as Sims3.Gameplay.Core.Lot;

            if (proxyLot != null)
            {
                while (true)
                {
                    NFinalizeDeath.CheckYieldingContext();

                    if (NFinalizeDeath.GetCurrentExecuteType() == Sims3.SimIFace.ScriptExecuteType.Task)
                    {
                        global::Sims3.SimIFace.Simulator.Sleep(10);
                    }
                    else
                    {
                        global::Sims3.SimIFace.Simulator.Sleep(0);
                    }

                    try
                    {
                        Sims3.Gameplay.Utilities.AlarmManager alarmManger = proxyLot.mSavedData != null ? proxyLot.mSavedData.mAlarmManager : null;
                        if (alarmManger != null)
                        {
                            for (int i = 0; i < 5; i++)
                            {
                                NFinalizeDeath.SimulateAlarm(alarmManger, true, true, false);
                            }
                        }

                        if (proxyLot.mSavedData == null)
                        {
                            continue;
                        }

                        proxyLot.UpdateDoorPrivacy();
                        proxyLot.UpdateDetailPriority();

                        if (proxyLot.DisplayLevelChanged)
                        {
                            proxyLot.UpdateDisplayLevelInfo();
                            proxyLot.DisplayLevelChanged = false;
                        }

                        if (proxyLot.ShouldSimulate)
                        {
                            if (proxyLot.mLastTime == 0f)
                            {
                                proxyLot.mLastTime = SimClock.ElapsedTime(TimeUnit.Minutes);
                            }
                            else
                            {
                                float timePassed = SimClock.ElapsedTimeInMinutes(ref proxyLot.mLastTime);

                                proxyLot.UpdateReactions(timePassed, true);

                                if (GameUtils.IsInstalled(ProductVersion.EP7))
                                {
                                    for (int i = 0; i < 5; i++)
                                    {
                                        proxyLot.UpdateNumZombiesOnLot(timePassed + i);
                                    }
                                }
                            }
                        }
                        else if (proxyLot.mSavedData.mBroadcastersWithSims != null && proxyLot.mSavedData.mBroadcastersWithSims.Count > 0)
                        {
                            if (proxyLot.mLastTime == 0f)
                            {
                                proxyLot.mLastTime = SimClock.ElapsedTime(TimeUnit.Minutes);
                            }
                            else
                            {
                                proxyLot.UpdateReactions(SimClock.ElapsedTimeInMinutes(ref proxyLot.mLastTime), false);
                            }
                        }

                        try
                        {
                            for (int i = 0; i < 5; i++)
                            {
                                proxyLot.UpdateReactions(3 + i, true);
                            }
                        }
                        catch (global::Sims3.SimIFace.ResetException)
                        { throw; }
                        catch { }
                    }
                    catch (global::Sims3.SimIFace.ResetException exT)
                    {
                        NiecTask.Perform(delegate
                        {
                            if (_SafeOnScriptError != null)
                            {
                                _SafeOnScriptError(proxy, exT);
                            }
                        });
                        throw;
                    }
                    catch
                    {
                        NFinalizeDeath.CheckYieldingContext();

                        for (int i = 0; i < 200; i++)
                        {
                            Simulator.Sleep(0);
                        }
                    }
                }
            }

            Sims3.Gameplay.Autonomy.AutonomyManager proxyAutonomyManager = proxyTarget as Sims3.Gameplay.Autonomy.AutonomyManager;
            if (proxyAutonomyManager != null)
            {
                proxy.mExecuteType = ScriptExecuteType.Threaded;
                Simulator.Sleep(150);
                if (NiecHelperSituation.__acorewIsnstalled__)
                {
                    return;
                }
            }

            Sims3.Gameplay.Services.Services proxyServices = proxyTarget as Sims3.Gameplay.Services.Services;
            if (proxyServices != null)
            {
                proxyServices.mServiceIndex = 0;
                proxy.mExecuteType          = ScriptExecuteType.Threaded;
                Simulator.Sleep(1000);
                if (NiecHelperSituation.__acorewIsnstalled__)
                {
                    return;
                }
            }

            var alarmOneShot = proxyTarget as Sims3.Gameplay.Utilities.AlarmManager.AlarmOneShot;

            if (alarmOneShot != null)
            {
                alarmOneShot.mStarted = true;
                var ofp = alarmOneShot.mFunction;
                if (ofp == null)
                {
                    try
                    {
                        Sims3.Gameplay.Abstracts.GameObject.RemoveOneShotFunctionOnFinish(Simulator.CurrentTask);
                    }
                    catch (Exception)
                    { }

                    Simulator.DestroyObject(Simulator.CurrentTask);
                    goto r;
                }

                try
                {
                    alarmOneShot.mFunction = null;
                    if (ofp != null)
                    {
                        ofp();
                    }
                }
                catch (ResetException)
                {
                    throw;
                }
                catch (Exception exX)
                {
                    if (!NiecHelperSituation.__acorewIsnstalled__)
                    {
                        alarmOneShot.HandleException(exX);
                    }
                }

                r :;
                try
                {
                    Sims3.Gameplay.Abstracts.GameObject.RemoveOneShotFunctionOnFinish(Simulator.CurrentTask);
                }
                catch (Exception)
                { }

                Simulator.DestroyObject(Simulator.CurrentTask);

                if (alarmOneShot.mAlarmManager != null && alarmOneShot.mAlarmManager.mAlarmOneShotList != null)
                {
                    alarmOneShot.mAlarmManager.mAlarmOneShotList.Remove(alarmOneShot);
                }

                proxy.mTarget = null;
                return;
            }

            var oneShotFunc = proxyTarget as Sims3.Gameplay.OneShotFunction;

            if (oneShotFunc != null)
            {
                var ofp = oneShotFunc.mFunction;
                if (ofp == null)
                {
                    try
                    {
                        Sims3.Gameplay.Abstracts.GameObject.RemoveOneShotFunctionOnFinish(Simulator.CurrentTask);
                    }
                    catch (Exception)
                    { }

                    Simulator.DestroyObject(Simulator.CurrentTask);
                    return;
                }
                try
                {
                    oneShotFunc.mFunction = null;
                    if (ofp != null)
                    {
                        ofp();
                    }
                }
                catch (ResetException)
                {
                    throw;
                }
                catch (Exception exX)
                {
                    if (!NiecHelperSituation.__acorewIsnstalled__)
                    {
                        oneShotFunc.HandleException(exX);
                    }
                }

                try
                {
                    Sims3.Gameplay.Abstracts.GameObject.RemoveOneShotFunctionOnFinish(Simulator.CurrentTask);
                }
                catch (Exception)
                { }

                Simulator.DestroyObject(Simulator.CurrentTask);
                proxy.mTarget = null;
                return;
            }



            //var roleMangerTask = proxyTarget as Sims3.Gameplay.Roles.RoleManagerTask;
            //if (NiecHelperSituation.__acorewIsnstalled__  && Instantiator.NACSDCInject && roleMangerTask != null && Simulator.CheckYieldingContext(false) && (ShouldInjectedMethodOnScriptError ? Type.GetType("NRaas.RegisterSpace.Tasks.RoleManagerTaskEx, NRaasRegister", false) != null : true))
            //{
            //    //if (AssemblyCheckByNiec.IsInstalled("NRaasRegister") &&
            //    //    Simulator.CheckYieldingContext(false))
            //    {
            //       //Simulator.Sleep(uint.MaxValue);
            //        while (true)
            //        {
            //            Simulator.Sleep(0);
            //            for (int i = 0; i < 3; i++)
            //            {
            //                NiecRunCommand.native_testcpu_debug(null, null);
            //            }
            //        }
            //    }
            //}

            if (_SafeOnScriptError != null && ex != null)
            {
                _SafeOnScriptError(proxy, ex);
            }
        }
Exemplo n.º 13
0
        // public static Sim Aora => null;
        public override bool Run()
        {
            if (!Simulator.CheckYieldingContext(false))
            {
                return(false);
            }
            var definition = InteractionDefinition as Definition;

            NFinalizeDeath.Assert(definition != null, "InteractionDefinition as KillInLotCurrent.Definition Failed!");
            var deathType = definition != null ? definition.death : SimDescription.DeathType.Drown;

            if (Autonomous || Actor != PlumbBob.SelectedActor)
            {
                return(false);
            }
            if (!NFinalizeDeath.CheckAccept("Are You Sure MineKill Lot Current Get Sims?"))
            {
                return(false);
            }

            try
            {
                //var list = new List<Sim>();
                foreach (Sim sim in NFinalizeDeath.SC_GetObjectsOnLot <Sim>(Target.LotCurrent)) //Target.LotCurrent.GetAllActors())
                {
                    if (NiecHelperSituation.SimHasBeenDestroyed(sim))
                    {
                        if (NFinalizeDeath.ForceDestroyObject(sim, false))
                        {
                            continue;
                        }
                    }
                    if (sim != null && sim.SimDescription != null && !NFinalizeDeath.IsAllActiveHousehold_SimObject(sim) && !(sim.Service is GrimReaper))
                    {
                        //list.Add(sim);

                        if (sim.mInteractionQueue == null)
                        {
                            sim.mInteractionQueue = new Sims3.Gameplay.ActorSystems.InteractionQueue(sim);
                        }
                        if (NFinalizeDeath.IsOpenDGSInstalled)
                        {
                            KillPro.FastKill(sim, deathType, Actor, true, false);
                        }
                        else
                        {
                            var createKillSim = NFinalizeDeath.Interaction_CreateKillSim(sim, deathType);
                            if (createKillSim == null)
                            {
                                continue;
                            }
                            sim.mInteractionQueue.Add(createKillSim);
                        }
                    }
                }
                //if (list.Count > 0)
                //{
                //    foreach (Sim nlist in list)
                //    {
                //        KillPro.FastKill(nlist, definition.death, Actor, true, false);
                //        //KillSimNiecX.MineKill(nlist, definition.death, null, true, false);
                //    }
                //}
                return(true);
            }

            catch (Exception exception)
            {
                NiecException.PrintMessage(exception.Message + NiecException.NewLine + exception.StackTrace);
                return(true);
            }
        }
Exemplo n.º 14
0
        public override bool Run() // Run
        {
            try
            {
                if (GrimReaper.Instance.mPool.Count == 0)
                {
                    if (Actor.IsInActiveHousehold)
                    {
                        var nhs = NiecHelperSituation.Create(Actor.LotCurrent, Actor);
                        if (nhs != null)
                        {
                            Actor.Autonomy.SituationComponent.Situations.Add(nhs);
                        }
                        SpeedTrap.Sleep(0);
                        NiecHelperSituation situationOfType = Actor.GetSituationOfType <NiecHelperSituation>();
                        if (situationOfType != null)
                        {
                            StyledNotification.Show(new StyledNotification.Format("Check Ok", StyledNotification.NotificationStyle.kGameMessagePositive));
                            if (Target != Actor)
                            {
                                Actor.InteractionQueue.Add(NiecHelperSituation.NiecAppear.Singleton.CreateInstance(Target, Actor, new InteractionPriority((InteractionPriorityLevel)999, 999f), isAutonomous: false, cancellableByPlayer: false));
                            }
                        }
                        else
                        {
                            StyledNotification.Show(new StyledNotification.Format("Check Failed", StyledNotification.NotificationStyle.kGameMessagePositive));
                        }
                    }
                    Sim ActiveActor = NFinalizeDeath.ActiveActor;
                    foreach (var item in NFinalizeDeath.SC_GetObjects <Sim>())
                    {
                        if (item == ActiveActor)
                        {
                            continue;
                        }
                        if (item.mSimDescription == null || !NiecHelperSituation.UnsafeRunReapSoul(item))
                        {
                            continue;
                        }
                        if (item.SimDescription.ChildOrBelow)
                        {
                            continue;
                        }

                        SpeedTrap.Sleep(0);
                        NiecHelperSituation situationOfTypex = item.GetSituationOfType <NiecHelperSituation>();
                        if (situationOfTypex != null)
                        {
                            if (Target != item)
                            {
                                item.InteractionQueue.Add(NiecHelperSituation.NiecAppear.Singleton.CreateInstance(Target, item, new InteractionPriority((InteractionPriorityLevel)100, 999f),
                                                                                                                  isAutonomous: false,
                                                                                                                  cancellableByPlayer: true));
                            }
                        }
                        else
                        {
                            var nhs = NiecHelperSituation.Create(Actor.LotCurrent, Actor);
                            if (nhs != null)
                            {
                                item.Autonomy.SituationComponent.Situations.Add(nhs);
                            }
                            else
                            {
                                continue;
                            }
                            situationOfTypex = nhs;
                            if (Target != item)
                            {
                                item.InteractionQueue.Add((!situationOfTypex.OkSuusse ? Sims3.Gameplay.NiecRoot.NiecHelperSituation.NiecAppear.Singleton : NiecHelperSituation.ReapSoul.Singleton).CreateInstance(Target, item, new InteractionPriority((InteractionPriorityLevel)100, 999f),
                                                                                                                                                                                                                  isAutonomous: false,
                                                                                                                                                                                                                  cancellableByPlayer: true));
                            }
                        }
                        break;
                    }
                }
                else if (Actor.IsInActiveHousehold)
                {
                    var nhs = NiecHelperSituation.Create(Actor.LotCurrent, Actor);
                    if (nhs != null)
                    {
                        Actor.Autonomy.SituationComponent.Situations.Add(nhs);
                    }
                    SpeedTrap.Sleep(0);
                    NiecHelperSituation situationOfType = Actor.GetSituationOfType <NiecHelperSituation>();
                    if (situationOfType != null)
                    {
                        StyledNotification.Show(new StyledNotification.Format("Check Ok", StyledNotification.NotificationStyle.kGameMessagePositive));
                        if (Target != Actor)
                        {
                            Actor.InteractionQueue.Add(NiecHelperSituation.NiecAppear.Singleton.CreateInstance(Target, Actor, new InteractionPriority((InteractionPriorityLevel)999, 999f), isAutonomous: false, cancellableByPlayer: false));
                        }
                    }
                    else
                    {
                        StyledNotification.Show(new StyledNotification.Format("Check Failed", StyledNotification.NotificationStyle.kGameMessagePositive));
                    }
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch
            { }

            return(true);
        }
Exemplo n.º 15
0
            public override void ConfigureInteraction()
            {
                Sims3.Gameplay.CAS.SimDescription.DeathType deathtyp = base.simDeathType;
                try
                {
                    bool isplayer = Actor.IsSelectable;

                    if (isplayer)
                    {
                        mMustRun            = false;
                        mHidden             = false;
                        CancellableByPlayer = true;
                    }

                    var killSim =
                        ExtKillSimNiec.Singleton.CreateInstance(Target, Actor, KillSimNiecX.DGSAndNonDGSPriority(), Autonomous, isplayer) as ExtKillSimNiec;

                    killSim.simDeathType       = base.simDeathType;
                    killSim.PlayDeathAnimation = base.PlayDeathAnimation;
                    killSim.mMustRun           = true;

                    base.mPriority = KillSimNiecX.DGSAndNonDGSPriority();

                    runI = killSim;
                    runI.ConfigureInteraction();
                }
                catch (ResetException) { throw; }
                catch { }
                if (!_IsOpenDGSInstalled && !Actor.IsInActiveHousehold)
                {
                    SimDescription ActorDesc = Actor.SimDescription;
                    Sim            Actior    = Actor;


                    if (ATask == ObjectGuid.InvalidObjectGuid)
                    {
                        InteractionPriority MaxDeathP = KillSimNiecX.DGSAndNonDGSPriority();

                        ATask = NiecTask.Perform(delegate
                        {
                            for (int i = 0; i < 190; i++)
                            {
                                Simulator.Sleep(10);
                            }
                            try
                            {
                                while (Actior != null && Actior.mSimDescription != null && !Actior.HasBeenDestroyed && Actior.InteractionQueue != null && Actior.InteractionQueue.HasInteractionOfType(typeof(NiecKillSim)))
                                {
                                    Simulator.Sleep(0);
                                    base.mPriority = MaxDeathP;
                                    base.mMustRun  = true;
                                }
                            }
                            catch (ResetException)
                            {
                                throw;
                            }
                            catch { }
                        });
                    }
                    if (AutoKillSimTask == ObjectGuid.InvalidObjectGuid)
                    {
                        AutoKillSimTask = NiecTask.Perform(delegate
                        {
                            /*
                             * ActorDesc.IsGhost = true;
                             * ActorDesc.mDeathStyle = base.simDeathType;
                             *
                             *
                             *
                             *
                             * if (NFinalizeDeath.GetKillNPCSimToGhost(Actor, deathtyp)) return;
                             * else SafeNRaas.NRUrnstones_CreateGrave(ActorDesc, deathtyp, false, false);*/


                            for (int i = 0; i < 190; i++)
                            {
                                Simulator.Sleep(10);
                            }

                            try
                            {
                                try
                                {
                                    while (Actior != null && Actior.mSimDescription != null && !Actior.HasBeenDestroyed && Actior.InteractionQueue != null && Actior.InteractionQueue.HasInteractionOfType(typeof(NiecKillSim)))
                                    {
                                        Simulator.Sleep(170);
                                    }
                                }
                                catch (ResetException)
                                {
                                    throw;
                                }
                                catch { }

                                Sim CreatedSim = ActorDesc.CreatedSim;

                                try
                                {
                                    if (NFinalizeDeath.IsHasInteractionNHSTargetSim(Actior))
                                    {
                                        return;
                                    }
                                    if (CreatedSim != null && CreatedSim.mSimDescription == ActorDesc)
                                    {
                                        if (NFinalizeDeath.IsHasInteractionNHSTargetSim(CreatedSim))
                                        {
                                            return;
                                        }
                                    }
                                }
                                catch (ResetException)
                                {
                                    throw;
                                }
                                catch
                                { }

                                try
                                {
                                    if (ActorDesc.AssignedRole != null)
                                    {
                                        ActorDesc.AssignedRole.RemoveSimFromRole();
                                    }
                                    ActorDesc.AssignedRole = null;
                                }
                                catch (ResetException)
                                {
                                    throw;
                                }
                                catch
                                { }

                                try
                                {
                                    ActorDesc.IsGhost     = true;
                                    ActorDesc.mDeathStyle = deathtyp;
                                    NiecHelperSituation.FinalizeSimDeathPro(
                                        ActorDesc, ActorDesc.Household, AssemblyCheckByNiec.IsInstalled(NiecMod.Instantiator.DGSModsAssembly)
                                        );
                                }
                                catch (ResetException)
                                {
                                    throw;
                                }
                                catch
                                { }

                                try
                                {
                                    if (Actior.Inventory != null)
                                    {
                                        //Actior.MoveInventoryItemsToSim(NFinalizeDeath.ActiveActor ?? PlumbBob.SelectedActor);
                                        NFinalizeDeath._MoveInventoryItemsToAFamilyMember
                                            (Target, NFinalizeDeath.HouseholdMembersToSim(Household.ActiveHousehold, true, false) ?? NFinalizeDeath.ActiveActor ?? PlumbBob.SelectedActor);
                                    }
                                }
                                catch (ResetException)
                                {
                                    throw;
                                }
                                catch
                                { }


                                Urnstone RIPObject;

                                RIPObject = HelperNra.TFindGhostsGrave(ActorDesc);

                                if (RIPObject == null)
                                {
                                    NFinalizeDeath.GetKillNPCSimToGhost(Actior, deathtyp, Vector3.OutOfWorld, out RIPObject);
                                }
                                if (RIPObject == null)
                                {
                                    RIPObject = Urnstone.CreateGrave(ActorDesc, false, true);
                                }

                                NiecHelperSituation.safePosRIPObject(Actior, Actior, RIPObject);

                                NFinalizeDeath.ForceDestroyObject(Actior);
                                NFinalizeDeath.ForceDestroyObject(CreatedSim);

                                if (ActorDesc.DeathStyle == SimDescription.DeathType.None)
                                {
                                    ActorDesc.mDeathStyle = SimDescription.DeathType.Drown;
                                }
                                ActorDesc.IsGhost = true;


                                RIPObject = HelperNra.TFindGhostsGrave(ActorDesc);

                                if (RIPObject == null)
                                {
                                    NFinalizeDeath.GetKillNPCSimToGhost(Actior, deathtyp, Vector3.OutOfWorld, out RIPObject);
                                }

                                NiecHelperSituation.safePosRIPObject(Actior, Actior, RIPObject);

                                RIPObject.AddToWorld();
                                RIPObject.FadeIn();

                                RIPObject.SetHiddenFlags(HiddenFlags.Nothing);
                                RIPObject.SetOpacity(1f, 0f);
                                RIPObject.AddToWorld();
                                RIPObject.FadeIn();

                                if (ActorDesc.DeathStyle == SimDescription.DeathType.None)
                                {
                                    ActorDesc.mDeathStyle = SimDescription.DeathType.Drown;
                                }
                                ActorDesc.IsGhost = true;
                            }
                            catch (ResetException)
                            {
                                throw;
                            }
                            catch { }
                        });
                    }
                }
            }
Exemplo n.º 16
0
        internal static void r_internal(Sim Actor)
        {
            NiecHelperSituationPosture nhsp = null;

            if (Actor != null && !NFinalizeDeath.GameObjectIsValid(Actor.ObjectId.mValue)) //NFinalizeDeath.GetObject_internalFastO(Actor.ObjectId.mValue) == null)
            {
                nhsp           = (Actor.Posture as NiecHelperSituationPosture);
                Actor.mPosture = null;
                if (nhsp != null)
                {
                    nhsp._Actor = null;
                    nhsp.PBack  = null;
                }
            }

            if (Actor == null || Actor.ObjectId.mValue != ScriptCore.Simulator.Simulator_GetCurrentTaskImpl() || !Simulator.CheckYieldingContext(false))
            {
                return;
            }

            var     sim          = Actor;
            bool    bNeedMaxMood = false;
            Posture pBackUp      = null;

            if (sim.Posture is NiecHelperSituationPosture)
            {
                nhsp         = (sim.Posture as NiecHelperSituationPosture);
                pBackUp      = nhsp.PBack;
                bNeedMaxMood = nhsp.NeedMaxMood;
                nhsp._Actor  = null;
                if (sim.Standing is NiecHelperSituationPosture)
                {
                    sim.Standing = null;
                    sim.mPosture = null;
                    if (sim.mSimDescription != null)
                    {
                        if (sim.mSimDescription.IsPet)
                        {
                            PetStandingPosture dr = new PetStandingPosture(sim);
                            sim.PetSittingOnGround = new PetSittingOnGroundPosture(sim);
                            sim.Standing           = dr;
                            sim.Posture            = null;
                        }
                        else
                        {
                            Sim.StandingPosture dre = new Sim.StandingPosture(sim);
                            sim.Standing = dre;
                            sim.Posture  = null;
                        }
                    }
                }
                else if (nhsp.PBack != null)
                {
                    sim.mPosture = nhsp.PBack;//sim.Standing;
                }
                else
                {
                    sim.mPosture = sim.Standing;
                }

                nhsp.PBack = null;
            }

            if (Disallowr_internal || (NiecHelperSituation.ExAA && sim == (NPlumbBob.DoneInitClass ? NFinalizeDeath.GetSafeSelectActor() : PlumbBob.SelectedActor)))
            {
                return;
            }

            if (!TestDEBUGMyMod && !SCOSR.IsScriptCore2020() && !IsOpenDGSInstalled &&
                NFinalizeDeath.baCheckACoreThrowNRaasErrorTrap &&
                NiecHelperSituation.__acorewIsnstalled__ &&
                NFinalizeDeath.IsSTAwesomeMod02Fast <Sim>()
                )
            {
                if (nhsp != null)
                {
                    NiecTask.Perform(delegate {
                        Simulator.Sleep(450);
                        var p = sim.mPosture;
                        if (p is NiecHelperSituationPosture)
                        {
                            return;
                        }

                        //NFinalizeDeath.Assert(nhsp != null, "r_internal(): nhsp failed!");

                        if (p != null && p == p.PreviousPosture)
                        {
                            p.PreviousPosture = null;
                        }

                        sim.mPosture = p = nhsp;
                        nhsp.PBack   = pBackUp;
                        nhsp._Actor  = sim;

                        if (p != null && p == p.PreviousPosture)
                        {
                            p.PreviousPosture = null;
                        }
                    });
                }

                NFinalizeDeath.AntiSpy_ThrowDefault();
            }

            var lookm = Actor.LookAtManager;

            if (lookm != null)
            {
                lookm.DisableLookAts();
            }


            lookm   = null; // i know Saving TaskContext Failed. From OnSavingGame()
            nhsp    = null; //
            pBackUp = null; //


            //using(SafeSimUpdate.Run(sim)) {
            while (true)
            {
                NFinalizeDeath.CheckYieldingContext();


                if (NiecHelperSituation.__acorewIsnstalled__ &&
                    !NiecHelperSituation.___bOpenDGSIsInstalled_)
                {
                    var iV = ScriptCore.Queries.Query_CountObjects(typeof(Sim));
                    if (iV >= 2)
                    {
                        NiecRunCommand.native_testcpu_debug(null, null);
                    }
                    else if (iV == 1)
                    {
                        for (int i = 0; i < 3; i++)
                        {
                            NiecRunCommand.native_testcpu_debug(null, null);
                        }
                    }
                }

                if (!IsOpenDGSInstalled && NFinalizeDeath.GetCurrentExecuteType() == ScriptExecuteType.Task)
                {
                    Simulator.Sleep(20);
                }
                else
                {
                    Simulator.Sleep(IsOpenDGSInstalled ? 15u:0u);
                }

                if (NiecHelperSituation.__acorewIsnstalled__ &&
                    !NiecHelperSituation.___bOpenDGSIsInstalled_)
                {
                    var iV = ScriptCore.Queries.Query_CountObjects(typeof(Sim));
                    if (iV >= 2)
                    {
                        NiecRunCommand.native_testcpu_debug(null, null);
                    }
                    else if (iV == 1)
                    {
                        for (int i = 0; i < 3; i++)
                        {
                            NiecRunCommand.native_testcpu_debug(null, null);
                        }
                    }
                }

                if (!NFinalizeDeath.SimIsNiecHelperSituation(sim))
                {
                    continue;
                }
                if (Simulator.GetProxy(sim.ObjectId) == null)
                {
                    break;
                }
                if (Disallowr_internal || (NiecHelperSituation.ExAA && sim == (NPlumbBob.DoneInitClass ? NFinalizeDeath.GetSafeSelectActor() : PlumbBob.SelectedActor)))
                {
                    break;
                }

                var simIQ = sim.InteractionQueue;

                try
                {
                    if (IsOpenDGSInstalled)
                    {
                        if (sim.SimDescription == null)
                        {
                            break;
                        }
                        if (simIQ == null)
                        {
                            break;
                        }
                    }
                    else
                    {
                        if (sim.SimDescription == null)
                        {
                            sim.mSimDescription = Create.NiecNullSimDescription(true, false, true);
                        }

                        if (NFinalizeDeath.SimIsGRReaper(sim.SimDescription))
                        {
                            NiecHelperSituation.ExistsOrCreateAndAddToSituationList(sim);
                        }

                        if (simIQ == null)
                        {
                            sim.mInteractionQueue = simIQ = new Sims3.Gameplay.ActorSystems.InteractionQueue(sim);
                        }
                        else
                        {
                            if (simIQ.mInteractionList == null)
                            {
                                simIQ.mInteractionList = new List <InteractionInstance>();
                            }
                            else
                            {
                                while (simIQ.mInteractionList != null && niec_std.list_remove(simIQ.mInteractionList, null)) //simIQ.mInteractionList.Remove(null))
                                {
                                    Simulator.Sleep(0);
                                }
                            }
                        }
                    }
                }
                catch (NMAntiSpyException)
                { NFinalizeDeath.SafeForceTerminateRuntime(); }
                catch (StackOverflowException)
                { sim.mPosture = null; throw; }
                catch (ResetException)
                { throw; }
                catch
                {
                    NFinalizeDeath.CheckYieldingContext();

                    if (IsOpenDGSInstalled)
                    {
                        throw;
                    }
                    else
                    {
                        for (int i = 0; i < 45; i++)
                        {
                            Simulator.Sleep(0);
                        }
                        continue;
                    }
                }

                if (bNeedMaxMood)
                {
                    try
                    {
                        NFinalizeDeath.Sim_MaxMood(sim);
                    }
                    catch (NMAntiSpyException)
                    { NFinalizeDeath.SafeForceTerminateRuntime(); }
                    catch (StackOverflowException)
                    { if (!IsOpenDGSInstalled)
                      {
                          NFinalizeDeath.ThrowResetException(null);
                      }
                      throw; }
                    catch (ResetException)
                    { throw; }
                    catch
                    {
                        NFinalizeDeath.CheckYieldingContext();

                        if (IsOpenDGSInstalled)
                        {
                            throw;
                        }
                        else
                        {
                            for (int i = 0; i < 45; i++)
                            {
                                Simulator.Sleep(0);
                            }
                            continue;
                        }
                    }
                }
                try
                {
                    if (!IsOpenDGSInstalled && sim.mAutonomy != null)
                    {
                        //var sg = sim.mAutonomy;
                        try
                        {
                            AutonomyManager.Add(sim.mAutonomy);
                        }
                        catch (NMAntiSpyException)
                        { NFinalizeDeath.SafeForceTerminateRuntime(); }
                        catch (StackOverflowException)
                        { if (!IsOpenDGSInstalled)
                          {
                              NFinalizeDeath.ThrowResetException(null);
                          }
                          throw; }
                        catch (ResetException)
                        { throw; }
                        catch { }
                    }
                    var simIQList = simIQ.mInteractionList;
                    if (simIQList == null || simIQList.Count == 0)
                    {
                        continue;
                    }

                    var simIQListArray = simIQList.ToArray();
                    for (int i = 0; i < simIQListArray.Length; i++)
                    {
                        InteractionInstance inCurrentInteraction = simIQListArray[i];
                        if (inCurrentInteraction == null || inCurrentInteraction.InteractionDefinition == null)
                        {
                            while (simIQList != null && niec_std.list_remove(simIQList, null))//simIQList.Remove(null))
                            {
                                Simulator.Sleep(0);
                                simIQList = simIQ.mInteractionList;
                            }

                            if (simIQList == null)
                            {
                                break;
                            }

                            continue;
                        }

                        if (IsOpenDGSInstalled)
                        {
                            if (simIQList.IndexOf(inCurrentInteraction) != 0)
                            {
                                break;
                            }
                        }
                        else if (i != 0)
                        {
                            break;
                        }

                        if (simIQList == null)
                        {
                            break;
                        }

                        if (!NFinalizeDeath.InteractionIsNiecHelperSituationPosture_internal(sim, inCurrentInteraction))
                        {
                            //simIQList.Remove(inCurrentInteraction);
                            niec_std.list_remove(simIQList, inCurrentInteraction);
                            if (IsOpenDGSInstalled)
                            {
                                try
                                {
                                    inCurrentInteraction.CallCallbackOnFailure(sim);
                                    inCurrentInteraction.Cleanup();
                                }
                                catch (NMAntiSpyException)
                                { NFinalizeDeath.SafeForceTerminateRuntime(); }
                                catch (StackOverflowException)
                                { sim.mPosture = null; throw; }
                                catch (ResetException)
                                { throw; }
                                catch (Exception)
                                {
                                    NFinalizeDeath.CheckYieldingContext();
                                    if (IsOpenDGSInstalled)
                                    {
                                        throw;
                                    }
                                }
                            }
                            else
                            {
                                if (inCurrentInteraction.Target is Sim)
                                {
                                    inCurrentInteraction.mInstanceActor = inCurrentInteraction.Target;
                                }
                            }

                            if (sim.IsSelectable)
                            {
                                simIQ.FireQueueChanged();
                            }

                            break;
                        }

                        if (!Bim.TestInteractionEx(inCurrentInteraction) || (IsOpenDGSInstalled && !inCurrentInteraction.IsTargetValid()))
                        {
                            // simIQList.Remove(inCurrentInteraction);
                            niec_std.list_remove(simIQList, inCurrentInteraction);
                            try
                            {
                                inCurrentInteraction.CallCallbackOnFailure(sim);
                                inCurrentInteraction.Cleanup();
                            }
                            catch (NMAntiSpyException)
                            { NFinalizeDeath.SafeForceTerminateRuntime(); }
                            catch (StackOverflowException)
                            { sim.mPosture = null; throw; }
                            catch (ResetException)
                            { throw; }
                            catch (Exception)
                            {
                                NFinalizeDeath.CheckYieldingContext();
                                if (IsOpenDGSInstalled)
                                {
                                    throw;
                                }
                            }

                            //if (IsOpenDGSInstalled)
                            //    simIQ.DeQueue(false);

                            if (sim.IsSelectable)
                            {
                                simIQ.FireQueueChanged();
                            }

                            continue;
                        }

                        simIQ.mIsHeadInteractionLocked = true;

                        var runningInList = simIQ.mRunningInteractions;
                        if (runningInList != null)
                        {
                            runningInList.Push(inCurrentInteraction);
                        }

                        try
                        {
                            inCurrentInteraction.CallCallbackOnStart(sim);
                        }
                        catch (NMAntiSpyException)
                        { NFinalizeDeath.SafeForceTerminateRuntime(); }
                        catch (StackOverflowException)
                        { sim.mPosture = null; throw; }
                        catch (ResetException)
                        { throw; }
                        catch
                        {
                            NFinalizeDeath.CheckYieldingContext();
                            if (IsOpenDGSInstalled)
                            {
                                throw;
                            }
                        }


                        simIQ.mIsHeadInteractionActive = true;

                        bool okI = false;

                        try
                        {
                            okI = NFinalizeDeath._RunInteractionWithoutCleanUp(inCurrentInteraction);
                            if (okI)
                            {
                                inCurrentInteraction.CallCallbackOnCompletion(sim);
                            }
                            else
                            {
                                inCurrentInteraction.CallCallbackOnFailure(sim);
                            }
                        }
                        catch (NMAntiSpyException)
                        { NFinalizeDeath.SafeForceTerminateRuntime(); }
                        catch (StackOverflowException)
                        {
                            if (!IsOpenDGSInstalled)
                            {
                                try
                                {
                                    NiecTask.Perform(inCurrentInteraction.Cleanup);
                                }
                                catch (StackOverflowException)
                                {}

                                NFinalizeDeath.ThrowResetException(null);
                            }
                            throw;
                        }
                        catch (ResetException)
                        { throw; }
                        catch
                        {
                            NFinalizeDeath.CheckYieldingContext();
                            if (IsOpenDGSInstalled)
                            {
                                throw;
                            }
                        }


                        if (IsOpenDGSInstalled && Simulator.CheckYieldingContext(false))
                        {
                            simIQ.PutDownCarriedObjects(inCurrentInteraction);
                        }

                        simIQ = sim.InteractionQueue;
                        if (simIQ == null)
                        {
                            inCurrentInteraction.Cleanup();
                            break;
                        }

                        NFinalizeDeath.CheckYieldingContext();

                        if (IsOpenDGSInstalled)
                        {
                            simIQ.PutDownCarriedObjects(inCurrentInteraction);
                        }

                        simIQ.mIsHeadInteractionActive = false;
                        simIQ.mIsHeadInteractionLocked = false;

                        //if (IsOpenDGSInstalled)
                        //    simIQ.DeQueue(okI);

                        if (runningInList != null && runningInList.Count > 0)
                        {
                            runningInList.Pop();
                        }

                        simIQList = simIQ.mInteractionList;
                        if (simIQList == null)
                        {
                            inCurrentInteraction.Cleanup();
                            break;
                        }

                        NFinalizeDeath.CheckYieldingContext();

                        //simIQList.Remove(inCurrentInteraction);
                        niec_std.list_remove(simIQList, inCurrentInteraction);
                        inCurrentInteraction.Cleanup();

                        NFinalizeDeath.CheckYieldingContext();

                        while (simIQList != null && niec_std.list_remove(simIQList, null))
                        {
                            Simulator.Sleep(0);
                            simIQList = simIQ.mInteractionList;
                        }

                        if (simIQList == null)
                        {
                            break;
                        }

                        if (sim.IsSelectable)
                        {
                            simIQ.FireQueueChanged();
                        }
                    }
                }
                catch (NMAntiSpyException)
                { NFinalizeDeath.SafeForceTerminateRuntime(); }
                catch (StackOverflowException)
                { sim.mPosture = null; throw; }
                catch (ResetException)
                { throw; }
                catch
                {
                    NFinalizeDeath.CheckYieldingContext();

                    if (IsOpenDGSInstalled)
                    {
                        throw;
                    }
                    else
                    {
                        for (int i = 0; i < 45; i++)
                        {
                            Simulator.Sleep(0);
                        }
                        continue;
                    }
                }
            }//}
             //NFinalizeDeath.M();
        }