Esempio n. 1
0
        protected new void JournalismRummage(Sim rummager, IOutdoorAcceptsGarbage can)
        {
            Journalism job = OmniCareer.Career <Journalism>(rummager.Occupation);

            Common.DebugNotify("RummageEx:JournalismRummage");

            List <SimDescription> choices = new List <SimDescription>();

            foreach (SimDescription sim in Households.Humans(can.LotCurrent.Household))
            {
                if (sim.YoungAdultOrAbove && !job.SimsTrashScoped.Contains(sim))
                {
                    choices.Add(sim);
                }
            }
            if (choices.Count != 0x0)
            {
                SimDescription choice = RandomUtil.GetRandomObjectFromList(choices);

                Common.DebugNotify("JournalismRummage: " + choice.FullName);

                job.SimsTrashScoped.Add(choice);
                rummager.ShowTNSIfSelectable(Common.LocalizeEAString(rummager.IsFemale, "Gameplay/Objects/Miscellaneous/TrashcanOutside:RummageForInfo" + RandomUtil.GetInt(0x1, 0x3), new object[] { rummager, choice }), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, rummager.ObjectId);
            }
        }
Esempio n. 2
0
        public static bool Test(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (NRaas.Careers.Settings.mMaxShakedown <= 0)
                {
                    return(false);
                }

                if (actor.Occupation is Criminal)
                {
                    return(true);
                }

                if (actor.Occupation is LawEnforcement)
                {
                    return(true);
                }

                OmniCareer actorCareer = actor.Occupation as OmniCareer;
                if (actorCareer != null)
                {
                    return(actorCareer.CanShakedown());
                }

                return(false);
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return(false);
            }
        }
Esempio n. 3
0
        protected static int CalculateShowPriceEx(Sim a, ShowVenue target)
        {
            int showPrice = target.ShowPrice;

            if (a.HasTrait(TraitNames.ComplimentaryEntertainment))
            {
                showPrice = 0x0;
            }

            Music music = OmniCareer.Career <Music>(a.Occupation);

            if ((music != null) && (music.CurLevelBranchName == "Symphonic") && (music.CareerLevel >= Music.FreeTheatreShowLevel))
            {
                showPrice = 0x0;
            }

            foreach (Sim sim in a.Household.Sims)
            {
                if ((target.ActorsUsingMe.Contains(sim) && (sim.CurrentInteraction != null)) && (sim.CurrentInteraction.InteractionDefinition == ShowVenue.PerformConcert.Singleton))
                {
                    return(0x0);
                }
            }
            return(showPrice);
        }
Esempio n. 4
0
            public override bool Test(Sim a, RabbitHole target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                OmniCareer job = a.Occupation as OmniCareer;

                if ((job != null) && (job.HasMetric <MetricMeetingsHeld>()))
                {
                    float num = SimClock.Hours24;
                    if ((num >= Business.kEarliestTimeToHoldMeeting) && (num <= Business.kLatestTimeToHoldMeeting))
                    {
                        if (a.MoodManager.MoodValue >= Business.kMinMoodToHoldMeeting)
                        {
                            return(true);
                        }

                        greyedOutTooltipCallback = delegate
                        {
                            return(HoldMeetingInAtRabbitHole.LocalizeString(a.SimDescription, "MoodConstraintOnMeetings", new object[] { a.SimDescription }));
                        };
                    }
                    else
                    {
                        greyedOutTooltipCallback = delegate {
                            return(HoldMeetingInAtRabbitHole.LocalizeString(a.SimDescription, "NoTimeToHoldMeeting", new object[] { a.SimDescription }));
                        };
                    }
                }

                return(false);
            }
