コード例 #1
0
        public override void Simulate()
        {
            try
            {
                OnStart();
                if (IfMineKill)
                {
                    NiecMod.KillNiec.KillSimNiecX.MineKill(mtarget, mdeathType, mobj, mplayDeathAnim, msleepyes);
                }
            }
            catch (ResetException)
            {
                StyledNotification.Show(new StyledNotification.Format("Simulate" + "Failed", StyledNotification.NotificationStyle.kGameMessagePositive));
                //throw;
            }
            catch (Exception exception)
            {
                NiecException.WriteLog(mtarget.Name + " " + NiecException.LogException(exception), true, false, false);
            }
#pragma warning disable 1058
            catch {
                NiecException.PrintMessagePro("Failed to Mono Runtime!\n" + ToString(), false, 10);
            }
#pragma warning restore 1058
            finally
            {
                OnCleanUp();
                Simulator.DestroyObject(ObjectId);
            }
        }
コード例 #2
0
        public override bool Run() // Run
        {
            if (Autonomous || Actor.IsNPC || !Actor.IsInActiveHousehold)
            {
                return(false);
            }
            if (!AcceptCancelDialog.Show("Are You Sure All Pause?"))
            {
                return(false);
            }
            List <Sim> list = new List <Sim>();

            foreach (Sim sim in LotManager.Actors)
            {
                if (!sim.IsInActiveHousehold && !(sim.Service is GrimReaper))
                {
                    list.Add(sim);
                }
            }
            if (list.Count > 0)
            {
                foreach (Sim nlist in list)
                {
                    try
                    {
                        nlist.EnableInteractions();
                        nlist.InteractionQueue.Add(AllPauseNiecDone.Singleton.CreateInstance(nlist, nlist, new InteractionPriority((InteractionPriorityLevel)999, 999f), isAutonomous: false, cancellableByPlayer: false));
                    }
                    catch (Exception exception)
                    {
                        NiecException.PrintMessage(exception.Message + NiecException.NewLine + exception.StackTrace);
                        try
                        {
                            nlist.InteractionQueue.CancelAllInteractions();
                        }
                        catch
                        { }
                        return(true);
                    }

                    /*
                     * finally
                     * {
                     * try
                     * {
                     *  nlist.InteractionQueue.CancelAllInteractions();
                     * }
                     * catch (Exception exception)
                     * {
                     *  NiecException.PrintMessage(exception.Message + NiecException.NewLine + exception.StackTrace);
                     *  nlist.EnableInteractions();
                     *  nlist.InteractionQueue.Add(AllPauseNiecDone.Singleton.CreateInstance(nlist, nlist, new InteractionPriority((InteractionPriorityLevel)999, 999f), isAutonomous: false, cancellableByPlayer: false));
                     * }
                     * }
                     * */
                }
            }
            return(true);
        }
コード例 #3
0
 public void EventCallbackFadeInReaper(StateMachineClient sender, IEvent evt)
 {
     try
     {
         this.Actor.FadeIn(false, 3f);
     }
     catch (Exception exception)
     {
         NiecException.PrintMessage("EventCallbackFadeInReaper" + exception.Message + NiecException.NewLine + exception.StackTrace);
     }
 }
コード例 #4
0
 // Token: 0x06006FAD RID: 28589 RVA: 0x0026B994 File Offset: 0x0026A994
 public override void Cleanup()
 {
     try
     {
         SMCDeath.EnterState("x", "Enter");
     }
     catch (Exception exception)
     {
         NiecException.PrintMessage("EnterStateCleanup " + exception.Message + NiecException.NewLine + exception.StackTrace);
     }
     base.Cleanup();
 }
