Ejemplo n.º 1
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();
 }
Ejemplo n.º 2
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();
     }
 }
Ejemplo n.º 3
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);
            }
        }