public static void ReactToJealousEvent(Sim s, ReactionBroadcaster rb, JealousyLevel level, bool woohoo) { try { if (!WoohooScoring.ReactsToJealousy(s)) { return; } Sim broadcastingObject = rb.BroadcastingObject as Sim; if (broadcastingObject == null) { return; } if (broadcastingObject.CurrentInteraction == null) { return; } Sim target = null; IWooHooDefinition definition = broadcastingObject.CurrentInteraction.InteractionDefinition as IWooHooDefinition; if (definition != null) { target = definition.ITarget(broadcastingObject.CurrentInteraction); } if (target == null) { target = broadcastingObject.SynchronizationTarget; } if (target == null) { Woohooer.DebugNotify("Bad Target"); return; } if (CommonSocials.CaresAboutJealousy(broadcastingObject, target, s, level, woohoo)) { if ((s != broadcastingObject) && (s != target)) { if ((target != null) && (!SocialComponentEx.CheckCheating(s, broadcastingObject, target, level)) && (!broadcastingObject.CurrentInteraction.IsRejected)) { SocialComponentEx.CheckCheating(s, target, broadcastingObject, level); } } } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(s, e); } }
public override bool Run() { try { IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition; if (mWoohooee == null) { mWoohooee = definition.ITarget(this); } Tutorialette.TriggerLesson(Lessons.FutureTravel, Actor); List <Sim> followersFromSelectedObjects = new List <Sim>(); followersFromSelectedObjects.Add(mWoohooee); bool flag = mDestination.RouteOutside(Actor, followersFromSelectedObjects); CommonWoohoo.RunPostWoohoo(Actor, mWoohooee, Target, definition.GetStyle(this), definition.GetLocation(Target), true); Actor.BuffManager.AddElement(BuffNames.MissedMyStop, Origin.FromWooHooOnHoverTrain); if (CommonPregnancy.IsSuccess(Actor, mWoohooee, Autonomous, definition.GetStyle(this))) { CommonPregnancy.Impregnate(Actor, mWoohooee, Autonomous, definition.GetStyle(this)); } mWoohooee.BuffManager.AddElement(BuffNames.MissedMyStop, Origin.FromWooHooOnHoverTrain); return(flag); } catch (ResetException) { throw; } catch (Exception exception) { Common.Exception(Actor, Target, exception); return(false); } }