Exemple #1
0
        protected void OnPregnancyEvent(StateMachineClient sender, IEvent evt)
        {
            IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

            switch (definition.GetStyle(this))
            {
            case CommonWoohoo.WoohooStyle.Safe:
                CommonSurrogate.DonateDNA(Actor, Target);
                return;

            case CommonWoohoo.WoohooStyle.Risky:
            case CommonWoohoo.WoohooStyle.TryForBaby:
                CommonSurrogatePregnancy.GetDNASamples(Actor, Target, ref dnaMale, ref dnaFemale);
                break;
            }

            if (CommonSurrogatePregnancy.IsSuccess(Actor, Target, Autonomous, definition.GetStyle(this)))
            {
                Pregnancy pregnancy = CommonSurrogatePregnancy.Impregnate(Actor, Target, dnaFemale, dnaMale, Autonomous, definition.GetStyle(this));

                if (pregnancy != null)
                {
                    if (Actor.Posture.Container is HeartShapedBed)
                    {
                        pregnancy.SetForcedBabyTrait(TraitNames.Excitable);
                    }
                    else if (Actor.Posture.Container is Igloo)
                    {
                        pregnancy.SetForcedBabyTrait(TraitNames.LovesTheCold);
                    }
                }
            }
        }
Exemple #2
0
        private void FirePreggoEx(StateMachineClient sender, IEvent evt)
        {
            IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

            if (CommonPregnancy.IsSuccess(mWoohooer, mWoohooee, Autonomous, definition.GetStyle(this)))
            {
                CommonPregnancy.Impregnate(mWoohooer, mWoohooee, Autonomous, definition.GetStyle(this));
            }
        }
Exemple #3
0
        public override bool Run()
        {
            try
            {
                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

                if (mWoohooee == null)
                {
                    mWoohooee = definition.ITarget(this);
                }

                Tutorialette.TriggerLesson(Lessons.FutureTravel, Actor);

                List <Sim> followersFromSelectedObjects = new List <Sim>();
                followersFromSelectedObjects.Add(mWoohooee);

                bool flag = mDestination.RouteOutside(Actor, followersFromSelectedObjects);

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

                Actor.BuffManager.AddElement(BuffNames.MissedMyStop, Origin.FromWooHooOnHoverTrain);

                if (CommonPregnancy.IsSuccess(Actor, mWoohooee, Autonomous, definition.GetStyle(this)))
                {
                    CommonPregnancy.Impregnate(Actor, mWoohooee, Autonomous, definition.GetStyle(this));
                }

                mWoohooee.BuffManager.AddElement(BuffNames.MissedMyStop, Origin.FromWooHooOnHoverTrain);

                return(flag);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
        }
Exemple #4
0
        public override string GetInteractionName()
        {
            if ((WooHooer != null) && (WooHooee != null))
            {
                Sim sim = (Actor == WooHooer) ? WooHooee : WooHooer;

                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;
                if (definition != null)
                {
                    string name = (definition.GetStyle(this) == CommonWoohoo.WoohooStyle.TryForBaby) ? "TryForBabyWith" : "WooHooWith";
                    return(ActorTrailer.LocalizeString(name, new object[] { sim }));
                }
            }

            InteractionInstanceParameters parameters = GetInteractionParameters();

            return(InteractionDefinition.GetInteractionName(ref parameters));
        }
Exemple #5
0
        protected void OnBabyCheck(StateMachineClient smc, IEvent evt)
        {
            IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

            if (CommonPregnancy.IsSuccess(Actor, Target, Autonomous, definition.GetStyle(this)))
            {
                Pregnancy pregnancy = CommonPregnancy.Impregnate(Actor, Target, Autonomous, definition.GetStyle(this));
                if (pregnancy != null)
                {
                    HotTubBase container = Actor.Posture.Container as HotTubBase;

                    switch (RandomUtil.GetWeightedIndex(container.BabyTraitChance))
                    {
                    case 1:
                        pregnancy.SetForcedBabyTrait(TraitNames.Hydrophobic);
                        break;

                    case 2:
                        pregnancy.SetForcedBabyTrait(TraitNames.PartyAnimal);
                        break;
                    }
                }
            }
        }
Exemple #6
0
        public override bool Run()
        {
            try
            {
                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

                if ((mWardrobe == null) || (mOtherWooHoo == null))
                {
                    return(false);
                }

                if (!mWardrobe.SimLine.WaitForTurn(this, SimQueue.WaitBehavior.Default, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), 10f))
                {
                    return(false);
                }

                mWardrobe.SimLine.RemoveFromQueue(Actor);
                if (!Actor.RouteToSlotAndCheckInUse(mWardrobe, Slot.RoutingSlot_0))
                {
                    return(false);
                }

                OutfitCategories currentOutfitCategory = Actor.CurrentOutfitCategory;
                int currentOutfitIndex = Actor.CurrentOutfitIndex;
                StandardEntry();
                BeginCommodityUpdates();
                mWardrobe.AddToUseList(Actor);
                EnterStateMachine("wardrobewoohoo", "Enter", "y");
                SetActor("dresserWardrobe", mWardrobe);
                AddPersistentScriptEventHandler(0x65, HideSim);
                AddOneShotScriptEventHandler(0x66, ShowX);
                AddOneShotScriptEventHandler(0x67, ShowY);
                Animate("y", "GetInY");
                mIsInWardrobe = true;
                while (!mOtherWooHoo.mIsInWardrobe)
                {
                    if (Target.InteractionQueue.GetCurrentInteraction() != mOtherWooHoo)
                    {
                        Actor.SetOpacity(0f, 0f);
                        SpeedTrap.Sleep(0x1);
                        Actor.SetPosition(mWardrobe.GetPositionOfSlot(Slot.RoutingSlot_1));
                        Actor.SetForward(mWardrobe.GetForwardOfSlot(Slot.RoutingSlot_1));
                        Animate("y", "Exit");
                        mCurrentStateMachine.RemoveEventHandler(HideSim);
                        mCurrentStateMachine.RemoveEventHandler(ShowX);
                        mCurrentStateMachine.RemoveEventHandler(ShowY);
                        mWardrobe.RemoveFromUseList(Actor);
                        EndCommodityUpdates(false);
                        StandardExit();
                        return(false);
                    }
                    SpeedTrap.Sleep(0xa);
                }

                if (((Actor.OccultManager != null) && !Actor.OccultManager.DisallowClothesChange()) && !Actor.DoesSimHaveTransformationBuff())
                {
                    List <OutfitCategories> randomList = new List <OutfitCategories>(Wardrobe.kPossibleOutfitsAfterWooHoo);
                    randomList.Remove(Actor.CurrentOutfitCategory);

                    if (Woohooer.Settings.mNakedOutfitWardrobe)
                    {
                        randomList.Add(OutfitCategories.Naked);
                    }

                    Actor.SwitchToOutfitWithSpin(Sim.ClothesChangeReason.Force, RandomUtil.GetRandomObjectFromList(randomList));
                }

                AnimateJoinSims("WooHoo");
                mCurrentStateMachine.RemoveEventHandler(HideSim);
                Target.SetPosition(mWardrobe.GetPositionOfSlot(Slot.RoutingSlot_2));
                Target.SetForward(mWardrobe.GetForwardOfSlot(Slot.RoutingSlot_2));
                Actor.SetPosition(mWardrobe.GetPositionOfSlot(Slot.RoutingSlot_1));
                Actor.SetForward(mWardrobe.GetForwardOfSlot(Slot.RoutingSlot_1));
                mCurrentStateMachine.RequestState(false, "x", "GetOutX");
                mCurrentStateMachine.RequestState(true, "y", "GetOutX");
                mCurrentStateMachine.RequestState(false, "x", "GetOutY");
                mCurrentStateMachine.RequestState(true, "y", "GetOutY");

                if (CommonPregnancy.IsSuccess(Actor, Target, Autonomous, definition.GetStyle(this)))
                {
                    CommonPregnancy.Impregnate(Actor, Target, Autonomous, definition.GetStyle(this));
                }

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

                Actor.BuffManager.AddElement(BuffNames.ClothesEncounters, Origin.FromWooHooInWardrobe);
                Target.BuffManager.AddElement(BuffNames.ClothesEncounters, Origin.FromWooHooInWardrobe);

                mCurrentStateMachine.RequestState(false, "x", "Exit");
                mCurrentStateMachine.RequestState(true, "y", "Exit");
                mIsInWardrobe = false;

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

                mWardrobe.RemoveFromUseList(Actor);
                EndCommodityUpdates(true);
                StandardExit();
                mCurrentStateMachine.RemoveEventHandler(ShowX);
                mCurrentStateMachine.RemoveEventHandler(ShowY);
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
        }
Exemple #7
0
        public override bool Run()
        {
            try
            {
                if ((mWardrobe == null) || (mOtherWooHoo == null))
                {
                    return(false);
                }
                if (!mWardrobe.SimLine.WaitForTurn(this, SimQueue.WaitBehavior.Default, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), 10f))
                {
                    return(false);
                }

                mWardrobe.SimLine.RemoveFromQueue(Actor);
                OutfitCategories currentOutfitCategory = Actor.CurrentOutfitCategory;
                int currentOutfitIndex = Actor.CurrentOutfitIndex;
                Actor.RouteToObjectRadius(mWardrobe, 1.5f);

                while (!mOtherWooHoo.mIsInWardrobe)
                {
                    if (((Target.InteractionQueue.GetCurrentInteraction() != mOtherWooHoo) || Target.HasExitReason(ExitReason.Canceled)) || Actor.HasExitReason())
                    {
                        return(false);
                    }
                    SpeedTrap.Sleep(0xa);
                }

                Route r = Actor.CreateRoute();
                r.AddObjectToIgnoreForRoute(Target.ObjectId);
                r.PlanToSlot(mWardrobe, Slot.RoutingSlot_0);
                if (!Actor.DoRoute(r))
                {
                    return(false);
                }

                mWardrobe.UpdateFootprint(true, Actor, new Sim[] { Target });
                mWardrobe.AddToUseList(Actor);
                StandardEntry();
                BeginCommodityUpdates();
                mCurrentStateMachine = mOtherWooHoo.mCurrentStateMachine;
                SetActorAndEnter("x", Actor, "Enter");
                Animate("x", "GetInX");
                mIsInWardrobe = true;

                if (((Actor.OccultManager != null) && !Actor.OccultManager.DisallowClothesChange()) && !Actor.DoesSimHaveTransformationBuff())
                {
                    List <OutfitCategories> randomList = new List <OutfitCategories>(Wardrobe.kPossibleOutfitsAfterWooHoo);
                    randomList.Remove(Actor.CurrentOutfitCategory);

                    if (Woohooer.Settings.mNakedOutfitWardrobe)
                    {
                        randomList.Add(OutfitCategories.Naked);
                    }

                    Actor.SwitchToOutfitWithSpin(Sim.ClothesChangeReason.Force, RandomUtil.GetRandomObjectFromList(randomList));
                }

                while (mOtherWooHoo.mIsInWardrobe)
                {
                    if (Target.InteractionQueue.GetCurrentInteraction() != mOtherWooHoo)
                    {
                        Actor.SetOpacity(1f, 0f);
                        mWardrobe.RemoveFromUseList(Actor);
                        EndCommodityUpdates(true);
                        StandardExit();
                        mWardrobe.UpdateFootprint(false, Actor, new Sim[0x0]);
                        return(false);
                    }
                    SpeedTrap.Sleep(0xa);
                }

                IWooHooDefinition otherDefinition = mOtherWooHoo.InteractionDefinition as IWooHooDefinition;

                EventTracker.SendEvent(EventTypeId.kWoohooInWardrobe, Actor, Target);
                CommonWoohoo.RunPostWoohoo(Actor, Target, mWardrobe, otherDefinition.GetStyle(this), otherDefinition.GetLocation(mWardrobe), true);

                mWardrobe.UpdateFootprint(false, Actor, new Sim[0x0]);
                mWardrobe.RemoveFromUseList(Actor);
                EndCommodityUpdates(true);
                StandardExit();
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
        }
Exemple #8
0
        public override bool Run()
        {
            try
            {
                mLinkedActor = LinkedInteractionInstance.InstanceActor;

                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

                bool succeeded = true;
                if (mIsMaster)
                {
                    Target.mRoutingSims.Add(Actor);
                    Target.mRoutingSims.Add(mLinkedActor);
                }

                if (!mIsMaster)
                {
                    bool success = false;

                    Actor.RouteToObjectRadialRange(Target, 1.5f, 4f);
                    while (Target.mRoutingSims.Contains(mLinkedActor))
                    {
                        AncientPortalWooHoo interaction = LinkedInteractionInstance as AncientPortalWooHoo;
                        if (interaction == null)
                        {
                            break;
                        }

                        if (mLinkedActor.HasExitReason(ExitReason.Canceled))
                        {
                            break;
                        }

                        if (interaction.mNowWaiting)
                        {
                            success = true;
                            break;
                        }

                        SpeedTrap.Sleep(0xa);
                    }

                    if (!success)
                    {
                        Actor.AddExitReason(ExitReason.RouteFailed);
                        return(false);
                    }
                }

                bool routeSuccess = false;

                Route r = Actor.CreateRoute();
                r.AddObjectToIgnoreForRoute(mLinkedActor.ObjectId);
                r.PlanToSlot(Target, Target.GetRoutingSlots());
                routeSuccess = Actor.DoRoute(r);

                if ((mIsMaster) && (routeSuccess))
                {
                    routeSuccess = !Actor.InUse;
                }

                if (!routeSuccess)
                {
                    Actor.AddExitReason(ExitReason.RouteFailed);
                    return(false);
                }

                CommonWoohoo.TestNakedOutfit(Woohooer.Settings.mNakedOutfitAncientPortal, Actor);

                StandardEntry();

                EnterStateMachine("AncientPortal", "Enter", "x", "portal");

                AddOneShotScriptEventHandler(0x65, HideSim);
                AddOneShotScriptEventHandler(0x66, ShowSim);
                AnimateSim("InsidePortal");

                if (mIsMaster)
                {
                    Target.RemoveFromUseList(Actor);

                    mNowWaiting = true;

                    RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo);
                }

                BeginCommodityUpdates();

                if (mReactToSocialBroadcaster == null)
                {
                    mReactToSocialBroadcaster = new ReactionBroadcaster(Actor, Conversation.ReactToSocialParams, SocialComponentEx.ReactToJealousEventHigh);
                    CommonWoohoo.CheckForWitnessedCheating(Actor, mLinkedActor, !Rejected);
                }

                if ((Target.BoobyTrapComponent != null) ? Target.BoobyTrapComponent.CanTriggerTrap(Actor.SimDescription) : false)
                {
                    Target.TriggerTrap(Actor);
                }

                int count = 0;

                while (Target.mRoutingSims.Contains(mLinkedActor))
                {
                    AncientPortalWooHoo interaction = LinkedInteractionInstance as AncientPortalWooHoo;
                    if (interaction == null)
                    {
                        break;
                    }

                    if (mLinkedActor.HasExitReason(ExitReason.Canceled))
                    {
                        break;
                    }

                    if (!mIsMaster)
                    {
                        interaction.mWasSuccess = true;

                        if (count > 30)
                        {
                            break;
                        }
                        count++;

                        Target.SetOpacity(RandomUtil.GetFloat(0f, 1f), 0.25f);
                    }

                    SpeedTrap.Sleep(10);
                }

                if (!mIsMaster)
                {
                    Target.SetOpacity(1f, 1f);
                }

                AnimateSim("Exit");

                for (int i = 0; i < AncientPortal.CatchABeam.kPotentialTravelBuffs.Length; i++)
                {
                    if (RandomUtil.RandomChance(AncientPortal.CatchABeam.kChanceForEachBuff))
                    {
                        Actor.BuffManager.AddElement(AncientPortal.CatchABeam.kPotentialTravelBuffs[i], Origin.FromAncientPortal);
                    }
                }

                if (mIsMaster)
                {
                    RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo);
                }

                EndCommodityUpdates(succeeded);
                StandardExit();

                if ((mWasSuccess) && (mIsMaster))
                {
                    CommonWoohoo.RunPostWoohoo(Actor, mLinkedActor, Target, definition.GetStyle(this), definition.GetLocation(Target), true);

                    if (CommonPregnancy.IsSuccess(Actor, mLinkedActor, Autonomous, definition.GetStyle(this)))
                    {
                        CommonPregnancy.Impregnate(Actor, mLinkedActor, Autonomous, definition.GetStyle(this));
                    }
                }

                Actor.Wander(1f, 2f, false, RouteDistancePreference.PreferNearestToRouteOrigin, false);
                return(succeeded);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
            finally
            {
                Target.mRoutingSims.Remove(Actor);
            }
        }
