Ejemplo n.º 1
0
        public override void OnAddition(BuffManager bm, BuffInstance bi, bool travelReaddition)
        {
            BuffInstanceAbductedEx instance = bi as BuffInstanceAbductedEx;

            List <SimDescription> aliens = AlienUtilsEx.GetAliens(true);

            if (aliens == null)
            {
                return;
            }

            instance.Abductee     = bm.Actor;
            instance.Alien        = RandomUtil.GetRandomObjectFromList <SimDescription>(aliens);
            instance.IsAutonomous = false;

            if (CommonPregnancy.IsSuccess(instance.Abductee, instance.Alien))
            {
                Pregnancy pregnancy = CommonPregnancy.CreatePregnancy(instance.Abductee, instance.Alien, !CommonPregnancy.AllowPlantSimPregnancy());

                if (pregnancy != null)
                {
                    instance.IsAlienPregnancy = true;
                    instance.Abductee.SimDescription.Pregnancy = pregnancy;
                    EventTracker.SendEvent(EventTypeId.kGotPregnant, instance.Abductee);
                }
            }
        }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
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();
        }
Ejemplo n.º 4
0
        private void FirePreggoEx(StateMachineClient sender, IEvent evt)
        {
            IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

            if (CommonPregnancy.IsSuccess(mWoohooer, mWoohooee, Autonomous, definition.GetStyle(this)))
            {
                CommonPregnancy.Impregnate(mWoohooer, mWoohooee, Autonomous, definition.GetStyle(this));
            }
        }
Ejemplo n.º 5
0
            public void Impregnate()
            {
                if (CommonPregnancy.IsSuccess(Abductee, Abductor.CreatedSim, IsAutonomous))
                {
                    Pregnancy pregnancy = CommonPregnancy.CreatePregnancy(Abductee, Abductor, !CommonPregnancy.AllowPlantSimPregnancy());

                    if (pregnancy != null)
                    {
                        IsAlienPregnancy = true;
                        Abductee.SimDescription.Pregnancy = pregnancy;
                        EventTracker.SendEvent(EventTypeId.kGotPregnant, Abductee);
                    }
                }
            }
Ejemplo n.º 6
0
        private void OnBabyCheckEventEx(StateMachineClient smc, IEvent evt)
        {
            try
            {
                ISaunaWooHooDefinition definition = InteractionDefinition as ISaunaWooHooDefinition;

                if (CommonPregnancy.IsSuccess(Actor, Target, Autonomous, definition.GetStyle(this)))
                {
                    Pregnancy pregnancy = CommonPregnancy.Impregnate(Actor, Target, Autonomous, definition.GetStyle(this));
                    if (pregnancy != null)
                    {
                        switch (RandomUtil.GetWeightedIndex(SaunaClassic.kBabyTraitChance))
                        {
                        case 1:
                            pregnancy.SetForcedBabyTrait(TraitNames.Hydrophobic);
                            break;

                        case 2:
                            pregnancy.SetForcedBabyTrait(TraitNames.PartyAnimal);
                            break;
                        }

                        Audio.StartSound("sting_baby_conception");
                        if (definition.TryingFor == TryingFor.TryForBoy)
                        {
                            pregnancy.mGender = CASAgeGenderFlags.Male;
                        }
                        else if (definition.TryingFor == TryingFor.TryForGirl)
                        {
                            pregnancy.mGender = CASAgeGenderFlags.Female;
                        }
                    }
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }
        }
Ejemplo n.º 7
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);
            }
        }
Ejemplo n.º 8
0
        protected void OnBabyCheck(StateMachineClient smc, IEvent evt)
        {
            IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

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

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

                    case 2:
                        pregnancy.SetForcedBabyTrait(TraitNames.PartyAnimal);
                        break;
                    }
                }
            }
        }
Ejemplo n.º 9
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);
            }
        }
Ejemplo n.º 10
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);
            }
        }
