public override bool Run() { bool result = false; try { ProxyDefinition proxyDefinition = base.InteractionDefinition as ProxyDefinition; Vector3 slotPosition = Target.GetSlotPosition(Slot.RoutingSlot_0); if (Actor == WooHooer && !Actor.HasExitReason()) { if (!Target.SimLine.WaitForTurn(this, Actor, SimQueue.WaitBehavior.CutAheadOfLowerPrioritySims, ExitReason.Default, Toilet.kTimeToWaitInLine)) { return(result); } //float value1 = Actor.Motives.GetMotiveValue(CommodityKind.Bladder); //float value2 = WooHooee.Motives.GetMotiveValue(CommodityKind.Bladder); isSitting = (Actor.Position - slotPosition).Length() < (WooHooee.Position - slotPosition).Length(); //(value1 < Math.Min(0, value2)) || (value2 >= 0 && RandomUtil.CoinFlip()); ToiletStallWooHoo wooHoo = proxyDefinition.ProxyClone(WooHooee).CreateInstance(Target, WooHooee, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true) as ToiletStallWooHoo; wooHoo.LinkedInteractionInstance = this; wooHoo.WooHooer = WooHooer; wooHoo.WooHooee = WooHooee; wooHoo.isSitting = !isSitting; WooHooee.InteractionQueue.AddNext(wooHoo); } if (base.StartSync(!isSitting)) { if (!isSitting) { Actor.RouteToPointRadius(slotPosition, 1f); } if ((isSitting || Actor.WaitForSynchronizationLevelWithSim(LinkedInteractionInstance.InstanceActor, Sim.SyncLevel.Routed, 30f)) && Actor.RouteToSlot(Target, Slot.RoutingSlot_0)) { Actor.SynchronizationLevel = Sim.SyncLevel.Routed; base.StandardEntry(); StateMachineClient stateMachine = Target.GetStateMachine(Actor); if (SitDownAndWait(stateMachine)) { BuffInstance element = Actor.BuffManager.GetElement(BuffNames.ReallyHasToPee); if (element != null) { element.mTimeoutPaused = true; } base.BeginCommodityUpdates(); isWooHooing = !proxyDefinition.Makeout; bool skipFlush = false; if (isSitting) { Actor.EnableCensor(Sim.CensorType.FullHeight); base.FinishLinkedInteraction(false); skipFlush = !RelieveSelf(element); base.WaitForSyncComplete(); Actor.AutoEnableCensor(); Actor.BuffManager.UnpauseBuff(BuffNames.ImaginaryFriendFeelOfPorcelain); } else { string stateName = RandomUtil.GetRandomStringFromList(new string[] { "peeStanding", "clean" }); stateMachine.RequestState("x", stateName); Actor.EnableCensor(Sim.CensorType.FullHeight); TurnOnWooHooFx(); base.DoTimedLoop(RandomUtil.RandomFloatGaussianDistribution(5f, isWooHooing ? 15f : 10f)); if (!isWooHooing) { EventTracker.SendEvent(new SocialEvent(EventTypeId.kSocialInteraction, WooHooer, WooHooee, "Make Out", false, true, false, CommodityTypes.Undefined)); EventTracker.SendEvent(new SocialEvent(EventTypeId.kSocialInteraction, WooHooee, WooHooer, "Make Out", true, true, false, CommodityTypes.Undefined)); } else { EventTracker.SendEvent(EventTypeId.kWooHooed, WooHooer, Target); EventTracker.SendEvent(EventTypeId.kWooHooed, WooHooee, Target); CommonWoohoo.RunPostWoohoo(WooHooer, WooHooee, Target, proxyDefinition.GetStyle(this), proxyDefinition.GetLocation(Target), true); if (CommonPregnancy.IsSuccess(WooHooer, WooHooee, base.Autonomous, proxyDefinition.GetStyle(this))) { CommonPregnancy.Impregnate(WooHooer, WooHooee, base.Autonomous, proxyDefinition.GetStyle(this)); } WooHooer.BuffManager.AddElement(BuffNames.PublicWooHoo, Origin.FromWooHooInPublic); WooHooee.BuffManager.AddElement(BuffNames.PublicWooHoo, Origin.FromWooHooInPublic); } if (stateName == "clean") { stateMachine.RequestState("x", "putDown"); } RelieveSelf(element); base.EndCommodityUpdates(true); LinkedInteractionInstance.EndCommodityUpdates(true); } isWooHooing = false; Target.Cleanable.DirtyInc(Actor); bool autoFlush = !isSitting || Target.ToiletTuning.AutoFlushes; if (autoFlush || (!skipFlush && Target.ShouldFlush(Actor, base.Autonomous))) { Target.FlushToilet(Actor, stateMachine, !autoFlush); } if (Target.ShouldWashHands(Actor)) { Sink sink = Toilet.FindClosestSink(Actor); if (sink != null) { InteractionInstance interactionInstance = Sink.WashHands.Singleton.CreateInstance(sink, Actor, base.GetPriority(), false, true); Actor.InteractionQueue.PushAsContinuation(interactionInstance, false); } } result = true; } TurnOffCensorsAndFx(); stateMachine.RequestState("x", "Exit"); if (!isSitting) { base.FinishLinkedInteraction(true); if (result) { Relationship.Get(WooHooer, WooHooee, true).LTR.UpdateLiking(AllInOneBathroom.kLTRGainFromWoohooInAllInOneBathroom); } Actor.RouteAway(1f, 2f, false, new InteractionPriority(InteractionPriorityLevel.UserDirected), true, false, true, RouteDistancePreference.PreferFurthestFromRouteOrigin); } base.StandardExit(); } } } catch (ResetException) { throw; } catch (Exception exception) { Common.Exception(Actor, Target, exception); result = false; } return(result); }
public override bool Run() { try { ProxyDefinition definition = InteractionDefinition as ProxyDefinition; isMaster = (WooHooer == Actor); bool flag = false; if (Target.LockDoor) { return(false); } if (isMaster && !Actor.HasExitReason()) { if (!Target.mEnterLine.WaitForTurn(this, Actor, SimQueue.WaitBehavior.Default, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), 30f)) { return(false); } PhotoBooth.WooHoo entry = definition.ProxyClone(WooHooee).CreateInstance(Target, WooHooee, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true) as PhotoBooth.WooHoo; entry.LinkedInteractionInstance = this; entry.WooHooer = WooHooer; entry.WooHooee = WooHooee; WooHooee.InteractionQueue.AddNext(entry); } if (!SafeToSync()) { return(false); } if (!Target.RouteToAndEnterPhotoBooth(Actor, this, false, isMaster)) { if (isMaster) { Target.RemoveSims(); } return(false); } StandardEntry(false); Actor.LoopIdle(); if (!StartSync(isMaster)) { Target.RouteOutOfPhotoBooth(Actor, this, PhotoBooth.PhotoBoothExitType.Regular); StandardExit(false, false); return(false); } MotiveDelta[] deltaArray = new MotiveDelta[2]; deltaArray[0] = AddMotiveDelta(CommodityKind.Fun, 1500f); deltaArray[1] = AddMotiveDelta(CommodityKind.Social, 50f); BeginCommodityUpdates(); Target.LockDoor = true; if (isMaster) { Target.EnableFootprint(PhotoBooth.FootprintPathingHash); AcquireStateMachine("photobooth"); SetActorAndEnter("x", Actor, "EnterPhotoBooth"); SetActorAndEnter("y", WooHooee, "EnterPhotoBooth"); SetActor("PhotoBooth", Target); if (definition.Makeout) { AnimateJoinSims("MakeOut"); EventTracker.SendEvent(new SocialEvent(EventTypeId.kSocialInteraction, Actor, WooHooee, "Make Out", false, true, false, CommodityTypes.Undefined)); EventTracker.SendEvent(new SocialEvent(EventTypeId.kSocialInteraction, WooHooee, Actor, "Make Out", true, true, false, CommodityTypes.Undefined)); } else { isWooHooing = true; CommonWoohoo.TestNakedOutfit(Woohooer.Settings.mNakedOutfitPhotoBooth, WooHooer, WooHooee); AnimateJoinSims("WooHoo"); EventTracker.SendEvent(EventTypeId.kWoohooInPhotoBooth, Actor, Target); EventTracker.SendEvent(EventTypeId.kWoohooInPhotoBooth, WooHooee, Target); CommonWoohoo.RunPostWoohoo(Actor, WooHooee, Target, definition.GetStyle(this), definition.GetLocation(Target), true); if (CommonPregnancy.IsSuccess(WooHooer, WooHooee, Autonomous, definition.GetStyle(this))) { CommonPregnancy.Impregnate(WooHooer, WooHooee, Autonomous, definition.GetStyle(this)); } if (RandomUtil.RandomChance01(PhotoBooth.kChanceWooHooPicture)) { flag = true; } } isWooHooing = false; AnimateSim("ExitPhotoBooth"); AnimateNoYield("y", "ExitPhotoBooth"); } FinishLinkedInteraction(isMaster); WaitForSyncComplete(); if (isMaster) { Target.DisableFootprint(PhotoBooth.FootprintPathingHash); if (!definition.Makeout) { Relationship.Get(WooHooer, WooHooee, true).LTR.UpdateLiking(PhotoBooth.kLTRIncreaseOnWoohoo); } if (flag) { Target.RouteOutOfPhotoBooth(WooHooer, this, PhotoBooth.PhotoBoothExitType.ExitAndTear); } else { Target.RouteOutOfPhotoBooth(WooHooer, this, PhotoBooth.PhotoBoothExitType.Regular); } } else { Target.RouteOutOfPhotoBooth(Actor, this, PhotoBooth.PhotoBoothExitType.Regular); } EndCommodityUpdates(true); RemoveMotiveDelta(deltaArray[0x0]); RemoveMotiveDelta(deltaArray[0x1]); StandardExit(false, false); if (isMaster && flag) { WooHooer.BuffManager.AddElement(BuffNames.PublicWooHoo, Origin.FromWooHooInPublic); WooHooee.BuffManager.AddElement(BuffNames.PublicWooHoo, Origin.FromWooHooInPublic); WooHooee.ShowTNSIfSelectable(Localization.LocalizeString(WooHooee.IsFemale, "Gameplay/Objects/Entertainment/PhotoBooth:ToreUpPhotoEvidenceTNS", new object[] { WooHooee.FullName }), StyledNotification.NotificationStyle.kGameMessagePositive); WooHooer.ShowTNSIfSelectable(Localization.LocalizeString(WooHooer.IsFemale, "Gameplay/Objects/Entertainment/PhotoBooth:ToreUpPhotoEvidenceTNS", new object[] { WooHooer.FullName }), StyledNotification.NotificationStyle.kGameMessagePositive); } return(true); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); return(false); } }
public override bool Run() { try { ProxyDefinition definition = InteractionDefinition as ProxyDefinition; if (mIsMaster) { Actor.SynchronizationRole = Sim.SyncRole.Initiator; Actor.SynchronizationTarget = WooHooee; } else { Actor.SynchronizationRole = Sim.SyncRole.Receiver; Actor.SynchronizationTarget = WooHooer; } bool success = false; try { if (mIsMaster && !Actor.HasExitReason()) { ElevatorWooHoo entry = definition.ProxyClone(WooHooer).CreateInstance(Target, WooHooee, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true) as ElevatorWooHoo; entry.LinkedInteractionInstance = this; entry.WooHooer = WooHooer; entry.WooHooee = WooHooee; if (!WooHooee.InteractionQueue.AddNext(entry)) { return(false); } } if (!SafeToSync()) { return(false); } Actor.LoopIdle(); Actor.SynchronizationLevel = Sim.SyncLevel.NotStarted; if (!Actor.WaitForSynchronizationLevelWithSim(Actor.SynchronizationTarget, Sim.SyncLevel.NotStarted, ElevatorDoors.kWooHooSyncTime)) { FinishLinkedInteraction(mIsMaster); return(false); } if (!Target.RouteToElevator(Actor)) { FinishLinkedInteraction(mIsMaster); return(false); } Target.InteriorObj.AddElevatorColumnToUseList(Actor); Actor.RouteTurnToFace(Target.Position); Actor.LoopIdle(); Actor.SynchronizationLevel = Sim.SyncLevel.Started; if (!Actor.WaitForSynchronizationLevelWithSim(Actor.SynchronizationTarget, Sim.SyncLevel.Started, ElevatorDoors.kWooHooSyncTime)) { FinishLinkedInteraction(mIsMaster); return(false); } if (!Target.SimLine.WaitForTurn(this, SimQueue.WaitBehavior.CutToHeadOfLine, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), ElevatorDoors.kWooHooSyncTime)) { FinishLinkedInteraction(mIsMaster); return(false); } IsDoneRouting = true; CancellableByPlayer = false; Slot slotName = Slot.RoutingSlot_0; if (!mIsMaster) { slotName = Slot.RoutingSlot_1; } Actor.SimRoutingComponent.DisallowBeingPushed = true; Actor.SimRoutingComponent.ShouldIgnoreAllObstacles = true; if (!Actor.RouteToSlot(Target.InteriorObj, slotName)) { WanderOut(); FinishLinkedInteraction(mIsMaster); return(false); } Target.SimLine.RemoveFromQueue(Actor); Actor.LoopIdle(); Actor.SynchronizationLevel = Sim.SyncLevel.Routed; if (!Actor.WaitForSynchronizationLevelWithSim(Actor.SynchronizationTarget, Sim.SyncLevel.Routed, ElevatorDoors.kWooHooSyncTime)) { WanderOut(); FinishLinkedInteraction(mIsMaster); return(false); } IsInsideElevator = true; StandardEntry(false); Actor.LoopIdle(); Actor.SimDescription.Contactable = false; if (!StartSync(mIsMaster)) { WanderOut(); StandardExit(false); return(false); } success = true; } finally { if (!success) { definition.Definition.Restart(mIsMaster, WooHooer, WooHooee, Autonomous, Target); } } BeginCommodityUpdates(); try { if (mIsMaster) { AcquireStateMachine("Elevator"); SetActorAndEnter("x", Actor, "Enter"); SetActorAndEnter("y", WooHooee, "Enter"); SetActor("elevatorExterior", Target); success = true; if (Woohooer.Settings.UsingTraitScoring) { if (ScoringLookup.GetScore("ElevatorSuccess", Actor.SimDescription) < 0) { success = false; } else if (ScoringLookup.GetScore("ElevatorSuccess", WooHooee.SimDescription) < 0) { success = false; } } if (success) { isWooHooing = true; RockGemMetalBase.HandleNearbyWoohoo(Target, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo); AddOneShotScriptEventHandler(0x6e, WooHooTurnOnCensorBars); AddOneShotScriptEventHandler(0x6f, WooHooTurnOffCensorBars); mJealousyAlarm = AlarmManager.Global.AddAlarm(4f, TimeUnit.Minutes, StartJealousyBroadcaster, "StartJealousyBroadcaster", AlarmType.DeleteOnReset, Target); AnimateJoinSims("WooHooAccept"); CommonWoohoo.RunPostWoohoo(Actor, WooHooee, Target, definition.GetStyle(this), definition.GetLocation(Target), true); CommonWoohoo.TestNakedOutfit(Woohooer.Settings.mNakedOutfitElevator, WooHooer, WooHooee); if (CommonPregnancy.IsSuccess(WooHooer, WooHooee, Autonomous, definition.GetStyle(this))) { CommonPregnancy.Impregnate(WooHooer, WooHooee, Autonomous, definition.GetStyle(this)); } RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo); isWooHooing = false; } else { ElevatorDoors.WooHoo linkedInteractionInstance = LinkedInteractionInstance as ElevatorDoors.WooHoo; if (linkedInteractionInstance != null) { linkedInteractionInstance.IsFail = true; } AddOneShotScriptEventHandler(0x65, new SacsEventHandler(WooHooRejectCallback)); AnimateJoinSims("WooHooReject"); SpeedTrap.Sleep((uint)SimClock.ConvertToTicks(RandomUtil.RandomFloatGaussianDistribution(ElevatorDoors.kWooHooFailWaitTime[0x0], ElevatorDoors.kWooHooFailWaitTime[0x1]), TimeUnit.Minutes)); if (WooHooer.LotHome != Target.LotCurrent) { WooHooer.BuffManager.AddElement(BuffNames.WalkOfShame, Origin.FromRejectedWooHooOffHome); } Relationship.Get(WooHooee, WooHooer, true).LTR.UpdateLiking(ElevatorDoors.kWooHooRejectRelHit); } AnimateNoYield("y", "Exit"); AnimateSim("Exit"); } Actor.SynchronizationLevel = Sim.SyncLevel.Committed; Actor.WaitForSynchronizationLevelWithSim(Actor.SynchronizationTarget, Sim.SyncLevel.Committed, ElevatorDoors.kWooHooSyncTime); if (IsFail && !mIsMaster) { Actor.SetPosition(Target.InteriorObj.GetPositionOfSlot(Slot.RoutingSlot_0)); SpeedTrap.Sleep((uint)SimClock.ConvertToTicks(RandomUtil.RandomFloatGaussianDistribution(ElevatorDoors.kWooHooFailKickerOutWaitTime[0x0], ElevatorDoors.kWooHooFailKickerOutWaitTime[0x1]), TimeUnit.Minutes)); } Target.RouteToElevator(Actor); Actor.SynchronizationLevel = Sim.SyncLevel.Completed; Actor.WaitForSynchronizationLevelWithSim(Actor.SynchronizationTarget, Sim.SyncLevel.Completed, ElevatorDoors.kWooHooSyncTime); FinishLinkedInteraction(mIsMaster); WaitForSyncComplete(); } finally { EndCommodityUpdates(true); } StandardExit(false); return(true); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); return(false); } }
public override bool Run() { try { string str2; ProxyDefinition definition = InteractionDefinition as ProxyDefinition; bool flag2 = false; if (mIsMaster) { WooHooee.InteractionQueue.AddNext(new RouteToObject.Definition(WooHooer).CreateInstance(Target, WooHooee, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true)); flag2 = Target.RouteToMachine(Actor, false, null); } else { flag2 = Target.RouteToMachine(Actor, false, WooHooer); } if (!flag2) { Actor.AddExitReason(ExitReason.Finished); return(false); } if (mIsMaster && Target.ActorsUsingMe.Contains(WooHooee)) { return(false); } Actor.SimDescription.Contactable = false; StandardEntry(); EnterStateMachine("TimeMachine", "Enter", "x"); SetActor("timeMachine", Target); SetParameter("isFuture", definition.Definition.TimePeriod == TimeMachine.TravelTimePeriod.Future); Target.SetMaterial("InUse"); AddOneShotScriptEventHandler(0x66, ToggleHiddenAnimationEvent); if (mIsMaster) { AddOneShotScriptEventHandler(0x3ee, OnEnterAnimationEvent); } else { Target.EnableRoutingFootprint(Actor); } AnimateSim("GetIn"); if ((WooHooee == null) || WooHooee.HasBeenDestroyed) { AnimateSim("WooHoo"); Target.PushSimsFromFootprint(TimeMachine.sFootprintPathingHash, Actor, null, true); SpeedTrap.Sleep(0x64); string str; Target.PickExitStateAndSound(definition.Definition.TimePeriod, out str, out mExitSound); if (mIsMaster) { AddOneShotScriptEventHandler(0x3e9, OnExitAnimationEvent); AddOneShotScriptEventHandler(0x3ef, OnExitAnimationEvent); } AddOneShotScriptEventHandler(0x67, ToggleHiddenAnimationEvent); AnimateSim(str); Target.SetMaterial("default"); AnimateSim("Exit"); StandardExit(); return(true); } if (mIsMaster && !Actor.HasExitReason()) { TimeMachineWooHoo entry = definition.ProxyClone(WooHooer).CreateInstance(Target, WooHooee, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true) as TimeMachineWooHoo; entry.LinkedInteractionInstance = this; entry.WooHooer = WooHooer; entry.WooHooee = WooHooee; WooHooee.InteractionQueue.AddNext(entry); } isWooHooing = true; RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo); AnimateSim("WooHoo"); if (StartSync(mIsMaster)) { BeginCommodityUpdates(); try { DoTimedLoop(RandomUtil.GetFloat(TimeMachine.kWooHooMinutesMin, TimeMachine.kWooHooMinutesMax)); } finally { EndCommodityUpdates(true); } if (mIsMaster) { CommonWoohoo.TestNakedOutfit(Woohooer.Settings.mNakedOutfitTimeMachine, WooHooer, WooHooee); CommonWoohoo.RunPostWoohoo(Actor, WooHooee, Target, definition.GetStyle(this), definition.GetLocation(Target), true); do { SpeedTrap.Sleep(0xa); }while (Target.UseCount > 0x1); if (CommonPregnancy.IsSuccess(WooHooee, WooHooer, Autonomous, definition.GetStyle(this))) { if (WooHooer.IsMale) { Target.AddTryForBabyAlarm(WooHooer.SimDescription.SimDescriptionId, WooHooee.SimDescription.SimDescriptionId, definition.Definition.TimePeriod); } else { Target.AddTryForBabyAlarm(WooHooee.SimDescription.SimDescriptionId, WooHooer.SimDescription.SimDescriptionId, definition.Definition.TimePeriod); } } } } else if (mIsMaster) { Target.PushSimsFromFootprint(TimeMachine.sFootprintPathingHash, Actor, null, true); SpeedTrap.Sleep(0x64); if (LinkedInteractionInstance != null) { LinkedInteractionInstance.InstanceActor.AddExitReason(ExitReason.CanceledByScript); } do { SpeedTrap.Sleep(0xa); }while (Target.UseCount > 0x1); } Target.PickExitStateAndSound(definition.Definition.TimePeriod, out str2, out mExitSound); if (mIsMaster) { AddOneShotScriptEventHandler(0x3e9, new SacsEventHandler(OnExitAnimationEvent)); AddOneShotScriptEventHandler(0x3ef, new SacsEventHandler(OnExitAnimationEvent)); } AddOneShotScriptEventHandler(0x67, new SacsEventHandler(ToggleHiddenAnimationEvent)); AnimateSim(str2); Target.SetMaterial("default"); AnimateSim("Exit"); RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo); isWooHooing = false; StandardExit(); if (!mIsMaster) { Actor.RouteAway(1f, 3f, false, GetPriority(), Autonomous, false, true, RouteDistancePreference.PreferNearestToRouteOrigin); } return(true); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); return(false); } }