Esempio n. 5
0
        public override void OnEndOfDay(Career c)
        {
            Business business = OmniCareer.Career <Business> (c);

            if (business != null)
            {
                if ((business.SimConspiringPrank != null) && (business.OwnerDescription == business.SimConspiringPrank))
                {
                    if (business.IsPrankSet)
                    {
                        base.Display(LocalizeString(business.SimConspiringPrank, "PrankCouldNotBeDone", new object[] { business.SimAffectedByPrank, business.SimConspiringPrank }), business.SimConspiringPrank.CreatedSim.ObjectId, c);
                        business.WasLastPrankSuccessful = false;
                    }
                    if ((business.SimAffectedByPrank != null) && (business.LastPrankedSim != business.SimAffectedByPrank))
                    {
                        business.LastPrankedSim = business.SimAffectedByPrank;
                    }
                    else
                    {
                        business.LastPrankedSim = null;
                    }
                    business.SimAffectedByPrank = null;
                    business.IsPrankSet         = false;
                }
            }
        }
Esempio n. 6
0
        public override void OnTimePassed(InteractionInstance interactionInstance, float totalTime, float deltaTime)
        {
            base.OnTimePassed(interactionInstance, totalTime, deltaTime);

            Criminal career = OmniCareer.Career <Criminal>(Career);

            if (career == null)
            {
                return;
            }

            career.AddTimeSpentDoingSideJobs(deltaTime / 60f);
            if (career.TotalTimeSpentDoingSideJobs >= (career.WhenSideJobBonusLastGiven + career.TotalTimeToCompleteCurrentSideJob))
            {
                career.WhenSideJobBonusLastGiven         = career.TotalTimeSpentDoingSideJobs;
                career.TotalTimeToCompleteCurrentSideJob = Criminal.DoASideJob.kNumHoursDoingSideJobsToGetBonus * (1f + RandomUtil.GetFloat(-Criminal.DoASideJob.kSideJobDurationVariance, Criminal.DoASideJob.kSideJobDurationVariance));
                if ((base.Career.OwnerDescription != null) && (base.Career.OwnerDescription.Household != null))
                {
                    int num = Criminal.DoASideJob.kBaseSideJobsBonusAmount + (Criminal.DoASideJob.kSideJobBonusAmountExtraPerCareerLevel * (career.CurLevel.Level - 0x1));
                    num  = (int)(num * (1f + RandomUtil.GetFloat(-Criminal.DoASideJob.kSideJobBonusAmountVariance, Criminal.DoASideJob.kSideJobBonusAmountVariance)));
                    num -= num % 0x5;
                    Household household = base.Career.OwnerDescription.Household;
                    household.ModifyFamilyFunds(num);
                    base.Career.ShowOccupationTNS(LocalizeString(base.Career.OwnerDescription, "SideJobBonusText", new object[] { base.Career.OwnerDescription, num }));
                }
            }
        }
Esempio n. 7
0
            public override bool Test(Sim a, GameObject target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    if (a.Household == null)
                    {
                        return(false);
                    }

                    if (target.LotCurrent == a.LotHome)
                    {
                        return(false);
                    }

                    if (!target.IsStealable())
                    {
                        return(false);
                    }

                    OmniCareer omni = a.Occupation as OmniCareer;
                    if (omni == null)
                    {
                        return(false);
                    }

                    return(omni.CanSwipe());
                }
                catch (Exception e)
                {
                    Common.Exception(a, target, e);
                    return(false);
                }
            }
Esempio n. 8
0
        public override float FindMetricValue(Career career)
        {
            LawEnforcement enforcement = OmniCareer.Career <LawEnforcement> (career);

            SimDescription partner = null;

            if (enforcement != null)
            {
                partner = enforcement.Partner;
            }

            if (partner == null)
            {
                if (career.Coworkers.Count > 0)
                {
                    partner = career.Coworkers[0];
                }
            }

            if (partner == null)
            {
                return(0f);
            }

            Relationship relationship = enforcement.OwnerDescription.GetRelationship(partner, false);

            if (relationship == null)
            {
                return(0f);
            }

            return(relationship.GetCareerRating());
        }