Ejemplo n.º 11
0
        public override bool Run()
        {
            try
            {
                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

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

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

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

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

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

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

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

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

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

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

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

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

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

                mWardrobe.RemoveFromUseList(Actor);
                EndCommodityUpdates(true);
                StandardExit();
                mCurrentStateMachine.RemoveEventHandler(ShowX);
                mCurrentStateMachine.RemoveEventHandler(ShowY);
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
        }
Ejemplo n.º 12
0
        public override bool Run()
        {
            try
            {
                ProxyDefinition definition = InteractionDefinition as ProxyDefinition;

                isMaster = (WooHooer == Actor);
                bool flag = false;

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

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

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

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

                if (!Target.RouteToAndEnterPhotoBooth(Actor, this, false, isMaster))
                {
                    if (isMaster)
                    {
                        Target.RemoveSims();
                    }
                    return(false);
                }

                StandardEntry(false);
                Actor.LoopIdle();
                if (!StartSync(isMaster))
                {
                    Target.RouteOutOfPhotoBooth(Actor, this, PhotoBooth.PhotoBoothExitType.Regular);
                    StandardExit(false, false);
                    return(false);
                }

                MotiveDelta[] deltaArray = new MotiveDelta[2];
                deltaArray[0] = AddMotiveDelta(CommodityKind.Fun, 1500f);
                deltaArray[1] = AddMotiveDelta(CommodityKind.Social, 50f);

                BeginCommodityUpdates();
                Target.LockDoor = true;
                if (isMaster)
                {
                    Target.EnableFootprint(PhotoBooth.FootprintPathingHash);
                    AcquireStateMachine("photobooth");
                    SetActorAndEnter("x", Actor, "EnterPhotoBooth");
                    SetActorAndEnter("y", WooHooee, "EnterPhotoBooth");
                    SetActor("PhotoBooth", Target);

                    if (definition.Makeout)
                    {
                        AnimateJoinSims("MakeOut");
                        EventTracker.SendEvent(new SocialEvent(EventTypeId.kSocialInteraction, Actor, WooHooee, "Make Out", false, true, false, CommodityTypes.Undefined));
                        EventTracker.SendEvent(new SocialEvent(EventTypeId.kSocialInteraction, WooHooee, Actor, "Make Out", true, true, false, CommodityTypes.Undefined));
                    }
                    else
                    {
                        isWooHooing = true;

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

                        AnimateJoinSims("WooHoo");

                        EventTracker.SendEvent(EventTypeId.kWoohooInPhotoBooth, Actor, Target);
                        EventTracker.SendEvent(EventTypeId.kWoohooInPhotoBooth, WooHooee, Target);

                        CommonWoohoo.RunPostWoohoo(Actor, 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));
                        }

                        if (RandomUtil.RandomChance01(PhotoBooth.kChanceWooHooPicture))
                        {
                            flag = true;
                        }
                    }

                    isWooHooing = false;
                    AnimateSim("ExitPhotoBooth");
                    AnimateNoYield("y", "ExitPhotoBooth");
                }

                FinishLinkedInteraction(isMaster);
                WaitForSyncComplete();
                if (isMaster)
                {
                    Target.DisableFootprint(PhotoBooth.FootprintPathingHash);
                    if (!definition.Makeout)
                    {
                        Relationship.Get(WooHooer, WooHooee, true).LTR.UpdateLiking(PhotoBooth.kLTRIncreaseOnWoohoo);
                    }

                    if (flag)
                    {
                        Target.RouteOutOfPhotoBooth(WooHooer, this, PhotoBooth.PhotoBoothExitType.ExitAndTear);
                    }
                    else
                    {
                        Target.RouteOutOfPhotoBooth(WooHooer, this, PhotoBooth.PhotoBoothExitType.Regular);
                    }
                }
                else
                {
                    Target.RouteOutOfPhotoBooth(Actor, this, PhotoBooth.PhotoBoothExitType.Regular);
                }

                EndCommodityUpdates(true);
                RemoveMotiveDelta(deltaArray[0x0]);
                RemoveMotiveDelta(deltaArray[0x1]);
                StandardExit(false, false);

                if (isMaster && flag)
                {
                    WooHooer.BuffManager.AddElement(BuffNames.PublicWooHoo, Origin.FromWooHooInPublic);
                    WooHooee.BuffManager.AddElement(BuffNames.PublicWooHoo, Origin.FromWooHooInPublic);

                    WooHooee.ShowTNSIfSelectable(Localization.LocalizeString(WooHooee.IsFemale, "Gameplay/Objects/Entertainment/PhotoBooth:ToreUpPhotoEvidenceTNS", new object[] { WooHooee.FullName }), StyledNotification.NotificationStyle.kGameMessagePositive);
                    WooHooer.ShowTNSIfSelectable(Localization.LocalizeString(WooHooer.IsFemale, "Gameplay/Objects/Entertainment/PhotoBooth:ToreUpPhotoEvidenceTNS", new object[] { WooHooer.FullName }), StyledNotification.NotificationStyle.kGameMessagePositive);
                }

                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Ejemplo n.º 13
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);
            }
        }