コード例 #5
0
        protected bool LookupRoutine()
        {
            if (!mChecked)
            {
                //mError += "Assembly: " + mAssemblyName + NiecException.NewLine + "ClassName: " + mClassName + NiecException.NewLine + "RoutineName: " + mRoutineName;

                try
                {
                    mChecked = true;

                    if (!string.IsNullOrEmpty(mAssemblyName))
                    {
                        Assembly assembly = AssemblyCheckByNiec.FindAssembly(mAssemblyName);
                        if (assembly != null)
                        {
                            //mError += NiecException.NewLine + " Assembly Found: " + assembly.FullName;

                            Type type = assembly.GetType(mClassName);
                            if (type != null)
                            {
                                //mError += Common.NewLine + " Class Found: " + type.ToString();

                                if (mParameters != null)
                                {
                                    mMethod = type.GetMethod(mRoutineName, mParameters);
                                }
                                else
                                {
                                    mMethod = type.GetMethod(mRoutineName);
                                }

                                //if (mMethod != null)
                                //{
                                //    //mError += Common.NewLine + " Routine Found";
                                //}
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    //mError += Common.NewLine + "Exception";
                    NiecException.WriteLog("Error " + e.ToString(), true, true);
                }
                finally
                {
                    //Common.WriteLog(mError);
                }
            }

            return(mMethod != null);
        }
コード例 #6
0
ファイル: Instantiator.cs プロジェクト: niec-and-linc/OpenDGS
        public static int NMineKillLogA(object[] parameters)
        {
            try
            {
                if (NiecException.WriteLog(Niec.iCommonSpace.KillPro.LogTraneEx.ToString(), true, false, false))
                {
                    NiecException.PrintMessage("WriteLog" + NiecException.NewLine + "Created MineKillLog No: " + Niec.iCommonSpace.KillPro.sLogEnumeratorTrane);
                }
            }
            catch
            { }

            return(0);
        }
コード例 #7
0
        public static ObjectGuid Perform(NiecNraTask.NraFunction func)
        {
            try
            {
                if (func == null)
                {
                    throw new ArgumentNullException("func");
                }
            }
            catch (Exception ex)
            {
                NiecException.WriteLog(ex.ToString(), true, true, false);
                throw;
            }

            return(new NiecTask(func).AddToSimulator());
        }
コード例 #8
0
        public T Invoke <T>(object obj, object[] parameters)
        {
            if (!Valid)
            {
                return(default(T));
            }

            try
            {
                return((T)mMethod.Invoke(obj, parameters));
            }
            catch (Exception e)
            {
                NiecException.WriteLog("Error Invoke: " + e.ToString(), true, true);
                return(default(T));
            }
        }
コード例 #9
0
    internal static void printfm(params string[] messages)
    {
        if (messages == null || messages.Length == 0)
        {
            NiecException.PrintMessagePro("no message", false, 50);
            return;
        }

        string str = "";

        for (int i = 0; i < messages.Length; i++)
        {
            str += messages[i] ?? (i + ": no message");
        }

        NiecException.PrintMessagePro(str, false, 50);
    }
コード例 #10
0
 public override void Simulate()
 {
     try
     {
         mFunction();
     }
     catch (Exception exception)
     {
         if (exception.StackTrace != null)
         {
             NiecException.WriteLog(ToString() + System.Environment.NewLine + System.Environment.NewLine + NiecException.LogException(exception), true, true, false);
         }
     }
     finally
     {
         Simulator.DestroyObject(ObjectId);
     }
 }
コード例 #11
0
        public static void Init()
        {
            if (mInited)
            {
                return;
            }

            if (Urnstone.KillSim.Singleton is Urnstone.KillSim.Definition) // if mod other
            {
                Urnstone.KillSim.Singleton = new Definition();
            }
            else
            {
                NiecException.WriteLog("Urnstone.KillSim.Singleton: " + Urnstone.KillSim.Singleton.GetType().AssemblyQualifiedName);
                Urnstone.KillSim.Singleton = new Definition();
            }

            mInited = true;
        }
コード例 #12
0
        public static void SSetFakeObjectId(ObjectGuid value, out NiecTask currentTask)
        {
            currentTask = null;

            NiecTask task = Simulator.GetTask(Simulator.CurrentTask) as NiecTask;

            if (task != null)
            {
                currentTask    = task;
                task.mObjectId = value;
            }


            if (Simulator.CurrentTask == value)
            {
                NiecException.WriteLog("DEBUG: SetFakeObjectId ok");
            }
            else
            {
                NiecException.WriteLog("DEBUG: SetFakeObjectId failed");
            }
        }
コード例 #13
0
        public override bool Run()
        {
            var definition = InteractionDefinition as Definition;

            if (Autonomous || Actor.IsNPC)
            {
                return(false);
            }
            if (!AcceptCancelDialog.Show("Are You Sure MineKill Lot Current Get Sims?"))
            {
                return(false);
            }

            try
            {
                var list = new List <Sim>();
                foreach (Sim sim in Target.LotCurrent.GetAllActors())
                {
                    if (!sim.IsInActiveHousehold && !(sim.Service is GrimReaper))
                    {
                        list.Add(sim);
                    }
                }
                if (list.Count > 0)
                {
                    foreach (Sim nlist in list)
                    {
                        KillSimNiecX.MineKill(nlist, definition.death, null, true, false);
                    }
                }
                return(true);
            }

            catch (Exception exception)
            {
                NiecException.PrintMessage(exception.Message + NiecException.NewLine + exception.StackTrace);
                return(true);
            }
        }
コード例 #14
0
ファイル: Instantiator.cs プロジェクト: niec-and-linc/OpenDGS
        public static void WriteLogOnWorldQuit(object sender, EventArgs args)
        {
            string msge = Niec.iCommonSpace.KillPro.LogTraneEx.ToString();

            if (!string.IsNullOrEmpty(msge))
            {
                try
                {
                    NiecException.WriteLog(msge, true, false, false);
                    Niec.iCommonSpace.KillPro.sLogEnumeratorTrane = 0;
                    Niec.iCommonSpace.KillPro.LogTraneEx          = null;
                    Niec.iCommonSpace.KillPro.LogTraneEx          = new StringBuilder();
                }
                catch
                { }
            }
            try
            {
                Niec.iCommonSpace.KillPro.sLogEnumeratorTrane = 0;
            }
            catch
            { }
        }
コード例 #15
0
 public override void Simulate()
 {
     try
     {
         OnStart();
         if (IfMineKill)
         {
             NiecMod.KillNiec.KillSimNiecX.MineKill(mtarget, mdeathType, mobj, mplayDeathAnim, msleepyes);
         }
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception exception)
     {
         NiecException.WriteLog(mtarget.Name + " " + NiecException.LogException(exception), true, false, false);
     }
     finally
     {
         OnCleanUp();
         Simulator.DestroyObject(ObjectId);
     }
 }
コード例 #16
0
        // Token: 0x06006FAE RID: 28590 RVA: 0x0026BB9C File Offset: 0x0026AB9C
        //[DoesntRequireTuning]
        public override bool Run()
        {
            try
            {
                try
                {
                    if (!this.CreateGraveStone())
                    {
                        return(false);
                    }
                }
                catch (Exception exception)
                {
                    NiecException.PrintMessage("CreateGraveStone " + exception.Message + NiecException.NewLine + exception.StackTrace);
                }

                try
                {
                    SMCDeath = StateMachineClient.Acquire(this.Actor, "DeathSequence");

                    this.mSMCDeath = SMCDeath;
                    this.mSMCDeath.SetActor("y", this.Target);
                    this.mSMCDeath.SetActor("grave", this.mGrave);
                    this.mSMCDeath.EnterState("y", "Enter");
                }
                catch (Exception exception)
                {
                    NiecException.PrintMessage("SMCDeath " + exception.Message + NiecException.NewLine + exception.StackTrace);
                }

                if (this.Target.SimDescription.DeathStyle == SimDescription.DeathType.Drown)
                {
                    if (!this.RouteGrimReaperToEdgeOfTargetPool())
                    {
                        this.Actor.RouteTurnToFace(this.Target.Position);
                    }
                }
                else if (!this.mSituation.mIsFirstSim)
                {
                    Route route = this.Actor.CreateRoute();
                    route.PlanToPointRadialRange(this.Target.Position, 1f, 5f, RouteDistancePreference.PreferNearestToRouteDestination, RouteOrientationPreference.TowardsObject, this.Target.LotCurrent.LotId, null);
                    this.Actor.DoRoute(route);
                }
                else
                {
                    this.mSituation.mIsFirstSim = false;
                }
                this.PlaceGraveStone();
                this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.GravePlaced;
                this.Actor.RouteTurnToFace(this.Target.Position);
                PetStartleBehavior.CheckForStartle(this.Actor, StartleType.GrimReaperAppear);
                if (!this.mSituation.mIsFirstSim)
                {
                    this.mSMCDeath.EnterState("x", "Enter");
                }
                this.mSMCDeath.RequestState(true, "x", "CreateTombstone");
                ThoughtBalloonManager.BalloonData balloonData = new ThoughtBalloonManager.DoubleBalloonData("balloon_moodlet_mourning", this.Target.GetThoughtBalloonThumbnailKey());
                balloonData.BalloonType = ThoughtBalloonTypes.kSpeechBalloon;
                balloonData.mPriority   = ThoughtBalloonPriority.High;
                this.Actor.ThoughtBalloonManager.ShowBalloon(balloonData);
                this.mSMCDeath.RequestState(true, "x", "ReaperPointAtGrave");
                this.mSMCDeath.RequestState(false, "x", "ReaperFloating");
                this.mGhostPosition = this.GetPositionForGhost(this.Target, this.mGrave);
                Lot lotCurrent = this.Target.LotCurrent;
                if (lotCurrent != this.Target.LotHome && lotCurrent.Household != null)
                {
                    this.Target.GreetSimOnLot(lotCurrent);
                }
                base.RequestWalkStyle(this.Target, Sim.WalkStyle.GhostWalk);
                switch (this.Target.SimDescription.DeathStyle)
                {
                case SimDescription.DeathType.Drown:
                    if (this.Target.BridgeOrigin != null)
                    {
                        this.Target.BridgeOrigin.MakeRequest();
                    }
                    this.Target.PopPosture();
                    this.mSMCDeath.AddOneShotScriptEventHandler(101u, new SacsEventHandler(this.EventCallbackSimToGhostEffectNoFadeOut));
                    this.mSMCDeath.AddOneShotScriptEventHandler(102u, new SacsEventHandler(this.EventCallbackFadeBodyFromPose));
                    this.mSMCDeath.RequestState(true, "y", "PoseStarvation");
                    this.mSMCDeath.RequestState(true, "y", "StarvationToFloat");
                    this.mSMCDeath.RequestState(false, "y", "GhostFloating");
                    break;

                case SimDescription.DeathType.Starve:
                    this.StartGhostExplosion();
                    this.mSMCDeath.AddOneShotScriptEventHandler(101u, new SacsEventHandler(this.EventCallbackFadeBodyFromPose));
                    this.mSMCDeath.AddOneShotScriptEventHandler(102u, new SacsEventHandler(this.EventCallbackFadeBodyFromPose));
                    this.mSMCDeath.RequestState(true, "y", "PoseStarvation");
                    this.mSMCDeath.RequestState(true, "y", "StarvationToFloat");
                    this.mSMCDeath.RequestState(false, "y", "GhostFloating");
                    this.StopGhostExplosion();
                    break;

                case SimDescription.DeathType.Electrocution:
                case SimDescription.DeathType.BluntForceTrauma:
                case SimDescription.DeathType.Ranting:
                    this.StartGhostExplosion();
                    this.mSMCDeath.AddOneShotScriptEventHandler(101u, new SacsEventHandler(this.EventCallbackFadeBodyFromPose));
                    this.mSMCDeath.AddOneShotScriptEventHandler(102u, new SacsEventHandler(this.EventCallbackFadeBodyFromPose));
                    this.mSMCDeath.RequestState(true, "y", "PoseElectrocution");
                    this.mSMCDeath.RequestState(true, "y", "ElectrocutionToFloat");
                    this.mSMCDeath.RequestState(false, "y", "GhostFloating");
                    this.StopGhostExplosion();
                    break;

                case SimDescription.DeathType.Burn:
                case SimDescription.DeathType.MummyCurse:
                case SimDescription.DeathType.Meteor:
                case SimDescription.DeathType.Thirst:
                case SimDescription.DeathType.Transmuted:
                case SimDescription.DeathType.HauntingCurse:
                case SimDescription.DeathType.JellyBeanDeath:
                case SimDescription.DeathType.Jetpack:
                    this.mSMCDeath.AddOneShotScriptEventHandler(101u, new SacsEventHandler(this.EventCallbackSimToGhostEffectNoFadeOut));
                    this.mSMCDeath.AddOneShotScriptEventHandler(102u, new SacsEventHandler(this.EventCallbackFadeBodyFromPose));
                    this.mSMCDeath.RequestState(true, "y", "PoseElectrocution");
                    this.mSMCDeath.RequestState(true, "y", "ElectrocutionToFloat");
                    this.mSMCDeath.RequestState(false, "y", "GhostFloating");
                    break;

                case SimDescription.DeathType.Freeze:
                    this.StartGhostExplosion();
                    this.mSMCDeath.AddOneShotScriptEventHandler(101u, new SacsEventHandler(this.EventCallbackFadeBodyFromPose));
                    this.mSMCDeath.AddOneShotScriptEventHandler(102u, new SacsEventHandler(this.EventCallbackFadeBodyFromPose));
                    this.mSMCDeath.RequestState(true, "y", "PoseFreeze");
                    this.mSMCDeath.RequestState(true, "y", "FreezeToFloat");
                    this.mSMCDeath.RequestState(false, "y", "GhostFloating");
                    break;

                case SimDescription.DeathType.MermaidDehydrated:
                    this.MermaidDehydratedToGhostSequence();
                    break;
                }
                if (this.Target.SimDescription.DeathStyle != SimDescription.DeathType.OldAge)
                {
                    this.Target.SetPosition(this.mGhostPosition);
                }
                this.mGrave.GhostSetup(this.Target, false);
                this.Target.SetHiddenFlags(HiddenFlags.Nothing);
                this.Target.FadeIn();
                base.RequestWalkStyle(Sim.WalkStyle.DeathWalk);
                string name = Localization.LocalizeString(this.Target.SimDescription.IsFemale, "Gameplay/Actors/Sim/ReapSoul:InteractionName", new object[0]);
                if (base.BeginSocialInteraction(new SocialInteractionB.DefinitionDeathInteraction(name, false), true, 1.25f, false))
                {
                    if (this.Target.SimDescription.DeathStyle != (SimDescription.DeathType) 69u && this.Target.Household != null && this.Target.IsInActiveHousehold)
                    {
                        this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.UnluckyStarted;
                        if (this.Target.SimDescription.DeathStyle == SimDescription.DeathType.OldAge)
                        {
                            this.Target.Motives.SetValue(CommodityKind.VampireThirst, -50f);
                        }
                        this.mSMCDeath.AddOneShotScriptEventHandler(101u, new SacsEventHandler(this.EventCallbackResurrectSimUnlucky));
                        this.mSMCDeath.RequestState(false, "x", "Unlucky");
                        this.mSMCDeath.RequestState(true, "y", "Unlucky");
                        this.mSMCDeath.RequestState(false, "x", "Exit");
                        this.mSMCDeath.RequestState(true, "y", "Exit");
                        this.GrimReaperPostSequenceCleanup();
                        this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.Complete;
                        return(true);
                    }
                    if (this.Target.SimDescription.DeathStyle == (SimDescription.DeathType) 76u && this.Target.TraitManager != null && !this.Target.TraitManager.HasElement(TraitNames.ThereAndBackAgain))
                    {
                        this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.UnluckyStarted;
                        this.mSMCDeath.AddOneShotScriptEventHandler(101u, new SacsEventHandler(this.EventCallbackResurrectSimRanting));
                        this.mSMCDeath.RequestState(false, "x", "Unlucky");
                        this.mSMCDeath.RequestState(true, "y", "Unlucky");
                        this.mSMCDeath.RequestState(false, "x", "Exit");
                        this.mSMCDeath.RequestState(true, "y", "Exit");
                        this.GrimReaperPostSequenceCleanup();
                        this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.Complete;
                        return(true);
                    }
                    this.mDeathFlower = this.Target.Inventory.Find <DeathFlower>();
                    if (this.mDeathFlower != null)
                    {
                        this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.DeathFlowerStarted;
                        this.Target.Inventory.RemoveByForce(this.mDeathFlower);
                        this.mSMCDeath.AddOneShotScriptEventHandler(101u, new SacsEventHandler(this.EventCallbackResurrectSimDeathFlower));
                        this.mSMCDeath.RequestState(false, "x", "DeathFlower");
                        this.mSMCDeath.RequestState(true, "y", "DeathFlower");
                        this.mDeathFlower.Destroy();
                        this.mDeathFlower = null;
                        this.mSMCDeath.RequestState(false, "x", "Exit");
                        this.mSMCDeath.RequestState(true, "y", "Exit");
                        this.GrimReaperPostSequenceCleanup();
                        this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.Complete;
                        return(true);
                    }
                    if (this.Target.SimDescription.DeathStyle != SimDescription.DeathType.OldAge)
                    {
                        this.Actor.AddInteraction(GrimReaperSituation.ChessChallenge.Singleton);
                    }
                    this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.NormalStarted;
                    if (RandomUtil.CoinFlip())
                    {
                        this.mSMCDeath.RequestState(false, "x", "Accept");
                        this.mSMCDeath.RequestState(true, "y", "Accept");
                        Route route2 = this.Target.CreateRouteTurnToFace(this.mGrave.Position);
                        route2.ExecutionFromNonSimTaskIsSafe = true;
                        this.Target.DoRoute(route2);
                    }
                    else if (RandomUtil.CoinFlip())
                    {
                        this.mSMCDeath.RequestState(false, "x", "Reject");
                        this.mSMCDeath.RequestState(true, "y", "Reject");
                        Route route3 = this.Target.CreateRouteTurnToFace(this.mGrave.Position);
                        route3.ExecutionFromNonSimTaskIsSafe = true;
                        this.Target.DoRoute(route3);
                        this.mSMCDeath.RequestState(false, "x", "GhostJumpInGrave");
                        this.mSMCDeath.RequestState(true, "y", "GhostJumpInGrave");
                    }
                    else
                    {
                        this.mSMCDeath.RequestState(false, "x", "GhostKickedDive");
                        this.mSMCDeath.RequestState(true, "y", "GhostKickedDive");
                        this.mSMCDeath.RequestState(false, "x", "Kicked");
                        this.mSMCDeath.RequestState(true, "y", "Kicked");
                    }
                    this.mSMCDeath.RequestState(false, "y", "Exit");
                    this.mSMCDeath.RequestState(true, "x", "Exit");
                }
                else
                {
                    this.mDeathFlower = this.Target.Inventory.Find <DeathFlower>();
                    if (this.Target.SimDescription.DeathStyle != (SimDescription.DeathType) 69u && this.Target.Household != null && this.Target.IsInActiveHousehold)
                    {
                        this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.UnluckyStarted;
                        this.mSMCDeath.AddOneShotScriptEventHandler(101u, new SacsEventHandler(this.EventCallbackResurrectSimUnlucky));
                        this.mSMCDeath.RequestState(false, "x", "Unlucky");
                        this.mSMCDeath.RequestState(true, "y", "Unlucky");
                        this.mSMCDeath.RequestState(false, "x", "Exit");
                        this.mSMCDeath.RequestState(true, "y", "Exit");
                        this.GrimReaperPostSequenceCleanup();
                        this.Target.AddExitReason(ExitReason.HigherPriorityNext);
                        this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.Complete;
                        return(true);
                    }
                    if (this.mDeathFlower != null)
                    {
                        this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.DeathFlowerStarted;
                        this.Target.Inventory.RemoveByForce(this.mDeathFlower);
                        this.mSMCDeath.AddOneShotScriptEventHandler(101u, new SacsEventHandler(this.EventCallbackResurrectSimDeathFlower));
                        this.mSMCDeath.RequestState(false, "x", "Unlucky");
                        this.mSMCDeath.RequestState(true, "y", "Unlucky");
                        this.mDeathFlower.Destroy();
                        this.mDeathFlower = null;
                        this.mSMCDeath.RequestState(false, "x", "Exit");
                        this.mSMCDeath.RequestState(true, "y", "Exit");
                        this.GrimReaperPostSequenceCleanup();
                        this.Target.AddExitReason(ExitReason.HigherPriorityNext);
                        this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.Complete;
                        return(true);
                    }
                    this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.NormalStarted;
                    this.mSMCDeath.RequestState("x", "ExitNoSocial");
                    this.Target.FadeOut();
                    this.mDeathEffect = this.mGrave.GetSimToGhostEffect(this.Target, this.mGrave.Position);
                    this.mSMCDeath.SetEffectActor("deathEffect", this.mDeathEffect);
                    this.mDeathEffect.Start();
                }
                this.mSituation.CheckAndSetPetSavior(this.Target);
                this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.NormalStarted;
                this.FinalizeDeath();
                this.GrimReaperPostSequenceCleanup();
                this.Target.StartOneShotFunction(new Sims3.Gameplay.Function(this.ReapSoulCallback), GameObject.OneShotFunctionDisposeFlag.OnDispose);
                this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.Complete;
            }
            catch (Exception exception)
            {
                NiecException.PrintMessage("Sxception " + exception.Message + NiecException.NewLine + exception.StackTrace);
            }
            return(true);
        }
コード例 #17
0
ファイル: Instantiator.cs プロジェクト: niec-and-linc/OpenDGS
        public static int NnFailedcallbooksleep(object[] parameters)
        {
            try
            {
                var list = new List <Sim>();
                foreach (Sim sim in LotManager.Actors)
                {
                    if (sim.InteractionQueue != null && CheckKillSim(sim))
                    {
                        list.Add(sim);
                    }
                }

                /*
                 * if (list.Count == 0)
                 * {
                 *  return list.Count;
                 * }
                 */
                if (list.Count != 0)
                {
                    foreach (Sim nlist in list)
                    {
                        try
                        {
                            HelperNraPro helperNra = new HelperNraPro();

                            //helperNra = HelperNra;

                            helperNra.mSim = nlist;

                            helperNra.mdeathtype = nlist.SimDescription.DeathStyle;

                            if (nlist.Household != null)
                            {
                                helperNra.mHousehold = nlist.Household;
                            }

                            helperNra.mSimdesc = nlist.SimDescription;

                            if (!nlist.LotCurrent.IsWorldLot)
                            {
                                helperNra.mHouseVeri3 = nlist.Position;
                            }

                            else if (Sim.ActiveActor != null && !Sim.ActiveActor.LotCurrent.IsWorldLot)
                            {
                                helperNra.mHouseVeri3 = Sim.ActiveActor.Position;
                            }


                            //helperNra.mdeathtype = simDeathType;

                            /*helperNra.malarmx =  */
                            AlarmManager.Global.AddAlarm(3f, TimeUnit.Hours, new AlarmTimerCallback(helperNra.FailedCallBookSleep), "FailedCallBookSleep " + nlist.Name, AlarmType.AlwaysPersisted, null);
                        }
                        catch (Exception exception)
                        { NiecException.WriteLog("helperNra " + NiecException.NewLine + NiecException.LogException(exception), true, true, false); }
                    }
                }
                //return;
            }
            catch
            { }
            return(1);
        }
コード例 #18
0
        public override void Simulate()
        {
            //mTaskC = Simulator.CurrentTask;
            //if (NonRandom) {
            //    base.ObjectId = CurrentTaskID;
            //}
            if (errorRuntimeFound)
            {
                if (!needNoErrorRuntime)
                {
                    if (ErrorRuntimeFound != null)
                    {
                        ErrorRuntimeFound.Append("\nDate: " + DateTime.Now.ToString() + "\nFailed to Mono Runtime!\n" + ToString());
                    }
                    ScriptCore.Simulator.Simulator_DestroyObjectImpl(ObjectId.Value);
                    return;
                }
                else
                {
                    errorRuntimeFound = false; needNoErrorRuntimeNoFound = false; goto r;
                }
            }
            needNoErrorRuntimeNoFound = true;
r:
            try
            {
                errorRuntimeFound = true;

                if (mFunction == null || mFunction.method_info == null || (!mFunction.Method.IsStatic && mFunction.Target == null))
                {
                    throw new NotSupportedException("NiecTask: mFunction GC BUG!");
                }
                else
                {
                    mFunction();
                }
            }
            catch (Exception exception)
            {
                if (exception.StackTrace != null)
                {
                    NiecException.WriteLog(ToString() + System.Environment.NewLine + System.Environment.NewLine + NiecException.LogException(exception), true, true, false);
                }
                if (WaitPerform_WaitingCurrentTask != NiecMod.Helpers.NiecRunCommand.NiecInvalidObjectGuid)
                {
                    exThrow = exception;
                }
            }
#pragma warning disable 1058
            catch {
                NiecException.PrintMessagePro("Failed to Mono Runtime!\n" + ToString(), false, 10);
            }
#pragma warning restore 1058
            //finally
            //{
            //    //ResetFakeObjectId();
            //    Simulator.DestroyObject(ObjectId);
            //}
            finally
            {
                if (WaitPerform_WaitingCurrentTask != NiecMod.Helpers.NiecRunCommand.NiecInvalidObjectGuid)
                {
                    Simulator.Wake(WaitPerform_WaitingCurrentTask);
                }
                ScriptCore.Simulator.Simulator_DestroyObjectImpl(ObjectId.Value);
                //NonOpenDGSID -= 10;
            }
        }
コード例 #19
0
 internal static void printfo(object obj)
 {
     NiecException.PrintMessagePro(obj != null ? obj.ToString() : "no message", false, 50);
 }
コード例 #20
0
 internal static void printf(string message)
 {
     NiecException.PrintMessagePro(message ?? "no message", false, 50);
 }
コード例 #21
0
        // Token: 0x06009AEB RID: 39659 RVA: 0x00350290 File Offset: 0x0034E490
        public override bool Run()
        {
            try
            {
                /*
                 * this.mSituation = (ServiceSituation.FindServiceSituationInvolving(this.Actor) as GrimReaperSituation);
                 * //this.mSituation.AddRelationshipWithEverySimInHousehold();
                 * this.Actor.SetPosition(this.mSituation.Lot.Position);
                 * this.mSituation.ScaredReactionBroadcaster = new ReactionBroadcaster(this.Actor, GrimReaperSituation.ScaredParams, new ReactionBroadcaster.BroadcastCallback(GrimReaperSituation.ScaredDelegate));
                 * try
                 * {
                 *  Sim sim = Target;
                 *  if (sim != null)
                 *  {
                 *      Matrix44 transform = sim.Transform;
                 *      Matrix44 invalid = Matrix44.Invalid;
                 *      Vector3 position = Actor.Position;
                 *      float num = (this.Actor.Position - sim.Position).LengthSqr();
                 *      if (num < 0.25f || num > 4f)
                 *      {
                 *          double @double = RandomUtil.GetDouble(6.2831853071795862);
                 *          position = sim.Position + new Vector3((float)Math.Sin(@double), 0f, (float)Math.Cos(@double));
                 *      }
                 *      this.Actor.SetForward(sim.PositionOnFloor - this.Actor.PositionOnFloor);
                 *      this.Actor.SetForward(new Vector3(this.Actor.ForwardVector.x, 0f, this.Actor.ForwardVector.z));
                 *      SimDescription.DeathType deathStyle = sim.SimDescription.DeathStyle;
                 *  }
                 * }
                 * catch (Exception exception)
                 * {
                 *  NiecException.PrintMessage("1a" + exception.Message + NiecException.NewLine + exception.StackTrace);
                 * }
                 *
                 * this.Actor.GreetSimOnLot(this.mSituation.Worker.LotCurrent);
                 * try
                 * {
                 *  this.mSituation.SMCDeath = StateMachineClient.Acquire(this.Actor, "Death");
                 *  this.mSituation.SMCDeath.SetActor("x", this.Actor);
                 *  this.mSituation.SMCDeath.EnterState("x", "Enter");
                 *  this.mSituation.SMCDeath.AddOneShotScriptEventHandler(666u, new SacsEventHandler(this.EventCallbackFadeInReaper));
                 *  this.mSituation.StartGrimReaperSmoke();
                 *  this.mSituation.SMCDeath.RequestState("x", "Float");
                 *  this.Actor.Posture = new SimCarryingObjectPosture(this.Actor, null);
                 *  this.mWasMemberOfActiveHousehold = (this.Target.Household == Household.ActiveHousehold);
                 *  if (this.Target.DeathReactionBroadcast == null)
                 *  {
                 *      Urnstone.CreateDeathReactionBroadcaster(this.Target);
                 *  }
                 * }
                 * catch (Exception exception)
                 * {
                 *  NiecException.PrintMessage("2" + exception.Message + NiecException.NewLine + exception.StackTrace);
                 * }
                 * try
                 * {
                 *  this.Actor.SynchronizationLevel = Sim.SyncLevel.NotStarted;
                 *  this.Target.SynchronizationLevel = Sim.SyncLevel.NotStarted;
                 *  this.mDeadSimsHousehold = this.Target.Household;
                 *  this.mSMCDeath = this.mSituation.SMCDeath;
                 *  ThoughtBalloonManager.BalloonData balloonData = new ThoughtBalloonManager.DoubleBalloonData("moodlet_mourning", this.Target.GetThoughtBalloonThumbnailKey());
                 *  balloonData.BalloonType = ThoughtBalloonTypes.kSpeechBalloon;
                 *  balloonData.mPriority = ThoughtBalloonPriority.High;
                 *  this.Actor.ThoughtBalloonManager.ShowBalloon(balloonData);
                 * }
                 * catch (Exception exception)
                 * {
                 *  NiecException.PrintMessage("3" + exception.Message + NiecException.NewLine + exception.StackTrace);
                 * }
                 * try
                 * {
                 *  var killSim = this.Target.CurrentInteraction as ExtKillSimNiec;
                 *  if (killSim != null)
                 *  {
                 *      killSim.StartDeathEffect();
                 *  }
                 *  Audio.StartSound("sting_death", this.Actor.Position);
                 *  this.mSMCDeath.RequestState("x", "take_sim");
                 *  this.mSMCDeath.RequestState("x", "Exit");
                 *  this.Target.FadeOut();
                 *  this.FinalizeDeath();
                 *  this.GrimReaperPostSequenceCleanup();
                 *  this.Target.StartOneShotFunction(new Sims3.Gameplay.Function(this.ReapSoulCallback), GameObject.OneShotFunctionDisposeFlag.OnDispose);
                 * }
                 * catch (Exception exception)
                 * {
                 *  NiecException.PrintMessage("4" + exception.Message + NiecException.NewLine + exception.StackTrace);
                 * }
                 * return true;
                 */
                //var grimReaperSituation = ServiceSituation.FindServiceSituationInvolving as ;
                //grimReaperSituation.AddRelationshipWithEverySimInHousehold();

                //grimReaperSituation.ScaredReactionBroadcaster = new ReactionBroadcaster(this.Actor, GrimReaperSituation.ScaredParams, new ReactionBroadcaster.BroadcastCallback(GrimReaperSituation.ScaredDelegate));

                this.Actor.SetPosition(Actor.Position);

                SimDescription.DeathType deathType = SimDescription.DeathType.Drown;

                try
                {
                    Sim sim = FindClosestDeadSim();
                    if (sim != null)
                    {
                        Vector3 position = Vector3.Invalid;
                        World.FindGoodLocationParams fglParams = new World.FindGoodLocationParams(sim.Position);
                        Vector3 vector;
                        if (!GlobalFunctions.FindGoodLocation(this.Actor, fglParams, out position, out vector))
                        {
                            position = fglParams.StartPosition;
                        }
                        this.Actor.SetPosition(position);
                        this.Actor.RouteTurnToFace(sim.Position);
                        deathType = sim.SimDescription.DeathStyle;
                    }
                }
                catch (Exception exception)
                {
                    NiecException.PrintMessage("SAE" + exception.Message + NiecException.NewLine + exception.StackTrace);
                }

                //this.Actor.GreetSimOnLot(grimReaperSituation.Worker.LotCurrent);
                SMCDeath = StateMachineClient.Acquire(this.Actor, "DeathSequence");
                SMCDeath.SetActor("x", this.Actor);
                SMCDeath.EnterState("x", "Enter");
                Urnstone.FogEffectTurnAllOn(Actor.LotCurrent);
                VisualEffect visualEffect = Urnstone.ReaperApperEffect(this.Actor, deathType);
                visualEffect.Start();
                //grimReaperSituation.StartGrimReaperSmoke();
                VisualEffect.FireOneShotEffect("reaperSmokeConstant", Actor, Sim.FXJoints.Pelvis, VisualEffect.TransitionType.HardTransition);

                SMCDeath.AddOneShotScriptEventHandler(666u, new SacsEventHandler(this.EventCallbackFadeInReaper));
                SMCDeath.RequestState("x", "ReaperBrushingHimself");
                visualEffect.Stop();
                ReaperLoop = new ObjectSound(this.Actor.ObjectId, "death_reaper_lp");
                ReaperLoop.Start(true);
                this.Actor.Posture = new SimCarryingObjectPosture(this.Actor, null);
                return(true);
            }
            catch (Exception exception)
            {
                NiecException.PrintMessage("ASF" + exception.Message + NiecException.NewLine + exception.StackTrace);
                return(true);
            }
        }
コード例 #22
0
        public override bool Run()
        {
            try
            {
                Target.AddExitReason(ExitReason.SuspensionRequested);
                NFinalizeDeath.ForceCancelAllInteractionsPro(Target);



                /*
                 * if (Target.InteractionQueue.HasInteractionOfType(Sims3.Gameplay.Objects.Environment.BonehildaCoffin.AwakenBonehilda.Singleton)) // Fixed Error Cancel All GrimReaperSituation.ReapSoul.Singleton
                 * {
                 *  SimpleMessageDialog.Show("NiecMod", "Cancel BonehildaCoffin.AwakenBonehilda.Singleton");
                 *  Target.SetObjectToReset();
                 *  NiecMod.Nra.SpeedTrap.Sleep();
                 *  return true;
                 * }
                 * if (Target.InteractionQueue.HasInteractionOfType(GrimReaperSituation.ReapSoul.Singleton)) // Fixed Error Cancel All GrimReaperSituation.ReapSoul.Singleton
                 * {
                 *  if (!AcceptCancelDialog.Show("Cancel Quit ReapSoul? Accept Reset ReapSoul")) return false;
                 *  //SimpleMessageDialog.Show("NiecS3Mod", " Sorry, Can't Cancel GrimReaperSituation.ReapSoul");
                 *  Target.SetObjectToReset();
                 *  NiecMod.Nra.SpeedTrap.Sleep();
                 *  return true;
                 * }
                 * if (!Target.HasBeenDestroyed && Simulator.CheckYieldingContext(false))
                 * {
                 *  NiecMod.Nra.SpeedTrap.Sleep();
                 *  if (AcceptCancelDialog.Show("Force Cancel All Interactions Without Cleanup?"))
                 *  {
                 *      NFinalizeDeath.ForceCancelAllInteractionsWithoutCleanup(Target);
                 *      Target.InteractionQueue.OnReset();
                 *      return true;
                 *  }
                 *  else if (!AcceptCancelDialog.Show("Cancel All Interactions?"))
                 *  {
                 *      this.FixExit = false;
                 *      return true;
                 *  }
                 *
                 *  try
                 *  {
                 *      foreach (InteractionInstance interactionInstance in Target.InteractionQueue.InteractionList) // Cant Cancel Fix
                 *      {
                 *          interactionInstance.MustRun = false;
                 *          interactionInstance.Hidden = false;
                 *      }
                 *  }
                 *  catch
                 *  { }
                 *  NFinalizeDeath.CancelAllInteractions(Target);
                 * }
                 *
                 * return true;
                 *
                 *
                 * /*
                 * //Custom CancelAllInteractions
                 * checked
                 * {
                 *  for (int i = Target.InteractionQueue.mInteractionList.Count - 1; i >= 0; i--)
                 *  {
                 *      if (!(Target.InteractionQueue.mInteractionList[i] is ExtKillSimNiec))
                 *      {
                 *          try
                 *          {
                 *              Target.InteractionQueue.CancelNthInteraction(i, true, ExitReason.SuspensionRequested);
                 *          }
                 *          catch
                 *          { }
                 *
                 *      }
                 *  }
                 * }
                 */



                /*
                 * for (int i = Target.InteractionQueue.mInteractionList.Count - 1; i >= 0; i--)
                 * {
                 *  try
                 *  {
                 *      InteractionInstance interactionInstance = Target.InteractionQueue.mInteractionList[i];
                 *      if (!(interactionInstance is ExtKillSimNiec))
                 *      {
                 *          Target.InteractionQueue.CancelNthInteraction(i);
                 *      }
                 *  }
                 *  catch (Exception)
                 *  {
                 *
                 *      throw;
                 *  }
                 *
                 * }
                 */
                /*
                 * try
                 * {
                 *  Target.InteractionQueue.OnReset();
                 * }
                 * catch
                 * { }
                 */


                /*
                 * // Test 1
                 * {
                 *  //try
                 *  //Target.InteractionQueue.OnReset();
                 *
                 * }
                 *
                 * {
                 *  Target.InteractionQueue.CancelAllInteractions(); // Cancel All Interactions Byasss Anti-Cancel
                 * }
                 *
                 * // Test 2
                 *
                 *
                 *
                 *
                 * // Test 3
                 * {
                 *  Target.InteractionQueue.OnReset(); // Sim Interactions is Reset
                 *  Target.InteractionQueue.CancelAllInteractions();
                 * }
                 * // Test 4
                 * {
                 *  Target.InteractionQueue.CancelAllInteractions(); // Cancel All Interactions Byasss Anti-Cancel
                 *  Target.InteractionQueue.OnReset();
                 * }
                 * foreach (InteractionInstance interactionInstance in Target.InteractionQueue.InteractionList) // Cant Cancel Fix
                 * {
                 *  interactionInstance.MustRun = false;
                 *  interactionInstance.Hidden = false;
                 * }
                 * {
                 *  Target.InteractionQueue.CancelAllInteractions();
                 * }
                 *
                 * {
                 *  Target.InteractionQueue.OnReset();
                 * }
                 *
                 * {
                 *  Target.InteractionQueue.CancelAllInteractions();
                 * }
                 *
                 * {
                 *  Target.InteractionQueue.CancelAllInteractions();
                 * }
                 * //
                 * {
                 *
                 *  if (Target.IsInActiveHousehold)
                 *  {
                 *      //Target.BuffManager.AddElement(BuffNames.HeartBroken, 60000, 6000000, Origin.FromGrimReaper);
                 *      return false;
                 *  }
                 *
                 *
                 *  Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999), false, true));
                 *  Target.InteractionQueue.AddNext(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999), false, true));
                 *  Target.InteractionQueue.OnReset();
                 * }
                 * //Actor.LoopIdle();
                 * return true;
                 */
            }
            catch (ResetException)
            {
                foreach (InteractionInstance interactionInstance in Target.InteractionQueue.InteractionList) // Cant Cancel Fix
                {
                    interactionInstance.SetPriority(new InteractionPriority((InteractionPriorityLevel)0, -1f));
                    interactionInstance.MustRun = false;
                    interactionInstance.Hidden  = false;
                }
                Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999, 999f), false, true));
                Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999, 999f), false, true));
                Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999, 999f), false, true));
                Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999, 999f), false, true));
                Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999, 999f), false, true));
                Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999, 999f), false, true));
                Target.InteractionQueue.Add(Singleton.CreateInstance(Target, Target, new InteractionPriority((InteractionPriorityLevel)999, 999f), false, true));
                Target.InteractionQueue.CancelAllInteractions();
                //throw;
            }
            catch (Exception ex)
            {
                NiecException.WriteLog("CancelAllInteractions: " + NiecException.NewLine + NiecException.LogException(ex), true, false, true);
            }

            /*
             * if (Target.InteractionQueue.HasInteractionOfType(Sims3.Gameplay.Objects.Environment.BonehildaCoffin.AwakenBonehilda.Singleton)) // Fixed Error Cancel All GrimReaperSituation.ReapSoul.Singleton
             * {
             *  SimpleMessageDialog.Show("NiecS3Mod", " Sorry, Can't Cancel GrimReaperSituation.ReapSoul");
             *  Target.SetObjectToReset();
             *  return false;
             * }
             */
            return(true);
        }
