public void GetSimToLotEx(SimDescription simDesc, Lot actorHome, bool random) { bool success = SimEx.GetSimToSimHome(simDesc, base.Actor, new Callback(KamaSimtraSettings.ServiceData.GoToLotSuccessEx)); if (success) { if (random) { // someone will be over Common.Notify(Common.Localize("OrderServices:Success", Actor.IsFemale)); } else { // selected sim will be over Common.Notify(Common.Localize("OrderServices:SuccessSpecific", Actor.IsFemale, new object[] { "\"" + KamaSimtra.Settings.GetAlias(simDesc) + "\"" })); } } else { if (base.Actor.IsSelectable) { Phone.CallInviteOver.ShowInviteFailedDialog(this.GetInteractionName()); } return; } KamaSimtraSettings.ServiceData data = KamaSimtra.Settings.GetServiceData(base.Actor.SimDescription.SimDescriptionId, true); data.mRequester = base.Actor.SimDescription.SimDescriptionId; data.mProfessional = simDesc.SimDescriptionId; data.mWasRandom = random; KamaSimtra.Settings.SetServiceData(base.Actor.SimDescription.SimDescriptionId, data); }
public static void FixupProfessionalServices() { bool ksInstalled = Common.AssemblyCheck.IsInstalled("NRaasWoohooerKamaSimtra"); foreach (KeyValuePair <ulong, KamaSimtraSettings.ServiceData> data in KamaSimtra.Settings.sRequests) { bool dispose = !ksInstalled; KamaSimtraSettings.ServiceData dat = data.Value; if (dat.mProfessional != 0) { SimDescription proDesc = SimDescription.Find(dat.mProfessional); SimDescription clientDesc = SimDescription.Find(dat.mRequester); if (proDesc != null && proDesc.CreatedSim != null && clientDesc != null && clientDesc.CreatedSim != null) { if (proDesc.CreatedSim.LotCurrent != clientDesc.CreatedSim.LotHome) { if ((proDesc.CreatedSim.InteractionQueue != null && proDesc.CreatedSim.CurrentInteraction != null) && (proDesc.CreatedSim.RoutingComponent != null && proDesc.CreatedSim.RoutingComponent.GetDestinationLot() == clientDesc.LotHome)) { proDesc.CreatedSim.InteractionQueue.CancelInteraction(proDesc.CreatedSim.CurrentInteraction, false); } dispose = true; } } else { dispose = true; } } if (dispose) { dat.Dispose(); } else { dat.SetupAlarm(); } } }
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(); } } }