public ProxyDefinition(IWooHooProxyDefinition definition, Sim actor, IGameObject obj) : base(CommonWoohoo.GetSocialName(definition.GetStyle(null), actor), new string[0x0], null, false) { mDefinition = definition; mObject = obj; ChecksToSkip |= ActionData.ChecksToSkip.ProceduralTests; }
public override bool Run() { try { if (!SafeToSync()) { Common.Notify("Fail D"); return(false); } IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition; if (LinkedInteractionInstance == null) { HotairBalloon.WooHooSocial entry = definition.ProxyClone(Target).CreateInstance(Actor, Target, GetPriority(), Autonomous, CancellableByPlayer) as HotairBalloon.WooHooSocial; if (entry == null) { Common.Notify("Fail A"); return(false); } entry.mIsSocialTarget = true; LinkedInteractionInstance = entry; Target.InteractionQueue.AddNext(entry); } HotairBalloon.InBalloonPosture posture = Actor.Posture as HotairBalloon.InBalloonPosture; if (posture == null) { Common.Notify("Fail B"); return(false); } if (!StartSync(!mIsSocialTarget)) { Common.Notify("Fail C"); return(false); } StandardEntry(); BeginCommodityUpdates(); if (mIsSocialTarget) { DoLoop(ExitReason.Finished); } else { StartSocial(CommonWoohoo.GetSocialName(definition.GetStyle(this), Actor)); Animation.ForceAnimation(Actor.ObjectId, true); Animation.ForceAnimation(Target.ObjectId, true); if (Rejected) { Target.Posture.CurrentStateMachine.RequestState(true, "x", "ToFromSocial"); posture.CurrentStateMachine.RequestState(true, "x", "ToFromSocial"); posture.CurrentStateMachine.SetActor("y", Target); CreateProps(posture.CurrentStateMachine); posture.CurrentStateMachine.SetParameter("XSimR", posture.IsXActor ? YesOrNo.no : YesOrNo.yes); posture.CurrentStateMachine.EnterState("x", "EnterSocial"); posture.CurrentStateMachine.EnterState("y", "EnterSocial"); ThoughtBalloonManager.BalloonData bd = new ThoughtBalloonManager.DoubleBalloonData("balloon_woohoo", "balloon_question"); bd.BalloonType = ThoughtBalloonTypes.kSpeechBalloon; Actor.ThoughtBalloonManager.ShowBalloon(bd); posture.CurrentStateMachine.RequestState(false, "y", "woohoo rejected"); posture.CurrentStateMachine.RequestState(true, "x", "woohoo rejected"); bd = new ThoughtBalloonManager.BalloonData("balloon_woohoo"); bd.BalloonType = ThoughtBalloonTypes.kSpeechBalloon; bd.LowAxis = ThoughtBalloonAxis.kDislike; Target.ThoughtBalloonManager.ShowBalloon(bd); posture.CurrentStateMachine.RequestState(false, "y", "ExitSocial"); posture.CurrentStateMachine.RequestState(true, "x", "ExitSocial"); posture.CurrentStateMachine.RemoveActor(Target); Target.Posture.CurrentStateMachine.EnterState("x", "ToFromSocial"); posture.CurrentStateMachine.EnterState("x", "ToFromSocial"); Target.Posture.CurrentStateMachine.EnterState("x", "IdleStand"); posture.CurrentStateMachine.EnterState("x", "IdleStand"); Actor.GetRelationship(Target, true).LTR.UpdateLiking(HotairBalloon.kWoohooRejectLtrChange); SocialComponent.SetSocialFeedbackForActorAndTarget(CommodityTypes.Friendly, Actor, Target, false, 0x0, LongTermRelationshipTypes.Undefined, LongTermRelationshipTypes.Undefined); SocialCallback.AddRejectedByEx(Actor, Target, GetInteractionName(), null, this); } else { switch (posture.Balloon.mCurrentHeight) { case HotairBalloon.BalloonHeight.OnGround: posture.CurrentStateMachine.SetParameter("Height", SkillLevel.poor); break; case HotairBalloon.BalloonHeight.Height1: posture.CurrentStateMachine.SetParameter("Height", SkillLevel.novice); break; } Sim actor = posture.IsXActor ? Actor : Target; Sim sim2 = posture.IsXActor ? Target : Actor; actor.Posture.CurrentStateMachine.RequestState(true, "x", "ToFromSocial"); sim2.Posture.CurrentStateMachine.RequestState(true, "x", "ToFromSocial"); sim2.Posture.CurrentStateMachine.SetActor("y", actor); CreateProps(sim2.Posture.CurrentStateMachine); sim2.Posture.CurrentStateMachine.EnterState("x", "EnterSocial"); sim2.Posture.CurrentStateMachine.EnterState("y", "EnterSocial"); ThoughtBalloonManager.BalloonData data2 = new ThoughtBalloonManager.DoubleBalloonData("balloon_woohoo", "balloon_question"); data2.BalloonType = ThoughtBalloonTypes.kSpeechBalloon; Actor.ThoughtBalloonManager.ShowBalloon(data2); sim2.Posture.CurrentStateMachine.RequestState(false, "y", "woohoo"); sim2.Posture.CurrentStateMachine.RequestState(true, "x", "woohoo"); sim2.Posture.CurrentStateMachine.RequestState(false, "y", "ExitSocial"); sim2.Posture.CurrentStateMachine.RequestState(true, "x", "ExitSocial"); sim2.Posture.CurrentStateMachine.RemoveActor(actor); actor.Posture.CurrentStateMachine.EnterState("x", "ToFromSocial"); sim2.Posture.CurrentStateMachine.EnterState("x", "ToFromSocial"); Relationship relationship = Actor.GetRelationship(Target, true); relationship.STC.Update(Actor, Target, CommodityTypes.Amorous, HotairBalloon.kSTCIncreaseAfterWoohoo); relationship.LTR.UpdateLiking(-HotairBalloon.kWoohooRejectLtrChange); CommonWoohoo.RunPostWoohoo(Actor, Target, posture.Balloon, definition.GetStyle(this), definition.GetLocation(posture.Balloon), true); if (CommonPregnancy.IsSuccess(Actor, Target, Autonomous, definition.GetStyle(this))) { CommonPregnancy.Impregnate(Actor, Target, Autonomous, definition.GetStyle(this)); } actor.Posture.CurrentStateMachine.EnterState("x", "IdleStand"); sim2.Posture.CurrentStateMachine.EnterState("x", "IdleStand"); Actor.BuffManager.AddElement((BuffNames)(0x9a7f5f1919df0036L), Origin.None); Target.BuffManager.AddElement((BuffNames)(0x9a7f5f1919df0036L), Origin.None); } FinishSocial(CommonWoohoo.GetSocialName(definition.GetStyle(this), Actor), Rejected); Target.AddExitReason(ExitReason.Finished); } FinishLinkedInteraction(mIsSocialTarget); EndCommodityUpdates(Rejected); StandardExit(); WaitForSyncComplete(); posture.Balloon.PushIdleInteractionOnSim(Actor); return(true); } catch (ResetException) { throw; } catch (Exception exception) { Woohooer.Settings.AddChange(Actor); Woohooer.Settings.AddChange(Target); Common.Exception(Actor, Target, exception); 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); } }
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() { Common.StringBuilder msg = new Common.StringBuilder("ShowerWoohoo:Run" + Common.NewLine); try { IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition; Actor.BuffManager.RemoveElement(BuffNames.RobotForm); mSwitchOutfitHelper = new Sim.SwitchOutfitHelper(Actor, Sim.ClothesChangeReason.GoingToBathe); mSwitchOutfitHelper.Start(); if (WaitForBToEnterShower) { //Actor.RouteToObjectRadialRange(Shower, 1.5f, 4f); SpeedTrap.Sleep(0xa); while (Shower.SimInShower != Target) { if ((Target.InteractionQueue.GetCurrentInteraction() != TakeShowerInst) || Target.HasExitReason(ExitReason.Canceled)) { mSwitchOutfitHelper.Dispose(); return(false); } SpeedTrap.Sleep(0xa); } } msg += "A"; if (!Actor.RouteToSlot(Shower, Slot.RoutingSlot_0)) { mSwitchOutfitHelper.Dispose(); return(false); } msg += "B"; mSwitchOutfitHelper.Wait(true); bool flag = Actor.GetCurrentOutfitCategoryFromOutfitInGameObject() == OutfitCategories.Singed; Shower.AddToUseList(Actor); mInUseList = true; mCurrentStateMachine = TakeShowerInst.mCurrentStateMachine; SetActorAndEnter("y", Actor, "Enter"); if (!WaitForBToEnterShower) { mCurrentStateMachine.RequestState("y", "Ask"); } msg += "C"; string socialName = CommonWoohoo.GetSocialName(definition.GetStyle(this), Actor); StartSocial(socialName); if (WaitForBToEnterShower) { Rejected = false; } InitiateSocialUI(Actor, Target); msg += "D"; bool succeeded = true; if (Rejected) { succeeded = false; mCurrentStateMachine.RequestState("y", "Reject"); mCurrentStateMachine.RemoveActor(Actor); FinishSocial(socialName, true); Actor.BuffManager.AddElement(BuffNames.WalkOfShame, Origin.FromRejectedWooHooOffHome); } else { mCurrentStateMachine.RequestState("y", "ShooSims"); SetParameter("SimShouldClothesChange", !flag && !Actor.OccultManager.DisallowClothesChange()); mSwitchOutfitHelper.AddScriptEventHandler(this); Actor.LoopIdle(); msg += "E"; if (CommonWoohoo.NeedPrivacy(Shower.IsOutside, Actor, Target)) { mSituation = new BedWoohoo.WooHooPrivacySituation(this); if (!mSituation.Start()) { mSwitchOutfitHelper.Dispose(); succeeded = false; } } msg += "F"; if ((succeeded) && (Actor.RouteToSlot(Shower, Slot.RoutingSlot_0))) { MotiveDelta[] deltaArray = new MotiveDelta[6]; deltaArray[0] = AddMotiveDelta(CommodityKind.Fun, 1500f); deltaArray[1] = TakeShowerInst.AddMotiveDelta(CommodityKind.Fun, 1500f); deltaArray[2] = AddMotiveDelta(CommodityKind.Social, 50f); deltaArray[3] = TakeShowerInst.AddMotiveDelta(CommodityKind.Social, 50f); if (Actor.SimDescription.IsPlantSim) { deltaArray[4] = AddMotiveDelta(CommodityKind.Hygiene, 800f * Sims3.Gameplay.Objects.Plumbing.Shower.kPlantSimHygieneModifier); } else { deltaArray[4] = AddMotiveDelta(CommodityKind.Hygiene, 800f); } if (Actor.SimDescription.IsMermaid) { deltaArray[5] = AddMotiveDelta(CommodityKind.MermaidDermalHydration, 800f); } Target.EnableCensor(Sim.CensorType.FullHeight); RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo); mCurrentStateMachine.AddOneShotScriptEventHandler(0x65, OnJealousyEvent); mCurrentStateMachine.AddOneShotScriptEventHandler(0x66, OnAnimationEvent); if (CommonPregnancy.IsSuccess(Actor, Target, Autonomous, definition.GetStyle(this))) { mCurrentStateMachine.AddOneShotScriptEventHandler(0x67, OnPregnancyEvent); } msg += "G"; mSteamVfx = VisualEffect.Create(Shower.SteamVfxName); mSteamVfx.ParentTo(Shower, Shower.IsShowerTub ? Slot.FXJoint_2 : Slot.FXJoint_0); mSteamVfx.Start(); mCurrentStateMachine.RequestState(null, "BreatheIdle"); RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo); CommonWoohoo.RunPostWoohoo(Actor, Target, Shower, definition.GetStyle(this), definition.GetLocation(Shower), true); msg += "H"; Sims3.Gameplay.Objects.Plumbing.Shower.WaitToLeaveShower(Actor, Shower); // Custom ShowerEx.ApplyPostShowerEffects(Actor, Shower); if (flag) { mSwitchOutfitHelper.Dispose(); mSwitchOutfitHelper = new Sim.SwitchOutfitHelper(Actor, Sim.ClothesChangeReason.GoingToBathe); mSwitchOutfitHelper.Start(); mSwitchOutfitHelper.Wait(false); mSwitchOutfitHelper.ChangeOutfit(); } msg += "I"; mSwitchOutfitHelper.Dispose(); mSwitchOutfitHelper = new Sim.SwitchOutfitHelper(Actor, Sim.ClothesChangeReason.GettingOutOfBath); mSwitchOutfitHelper.Start(); mSwitchOutfitHelper.AddScriptEventHandler(this); mSwitchOutfitHelper.Wait(false); RemoveMotiveDelta(deltaArray[0x0]); TakeShowerInst.RemoveMotiveDelta(deltaArray[0x1]); RemoveMotiveDelta(deltaArray[0x2]); TakeShowerInst.RemoveMotiveDelta(deltaArray[0x3]); RemoveMotiveDelta(deltaArray[0x4]); if (Actor.SimDescription.IsMermaid) { RemoveMotiveDelta(deltaArray[0x5]); } mCurrentStateMachine.RequestState("y", "Exit Working Y"); Target.AutoEnableCensor(); msg += "J"; } mCurrentStateMachine.RemoveActor(Actor); FinishSocial(socialName, true); } msg += "K"; Shower.RemoveFromUseList(Actor); mInUseList = false; Actor.RouteAway(Sims3.Gameplay.Objects.Plumbing.Shower.kMinDistanceToMoveAwayFromShower, Sims3.Gameplay.Objects.Plumbing.Shower.kMaxDistanceToMoveAwayFromShower, false, GetPriority(), true, true, true, RouteDistancePreference.PreferFurthestFromRouteOrigin); if (mSteamVfx != null) { mSteamVfx.Stop(); mSteamVfx = null; } msg += "L"; EndCommodityUpdates(succeeded); return(succeeded); } catch (ResetException) { throw; } catch (Exception exception) { Common.Exception(Actor, Target, exception); return(false); } finally { if (TakeShowerInst != null) { TakeShowerInst.HavingWooHoo = false; } } }