Esempio n. 9
0
        public override bool InRabbitHole()
        {
            StartStages();
            BeginCommodityUpdates();

            bool succeeded = false;

            try
            {
                succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
            }
            finally
            {
                EndCommodityUpdates(succeeded);
            }

            if (succeeded)
            {
                Education occupation = OmniCareer.Career <Education>(Actor.Occupation);
                if (occupation != null)
                {
                    occupation.LecturesGivenToday++;
                    EventTracker.SendEvent(EventTypeId.kGaveEducationLecture, Actor);
                    Actor.ModifyFunds(Education.kMoneyForLecture);
                    Actor.ShowTNSIfSelectable(LocalizeString(Actor.IsFemale, "MoneyEarned", new object[] { Actor, Education.kMoneyForLecture }), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, Actor.ObjectId);
                }
            }
            return(succeeded);
        }
Esempio n. 10
0
        public override bool TestReadBook(Sim Actor, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            GreyedOutTooltipCallback callback = null;
            OmniJournalData          data     = base.Data as OmniJournalData;

            OmniCareer career = Actor.Occupation as OmniCareer;

            if (career == null)
            {
                return(true);
            }

            if ((career.CurLevel.HasMetricType(typeof(MetricJournals))) && ((data != null) && (career.CareerLevel >= data.CareerLevel)))
            {
                return(true);
            }
            if (callback == null)
            {
                callback = delegate
                {
                    return(LocalizeString(Actor.SimDescription, "NonDoctorReadFailureTooltip", new object[] { Actor }));
                };
            }
            greyedOutTooltipCallback = callback;
            return(false);
        }
Esempio n. 11
0
        public override bool Run()
        {
            StandardEntry();
            if (!Target.StartComputing(this, SurfaceHeight.Table, true))
            {
                StandardExit();
                return(false);
            }
            Target.StartVideo(Computer.VideoType.WordProcessor);
            BeginCommodityUpdates();

            bool succeeded = false;

            try
            {
                Definition interactionDefinition = InteractionDefinition as Definition;

                mJob = Actor.OccupationAsCareer;

                if (interactionDefinition.Scrap)
                {
                    AnimateSim("WorkTyping");
                    string name = (OmniCareer.Career <Journalism>(mJob) != null) ? "ScrapStoryWarning" : "ScrapReportWarning";
                    if (AcceptCancelDialog.Show(Computer.LocalizeString(name, new object[] { mJob.GetCurrentReportSubject() })))
                    {
                        base.AnimateSim("WorkTyping");
                        mJob.SetReportSubject(null);
                    }
                    EndCommodityUpdates(true);
                    Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false);
                    StandardExit();
                    return(true);
                }
                if (!interactionDefinition.IsContinuing)
                {
                    Sim selectedObject = base.GetSelectedObject() as Sim;
                    mJob.SetReportSubject(selectedObject.SimDescription);
                    Journalism job = OmniCareer.Career <Journalism>(mJob);
                    if (job != null)
                    {
                        job.IsStoryNegative = interactionDefinition.IsNegativeReport;
                    }
                }
                ProgressMeter.ShowProgressMeter(Actor, mJob.GetCurrentReportCompletion() / 100f, ProgressMeter.GlowType.Weak);
                AnimateSim("WorkTyping");
                succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), new Interaction <Sim, Computer> .InsideLoopFunction(LoopDel), null, 1f);
                ProgressMeter.HideProgressMeter(Actor, succeeded);
            }
            finally
            {
                EndCommodityUpdates(succeeded);
            }

            Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false);
            StandardExit();
            return(succeeded);
        }
Esempio n. 12
0
        public override float FindMetricValue(Career career)
        {
            ProSports sports = OmniCareer.Career <ProSports>(career);

            if (sports != null)
            {
                return((float)(sports.mWinRecord - sports.mLossRecord));
            }
            return(0f);
        }
Esempio n. 13
0
        public override float FindMetricValue(Career career)
        {
            OmniCareer job = career as OmniCareer;

            if (job != null)
            {
                return((float)job.NumRecruits);
            }
            return(0f);
        }
