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); } }
private static bool WasWitnessed(Sim actor, Sim target, JealousyLevel level, bool woohoo) { foreach (Sim sim in actor.LotCurrent.GetAllActors()) { if (sim == actor) { continue; } if (sim == target) { continue; } if (CommonSocials.CaresAboutJealousy(actor, target, sim, level, woohoo)) { return(true); } } return(false); }