Exemple #9
0
        public override bool Run()
        {
            try
            {
                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

                if (Target.IsBroken)
                {
                    return(false);
                }

                int num;
                if (mIsMaster)
                {
                    if (!Actor.RouteToSlotListAndCheckInUse(Target, TimePortal.kRoutingSlots, out num))
                    {
                        return(false);
                    }
                }
                else
                {
                    if (!Actor.RouteToSlotList(Target, TimePortal.kRoutingSlots, out num))
                    {
                        return(false);
                    }
                }

                if (Actor.HasExitReason(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached)))
                {
                    return(false);
                }

                StandardEntry();

                EnterStateMachine("timeportal", "Enter", "x", "portal");
                AddPersistentScriptEventHandler(0xc9, CameraShakeEventEx);

                if (mIsMaster && !Actor.HasExitReason())
                {
                    TimePortalWooHoo entry = definition.ProxyClone(Actor).CreateInstance(Target, mWoohooee, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true) as TimePortalWooHoo;
                    entry.LinkedInteractionInstance = this;
                    entry.mWoohooee = mWoohooee;
                    mWoohooee.InteractionQueue.AddNext(entry);
                }

                Skill futureSkill = Actor.SkillManager.AddElement(SkillNames.Future);
                if (futureSkill.SkillLevel >= 0x3)
                {
                    AnimateSim("Jump In");
                }
                else
                {
                    AnimateSim("Apprehensive");
                }

                bool succeeded = true;

                if (StartSync(mIsMaster))
                {
                    BeginCommodityUpdates();

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

                    if (mIsMaster)
                    {
                        CommonWoohoo.TestNakedOutfit(Woohooer.Settings.mNakedOutfitTimePortal, Actor, mWoohooee);

                        TimePortal.PortalState previousState = Target.State;

                        List <TimePortal.PortalState> choices = new List <TimePortal.PortalState>();
                        foreach (TimePortal.PortalState state in Enum.GetValues(typeof(TimePortal.PortalState)))
                        {
                            if (state == TimePortal.PortalState.Invalid_State)
                            {
                                continue;
                            }

                            choices.Add(state);
                        }

                        int count = 0;
                        while (Target.ActorsUsingMe.Contains(mWoohooee))
                        {
                            TimePortalWooHoo interaction = LinkedInteractionInstance as TimePortalWooHoo;
                            if (interaction == null)
                            {
                                break;
                            }

                            if (mWoohooee.HasExitReason(ExitReason.Canceled))
                            {
                                break;
                            }

                            if (mIsMaster)
                            {
                                if (count > 30)
                                {
                                    break;
                                }
                                count++;

                                Target.UpdateState(RandomUtil.GetRandomObjectFromList(choices));

                                if (RandomUtil.RandomChance(5))
                                {
                                    CameraShakeEventEx(null, null);
                                }
                            }

                            SpeedTrap.Sleep(10);
                        }

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

                        Target.UpdateState(previousState);
                    }
                    else
                    {
                        do
                        {
                            SpeedTrap.Sleep(0xa);
                        }while (Target.UseCount > 0x1);
                    }

                    RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo);
                }
                else if (mIsMaster)
                {
                    if (LinkedInteractionInstance != null)
                    {
                        LinkedInteractionInstance.InstanceActor.AddExitReason(ExitReason.CanceledByScript);
                    }
                }

                if (((succeeded && Actor.TraitManager.HasElement(TraitNames.Unstable)) && (!Actor.BuffManager.HasElement(BuffNames.FeelingOutOfSorts) && !Actor.BuffManager.HasElement(BuffNames.ImpendingEpisode))) && (!Actor.BuffManager.HasElement(BuffNames.Delusional) && RandomUtil.RandomChance01(kUnstableTraitChance)))
                {
                    Actor.BuffManager.AddElement(BuffNames.FeelingOutOfSorts, Origin.FromUnstableTrait);
                }

                if (futureSkill.SkillLevel >= 0x3)
                {
                    AnimateSim("Exit");
                }
                else
                {
                    AnimateSim("Spit Out");
                }

                EndCommodityUpdates(succeeded);
                StandardExit();

                if (!mIsMaster)
                {
                    if (CommonPregnancy.IsSuccess(Actor, mWoohooee, Autonomous, definition.GetStyle(this)))
                    {
                        CommonPregnancy.Impregnate(Actor, mWoohooee, Autonomous, definition.GetStyle(this));
                    }

                    Actor.RouteAway(1f, 3f, false, GetPriority(), Autonomous, false, true, RouteDistancePreference.PreferNearestToRouteOrigin);
                }
                else
                {
                    Target.StopActiveFX();
                }

                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Exemple #10
