protected override bool ConfigureInteraction(RabbitHole.RabbitHoleInteraction <Sim, RabbitHole> wk, List <ITone> allTones) { if (ChatOnly) { // Search for the Meet new People tone foreach (ITone displaytone in allTones) { MeetCoworkersTone careertone = displaytone as MeetCoworkersTone; if (careertone == null) { continue; } if (ManagerCareer.VerifyTone(careertone)) { try { wk.CurrentITone = careertone; return(true); } catch (Exception e) { Common.DebugException(careertone.Name(), e); wk.CurrentITone = null; } } break; } // Search for the Hang with Coworkers tone foreach (ITone displaytone in allTones) { HangWithCoworkersTone careertone = displaytone as HangWithCoworkersTone; if (careertone == null) { continue; } if (ManagerCareer.VerifyTone(careertone)) { try { wk.CurrentITone = careertone; return(true); } catch (Exception e) { Common.DebugException(careertone.Name(), e); wk.CurrentITone = null; } } break; } } return(base.ConfigureInteraction(wk, allTones)); }
public override bool Test(Sim a, RabbitHole target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { try { if (a.Posture.Container != target.RabbitHoleProxy) { greyedOutTooltipCallback = Common.DebugTooltip("Not Container"); return(false); } if (GetRomanticSims(target, a, isAutonomous, GetStyle(null), Makeout).Count == 0x0) { greyedOutTooltipCallback = Common.DebugTooltip("No Other Sims"); return(false); } RabbitHole.RabbitHoleInteraction <Sim, RabbitHole> currentInteraction = a.CurrentInteraction as RabbitHole.RabbitHoleInteraction <Sim, RabbitHole>; if (currentInteraction == null) { greyedOutTooltipCallback = Common.DebugTooltip("Not Rabbithole Interaction"); return(false); } if (!currentInteraction.CanWooHooDuringInteraction) { greyedOutTooltipCallback = Common.DebugTooltip("CanWooHooDuringInteraction Fail"); return(false); } return(true); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(a, target, e); return(false); } }
protected virtual bool ConfigureInteraction(RabbitHole.RabbitHoleInteraction <Sim, RabbitHole> wk, List <ITone> allTones) { string jobimage = null; if (wk is GoToSchoolInRabbitHole) { if (wk.Actor.School != null) { jobimage = wk.Actor.School.CareerIconColored; } } else { if (wk.Actor.Occupation != null) { jobimage = wk.Actor.Occupation.CareerIconColored; } } return(SetTone(wk, allTones, ref mTone)); }
protected override bool PrivateUpdate(ScenarioFrame frame) { int elapsedCalendarDays = SimClock.ElapsedCalendarDays(); RabbitHole.RabbitHoleInteraction <Sim, RabbitHole> work = Sim.CreatedSim.InteractionQueue.GetCurrentInteraction() as RabbitHole.RabbitHoleInteraction <Sim, RabbitHole>; if (work == null) { return(false); } if (work.Actor == null) { return(false); } if (work.mAvailableTones != null) { int index = 0; while (index < work.mAvailableTones.Count) { if (work.mAvailableTones[index] == null) { work.mAvailableTones.RemoveAt(index); } else { index++; } } } List <InteractionToneDisplay> displayTones = work.AvailableTonesForDisplay(); if (displayTones == null) { IncStat("No Choices"); return(false); } List <ITone> tones = new List <ITone>(); foreach (InteractionToneDisplay tone in displayTones) { if (tone.InteractionTone == null) { continue; } if (tone.InteractionTone.ToString() == mTone) { continue; } if (!ManagerCareer.VerifyTone(tone.InteractionTone as CareerTone)) { continue; } tones.Add(tone.InteractionTone); } return(ConfigureInteraction(work, tones)); }
protected override bool PrivateUpdate(ScenarioFrame frame) { int elapsedCalendarDays = SimClock.ElapsedCalendarDays(); RabbitHole.RabbitHoleInteraction <Sim, RabbitHole> work = Sim.CreatedSim.InteractionQueue.GetCurrentInteraction() as RabbitHole.RabbitHoleInteraction <Sim, RabbitHole>; if (work == null) { return(false); } if (work.Actor == null) { return(false); } if (work.mAvailableTones != null) { int index = 0; while (index < work.mAvailableTones.Count) { if (work.mAvailableTones[index] == null) { work.mAvailableTones.RemoveAt(index); } else { index++; } } } List <InteractionToneDisplay> displayTones = work.AvailableTonesForDisplay(); if (displayTones == null) { IncStat("No Choices"); return(false); } List <ITone> tones = new List <ITone>(); foreach (InteractionToneDisplay tone in displayTones) { if (tone.InteractionTone == null) { continue; } if (tone.InteractionTone.ToString() == mTone) { continue; } if (!ManagerCareer.VerifyTone(tone.InteractionTone as CareerTone)) { continue; } // can't put this in VerifyTone because ActiveCareer tones aren't inherited from CareerTone // and that function needs that AcademicCourse.SuckUpToProfessorTone professorTone = tone.InteractionTone as AcademicCourse.SuckUpToProfessorTone; if (professorTone != null && work.Actor.CareerManager.DegreeManager != null) { SimDescription sim = AcademicCareer.GetProfessorForMajor(work.Actor.CareerManager.DegreeManager.EnrollmentAcademicDegreeName); if (sim != null && sim.SimDescriptionId == work.Actor.SimDescription.SimDescriptionId) { continue; } } tones.Add(tone.InteractionTone); } return(ConfigureInteraction(work, tones)); }