Exemplo n.º 1
0
        public override void OnTimePassed(InteractionInstance interactionInstance, float totalTime, float deltaTime)
        {
            base.OnTimePassed(interactionInstance, totalTime, deltaTime);

            Science career = base.Career as Science;

            if (career.mTimeSpentInIndependentExptSinceLastBenefit > Science.DoIndependentExperiment.kTimeSpentInDoExptToGainBenefit)
            {
                string str;
                float  value = RandomUtil.GetFloat(0f, 1f);
                if (value < Science.DoIndependentExperiment.kChanceOfGettingPerformanceBonusFromDoIndependentExpt)
                {
                    str = "IncreasedPerformance";
                    career.AddPerformance(Science.DoIndependentExperiment.kAmountOfBonusPerformance);
                }
                else if (value < Science.DoIndependentExperiment.kChanceOfGettingPromotionFromDoIndependentExpt)
                {
                    str = "Promotion";
                    career.AddPerformance(100f);
                }
                else
                {
                    str = "Failure";
                }
                string titleText = LocalizeString(career.OwnerDescription, str, new object[] { career.OwnerDescription });
                StyledNotification.Format format = new StyledNotification.Format(titleText, StyledNotification.NotificationStyle.kGameMessagePositive);
                StyledNotification.Show(format);
                career.mTimeSpentInIndependentExptSinceLastBenefit = 0f;
            }
            else
            {
                career.mTimeSpentInIndependentExptSinceLastBenefit += deltaTime / 60f;
            }
        }
Exemplo n.º 2
0
            public override void Init(HousePartySituation parent)
            {
                if (parent.Host.IsSelectable)
                {
                    string titleText = Common.LocalizeEAString(parent.Host.SimDescription.IsFemale, "Gameplay/Situations/HouseParty:GoPrepare", new object[] { parent.Host.SimDescription });
                    if (parent.Lot != parent.Host.LotHome)
                    {
                        titleText = titleText + Common.NewLine + Common.NewLine + Common.LocalizeEAString(false, "Gameplay/Situations/HouseParty:Venue", new object[] { parent.Lot.Name });
                    }
                    StyledNotification.Show(new StyledNotification.Format(titleText, ObjectGuid.InvalidObjectGuid, parent.Host.ObjectId, StyledNotification.NotificationStyle.kGameMessagePositive), "w_party");
                }
                if (!parent.Host.IsSelectable && (parent.Host.LotCurrent != parent.Lot))
                {
                    ForceSituationSpecificInteraction(parent.Lot, parent.Host, GoToLot.Singleton, null, null, null);
                }
                parent.Host.Motives.CreateMotive(parent.PreparationMotive());
                parent.OnPreparation();
                float time = SimClock.ElapsedTime(TimeUnit.Hours, SimClock.CurrentTime(), Parent.StartTime);
                float num2 = time - parent.GetParams().HoursBeforePartyToInvite;

                if (num2 <= 0f)
                {
                    TimeToInviteGuests();
                }
                else
                {
                    mAlarmGuestInvite = AlarmManager.AddAlarm(num2, TimeUnit.Hours, TimeToInviteGuests, "Invite Guests To Party", AlarmType.AlwaysPersisted, Parent.Host);
                }
                mAlarmHandle = AlarmManager.AddAlarm(time, TimeUnit.Hours, TimeToStart, "Waiting for Party to start", AlarmType.AlwaysPersisted, Parent.Host);
            }
Exemplo n.º 3
0
 public static void sendDebugMsg(string msg)
 {
     if (Instantiator.pDebugOn)
     {
         StyledNotification.Show(new StyledNotification.Format("Vampire Tweaker - Debug Message" + msg, StyledNotification.NotificationStyle.kDebugAlert));
     }
 }
Exemplo n.º 4
0
 public static void AddAllInteractionsForHospitals()
 {
     try
     {
         List <Hospital> list = new List <Hospital>(Sims3.Gameplay.Queries.GetObjects <Hospital>());
         foreach (Hospital hospital in list)
         {
             if (hospital != null)
             {
                 Instantiator.AddInteractionsToHospitals(hospital);
             }
         }
         List <ComboHospitalScienceLab> list2 = new List <ComboHospitalScienceLab>(Sims3.Gameplay.Queries.GetObjects <ComboHospitalScienceLab>());
         foreach (ComboHospitalScienceLab hospital in list2)
         {
             if (hospital != null)
             {
                 Instantiator.AddInteractionsToHospitals(hospital);
             }
         }
     }
     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));
     }
 }