0
        public override bool Run()
        {
            try
            {
                if (!SafeToSync())
                {
                    return(false);
                }
                else if (BoxStallToUse == null)
                {
                    return(false);
                }
                else if (!StartSync(IsMaster))
                {
                    return(false);
                }

                if (!IsMaster)
                {
                    SpeedTrap.Sleep();
                }

                try
                {
                    Slot destinationSlot = IsMaster ? BoxStall.kRoutingSlot_SnuggleA : BoxStall.kRoutingSlot_SnuggleB;
                    if (Actor.IsHuman)
                    {
                        if (IsMaster)
                        {
                            (BoxStallToUse.PortalComponent as BoxStall.BoxStallPortalComponent).AddPortals();
                        }

                        if (!BoxStallToUse.TryRouteToSlot(Actor, BoxStall.kRoutingSlot_EnterA, BoxStall.RouteOptions.IgnoreOrientation | BoxStall.RouteOptions.IgnoreExitReasons))
                        {
                            return(false);
                        }

                        if (!BoxStallToUse.TryRouteToSlot(Actor, destinationSlot))
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        if (!BoxStallToUse.RouteToAndEnter(Actor, destinationSlot, this))
                        {
                            return(false);
                        }
                    }

                    Actor.SynchronizationLevel = Sim.SyncLevel.Routed;
                    if (!Actor.WaitForSynchronizationLevelWithSim(Target, Sim.SyncLevel.Routed, 30f))
                    {
                        return(false);
                    }

                    BeginCommodityUpdates();

                    IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

                    if (IsMaster)
                    {
                        try
                        {
                            RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo);
                            Actor.EnableCensor(Sim.CensorType.FullBody);
                            Target.EnableCensor(Sim.CensorType.FullBody);
                            EnterStateMachine("BoxStallWooHoo", "Enter", "x", "y");
                            AddPersistentSynchronousScriptEventHandler(0x65, StartEffects);
                            AddPersistentSynchronousScriptEventHandler(0x66, StopEffects);
                            mCurrentStateMachine.RequestState(false, "x", "WooHoo");
                            mCurrentStateMachine.RequestState(true, "y", "WooHoo");
                            mCurrentStateMachine.RequestState(false, "x", "Exit");
                            mCurrentStateMachine.RequestState(true, "y", "Exit");
                        }
                        finally
                        {
                            Actor.AutoEnableCensor();
                            Target.AutoEnableCensor();
                            RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo);
                        }

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

                        if (RandomUtil.RandomChance(HayStack.kChanceOfRolledInHayMoodlet))
                        {
                            Actor.BuffManager.AddElement(BuffNames.RolledInTheHay, WoohooBuffs.sWoohooOrigin);
                            Target.BuffManager.AddElement(BuffNames.RolledInTheHay, WoohooBuffs.sWoohooOrigin);
                        }

                        if (Actor.IsHuman)
                        {
                            BoxStallToUse.TryRouteToSlot(Actor, BoxStall.kRoutingSlot_EnterB, BoxStall.RouteOptions.IgnoreOrientation | BoxStall.RouteOptions.IgnoreExitReasons);
                            BoxStallToUse.TryRouteToSlot(Actor, BoxStall.kRoutingSlot_Exit, BoxStall.RouteOptions.IgnoreExitReasons);
                        }
                    }

                    if (IsMaster)
                    {
                        if (CommonPregnancy.IsSuccess(Actor, Target, Autonomous, definition.GetStyle(this)))
                        {
                            CommonPregnancy.Impregnate(Actor, Target, Autonomous, definition.GetStyle(this));
                        }
                    }

                    if (Actor.IsHuman)
                    {
                        BoxStallToUse.TryRouteToSlot(Actor, BoxStall.kRoutingSlot_EnterB, BoxStall.RouteOptions.IgnoreOrientation | BoxStall.RouteOptions.IgnoreExitReasons);
                        BoxStallToUse.TryRouteToSlot(Actor, BoxStall.kRoutingSlot_Exit, BoxStall.RouteOptions.IgnoreExitReasons);
                    }

                    Actor.SynchronizationLevel = Sim.SyncLevel.Completed;
                    if (!Actor.WaitForSynchronizationLevelWithSim(Target, Sim.SyncLevel.Completed, ExitReason.None, 30f))
                    {
                        EndCommodityUpdates(false);
                        return(false);
                    }

                    if ((!IsMaster) && (!Actor.IsHuman))
                    {
                        TryPushAsContinuation(BoxStall.Exit.Singleton, BoxStallToUse);
                    }

                    EndCommodityUpdates(true);
                    FinishLinkedInteraction();
                    WaitForSyncComplete();
                    return(true);
                }
                finally
                {
                    if ((Actor.IsHuman) && (IsMaster))
                    {
                        (BoxStallToUse.PortalComponent as BoxStall.BoxStallPortalComponent).RemovePortals();
                    }
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
        }
Exemple #11
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);
            }
        }
Exemple #12
0
        public override bool Run()
        {
            try
            {
                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

                bool flag2 = false;
                if (mIsMaster)
                {
                    flag2 = Actor.RouteToSlotAndCheckInUse(Target, Slot.RoutingSlot_1);
                    mFail = RandomUtil.RandomChance(BoxOfMystery.kChanceToFailWooHoo);
                }
                else
                {
                    Route r = Actor.CreateRoute();
                    r.AddObjectToIgnoreForRoute(mWooHooer.ObjectId);
                    r.PlanToSlot(Target, Slot.RoutingSlot_1);
                    flag2 = Actor.DoRoute(r);
                }
                if (!flag2)
                {
                    Actor.AddExitReason(ExitReason.RouteFailed);
                    return(false);
                }

                mRouteComplete = flag2;
                if (mIsMaster && Target.ActorsUsingMe.Contains(mWooHooee))
                {
                    return(false);
                }

                if (mIsMaster && !Actor.HasExitReason())
                {
                    mLinkedInstance = definition.ProxyClone(mWooHooer).CreateInstance(Target, mWooHooee, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true) as BoxOfMystery.WooHooInBoxOfMystery;
                    mLinkedInstance.LinkedInteractionInstance = this;
                    mLinkedInstance.mWooHooer = mWooHooer;
                    mLinkedInstance.mWooHooee = mWooHooee;
                    mLinkedInstance.mFail     = mFail;
                    mWooHooee.InteractionQueue.AddNext(mLinkedInstance);
                }

                StandardEntry();
                EnterStateMachine("BoxOfMystery", "Enter", "x");
                SetActor("box", Target);
                AnimateSim("GetInBox");
                if (mIsMaster)
                {
                    Actor.SetOpacity(0f, 0f);
                }

                while ((mIsMaster && !mLinkedInstance.mRouteComplete) && (!mWooHooee.HasExitReason(ExitReason.RouteFailed) && mWooHooee.InteractionQueue.HasInteraction(mLinkedInstance)))
                {
                    SpeedTrap.Sleep(0x0);
                }

                if (mIsMaster && (mWooHooee.HasExitReason(ExitReason.RouteFailed) || !mWooHooee.InteractionQueue.HasInteraction(mLinkedInstance)))
                {
                    Actor.SetOpacity(1f, 0f);
                    AnimateSim("Exit");
                    StandardExit();
                    return(false);
                }

                if (mIsMaster)
                {
                    List <Sim> exceptions = new List <Sim>();
                    exceptions.Add(mWooHooee);
                    Target.EnableFootprintAndPushSims(BoxOfMystery.sFootprintPathingHash, Actor, exceptions, false);
                }

                if (!StartSync(mIsMaster))
                {
                    if (mIsMaster)
                    {
                        if (LinkedInteractionInstance != null)
                        {
                            LinkedInteractionInstance.InstanceActor.AddExitReason(ExitReason.CanceledByScript);
                            Actor.AddExitReason(ExitReason.CanceledByScript);
                        }

                        do
                        {
                            SpeedTrap.Sleep(0xa);
                        }while (Target.UseCount > 0x1);
                    }
                }
                else
                {
                    if (mIsMaster)
                    {
                        mLinkedInstance.mAnimating = true;
                    }
                    Actor.SetOpacity(0f, 0f);
                    BeginCommodityUpdates();
                    if (!mIsMaster)
                    {
                        while (mAnimating)
                        {
                            SpeedTrap.Sleep(0x1);
                        }
                    }
                    else
                    {
                        AnimateSim("TryForWooHoo");
                        mLinkedInstance.mAnimating = false;
                    }
                    EndCommodityUpdates(true);
                    if (mIsMaster)
                    {
                        CommonWoohoo.RunPostWoohoo(Actor, mWooHooee, Target, definition.GetStyle(this), definition.GetLocation(Target), true);

                        if (CommonPregnancy.IsSuccess(Actor, mWooHooee, Autonomous, definition.GetStyle(this)))
                        {
                            CommonPregnancy.Impregnate(Actor, mWooHooee, Autonomous, definition.GetStyle(this));
                        }

                        if (mFail)
                        {
                            Actor.SetOpacity(1f, 0f);
                            AnimateSim("FailExit");
                            Route route2 = Actor.CreateRouteTurnToFace(Target.Position);
                            route2.AddObjectToIgnoreForRoute(mWooHooee.ObjectId);
                            Actor.DoRoute(route2);
                            AnimateSim("Panic");
                            Actor.RouteAway(1f, 3f, false, GetPriority(), Autonomous, false, true, RouteDistancePreference.PreferNearestToRouteOrigin);
                        }
                        else
                        {
                            do
                            {
                                SpeedTrap.Sleep(0xa);
                            }while (Target.UseCount > 0x1);
                        }
                    }
                    else if (mFail)
                    {
                        do
                        {
                            SpeedTrap.Sleep(0xa);
                        }while (Target.UseCount > 0x1);

                        Actor.SetOpacity(1f, 0f);
                        AnimateSim("SuprisedExit");
                    }
                }

                Actor.SetOpacity(1f, 0f);
                AnimateSim("Exit");
                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);
            }
        }
