Exemplo n.º 1
0
        public static void OnAccept(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                actor.Motives.SetDecay(CommodityKind.Fun, true);
                target.Motives.SetDecay(CommodityKind.Fun, true);
                actor.Motives.ChangeValue(CommodityKind.Fun, Jetpack.kFunGainJetPackWoohoo);
                target.Motives.ChangeValue(CommodityKind.Fun, Jetpack.kFunGainJetPackWoohoo);

                if (CommonPregnancy.IsSuccess(actor, target, i.Autonomous, CommonWoohoo.WoohooStyle.TryForBaby))
                {
                    CommonPregnancy.Impregnate(actor, target, i.Autonomous, CommonWoohoo.WoohooStyle.TryForBaby);
                }

                CommonWoohoo.RunPostWoohoo(actor, target, actor.GetActiveJetpack(), CommonWoohoo.WoohooStyle.TryForBaby, CommonWoohoo.WoohooLocation.Jetpack, true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
Exemplo n.º 2
0
        public static bool CommonTest(Sim actor, Sim target, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            if ((actor.LotCurrent == null) || (actor.LotCurrent.IsWorldLot))
            {
                greyedOutTooltipCallback = Common.DebugTooltip("Not Current Lot");
                return(false);
            }
            else if (!CommonWoohoo.HasWoohooableObject(actor.LotCurrent, actor, target))
            {
                greyedOutTooltipCallback = Common.DebugTooltip("No Woohoo Locations");
                return(false);
            }
            else if ((actor.Posture != null) && (actor.Posture.Satisfies(CommodityKind.Relaxing, target)))
            {
                greyedOutTooltipCallback = Common.DebugTooltip("Actor Posture Fail");
                return(false);
            }
            else if ((target.Posture != null) && (target.Posture.Satisfies(CommodityKind.Relaxing, actor)))
            {
                greyedOutTooltipCallback = Common.DebugTooltip("Target Posture Fail");
                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
        private new void StartJealousyBroadcaster()
        {
            try
            {
                if (mReactToSocialBroadcaster == null)
                {
                    mReactToSocialBroadcaster = new ReactionBroadcaster(Actor, sBroadcastParams, SocialComponentEx.ReactToJealousEventHigh);
                    CommonWoohoo.CheckForWitnessedCheating(Actor, Target, !Rejected);
                }

                if (IsMaster)
                {
                    BedSurrogate linked = LinkedInteractionInstance as BedSurrogate;

                    if (linked != null)
                    {
                        linked.StartJealousyBroadcaster();
                    }
                }
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }
        }
Exemplo n.º 4
0
        public static void GettingItOnInRabbitHole(InteractionInstance instance, Sim wooHooer, Sim wooHooee, RabbitHoleRomanticType romanticType, RabbitHole.VisitRabbitHoleTuningClass visitTuning, CommonWoohoo.WoohooStyle style, CommonWoohoo.WoohooLocation location, bool impregnate)
        {
            RabbitHole target = instance.Target as RabbitHole;

            if (instance.InstanceActor == wooHooer)
            {
                switch (romanticType)
                {
                case RabbitHoleRomanticType.TryForBaby:
                case RabbitHoleRomanticType.WooHoo:
                    CommonWoohoo.RunPostWoohoo(wooHooer, wooHooee, target, style, location, true);
                    break;
                }

                Relationship relationship = Relationship.Get(wooHooer, wooHooee, true);
                if (relationship != null)
                {
                    relationship.UpdateSTCFromOutsideConversation(wooHooer, wooHooee, visitTuning.WooHooingCommodity, visitTuning.WooHooingSTCIncrement);
                }
            }

            if ((impregnate) && (CommonPregnancy.IsSuccess(wooHooer, wooHooee, instance.Autonomous, style)))
            {
                CommonPregnancy.Impregnate(wooHooer, wooHooee, instance.Autonomous, style);
            }

            target.RabbitHoleProxy.TurnOffWooHooEffect();
        }
Exemplo n.º 5
0
        private new void StartJealousyBroadcaster()
        {
            try
            {
                if (mReactToSocialBroadcaster == null)
                {
                    mReactToSocialBroadcaster = new ReactionBroadcaster(Actor, Conversation.ReactToSocialParams, SocialComponentEx.ReactToJealousEventHigh);
                    CommonWoohoo.CheckForWitnessedCheating(Actor, Actor.SynchronizationTarget, true);
                }

                if (mIsMaster)
                {
                    ElevatorWooHoo linked = LinkedInteractionInstance as ElevatorWooHoo;

                    if (linked != null)
                    {
                        linked.StartJealousyBroadcaster();
                    }
                }
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }
        }
Exemplo n.º 6
0
            protected override bool Satisfies(Sim actor, Sim target, ActorTrailer obj, bool isAutonomous, ref GreyedOutTooltipCallback callback)
            {
                if (!base.Satisfies(actor, target, obj, isAutonomous, ref callback))
                {
                    return(false);
                }

                return(CommonWoohoo.SatisfiesWoohoo(actor, target, "HotTubWoohoo", isAutonomous, true, true, ref callback));
            }
Exemplo n.º 7
0
            public ProxyDefinition(IWooHooProxyDefinition definition, Sim actor, IGameObject obj)
                : base(CommonWoohoo.GetSocialName(definition.GetStyle(null), actor), new string[0x0], null, false)
            {
                mDefinition = definition;

                mObject = obj;

                ChecksToSkip |= ActionData.ChecksToSkip.ProceduralTests;
            }
Exemplo n.º 8
0
            protected override bool Satisfies(Sim actor, Sim target, BotMakingStation obj, bool isAutonomous, ref GreyedOutTooltipCallback callback)
            {
                if (!base.Satisfies(actor, target, obj, isAutonomous, ref callback))
                {
                    return(false);
                }

                return(CommonWoohoo.SatisfiesWoohoo(actor, target, "BotMakerWoohoo", isAutonomous, true, true, ref callback));
            }
Exemplo n.º 9
0
            public override bool Test(Sim a, Computer target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!SimClock.IsNightTime())
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Not Night Time");
                    return(false);
                }

                if (isAutonomous)
                {
                    if (!mRandom)
                    {
                        greyedOutTooltipCallback = Common.DebugTooltip("Not Random");
                        return(false);
                    }

                    if (!Woohooer.Settings.mAutonomousComputer)
                    {
                        greyedOutTooltipCallback = Common.DebugTooltip("No Autonomous");
                        return(false);
                    }

                    if (ScoringLookup.GetScore("LikeProfessional", a.SimDescription) < 0)
                    {
                        greyedOutTooltipCallback = Common.DebugTooltip("Score Fail");
                        return(false);
                    }

                    if (!CommonWoohoo.SatisfiesCooldown(a, RandomUtil.GetRandomObjectFromList <Sim>(LotManager.Actors), isAutonomous, ref greyedOutTooltipCallback))
                    {
                        greyedOutTooltipCallback = Common.DebugTooltip("Cooldown Fail");
                        return(false);
                    }

                    if (!CommonWoohoo.HasWoohooableObject(a.LotHome, a, RandomUtil.GetRandomObjectFromList <Sim>(LotManager.Actors)))
                    {
                        greyedOutTooltipCallback = Common.DebugTooltip("No Woohooable Objects Fail");
                        return(false);
                    }

                    if (GetPotentials(a).Count == 0)
                    {
                        greyedOutTooltipCallback = Common.DebugTooltip("No Choices");
                        return(false);
                    }
                }
                else
                {
                    if (!KamaSimtra.Settings.mShowRegisterInteraction)
                    {
                        greyedOutTooltipCallback = Common.DebugTooltip("User Hidden");
                        return(false);
                    }
                }

                return(true);
            }
Exemplo n.º 10
0
            protected static List <Sim> GetRomanticSims(RabbitHole ths, Sim actor, bool isAutonomous, CommonWoohoo.WoohooStyle style, bool makeout)
            {
                List <Sim> list = new List <Sim>();
                GreyedOutTooltipCallback greyedOutTooltipCallback = null;

                foreach (Sim sim in ths.RabbitHoleProxy.ActorsUsingMe)
                {
                    if (sim == actor)
                    {
                        continue;
                    }

                    if (makeout)
                    {
                        if (!CommonSocials.SatisfiesRomance(actor, sim, "RabbitholeRomance ", isAutonomous, ref greyedOutTooltipCallback))
                        {
                            continue;
                        }

                        list.Add(sim);
                    }
                    else
                    {
                        switch (style)
                        {
                        case CommonWoohoo.WoohooStyle.Risky:
                            if (!CommonPregnancy.SatisfiesRisky(actor, sim, "RabbitholeRisky", isAutonomous, true, ref greyedOutTooltipCallback))
                            {
                                continue;
                            }

                            list.Add(sim);
                            break;

                        case CommonWoohoo.WoohooStyle.Safe:
                            if (!CommonWoohoo.SatisfiesWoohoo(actor, sim, "RabbitholeWoohoo", isAutonomous, true, true, ref greyedOutTooltipCallback))
                            {
                                continue;
                            }

                            list.Add(sim);
                            break;

                        case CommonWoohoo.WoohooStyle.TryForBaby:
                            if (!CommonPregnancy.SatisfiesTryForBaby(actor, sim, "RabbitholeTryForBaby", isAutonomous, true, ref greyedOutTooltipCallback))
                            {
                                continue;
                            }

                            list.Add(sim);
                            break;
                        }
                    }
                }
                return(list);
            }
Exemplo n.º 11
0
        public static bool PublicTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            if (!CommonTest(actor, target, ref greyedOutTooltipCallback))
            {
                return(false);
            }

            ScoringLookup.IncStat("OnTest Woohoo Try");

            return(CommonWoohoo.SatisfiesWoohoo(actor, target, "OnTest Woohoo", isAutonomous, false, true, ref greyedOutTooltipCallback));
        }
Exemplo n.º 12
0
 private void OnJealousyEvent(StateMachineClient smc, IEvent evt)
 {
     if (mReactToSocialBroadcasterActor == null)
     {
         mReactToSocialBroadcasterActor = new ReactionBroadcaster(Actor, Conversation.ReactToSocialParams, SocialComponentEx.ReactToJealousEventHigh);
         CommonWoohoo.CheckForWitnessedCheating(Actor, Target, !Rejected);
     }
     if (mReactToSocialBroadcasterTarget == null)
     {
         mReactToSocialBroadcasterTarget = new ReactionBroadcaster(Target, Conversation.ReactToSocialParams, SocialComponentEx.ReactToJealousEventHigh);
         CommonWoohoo.CheckForWitnessedCheating(Target, Actor, !Rejected);
     }
 }
Exemplo n.º 13
0
            public virtual bool RomanticSimTest(Sim actor, Sim sim, bool isAutonomous)
            {
                GreyedOutTooltipCallback greyedOutTooltipCallback = null;

                switch (GetStyle(null))
                {
                case CommonWoohoo.WoohooStyle.Risky:
                    return(CommonPregnancy.SatisfiesRisky(actor, sim, "RabbitholeRisky", isAutonomous, true, ref greyedOutTooltipCallback));

                case CommonWoohoo.WoohooStyle.TryForBaby:
                    return(CommonPregnancy.SatisfiesTryForBaby(actor, sim, "RabbitholeTryForBaby", isAutonomous, true, ref greyedOutTooltipCallback));
                }
                return(CommonWoohoo.SatisfiesWoohoo(actor, sim, "RabbitholeWoohoo", isAutonomous, true, true, ref greyedOutTooltipCallback));
            }
Exemplo n.º 14
0
            protected override bool Satisfies(Sim a, Sim target, SaunaClassic obj, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    if (!base.Satisfies(a, target, obj, isAutonomous, ref greyedOutTooltipCallback))
                    {
                        return(false);
                    }

                    return(CommonWoohoo.SatisfiesWoohoo(a, target, "SaunaWoohoo", isAutonomous, true, true, ref greyedOutTooltipCallback));
                }
                catch (Exception exception)
                {
                    Common.Exception(a, target, exception);
                }
                return(false);
            }