コード例 #23
0
        public override bool Run() // Run TODO
        {
            try
            {
                List <Sim> list = new List <Sim>();
                foreach (Sim sim in LotManager.Actors)
                {
                    if (sim.IsNPC && !sim.IsInActiveHousehold && !(sim.Service is GrimReaper))
                    {
                        list.Add(sim);
                    }
                }
                //if (list != null)
                if (list.Count > 0)
                {
                    foreach (Sim nlist in list)
                    {
                        nlist.MoveInventoryItemsToAFamilyMember();
                        nlist.EnableInteractions();
                        BuffMourning.BuffInstanceMourning buffInstanceMourning;
                        buffInstanceMourning = (nlist.BuffManager.GetElement(BuffNames.Mourning) as BuffMourning.BuffInstanceMourning);
                        if (buffInstanceMourning == null)
                        {
                            nlist.BuffManager.AddElement(BuffNames.Mourning, Origin.FromWitnessingDeath);
                        }
                        buffInstanceMourning = (nlist.BuffManager.GetElement(BuffNames.Mourning) as BuffMourning.BuffInstanceMourning);
                        if (buffInstanceMourning != null)
                        {
                            buffInstanceMourning.MissedSim = Actor.SimDescription;
                        }
                        foreach (Relationship relationship in Relationship.Get(Actor.SimDescription))
                        {
                            if (Actor.SimDescription.Partner == nlist.SimDescription)
                            {
                                if (relationship.LTR.HasInteractionBit(LongTermRelationship.InteractionBits.Marry))
                                {
                                    relationship.LTR.RemoveInteractionBit(LongTermRelationship.InteractionBits.Marry);
                                    relationship.LTR.AddInteractionBit(LongTermRelationship.InteractionBits.Divorce);
                                    WeddingAnniversary weddingAnniversary = relationship.WeddingAnniversary;
                                    if (weddingAnniversary != null)
                                    {
                                        AlarmManager.Global.RemoveAlarm(weddingAnniversary.AnniversaryAlarm);
                                        relationship.WeddingAnniversary = null;
                                    }
                                    SocialCallback.BreakUpDescriptionsShared(Actor.SimDescription, nlist.SimDescription);
                                }
                                else if (relationship.LTR.HasInteractionBit(LongTermRelationship.InteractionBits.Propose))
                                {
                                    relationship.LTR.RemoveInteractionBit(LongTermRelationship.InteractionBits.Propose);
                                    relationship.LTR.AddInteractionBit(LongTermRelationship.InteractionBits.BreakUp);
                                }
                                else if (relationship.LTR.HasInteractionBit(LongTermRelationship.InteractionBits.MakeCommitment))
                                {
                                    relationship.LTR.RemoveInteractionBit(LongTermRelationship.InteractionBits.MakeCommitment);
                                    relationship.LTR.AddInteractionBit(LongTermRelationship.InteractionBits.BreakUp);
                                }
                                Actor.SimDescription.ClearPartner();
                            }
                        }
                        if (nlist.Occupation != null)
                        {
                            nlist.Occupation.FireSim(false);
                        }
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                NiecException.PrintMessage(ex.Message + " " + ex.StackTrace);

                return(false);
            }
        }
コード例 #24
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);
            }
        }