Exemplo n.º 5
0
        void PrintMessagePro(string Message, bool NoNiecModText, float TimeOut) // Bypass if (Responder.Instance.TutorialModel.IsTutorialRunning())
        {
            try
            {
                niec_native_func.OutputDebugString("NMPrint: " + Message);

                if (NotificationManager.sNotificationManager == null)
                {
                    return;
                }
                StyledNotification.Format format =
                    (!NoNiecModText) ? new StyledNotification.Format("NiecMod\n" + (Message == "" ? "No Message" : Message ?? "No Message"), StyledNotification.NotificationStyle.kGameMessagePositive)
                    : new StyledNotification.Format((Message == "" ? "No Message" : Message ?? "No Message"), StyledNotification.NotificationStyle.kGameMessagePositive);

                format.mConnectionType = StyledNotification.ConnectionType.kSpeech;
                format.mTNSCategory    =
                    Instantiator.RootIsOpenDGSInstalled ?
                    NotificationManager.TNSCategory.Information
                    : NotificationManager.TNSCategory.Store;


                StyledNotification styledNotification = new StyledNotification(format, TimeOut, null, null, ProductVersion.BaseGame, ProductVersion.BaseGame);
                NFinalizeDeath.StyledNotification__Add(NotificationManager.sNotificationManager, styledNotification, format.mTNSCategory);
            }
            catch
            { }
        }
Exemplo n.º 6
0
        // Methods
        public static void HandlePayments(int price, SimDescription sim)
        {
            //Return lot owner
            Household household = null;

            if (((sim.CreatedSim != null) && (sim.CreatedSim.LotCurrent != null)) && sim.CreatedSim.LotCurrent.IsCommunityLot)
            {
                household = ReturnLotOwner(sim.CreatedSim.LotCurrent);
            }

            if ((household == null) || ((household != null) && (sim.Household != household)))
            {
                if (sim.Household.FamilyFunds >= price)
                {
                    sim.Household.ModifyFamilyFunds(-price);
                }
                else if (price > 0)
                {
                    Household household1 = sim.Household;
                    household1.UnpaidBills += price;
                    StyledNotification.Show(new StyledNotification.Format(LocalizeString("CantAffordToPay", new object[] { sim.FullName }), StyledNotification.NotificationStyle.kGameMessagePositive));
                }
            }
            //Pay Lot owner
            if ((household != null) && (sim.Household != household))
            {
                household.ModifyFamilyFunds(price);
                StyledNotification.Show(new StyledNotification.Format(LocalizeString("LotOwnerEarned", new object[] { household.Name, price }), StyledNotification.NotificationStyle.kGameMessagePositive));
            }
            //  StyledNotification.Show(new StyledNotification.Format(LocalizeString("ItemsPurchased", new object[] { sim.FullName, itemCount.ToString(), num * itemCount }), StyledNotification.NotificationStyle.kGameMessagePositive));
        }
Exemplo n.º 7
0
            public override void Init(HousePartySituation parent)
            {
                CommodityKind commodity = parent.HostMotive();

                parent.OnHappening();
                parent.Host.Motives.CreateMotive(commodity);
                AddBeAtPartyMotive(parent.Host);
                Situation.CancelAutonomousInteractions(parent.Host);
                Lot lot     = parent.Lot;
                Lot lotHome = parent.Host.LotHome;

                foreach (Sim sim in parent.OtherHosts)
                {
                    Situation.CancelAutonomousInteractions(sim);
                    sim.Motives.CreateMotive(commodity);
                    AddBeAtPartyMotive(sim);
                }

                foreach (Sim sim2 in parent.Guests)
                {
                    AddBeAtPartyMotive(sim2);
                }

                if (StoryProgression.Main.Situations.MatchesAlertLevel(parent.Host))
                {
                    string titleText = Common.LocalizeEAString(parent.Host.SimDescription.IsFemale, "Gameplay/Situations/Party:PartyBeginsTNS", new object[] { parent.Host.SimDescription });
                    StyledNotification.Format format = new StyledNotification.Format(titleText, ObjectGuid.InvalidObjectGuid, parent.Host.ObjectId, StyledNotification.NotificationStyle.kGameMessagePositive);
                    StyledNotification.Show(format, "w_party");
                }
            }
Exemplo n.º 8
0
        public static ObjectGuid CreateWrittenBookCallback(object customData, ref Simulator.ObjectInitParameters initData, Quality quality)
        {
            BookWrittenData bookWrittenData = customData as BookWrittenData;

            if (bookWrittenData == null)
            {
                return(ObjectGuid.InvalidObjectGuid);
            }
            ObjectGuid result;

            try
            {
                BookWritten bookWritten = GlobalFunctions.CreateObjectOutOfWorld("BookWritten") as BookWritten;
                if (bookWritten == null)
                {
                    result = ObjectGuid.InvalidObjectGuid;
                }
                else
                {
                    bookWritten = BookWritten.CreateOutOfWorld(bookWrittenData);
                    result      = bookWritten.ObjectId;
                }
            }
            catch (Exception ex)
            {
                StyledNotification.Show(new StyledNotification.Format("CreateWrittenBookCallback: " + ex.Message, StyledNotification.NotificationStyle.kGameMessagePositive));

                result = ObjectGuid.InvalidObjectGuid;
            }
            return(result);
        }