Exemplo n.º 15
0
            public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    if (!base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback))
                    {
                        return(false);
                    }

                    return(CommonWoohoo.SatisfiesWoohoo(a, target, "SaunaWoohoo", isAutonomous, true, true, ref greyedOutTooltipCallback));
                }
                catch (Exception exception)
                {
                    Common.Exception(a, target, exception);
                }
                return(false);
            }
Exemplo n.º 16
0
            protected override bool Satisfies(Sim actor, Sim target, PetHouse obj, bool isAutonomous, ref GreyedOutTooltipCallback callback)
            {
                try
                {
                    if (!base.Satisfies(actor, target, obj, isAutonomous, ref callback))
                    {
                        return(false);
                    }

                    return(CommonWoohoo.SatisfiesWoohoo(actor, target, "PetHouseWoohoo", isAutonomous, true, true, ref callback));
                }
                catch (Exception exception)
                {
                    Common.Exception(actor, target, exception);
                }
                return(false);
            }
Exemplo n.º 17
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);
            }
        }
Exemplo n.º 18
0
        public override bool Run()
        {
            try
            {
                ProxyDefinition definition = InteractionDefinition as ProxyDefinition;

                if (mIsMaster)
                {
                    Actor.SynchronizationRole   = Sim.SyncRole.Initiator;
                    Actor.SynchronizationTarget = WooHooee;
                }
                else
                {
                    Actor.SynchronizationRole   = Sim.SyncRole.Receiver;
                    Actor.SynchronizationTarget = WooHooer;
                }

                bool success = false;
                try
                {
                    if (mIsMaster && !Actor.HasExitReason())
                    {
                        ElevatorWooHoo entry = definition.ProxyClone(WooHooer).CreateInstance(Target, WooHooee, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true) as ElevatorWooHoo;
                        entry.LinkedInteractionInstance = this;
                        entry.WooHooer = WooHooer;
                        entry.WooHooee = WooHooee;

                        if (!WooHooee.InteractionQueue.AddNext(entry))
                        {
                            return(false);
                        }
                    }

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

                    Actor.LoopIdle();
                    Actor.SynchronizationLevel = Sim.SyncLevel.NotStarted;
                    if (!Actor.WaitForSynchronizationLevelWithSim(Actor.SynchronizationTarget, Sim.SyncLevel.NotStarted, ElevatorDoors.kWooHooSyncTime))
                    {
                        FinishLinkedInteraction(mIsMaster);
                        return(false);
                    }

                    if (!Target.RouteToElevator(Actor))
                    {
                        FinishLinkedInteraction(mIsMaster);
                        return(false);
                    }

                    Target.InteriorObj.AddElevatorColumnToUseList(Actor);
                    Actor.RouteTurnToFace(Target.Position);
                    Actor.LoopIdle();
                    Actor.SynchronizationLevel = Sim.SyncLevel.Started;
                    if (!Actor.WaitForSynchronizationLevelWithSim(Actor.SynchronizationTarget, Sim.SyncLevel.Started, ElevatorDoors.kWooHooSyncTime))
                    {
                        FinishLinkedInteraction(mIsMaster);
                        return(false);
                    }

                    if (!Target.SimLine.WaitForTurn(this, SimQueue.WaitBehavior.CutToHeadOfLine, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), ElevatorDoors.kWooHooSyncTime))
                    {
                        FinishLinkedInteraction(mIsMaster);
                        return(false);
                    }

                    IsDoneRouting       = true;
                    CancellableByPlayer = false;
                    Slot slotName = Slot.RoutingSlot_0;
                    if (!mIsMaster)
                    {
                        slotName = Slot.RoutingSlot_1;
                    }
                    Actor.SimRoutingComponent.DisallowBeingPushed      = true;
                    Actor.SimRoutingComponent.ShouldIgnoreAllObstacles = true;
                    if (!Actor.RouteToSlot(Target.InteriorObj, slotName))
                    {
                        WanderOut();
                        FinishLinkedInteraction(mIsMaster);
                        return(false);
                    }
                    Target.SimLine.RemoveFromQueue(Actor);
                    Actor.LoopIdle();
                    Actor.SynchronizationLevel = Sim.SyncLevel.Routed;
                    if (!Actor.WaitForSynchronizationLevelWithSim(Actor.SynchronizationTarget, Sim.SyncLevel.Routed, ElevatorDoors.kWooHooSyncTime))
                    {
                        WanderOut();
                        FinishLinkedInteraction(mIsMaster);
                        return(false);
                    }
                    IsInsideElevator = true;
                    StandardEntry(false);
                    Actor.LoopIdle();
                    Actor.SimDescription.Contactable = false;
                    if (!StartSync(mIsMaster))
                    {
                        WanderOut();
                        StandardExit(false);
                        return(false);
                    }

                    success = true;
                }
                finally
                {
                    if (!success)
                    {
                        definition.Definition.Restart(mIsMaster, WooHooer, WooHooee, Autonomous, Target);
                    }
                }

                BeginCommodityUpdates();

                try
                {
                    if (mIsMaster)
                    {
                        AcquireStateMachine("Elevator");
                        SetActorAndEnter("x", Actor, "Enter");
                        SetActorAndEnter("y", WooHooee, "Enter");
                        SetActor("elevatorExterior", Target);

                        success = true;

                        if (Woohooer.Settings.UsingTraitScoring)
                        {
                            if (ScoringLookup.GetScore("ElevatorSuccess", Actor.SimDescription) < 0)
                            {
                                success = false;
                            }
                            else if (ScoringLookup.GetScore("ElevatorSuccess", WooHooee.SimDescription) < 0)
                            {
                                success = false;
                            }
                        }

                        if (success)
                        {
                            isWooHooing = true;
                            RockGemMetalBase.HandleNearbyWoohoo(Target, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo);
                            AddOneShotScriptEventHandler(0x6e, WooHooTurnOnCensorBars);
                            AddOneShotScriptEventHandler(0x6f, WooHooTurnOffCensorBars);
                            mJealousyAlarm = AlarmManager.Global.AddAlarm(4f, TimeUnit.Minutes, StartJealousyBroadcaster, "StartJealousyBroadcaster", AlarmType.DeleteOnReset, Target);
                            AnimateJoinSims("WooHooAccept");

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

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

                            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;
                        }
                        else
                        {
                            ElevatorDoors.WooHoo linkedInteractionInstance = LinkedInteractionInstance as ElevatorDoors.WooHoo;
                            if (linkedInteractionInstance != null)
                            {
                                linkedInteractionInstance.IsFail = true;
                            }
                            AddOneShotScriptEventHandler(0x65, new SacsEventHandler(WooHooRejectCallback));
                            AnimateJoinSims("WooHooReject");
                            SpeedTrap.Sleep((uint)SimClock.ConvertToTicks(RandomUtil.RandomFloatGaussianDistribution(ElevatorDoors.kWooHooFailWaitTime[0x0], ElevatorDoors.kWooHooFailWaitTime[0x1]), TimeUnit.Minutes));
                            if (WooHooer.LotHome != Target.LotCurrent)
                            {
                                WooHooer.BuffManager.AddElement(BuffNames.WalkOfShame, Origin.FromRejectedWooHooOffHome);
                            }
                            Relationship.Get(WooHooee, WooHooer, true).LTR.UpdateLiking(ElevatorDoors.kWooHooRejectRelHit);
                        }
                        AnimateNoYield("y", "Exit");
                        AnimateSim("Exit");
                    }
                    Actor.SynchronizationLevel = Sim.SyncLevel.Committed;
                    Actor.WaitForSynchronizationLevelWithSim(Actor.SynchronizationTarget, Sim.SyncLevel.Committed, ElevatorDoors.kWooHooSyncTime);
                    if (IsFail && !mIsMaster)
                    {
                        Actor.SetPosition(Target.InteriorObj.GetPositionOfSlot(Slot.RoutingSlot_0));
                        SpeedTrap.Sleep((uint)SimClock.ConvertToTicks(RandomUtil.RandomFloatGaussianDistribution(ElevatorDoors.kWooHooFailKickerOutWaitTime[0x0], ElevatorDoors.kWooHooFailKickerOutWaitTime[0x1]), TimeUnit.Minutes));
                    }
                    Target.RouteToElevator(Actor);
                    Actor.SynchronizationLevel = Sim.SyncLevel.Completed;
                    Actor.WaitForSynchronizationLevelWithSim(Actor.SynchronizationTarget, Sim.SyncLevel.Completed, ElevatorDoors.kWooHooSyncTime);
                    FinishLinkedInteraction(mIsMaster);
                    WaitForSyncComplete();
                }
                finally
                {
                    EndCommodityUpdates(true);
                }

                StandardExit(false);
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Exemplo n.º 19
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);
            }
        }
