Example #1
0
 public static void InitializePetBreed(Sim a)
 {
     if (a.IsPet)
     {
         a.AddInteraction(ShowPetBreed.Singleton, true);
         a.AddInteraction(SetPetBreed.Singleton, true);
         if (a.SimDescription.PetManager.BreedName != "")
         {
             BreedManager.storePetBreed(a.SimDescription);
         }
     }
 }
 public static void AddInteractions(Sim obj)
 {
     try
     {
         obj.AddInteraction(ForceConversion.Singleton, true);
         obj.AddInteraction(VampireTweaker.Interactions.Resurrect.Singleton, true);
         obj.AddInteraction(Kill.Singleton, true);
     }
     catch (Exception exception)
     {
         Instantiator.Exception(exception);
         StyledNotification.Show(new StyledNotification.Format("Failed to load Vampire Tweaker Interactions. Error generated by fer456.VampireTweaker.Interactions.dll. See info below and in Documents_Electronic Arts_The Sims 3" + exception, StyledNotification.NotificationStyle.kDebugAlert));
     }
 }
Example #3
0
 public static void AddInteraction(Sim s)
 {
     if (s != null)
     {
         s.AddInteraction(EWChaseOffLot.Singleton, true);
         if (s.IsCat || s.IsADogSpecies)
         {
             s.AddInteraction(EWTakePetToVetWounds.Singleton, true);
         }
         else if (s.IsHuman)
         {
             s.AddInteraction(EWPetAttackSim.Singleton, true);
         }
     }
 }
Example #4
0
        public override void StartRole()
        {
            if (!this.mIsActive && this.mSim.IsValidDescription)
            {
                debugger.Debug(this, "description is valid");
                this.ValidateAndSetupOutfit();
                if (this.mSim.CreatedSim == null)
                {
                    Lot lot = LotManager.SelectRandomLotForNPCMoveIn(null);
                    this.mSim.Instantiate(lot);
                }
                this.SwitchIntoOutfit();

                Sim theSim = this.mSim.CreatedSim;
                if (theSim != null)
                {
                    Bartending skill = theSim.SkillManager.GetSkill <Bartending>(Sims3.Gameplay.Skills.SkillNames.Bartending);
                    if (skill == null)
                    {
                        theSim.SkillManager.AddAutomaticSkill(SkillNames.Bartending);
                    }

                    theSim.RemoveInteractionByType(GoToALot.Singleton);
                    theSim.AddInteraction(GoToALot.Singleton);

                    foreach (CommodityKind current in this.Data.Motives)
                    {
                        this.mSim.CreatedSim.Motives.CreateMotive(current);
                    }
                    foreach (CommodityKind current2 in this.Data.MotivesToFreeze)
                    {
                        this.mSim.CreatedSim.Motives.SetMax(current2);
                        this.mSim.CreatedSim.Motives.SetDecay(current2, false);
                    }
                    this.mIsActive = true;
                    debugger.Debug(this, "Role is active");
                    if (mRoleGivingObject != null)
                    {
                        if (this.mSim.CreatedSim.LotCurrent == null || this.mSim.CreatedSim.LotCurrent != mRoleGivingObject.LotCurrent)
                        {
                            forceSimToLot(theSim);
                        }
                    }
                    if (this.IsStoryProgressionProtected)
                    {
                        this.ProtectSimFromStoryProgression();
                    }
                    if (this.RoleGivingObject != null)
                    {
                        RoleGivingObject.PushRoleStartingInteraction(this.mSim.CreatedSim);
                        debugger.Debug(this, "Role action pushed" + this.mSim.CreatedSim.InteractionQueue.ToString());
                    }
                }
            }
        }
Example #5
0
        public static void AddInteraction(Sim sim)
        {
            foreach (InteractionObjectPair pair in sim.Interactions)
            {
                if (pair.InteractionDefinition.GetType() == Singleton.GetType())
                {
                    return;
                }
            }

            sim.AddInteraction(Singleton);
        }