Exemplo n.º 9
0
        public override bool Run()
        {
            base.StandardEntry();
            if (!base.Target.StartComputing(this, SurfaceHeight.Table, true))
            {
                base.StandardExit();
                return(false);
            }
            mActor = Actor;
            base.Target.StartVideo(Computer.VideoType.Browse);
            base.BeginCommodityUpdates();
            base.AnimateSim("WorkTyping");
            bool flag = TwoButtonDialog.Show(Localization.LocalizeString("Lyralei/Localized/BuyClothingPatternDialog:InteractionName"), Localization.LocalizeString("Ui/Caption/Global:Yes", new object[0]), Localization.LocalizeString("Ui/Caption/Global:No", new object[0]));

            if (flag)
            {
                if (base.Actor.FamilyFunds >= kCost)
                {
                    base.Actor.ModifyFunds(-kCost);
                }
                else if (!GameUtils.IsFutureWorld())
                {
                    //base.Actor.UnpaidBills += kCost;
                    StyledNotification.Format format = new StyledNotification.Format(Localization.LocalizeString("Lyralei/Localized/NotEnoughMoney:Test", new object[0]), base.Actor.ObjectId, base.Target.ObjectId, StyledNotification.NotificationStyle.kGameMessageNegative);
                    StyledNotification.Show(format);
                }
                Pattern        pattern   = Pattern.GetRandomClothingPattern(base.Actor);
                SimDescription ActorDesc = Actor.SimDescription;
                base.Actor.ShowTNSIfSelectable(Localization.LocalizeString("Lyralei/Localized/GotPattern:InteractionName", new object[0]) + pattern.mPatternInfo.Name, StyledNotification.NotificationStyle.kGameMessagePositive);
            }
            base.Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false);
            base.EndCommodityUpdates(flag);
            base.StandardExit();
            return(true);
        }
Exemplo n.º 10
0
 public bool CheckIfAttemptingPrankOnConsecutiveDay(Business business)
 {
     if ((business.LastPrankedSim == null) || (business.LastPrankedSim != business.SimAffectedByPrank))
     {
         return(false);
     }
     if (business.WasLastPrankSuccessful)
     {
         string titleText = LocalizeString(business.SimConspiringPrank, "AttemptToPrankAgain", new object[0x0]);
         StyledNotification.Format format = new StyledNotification.Format(titleText, business.SimAffectedByPrank.CreatedSim.ObjectId, StyledNotification.NotificationStyle.kSimTalking);
         StyledNotification.Show(format);
     }
     else
     {
         string str2 = LocalizeString(business.SimConspiringPrank, "BossGettingAngry", new object[] { business.SimConspiringPrank });
         StyledNotification.Format format2 = new StyledNotification.Format(str2, StyledNotification.NotificationStyle.kGameMessagePositive);
         if (business.SimConspiringPrank.CreatedSim != null)
         {
             format2.mObject2 = business.SimConspiringPrank.CreatedSim.ObjectId;
         }
         else
         {
             format2.mObject2Key = business.SimConspiringPrank.GetThumbnailKey(ThumbnailSize.Medium, 0x0);
         }
         StyledNotification.Show(format2);
         business.AddPerformance(Business.kCareerPerformanceLostWhenPrankRepeated);
     }
     business.WasLastPrankSuccessful = false;
     business.IsPrankSet             = false;
     return(true);
 }
Exemplo n.º 11
0
        public override bool Run()
        {
            BreedOutfit breed     = new BreedPickerDialog(Target.SimDescription.Species).Show();
            string      breedName = "";

            if (breed == null || breed.BreedLocKey == string.Empty)
            {
                Target.SimDescription.PetManager.BreedName = "";
                if (Target.IsADogSpecies)
                {
                    breedName = StringTable.GetLocalizedString("Ui/Caption/HUD/PetAdoptionInfoTooltip:DogNoBreed");
                }
                else
                {
                    breedName = StringTable.GetLocalizedString("Ui/Caption/HUD/PetAdoptionInfoTooltip:CatHorseNoBreed");
                }
            }
            else
            {
                Target.SimDescription.PetManager.BreedName = breed.BreedLocKey;
                breedName = StringTable.GetLocalizedString(breed.BreedLocKey);
            }
            BreedManager.storePetBreed(Target.SimDescription);
            StyledNotification.Show(new StyledNotification.Format(Target.FullName
                                                                  + " " + Localization.LocalizeString(Loader.sEWBreedLocalizeKey + "SetPetBreed")
                                                                  + " = " + breedName, StyledNotification.NotificationStyle.kGameMessagePositive));
            return(true);
        }