Exemple #13
0
        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);
            }
        }
Exemple #14
0
        private void OnPregnancyEvent(StateMachineClient smc, IEvent evt)
        {
            IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

            Pregnancy pregnancy = CommonPregnancy.Impregnate(Actor, Target, Autonomous, definition.GetStyle(this));

            if (pregnancy != null)
            {
                if (RandomUtil.RandomChance(Sims3.Gameplay.Objects.Plumbing.Shower.kChanceOfHydrophobic))
                {
                    pregnancy.SetForcedBabyTrait(TraitNames.Hydrophobic);
                }
            }
        }
Exemple #15
0
        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);
            }
        }
Exemple #16
0
        public override bool Run()
        {
            try
            {
                mLinkedActor = LinkedInteractionInstance.InstanceActor;
                if (!StartSync(mIsMaster))
                {
                    Treehouse.PushGetOutAsContinuation(Actor);
                    return(false);
                }

                StandardEntry(false);
                BeginCommodityUpdates();
                if (mIsMaster)
                {
                    RockGemMetalBase.HandleNearbyWoohoo(Target, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo);
                    mCurrentStateMachine = Actor.Posture.CurrentStateMachine;
                    SetActor("y", mLinkedActor);
                    AnimateSim("WooHoo");
                    AnimateSim("Idle");
                    RemoveActor("y");

                    IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

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

                    if (CommonPregnancy.IsSuccess(Actor, mLinkedActor, Autonomous, definition.GetStyle(this)))
                    {
                        Pregnancy pregnancy = CommonPregnancy.Impregnate(Actor, mLinkedActor, Autonomous, definition.GetStyle(this));
                        if (pregnancy != null)
                        {
                            pregnancy.SetForcedBabyTrait(RandomUtil.GetRandomObjectFromList(Target.RandomPregnancyTraits));
                        }
                    }

                    RockGemMetalBase.HandleNearbyWoohoo(Target, RockGemMetalBase.HowMuchWooHoo.LessWoohoo);
                }
                else
                {
                    DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                }

                float splinterChance = Treehouse.WooHoo.kSplinterChance;
                if (Actor.TraitManager.HasAnyElement(kSplinterChanceTraitsIncrease))
                {
                    splinterChance *= kSplinterChanceMultiplierIncrease;
                }
                if (Actor.TraitManager.HasAnyElement(kSplinterChanceTraitsDecrease) || Actor.BuffManager.HasElement(BuffNames.LuckyLime))
                {
                    splinterChance *= kSplinterChanceMultiplierDecrease;
                }
                if (RandomUtil.RandomChance01(splinterChance))
                {
                    Actor.BuffManager.AddElement(BuffNames.Splinter, Origin.None);
                }

                EndCommodityUpdates(true);
                StandardExit(false, false);
                FinishLinkedInteraction(mIsMaster);
                WaitForSyncComplete();
                Treehouse.PushGetOutAsContinuation(Actor);
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
        }
Exemple #17
0
        public override bool Run()
        {
            try
            {
                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

                if ((mGypsyCaravan == null) || (mOtherWooHoo == null))
                {
                    return(false);
                }
                if (!mGypsyCaravan.SimLine.WaitForTurn(this, SimQueue.WaitBehavior.Default, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), 10f))
                {
                    return(false);
                }

                mGypsyCaravan.SimLine.RemoveFromQueue(Actor);
                if (!mGypsyCaravan.RouteNearEntranceAndEnterRabbitHole(Actor, null, null, false, Route.RouteMetaType.GoRabbitHole, true))
                {
                    return(false);
                }

                StandardEntry();
                BeginCommodityUpdates();
                EnterStateMachine("GypsyCaravanWoohoo", "WoohooEnter", "y");
                SetActor("caravan", mGypsyCaravan);
                AddPersistentScriptEventHandler(0x65, HideSim);
                AddOneShotScriptEventHandler(0x66, ShowX);
                AddOneShotScriptEventHandler(0x67, ShowY);
                Animate("y", "GetInY");
                mIsInCaravan = true;

                while (!mOtherWooHoo.mIsInCaravan)
                {
                    if ((Target.InteractionQueue.GetCurrentInteraction() != mOtherWooHoo) || Target.HasExitReason(ExitReason.Canceled))
                    {
                        Actor.SetOpacity(1f, 0f);
                        Animate("y", "WoohooExit");
                        mCurrentStateMachine.RemoveEventHandler(HideSim);
                        mCurrentStateMachine.RemoveEventHandler(ShowX);
                        mCurrentStateMachine.RemoveEventHandler(ShowY);
                        mGypsyCaravan.RemoveFromUseList(Actor);
                        EndCommodityUpdates(false);
                        StandardExit();
                        return(false);
                    }
                    SpeedTrap.Sleep(0xa);
                }

                mGypsyCaravan.TurnOnWooHooEffect();
                AnimateJoinSims("WooHoo");
                CommonWoohoo.RunPostWoohoo(Actor, Target, mGypsyCaravan, definition.GetStyle(this), definition.GetLocation(mGypsyCaravan), true);

                if (RandomUtil.RandomChance(GypsyCaravan.kFortuneToldSleepWear))
                {
                    if (Woohooer.Settings.mNakedOutfitGypsyCaravan)
                    {
                        if (!Actor.OccultManager.DisallowClothesChange())
                        {
                            Actor.SwitchToOutfitWithoutSpin(OutfitCategories.Naked);
                        }

                        if (!Target.OccultManager.DisallowClothesChange())
                        {
                            Target.SwitchToOutfitWithoutSpin(OutfitCategories.Naked);
                        }
                    }
                    else
                    {
                        if (!Actor.OccultManager.DisallowClothesChange())
                        {
                            Actor.SwitchToOutfitWithoutSpin(OutfitCategories.Sleepwear);
                        }

                        if (!Target.OccultManager.DisallowClothesChange())
                        {
                            Target.SwitchToOutfitWithoutSpin(OutfitCategories.Sleepwear);
                        }
                    }
                }
                else if (RandomUtil.RandomChance(GypsyCaravan.kFortuneToldSinged))
                {
                    if (!Actor.OccultManager.DisallowClothesChange())
                    {
                        Actor.SwitchToOutfitWithoutSpin(OutfitCategories.Singed);
                    }

                    if (!Target.OccultManager.DisallowClothesChange())
                    {
                        Target.SwitchToOutfitWithoutSpin(OutfitCategories.Singed);
                    }
                }

                mCurrentStateMachine.RemoveEventHandler(HideSim);
                mGypsyCaravan.TurnOffWooHooEffect();
                mGypsyCaravan.ExitRabbitHoleAndRouteAway(Actor);

                if (CommonPregnancy.IsSuccess(Actor, Target, Autonomous, definition.GetStyle(this)))
                {
                    CommonPregnancy.Impregnate(Actor, Target, Autonomous, definition.GetStyle(this));
                }

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

                EventTracker.SendEvent(EventTypeId.kWooHooedInTheVardo, Actor, mOtherWooHoo.Actor);

                mIsInCaravan = false;
                EndCommodityUpdates(true);
                StandardExit();
                mCurrentStateMachine.RemoveEventHandler(ShowX);
                mCurrentStateMachine.RemoveEventHandler(ShowY);
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
        }
Exemple #18
0
        public override bool Run()
        {
            try
            {
                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

                if (mWoohooer == null)
                {
                    mMaster   = true;
                    mWoohooer = Actor;
                    mWoohooee = GetSelectedObject() as Sim;
                    if (mWoohooee == null)
                    {
                        return(false);
                    }
                }

                if (mMaster)
                {
                    UnderwaterCave.WoohooInCave entry = definition.ProxyClone(mWoohooer).CreateInstance(Target, mWoohooee, mPriority, Autonomous, true) as UnderwaterCave.WoohooInCave;
                    entry.mWoohooer = Actor;
                    entry.mWoohooee = mWoohooee;
                    entry.LinkedInteractionInstance = this;
                    mWoohooee.InteractionQueue.AddNext(entry);

                    if (Target.mIsTentacleWaving)
                    {
                        Target.TentacleWaveUpdate();
                    }

                    if (!Actor.RouteToSlot(Target, Slot.RoutingSlot_0))
                    {
                        mWoohooee.AddExitReason(ExitReason.SynchronizationFailed);
                        return(false);
                    }

                    Target.WaitForTentacle(Actor);
                    StandardEntry();
                    EnterStateMachine("UnderwaterCaveWooHoo", "enter", "x");
                    SetParameter("IsMermaidX", Actor.SimDescription.IsMatureMermaid);
                    SetActor("cave", Target);
                    AnimateSim("xEnterCave");
                    mRouteComplete = true;
                }

                UnderwaterCave.WoohooInCave linkedInteractionInstance = LinkedInteractionInstance as UnderwaterCave.WoohooInCave;
                while (((linkedInteractionInstance != null) && !linkedInteractionInstance.mRouteComplete) && !Actor.HasExitReason(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached)))
                {
                    SpeedTrap.Sleep();
                }

                if ((linkedInteractionInstance == null) || !linkedInteractionInstance.mRouteComplete)
                {
                    return(false);
                }

                if (!mMaster)
                {
                    Route r = Actor.CreateRoute();
                    r.AddObjectToIgnoreForRoute(mWoohooer.ObjectId);
                    r.PlanToSlot(Target, Slot.RoutingSlot_0);
                    mRouteComplete = Actor.DoRoute(r);
                    if (!mRouteComplete)
                    {
                        mWoohooer.AddExitReason(ExitReason.SynchronizationFailed);
                        return(false);
                    }
                    StandardEntry();
                }

                BeginCommodityUpdates();
                if (mMaster)
                {
                    if (Actor.HasExitReason(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached)))
                    {
                        AnimateSim("xExit");
                        return(false);
                    }
                    Target.WaitForTentacle(mWoohooee);
                    SetActor("y", mWoohooee);
                    SetParameter("IsMermaidY", mWoohooee.SimDescription.IsMatureMermaid);
                    AddOneShotScriptEventHandler(0xc9, FireVFX);
                    if (definition.GetStyle(this) != CommonWoohoo.WoohooStyle.Safe)
                    {
                        // Custom
                        AddOneShotScriptEventHandler(0x3e9, FirePreggoEx);
                    }

                    CommonWoohoo.RunPostWoohoo(mWoohooer, mWoohooee, Target, definition.GetStyle(this), definition.GetLocation(Target), true);

                    mCurrentStateMachine.EnterState("y", "enter");
                    mCurrentStateMachine.RequestState("y", "yEnterCave");
                    AnimateJoinSims("woohoo");
                    mWoohooer.BuffManager.AddElement(BuffNames.MileLowClub, Origin.FromWooHooUnderwaterCave);
                    mWoohooee.BuffManager.AddElement(BuffNames.MileLowClub, Origin.FromWooHooUnderwaterCave);
                    mWoohooer.GetRelationship(mWoohooee, true).LTR.UpdateLiking(kLTRBump);
                    if (mVfxone != null)
                    {
                        mVfxone.Stop(VisualEffect.TransitionType.SoftTransition);
                        mVfxone = null;
                    }

                    if (mVfxtwo != null)
                    {
                        mVfxtwo.Stop(VisualEffect.TransitionType.SoftTransition);
                        mVfxtwo = null;
                    }

                    AnimateSim("xExit");
                    Actor.RouteToObjectRadius(Target, kRouteRadiusRange);
                    Actor.LoopIdle();
                    mCurrentStateMachine.RequestState("y", "yExit");
                    mWoohooee.AddExitReason(ExitReason.Finished);
                }
                else
                {
                    DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                    Actor.RouteToObjectRadius(Target, kRouteRadiusRange);
                }

                EventTracker.SendEvent(EventTypeId.kWooHooInUnderwaterCave, Actor, Target);
                EndCommodityUpdates(true);
                StandardExit();
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Exemple #19
0
        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;
                }
            }
        }