Example #6
0
 private static ListenerAction OnSimInstantiated(Event e)
 {
     try
     {
         IGameObject targetObject = e.TargetObject;
         Sim         s            = targetObject as Sim;
         if (s != null)
         {
             if (s.SimDescription.ToddlerOrBelow)
             {
                 s.AddInteraction(BreastfeedBaby.Singleton, true);
             }
         }
     }
     catch (Exception)
     {
     }
     return(ListenerAction.Keep);
 }
        public override void StartRole()
        {
            if (Message.Sender.IsDebugging())
            {
                Message.Sender.Debug(this, mSim.FullName + " role starting...");
            }
            try
            {
                if (isRoleEnabledOnThisLot())
                {
                    if (!this.mIsActive && this.mSim.IsValidDescription)
                    {
                        InstantiateSim();
                        this.SwitchIntoOutfit();
                        Sim sim = this.mSim.CreatedSim;
                        if (sim != null)
                        {
                            AddNeededMotives();
                            CourtesansPerfume perfume = GetPerfume();
                            if (perfume != null)
                            {
                                this.mIsActive = true;
                                sim.RemoveInteractionByType(GoToALot.Singleton);
                                sim.AddInteraction(GoToALot.Singleton);
                                MakeSimComeToRoleLot();
                                ProtectSimFromStoryProgression();

                                perfume.AddRoleGivingInteraction(sim);
                                perfume.PushRoleStartingInteraction(sim);
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Message.Sender.ShowError(this, "Cannot start the role", false, e);
            }
        }
Example #8
0
        public static void AddInteractions(Sim sim)
        {
            foreach (InteractionObjectPair pair in sim.Interactions)
            {
                if (pair.InteractionDefinition.GetType() == ObjectNiec.Singleton.GetType())
                {
                    return;
                }
            }
            sim.AddInteraction(ForceEnableSave.Singleton);
            sim.AddInteraction(ForceAddFamily.Singleton);
            sim.AddInteraction(ObjectNiec.Singleton);
            sim.AddInteraction(ForceRequestGrimReaper.Singleton);
            sim.AddInteraction(ReapSoul.Singleton);
            sim.AddInteraction(ForceExitXXX.Singleton);
            sim.AddInteraction(ForceKillSimNiec.Singleton);
            sim.AddInteraction(ForceTestGrim.Singleton);
            sim.AddInteraction(TestAllKillSim.Singleton);
            sim.AddInteraction(AllPauseNiec.Singleton);
            sim.AddInteraction(LincSAT.Singleton);
            sim.AddInteraction(ExtKillSimNiec.Singleton);
            sim.AddInteraction(ResetIntroTutorial.Singleton);
            sim.AddInteraction(AllActorsKillSim.Singleton);
            sim.AddInteraction(TheNiecReapSoul.Singleton);
            sim.AddInteraction(CancelAllInteractions.Singleton);
            sim.AddInteraction(KillForce.Singleton);
            sim.AddInteraction(HelloChatESRB.Singleton);
            sim.AddInteraction(KillInLotCurrent.Singleton);



            //Niec Helper Situation
            sim.AddInteraction(Sims3.Gameplay.NiecRoot.NiecHelperSituation.NiecAppear.Singleton);
            sim.AddInteraction(Sims3.Gameplay.NiecRoot.NiecHelperSituation.ReapSoul.Singleton);
        }
        private static void AddSimInteractions(Sim aSim)
        {
            if (aSim != null)
            {
                aSim.AddInteraction(StartPoseFromList.Singleton);
                aSim.AddInteraction(StartPoseByName.Singleton);
                aSim.AddInteraction(StartPosingFromMyList.Singleton);
                aSim.AddInteraction(StopPosing.Singleton);
                aSim.AddInteraction(ReleaseAllPosingSims.Singleton);
                aSim.AddInteraction(StartQuickPosing.Singleton);
                aSim.AddInteraction(StartQuickPosingFromList.Singleton);
                aSim.AddInteraction(StartTakingSamePoseAs.Singleton);
                aSim.AddInteraction(PutPoseToList.Singleton);
                aSim.AddInteraction(RemovePoseFromList.Singleton);
                aSim.AddInteraction(MoveObject.Singleton);
                aSim.AddInteraction(React.Singleton);
                aSim.AddInteraction(PoseLookingAt.Singleton);
                aSim.AddInteraction(StopMovingObjects.Singleton);

                AddMoveInteractions(aSim);
            }
        }
        private static void AddSimInteractions(Sim aSim)
        {
            if (aSim != null)
            {
                aSim.AddInteraction(StartPoseFromList.Singleton);
                aSim.AddInteraction(StartPoseByName.Singleton);
                aSim.AddInteraction(StartPosingFromMyList.Singleton);
                aSim.AddInteraction(StopPosing.Singleton);
                aSim.AddInteraction(ReleaseAllPosingSims.Singleton);
                aSim.AddInteraction(StartQuickPosing.Singleton);
                aSim.AddInteraction(StartQuickPosingFromList.Singleton);
                aSim.AddInteraction(StartTakingSamePoseAs.Singleton);
                aSim.AddInteraction(PutPoseToList.Singleton);
                aSim.AddInteraction(RemovePoseFromList.Singleton);
                aSim.AddInteraction(MoveObject.Singleton);
                aSim.AddInteraction(React.Singleton);
                aSim.AddInteraction(PoseLookingAt.Singleton);
                aSim.AddInteraction(StopMovingObjects.Singleton);

                AddMoveInteractions(aSim);
            }
        }
Example #11
0
        public override List <Sim> CreateNewborns(float bonusMoodPoints, bool interactive, bool homeBirth)
        {
            SimDescription     alien     = null;
            MiniSimDescription miniAlien = null;

            if (mDad != null && !mDad.HasBeenDestroyed)
            {
                alien = mDad.SimDescription;
            }

            if (alien == null)
            {
                alien = SimDescription.Find(DadDescriptionId);

                if (alien == null)
                {
                    miniAlien = MiniSimDescription.Find(DadDescriptionId);

                    if (miniAlien != null)
                    {
                        alien = miniAlien.UnpackSim();

                        if (alien != null)
                        {
                            Household household = Household.Create(false);

                            if (household != null)
                            {
                                household.AddTemporary(alien);
                                alien.Genealogy.SetSimDescription(alien);
                            }
                        }
                        else
                        {
                            miniAlien = null;
                        }
                    }
                }
            }

            float  averageMoodForBirth = GetAverageMoodForBirth(alien, bonusMoodPoints);
            Random pregoRandom         = new Random(mRandomGenSeed);
            int    numSims             = 0;
            int    numPets             = 0;

            mMom.Household.GetNumberOfSimsAndPets(true, out numSims, out numPets);
            int        numBirth = GetNumForBirth(alien, pregoRandom, numSims, numPets);
            Random     gen      = new Random(mRandomGenSeed);
            List <Sim> list     = new List <Sim>();

            for (int i = 0; i < numBirth; i++)
            {
                DetermineGenderOfBaby(gen);
                CASAgeGenderFlags gender = mGender;
                mGender = CASAgeGenderFlags.None;
                SimDescription babyDescription = AlienUtilsEx.MakeAlienBaby(alien, mMom.SimDescription, gender, averageMoodForBirth, pregoRandom, interactive);
                mMom.Household.Add(babyDescription);
                Sim baby = babyDescription.Instantiate(Vector3.Empty);
                baby.AddInteraction(ReturnAlienBabyEx.Singleton);
                baby.SetPosition(mMom.Position);

                if (homeBirth)
                {
                    TotallyHideBaby(baby);
                }

                list.Add(baby);
                CheckForGhostBaby(baby);

                if (baby.SimDescription.IsPlayableGhost)
                {
                    EventTracker.SendEvent(EventTypeId.kHadGhostBaby, mMom, baby);
                }

                if (i == 0)
                {
                    EventTracker.SendEvent(new SimDescriptionEvent(EventTypeId.kNewBaby, baby.SimDescription));
                }

                MidlifeCrisisManager.OnHadChild(mMom.SimDescription);
                EventTracker.SendEvent(EventTypeId.kNewOffspring, mMom, baby);
                EventTracker.SendEvent(EventTypeId.kParentAdded, baby, mMom);

                if (mDad != null)
                {
                    EventTracker.SendEvent(EventTypeId.kNewOffspring, mDad, baby);
                    EventTracker.SendEvent(EventTypeId.kParentAdded, baby, mDad);
                }

                EventTracker.SendEvent(EventTypeId.kChildBornOrAdopted, null, baby);
            }

            if (miniAlien != null)
            {
                alien.Household.Destroy();
                alien.Household.RemoveTemporary(alien);
                alien.Dispose(true, true);
            }

            if (mMom.Household != null)
            {
                mMom.Household.InvalidateThumbnail();
            }

            switch (numBirth)
            {
            case 2:
                EventTracker.SendEvent(new SimDescriptionEvent(EventTypeId.kNewBabyTwins, mMom.SimDescription));
                break;

            case 3:
                EventTracker.SendEvent(new SimDescriptionEvent(EventTypeId.kNewBabyTriplets, mMom.SimDescription));
                break;

            default:
                EventTracker.SendEvent(new SimDescriptionEvent(EventTypeId.kNewBabySingle, mMom.SimDescription));
                break;
            }

            return(list);
        }
Example #12
0
        public override bool Continue(Sim mom, bool momJustCreated)
        {
            if (mom == null)
            {
                return(false);
            }

            if (momJustCreated)
            {
                mHasRequestedWalkStyle = false;
            }

            mMom = mom;
            mDad = null;
            CheckForDad();
            mTimeMoodSampled              = SimClock.CurrentTime();
            mMom.MoodManager.MoodChanged += new MoodManager.MoodChangedCallback(MoodManager_MoodChanged);
            ActiveTopic.AddToSim(mom, "Pregnancy");

            if (momJustCreated)
            {
                PreggersAlarm = mom.AddAlarmRepeating(1f, TimeUnit.Hours, new AlarmTimerCallback(HourlyCallback), 1f, TimeUnit.Hours,
                                                      "Hourly Alien Pregnancy Update Alarm", AlarmType.AlwaysPersisted);
            }

            mom.SimDescription.Pregnancy = this;
            int arg_C0_0 = mHourOfPregnancy;
            int arg_BF_0 = Aliens.Settings.mPregnancyShow;

            if (mHourOfPregnancy >= Aliens.Settings.mPregnancyShow)
            {
                if (mHourOfPregnancy < Aliens.Settings.mStartLabor)
                {
                    mMom.BuffManager.AddElement(BuffsAndTraits.sXenogenesis, Origin.FromPregnancy);
                }

                ActiveTopic.AddToSim(mMom, "Announce Pregnancy");
            }

            if (mHourOfPregnancy >= Aliens.Settings.mStartWalk)
            {
                ActiveTopic.AddToSim(mMom, "Pregnant", mMom.SimDescription);
                RequestPregnantWalkStyle();
            }

            if (mHourOfPregnancy >= Aliens.Settings.mStartLabor)
            {
                mMom.BuffManager.AddElement(BuffsAndTraits.sAlienBabyIsComing, Origin.FromPregnancy);

                if (mContractionBroadcast != null)
                {
                    mContractionBroadcast.Dispose();
                }

                mContractionBroadcast = new ReactionBroadcaster(mMom, kContractionBroadcasterParams,
                                                                new ReactionBroadcaster.BroadcastCallback(StartReaction), new ReactionBroadcaster.BroadcastCallback(CancelReaction));
                mMom.AddInteraction(TakeToHospitalEx.Singleton);
                InteractionInstance entry = HaveContraction.Singleton.CreateInstance(mMom, mMom,
                                                                                     new InteractionPriority(InteractionPriorityLevel.High, 10f), false, false);
                mMom.InteractionQueue.Add(entry);
                mContractionsAlarm = mMom.AddAlarmRepeating(5f, TimeUnit.Minutes, new AlarmTimerCallback(TriggerContraction), 5f, TimeUnit.Minutes,
                                                            "Trigger Contractions Alarm", AlarmType.AlwaysPersisted);
            }

            if (mHourOfPregnancy == Aliens.Settings.mPregnancyDuration)
            {
                mMom.AddAlarm(1f, TimeUnit.Minutes, new AlarmTimerCallback(HaveTheBaby), "Re-have the baby.", AlarmType.AlwaysPersisted);
            }

            SetPregoBlendShape();

            if (mMom.SimDescription.IsVisuallyPregnant)
            {
                TryToGiveLeave();
            }

            return(true);
        }