Ejemplo n.º 14
0
        public override bool Run()
        {
            try
            {
                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

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

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

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

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

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

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

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

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

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

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

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

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

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

                mIsInCaravan = false;
                EndCommodityUpdates(true);
                StandardExit();
                mCurrentStateMachine.RemoveEventHandler(ShowX);
                mCurrentStateMachine.RemoveEventHandler(ShowY);
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
        }
Ejemplo n.º 15
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);
            }
        }
Ejemplo n.º 16
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);
            }
        }
Ejemplo n.º 17
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);
            }
        }
Ejemplo n.º 18
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);
            }
        }
Ejemplo n.º 19
0
        public override bool Run()
        {
            Common.StringBuilder msg = new Common.StringBuilder("ShowerWoohoo:Run" + Common.NewLine);

            try
            {
                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

                Actor.BuffManager.RemoveElement(BuffNames.RobotForm);

                mSwitchOutfitHelper = new Sim.SwitchOutfitHelper(Actor, Sim.ClothesChangeReason.GoingToBathe);
                mSwitchOutfitHelper.Start();
                if (WaitForBToEnterShower)
                {
                    //Actor.RouteToObjectRadialRange(Shower, 1.5f, 4f);
                    SpeedTrap.Sleep(0xa);
                    while (Shower.SimInShower != Target)
                    {
                        if ((Target.InteractionQueue.GetCurrentInteraction() != TakeShowerInst) || Target.HasExitReason(ExitReason.Canceled))
                        {
                            mSwitchOutfitHelper.Dispose();
                            return(false);
                        }
                        SpeedTrap.Sleep(0xa);
                    }
                }

                msg += "A";

                if (!Actor.RouteToSlot(Shower, Slot.RoutingSlot_0))
                {
                    mSwitchOutfitHelper.Dispose();
                    return(false);
                }

                msg += "B";

                mSwitchOutfitHelper.Wait(true);
                bool flag = Actor.GetCurrentOutfitCategoryFromOutfitInGameObject() == OutfitCategories.Singed;
                Shower.AddToUseList(Actor);
                mInUseList           = true;
                mCurrentStateMachine = TakeShowerInst.mCurrentStateMachine;
                SetActorAndEnter("y", Actor, "Enter");
                if (!WaitForBToEnterShower)
                {
                    mCurrentStateMachine.RequestState("y", "Ask");
                }

                msg += "C";

                string socialName = CommonWoohoo.GetSocialName(definition.GetStyle(this), Actor);
                StartSocial(socialName);

                if (WaitForBToEnterShower)
                {
                    Rejected = false;
                }

                InitiateSocialUI(Actor, Target);

                msg += "D";

                bool succeeded = true;
                if (Rejected)
                {
                    succeeded = false;
                    mCurrentStateMachine.RequestState("y", "Reject");
                    mCurrentStateMachine.RemoveActor(Actor);
                    FinishSocial(socialName, true);
                    Actor.BuffManager.AddElement(BuffNames.WalkOfShame, Origin.FromRejectedWooHooOffHome);
                }
                else
                {
                    mCurrentStateMachine.RequestState("y", "ShooSims");
                    SetParameter("SimShouldClothesChange", !flag && !Actor.OccultManager.DisallowClothesChange());
                    mSwitchOutfitHelper.AddScriptEventHandler(this);
                    Actor.LoopIdle();

                    msg += "E";

                    if (CommonWoohoo.NeedPrivacy(Shower.IsOutside, Actor, Target))
                    {
                        mSituation = new BedWoohoo.WooHooPrivacySituation(this);
                        if (!mSituation.Start())
                        {
                            mSwitchOutfitHelper.Dispose();
                            succeeded = false;
                        }
                    }

                    msg += "F";

                    if ((succeeded) && (Actor.RouteToSlot(Shower, Slot.RoutingSlot_0)))
                    {
                        MotiveDelta[] deltaArray = new MotiveDelta[6];
                        deltaArray[0] = AddMotiveDelta(CommodityKind.Fun, 1500f);
                        deltaArray[1] = TakeShowerInst.AddMotiveDelta(CommodityKind.Fun, 1500f);
                        deltaArray[2] = AddMotiveDelta(CommodityKind.Social, 50f);
                        deltaArray[3] = TakeShowerInst.AddMotiveDelta(CommodityKind.Social, 50f);
                        if (Actor.SimDescription.IsPlantSim)
                        {
                            deltaArray[4] = AddMotiveDelta(CommodityKind.Hygiene, 800f * Sims3.Gameplay.Objects.Plumbing.Shower.kPlantSimHygieneModifier);
                        }
                        else
                        {
                            deltaArray[4] = AddMotiveDelta(CommodityKind.Hygiene, 800f);
                        }

                        if (Actor.SimDescription.IsMermaid)
                        {
                            deltaArray[5] = AddMotiveDelta(CommodityKind.MermaidDermalHydration, 800f);
                        }

                        Target.EnableCensor(Sim.CensorType.FullHeight);
                        RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo);
                        mCurrentStateMachine.AddOneShotScriptEventHandler(0x65, OnJealousyEvent);
                        mCurrentStateMachine.AddOneShotScriptEventHandler(0x66, OnAnimationEvent);

                        if (CommonPregnancy.IsSuccess(Actor, Target, Autonomous, definition.GetStyle(this)))
                        {
                            mCurrentStateMachine.AddOneShotScriptEventHandler(0x67, OnPregnancyEvent);
                        }

                        msg += "G";

                        mSteamVfx = VisualEffect.Create(Shower.SteamVfxName);
                        mSteamVfx.ParentTo(Shower, Shower.IsShowerTub ? Slot.FXJoint_2 : Slot.FXJoint_0);
                        mSteamVfx.Start();
                        mCurrentStateMachine.RequestState(null, "BreatheIdle");
                        RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo);

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

                        msg += "H";

                        Sims3.Gameplay.Objects.Plumbing.Shower.WaitToLeaveShower(Actor, Shower);

                        // Custom
                        ShowerEx.ApplyPostShowerEffects(Actor, Shower);
                        if (flag)
                        {
                            mSwitchOutfitHelper.Dispose();
                            mSwitchOutfitHelper = new Sim.SwitchOutfitHelper(Actor, Sim.ClothesChangeReason.GoingToBathe);
                            mSwitchOutfitHelper.Start();
                            mSwitchOutfitHelper.Wait(false);
                            mSwitchOutfitHelper.ChangeOutfit();
                        }

                        msg += "I";

                        mSwitchOutfitHelper.Dispose();
                        mSwitchOutfitHelper = new Sim.SwitchOutfitHelper(Actor, Sim.ClothesChangeReason.GettingOutOfBath);
                        mSwitchOutfitHelper.Start();
                        mSwitchOutfitHelper.AddScriptEventHandler(this);
                        mSwitchOutfitHelper.Wait(false);
                        RemoveMotiveDelta(deltaArray[0x0]);
                        TakeShowerInst.RemoveMotiveDelta(deltaArray[0x1]);
                        RemoveMotiveDelta(deltaArray[0x2]);
                        TakeShowerInst.RemoveMotiveDelta(deltaArray[0x3]);
                        RemoveMotiveDelta(deltaArray[0x4]);

                        if (Actor.SimDescription.IsMermaid)
                        {
                            RemoveMotiveDelta(deltaArray[0x5]);
                        }

                        mCurrentStateMachine.RequestState("y", "Exit Working Y");
                        Target.AutoEnableCensor();

                        msg += "J";
                    }

                    mCurrentStateMachine.RemoveActor(Actor);
                    FinishSocial(socialName, true);
                }

                msg += "K";

                Shower.RemoveFromUseList(Actor);
                mInUseList = false;
                Actor.RouteAway(Sims3.Gameplay.Objects.Plumbing.Shower.kMinDistanceToMoveAwayFromShower, Sims3.Gameplay.Objects.Plumbing.Shower.kMaxDistanceToMoveAwayFromShower, false, GetPriority(), true, true, true, RouteDistancePreference.PreferFurthestFromRouteOrigin);
                if (mSteamVfx != null)
                {
                    mSteamVfx.Stop();
                    mSteamVfx = null;
                }

                msg += "L";

                EndCommodityUpdates(succeeded);
                return(succeeded);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
            finally
            {
                if (TakeShowerInst != null)
                {
                    TakeShowerInst.HavingWooHoo = false;
                }
            }
        }
