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); }
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; } } }
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 })); } } }
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()); }
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); }
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); } }
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); }
public override float FindMetricValue(Career career) { ProSports sports = OmniCareer.Career <ProSports>(career); if (sports != null) { return((float)(sports.mWinRecord - sports.mLossRecord)); } return(0f); }
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(""); }
public override float FindMetricValue(Career career) { FortuneTellerCareer fortune = OmniCareer.Career <FortuneTellerCareer>(career); if (fortune != null) { return((float)fortune.PrivateReadingsPerfomed); } return(0f); }
// 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])); }
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); } }
public override bool IsEligible(Career c) { Business business = OmniCareer.Career <Business>(c); if (business == null) { return(false); } return(business.OwnerDescription == business.SimConspiringPrank); }
// 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); }
public override float FindMetricValue(Career career) { Music music = OmniCareer.Career <Music> (career); if (music == null) { return(0); } return((float)music.ConcertsPerformed); }
// 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; } }
// 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; } }
// 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); } }
// 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 }); }
// 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])); }
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); } }
public override bool Run() { try { StandardEntry(); if (!Target.StartComputing(this, SurfaceHeight.Table, true)) { StandardExit(); return(false); } DateAndTime firstDate = SimClock.CurrentTime(); Target.StartVideo(Computer.VideoType.WordProcessor); StartStages(); BeginCommodityUpdates(); bool succeeded = false; try { AnimateSim("WorkTyping"); succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached)); } finally { EndCommodityUpdates(succeeded); } LawEnforcement job = OmniCareer.Career <LawEnforcement>(Actor.Occupation); float minutes = SimClock.ElapsedTime(TimeUnit.Minutes, firstDate, SimClock.CurrentTime()); job.UpdateTimeSpentOnForensicAnalysis(minutes); Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false); if (job.IsForensicAnalysisComplete(Computer.RunForensicAnalysis.kTotalTimeToFinishAnalysis)) { job.ResetForensicAnalysisStatistics(); Actor.ModifyFunds(Computer.RunForensicAnalysis.kRewardOnFinishingAnalysis); Actor.ShowTNSIfSelectable(LocalizeString(Actor.SimDescription, "AnalysisComplete", new object[] { Actor, Computer.RunForensicAnalysis.kRewardOnFinishingAnalysis }), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, Actor.ObjectId); } StandardExit(); return(true); } catch (Exception e) { Common.Exception(Actor, Target, e); return(false); } }
public override float FindMetricValue(Career career) { Journalism journalism = OmniCareer.Career <Journalism>(career); int num = 0x0; if (journalism != null) { for (int i = 0x0; i < Journalism.kWindowForRememberingStories; i++) { num += journalism.mStoriesWrittenPastNDays[i]; } num += journalism.StoriesWrittenToday; } return((float)num); }
public override bool Test(InteractionInstance ii, out StringDelegate reason) { if (!base.Test(ii, out reason)) { return(false); } Business career = OmniCareer.Career <Business>(Career); if ((career != null) && (career.CurLevel != null)) { return(OmniCareer.HasMetric <MetricMeetingsHeld>(Career)); } return(false); }
public override float FindMetricValue(Career career) { LawEnforcement enforcement = OmniCareer.Career <LawEnforcement>(career); int num = 0x0; if (enforcement != null) { for (int i = 0x0; i < LawEnforcement.kWindowForRememberingReports; i++) { num += enforcement.mReportsWrittenPastNDays[i]; } num += enforcement.ReportsCompltetedToday; } return((float)num); }
public override void OnTimePassed(InteractionInstance interactionInstance, float totalTime, float deltaTime) { base.OnTimePassed(interactionInstance, totalTime, deltaTime); Business career = OmniCareer.Career <Business>(Career); if (career != null) { float num = SimClock.ElapsedTime(TimeUnit.Hours) - mTimeForStartOfTone; if (((int)Math.Floor((double)(num / Business.kSimHoursToCallMeetingWothwhile))) > (career.MeetingsHeldToday - mMeetingsHeldBeforeStartOfTone)) { career.MeetingsHeldToday++; } } }
public override bool Test(InteractionInstance ii, out StringDelegate reason) { if (!base.Test(ii, out reason)) { return(false); } Education career = OmniCareer.Career <Education>(Career); if ((career != null) && (career.CurLevel != null)) { return(OmniCareer.HasMetric <MetricLecturesGiven>(Career)); } return(false); }
// Methods public override bool BeforeEnteringRabbitHole() { ProSports job = OmniCareer.Career <ProSports>(Actor.Occupation); if (job == null) { return(false); } if (!job.IsAllowedToWork() && job.IsAllowedToWorkThisTime(ProSports.kGameStartTime, ProSports.kGameLength)) { return(job.WaitForWork(Actor, Target)); } return(true); }
public override float FindMetricValue(Career career) { Education education = OmniCareer.Career <Education>(career); int num = 0x0; if (education != null) { for (int i = 0x0; i < Education.kWindowForRememberingLectures; i++) { num += education.mLecturesInLastNDays[i]; } num += education.LecturesGivenToday; } return((float)num); }
// Methods public override void BeginCareerTone(InteractionInstance interactionInstance) { base.BeginCareerTone(interactionInstance); Criminal career = OmniCareer.Career <Criminal>(Career); if (career == null) { return; } if (career.TotalTimeToCompleteCurrentSideJob < 0.5f) { career.TotalTimeToCompleteCurrentSideJob = Criminal.DoASideJob.kNumHoursDoingSideJobsToGetBonus * (1f + RandomUtil.GetFloat(-Criminal.DoASideJob.kSideJobDurationVariance, Criminal.DoASideJob.kSideJobDurationVariance)); } }