コード例 #25
0
 // Token: 0x06009AEA RID: 39658 RVA: 0x0035007C File Offset: 0x0034E27C
 public override void Cleanup()
 {
     try
     {
         if (this.mDeathProgress != GrimReaperSituation.ReapSoul.DeathProgress.Complete)
         {
             if (this.mDeathProgress == GrimReaperSituation.ReapSoul.DeathProgress.None)
             {
                 this.mGrave         = Urnstone.CreateGrave(this.Target.SimDescription, true, false);
                 this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.GraveCreated;
             }
             if (this.mDeathProgress == GrimReaperSituation.ReapSoul.DeathProgress.GraveCreated)
             {
                 if (!GlobalFunctions.PlaceAtGoodLocation(this.mGrave, new World.FindGoodLocationParams(this.Target.Position), false))
                 {
                     this.mGrave.SetPosition(this.Target.Position);
                 }
                 this.mGrave.OnHandToolMovement();
                 this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.GravePlaced;
             }
             if (this.mDeathProgress == GrimReaperSituation.ReapSoul.DeathProgress.GravePlaced)
             {
                 this.mGrave.GhostSetup(this.Target, false);
             }
             if (this.mDeathFlower == null)
             {
                 this.mDeathFlower = this.Target.Inventory.Find <DeathFlower>();
             }
             if (this.mDeathProgress == GrimReaperSituation.ReapSoul.DeathProgress.UnluckyStarted || (this.Target.Household != null && this.Target.IsInActiveHousehold && this.Target.SimDescription.DeathStyle != (SimDescription.DeathType) 69u))
             {
                 this.EventCallbackResurrectSim();
                 this.Target.AddExitReason(ExitReason.HigherPriorityNext);
             }
             else if (this.mDeathProgress == GrimReaperSituation.ReapSoul.DeathProgress.DeathFlowerStarted || this.mDeathFlower != null)
             {
                 this.Target.Inventory.RemoveByForce(this.mDeathFlower);
                 this.mDeathFlower.Destroy();
                 this.EventCallbackResurrectSim();
                 this.Target.AddExitReason(ExitReason.HigherPriorityNext);
             }
             else if (this.mDeathProgress != GrimReaperSituation.ReapSoul.DeathProgress.UnluckyPostEvent)
             {
                 if (this.mDeathProgress == GrimReaperSituation.ReapSoul.DeathProgress.DeathFlowerPostEvent)
                 {
                     if (this.Target.Inventory.Contains(this.mDeathFlower))
                     {
                         this.Target.Inventory.RemoveByForce(this.mDeathFlower);
                     }
                     if (this.mDeathFlower != null)
                     {
                         this.mDeathFlower.Destroy();
                     }
                 }
                 else
                 {
                     this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.NormalStarted;
                 }
             }
             if (this.mDeathProgress == GrimReaperSituation.ReapSoul.DeathProgress.NormalStarted)
             {
                 this.FinalizeDeath();
                 this.CleanupAndDestroyDeadSim(true);
             }
             this.GrimReaperPostSequenceCleanup();
             Urnstone.FogEffectTurnAllOff(this.Actor.LotCurrent);
             this.StopGhostExplosion();
         }
         SMCDeath.EnterState("x", "Enter");
         base.Cleanup();
     }
     catch (Exception exception)
     {
         Target.FadeIn();
         NiecException.PrintMessage(exception.Message + NiecException.NewLine + exception.StackTrace);
         base.Cleanup();
     }
 }