Exemple #20
0
        public override bool Run()
        {
            try
            {
                if (WoohooHouse == null)
                {
                    return(false);
                }
                if (!SafeToSync())
                {
                    return(false);
                }
                PetHouse.WoohooPetHouseB entry = PetHouse.WoohooPetHouseB.Singleton.CreateInstance(Actor, Target, GetPriority(), Autonomous, CancellableByPlayer) as PetHouse.WoohooPetHouseB;
                entry.LinkedInteractionInstance = this;
                Target.InteractionQueue.Add(entry);
                Actor.SynchronizationLevel  = Sim.SyncLevel.Started;
                Actor.SynchronizationTarget = Target;
                Actor.SynchronizationRole   = Sim.SyncRole.Initiator;
                if (!WoohooHouse.SimLine.WaitForTurn(this, SimQueue.WaitBehavior.Default, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), 10f))
                {
                    return(false);
                }
                if (!Actor.RouteToSlotAndCheckInUse(WoohooHouse, Slot.RoutingSlot_3))
                {
                    if (!Actor.HasExitReason(ExitReason.RouteFailed))
                    {
                        WoohooHouse.SimLine.RemoveFromQueue(Actor);
                        WoohooHouse.PlayRouteFailAndWanderAway(Actor);
                        return(false);
                    }
                    Actor.RemoveExitReason(ExitReason.RouteFailed);
                    if (!Actor.RouteToSlotAndCheckInUse(WoohooHouse, Slot.RoutingSlot_3))
                    {
                        WoohooHouse.SimLine.RemoveFromQueue(Actor);
                        WoohooHouse.PlayRouteFailAndWanderAway(Actor);
                        return(false);
                    }
                }
                StandardEntry();
                WoohooHouse.AddToUseList(Actor);
                WoohooHouse.AddToUseList(Target);
                EnterStateMachine("PetHouse", "enter", "x");
                SetActor("petHouse", WoohooHouse);
                SetActor("y", Target);
                Animate("x", "getInWoohooX");
                Actor.ParentToSlot(WoohooHouse, WoohooHouse.GetContainmentSlotForActor(Actor));
                WoohooHouse.SimLine.RemoveFromQueue(Actor);
                if (!Actor.WaitForSynchronizationLevelWithSim(Target, Sim.SyncLevel.Routed, 30f))
                {
                    Actor.UnParent();
                    Animate("x", "inHouseNeutral");
                    Animate("x", "exit");
                    StandardExit();
                    WoohooHouse.RemoveFromUseList(Actor);
                    WoohooHouse.RemoveFromUseList(Target);
                    return(false);
                }
                BeginCommodityUpdates();
                (LinkedInteractionInstance as PetHouse.WoohooPetHouseB).BeginCommodityUpdates();
                RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo);
                EnterState("y", "enter");
                Animate("y", "getInWoohooY");
                AnimateJoinSims("woohoo");
                Actor.UnParent();
                AnimateSim("exitWoohoo");
                RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo);

                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

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

                if (CommonPregnancy.IsSuccess(Actor, Target, Autonomous, definition.GetStyle(this)))
                {
                    CommonPregnancy.Impregnate(Actor, Target, Autonomous, definition.GetStyle(this));
                }

                StateMachineClient smc = StateMachineClient.Acquire(Actor, "PetHouse");
                smc.SetActor("petHouse", WoohooHouse);
                smc.SetActor("x", Actor);
                smc.EnterState("x", "inHouseNeutral");
                PetHouse.PetHousePosture posture = new PetHouse.PetHousePosture(WoohooHouse, Actor, smc);
                Actor.Posture       = posture;
                ActorStayingInHouse = Actor.InteractionQueue.PushAsContinuation(PetHouse.LieDown.Singleton.CreateInstance(WoohooHouse, Actor, GetPriority(), Autonomous, CancellableByPlayer), true);
                if (!ActorStayingInHouse)
                {
                    posture.CancelPosture(Actor);
                }
                EndCommodityUpdates(true);
                (LinkedInteractionInstance as PetHouse.WoohooPetHouseB).EndCommodityUpdates(true);
                PlumbBob.Reparent();
                StandardExit();
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
        }
Exemple #21
0
        public override bool Run()
        {
            try
            {
                if (!(Actor.Posture is FairyHouse.FairyHousePosture))
                {
                    return(false);
                }

                mLinkedActor = LinkedInteractionInstance.InstanceActor;
                if (!StartSync(mIsMaster))
                {
                    if (!Target.IsNextInteractionAFairyHouseInteraction(Actor))
                    {
                        Target.PushGetOutAsContinuation(Actor);
                    }
                    return(false);
                }

                StandardEntry(false);
                BeginCommodityUpdates();
                mCurrentStateMachine = Actor.Posture.CurrentStateMachine;
                if (mIsMaster)
                {
                    SetActorAndEnter("y", Actor, "WooHoo");
                    SetActorAndEnter("fairyHouse", Target, "Enter");
                    RockGemMetalBase.HandleNearbyWoohoo(Target, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo);
                    Animate("fairyHouse", "WooHoo");
                    Animate("fairyHouse", "Exit");

                    IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

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

                    if (CommonPregnancy.IsSuccess(Actor, mLinkedActor, Autonomous, definition.GetStyle(this)))
                    {
                        CommonPregnancy.Impregnate(Actor, mLinkedActor, Autonomous, definition.GetStyle(this));
                    }
                }
                else
                {
                    DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                }

                EventTracker.SendEvent(EventTypeId.kWooHooedInTheFairyHouse, Actor, mLinkedActor);
                EndCommodityUpdates(true);
                StandardExit(false, false);
                FinishLinkedInteraction(mIsMaster);
                WaitForSyncComplete();

                LongTermRelationshipTypes longTermRelationship = Relationship.GetLongTermRelationship(Actor, mLinkedActor);
                Relationship relationship = Relationship.Get(Actor, mLinkedActor, true);
                if (mIsMaster && (relationship != null))
                {
                    relationship.LTR.UpdateLiking(FairyHouse.kLTRIncreaseOnWoohoo);
                    LongTermRelationshipTypes currentLTR = relationship.CurrentLTR;
                    SocialComponent.SetSocialFeedback(CommodityTypes.Friendly, Actor, true, 0x0, longTermRelationship, currentLTR);
                    SocialComponent.SetSocialFeedback(CommodityTypes.Friendly, mLinkedActor, true, 0x0, longTermRelationship, currentLTR);
                }

                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
        }
Exemple #22
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);
            }
        }
        public override bool Run()
        {
            Common.StringBuilder msg = new Common.StringBuilder(GetType().FullName + ":Run");

            try
            {
                msg += "A";

                IWooHooDefinition interactionDefinition = InteractionDefinition as IWooHooDefinition;

                Sim selectedObject = GetSelectedObject() as Sim;                 //interactionDefinition.GetTarget(Actor, Target, this);
                if (selectedObject == null)
                {
                    return(false);
                }

                msg += "B";

                bool impregnate = true;

                RabbitHoleRomanticType romanticType = RabbitHoleRomanticType.WooHoo;
                if (interactionDefinition.GetStyle(this) == CommonWoohoo.WoohooStyle.TryForBaby)
                {
                    romanticType = RabbitHoleRomanticType.TryForBaby;
                }
                CommonWoohoo.WoohooStyle style = interactionDefinition.GetStyle(this);

                TVisitInteraction currentInteraction = selectedObject.CurrentInteraction as TVisitInteraction;
                if (currentInteraction != null)
                {
                    msg += "C";

                    ConfigureWooHooInteraction(currentInteraction, selectedObject, romanticType, impregnate, style);

                    /*currentInteraction.IsGettingItOn = true;
                     * currentInteraction.WooHooer = Actor;
                     * currentInteraction.WooHooee = selectedObject;
                     *
                     * if (interactionDefinition.GetStyle(this) == CommonWoohoo.WoohooStyle.TryForBaby)
                     * {
                     *      currentInteraction.RomanticType = RabbitHoleRomanticType.TryForBaby;
                     * }
                     * else
                     * {
                     *      currentInteraction.RomanticType = RabbitHoleRomanticType.WooHoo;
                     * }
                     *
                     * currentInteraction.mImpregnate = impregnate;
                     * currentInteraction.mStyle = interactionDefinition.GetStyle(this);
                     * currentInteraction.ActiveStage = currentInteraction.GetStages()[0x1];*/

                    impregnate = false;
                }

                currentInteraction = Actor.CurrentInteraction as TVisitInteraction;
                if (currentInteraction != null)
                {
                    msg += "D";

                    if (Makeout)
                    {
                        romanticType = RabbitHoleRomanticType.MakeOut;
                    }
                    ConfigureWooHooInteraction(currentInteraction, selectedObject, romanticType, impregnate, style);

                    /*currentInteraction.IsGettingItOn = true;
                     * currentInteraction.WooHooer = Actor;
                     * currentInteraction.WooHooee = selectedObject;
                     *
                     * if (interactionDefinition.Makeout)
                     * {
                     *      currentInteraction.RomanticType = RabbitHoleRomanticType.MakeOut;
                     * }
                     * else if (interactionDefinition.GetStyle(this) == CommonWoohoo.WoohooStyle.TryForBaby)
                     * {
                     *      currentInteraction.RomanticType = RabbitHoleRomanticType.TryForBaby;
                     * }
                     * else
                     * {
                     *      currentInteraction.RomanticType = RabbitHoleRomanticType.WooHoo;
                     * }
                     * currentInteraction.mImpregnate = impregnate;
                     * currentInteraction.mStyle = interactionDefinition.GetStyle(this);
                     * currentInteraction.ActiveStage = currentInteraction.GetStages()[0x1];*/
                }

                msg += "E";

                Target.RabbitHoleProxy.TurnOnWooHooEffect();

                CommonWoohoo.CheckForWitnessedCheating(Actor, selectedObject, true);

                if (Makeout)
                {
                    EventTracker.SendEvent(new WooHooEvent(EventTypeId.kMadeOut, Actor, selectedObject, Target));
                    EventTracker.SendEvent(new WooHooEvent(EventTypeId.kMadeOut, selectedObject, Actor, Target));

                    EventTracker.SendEvent(new SocialEvent(EventTypeId.kSocialInteraction, Actor, selectedObject, "Make Out", false, true, false, CommodityTypes.Undefined));
                    EventTracker.SendEvent(new SocialEvent(EventTypeId.kSocialInteraction, selectedObject, Actor, "Make Out", true, true, false, CommodityTypes.Undefined));
                }

                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, msg, e);
                return(false);
            }
            finally
            {
                Common.DebugNotify(msg);
            }
        }
