Beispiel #1
0
        public override bool Run()
        {
            try
            {
                int num;
                if ((WoohooObject == null) || !WoohooObject.CanWooHooIn())
                {
                    return(false);
                }
                if (!SafeToSync())
                {
                    return(false);
                }

                LeafPile.WoohooInPileOrStackB entry = LeafPile.WoohooInPileOrStackB.Singleton.CreateInstance(Actor, Target, GetPriority(), Autonomous, CancellableByPlayer) as LeafPile.WoohooInPileOrStackB;
                entry.LinkedInteractionInstance = this;
                if (!Target.InteractionQueue.Add(entry))
                {
                    Common.DebugNotify("LeafPileBaseWoohoo Add Fail");
                    return(false);
                }

                Actor.SynchronizationLevel  = Sim.SyncLevel.Started;
                Actor.SynchronizationTarget = Target;
                Actor.SynchronizationRole   = Sim.SyncRole.Initiator;
                if (!WoohooObject.SimLine.WaitForTurn(this, SimQueue.WaitBehavior.Default, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), 10f))
                {
                    return(false);
                }

                Slot[] routingSlots = WoohooObject.GetRoutingSlots();
                if (!Actor.RouteToSlotListAndCheckInUse(WoohooObject, routingSlots, out num))
                {
                    return(false);
                }

                if (!WoohooObject.CanWooHooIn())
                {
                    return(false);
                }

                CommonWoohoo.TestNakedOutfit(UsingNakedOutfit, Actor, Target);

                mActorXRoutingSlot = routingSlots[num];
                StandardEntry();
                WoohooObject.AddToUseList(Actor);
                WoohooObject.AddToUseList(Target);
                BeginCommodityUpdates();
                EnterStateMachine(WoohooObject.JazzFileName, "Enter", "x");
                AddOneShotScriptEventHandler(0x65, PlayEffectsHandlerX);
                AddOneShotScriptEventHandler(0x78, AnimCallbackSimX);
                SetActor(WoohooObject.JazzObjectName, WoohooObject);
                Animate("x", "GetInStackX");
                WoohooObject.SimLine.RemoveFromQueue(Actor);
                if (!Actor.WaitForSynchronizationLevelWithSim(Target, Sim.SyncLevel.Routed, 30f))
                {
                    AddOneShotScriptEventHandler(0x65, PlayEffectsHandlerX);
                    AddOneShotScriptEventHandler(0x66, PlayEffectsHandlerX);
                    AddOneShotScriptEventHandler(0x6e, AnimCallbackSimX);
                    AddOneShotScriptEventHandler(0x79, AnimCallbackSimX);
                    Animate("x", "GetOut");
                    Animate("x", "Exit");
                    WoohooObject.RemoveFromUseList(Actor);
                    WoohooObject.RemoveFromUseList(Target);
                    EndCommodityUpdates(false);
                    StandardExit();
                    return(false);
                }

                mActorYRoutingSlot = (Slot)(LinkedInteractionInstance as LeafPile.WoohooInPileOrStackB).RoutedSlot;

                RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo);
                SetActor("y", Target);
                EnterState("y", "Enter");
                AddOneShotScriptEventHandler(0x65, PlayEffectsHandlerY);
                AddOneShotScriptEventHandler(0x78, AnimCallbackSimY);
                Animate("y", "GetInStackY");
                if (mReactToSocialBroadcasterActor == null)
                {
                    mReactToSocialBroadcasterActor = new ReactionBroadcaster(Actor, Conversation.ReactToSocialParams, SocialComponentEx.ReactToJealousEventHigh);
                    CommonWoohoo.CheckForWitnessedCheating(Actor, Target, true);
                }

                if (mReactToSocialBroadcasterTarget == null)
                {
                    mReactToSocialBroadcasterTarget = new ReactionBroadcaster(Target, Conversation.ReactToSocialParams, SocialComponentEx.ReactToJealousEventHigh);
                    CommonWoohoo.CheckForWitnessedCheating(Target, Actor, true);
                }

                AnimateJoinSims("Woohoo");
                (WoohooObject as GameObject).PushSimsFromFootprint((uint)mActorXRoutingSlot, Actor, null, true);
                AddOneShotScriptEventHandler(0x65, PlayEffectsHandlerX);
                AddOneShotScriptEventHandler(0x66, PlayEffectsHandlerX);
                AddOneShotScriptEventHandler(0x6e, AnimCallbackSimX);
                AddOneShotScriptEventHandler(0x79, AnimCallbackSimX);
                AnimateJoinSims("GetOutX");
                List <Sim> exceptions = new List <Sim>();
                exceptions.Add(Actor);
                (WoohooObject as GameObject).PushSimsFromFootprint((uint)mActorYRoutingSlot, Target, exceptions, true);
                if (mActorYRoutingSlot == mActorXRoutingSlot)
                {
                    Actor.Wander(1f, 2f, false, RouteDistancePreference.PreferFurthestFromRouteOrigin, true);
                }
                AddOneShotScriptEventHandler(0x65, PlayEffectsHandlerY);
                AddOneShotScriptEventHandler(0x66, PlayEffectsHandlerY);
                AddOneShotScriptEventHandler(0x6e, AnimCallbackSimY);
                AddOneShotScriptEventHandler(0x79, AnimCallbackSimY);
                AnimateJoinSims("GetOutY");
                AnimateJoinSims("Exit");
                RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo);

                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

                CommonWoohoo.RunPostWoohoo(Actor, Target, WoohooObject, definition.GetStyle(this), definition.GetLocation(WoohooObject), true);

                if (CommonPregnancy.IsSuccess(Actor, Target, Autonomous, definition.GetStyle(this)))
                {
                    Pregnancy pregnancy = CommonPregnancy.Impregnate(Actor, Target, Autonomous, definition.GetStyle(this));
                    if (pregnancy != null)
                    {
                        if (RandomUtil.RandomChance(WoohooObject.ChanceBabyGetsLovesOutdoorsTrait))
                        {
                            pregnancy.SetForcedBabyTrait(TraitNames.LovesTheOutdoors);
                        }
                    }
                }

                WoohooObject.RemoveFromUseList(Actor);
                WoohooObject.RemoveFromUseList(Target);
                EndCommodityUpdates(true);
                StandardExit();

                VisitSituation situation  = VisitSituation.FindVisitSituationInvolvingGuest(Actor);
                VisitSituation situation2 = VisitSituation.FindVisitSituationInvolvingGuest(Target);
                if ((situation != null) && (situation2 != null))
                {
                    situation.GuestStartingInappropriateAction(Actor, 3.5f);
                    situation2.GuestStartingInappropriateAction(Target, 3.5f);
                }

                if (RandomUtil.RandomChance(WoohooObject.ChanceGetRollInHayBuff))
                {
                    Actor.BuffManager.AddElement(BuffNames.RolledInTheHay, Origin.FromWooHooInHayStack);
                    Target.BuffManager.AddElement(BuffNames.RolledInTheHay, Origin.FromWooHooInHayStack);
                }

                Relationship.Get(Actor, Target, true).LTR.UpdateLiking(WoohooObject.LTRGain);
                EventTracker.SendEvent(WoohooObject.WooHooEventID, Actor, Target);
                EventTracker.SendEvent(WoohooObject.WooHooEventID, Target, Actor);
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
        }