Exemplo n.º 20
0
        public override bool InRabbitHole()
        {
            DoChargeCheck(true);
            if (base.InteractionDefinition is TakeElevatorToTopEx.StairsDefinition)
            {
                AddWondrousViewAlarmHandle = Target.AddAlarm((float)EiffelTower.TakeElevatorToTop.kTimeUntilWondrousViewBuff * 2, TimeUnit.Minutes, new AlarmTimerCallback(AddWondrousViewBuffCallback), "AddWondrousViewBuffAlarm", AlarmType.DeleteOnReset);
                AddSoreBuffAlarmHandle     = Target.AddAlarm((float)EiffelTower.TakeElevatorToTop.kTimeUntilSoreBuff, TimeUnit.Minutes, new AlarmTimerCallback(AddSoreBuffCallback), "AddSoreBuffAlarm", AlarmType.DeleteOnReset);
                Actor.AddCardioDelta(EiffelTower.TakeElevatorToTop.kDaysToReachCardioShape);
                Actor.SkillManager.StartGainWithoutSkillMeter(SkillNames.Athletic, EiffelTower.TakeElevatorToTop.kAthleticSkillGainRate, true);
            }
            else
            {
                AddWondrousViewAlarmHandle = Target.AddAlarm((float)EiffelTower.TakeElevatorToTop.kTimeUntilWondrousViewBuff, TimeUnit.Minutes, new AlarmTimerCallback(AddWondrousViewBuffCallback), "AddWondrousViewBuffAlarm", AlarmType.DeleteOnReset);
            }
            try
            {
                Definition definition = InteractionDefinition as Definition;

                StartStages();
                BeginCommodityUpdates();

                bool succeeded = false;
                try
                {
                    succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), new Interaction <Sim, RabbitHole> .InsideLoopFunction(LoopDel), null);
                }
                finally
                {
                    EndCommodityUpdates(succeeded);
                }

                if (IsGettingItOn)
                {
                    if (Actor == WooHooer)
                    {
                        switch (RomanticType)
                        {
                        case RabbitHoleRomanticType.TryForBaby:
                        case RabbitHoleRomanticType.WooHoo:
                            CommonWoohoo.RunPostWoohoo(WooHooer, WooHooee, Target, mStyle, CommonWoohoo.WoohooLocation.EiffelTower, true);
                            break;
                        }

                        Relationship relationship = Relationship.Get(WooHooer, WooHooee, true);
                        if (relationship != null)
                        {
                            relationship.UpdateSTCFromOutsideConversation(WooHooer, WooHooee, definition.VisitTuning.WooHooingCommodity, definition.VisitTuning.WooHooingSTCIncrement);
                        }
                    }

                    if ((mImpregnate) && (CommonPregnancy.IsSuccess(WooHooer, WooHooee, Autonomous, mStyle)))
                    {
                        CommonPregnancy.Impregnate(WooHooer, WooHooee, Autonomous, mStyle);
                    }

                    Target.RabbitHoleProxy.TurnOffWooHooEffect();
                }

                if (Actor.HasExitReason(ExitReason.StageComplete) || (Actor.HasExitReason(ExitReason.Finished) && !IsGettingItOn))
                {
                    Career occupationAsCareer = Actor.OccupationAsCareer;
                    if ((occupationAsCareer != null) && (occupationAsCareer.CareerLoc.Owner == Target))
                    {
                        Actor.BuffManager.AddElement(BuffNames.Bored, definition.VisitBuffOrigin);
                        return(succeeded);
                    }

                    float visitBoredomChanceAdult = definition.VisitTuning.VisitBoredomChanceAdult;
                    if (Actor.SimDescription.Teen)
                    {
                        visitBoredomChanceAdult = definition.VisitTuning.VisitBoredomChanceTeen;
                    }
                    else if (Actor.SimDescription.Child)
                    {
                        visitBoredomChanceAdult = definition.VisitTuning.VisitBoredomChanceChild;
                    }

                    if (RandomUtil.RandomChance(visitBoredomChanceAdult))
                    {
                        Actor.BuffManager.AddElement(BuffNames.Bored, definition.VisitBuffOrigin);
                        return(succeeded);
                    }

                    BuffNames[] namesArray = new BuffNames[] { BuffNames.Excited, BuffNames.Fascinated, BuffNames.Intrigued, BuffNames.Impressed, BuffNames.Educated };
                    Actor.BuffManager.AddElement(namesArray[RandomUtil.GetInt(0x4)], definition.VisitBuffOrigin);
                }
                return(succeeded);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Exemplo n.º 21
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);
            }
        }