Ejemplo n.º 20
0
        public override bool Run()
        {
            try
            {
                string          str2;
                ProxyDefinition definition = InteractionDefinition as ProxyDefinition;

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

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

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

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

                Actor.SimDescription.Contactable = false;
                StandardEntry();
                EnterStateMachine("TimeMachine", "Enter", "x");
                SetActor("timeMachine", Target);
                SetParameter("isFuture", definition.Definition.TimePeriod == TimeMachine.TravelTimePeriod.Future);
                Target.SetMaterial("InUse");
                AddOneShotScriptEventHandler(0x66, ToggleHiddenAnimationEvent);
                if (mIsMaster)
                {
                    AddOneShotScriptEventHandler(0x3ee, OnEnterAnimationEvent);
                }
                else
                {
                    Target.EnableRoutingFootprint(Actor);
                }

                AnimateSim("GetIn");
                if ((WooHooee == null) || WooHooee.HasBeenDestroyed)
                {
                    AnimateSim("WooHoo");
                    Target.PushSimsFromFootprint(TimeMachine.sFootprintPathingHash, Actor, null, true);
                    SpeedTrap.Sleep(0x64);

                    string str;
                    Target.PickExitStateAndSound(definition.Definition.TimePeriod, out str, out mExitSound);
                    if (mIsMaster)
                    {
                        AddOneShotScriptEventHandler(0x3e9, OnExitAnimationEvent);
                        AddOneShotScriptEventHandler(0x3ef, OnExitAnimationEvent);
                    }
                    AddOneShotScriptEventHandler(0x67, ToggleHiddenAnimationEvent);
                    AnimateSim(str);
                    Target.SetMaterial("default");
                    AnimateSim("Exit");
                    StandardExit();
                    return(true);
                }
                if (mIsMaster && !Actor.HasExitReason())
                {
                    TimeMachineWooHoo entry = definition.ProxyClone(WooHooer).CreateInstance(Target, WooHooee, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true) as TimeMachineWooHoo;
                    entry.LinkedInteractionInstance = this;
                    entry.WooHooer = WooHooer;
                    entry.WooHooee = WooHooee;
                    WooHooee.InteractionQueue.AddNext(entry);
                }
                isWooHooing = true;
                RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.MoreWoohoo);
                AnimateSim("WooHoo");
                if (StartSync(mIsMaster))
                {
                    BeginCommodityUpdates();

                    try
                    {
                        DoTimedLoop(RandomUtil.GetFloat(TimeMachine.kWooHooMinutesMin, TimeMachine.kWooHooMinutesMax));
                    }
                    finally
                    {
                        EndCommodityUpdates(true);
                    }

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

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

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

                        if (CommonPregnancy.IsSuccess(WooHooee, WooHooer, Autonomous, definition.GetStyle(this)))
                        {
                            if (WooHooer.IsMale)
                            {
                                Target.AddTryForBabyAlarm(WooHooer.SimDescription.SimDescriptionId, WooHooee.SimDescription.SimDescriptionId, definition.Definition.TimePeriod);
                            }
                            else
                            {
                                Target.AddTryForBabyAlarm(WooHooee.SimDescription.SimDescriptionId, WooHooer.SimDescription.SimDescriptionId, definition.Definition.TimePeriod);
                            }
                        }
                    }
                }
                else if (mIsMaster)
                {
                    Target.PushSimsFromFootprint(TimeMachine.sFootprintPathingHash, Actor, null, true);
                    SpeedTrap.Sleep(0x64);
                    if (LinkedInteractionInstance != null)
                    {
                        LinkedInteractionInstance.InstanceActor.AddExitReason(ExitReason.CanceledByScript);
                    }
                    do
                    {
                        SpeedTrap.Sleep(0xa);
                    }while (Target.UseCount > 0x1);
                }
                Target.PickExitStateAndSound(definition.Definition.TimePeriod, out str2, out mExitSound);
                if (mIsMaster)
                {
                    AddOneShotScriptEventHandler(0x3e9, new SacsEventHandler(OnExitAnimationEvent));
                    AddOneShotScriptEventHandler(0x3ef, new SacsEventHandler(OnExitAnimationEvent));
                }
                AddOneShotScriptEventHandler(0x67, new SacsEventHandler(ToggleHiddenAnimationEvent));
                AnimateSim(str2);
                Target.SetMaterial("default");
                AnimateSim("Exit");
                RockGemMetalBase.HandleNearbyWoohoo(Actor, RockGemMetalBase.HowMuchWooHoo.LessWoohoo);
                isWooHooing = false;
                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);
            }
        }