Exemple #24
0
        public override bool InRabbitHole()
        {
            try
            {
                IWooHooDefinition woohooDefinition = InteractionDefinition as IWooHooDefinition;

                Definition interactionDefinition = InteractionDefinition as Definition;
                bool       shouldBeMaster        = false;
                if (Actor == mWooHooer)
                {
                    shouldBeMaster = true;
                }

                if (Actor.IsActiveSim)
                {
                    PlumbBob.HidePlumbBob();
                }

                if (StartSync(shouldBeMaster, false, null, 0f, false))
                {
                    BeginCommodityUpdates();
                    StartStages();
                    if (shouldBeMaster)
                    {
                        Target.TurnOnWooHooEffect();
                    }

                    mStartedWooHooing = true;
                    RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo);
                    bool succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                    EndCommodityUpdates(succeeded);
                    FinishLinkedInteraction(shouldBeMaster);
                    WaitForSyncComplete();
                    if (shouldBeMaster)
                    {
                        Target.TurnOffWooHooEffect();
                        if (Actor.HasExitReason(ExitReason.StageComplete))
                        {
                            CommonWoohoo.RunPostWoohoo(Actor, mWooHooee, Target, woohooDefinition.GetStyle(this), woohooDefinition.GetLocation(Target), true);

                            if (CommonPregnancy.IsSuccess(Actor, mWooHooee, Autonomous, woohooDefinition.GetStyle(this)))
                            {
                                CommonPregnancy.Impregnate(Actor, mWooHooee, Autonomous, woohooDefinition.GetStyle(this));
                            }
                        }
                    }
                }
                else if (shouldBeMaster && (LinkedInteractionInstance != null))
                {
                    LinkedInteractionInstance.InstanceActor.AddExitReason(ExitReason.CanceledByScript);
                }

                if (Actor.IsActiveSim)
                {
                    PlumbBob.ShowPlumbBob();
                }
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Exemple #25
0
        public static void OnWoohooed(Event e)
        {
            using (Common.TestSpan span = new Common.TestSpan(ScoringLookup.Stats, "Duration CommonWoohoo:OnWoohooed"))
            {
                WooHooEvent wEvent = e as WooHooEvent;
                if (wEvent == null)
                {
                    return;
                }

                Sim actor = wEvent.Actor as Sim;
                if (actor == null)
                {
                    return;
                }

                SimDescription targetDesc = null;

                Sim target = wEvent.TargetObject as Sim;
                if (target != null)
                {
                    targetDesc = target.SimDescription;
                }
                else if (actor.SimDescription.IsPregnant)
                {
                    targetDesc = SimDescription.Find(actor.SimDescription.Pregnancy.DadDescriptionId);
                }

                if (targetDesc == null)
                {
                    return;
                }

                CommonWoohoo.WoohooLocation location = WoohooLocation.Bed;

                CommonWoohoo.WoohooStyle style = WoohooStyle.Safe;

                IWooHooDefinition woohoo = null;

                NRaasWooHooEvent customEvent = wEvent as NRaasWooHooEvent;
                if (customEvent != null)
                {
                    location = customEvent.Location;
                    style    = customEvent.Style;
                }
                else
                {
                    if (actor.CurrentInteraction != null)
                    {
                        woohoo = actor.CurrentInteraction.InteractionDefinition as IWooHooDefinition;
                        if (woohoo == null)
                        {
                            if (actor.CurrentInteraction is Shower.TakeShower)
                            {
                                foreach (Sim sim in actor.LotCurrent.GetAllActors())
                                {
                                    if ((sim.CurrentInteraction != null) && (sim.CurrentInteraction.Target == actor))
                                    {
                                        woohoo = sim.CurrentInteraction.InteractionDefinition as IWooHooDefinition;
                                        if (woohoo != null)
                                        {
                                            break;
                                        }
                                    }
                                }
                            }
                        }

                        if (woohoo != null)
                        {
                            location = woohoo.GetLocation(wEvent.ObjectUsed);

                            style = woohoo.GetStyle(actor.CurrentInteraction);
                            if ((style == WoohooStyle.Safe) && (Woohooer.Settings.ReplaceWithRisky))
                            {
                                style = WoohooStyle.Risky;
                            }
                        }
                    }

                    if (wEvent.BedUsed != null)
                    {
                        if (wEvent.BedUsed is Tent)
                        {
                            location = WoohooLocation.Tent;
                        }
                        else if (wEvent.BedUsed is Igloo)
                        {
                            location = WoohooLocation.Igloo;
                        }
                        else if (wEvent.BedUsed is FairyHouse)
                        {
                            location = WoohooLocation.FairyHouse;
                        }
                    }
                    else if ((woohoo == null) && (wEvent.ObjectUsed != null))
                    {
                        foreach (WoohooLocationControl check in Common.DerivativeSearch.Find <WoohooLocationControl>())
                        {
                            if (check.Matches(wEvent.ObjectUsed))
                            {
                                location = check.Location;
                                break;
                            }
                        }
                    }
                }

                KamaSimtra.AddNotch(actor.SimDescription, targetDesc, actor.LotCurrent, location, style);

                Woohooer.Settings.AddCount(actor);

                WoohooBuffs.Apply(actor, target, style == WoohooStyle.Risky);

                KamaSimtraSettings.ServiceData data = KamaSimtra.Settings.GetServiceData(targetDesc.SimDescriptionId, true);
                if (data != null)
                {
                    data.Dispose();
                }
            }
        }
Exemple #26
0
        public override bool Run()
        {
            try
            {
                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

                bool flag2 = false;
                if (mIsMaster)
                {
                    flag2 = Target.RouteToBotStation(Actor, null);
                }
                else
                {
                    flag2 = Target.RouteToBotStation(Actor, WooHooer);
                }

                if (!flag2)
                {
                    Actor.AddExitReason(ExitReason.Finished);
                    return(false);
                }
                if (mIsMaster && Target.ActorsUsingMe.Contains(WooHooee))
                {
                    return(false);
                }

                StandardEntry();
                EnterStateMachine("BotStationWoohoo", "Enter", "x", "station");
                RegisterForHidingEvents();
                if (mIsMaster && !Actor.HasExitReason())
                {
                    if (WooHooee.InteractionQueue == null)
                    {
                        StandardExit();
                        return(false);
                    }

                    BotMakingStation.WooHoo entry = definition.ProxyClone(WooHooer).CreateInstance(Target, WooHooee, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true) as BotMakingStation.WooHoo;
                    entry.LinkedInteractionInstance = this;
                    entry.WooHooer = WooHooer;
                    entry.WooHooee = WooHooee;
                    WooHooee.InteractionQueue.AddNext(entry);
                }

                AnimateSim("WooHooWait");
                if (StartSync(mIsMaster))
                {
                    BeginCommodityUpdates();

                    try
                    {
                        if (mIsMaster)
                        {
                            Audio.StartObjectSound(Target.ObjectId, "sarcoph_woohoo", false);
                        }

                        CommonWoohoo.TestNakedOutfit(Woohooer.Settings.mNakedOutfitBotMaker, WooHooer, WooHooee);

                        isWooHooing = true;
                        AnimateSim("WooHoo");
                        isWooHooing = false;
                    }
                    finally
                    {
                        EndCommodityUpdates(true);
                    }

                    if (mIsMaster)
                    {
                        CommonWoohoo.RunPostWoohoo(Actor, WooHooee, Target, definition.GetStyle(this), definition.GetLocation(Target), true);

                        do
                        {
                            SpeedTrap.Sleep(0xa);
                        }while (Target.UseCount > 0x1);
                    }
                }
                else if (mIsMaster)
                {
                    if (LinkedInteractionInstance != null)
                    {
                        LinkedInteractionInstance.InstanceActor.AddExitReason(ExitReason.CanceledByScript);
                    }

                    do
                    {
                        SpeedTrap.Sleep(0xa);
                    }while (Target.UseCount > 0x1);
                }

                PrepSimForExit(true);
                AnimateSim("Exit");
                StandardExit();
                if (mIsMaster)
                {
                    if (CommonPregnancy.IsSuccess(WooHooer, WooHooee, Autonomous, definition.GetStyle(this)))
                    {
                        CommonPregnancy.Impregnate(WooHooer, WooHooee, Autonomous, definition.GetStyle(this));
                    }
                }
                else
                {
                    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);
            }
        }
Exemple #27
0
        public override bool Run()
        {
            try
            {
                Actor.GreetSimOnMyLotIfPossible(Target);

                if (StartBedCuddleA.GetCuddleType(Actor, Target) == StartBedCuddleA.CuddleType.CuddleTargetOnDifferentBed)
                {
                    ChildUtils.SetPosturePrecondition(this, CommodityKind.Relaxing, new CommodityKind[] { CommodityKind.NextToTarget });
                    Actor.InteractionQueue.PushAsContinuation(this, true);

                    return(true);
                }

                BedMultiPart container = null;

                try
                {
                    if (Actor.Posture == null)
                    {
                        return(false);
                    }

                    if (!Actor.Posture.Satisfies(CommodityKind.Relaxing, null))
                    {
                        return(false);
                    }

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

                    container = Actor.Posture.Container as BedMultiPart;

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

                    if (IsMaster && ReturnInstance == null)
                    {
                        EnterStateMachine("BedSocials", "FromRelax", "x", "y");
                        AddPersistentScriptEventHandler(0x0, EventCallbackChangeVisibility);
                        SetActor("bed", container);
                        container.PartComp.GetPartSimIsIn(Actor).SetPartParameters(mCurrentStateMachine);
                        WooHoo interaction = InteractionDefinition.CreateInstance(Actor, Target, GetPriority(), false, CancellableByPlayer) as WooHoo;
                        interaction.IsMaster = false;
                        interaction.LinkedInteractionInstance = this;
                        ChildUtils.SetPosturePrecondition(interaction, CommodityKind.Relaxing, new CommodityKind[] { CommodityKind.NextToTarget });
                        Target.InteractionQueue.AddNext(interaction);

                        if (Target.Posture.Container != Actor.Posture.Container)
                        {
                            Actor.LookAtManager.SetInteractionLookAt(Target, 0xc8, LookAtJointFilter.TorsoBones);
                            Actor.Posture.CurrentStateMachine.RequestState("x", "callOver");
                        }

                        Actor.SynchronizationLevel  = Sim.SyncLevel.Started;
                        Actor.SynchronizationTarget = Target;
                        Actor.SynchronizationRole   = Sim.SyncRole.Initiator;

                        if (!StartSync(IsMaster))
                        {
                            return(false);
                        }

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

                        Actor.SocialComponent.StartSocializingWith(Target);
                    }
                    else if (!StartSync(IsMaster))
                    {
                        return(false);
                    }
                }
                catch (ResetException)
                {
                    throw;
                }
                catch (Exception e)
                {
                    Common.DebugException(Actor, Target, e);
                    return(false);
                }

                StandardEntry(false);
                BeginCommodityUpdates();
                bool succeeded = false;

                try
                {
                    if (IsMaster)
                    {
                        if (CommonWoohoo.NeedPrivacy(container.InherentlyProvidesPrivacy, Actor, Target))
                        {
                            mSituation = new WooHooPrivacySituation(this);

                            if (!mSituation.Start())
                            {
                                FinishLinkedInteraction();
                                PostLoop();

                                if (ReturnInstance == null)
                                {
                                    InteractionInstance instance = BedRelax.Singleton.CreateInstance(Actor.Posture.Container, Actor, GetPriority(), true, true);
                                    Actor.InteractionQueue.PushAsContinuation(instance, true);
                                }
                                else
                                {
                                    DoResume();
                                }

                                WooHoo linkedInteractionInstance = LinkedInteractionInstance as WooHoo;

                                if (linkedInteractionInstance != null)
                                {
                                    if (ReturnInstance == null)
                                    {
                                        InteractionInstance instance2 = BedRelax.Singleton.CreateInstance(Target.Posture.Container, Target, GetPriority(), true, true);
                                        Target.InteractionQueue.PushAsContinuation(instance2, true);
                                    }
                                    else
                                    {
                                        linkedInteractionInstance.DoResume();
                                    }

                                    linkedInteractionInstance.Failed = true;
                                }

                                WaitForSyncComplete();

                                return(false);
                            }
                        }

                        IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;
                        Actor.LookAtManager.ClearInteractionLookAt();
                        Target.LookAtManager.ClearInteractionLookAt();

                        if (ReturnInstance != null)
                        {
                            ReturnInstance.EnsureMaster();
                            mCurrentStateMachine = ReturnInstance.mCurrentStateMachine;
                        }

                        StartSocial(CommonSurrogate.GetSocialName(definition.GetStyle(this)));
                        InitiateSocialUI(Actor, Target);
                        WooHoo linked = LinkedInteractionInstance as WooHoo;

                        if (linked != null)
                        {
                            linked.Rejected = Rejected;
                        }

                        if (Rejected)
                        {
                            if (Actor.Posture.Container == Target.Posture.Container)
                            {
                                ThoughtBalloonManager.BalloonData bd = new ThoughtBalloonManager.DoubleBalloonData("balloon_woohoo", "balloon_question");
                                bd.BalloonType = ThoughtBalloonTypes.kSpeechBalloon;
                                Actor.ThoughtBalloonManager.ShowBalloon(bd);
                                AddOneShotScriptEventHandler(0x194, ShowRejectBalloonAndEnqueueRouteAway);
                                mCurrentStateMachine.RequestState(false, "x", "WooHooReject");
                                mCurrentStateMachine.RequestState(true, "y", "WooHooReject");
                                mCurrentStateMachine.RequestState(true, null, "ToRelax");
                            }
                        }
                        else
                        {
                            mCurrentStateMachine.AddOneShotScriptEventHandler(0x6e, OnPregnancyEvent);
                            mCurrentStateMachine.AddOneShotScriptEventHandler(0x6e, EventCallbackChangeClothes);
                            string wooHooEffectName = container.TuningBed.WooHooEffectName;

                            if (!string.IsNullOrEmpty(wooHooEffectName))
                            {
                                mWooHooEffect = VisualEffect.Create(wooHooEffectName);
                                mWooHooEffect.ParentTo(container, Slots.Hash("_FX_0"));
                                AddOneShotScriptEventHandler(0xc8, EventCallbackWooHoo);
                                AddOneShotScriptEventHandler(0xc9, EventCallbackWooHoo);
                            }

                            if (container is BedDreamPod)
                            {
                                AddOneShotScriptEventHandler(0xc8, EventCallbackDreamPodWooHoo);
                                AddOneShotScriptEventHandler(0xc9, EventCallbackDreamPodWooHoo);
                            }

                            Sim.ClothesChangeReason reason = Sim.ClothesChangeReason.GoingToBed;

                            if ((Woohooer.Settings.mNakedOutfitBed) && (!container.IsOutside))
                            {
                                reason = Sim.ClothesChangeReason.GoingToBathe;
                                Woohooer.Settings.AddChange(Actor);
                                Woohooer.Settings.AddChange(Target);
                            }

                            mHelperX = new Sim.SwitchOutfitHelper(Actor, reason);
                            mHelperY = new Sim.SwitchOutfitHelper(Target, reason);
                            mHelperX.Start();
                            mHelperY.Start();
                            mJealousyAlarm = AlarmManager.Global.AddAlarm(kJealousyBroadcasterDelay, TimeUnit.Minutes, StartJealousyBroadcaster, "StartJealousyBroadcaster", AlarmType.DeleteOnReset, container);
                            container.PreWooHooBehavior(Actor, Target, this);
                            mCurrentStateMachine.RequestState(false, "x", "WooHoo");
                            mCurrentStateMachine.RequestState(true, "y", "WooHoo");
                            container.PostWooHooBehavior(Actor, Target, this);
                            Relationship.Get(Actor, Target, true).STC.Update(Actor, Target, CommodityTypes.Amorous, kSTCIncreaseAfterWoohoo);

                            if (CanSleep(Actor, container))
                            {
                                SleepAfter = true;
                            }
                            else
                            {
                                SleepAfter = false;
                                container.PartComp.GetPartSimIsIn(Actor).BedMade = true;
                            }

                            if (CanSleep(Target, container))
                            {
                                (LinkedInteractionInstance as WooHoo).SleepAfter = true;
                            }
                            else
                            {
                                (LinkedInteractionInstance as WooHoo).SleepAfter  = false;
                                container.PartComp.GetPartSimIsIn(Target).BedMade = true;
                            }

                            /*
                             * if (SleepAfter)
                             * {
                             *  mCurrentStateMachine.RequestState(null, "ToSleep");
                             * }
                             * else*/
                            {
                                mCurrentStateMachine.RequestState(null, "ToRelax");
                            }

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

                            if (container is BedDoubleHover)
                            {
                                Actor.BuffManager.AddElement(BuffNames.MeterHighClub, Origin.FromWooHooOnHoverBed);
                                Target.BuffManager.AddElement(BuffNames.MeterHighClub, Origin.FromWooHooOnHoverBed);
                            }

                            if (container is BedDreamPod)
                            {
                                Actor.BuffManager.AddElement(BuffNames.DoubleDreaming, Origin.FromWooHooInDreamPod);
                                Target.BuffManager.AddElement(BuffNames.DoubleDreaming, Origin.FromWooHooInDreamPod);
                            }
                        }

                        FinishSocial(CommonSurrogate.GetSocialName(definition.GetStyle(this)), true);
                        CleanupSituation();
                        Actor.AddExitReason(ExitReason.Finished);
                    }
                    else
                    {
                        container = Target.Posture.Container as BedMultiPart;

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

                        PartComponent <BedData> partComp = container.PartComp;

                        if (partComp.GetSimInOtherPart(Target) == null)
                        {
                            int     num;
                            BedData otherPart = partComp.GetOtherPart(partComp.GetPartSimIsIn(Target));

                            if (!Actor.RouteToSlotListAndCheckInUse(container, otherPart.RoutingSlot, out num))
                            {
                                Actor.AddExitReason(ExitReason.RouteFailed);
                                return(false);
                            }

                            Actor.SynchronizationLevel = Sim.SyncLevel.Routed;

                            if (Rejected)
                            {
                                Actor.PlaySoloAnimation("a2a_bed_relax_cuddle_reject_standing_y", true);
                                Actor.RouteAway(kMinDistanceToMoveAwayWhenRejected, kMaxDistanceToMoveAwayWhenRejected, true,
                                                new InteractionPriority(InteractionPriorityLevel.Zero), false, true, true, RouteDistancePreference.NoPreference);

                                return(true);
                            }

                            if (!otherPart.RelaxOnBed(Actor, "Enter_BedRelax_" + otherPart.StateNameSuffix))
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            Actor.SynchronizationLevel = Sim.SyncLevel.Routed;
                        }

                        DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));

                        if (!Actor.HasExitReason(ExitReason.Finished))
                        {
                            PostLoop();
                            WaitForMasterInteractionToFinish();
                        }
                    }

                    PostLoop();
                    WaitForSyncComplete();

                    succeeded = !Failed && !Rejected;
                }
                finally
                {
                    EndCommodityUpdates(succeeded);
                    StandardExit(false, false);
                }

                if (succeeded)
                {
                    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 (succeeded && SleepAfter)
                {
                    if (!Actor.InteractionQueue.HasInteractionOfType(BedSleep.Singleton))
                    {
                        InteractionInstance instance = BedSleep.Singleton.CreateInstance(container, Actor, GetPriority(), Autonomous, CancellableByPlayer);
                        Actor.InteractionQueue.PushAsContinuation(instance, true);
                    }

                    if (VisitSituation.FindVisitSituationInvolvingGuest(Target) != null && Actor.IsAtHome)
                    {
                        SocialCallback.OnStayOver(Actor, Target, false);
                    }
                    else if (VisitSituation.FindVisitSituationInvolvingGuest(Actor) != null && Target.IsAtHome)
                    {
                        SocialCallback.OnStayOver(Target, Actor, false);
                    }
                }
                else if (!IsOwner(Actor, container))
                {
                    InteractionInstance instance = Actor.Posture.GetStandingTransition();

                    if (instance != null)
                    {
                        Actor.InteractionQueue.Add(instance);
                    }
                }

                return(succeeded);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Woohooer.Settings.AddChange(Actor);
                Woohooer.Settings.AddChange(Target);
                Common.Exception(Actor, Target, e);

                return(false);
            }
        }