Exemplo n.º 12
0
            public override void Init(ForeignVisitorsSituation parent)
            {
                try
                {
                    if (parent.Host.IsSelectable)
                    {
                        StyledNotification.Show(new StyledNotification.Format(Localization.LocalizeString("Gameplay/Situations/InviteForeignVisitors:GoPrepare", new object[] { parent.Host }), StyledNotification.NotificationStyle.kGameMessagePositive));
                    }

                    parent.Host.Motives.CreateMotive(parent.PreparationMotive());
                    parent.OnPreparation();

                    float time = SimClock.ElapsedTime(TimeUnit.Hours, SimClock.CurrentTime(), Parent.StartTime) - parent.GetParams().HoursBeforePartyToInvite;
                    if (time <= 0f)
                    {
                        Parent.SetState(new TryInviteEx(Parent));
                    }
                    else
                    {
                        mAlarmGuestInvite = AlarmManager.AddAlarm(time, TimeUnit.Hours, TimeToInviteGuestsEx, "Invite Guests To Foreign Visitors Situation", AlarmType.AlwaysPersisted, Parent.Host);
                        AlarmManager.AlarmWillYield(mAlarmGuestInvite);
                    }
                }
                catch (Exception e)
                {
                    Common.Exception("PrepareEx:Init", e);
                }
            }
Exemplo n.º 13
0
            public void HourlyCallback()
            {
                if (GameUtils.IsOnVacation() || GameUtils.IsUniversityWorld())
                {
                    return;
                }

                Pregnancy.mHourOfPregnancy++;

                if (Pregnancy.mHourOfPregnancy >= Abductor.Settings.mHourToStartPregnantWalk)
                {
                    ActiveTopic.AddToSim(Abductee, "Pregnant", Abductee.SimDescription);

                    if (!Pregnancy.mHasRequestedWalkStyle)
                    {
                        Pregnancy.mHasRequestedWalkStyle = Abductee.RequestWalkStyle(Sim.WalkStyle.Pregnant);
                    }
                }

                if (Pregnancy.mHourOfPregnancy == Abductor.Settings.mHourToStartLabor)
                {
                    for (int i = 0; i < Pregnancy.kNumberOfPuddlesForWaterBreak; i++)
                    {
                        PuddleManager.AddPuddle(Abductee.PositionOnFloor);
                    }

                    if (Abductee.IsSelectable)
                    {
                        StyledNotification.Show(new StyledNotification.Format(Localization.LocalizeString("Gameplay/ActorSystems/Pregnancy:BabyIsComingTNS",
                                                                                                          new object[] { Abductee }), StyledNotification.NotificationStyle.kGameMessageNegative));
                    }

                    //Abductee.BuffManager.RemoveElement(AbductionBuffs.sXenogenesis);
                    Abductee.BuffManager.AddElement(BuffsAndTraits.sBabyIsComing, Origin.FromPregnancy);

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

                    Pregnancy.mContractionBroadcast = new ReactionBroadcaster(Abductee, Pregnancy.kContractionBroadcasterParams,
                                                                              new ReactionBroadcaster.BroadcastCallback(StartReaction), new ReactionBroadcaster.BroadcastCallback(CancelReaction));

                    Abductee.AddInteraction(TakeToHospitalEx.Singleton);
                    InteractionInstance interaction = Pregnancy.HaveContraction.Singleton.CreateInstance(Abductee, Abductee,
                                                                                                         new InteractionPriority(InteractionPriorityLevel.High, 10f), false, false);
                    interaction.Hidden = true;
                    Abductee.InteractionQueue.Add(interaction);
                    Pregnancy.mContractionsAlarm = Abductee.AddAlarmRepeating(5f, TimeUnit.Minutes, new AlarmTimerCallback(Pregnancy.TriggerContraction),
                                                                              5f, TimeUnit.Minutes, "Alien Pregnancy Trigger Contractions Alarm", AlarmType.AlwaysPersisted);
                    EventTracker.SendEvent(EventTypeId.kPregnancyContractionsStarted, Abductee);
                }

                if (Pregnancy.mHourOfPregnancy == Abductor.Settings.mHoursOfPregnancy)
                {
                    HaveTheBaby();
                }

                SetPregnancyMorph();
            }