Esempio n. 14
0
        public override float FindMetricValue(Career career)
        {
            OmniCareer job = career as OmniCareer;

            if (job != null)
            {
                return((float)job.ShakedownFunds);
            }
            return(0f);
        }
Esempio n. 15
0
        public override string MetricDescription(Career career)
        {
            ProSports sports = OmniCareer.Career <ProSports>(career);

            if (sports != null)
            {
                return(OmniCareer.LocalizeString(career.OwnerDescription, "DescriptionWinLossRecord", "Gameplay/Careers/Metrics:DescriptionWinLossRecord", new object[] { sports.GamesTillSeasonEnds, sports.GamesWon, sports.GamesLost, sports.GamesWonTotal, sports.GamesLostTotal }));
            }
            return("");
        }
Esempio n. 16
0
        public override float FindMetricValue(Career career)
        {
            FortuneTellerCareer fortune = OmniCareer.Career <FortuneTellerCareer>(career);

            if (fortune != null)
            {
                return((float)fortune.PrivateReadingsPerfomed);
            }
            return(0f);
        }
Esempio n. 17
0
            // Methods
            public override string GetInteractionName(Sim actor, Computer target, InteractionObjectPair iop)
            {
                LawEnforcement job = OmniCareer.Career <LawEnforcement>(actor.Occupation);

                if ((job != null) && (!job.IsCurrentlyRunningforensicAnalysis))
                {
                    return(RunForensicAnalysis.LocalizeString(actor.SimDescription, "InteractionName", new object[0x0]));
                }
                return(RunForensicAnalysis.LocalizeString(actor.SimDescription, "ContinueAnalysis", new object[0x0]));
            }
Esempio n. 18
0
        // Methods
        public bool HasPartner(Career career, out SimDescription partner)
        {
            partner = null;
            LawEnforcement enforcement = OmniCareer.Career <LawEnforcement> (career);

            if (enforcement != null)
            {
                partner = enforcement.Partner;
            }
            return(partner != null);
        }
Esempio n. 19
0
        public override bool Test(InteractionInstance inst, out StringDelegate reason)
        {
            if (!base.Test(inst, out reason))
            {
                return(false);
            }

            OmniCareer career = Career as OmniCareer;

            return(career != null);
        }
Esempio n. 20
0
        public override bool BeforeEnteringRabbitHole()
        {
            GreyedOutTooltipCallback greyedOutTooltipCallback = null;

            if (!base.Target.PerformConcertAllowed(ref greyedOutTooltipCallback))
            {
                base.Actor.ShowTNSIfSelectable(OmniCareer.LocalizeString(base.Actor.SimDescription, "AttendClassInRabbitHole:ConflictingEventTNS", "Gameplay/Abstracts/RabbitHole/AttendClassInRabbitHole:ConflictingEventTNS", new object[0x0]), StyledNotification.NotificationStyle.kSimTalking, base.Actor.ObjectId, base.Target.ObjectId);
                return(false);
            }
            return(base.BeforeEnteringRabbitHole());
        }
Esempio n. 21
0
        public new void LoopDel(StateMachineClient smc, Interaction <Sim, Computer> .LoopData loopData)
        {
            Journalism job = OmniCareer.Career <Journalism>(Actor.Occupation);

            Definition def = InteractionDefinition as Definition;

            if (job.UpdateReview(def.Review))
            {
                Actor.AddExitReason(ExitReason.Finished);
            }
        }
Esempio n. 22
0
        public override float FindMetricValue(Career career)
        {
            Music music = OmniCareer.Career <Music> (career);

            if (music == null)
            {
                return(0);
            }

            return((float)music.ConcertsPerformed);
        }
Esempio n. 23
0
        public override bool IsEligible(Career c)
        {
            Business business = OmniCareer.Career <Business>(c);

            if (business == null)
            {
                return(false);
            }

            return(business.OwnerDescription == business.SimConspiringPrank);
        }
