Example #1
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);
            }
        }
Example #2
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);
            }
        }
Example #3
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);
            }
        }
Example #4
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);
            }
        }
Example #5
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);
            }
        }
Example #6
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);
            }
        }
Example #7
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);
            }
        }