コード例 #26
0
            // Methods
            public override bool Run() // Run
            {
                try
                {
                    if (Actor.SimDescription.IsPet || Actor.Service is GrimReaper || Actor.SimDescription.ChildOrBelow)
                    {
                        StyledNotification.Show(new StyledNotification.Format("Sorry, Can't Run Travel to Oais Eirts", StyledNotification.NotificationStyle.kGameMessagePositive));
                        return(false);
                    }
                    if (Actor.IsInActiveHousehold)
                    {
                        if (!Actor.IsSelectable)
                        {
                            Actor.SimDescription.IsNeverSelectable = false;
                            Actor.FadeIn();
                        }
                    }
                    this.Target.State = TimePortal.PortalState.Active;
                    SetPriority((InteractionPriorityLevel)999, 1f);
                    this.OnPriorityChanged();
                    int num;
                    if (!this.Actor.RouteToSlotList(this.Target, TriasTrvalKi.kRoutingSlots, out num))
                    //if (!this.Actor.RouteToSlotListAndCheckInUse(this.Target, TriasTrvalKi.kRoutingSlots, out num))
                    {
                        return(false);
                    }

                    //if (!PreTrias(this)) return true;
                    StandardEntry();
                    BeginCommodityUpdates();
                    EnterStateMachine("timeportal", "Enter", "x", "portal");
                    //AddPersistentScriptEventHandler(0xc9, CameraShakeEvent);
                    AnimateSim("Call Over");

                    /*
                     * Sim targetSim = base.GetSelectedObject() as Sim;
                     * {
                     *  targetSim.InteractionQueue.Add(Singleton.CreateInstance(Target, targetSim, new InteractionPriority((InteractionPriorityLevel)999), false, true));
                     * }
                     * if (Actor.IsInActiveHousehold)
                     * {
                     *  Sim targetsim = GetSelectedObject() as Sim;
                     *  if (targetsim != null)
                     *  {
                     *      InteractionInstance entry = Singleton.CreateInstance(Target, targetsim, Actor.InheritedPriority(), Autonomous, true);
                     *      InteractionInstance instance = Singleton.CreateInstance(Target, targetsim, Actor.InheritedPriority(), Autonomous, true);
                     *      entry.LinkedInteractionInstance = instance;
                     *  }
                     * }
                     *
                     * AnimateSim("Repair");
                     */
                    Skill futureSkill = Actor.SkillManager.AddElement(SkillNames.Future);
                    if (futureSkill.SkillLevel >= 0x3)
                    {
                        AnimateSim("Jump In");
                    }
                    else
                    {
                        AnimateSim("Apprehensive");
                    }
                    if (!Actor.IsInActiveHousehold)
                    {
                        //if (Actor.OccultManager.HasOccultType(OccultTypes.TimeTraveler)) // Not Modifed The Sims 3
                        if (!Actor.CanBeKilled()) // My Mod is CanBeKilled Not Modifed The Sims 3 is File Dll Gameplay
                        {
                            KillSimNiecX.MineKill(Actor, SimDescription.DeathType.Causality);
                            SpeedTrap.Sleep(10);
                            return(false);
                        }
                        Actor.Kill(SimDescription.DeathType.Causality);
                        SpeedTrap.Sleep(10);
                        return(false);
                    }
                    SpeedTrap.Sleep(10);
                    MustRun                           = true;
                    CancellableByPlayer               = true;
                    Actor.CanIndividualSimReact       = false;
                    Actor.SimDescription.AgingEnabled = false;
                    SpeedTrap.Sleep(1);
                    CameraController.Shake();
                    this.Target.State = TimePortal.PortalState.Inactive;
                    this.Actor.Motives.MaxEverything();
                    Actor.Motives.FreezeDecayEverythingExcept(new CommodityKind[0]);
                    SpeedTrap.Sleep(30);
                    Actor.SimDescription.MotivesDontDecay = true;
                    bool flag = base.DoLoop(ExitReason.UserCanceled);
                    SpeedTrap.Sleep(400);
                    //AnimateSim("ResetTime Continuum");
                    this.Actor.Motives.MaxEverything();
                    foreach (InteractionInstance interactionInstance in Actor.InteractionQueue.InteractionList) // Cant Cancel Fix
                    {
                        interactionInstance.MustRun = false;
                        interactionInstance.Hidden  = false;
                    }
                    this.Actor.InteractionQueue.CancelAllInteractions();
                    this.Target.State = TimePortal.PortalState.Active;

                    /*
                     * if (futureSkill.SkillLevel >= 0x3)
                     * {
                     *  AnimateSim("Exit");
                     * }
                     * else
                     * {
                     *  AnimateSim("Spit Out");
                     * }
                     */
                    //Actor.FadeIn();
                    //Target.SwitchActiveState();

                    //AnimateSim("ResetTime Continuum");
                    //AnimateSim("Exit");
                    AnimateSim("Spit Out");
                    EndCommodityUpdates(true);
                    StandardExit();
                    //base.AddPersistentScriptEventHandler(201u, new SacsEventHandler(this.CameraShakeEvent));
                    Actor.FadeIn();
                    return(true);
                }
                catch (ResetException)
                {
                    throw;
                }
                catch (Exception exception)
                {
                    NiecException.PrintMessage(exception.Message + exception.StackTrace);
                }
                return(false);
            }