Пример #1
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);
        }
Пример #2
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);
     }
 }
Пример #3
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();
 }
Пример #4
0
        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);
        }
Пример #5
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);
            }
        }
Пример #6
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);
            }
        }
Пример #7
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);
            }
        }
Пример #8
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);
        }
Пример #9
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);
            }
Пример #10
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();
     }
 }
Пример #11
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);
            }
        }