Esempio n. 24
0
 public override bool AddCoworker()
 {
     try
     {
         return(OmniCareer.AddCoworker(this));
     }
     catch (Exception e)
     {
         Common.Exception(OwnerDescription, e);
         return(false);
     }
 }
Esempio n. 25
0
        // Methods
        public override void BeginCareerTone(InteractionInstance interactionInstance)
        {
            base.BeginCareerTone(interactionInstance);

            mTimeForStartOfTone = SimClock.ElapsedTime(TimeUnit.Hours);
            Education career = OmniCareer.Career <Education>(Career);

            if (career != null)
            {
                mLecturesHeldBeforeStartOfTone = career.LecturesGivenToday;
            }
        }
Esempio n. 26
0
        // Methods
        public override void BeginCareerTone(InteractionInstance interactionInstance)
        {
            base.BeginCareerTone(interactionInstance);

            mTimeForStartOfTone = SimClock.ElapsedTime(TimeUnit.Hours);
            Business career = OmniCareer.Career <Business> (Career);

            if (career != null)
            {
                mMeetingsHeldBeforeStartOfTone = career.MeetingsHeldToday;
            }
        }
Esempio n. 27
0
        // Methods
        public override void OnTimePassed(InteractionInstance interactionInstance, float totalTime, float deltaTime)
        {
            base.OnTimePassed(interactionInstance, totalTime, deltaTime);

            ProSports career = OmniCareer.Career <ProSports>(base.Career);

            if ((career != null) && (career.CurLevel != null))
            {
                career.mPreparationForGame = Math.Min((float)100f, (float)(career.mPreparationForGame + ((deltaTime * ProSports.PrepareForGame.kPrepareForGamePerSimHour) / 60f)));
                this.OnProgressChanged(this);
            }
        }
Esempio n. 28
0
        // Methods
        public override void ConfigureInteraction()
        {
            LawEnforcement job = OmniCareer.Career <LawEnforcement>(base.Actor.Occupation);

            if (job == null)
            {
                return;
            }

            TimedStage stage = new TimedStage(this.GetInteractionName(), Computer.RunForensicAnalysis.kInteractionStageLength - job.MinutesSpentDoingForensicAnalysis, false, true, true);

            base.Stages = new List <Stage>(new Stage[] { stage });
        }
Esempio n. 29
0
        public override bool InRabbitHole()
        {
            try
            {
                SetMovieGenre();

                if (Actor.IsSelectable)
                {
                    Target.PlayMovieGenreMusic(mMovieGenre);
                }

                Journalism journalism = OmniCareer.Career <Journalism>(Actor.Occupation);

                bool isReviewing = false;
                if (journalism != null)
                {
                    isReviewing = journalism.CanReviewRabbitHole(Target);
                }

                if (!InRabbitholePreLoop(isReviewing))
                {
                    return(false);
                }

                StartStages();
                BeginCommodityUpdates();
                bool succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                EndCommodityUpdates(succeeded);
                if (succeeded)
                {
                    Target.PostAttendShow(Actor);
                    if (isReviewing)
                    {
                        journalism.RabbitHolesReviewed.Add(new Journalism.ReviewedRabbitHole(Target, Target.ShowType));
                    }
                }

                ShowVenue.ApplyMovieBuff(mMovieGenre, Actor);
                return(succeeded);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Esempio n. 30
0
            // Methods
            public override string GetInteractionName(Sim a, Stadium target, InteractionObjectPair interaction)
            {
                Journalism job = OmniCareer.Career <Journalism>(a.Occupation);

                if ((job != null) && job.CanReviewRabbitHole(target))
                {
                    return(LocalizeString(a.SimDescription, "ReviewGame", new object[0x0]));
                }
                if (FamilyMemberOfSportsPlayer(a, false) == null)
                {
                    return(LocalizeString(a.SimDescription, "InteractionName", new object[] { Stadium.AttendGame.kCostToAttendGame }));
                }
                return(LocalizeString(a.SimDescription, "FreeInteractionName", new object[0x0]));
            }