public override bool Run() { try { StandardEntry(false); mSwitchOutfitHelper = new Sim.SwitchOutfitHelper(Actor, Sim.ClothesChangeReason.GoingToSwim, OutfitCategories.Naked); mSwitchOutfitHelper.Start(); mSwitchOutfitHelper.Wait(false); HotTubSeat partSimIsIn = Target.PartComponent.GetPartSimIsIn(Actor) as HotTubSeat; mCurrentStateMachine = Actor.Posture.CurrentStateMachine; SetParameter("IkSuffix", partSimIsIn.IKSuffix); BeginCommodityUpdates(); AnimateSim("Change To Naked"); mSwitchOutfitHelper.ChangeOutfit(); // Custom HotTubBaseEx.StartSkinnyDipBroadcastersAndSendWishEvents(Target, Actor); partSimIsIn.CreateClothingPile(); Actor.BridgeOrigin = Actor.Posture.Idle(); EndCommodityUpdates(true); Target.PushRelaxInteraction(Actor, Autonomous); StandardExit(false, false); return(true); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); return(false); } }
public override bool Run() { try { Definition interactionDefinition = InteractionDefinition as Definition; bool isSkinnyDipping = interactionDefinition.IsSkinnyDipping || (Actor.CurrentOutfitCategory == OutfitCategories.SkinnyDippingTowel); pickSeat(); if (isSkinnyDipping) { mSwitchOutfitHelper = new Sim.SwitchOutfitHelper(Actor, Sim.ClothesChangeReason.GoingToSwim, OutfitCategories.Naked, false); } else { mSwitchOutfitHelper = new Sim.SwitchOutfitHelper(Actor, Sim.ClothesChangeReason.GoingToSwim); } mSwitchOutfitHelper.Start(); Slot none = Slot.None; if (!RouteToHottub(out none)) { return(false); } HotTubSeat part = Target.PartComponent.GetPart(none) as HotTubSeat; if (part.InUse && !MoveSimToDifferentSeat(part)) { return(false); } if (Target.Repairable.Broken) { return(false); } StandardEntry(); BeginCommodityUpdates(); if (Actor.HasTrait(TraitNames.Hydrophobic)) { Actor.PlayReaction(ReactionTypes.WhyMe, Target, ReactionSpeed.ImmediateWithoutOverlay); } // Custom bool succeeded = HotTubBaseEx.SitDown(Target, Actor, none, part, mSwitchOutfitHelper, isSkinnyDipping, InvitedBy, Autonomous); if (succeeded) { if (Actor.HasExitReason(ExitReason.CancelledByPosture)) { InteractionInstance cancelTransition = Actor.Posture.GetCancelTransition(); Actor.InteractionQueue.PushAsContinuation(cancelTransition, true); } else { if ((!Target.Repairable.Broken && !Target.Repairable.UpdateBreakage(Actor)) && Actor.HasTrait(TraitNames.Hydrophobic)) { Actor.BuffManager.AddElementPaused(BuffNames.Hydrophobic, Origin.FromHotTub); } Target.PushRelaxInteraction(Actor, Autonomous); } } StandardExit(!succeeded, !succeeded); EndCommodityUpdates(succeeded); if (mIsMaster) { HotTubGetIn linked = LinkedInteractionInstance as HotTubGetIn; if (linked != null) { Sim linkedActor = linked.Actor; while (!Cancelled) { if (!linkedActor.InteractionQueue.HasInteraction(linked)) { break; } if (linked.mCompleted) { break; } SpeedTrap.Sleep(10); } } } return(true); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); return(false); } }