Exemplo n.º 22
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);
            }
        }
Exemplo n.º 23
0
        public override bool Run()
        {
            Common.StringBuilder msg = new Common.StringBuilder("WooHooInRabbitHoleWithEx:Run");

            try
            {
                msg += "A";

                BaseDefinition interactionDefinition = InteractionDefinition as BaseDefinition;

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

                msg += "B";

                bool impregnate = true;

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

                    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 VisitRabbitHoleEx;
                if (currentInteraction != null)
                {
                    msg += "D";

                    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 (interactionDefinition.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);
            }
        }
Exemplo n.º 24
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);
            }
        }
Exemplo n.º 25
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);
            }
        }
Exemplo n.º 26
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);
            }
        }
Exemplo n.º 27
0
        public override bool InRabbitHole()
        {
            try
            {
                ActiveStage.Start();

                SimDescription choice = null;

                if (mMaster)
                {
                    if (!AcceptCancelDialog.Show(Common.Localize("Rendezvous:Prompt", Actor.IsFemale, new object[] { KamaSimtra.Settings.mRendezvousCostPerLevel })))
                    {
                        return(false);
                    }

                    Dictionary <int, List <SimDescription> > potentials = KamaSimtra.GetPotentials(Woohooer.Settings.AllowTeen(true));

                    List <SimDescription> choices = new List <SimDescription>();
                    for (int i = 1; i <= 10; i++)
                    {
                        List <SimDescription> fullList;
                        if (!potentials.TryGetValue(i, out fullList))
                        {
                            continue;
                        }

                        bool needFemale = false;

                        if (Actor.SimDescription.CanAutonomouslyBeRomanticWithGender(CASAgeGenderFlags.Male))
                        {
                            if (Actor.SimDescription.CanAutonomouslyBeRomanticWithGender(CASAgeGenderFlags.Female))
                            {
                                if (RandomUtil.CoinFlip())
                                {
                                    needFemale = true;
                                }
                            }
                            else
                            {
                                needFemale = false;
                            }
                        }
                        else if (Actor.SimDescription.CanAutonomouslyBeRomanticWithGender(CASAgeGenderFlags.Female))
                        {
                            needFemale = true;
                        }
                        else
                        {
                            needFemale = !Actor.IsFemale;
                        }

                        List <SimDescription> randomList = new List <SimDescription>();

                        foreach (SimDescription sim in fullList)
                        {
                            if (sim.IsFemale != needFemale)
                            {
                                continue;
                            }

                            if (sim.Household == Actor.Household)
                            {
                                continue;
                            }

                            string reason;
                            GreyedOutTooltipCallback callback = null;
                            if (!CommonSocials.CanGetRomantic(Actor.SimDescription, sim, false, true, true, ref callback, out reason))
                            {
                                if (callback != null)
                                {
                                    Common.DebugNotify(sim.FullName + Common.NewLine + callback());
                                }
                                continue;
                            }

                            if (choices.Contains(sim))
                            {
                                continue;
                            }

                            randomList.Add(sim);
                        }

                        if (randomList.Count > 0)
                        {
                            choices.Add(RandomUtil.GetRandomObjectFromList(randomList));
                        }
                    }

                    if (choices.Count == 0)
                    {
                        Common.Notify(Common.Localize("Rendezvous:NoneAvailable", Actor.IsFemale));
                        return(false);
                    }

                    choice = new SimSelection(Common.Localize("Rendezvous:MenuName"), Actor.SimDescription, choices, SimSelection.Type.Rendezvous, -1000).SelectSingle();
                    if (choice == null)
                    {
                        Common.Notify(Common.Localize("Rendezvous:NoSelect", Actor.IsFemale));
                        return(false);
                    }

                    if (Instantiation.PerformOffLot(choice, Target.LotCurrent, null) == null)
                    {
                        Common.Notify(Common.Localize("Rendezvous:BadSim", Actor.IsFemale, new object[] { choice }));
                        return(false);
                    }

                    Rendezvous interaction = Singleton.CreateInstance(Target, choice.CreatedSim, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true) as Rendezvous;
                    interaction.mMaster = false;
                    interaction.LinkedInteractionInstance = this;

                    choice.CreatedSim.InteractionQueue.CancelAllInteractions();
                    if (!choice.CreatedSim.InteractionQueue.AddNext(interaction))
                    {
                        Common.Notify(Common.Localize("Rendezvous:BadSim", Actor.IsFemale, new object[] { choice }));
                        return(false);
                    }

                    if (!DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), WaitPeriodLoop, null))
                    {
                        Common.Notify(Common.Localize("Rendezvous:BadSim", Actor.IsFemale, new object[] { choice }));
                        return(false);
                    }

                    if (!mBegin)
                    {
                        Common.Notify(Common.Localize("Rendezvous:BadSim", Actor.IsFemale, new object[] { choice }));
                        return(false);
                    }
                    else
                    {
                        Actor.ClearExitReasons();

                        TimedStage stage = new TimedStage(GetInteractionName(), KamaSimtra.Settings.mRendezvousDuration, false, false, true);
                        Stages      = new List <Stage>(new Stage[] { stage });
                        ActiveStage = stage;
                        ActiveStage.Start();
                    }
                }
                else
                {
                    Rendezvous interaction = LinkedInteractionInstance as Rendezvous;
                    if (interaction == null)
                    {
                        return(false);
                    }

                    interaction.mBegin = true;
                }

                if (mMaster)
                {
                    if (!CelebrityManager.TryModifyFundsWithCelebrityDiscount(Actor, Target, KamaSimtra.Settings.mRendezvousCostPerLevel * choice.SkillManager.GetSkillLevel(KamaSimtra.StaticGuid), true))
                    {
                        Common.Notify(Common.Localize("Rendezvous:CannotPay", Actor.IsFemale));
                        return(false);
                    }

                    Common.Notify(choice.CreatedSim, Common.Localize("Rendezvous:Success", Actor.IsFemale, choice.IsFemale, new object[] { choice }));

                    KamaSimtra skill = KamaSimtra.EnsureSkill(Actor);
                    if (skill != null)
                    {
                        skill.RendezvousActive = true;
                    }
                }

                BeginCommodityUpdates();
                bool succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                EndCommodityUpdates(succeeded);

                if (KamaSimtra.Settings.mRandomRendezvousMoodlet)
                {
                    Actor.BuffManager.AddElement(RandomUtil.GetRandomObjectFromList(sRandomBuffs), WoohooBuffs.sWoohooOrigin);
                }

                if (mMaster)
                {
                    CommonWoohoo.WoohooLocation location = CommonWoohoo.WoohooLocation.RabbitHole;

                    List <WoohooLocationControl> choices = CommonWoohoo.GetValidLocations(Actor.SimDescription);
                    if (choices.Count > 0)
                    {
                        location = RandomUtil.GetRandomObjectFromList(choices).Location;
                    }

                    CommonWoohoo.RunPostWoohoo(Actor, choice.CreatedSim, Target, CommonWoohoo.WoohooStyle.Safe, location, false);
                }

                return(succeeded);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Exemplo n.º 28
