public override bool Run() { try { ISaunaWooHooDefinition definition = InteractionDefinition as ISaunaWooHooDefinition; if (!StartSync()) { DoResume(); return(false); } StandardEntry(false); mSauna = Actor.Posture.Container as SaunaClassic; if (Actor == mSauna.GetLeftSim()) { IHasSeatingGroup container = Actor.Posture.Container as IHasSeatingGroup; Seat seat = container.SeatingGroup[Actor]; Seat seat2 = container.SeatingGroup[Target]; if ((seat == null) || (seat2 == null)) { Actor.AddExitReason(ExitReason.FailedToStart); return(false); } // Custom string socialName = CommonWoohoo.GetSocialName(definition.GetStyle(this), Actor); ReturnInstance.EnsureMaster(); mCurrentStateMachine = ReturnInstance.mCurrentStateMachine; StartSocial(socialName); InitiateSocialUI(Actor, Target); SaunaClassic.CuddleSeatedWooHooSauna linkedInteractionInstance = LinkedInteractionInstance as SaunaClassic.CuddleSeatedWooHooSauna; linkedInteractionInstance.Rejected = Rejected; if (Rejected) { mCurrentStateMachine.RequestState(null, "Woo Hoo Reject"); mCurrentStateMachine.RequestState(null, "ExitSitting"); FinishSocial(socialName, true); FinishSocialContext(); Actor.BuffManager.AddElement(BuffNames.WalkOfShame, Origin.FromRejectedWooHooOffHome); } else { mCurrentStateMachine.RequestState(null, "ExitSitting"); // Custom CommonWoohoo.TestNakedOutfit(Woohooer.Settings.mNakedOutfitSaunaWoohoo, Actor, Target); if (Stand.Singleton.CreateInstance(mSauna, Actor, Actor.InheritedPriority(), false, false).RunInteraction()) { // Custom if (CommonWoohoo.NeedPrivacy(false, Actor, Target)) { mSituation = new WooHoo.WooHooPrivacySituation(this); mPrivacyFailed = !mSituation.Start(); } else { mPrivacyFailed = false; } linkedInteractionInstance.mPrivacyFailed = mPrivacyFailed; if (!mPrivacyFailed && Actor.RouteToSlot(mSauna, Slot.RoutingSlot_14)) { EnterStateMachine("Sauna_store", "SimEnter", "x"); SetActor("saunaX", seat.Host); SetActor("saunaY", seat2.Host); AddOneShotScriptEventHandler(0x384, OnAnimationEvent); AnimateSim("PourWater"); AnimateSim("SimExit"); if (SaunaSit.WoohooSingleton.CreateInstance(mSauna, Actor, Actor.InheritedPriority(), false, false).RunInteraction()) { RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo); EnterStateMachine("sauna_store", "SimEnter", "x", "y"); SetActor("saunaX", mSauna); mCurrentStateMachine.AddOneShotScriptEventHandler(0x6e, OnAnimationEvent); mCurrentStateMachine.AddOneShotScriptEventHandler(0x6f, OnAnimationEvent); mCurrentStateMachine.AddOneShotScriptEventHandler(0x78, OnAnimationEvent); mCurrentStateMachine.AddOneShotScriptEventHandler(0x79, OnAnimationEvent); mCurrentStateMachine.AddOneShotScriptEventHandler(0x70, OnBabyCheckEventEx); SetActor("saunaX", seat.Host); SetActor("saunaY", seat2.Host); if (Actor == mSauna.GetLeftSim()) { SetParameter("IsMirrored", true); SetParameter("SuffixX", mSauna.mSeatingGroup[Actor].IKSuffix); SetParameter("SuffixY", mSauna.mSeatingGroup[Target].IKSuffix); } else { SetParameter("IsMirrored", false); SetParameter("SuffixY", mSauna.mSeatingGroup[Actor].IKSuffix); SetParameter("SuffixX", mSauna.mSeatingGroup[Target].IKSuffix); } AnimateJoinSims("Woohoo"); AnimateJoinSims("SimExit"); RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo); // Custom CommonWoohoo.RunPostWoohoo(Actor, Target, mSauna, definition.GetStyle(this), definition.GetLocation(mSauna), true); Target.Motives.ChangeValue(CommodityKind.Fun, SaunaClassic.kWooHooFunBump); Target.Motives.ChangeValue(CommodityKind.Social, SaunaClassic.kWooHooSocialBump); Target.Motives.ChangeValue(CommodityKind.Hygiene, SaunaClassic.kWooHooHygieneBump); Actor.Motives.ChangeValue(CommodityKind.Fun, SaunaClassic.kWooHooFunBump); Actor.Motives.ChangeValue(CommodityKind.Social, SaunaClassic.kWooHooSocialBump); Actor.Motives.ChangeValue(CommodityKind.Hygiene, SaunaClassic.kWooHooHygieneBump); } } } FinishSocial(socialName, true); Actor.AddExitReason(ExitReason.StageComplete); Target.AddExitReason(ExitReason.StageComplete); } } else { DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached)); } FinishLinkedInteraction(IsMaster); bool succeeded = !Rejected && !mPrivacyFailed; EndCommodityUpdates(succeeded); StandardExit(false, false); InvokeDoResumeOnCleanup = false; if (!mPrivacyFailed) { Actor.SimDescription.SetFirstWooHoo(); } if ((Rejected && !IsMaster) && Stand.Singleton.CreateInstance(mSauna, Actor, Actor.InheritedPriority(), false, false).RunInteraction()) { Actor.PlayReaction(ReactionTypes.Embarrassed, ReactionSpeed.AfterInteraction); } WaitForSyncComplete(); return(!Rejected); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); return(false); } }
public override bool Run() { try { if (!StartSync()) { return(false); } bool flag2 = false; StandardEntry(false); BeginCommodityUpdates(); bool succeeded = false; try { if (IsMaster) { HotTubBase container = Actor.Posture.Container as HotTubBase; container.mSimsAreWooHooing = true; ReturnInstance.EnsureMaster(); mCurrentStateMachine = ReturnInstance.mCurrentStateMachine; IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;; string socialName = CommonWoohoo.GetSocialName(definition.GetStyle(this), Actor); StartSocial(socialName); Actor.SocialComponent.StartSocializingWith(Target); Dictionary <Sim, SocialRule> effects = new Dictionary <Sim, SocialRule>(); SocialEffect = Actor.Conversation.UpdateOnSelectingInteraction(Actor, Target, Autonomous, CommonWoohoo.GetSocialName(definition.GetStyle(this), Actor), null, null, effects); Rejected = (SocialEffect == null) || (!SocialEffect.LHS.IsSocialAccepted()); InitiateSocialUI(Actor, Target); (LinkedInteractionInstance as NestedCuddleInteraction).Rejected = Rejected; if (Rejected) { mCurrentStateMachine.RequestState(null, "Woo Hoo Reject"); mCurrentStateMachine.RequestState(null, "ExitSitting"); FinishSocial(socialName, true); FinishSocialContext(); Actor.BuffManager.AddElement(BuffNames.WalkOfShame, Origin.FromRejectedWooHooOffHome); } else { if (CommonWoohoo.NeedPrivacy(false, Actor, Target)) { mSituation = new WooHoo.WooHooPrivacySituation(this); flag2 = !mSituation.Start(); } if (!flag2) { RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo); mCurrentStateMachine.AddOneShotScriptEventHandler(0x6e, OnAnimationEvent); mCurrentStateMachine.AddOneShotScriptEventHandler(0x6f, OnAnimationEvent); mCurrentStateMachine.AddOneShotScriptEventHandler(0x78, OnAnimationEvent); mCurrentStateMachine.AddOneShotScriptEventHandler(0x79, OnAnimationEvent); mCurrentStateMachine.AddOneShotScriptEventHandler(0x70, OnBabyCheck); mCurrentStateMachine.RequestState(null, "Woo Hoo Accept"); PuddleManager.AddPuddle(Actor.Posture.Container.Position); RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo); CommonWoohoo.RunPostWoohoo(Actor, Target, container, definition.GetStyle(this), definition.GetLocation(container), true); } FinishSocial(socialName, true); } } else { DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached)); } FinishLinkedInteraction(IsMaster); succeeded = !Rejected && !flag2; } finally { EndCommodityUpdates(succeeded); StandardExit(false, false); } if (Rejected) { InvokeDoResumeOnCleanup = false; } else if (!mPrivacyFailed) { Actor.SimDescription.SetFirstWooHoo(); } WaitForSyncComplete(); return(!Rejected); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); return(false); } }