public static bool ReactsToJealousy(Sim actor) { if (actor.SimDescription.ToddlerOrBelow) { return(false); } if (KamaSimtra.IsWhoring(actor)) { return(false); } if (actor.HasTrait(TraitNames.InappropriateButInAGoodWay)) { return(false); } if (!Woohooer.Settings.UsingTraitScoring) { return(true); } if (Woohooer.Settings.mReactToJealousyBaseChanceScoring <= 0) { return(false); } return(TestScoringAbsolute(actor, null, "ReactsToJealousy", false)); }
public override bool Run() { try { StandardEntry(); if (!Target.StartComputing(this, SurfaceHeight.Table, true)) { StandardExit(); return(false); } Target.StartVideo(Computer.VideoType.Browse); AnimateSim("GenericTyping"); KamaSimtra skill = KamaSimtra.EnsureSkill(Actor); if (skill != null) { skill.WhoringActive = !skill.WhoringActive; } Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false); StandardExit(); return(true); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); return(false); } }
public static void ResetSettings() { sSettings = null; KamaSimtra.ResetSettings(); AdjustAttractionTuning(); }
public override ObjectPicker.ColumnInfo GetValue(SimDescription sim) { int price = 0; KamaSimtra skill = sim.SkillManager.GetSkill <KamaSimtra>(KamaSimtra.StaticGuid); if (skill != null) { price = skill.GetPayment() * 2; } return(new ObjectPicker.TextColumn(EAText.GetMoneyString(price))); }
public override string GetInteractionName(Sim actor, Computer target, InteractionObjectPair iop) { KamaSimtra skill = actor.SkillManager.GetSkill <KamaSimtra>(KamaSimtra.StaticGuid); if (skill == null) { return(""); } if (skill.WhoringActive) { return(Common.Localize("DisableWhoring:MenuName")); } else { return(Common.Localize("EnableWhoring:MenuName")); } }
public override bool Test(Sim a, Computer target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (!KamaSimtra.Settings.mShowRegisterInteraction) { return(false); } if (!target.IsComputerUsable(a, true, false, isAutonomous)) { return(false); } KamaSimtra skill = a.SkillManager.GetSkill <KamaSimtra>(KamaSimtra.StaticGuid); if (skill == null) { return(false); } return(skill.CanWhore()); }
public static void WoohooDisgraceChecks(Sim actor, Sim target) { if (!WasWitnessed(actor, target, JealousyLevel.High, true)) { return; } if (actor.LotCurrent.IsCommunityLot) { DisgracefulActionEvent e = new DisgracefulActionEvent(EventTypeId.kSimCommittedDisgracefulAction, actor, DisgracefulActionType.WooHooInPublic); e.TargetId = target.SimDescription.SimDescriptionId; EventTracker.SendEvent(e); e = new DisgracefulActionEvent(EventTypeId.kSimCommittedDisgracefulAction, target, DisgracefulActionType.WooHooInPublic); e.TargetId = actor.SimDescription.SimDescriptionId; EventTracker.SendEvent(e); } OccultTypes currentOccultTypes = target.SimDescription.OccultManager.CurrentOccultTypes; OccultTypes types2 = actor.SimDescription.OccultManager.CurrentOccultTypes; List <KamaSimtra.OccultTypesEx> actorTypes = KamaSimtra.GetOccultType(actor.SimDescription, false); List <KamaSimtra.OccultTypesEx> targetTypes = KamaSimtra.GetOccultType(target.SimDescription, false); if (actorTypes.Count == 0) { if (targetTypes.Count > 0) { DisgracefulActionEvent event3 = new DisgracefulActionEvent(EventTypeId.kSimCommittedDisgracefulAction, actor, DisgracefulActionType.WooHooWithOccult); event3.TargetId = target.SimDescription.SimDescriptionId; EventTracker.SendEvent(event3); } } else if (targetTypes.Count == 0) { DisgracefulActionEvent event4 = new DisgracefulActionEvent(EventTypeId.kSimCommittedDisgracefulAction, target, DisgracefulActionType.WooHooWithOccult); event4.TargetId = actor.SimDescription.SimDescriptionId; EventTracker.SendEvent(event4); } }
public override bool InRabbitHole() { try { ActiveStage.Start(); SimDescription choice = null; if (mMaster) { if (!AcceptCancelDialog.Show(Common.Localize("Rendezvous:Prompt", Actor.IsFemale, new object[] { KamaSimtra.Settings.mRendezvousCostPerLevel }))) { return(false); } Dictionary <int, List <SimDescription> > potentials = KamaSimtra.GetPotentials(Woohooer.Settings.AllowTeen(true)); List <SimDescription> choices = new List <SimDescription>(); for (int i = 1; i <= 10; i++) { List <SimDescription> fullList; if (!potentials.TryGetValue(i, out fullList)) { continue; } bool needFemale = false; if (Actor.SimDescription.CanAutonomouslyBeRomanticWithGender(CASAgeGenderFlags.Male)) { if (Actor.SimDescription.CanAutonomouslyBeRomanticWithGender(CASAgeGenderFlags.Female)) { if (RandomUtil.CoinFlip()) { needFemale = true; } } else { needFemale = false; } } else if (Actor.SimDescription.CanAutonomouslyBeRomanticWithGender(CASAgeGenderFlags.Female)) { needFemale = true; } else { needFemale = !Actor.IsFemale; } List <SimDescription> randomList = new List <SimDescription>(); foreach (SimDescription sim in fullList) { if (sim.IsFemale != needFemale) { continue; } if (sim.Household == Actor.Household) { continue; } string reason; GreyedOutTooltipCallback callback = null; if (!CommonSocials.CanGetRomantic(Actor.SimDescription, sim, false, true, true, ref callback, out reason)) { if (callback != null) { Common.DebugNotify(sim.FullName + Common.NewLine + callback()); } continue; } if (choices.Contains(sim)) { continue; } randomList.Add(sim); } if (randomList.Count > 0) { choices.Add(RandomUtil.GetRandomObjectFromList(randomList)); } } if (choices.Count == 0) { Common.Notify(Common.Localize("Rendezvous:NoneAvailable", Actor.IsFemale)); return(false); } choice = new SimSelection(Common.Localize("Rendezvous:MenuName"), Actor.SimDescription, choices, SimSelection.Type.Rendezvous, -1000).SelectSingle(); if (choice == null) { Common.Notify(Common.Localize("Rendezvous:NoSelect", Actor.IsFemale)); return(false); } if (Instantiation.PerformOffLot(choice, Target.LotCurrent, null) == null) { Common.Notify(Common.Localize("Rendezvous:BadSim", Actor.IsFemale, new object[] { choice })); return(false); } Rendezvous interaction = Singleton.CreateInstance(Target, choice.CreatedSim, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true) as Rendezvous; interaction.mMaster = false; interaction.LinkedInteractionInstance = this; choice.CreatedSim.InteractionQueue.CancelAllInteractions(); if (!choice.CreatedSim.InteractionQueue.AddNext(interaction)) { Common.Notify(Common.Localize("Rendezvous:BadSim", Actor.IsFemale, new object[] { choice })); return(false); } if (!DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), WaitPeriodLoop, null)) { Common.Notify(Common.Localize("Rendezvous:BadSim", Actor.IsFemale, new object[] { choice })); return(false); } if (!mBegin) { Common.Notify(Common.Localize("Rendezvous:BadSim", Actor.IsFemale, new object[] { choice })); return(false); } else { Actor.ClearExitReasons(); TimedStage stage = new TimedStage(GetInteractionName(), KamaSimtra.Settings.mRendezvousDuration, false, false, true); Stages = new List <Stage>(new Stage[] { stage }); ActiveStage = stage; ActiveStage.Start(); } } else { Rendezvous interaction = LinkedInteractionInstance as Rendezvous; if (interaction == null) { return(false); } interaction.mBegin = true; } if (mMaster) { if (!CelebrityManager.TryModifyFundsWithCelebrityDiscount(Actor, Target, KamaSimtra.Settings.mRendezvousCostPerLevel * choice.SkillManager.GetSkillLevel(KamaSimtra.StaticGuid), true)) { Common.Notify(Common.Localize("Rendezvous:CannotPay", Actor.IsFemale)); return(false); } Common.Notify(choice.CreatedSim, Common.Localize("Rendezvous:Success", Actor.IsFemale, choice.IsFemale, new object[] { choice })); KamaSimtra skill = KamaSimtra.EnsureSkill(Actor); if (skill != null) { skill.RendezvousActive = true; } } BeginCommodityUpdates(); bool succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached)); EndCommodityUpdates(succeeded); if (KamaSimtra.Settings.mRandomRendezvousMoodlet) { Actor.BuffManager.AddElement(RandomUtil.GetRandomObjectFromList(sRandomBuffs), WoohooBuffs.sWoohooOrigin); } if (mMaster) { CommonWoohoo.WoohooLocation location = CommonWoohoo.WoohooLocation.RabbitHole; List <WoohooLocationControl> choices = CommonWoohoo.GetValidLocations(Actor.SimDescription); if (choices.Count > 0) { location = RandomUtil.GetRandomObjectFromList(choices).Location; } CommonWoohoo.RunPostWoohoo(Actor, choice.CreatedSim, Target, CommonWoohoo.WoohooStyle.Safe, location, false); } return(succeeded); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); return(false); } }
protected static Dictionary <int, SimDescription> GetPotentials(Sim actor) { CASAgeGenderFlags allow = CASAgeGenderFlags.None; if ((actor.SimDescription.Teen && Woohooer.Settings.AllowTeen(true)) || (actor.SimDescription.YoungAdultOrAbove && Woohooer.Settings.AllowTeenAdult(true))) { allow |= CASAgeGenderFlags.Teen; } if (actor.SimDescription.Teen && Woohooer.Settings.AllowTeen(true) && Woohooer.Settings.AllowTeenAdult(true)) { allow |= CASAgeGenderFlags.YoungAdult | CASAgeGenderFlags.Adult | CASAgeGenderFlags.Elder; } if (actor.SimDescription.YoungAdultOrAbove) { allow |= CASAgeGenderFlags.YoungAdult | CASAgeGenderFlags.Adult | CASAgeGenderFlags.Elder; } Dictionary <int, List <SimDescription> > potentials = KamaSimtra.GetPotentials(allow, true); Dictionary <int, SimDescription> choices = new Dictionary <int, SimDescription>(); for (int i = 1; i <= 10; i++) { List <SimDescription> fullList; if (!potentials.TryGetValue(i, out fullList)) { continue; } bool needFemale = false; if (actor.SimDescription.CanAutonomouslyBeRomanticWithGender(CASAgeGenderFlags.Male)) { if (actor.SimDescription.CanAutonomouslyBeRomanticWithGender(CASAgeGenderFlags.Female)) { if (RandomUtil.CoinFlip()) { needFemale = true; } } else { needFemale = false; } } else if (actor.SimDescription.CanAutonomouslyBeRomanticWithGender(CASAgeGenderFlags.Female)) { needFemale = true; } else { needFemale = !actor.IsFemale; } List <SimDescription> randomList = new List <SimDescription>(); foreach (SimDescription sim in fullList) { if (sim.IsFemale != needFemale) { continue; } if (sim.Household == actor.Household) { continue; } string reason; GreyedOutTooltipCallback callback = null; if (!CommonSocials.CanGetRomantic(actor.SimDescription, sim, false, true, true, ref callback, out reason)) { if (callback != null) { Common.Notify(sim.FullName + Common.NewLine + callback()); } continue; } if (choices.ContainsValue(sim)) { continue; } randomList.Add(sim); } if (randomList.Count > 0) { choices.Add(i, RandomUtil.GetRandomObjectFromList(randomList)); } } return(choices); }
public override bool Run() { SimDescription hooker = null; Definition def = base.InteractionDefinition as Definition; if (def == null) { return(false); } try { StandardEntry(); if (!Target.StartComputing(this, SurfaceHeight.Table, true)) { StandardExit(); return(false); } Target.StartVideo(Computer.VideoType.Chat); base.AnimateSim("GenericTyping"); bool succeeded = true; if (base.DoTimedLoop(Computer.CheckWeather.kTimeToBrowse, ~(ExitReason.Replan | ExitReason.PlayIdle | ExitReason.ObjectStateChanged | ExitReason.MidRoutePushRequested | ExitReason.MaxSkillPointsReached | ExitReason.BuffFailureState | ExitReason.MoodFailure))) { Dictionary <int, SimDescription> potentials = GetPotentials(Actor); if (potentials.Values.Count > 0) { if (!def.mRandom) { hooker = new SimSelection(Common.Localize("OrderServices:Title"), Actor.SimDescription, potentials.Values, SimSelection.Type.ProfessionalServices, -1000).SelectSingle(); if (hooker == null) { Common.Notify(Common.Localize("Rendezvous:NoSelect", Actor.IsFemale)); succeeded = false; } } else { int val = 0; if (Actor.IsSelectable) { string text = StringInputDialog.Show(Common.Localize("OrderServices:Title"), Common.Localize("OrderServices:Prompt"), val.ToString()); if (string.IsNullOrEmpty(text)) { succeeded = false; } if (!int.TryParse(text, out val)) { SimpleMessageDialog.Show(Common.Localize("OrderServices:Title"), Common.Localize("Numeric:Error")); succeeded = false; } } else { val = Actor.FamilyFunds * 2 / 100; } if (val > Actor.FamilyFunds || val < Actor.FamilyFunds) { if (Actor.IsSelectable) { Common.Notify(Common.Localize("OrderServices:NoFunds", Actor.IsFemale)); } succeeded = false; } if (succeeded) { // how much sexy can we afford? bool allAbove = false; foreach (SimDescription sim in potentials.Values) { KamaSimtra skill = sim.SkillManager.GetSkill <KamaSimtra>(KamaSimtra.StaticGuid); if (skill == null) { continue; } if (skill.GetPayment() > Actor.FamilyFunds) { allAbove = true; } else { allAbove = false; } if (skill.GetPayment() > val) { continue; } hooker = sim; } if (hooker == null) { if (!allAbove) { if (Actor.IsSelectable) { Common.Notify(Common.Localize("OrderServices:StopBeingCheap")); } succeeded = false; } else { if (Actor.IsSelectable) { Common.Notify(Common.Localize("OrderServices:NoFunds", Actor.IsFemale)); } succeeded = false; } } } } } else { Common.Notify(Common.Localize("OrderServices:NoChoices", Actor.IsFemale)); succeeded = false; } } if (succeeded && hooker != null) { GetSimToLotEx(hooker, Actor.LotHome, def.mRandom); } Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false); StandardExit(); return(succeeded); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); return(false); } }
public static void Apply(Sim actor, Sim target, bool risky) { if (!Woohooer.Settings.mApplyBuffs) { return; } bool useTraitScoring = Woohooer.Settings.UsingTraitScoring; if ((actor == null) || (target == null)) { return; } Relationship relation = Relationship.Get(actor, target, false); if (relation == null) { return; } bool witnessed = false; if (useTraitScoring) { string reason; foreach (Sim sim in actor.LotCurrent.GetAllActors()) { if (!sim.IsHuman) { continue; } if ((sim == actor) || (sim == target)) { continue; } if (sim.RoomId != actor.RoomId) { continue; } if ((!CommonSocials.CanGetRomantic(sim.SimDescription, actor.SimDescription, out reason)) && (!CommonSocials.CanGetRomantic(sim.SimDescription, target.SimDescription, out reason))) { continue; } if (ScoringLookup.GetScore("LikeWatching", sim.SimDescription) > 0) { sim.BuffManager.AddElement(sVoyeur, sWoohooOrigin); witnessed = true; } else { sim.BuffManager.AddElement(BuffNames.Embarrassed, sWoohooOrigin); } } } Sim[] sims = new Sim[] { actor, target }; foreach (Sim sim in sims) { if (!sim.IsHuman) { continue; } if (useTraitScoring) { if (KamaSimtra.GetSkillLevel(sim.SimDescription) < 4) { if (ScoringLookup.GetScore("WorryAboutWoohoo", sim.SimDescription) > 0) { sim.BuffManager.AddElement(sWorryAboutWoohoo, sWoohooOrigin); } } } if (witnessed) { sim.BuffManager.AddElement(sWitnessed, sWoohooOrigin); } if (useTraitScoring) { if ((risky) && (!Woohooer.Settings.ReplaceWithRisky)) { int score = ScoringLookup.GetScore("LikeRisky", sim.SimDescription); if (score > 0) { sim.BuffManager.RemoveElement(sDislikeRisky); sim.BuffManager.AddElement(sLikeRisky, sWoohooOrigin); } else if (score < 0) { sim.BuffManager.RemoveElement(sLikeRisky); sim.BuffManager.AddElement(sDislikeRisky, sWoohooOrigin); } } } if (actor.Partner == target.SimDescription) { sim.BuffManager.AddElement(sLikePartner, sWoohooOrigin); } else if (sim.Partner != null) { if (useTraitScoring) { int score = ScoringLookup.GetScore("Monogamous", sim.SimDescription); if (score > 0) { sim.BuffManager.RemoveElement(sLikeAdultery); sim.BuffManager.AddElement(sDislikeAdultery, sWoohooOrigin); } else if (score < 0) { sim.BuffManager.RemoveElement(sDislikeAdultery); sim.BuffManager.AddElement(sLikeAdultery, sWoohooOrigin); } } } if ((useTraitScoring) && (!relation.AreRomantic())) { if (relation.LTR.Liking > 75) { int score = ScoringLookup.GetScore("LikeFriendWithBenefits", sim.SimDescription); if (score > 0) { sim.BuffManager.RemoveElement(sDislikeFriendWithBenefits); sim.BuffManager.AddElement(sLikeFriendWithBenefits, sWoohooOrigin); } else if (score < 0) { sim.BuffManager.RemoveElement(sLikeFriendWithBenefits); sim.BuffManager.AddElement(sDislikeFriendWithBenefits, sWoohooOrigin); } } else { int score = ScoringLookup.GetScore("LikeOneNightStand", sim.SimDescription); if (score > 0) { sim.BuffManager.RemoveElement(sDislikeOneNightStand); sim.BuffManager.AddElement(sLikeOneNightStand, sWoohooOrigin); } else if (score < 0) { sim.BuffManager.RemoveElement(sLikeOneNightStand); sim.BuffManager.AddElement(sDislikeOneNightStand, sWoohooOrigin); } } } } }
public static void OnWoohooed(Event e) { using (Common.TestSpan span = new Common.TestSpan(ScoringLookup.Stats, "Duration CommonWoohoo:OnWoohooed")) { WooHooEvent wEvent = e as WooHooEvent; if (wEvent == null) { return; } Sim actor = wEvent.Actor as Sim; if (actor == null) { return; } SimDescription targetDesc = null; Sim target = wEvent.TargetObject as Sim; if (target != null) { targetDesc = target.SimDescription; } else if (actor.SimDescription.IsPregnant) { targetDesc = SimDescription.Find(actor.SimDescription.Pregnancy.DadDescriptionId); } if (targetDesc == null) { return; } CommonWoohoo.WoohooLocation location = WoohooLocation.Bed; CommonWoohoo.WoohooStyle style = WoohooStyle.Safe; IWooHooDefinition woohoo = null; NRaasWooHooEvent customEvent = wEvent as NRaasWooHooEvent; if (customEvent != null) { location = customEvent.Location; style = customEvent.Style; } else { if (actor.CurrentInteraction != null) { woohoo = actor.CurrentInteraction.InteractionDefinition as IWooHooDefinition; if (woohoo == null) { if (actor.CurrentInteraction is Shower.TakeShower) { foreach (Sim sim in actor.LotCurrent.GetAllActors()) { if ((sim.CurrentInteraction != null) && (sim.CurrentInteraction.Target == actor)) { woohoo = sim.CurrentInteraction.InteractionDefinition as IWooHooDefinition; if (woohoo != null) { break; } } } } } if (woohoo != null) { location = woohoo.GetLocation(wEvent.ObjectUsed); style = woohoo.GetStyle(actor.CurrentInteraction); if ((style == WoohooStyle.Safe) && (Woohooer.Settings.ReplaceWithRisky)) { style = WoohooStyle.Risky; } } } if (wEvent.BedUsed != null) { if (wEvent.BedUsed is Tent) { location = WoohooLocation.Tent; } else if (wEvent.BedUsed is Igloo) { location = WoohooLocation.Igloo; } else if (wEvent.BedUsed is FairyHouse) { location = WoohooLocation.FairyHouse; } } else if ((woohoo == null) && (wEvent.ObjectUsed != null)) { foreach (WoohooLocationControl check in Common.DerivativeSearch.Find <WoohooLocationControl>()) { if (check.Matches(wEvent.ObjectUsed)) { location = check.Location; break; } } } } KamaSimtra.AddNotch(actor.SimDescription, targetDesc, actor.LotCurrent, location, style); Woohooer.Settings.AddCount(actor); WoohooBuffs.Apply(actor, target, style == WoohooStyle.Risky); KamaSimtraSettings.ServiceData data = KamaSimtra.Settings.GetServiceData(targetDesc.SimDescriptionId, true); if (data != null) { data.Dispose(); } } }