public static FuneralScenario Create(ManagerSituation manager, SimDescription deadSim) { SimDescription host = null; List <SimDescription> hosts = new List <SimDescription>(); foreach (SimDescription parent in Relationships.GetParents(deadSim)) { hosts.Add(parent); } foreach (SimDescription child in Relationships.GetChildren(deadSim)) { hosts.Add(child); } foreach (SimDescription sibling in Relationships.GetSiblings(deadSim)) { hosts.Add(sibling); } foreach (Relationship relation in Relationship.GetRelationships(deadSim)) { if (relation.LTR.Liking <= 50) { continue; } hosts.Add(relation.GetOtherSimDescription(deadSim)); } foreach (SimDescription sim in hosts) { if (sim == null) { continue; } if (sim.LotHome == null) { continue; } if (manager.IsBusy(manager, sim, true)) { continue; } host = sim; break; } if (host == null) { return(null); } return(new FuneralScenario(host, deadSim)); }
public override void Init(GoToLotSituation parent) { AlarmManager.RemoveAlarm(mAlarmHandle); mAlarmHandle = AlarmManager.AddAlarm(Sims3.Gameplay.Situations.InviteToLotSituation.kNumHoursForBothGoToLotToWaitBeforeGivingUp, TimeUnit.Hours, TimeOut, "Waiting for Sims to get to lot", AlarmType.NeverPersisted, Parent.mSimA); ForceSituationSpecificInteraction(parent.Lot, parent.mSimA, ManagerSituation.GetVisitInteraction(parent.mSimA, parent.Lot), null, OnRouteToLotSucceeded, OnRouteToLotFailed, InteractionPriorityLevel.UserDirected); ForceSituationSpecificInteraction(parent.Lot, parent.mSimB, ManagerSituation.GetVisitInteraction(parent.mSimB, parent.Lot), null, OnRouteToLotSucceeded, OnRouteToLotFailed, InteractionPriorityLevel.UserDirected); }
protected override bool PrivateSatisfies(ManagerCareer manager, SimDescription sim, Lot newLot, bool inspecting) { if (inspecting) { return(true); } return(ManagerSituation.FindRabbitHole(RabbitHoleType.PoliceStation) != null); }
private void TimeToInviteGuests() { Sim host = Parent.Host; foreach (SimDescription description in Parent.GuestDescriptions) { if (host != null) { Sim createdSim = description.CreatedSim; if ((createdSim == null) && (!SimTypes.IsDead(description)) && (!SimTypes.IsSelectable(description))) { createdSim = Instantiation.PerformOffLot(description, host.LotHome, null); } if (createdSim != null) { Parent.Guests.Add(createdSim); createdSim.AssignRole(Parent); } } } ManagerSituation situations = StoryProgression.Main.Situations; foreach (Sim sim3 in Parent.Guests) { if (!situations.IsBusy(situations, sim3, true)) { continue; } if (StoryProgression.Main.Situations.Allow(StoryProgression.Main.Situations, sim3.SimDescription)) { sim3.PushSwitchToOutfitInteraction(Sim.ClothesChangeReason.GoingToSituation, Parent.ClothingStyle); } if (sim3.LotCurrent != Parent.Lot) { Parent.PushComeToParty(sim3); } else { Parent.OnRouteToPartySucceeded(sim3, 0f); } } if (Parent.Lot != Parent.Host.LotCurrent) { Parent.PushComeToParty(host); } }
protected override bool PrivateSatisfies(ManagerCareer manager, SimDescription sim, Lot newLot, bool inspecting) { if (inspecting) { return(true); } if (sim.Occupation is Retired) { return(false); } return(ManagerSituation.FindRabbitHole(RabbitHoleType.ScienceLab) != null); }
protected override bool PrivateUpdate(ScenarioFrame frame) { bool formalOutfit = false; try { if (Sim.CreatedSim.CurrentOutfitCategory == OutfitCategories.Formalwear) { formalOutfit = true; } } catch (Exception e) { Common.DebugException(Sim, e); IncStat("Exception"); return(false); } if (formalOutfit) { if (Party.IsInvolvedInAnyTypeOfParty(Sim.CreatedSim)) { IncStat("Party"); return(false); } else if (Sim.CreatedSim.CurrentInteraction is ICountsAsWorking) { IncStat("Working"); return(false); } else if (PromSituation.IsHeadedToProm(Sim.CreatedSim)) { IncStat("Heading To Prom"); return(false); } else if (ManagerSituation.HasInteraction(Sim, PromSituation.GoToProm.Singleton)) { IncStat("At Prom"); return(false); } ManagerSim.ChangeOutfit(Manager, Sim, OutfitCategories.Everyday); ManagerCareer.PerformStylistHelp(this, frame); } return(true); }
public static BirthdayScenario Create(ManagerSituation manager, SimDescription birthdaySim) { SimDescription host = null; List <SimDescription> hosts = new List <SimDescription>(); if (!manager.Households.AllowGuardian(birthdaySim)) { foreach (SimDescription parent in Relationships.GetParents(birthdaySim)) { hosts.Add(parent); } } else { hosts.Add(birthdaySim); } foreach (SimDescription sim in hosts) { if (sim == null) { continue; } if (sim.LotHome == null) { continue; } if (manager.IsBusy(manager, sim, true)) { continue; } host = sim; break; } if (host == null) { return(null); } return(new BirthdayScenario(host, birthdaySim)); }
private void OnRouteToLotFailed(Sim actor, float x) { if (actor.LotCurrent != Parent.Lot) { if (mFirst) { mFirst = false; ForceSituationSpecificInteraction(Parent.Lot, actor, ManagerSituation.GetVisitInteraction(actor, Parent.Lot), null, OnRouteToLotSucceeded, OnRouteToLotFailed, InteractionPriorityLevel.UserDirected); } else { Exit(); } } else { OnRouteToLotSucceeded(actor, x); } }
protected override bool Push() { if (Sim.CreatedSim == null) { return(false); } if (!Situations.Allow(this, Sim)) { return(false); } if (Sim.CreatedSim.InteractionQueue != null) { Sim.CreatedSim.InteractionQueue.CancelAllInteractions(); } PoliceStation target = ManagerSituation.FindRabbitHole(RabbitHoleType.PoliceStation) as PoliceStation; if (target == null) { return(false); } if (OnPushInteraction == null) { return(false); } InteractionDefinition pushInteraction = OnPushInteraction(); if (pushInteraction == null) { return(false); } InteractionInstance entry = pushInteraction.CreateInstance(target, Sim.CreatedSim, new InteractionPriority(InteractionPriorityLevel.High), false, false); Sim.CreatedSim.AddExitReason(ExitReason.CanceledByScript); Sim.CreatedSim.InteractionQueue.AddNext(entry); return(true); }
protected override bool PrivateSatisfies(ManagerCareer manager, SimDescription sim, Lot newLot, bool inspecting) { if (inspecting) { return(true); } if (sim.Occupation is Retired) { return(false); } if (sim.Elder) { return(false); } return(ManagerSituation.FindLotType(CommercialLotSubType.kEP2_FireStation) != null); }
protected static bool IsInSituation(Sim sim) { if (Party.IsGuestAtAParty(sim)) { return(true); } else if (PromSituation.IsHeadedToProm(sim)) { return(true); } else if (ManagerSituation.HasBlockingSituation(sim, null)) { return(true); } else if (IsInteriorDesignerClient(sim)) { return(true); } return(false); }
protected override bool PrivateSatisfies(ManagerCareer manager, SimDescription sim, Lot newLot, bool inspecting) { if (!inspecting) { if (sim.Occupation is Retired) { return(false); } if (ManagerSituation.FindRabbitHole(RabbitHoleType.CityHall) == null) { return(false); } } if ((newLot == null) || (newLot.CountObjects <DraftingTable>() == 0)) { return(false); } return(true); }
protected override bool PrivateSatisfies(ManagerCareer manager, SimDescription sim, Lot newLot, bool inspecting) { if (!inspecting) { if (sim.Occupation is Retired) { return(false); } if (ManagerSituation.FindLotType(CommercialLotSubType.kEP2_Salon) == null) { return(false); } } if ((newLot == null) || (newLot.CountObjects <DraftingTable>() == 0)) { return(false); } return(true); }
protected bool ProgressPrivateEye(Occupation occupation) { if (!Test(Sim.CreatedSim, PoliceStation.LowLevelPoliceWork.Singleton)) { PoliceStation.LowLevelPoliceWork interaction = Sim.CreatedSim.InteractionQueue.GetCurrentInteraction() as PoliceStation.LowLevelPoliceWork; if (interaction != null) { if (interaction.CurrentTone == null) { List <ITone> allTones = new List <ITone>(); foreach (InteractionToneDisplay tone in interaction.AvailableTonesForDisplay()) { allTones.Add(tone.InteractionTone); } string name = null; if (CareerToneScenario.SetTone(interaction, allTones, ref name)) { IncStat("Private Eye Tone"); } } } return(true); } ; RabbitHole hole = ManagerSituation.FindRabbitHole(RabbitHoleType.PoliceStation); if (hole == null) { IncStat("No Police Station"); return(false); } return(Situations.PushInteraction <RabbitHole>(this, Sim, hole, PoliceStation.LowLevelPoliceWork.Singleton)); }
public static bool Perform(StoryProgressionObject manager, IScoringGenerator stats, SimDescription sim, Sim horse, RemountScenario remount) { if (ManagerSituation.HasInteraction(sim, Sims3.Gameplay.Actors.Sim.Mount.Singleton)) return false; return manager.Situations.PushInteraction<Sim>(stats, sim, horse, new ManagerSituation.WithCallbackPush(manager, Sims3.Gameplay.Actors.Sim.Mount.Singleton, null, null, remount)); }
public override void Startup(PersistentOptionBase vOptions) { try { mManagers = new List <Manager>(); Castes = new ManagerCaste(this); Lots = new ManagerLot(this); Households = new ManagerHousehold(this); Sims = new ManagerSim(this); Money = new ManagerMoney(this); Deaths = new ManagerDeath(this); Skills = new ManagerSkill(this); Careers = new ManagerCareer(this); Pregnancies = new ManagerPregnancy(this); Romances = new ManagerRomance(this); Flirts = new ManagerFlirt(this); Friends = new ManagerFriendship(this); Situations = new ManagerSituation(this); Personalities = new ManagerPersonality(this); Scenarios = new ManagerScenario(this); Scoring = new ManagerScoring(this); Stories = new ManagerStory(this); mManagerLookup = new Dictionary <Type, Manager>(); mManagerLookup.Add(GetType(), this); mManagerByName = new Dictionary <string, Manager>(); mManagerByName.Add(GetTitlePrefix(PrefixType.Pure), this); foreach (Manager manager in mManagers) { mManagerLookup.Add(manager.GetType(), manager); mManagerByName.Add(manager.GetTitlePrefix(PrefixType.Pure), manager); } InstallOptions(sInitialInstall); foreach (Manager manager in mManagers) { manager.InstallOptions(sInitialInstall); } if (Common.IsAwayFromHomeworld()) { // Stop persistence for the moment OptionStore optionStore = sOptions; sOptions = null; List <IAdjustForVacationOption> options = new List <IAdjustForVacationOption>(); GetOptions(options, false, null); foreach (IAdjustForVacationOption option in options) { option.AdjustForVacationTown(); } sOptions = optionStore; } Options.Restore(); Common.kDebugging = GetValue <DebuggingOption, bool>(); base.Startup(Options); RemoveStats(); foreach (Manager manager in mManagers) { try { manager.Startup(Options); } catch (Exception exception) { BooterLogger.AddError(exception.ToString()); } } if (DebuggingEnabled) { TestOptionNameUniqueness(); } sInitialInstall = false; mFirst = true; mTask = new Common.AlarmTask(1f, TimeUnit.Seconds, OnTimer, 10f, TimeUnit.Minutes); } catch (Exception exception) { Common.Exception("Startup", exception); } }