0
 protected override bool Satisfies(Sim actor, Sim target, ToiletStall obj, bool isAutonomous, ref GreyedOutTooltipCallback callback)
 {
     return(base.Satisfies(actor, target, obj, isAutonomous, ref callback) && CommonWoohoo.SatisfiesWoohoo(actor, target, "ToiletStallWooHoo", isAutonomous, true, true, ref callback));
 }
Exemplo n.º 29
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);
            }
        }
Exemplo n.º 30
0
        public override bool Run()
        {
            bool result = false;

            try
            {
                ProxyDefinition proxyDefinition = base.InteractionDefinition as ProxyDefinition;
                Vector3         slotPosition    = Target.GetSlotPosition(Slot.RoutingSlot_0);
                if (Actor == WooHooer && !Actor.HasExitReason())
                {
                    if (!Target.SimLine.WaitForTurn(this, Actor, SimQueue.WaitBehavior.CutAheadOfLowerPrioritySims, ExitReason.Default, Toilet.kTimeToWaitInLine))
                    {
                        return(result);
                    }
                    //float value1 = Actor.Motives.GetMotiveValue(CommodityKind.Bladder);
                    //float value2 = WooHooee.Motives.GetMotiveValue(CommodityKind.Bladder);
                    isSitting = (Actor.Position - slotPosition).Length() < (WooHooee.Position - slotPosition).Length();                     //(value1 < Math.Min(0, value2)) || (value2 >= 0 && RandomUtil.CoinFlip());
                    ToiletStallWooHoo wooHoo = proxyDefinition.ProxyClone(WooHooee).CreateInstance(Target, WooHooee, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true) as ToiletStallWooHoo;
                    wooHoo.LinkedInteractionInstance = this;
                    wooHoo.WooHooer  = WooHooer;
                    wooHoo.WooHooee  = WooHooee;
                    wooHoo.isSitting = !isSitting;
                    WooHooee.InteractionQueue.AddNext(wooHoo);
                }
                if (base.StartSync(!isSitting))
                {
                    if (!isSitting)
                    {
                        Actor.RouteToPointRadius(slotPosition, 1f);
                    }
                    if ((isSitting || Actor.WaitForSynchronizationLevelWithSim(LinkedInteractionInstance.InstanceActor, Sim.SyncLevel.Routed, 30f)) && Actor.RouteToSlot(Target, Slot.RoutingSlot_0))
                    {
                        Actor.SynchronizationLevel = Sim.SyncLevel.Routed;
                        base.StandardEntry();
                        StateMachineClient stateMachine = Target.GetStateMachine(Actor);

                        if (SitDownAndWait(stateMachine))
                        {
                            BuffInstance element = Actor.BuffManager.GetElement(BuffNames.ReallyHasToPee);
                            if (element != null)
                            {
                                element.mTimeoutPaused = true;
                            }
                            base.BeginCommodityUpdates();
                            isWooHooing = !proxyDefinition.Makeout;
                            bool skipFlush = false;
                            if (isSitting)
                            {
                                Actor.EnableCensor(Sim.CensorType.FullHeight);
                                base.FinishLinkedInteraction(false);
                                skipFlush = !RelieveSelf(element);
                                base.WaitForSyncComplete();
                                Actor.AutoEnableCensor();
                                Actor.BuffManager.UnpauseBuff(BuffNames.ImaginaryFriendFeelOfPorcelain);
                            }
                            else
                            {
                                string stateName = RandomUtil.GetRandomStringFromList(new string[] { "peeStanding", "clean" });
                                stateMachine.RequestState("x", stateName);
                                Actor.EnableCensor(Sim.CensorType.FullHeight);
                                TurnOnWooHooFx();
                                base.DoTimedLoop(RandomUtil.RandomFloatGaussianDistribution(5f, isWooHooing ? 15f : 10f));
                                if (!isWooHooing)
                                {
                                    EventTracker.SendEvent(new SocialEvent(EventTypeId.kSocialInteraction, WooHooer, WooHooee, "Make Out", false, true, false, CommodityTypes.Undefined));
                                    EventTracker.SendEvent(new SocialEvent(EventTypeId.kSocialInteraction, WooHooee, WooHooer, "Make Out", true, true, false, CommodityTypes.Undefined));
                                }
                                else
                                {
                                    EventTracker.SendEvent(EventTypeId.kWooHooed, WooHooer, Target);
                                    EventTracker.SendEvent(EventTypeId.kWooHooed, WooHooee, Target);
                                    CommonWoohoo.RunPostWoohoo(WooHooer, WooHooee, Target, proxyDefinition.GetStyle(this), proxyDefinition.GetLocation(Target), true);
                                    if (CommonPregnancy.IsSuccess(WooHooer, WooHooee, base.Autonomous, proxyDefinition.GetStyle(this)))
                                    {
                                        CommonPregnancy.Impregnate(WooHooer, WooHooee, base.Autonomous, proxyDefinition.GetStyle(this));
                                    }
                                    WooHooer.BuffManager.AddElement(BuffNames.PublicWooHoo, Origin.FromWooHooInPublic);
                                    WooHooee.BuffManager.AddElement(BuffNames.PublicWooHoo, Origin.FromWooHooInPublic);
                                }
                                if (stateName == "clean")
                                {
                                    stateMachine.RequestState("x", "putDown");
                                }
                                RelieveSelf(element);
                                base.EndCommodityUpdates(true);
                                LinkedInteractionInstance.EndCommodityUpdates(true);
                            }
                            isWooHooing = false;
                            Target.Cleanable.DirtyInc(Actor);
                            bool autoFlush = !isSitting || Target.ToiletTuning.AutoFlushes;
                            if (autoFlush || (!skipFlush && Target.ShouldFlush(Actor, base.Autonomous)))
                            {
                                Target.FlushToilet(Actor, stateMachine, !autoFlush);
                            }
                            if (Target.ShouldWashHands(Actor))
                            {
                                Sink sink = Toilet.FindClosestSink(Actor);
                                if (sink != null)
                                {
                                    InteractionInstance interactionInstance = Sink.WashHands.Singleton.CreateInstance(sink, Actor, base.GetPriority(), false, true);
                                    Actor.InteractionQueue.PushAsContinuation(interactionInstance, false);
                                }
                            }
                            result = true;
                        }
                        TurnOffCensorsAndFx();
                        stateMachine.RequestState("x", "Exit");
                        if (!isSitting)
                        {
                            base.FinishLinkedInteraction(true);
                            if (result)
                            {
                                Relationship.Get(WooHooer, WooHooee, true).LTR.UpdateLiking(AllInOneBathroom.kLTRGainFromWoohooInAllInOneBathroom);
                            }
                            Actor.RouteAway(1f, 2f, false, new InteractionPriority(InteractionPriorityLevel.UserDirected), true, false, true, RouteDistancePreference.PreferFurthestFromRouteOrigin);
                        }
                        base.StandardExit();
                    }
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                result = false;
            }
            return(result);
        }