Ejemplo n.º 21
0
        public override bool Run()
        {
            try
            {
                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

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

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

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

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

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

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

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

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

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

                Animate("x", "WooHoo");

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

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

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

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

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

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

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

                Relationship.Get(Actor, Target, true).LTR.UpdateLiking(AllInOneBathroom.kLTRGainFromWoohooInAllInOneBathroom);
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
        }
Ejemplo n.º 22
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);
            }
        }
Ejemplo n.º 23
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);
        }
Ejemplo n.º 24
0
        public override bool Run()
        {
            try
            {
                if (!(Actor.Posture is FairyHouse.FairyHousePosture))
                {
                    return(false);
                }

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

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

                    IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

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

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

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

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

                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
        }
Ejemplo n.º 25
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);
            }
        }
Ejemplo n.º 26
0
        public override bool Run()
        {
            try
            {
                mLinkedActor = LinkedInteractionInstance.InstanceActor;

                IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

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

                if (!mIsMaster)
                {
                    bool success = false;

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

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

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

                        SpeedTrap.Sleep(0xa);
                    }

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

                bool routeSuccess = false;

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

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

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

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

                StandardEntry();

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

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

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

                    mNowWaiting = true;

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

                BeginCommodityUpdates();

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

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

                int count = 0;

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

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

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

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

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

                    SpeedTrap.Sleep(10);
                }

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

                AnimateSim("Exit");

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

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

                EndCommodityUpdates(succeeded);
                StandardExit();

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

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

                Actor.Wander(1f, 2f, false, RouteDistancePreference.PreferNearestToRouteOrigin, false);
                return(succeeded);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
            finally
            {
                Target.mRoutingSims.Remove(Actor);
            }
        }
Ejemplo n.º 27
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);
            }
        }
Ejemplo n.º 28
0
        public override bool Run()
        {
            try
            {
                if (!SafeToSync())
                {
                    return(false);
                }
                else if (BoxStallToUse == null)
                {
                    return(false);
                }
                else if (!StartSync(IsMaster))
                {
                    return(false);
                }

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

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

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

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

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

                    BeginCommodityUpdates();

                    IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

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

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

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

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

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

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

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

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

                    EndCommodityUpdates(true);
                    FinishLinkedInteraction();
                    WaitForSyncComplete();
                    return(true);
                }
                finally
                {
                    if ((Actor.IsHuman) && (IsMaster))
                    {
                        (BoxStallToUse.PortalComponent as BoxStall.BoxStallPortalComponent).RemovePortals();
                    }
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception exception)
            {
                Common.Exception(Actor, Target, exception);
                return(false);
            }
        }
Ejemplo 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);
            }
        }
Ejemplo n.º 30
0
        public override bool InRabbitHole()
        {
            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.RabbitHole, 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);
            }
        }