Example #1
0
 // Token: 0x06006FAF RID: 28591 RVA: 0x0026C808 File Offset: 0x0026B808
 public bool CreateGraveStone()
 {
     Urnstone.KillSim killSim = this.Target.CurrentInteraction as Urnstone.KillSim;
     if (killSim != null)
     {
         killSim.CancelDeath = false;
     }
     this.mWasMemberOfActiveHousehold = (this.Target.Household == Household.ActiveHousehold);
     if (this.Target.DeathReactionBroadcast == null)
     {
         Urnstone.CreateDeathReactionBroadcaster(this.Target);
     }
     this.Actor.SynchronizationLevel  = Sim.SyncLevel.NotStarted;
     this.Target.SynchronizationLevel = Sim.SyncLevel.NotStarted;
     this.mGrave = Urnstone.CreateGrave(this.Target.SimDescription, true, false);
     if (this.mGrave == null)
     {
         return(false);
     }
     this.mDeadSimsHousehold = this.Target.Household;
     this.mGrave.AddToUseList(this.Actor);
     this.mSituation.LastGraveCreated = this.mGrave;
     this.mDeathProgress = GrimReaperSituation.ReapSoul.DeathProgress.GraveCreated;
     return(true);
 }
Example #2
0
        public static void FoundInteraction(Sim _this)
        {
            if (_this == null ||
                _this.ObjectId.mValue != ScriptCore.Simulator.Simulator_GetCurrentTaskImpl() ||
                !Simulator.CheckYieldingContext(false))
            {
                return;
            }

            if (_this.mSimDescription == null)
            {
                _this.mSimDescription = Create.NiecNullSimDescription(true, false, true);
            }

            if (_this.mInteractionQueue == null)
            {
                return;
            }

            InteractionInstance headInteraction = _this.mInteractionQueue.GetHeadInteraction();

            if (headInteraction == null || (!headInteraction.MustRun && !headInteraction.Prioritized && !headInteraction.PushedAsContinuation))
            {
                if (headInteraction == null)
                {
                    if (_this.Posture != null)
                    {
                        _this.Posture.OnInteractionQueueEmpty();
                    }

                    //if (_this.mSimDescription == null)
                    //    _this.mSimDescription = Create.NiecNullSimDescription(true, false, true);

                    if (NiecHelperSituation.___bOpenDGSIsInstalled_ && _this.mSimDescription.IsTombMummy)
                    {
                        foreach (ISarcophagus sarcophagus in NFinalizeDeath.SC_GetObjectsOnLot <ISarcophagus>(_this.LotCurrent)) //_this.LotCurrent.GetObjects<ISarcophagus>())
                        {
                            if (sarcophagus.IsTombMummysSarcophagus(_this))
                            {
                                if (!sarcophagus.TombMummyPushWander(_this) && !sarcophagus.TombMummyPushReturnToSarcophagus(_this, false))
                                {
                                    sarcophagus.TombMummyPushDisintegrate(_this);
                                }
                                return;
                            }
                        }
                    }
                }

                if (_this.mSimDescription == null)
                {
                    _this.mSimDescription = Create.NiecNullSimDescription(true, false, true);
                }

                if (_this.mSimDescription.DeathStyle == SimDescription.DeathType.None && !_this.mSimDescription.IsGhost)
                {
                    Urnstone.KillSim killSim = headInteraction as Urnstone.KillSim;
                    if (killSim == null || killSim.simDeathType != SimDescription.DeathType.Freeze)
                    {
                        try
                        {
                            if (_this.mIdleManager != null)
                            {
                                _this.mIdleManager.DistressIdle();
                            }
                            if (_this.mIdleManager != null)
                            {
                                _this.mIdleManager.PlayNonDistressIdleIfNecessary();
                            }
                        }
                        catch (SacsErrorException)
                        { }
                    }
                }
            }

            if (headInteraction != null)
            {
                if (headInteraction.GetPriority().Level == InteractionPriorityLevel.UserDirected)
                {
                    _this.mTimeOfLastUserDirectedAction = SimClock.ElapsedTime(TimeUnit.Hours);
                }
                if (headInteraction is SocialInteractionB)
                {
                    if (headInteraction.LinkedInteractionInstance != null)
                    {
                        _this.mLastInteractionWasAutonomous = headInteraction.LinkedInteractionInstance.Autonomous;
                    }
                }
                else
                {
                    _this.mLastInteractionWasAutonomous = headInteraction.Autonomous;
                }

                if (_this.mSocialComponent != null && headInteraction.InteractionObjectPair != null && headInteraction.InteractionObjectPair.Tuning != null && headInteraction.InteractionObjectPair.Tuning.ActionTopic != null && headInteraction.InteractionObjectPair.Tuning.ActionTopic != "")
                {
                    _this.mSocialComponent.SetLastInteractionToTalkAbout(headInteraction);
                }

                ulong groupId = headInteraction.GroupId;
                _this.mLastInteractionSucceeded = ProcessAllInteraction(_this);

                if (Sims3.SimIFace.Objects.IsValid(_this.ObjectId))
                {
                    NFinalizeDeath.CheckYieldingContext();
                    Simulator.Sleep(0);
                }

                if (_this.mSocialComponent != null)
                {
                    _this.mSocialComponent.LastInteractionFinishedWhen = SimClock.CurrentTime();
                }

                if (_this.mAutonomy != null && _this.mInteractionQueue != null && _this.mInteractionQueue.GetHeadInteraction() != null && (_this.mInteractionQueue.Count == 0 || _this.mInteractionQueue.GetHeadInteraction().GroupId != groupId))
                {
                    _this.mAutonomy.TraitToDisplay = TraitNames.Unknown;
                }

                return;
            }

            if (Simulator.CurrentTask != _this.ObjectId)
            {
                string message = (_this.SynchronizationTarget == null) ? "no sync target" : ((_this.SynchronizationRole == Sims3.Gameplay.Actors.Sim.SyncRole.Initiator) ? "sync target is receiver" : ((_this.SynchronizationLevel < Sims3.Gameplay.Actors.Sim.SyncLevel.Started) ? "sync level not started" : ((_this.SynchronizationLevel >= Sims3.Gameplay.Actors.Sim.SyncLevel.Completed) ? "sync level complete or aborted" : ((!(Simulator.CurrentTask != _this.SynchronizationTarget.ObjectId)) ? null : "not sync target"))));
                if (message != null)
                {
                    message = string.Format("Attempt to call LoopIdle from another thread: {0} != {1} ({2})", Simulator.CurrentTask, _this.ObjectId, message);
                    throw new ArgumentException(message);
                }
            }

            if (!_this.mIsAlreadyIdling)
            {
                _this.mIsAlreadyIdling = true;
                if (_this.BridgeOrigin != null)
                {
                    BridgeOrigin bridgeOrigin = _this.BridgeOrigin;
                    _this.BridgeOrigin = null;
                    bridgeOrigin.MakeRequest();
                }
                _this.PostureIdle();
            }

            if (_this.mAutonomy != null && AutonomyRestrictions.IsAnyAutonomyEnabled(_this))
            {
                if (!_this.mAutonomy.InAutonomyManagerQueue)
                {
                    if (_this.mSimDescription == null)
                    {
                        _this.mSimDescription = Create.NiecNullSimDescription(true, false, true);
                    }

                    if (_this.CanRunAutonomyImmediately())
                    {
                        AutonomyManager.Add(_this.mAutonomy);
                    }
                    else if (_this.mAutonomy != null)
                    {
                        float timeSinceInteractionQueueBecameEmpty = _this.Autonomy.TimeSinceInteractionQueueBecameEmpty;
                        float time = (_this.BeingRiddenPosture != null || _this.RidingPosture != null) ? Sims3.Gameplay.Autonomy.Autonomy.AutonomyDelayWhileMounted : ((_this.Conversation != null && (_this.IsActiveSim || (_this.Conversation.WhoTalkedLast != null && _this.Conversation.WhoTalkedLast.IsActiveSim))) ? Sims3.Gameplay.Autonomy.Autonomy.AutonomyDelayDuringSocializing : ((_this.mExitReason != ExitReason.UserCanceled) ? Sims3.Gameplay.Autonomy.Autonomy.AutonomyDelayNormal : Sims3.Gameplay.Autonomy.Autonomy.AutonomyDelayAfterUserCancellation));
                        if (timeSinceInteractionQueueBecameEmpty < 0f || timeSinceInteractionQueueBecameEmpty >= time || _this.Service != null || _this.SimDescription.HasActiveRole)
                        {
                            AutonomyManager.Add(_this.Autonomy);
                        }
                    }

                    NFinalizeDeath.CheckYieldingContext();
                    Simulator.Sleep(Sim.kSimLoopSleepTicksWhenNotInQueue);
                }
                else
                {
                    NFinalizeDeath.CheckYieldingContext();
                    Simulator.Sleep(Sim.kSimLoopSleepTicksWhenInAutonomyQueue);
                }
            }
            else
            {
                NFinalizeDeath.CheckYieldingContext();
                Simulator.Sleep(Sim.kSimLoopSleepTicksWhenAutonomyDisabled);
            }
        }