Beispiel #2
0
        public override bool Run()
        {
            try
            {
                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

                if (WoohooObject == null)
                {
                    return(false);
                }

                if (!SafeToSync())
                {
                    return(false);
                }

                AllInOneBathroom.WoohooInAllInOneBathroomB entry = AllInOneBathroom.WoohooInAllInOneBathroomB.Singleton.CreateInstance(Actor, Target, GetPriority(), Autonomous, CancellableByPlayer) as AllInOneBathroom.WoohooInAllInOneBathroomB;
                entry.TryForBaby = TryForBaby;
                entry.LinkedInteractionInstance = this;
                Target.InteractionQueue.Add(entry);
                Actor.SynchronizationLevel  = Sim.SyncLevel.Started;
                Actor.SynchronizationTarget = Target;
                Actor.SynchronizationRole   = Sim.SyncRole.Initiator;
                if (!WoohooObject.SimLine.WaitForTurn(this, SimQueue.WaitBehavior.Default, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), 10f))
                {
                    return(false);
                }

                if (!Actor.RouteToSlotAndCheckInUse(WoohooObject, Slot.RoutingSlot_1))
                {
                    return(false);
                }

                StandardEntry();
                WoohooObject.AddToUseList(Actor);
                WoohooObject.AddToUseList(Target);
                BeginCommodityUpdates();

                if (!Actor.WaitForSynchronizationLevelWithSim(Target, Sim.SyncLevel.Routed, 30f))
                {
                    WoohooObject.RemoveFromUseList(Actor);
                    WoohooObject.RemoveFromUseList(Target);
                    EndCommodityUpdates(false);
                    StandardExit();
                    return(false);
                }

                EnterStateMachine("AllInOneBathroom", "Enter", "x");
                SetActor("bathroom", WoohooObject);
                SetActor("y", Target);
                AddOneShotScriptEventHandler(0x64, AnimationCallback);
                AddOneShotScriptEventHandler(0x65, AnimationCallback);
                RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo);

                if (mReactToSocialBroadcasterActor == null)
                {
                    mReactToSocialBroadcasterActor = new ReactionBroadcaster(Actor, Conversation.ReactToSocialParams, SocialComponentEx.ReactToJealousEventHigh);
                }

                if (mReactToSocialBroadcasterTarget == null)
                {
                    mReactToSocialBroadcasterTarget = new ReactionBroadcaster(Target, Conversation.ReactToSocialParams, SocialComponentEx.ReactToJealousEventHigh);
                }

                Animate("x", "WooHoo");

                List <Sim> exceptions = new List <Sim>();
                exceptions.Add(Target);
                WoohooObject.PushSimsFromFootprint(0x31229a4d, Actor, exceptions, true);
                WoohooObject.PushSimsFromFootprint(0x31229a4e, Actor, exceptions, true);
                Animate("x", "Exit");

                RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo);

                CommonWoohoo.RunPostWoohoo(Actor, Target, WoohooObject, definition.GetStyle(this), definition.GetLocation(WoohooObject), true);

                if (CommonPregnancy.IsSuccess(Actor, Target, Autonomous, definition.GetStyle(this)))
                {
                    Pregnancy pregnancy = CommonPregnancy.Impregnate(Actor, Target, Autonomous, definition.GetStyle(this));
                    if (pregnancy != null)
                    {
                        if (RandomUtil.RandomChance(AllInOneBathroom.kChanceOfHydrophobicTrait))
                        {
                            pregnancy.SetForcedBabyTrait(TraitNames.Hydrophobic);
                        }
                    }
                }

                WoohooObject.RemoveFromUseList(Actor);
                WoohooObject.RemoveFromUseList(Target);
                WoohooObject.SimLine.RemoveFromQueue(Actor);
                EndCommodityUpdates(true);
                StandardExit();

                EventTracker.SendEvent(EventTypeId.kWooHooInAllInOneBathroom, Actor, Target);

                VisitSituation situation  = VisitSituation.FindVisitSituationInvolvingGuest(Actor);
                VisitSituation situation2 = VisitSituation.FindVisitSituationInvolvingGuest(Target);
                if ((situation != null) && (situation2 != null))
                {
                    situation.GuestStartingInappropriateAction(Actor, 3.5f);
                    situation2.GuestStartingInappropriateAction(Target, 3.5f);
                }

                Relationship.Get(Actor, Target, true).LTR.UpdateLiking(AllInOneBathroom.kLTRGainFromWoohooInAllInOneBathroom);
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
        }