Esempio n. 1
0
            public override void Cleanup()
            {
                if (runI == null)
                {
                    base.Cleanup();
                }
                else
                {
                    try
                    {
                        if (!_IsOpenDGSInstalled && Actor.SimDescription != null && !Actor.HasBeenDestroyed && Actor.Autonomy == null)
                        {
                            Actor.mAutonomy = new Autonomy.Autonomy((ActorIDNext++).ToString(), Actor);
                        }
                    }
                    catch (ResetException)
                    { throw; }
                    catch { }

                    Simulator.DestroyObject(AutoKillSimTask);
                    AutoKillSimTask = ObjectGuid.InvalidObjectGuid;

                    Simulator.DestroyObject(ATask);
                    ATask = ObjectGuid.InvalidObjectGuid;

                    runI.simDeathType       = base.simDeathType;
                    runI.PlayDeathAnimation = base.PlayDeathAnimation;
                    runI.Cleanup();
                }

                runI = null;
            }
Esempio n. 2
0
 // Token: 0x0600A7E2 RID: 42978 RVA: 0x002FB164 File Offset: 0x002FA164
 public override bool Run()
 {
     try
     {
         ExtKillSimNiec extKillSimNiec = ExtKillSimNiec.Singleton.CreateInstance(Actor, Actor, KillSimNiecX.DGSAndNonDGSPriority(), false, false) as ExtKillSimNiec;
         extKillSimNiec.simDeathType       = this.simDeathType;
         extKillSimNiec.PlayDeathAnimation = this.PlayDeathAnimation;
         extKillSimNiec.MustRun            = true;
         //Actor.InteractionQueue.AddNext(extKillSimNiec);
         return(extKillSimNiec.RunInteraction());
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception)
     {
         return(true);
     }
 }
Esempio n. 3
0
            public override void ConfigureInteraction()
            {
                Sims3.Gameplay.CAS.SimDescription.DeathType deathtyp = base.simDeathType;
                try
                {
                    bool isplayer = Actor.IsSelectable;

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

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

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

                    base.mPriority = KillSimNiecX.DGSAndNonDGSPriority();

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


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

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


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

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

                                Sim CreatedSim = ActorDesc.CreatedSim;

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

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

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

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


                                Urnstone RIPObject;

                                RIPObject = HelperNra.TFindGhostsGrave(ActorDesc);

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

                                NiecHelperSituation.safePosRIPObject(Actior, Actior, RIPObject);

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

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


                                RIPObject = HelperNra.TFindGhostsGrave(ActorDesc);

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

                                NiecHelperSituation.safePosRIPObject(Actior, Actior, RIPObject);

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

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

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