Exemple #28
0
        public override bool Run()
        {
            try
            {
                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

                if (mIsMaster && !Actor.HasExitReason())
                {
                    if (!Target.mEnterLine.WaitForTurn(this, Actor, SimQueue.WaitBehavior.Default, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), 30f))
                    {
                        return(false);
                    }

                    List <Sim> exceptionsList = new List <Sim>();
                    exceptionsList.Add(WooHooer);
                    exceptionsList.Add(WooHooee);
                    Target.RemoveSimsExceptFor(exceptionsList);

                    ActorTrailerWooHoo entry = definition.ProxyClone(WooHooer).CreateInstance(Target, WooHooee, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true) as ActorTrailerWooHoo;
                    entry.LinkedInteractionInstance = this;
                    entry.WooHooer = WooHooer;
                    entry.WooHooee = WooHooee;

                    WooHooee.InteractionQueue.AddNext(entry);
                }

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

                if (!Target.RouteToAndEnterActorTrailer(Actor, this, false))
                {
                    return(false);
                }

                StandardEntry(false);
                Actor.LoopIdle();
                if (!StartSync(mIsMaster))
                {
                    StandardExit(false, false);
                    return(false);
                }

                BeginCommodityUpdates();

                try
                {
                    if (mIsMaster)
                    {
                        AcquireStateMachine("ActorTrailerSocials");
                        SetActorAndEnter("x", Actor, "FromRestOrSleep");
                        SetActorAndEnter("y", WooHooee, "FromRestOrSleep");
                        SetActor("Trailer", Target);
                        isWooHooing = true;
                        mWooHooReactionBroadcast = new ReactionBroadcaster(Target, ActorTrailer.kWooHooReactionBroadcastParams, PublicWooHooReactionCallback);
                        RockGemMetalBase.HandleNearbyWoohoo(Target, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo);
                        AnimateJoinSims("WooHoo");

                        CommonWoohoo.TestNakedOutfit(Woohooer.Settings.mNakedOutfitActorTrailer, WooHooer, WooHooee);

                        CommonWoohoo.RunPostWoohoo(WooHooer, 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));
                        }
                        RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo);
                        isWooHooing = false;

                        AnimateNoYield("y", "ToRestOrSleep");
                        AnimateSim("ToRestOrSleep");
                    }
                    FinishLinkedInteraction(mIsMaster);
                    WaitForSyncComplete();
                }
                finally
                {
                    EndCommodityUpdates(true);
                }

                StandardExit(false, false);

                if (mIsMaster)
                {
                    //WooHooer.InteractionQueue.PushAsContinuation(ActorTrailer.Relax.Singleton.CreateInstance(Target, WooHooer, new InteractionPriority(InteractionPriorityLevel.Autonomous), true, true), true);
                    //WooHooee.InteractionQueue.PushAsContinuation(ActorTrailer.Relax.Singleton.CreateInstance(Target, WooHooee, new InteractionPriority(InteractionPriorityLevel.Autonomous), true, true), true);

                    if (mWooHooReactionBroadcast != null)
                    {
                        mWooHooReactionBroadcast.Dispose();
                        mWooHooReactionBroadcast = null;
                    }

                    foreach (Sim sim in Sims3.Gameplay.Queries.GetObjects <Sim>(Target.Position, ActorTrailer.kWooHooReactionBroadcastParams.PulseRadius))
                    {
                        if (sim.RoomId == Target.RoomId)
                        {
                            sim.PlayReaction(ReactionTypes.Cheer, Target, ReactionSpeed.NowOrLater);
                        }
                    }
                }
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Exemple #29
0
        public override bool Run()
        {
            try
            {
                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

                bool flag2 = false;
                if (mIsMaster)
                {
                    WooHooee.InteractionQueue.AddNext(new RouteToObject.Definition(WooHooer).CreateInstance(Target, WooHooee, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true));

                    flag2 = Target.RouteToSarcaphagus(Actor, null);
                }
                else
                {
                    flag2 = Target.RouteToSarcaphagus(Actor, WooHooer);
                }

                if (!flag2)
                {
                    Actor.AddExitReason(ExitReason.Finished);
                    return(false);
                }

                if (mIsMaster && Target.ActorsUsingMe.Contains(WooHooee))
                {
                    return(false);
                }

                StandardEntry();
                EnterStateMachine("Sarcophagus", "Enter", "x", "sarcophagus");
                SetParameter("isMummy", Actor.SimDescription.IsMummy);
                RegisterForHidingEvents();
                AnimateSim("Open");
                if (mIsMaster && !Actor.HasExitReason())
                {
                    SarcophagusWooHoo entry = definition.ProxyClone(WooHooer).CreateInstance(Target, WooHooee, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true) as SarcophagusWooHoo;
                    entry.LinkedInteractionInstance = this;
                    entry.WooHooer = WooHooer;
                    entry.WooHooee = WooHooee;
                    WooHooee.InteractionQueue.AddNext(entry);
                }

                AnimateSim("WooHooWait");
                if (StartSync(mIsMaster))
                {
                    BeginCommodityUpdates();

                    try
                    {
                        if (mIsMaster)
                        {
                            CommonWoohoo.TestNakedOutfit(Woohooer.Settings.mNakedOutfitSarcophagus, WooHooer, WooHooee);

                            mWooHooFX = VisualEffect.Create("sarcophagusCairoWoohooPetals");
                            mWooHooFX.ParentTo(Target, Slot.FXJoint_0);
                            mWooHooFX.Start();
                            Audio.StartObjectSound(Target.ObjectId, "sarcoph_woohoo", false);
                        }
                        isWooHooing = true;
                        RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo);
                        AnimateSim("WooHoo");
                        RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo);
                        isWooHooing = false;
                    }
                    finally
                    {
                        EndCommodityUpdates(true);
                    }

                    if (mIsMaster)
                    {
                        mWooHooFX.Stop();

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

                        do
                        {
                            SpeedTrap.Sleep(0xa);
                        }while (Target.UseCount > 0x1);
                    }
                }
                else if (mIsMaster)
                {
                    if (LinkedInteractionInstance != null)
                    {
                        LinkedInteractionInstance.InstanceActor.AddExitReason(ExitReason.CanceledByScript);
                    }

                    do
                    {
                        SpeedTrap.Sleep(0xa);
                    }while (Target.UseCount > 0x1);
                }

                PrepSimForExit(true);
                Target.EnableRoutingFootprint(Actor);
                AnimateSim("Exit");
                StandardExit();
                if (mIsMaster)
                {
                    if (CommonPregnancy.IsSuccess(WooHooer, WooHooee, Autonomous, definition.GetStyle(this)))
                    {
                        CommonPregnancy.Impregnate(WooHooer, WooHooee, Autonomous, definition.GetStyle(this));
                    }
                }
                else
                {
                    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);
            }
        }