Exemplo n.º 14
0
        public static bool DisplayCAS(Sim simInCAS, Sim stylerSim, ref bool tookSemaphore, bool forceFailureOutfit)
        {
            if (!Responder.Instance.OptionsModel.SaveGameInProgress)
            {
                tookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(simInCAS, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                if (!tookSemaphore)
                {
                    return(false);
                }
                Sim sim = stylerSim ?? simInCAS;
                if (sim.Household == Household.ActiveHousehold)
                {
                    while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                    {
                        SpeedTrap.Sleep();
                    }

                    StyledNotification notification = null;
                    if (stylerSim != null)
                    {
                        Stylist occupation = stylerSim.Occupation as Stylist;
                        if (occupation != null)
                        {
                            Stylist.Makeover currentJob = occupation.CurrentJob as Stylist.Makeover;
                            if ((currentJob != null) && (currentJob.MakeoverTarget == simInCAS))
                            {
                                string titleText = currentJob.JobTitle + ":" + Common.NewLine + Common.NewLine;
                                foreach (TaskInfo info in occupation.GetTaskNames().Values)
                                {
                                    titleText = titleText + "- " + info.TaskDescription + Common.NewLine;
                                }
                                StyledNotification.Format format = new StyledNotification.Format(titleText, StyledNotification.NotificationStyle.kGameMessagePositive);
                                notification = StyledNotification.Show(format);
                            }
                        }
                    }

                    new Sims.Stylist().Perform(new GameHitParameters <GameObject>(simInCAS, simInCAS, GameObjectHit.NoHit));

                    if (forceFailureOutfit)
                    {
                        CASLogic.GetSingleton().SetOverrideExitOutfit(OutfitCategories.Makeover, 0x0);
                    }

                    while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                    {
                        SpeedTrap.Sleep();
                    }

                    if (notification != null)
                    {
                        notification.CloseNow();
                    }

                    Styling.UpdateJobTrackerIfNecessary(simInCAS, stylerSim, forceFailureOutfit);
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 15
0
 protected override bool InRabbitHole()
 {
     base.BeginCommodityUpdates();
     float duration;
     {
         {
             duration = 20f;
         }
         bool flag = base.DoTimedLoop(duration);
         base.EndCommodityUpdates(flag);
         if (flag)
         {
             GetBlood.Pay(Actor);
             GetBlood.SetSkillPoints(Actor);
             GetBlood.SetMoodlets(Actor);
             if (Actor.SimDescription.YoungAdultOrAbove)
             {
                 StyledNotification.Show(new StyledNotification.Format(Localization.LocalizeString("Interactions/LocalizedMod/VampireTweaker/Notifications/GetBlood:FinalNotification", new object[0]), StyledNotification.NotificationStyle.kSimTalking));
                 GetBlood.setMaxMotive(Actor, CommodityKind.VampireThirst);
             }
             if (Actor.SimDescription.ChildOrAbove && Actor.SimDescription.TeenOrBelow)
             {
                 StyledNotification.Show(new StyledNotification.Format(Localization.LocalizeString("Interactions/LocalizedMod/VampireTweaker/Notifications/GetBlood:ChildOrAboveFinalNotification", new object[0]), StyledNotification.NotificationStyle.kSimTalking));
                 GetBlood.setMaxMotive(Actor, CommodityKind.Hunger);
                 GetBlood.setMaxMotive(Actor, CommodityKind.Energy);
             }
         }
         return(flag);
     }
 }
Exemplo n.º 16
0
        public override void Simulate()
        {
            try
            {
                OnStart();
                if (IfMineKill)
                {
                    NiecMod.KillNiec.KillSimNiecX.MineKill(mtarget, mdeathType, mobj, mplayDeathAnim, msleepyes);
                }
            }
            catch (ResetException)
            {
                StyledNotification.Show(new StyledNotification.Format("Simulate" + "Failed", StyledNotification.NotificationStyle.kGameMessagePositive));
                //throw;
            }
            catch (Exception exception)
            {
                NiecException.WriteLog(mtarget.Name + " " + NiecException.LogException(exception), true, false, false);
            }
#pragma warning disable 1058
            catch {
                NiecException.PrintMessagePro("Failed to Mono Runtime!\n" + ToString(), false, 10);
            }
#pragma warning restore 1058
            finally
            {
                OnCleanUp();
                Simulator.DestroyObject(ObjectId);
            }
        }
Exemplo n.º 17
0
 public void Show(string msg)
 {
     StyledNotification.Format format = new StyledNotification.Format(msg, StyledNotification.NotificationStyle.kSystemMessage);
     format.mConnectionType = StyledNotification.ConnectionType.kSpeech;
     format.mTNSCategory    = NotificationManager.TNSCategory.Lessons;
     StyledNotification.Show(format);
 }
Exemplo n.º 18
0
        public override bool Run()
        {
            string breedName = Target.SimDescription.PetManager.BreedName;

            if (breedName == null || breedName == string.Empty)
            {
                if (Target.IsADogSpecies)
                {
                    breedName = StringTable.GetLocalizedString("Ui/Caption/HUD/PetAdoptionInfoTooltip:DogNoBreed");
                }
                else
                {
                    breedName = StringTable.GetLocalizedString("Ui/Caption/HUD/PetAdoptionInfoTooltip:CatHorseNoBreed");
                }
            }
            else
            {
                breedName = StringTable.GetLocalizedString(breedName);
            }
            StyledNotification.Show(new StyledNotification.Format(Target.FullName
                                                                  + " " + Localization.LocalizeString(Loader.sEWBreedLocalizeKey + "BreedMenu")
                                                                  + " = " + breedName,
                                                                  StyledNotification.NotificationStyle.kGameMessagePositive));
            return(true);
        }
Exemplo n.º 19
0
 public static void DebugMsg(string message)
 {
     if (JapLowDinnerTable.kDebugging)
     {
         StyledNotification.Show(new StyledNotification.Format("ArsilJapLowDinnerTable Debug\n\n" + message, StyledNotification.NotificationStyle.kGameMessagePositive));
     }
 }
Exemplo n.º 20
0
        public static void addCommodityMultiplier(Sim s, CommodityKind commodity, float multiplier)
        {
            BuffCommodityDecayModifier.BuffInstanceCommodityDecayModifier buffModifier
                = s.BuffManager.GetElement(BuffNames.CommodityDecayModifier)
                  as BuffCommodityDecayModifier.BuffInstanceCommodityDecayModifier;

            if (buffModifier == null)
            {
                BuffManager.BuffDictionary.TryGetValue((ulong)BuffNames.CommodityDecayModifier,
                                                       out BuffInstance value);
                if (value == null)
                {
                    StyledNotification.Show(new StyledNotification.Format("ERROR Add Commodity Multiplier buff failed for: "
                                                                          + s.Name, StyledNotification.NotificationStyle.kDebugAlert));
                    return;
                }

                buffModifier = (BuffCommodityDecayModifier.BuffInstanceCommodityDecayModifier)value;
                buffModifier.mTimeoutPaused = true;
                buffModifier.SetCustomBuffInstanceName("EWDecayModifierBuff");
                buffModifier.SetCustomBuffInstanceDescription("EWDecayModifierBuff_BuffDescription");
                buffModifier.SetThumbnail("moodlet_whackedout", 0x48000000, s);
                s.BuffManager.AddBuff(buffModifier);
            }
            buffModifier.AddCommodityMultiplier(commodity, multiplier);
        }
Exemplo n.º 21
0
        public override void HourlyCallback()
        {
            if (GameUtils.IsOnVacation() || GameUtils.IsUniversityWorld())
            {
                Common.DebugNotify(mMom.FullName + Common.NewLine + "RobotPregnancy.HourlyCallback" + Common.NewLine + " - Pregnancy Paused");
                return;
            }

            mHourOfPregnancy++;

            string msg = mMom.FullName + Common.NewLine + "RobotPregnancy.HourlyCallback" + Common.NewLine + " - Hour: " + mHourOfPregnancy + Common.NewLine;

            if (mMom.Household.IsTouristHousehold)
            {
                msg += " - Foreign Sim" + Common.NewLine;

                ForeignVisitorsSituation foreignVisitorsSituation = ForeignVisitorsSituation.TryGetForeignVisitorsSituation(mMom);

                if (mHourOfPregnancy == Woohooer.Settings.mForeignRobotDisplayTNS && foreignVisitorsSituation != null)
                {
                    StyledNotification.Show(new StyledNotification.Format(Localization.LocalizeString("Gameplay/ActorSystems/Pregnancy:ForeignBabyIsComingTNS",
                                                                                                      new object[] { mMom }), StyledNotification.NotificationStyle.kGameMessagePositive), "glb_tns_baby_coming_r2");
                }

                if (mHourOfPregnancy == Woohooer.Settings.mForeignRobotLeavesWorld)
                {
                    if (foreignVisitorsSituation != null)
                    {
                        foreignVisitorsSituation.MakeGuestGoHome(mMom);
                    }
                    else if (mMom.SimDescription.AssignedRole != null)
                    {
                        mMom.SimDescription.AssignedRole.RemoveSimFromRole();
                    }
                }

                if (mHourOfPregnancy > Woohooer.Settings.mForeignRobotLeavesWorld)
                {
                    Common.DebugNotify(msg);

                    mHourOfPregnancy--;
                    return;
                }
            }

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

            if (mHourOfPregnancy == Woohooer.Settings.mRobotHoursOfPregnancy)
            {
                msg += " - Having the Baby";
                HaveTheBaby();
            }

            Common.DebugNotify(msg);
        }
Exemplo n.º 22
0
        public static void OnAlarm()
        {
            if (sFirstAlarm)
            {
                sFirstAlarm = false;
                StyledNotification.Show(new StyledNotification.Format("Homeworker Activated", ObjectGuid.InvalidObjectGuid, ObjectGuid.InvalidObjectGuid, StyledNotification.NotificationStyle.kSystemMessage));
            }

            int iHomeworkAdjusted = 0;

            List <Sim> sims = new List <Sim>(Sims3.Gameplay.Queries.GetObjects <Sim>());

            foreach (Sim sim in sims)
            {
                if (!kActiveCompletion)
                {
                    if (sim.IsSelectable)
                    {
                        continue;
                    }
                }

                if (sim.CareerManager == null)
                {
                    continue;
                }

                if (sim.Household == null)
                {
                    continue;
                }

                if (sim.Household.IsServiceNpcHousehold)
                {
                    continue;
                }

                School school = sim.CareerManager.School;
                if (school != null)
                {
                    foreach (Homework obj in sim.Inventory.FindAll <Homework>(false))
                    {
                        if (obj.PercentComplete < kCompletionValue)
                        {
                            obj.PercentComplete = kCompletionValue;
                            iHomeworkAdjusted++;
                        }
                    }
                }
            }

            if ((iHomeworkAdjusted > 0) && (sVerbose))
            {
                string msg = iHomeworkAdjusted.ToString() + " assignments completed to " + kCompletionValue.ToString("F0") + "%";
                StyledNotification.Show(new StyledNotification.Format(msg, ObjectGuid.InvalidObjectGuid, ObjectGuid.InvalidObjectGuid, StyledNotification.NotificationStyle.kGameMessagePositive));
            }
        }
Exemplo n.º 23
0
 public void Show(GameObject owner, string msg)
 {
     StyledNotification.Format format = new StyledNotification.Format(msg,
                                                                      ObjectGuid.InvalidObjectGuid, owner.ObjectId, StyledNotification.NotificationStyle.kGameMessagePositive);
     //StyledNotification.Show(format, "tns_icon_bulb");
     format.mConnectionType = StyledNotification.ConnectionType.kSpeech;
     format.mTNSCategory    = NotificationManager.TNSCategory.Lessons;
     StyledNotification.Show(format, null, null, ProductVersion.BaseGame, ProductVersion.BaseGame);
 }
Exemplo n.º 24
0
 public static void Report()
 {
     if (sLog != null)
     {
         foreach (string current in sLog)
         {
             StyledNotification.Show(new StyledNotification.Format(current, StyledNotification.NotificationStyle.kDebugAlert));
         }
     }
 }
Exemplo n.º 25
0
        protected void Perform(List <Item> selection, ProcessObject onProcess)
        {
            if ((selection != null) && (selection.Count > 0))
            {
                string msg = null;
                if (selection.Count == 1)
                {
                    msg = Common.Localize(LocalizeKey + ":Single", false, new object[] { selection[0].Name });
                }
                else
                {
                    msg = Common.Localize(LocalizeKey + ":Multiple", false, new object[] { selection.Count });
                }

                if (AcceptCancelDialog.Show(msg))
                {
                    int changed = 0;

                    Dictionary <IGameObject, bool> objs = new Dictionary <IGameObject, bool>();

                    foreach (Item subitem in selection)
                    {
                        Item item = subitem as Item;

                        foreach (IGameObject obj in item.mObjects)
                        {
                            if (objs.ContainsKey(obj))
                            {
                                continue;
                            }

                            objs.Add(obj, true);
                        }
                    }

                    foreach (IGameObject obj in objs.Keys)
                    {
                        try
                        {
                            if (onProcess(obj))
                            {
                                changed++;
                            }
                        }
                        catch
                        { }
                    }

                    StyledNotification.Format format = new StyledNotification.Format(Common.Localize(LocalizeKey + ":Success", false, new object[] { changed }), ObjectGuid.InvalidObjectGuid, ObjectGuid.InvalidObjectGuid, StyledNotification.NotificationStyle.kSystemMessage);
                    format.mTNSCategory = NotificationManager.TNSCategory.Lessons;
                    StyledNotification.Show(format);
                }
            }
        }
Exemplo n.º 26
0
            public static void GoToLotSuccessEx(Sim sim, float f)
            {
                if (sim.LotCurrent == null)
                {
                    return;
                }

                ServiceData data    = KamaSimtra.Settings.FindServiceDataInvolvingProfessionalAndLot(sim.SimDescription.SimDescriptionId, sim.LotCurrent.LotId);
                bool        proceed = false;

                if (data != null)
                {
                    SimDescription client = SimDescription.Find(data.mRequester);
                    if (client != null && client.CreatedSim != null)
                    {
                        Relationship relationship = Relationship.Get(client, sim.SimDescription, true);
                        if (relationship != null)
                        {
                            data.DisableAutonomy();
                            relationship.STC.Set(client.CreatedSim, sim, CommodityTypes.Amorous, 500f);
                            client.CreatedSim.InteractionQueue.CancelAllInteractions();
                            while (client.CreatedSim.CurrentInteraction != null)
                            {
                                Common.Sleep(0);
                            }

                            data.SetupAlarm();

                            client.CreatedSim.GreetSimOnMyLotIfPossible(sim);
                            CommonWoohoo.WoohooStyle style = CommonWoohoo.WoohooStyle.Safe;
                            if (!Woohooer.Settings.ReplaceWithRisky && client.CreatedSim.IsSelectable && TwoButtonDialog.Show(Woohooer.Localize("FriskyConfirm:Prompt", sim.IsFemale, new object[] { sim, client.CreatedSim }), Woohooer.Localize("FriskyConfirm:Yes", sim.IsFemale, new object[] { sim, client.CreatedSim }), Woohooer.Localize("FriskyConfirm:No", sim.IsFemale, new object[] { sim, client.CreatedSim })))
                            {
                                style = CommonWoohoo.WoohooStyle.Risky;
                            }
                            data.mStyle = style;
                            KamaSimtra.Settings.SetServiceData(data.mRequester, data);

                            new CommonWoohoo.PushWoohoo(sim, client.CreatedSim, false, style);
                            proceed = true;

                            if (client.CreatedSim.IsSelectable)
                            {
                                StyledNotification.Format format = new StyledNotification.Format(Common.Localize("OrderServices:Arrived", sim.IsFemale), sim.ObjectId, client.CreatedSim.ObjectId, StyledNotification.NotificationStyle.kSimTalking);
                                StyledNotification.Show(format);
                            }
                        }
                    }
                }

                if (!proceed && data != null)
                {
                    data.Dispose();
                }
            }
Exemplo n.º 27
0
 public static void OnWorldLoadFinishedHandler(object sender, EventArgs e)
 {
     try
     {
         if (GameUtils.IsInstalled(ProductVersion.EP7) || GameUtils.IsInstalled(ProductVersion.EP3))
         {
             Instantiator.AddInteractionsToCityHall();
             if (Instantiator.pInteractionsActive)
             {
                 Instantiator.AddAllInteractionsForSims();
                 Instantiator.AddAllInteractionsForUrnstones();
                 Instantiator.AddAllInteractionsForHospitals();
             }
             if (Instantiator.pBloodActive)
             {
                 VTBlood.OnWorldLoadFinishedHandler();
             }
             if (Instantiator.pBiteMarkActive)
             {
                 VTBiteMark.OnWorldLoadFinishedHandler();
             }
             if (Instantiator.pThirstActive)
             {
                 VTThirst.OnWorldLoadFinishedHandler();
             }
             if (Instantiator.pConversionActive)
             {
                 VTConversion.OnWorldLoadFinishedHandler();
             }
             if (!Instantiator.pLoadNotificationDeActived)
             {
                 StyledNotification.Show(new StyledNotification.Format("Loaded Vampire Tweaker correctly without any errors", StyledNotification.NotificationStyle.kSystemMessage));
                 SimpleMessageDialog.Show("Vampire Tweaker", "Every functionality of the mod is deactivated, please, consider to go to City Hall>Vampire Tweaker... to customize the mod with a easy method and disable this message and the notification to load on start. Anything won´t work if you don´t active in the City Hall the function.");
                 if (!GameUtils.IsInstalled(ProductVersion.EP7))
                 {
                     StyledNotification.Show(new StyledNotification.Format("We have detected you haven´t installed Supernatural EP. Some functionalities of the mod requires this expansion, but it won´t generate any conflicts. The functionalities will be activated the first time you install Supernatural EP", StyledNotification.NotificationStyle.kSystemMessage));
                 }
             }
             if (!Instantiator.pBuffActive)
             {
                 sBuffSparkleDisable = EventTracker.AddListener(EventTypeId.kGotBuff, new ProcessEventDelegate(EnableSparkle.OnGotBuff));
             }
         }
         if (!GameUtils.IsInstalled(ProductVersion.EP7) || !GameUtils.IsInstalled(ProductVersion.EP3))
         {
             SimpleMessageDialog.Show("Vampire Tweaker", "It seems you haven´t installed any expansion of Vampires (Late Night or Supernatural). The mod is deactivated and any function won´t work. Upgrade the Expansion Pack or install it. If you won´t install any expansion, you should remove this mod, it isn´t useful for you without the EPs.");
         }
     }
     catch (Exception exception)
     {
         Instantiator.Exception(exception);
         StyledNotification.Show(new StyledNotification.Format("Failed to load Vampire Tweaker things. Error generated by fer456.VampireTweaker.Interactions.dll into VampireTweaker.ModInitiatorAndHandler.Instantiator || See info below and in Documents_Electronic Arts_The Sims 3" + exception, StyledNotification.NotificationStyle.kDebugAlert));
     }
 }
Exemplo n.º 28
0
        protected static void Notify(Sim sim, string msg)
        {
            if (sim == null)
            {
                return;
            }

            if (sim.Household == Household.ActiveHousehold)
            {
                StyledNotification.Show(new StyledNotification.Format(msg, sim.ObjectId, ObjectGuid.InvalidObjectGuid, StyledNotification.NotificationStyle.kSystemMessage));
            }
        }
Exemplo n.º 29
0
        protected static void Notify(Sim sim, string msg)
        {
            if (sim == null)
            {
                return;
            }

            if (SimTypes.IsSelectable(sim))
            {
                StyledNotification.Show(new StyledNotification.Format(msg, sim.ObjectId, ObjectGuid.InvalidObjectGuid, StyledNotification.NotificationStyle.kSystemMessage));
            }
        }
Exemplo n.º 30
0
 public static void Report()
 {
     if (Debugger.sLog != null)
     {
         foreach (string current in Debugger.sLog)
         {
             StyledNotification.Show(new StyledNotification.Format(current, StyledNotification.NotificationStyle.kDebugAlert));
         }
     }
     AlarmManager.Global.RemoveAlarm(Debugger.sReporterHandle);
     Debugger.sReporterHandle = AlarmHandle.kInvalidHandle;
 }