public static ListenerAction OnObjectChanged(Event evt) { if (evt.TargetObject is CarUFO) { AbductSimAEx.AddInteraction(evt.TargetObject as CarUFO); return(ListenerAction.Keep); } if (evt.TargetObject is RabbitHole) { if ((evt.TargetObject as RabbitHole).Guid == RabbitHoleType.Hospital) { HaveAlienBabyHospital.AddInteraction(evt.TargetObject as RabbitHole); } return(ListenerAction.Keep); } if (evt.TargetObject is Lot) { DebugTriggerAbduction.AddInteraction(evt.TargetObject as Lot); HaveAlienBabyHome.AddInteraction(evt.TargetObject as Lot); return(ListenerAction.Keep); } return(ListenerAction.Keep); }
public static void OnWorldLoadFinished(object sender, EventArgs evtArgs) { kDebugging = Settings.mDebugging; foreach (Sim sim in Sims3.Gameplay.Queries.GetObjects <Sim>()) { DebugInduceAlienPregnancy.AddInteraction(sim); ReturnAlienBabyEx.AddInteraction(sim); } /* * foreach (CarUFO ufo in Sims3.Gameplay.Queries.GetObjects<CarUFO>()) * { * AbductSimAEx.AddInteraction(ufo); * } */ foreach (Lot lot in Sims3.Gameplay.Queries.GetObjects <Lot>()) { DebugTriggerAbduction.AddInteraction(lot); HaveAlienBabyHome.AddInteraction(lot); } foreach (RabbitHole hospital in RabbitHole.GetRabbitHolesOfType(RabbitHoleType.Hospital)) { HaveAlienBabyHospital.AddInteraction(hospital); } EventTracker.AddListener(EventTypeId.kChildBornOrAdopted, new ProcessEventDelegate(OnNewBaby)); EventTracker.AddListener(EventTypeId.kBoughtObject, new ProcessEventDelegate(OnObjectChanged)); EventTracker.AddListener(EventTypeId.kBoughtObjectInEditTownMode, new ProcessEventDelegate(OnObjectChanged)); EventTracker.AddListener(EventTypeId.kInventoryObjectAdded, new ProcessEventDelegate(OnObjectChanged)); EventTracker.AddListener(EventTypeId.kObjectStateChanged, new ProcessEventDelegate(OnObjectChanged)); }