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

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

                CommonWoohoo.RunPostWoohoo(actor, target, actor.GetActiveJetpack(), CommonWoohoo.WoohooStyle.TryForBaby, CommonWoohoo.WoohooLocation.Jetpack, true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
예제 #2
0
        public static new bool StartInternal(Sim abductee, SimDescription alien)
        {
            if (!CommonPregnancy.CanGetPregnant(abductee, true, out string reason))
            {
                Common.DebugNotify("Alien Pregnancy: Auto Fail - " + reason);
                return(false);
            }

            AgingManager.Singleton.CancelAgingAlarmsForSim(abductee.SimDescription.AgingState);

            if (abductee.IsHuman)
            {
                AlienPregnancyProxy pregnancy = new AlienPregnancyProxy(abductee, alien);
                pregnancy.PreggersAlarm = abductee.AddAlarmRepeating(1f, TimeUnit.Hours, new AlarmTimerCallback(pregnancy.HourlyCallback),
                                                                     1f, TimeUnit.Hours, "Hourly Alien Pregnancy Update Alarm", AlarmType.AlwaysPersisted);
                abductee.SimDescription.Pregnancy = pregnancy;
                EventTracker.SendEvent(new PregnancyEvent(EventTypeId.kGotPregnant, abductee, null, pregnancy, null));
            }
            else
            {
                Common.DebugNotify("Alien Pregnancy: Abductee is Pet");
                return(false);
            }

            ((AlienPregnancyProxy)abductee.SimDescription.Pregnancy).ApplyInitialMutationFactors();

            return(true);
        }
예제 #3
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);
                }
            }
        }
예제 #4
0
        public static void GettingItOnInRabbitHole(InteractionInstance instance, Sim wooHooer, Sim wooHooee, RabbitHoleRomanticType romanticType, RabbitHole.VisitRabbitHoleTuningClass visitTuning, CommonWoohoo.WoohooStyle style, CommonWoohoo.WoohooLocation location, bool impregnate)
        {
            RabbitHole target = instance.Target as RabbitHole;

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

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

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

            target.RabbitHoleProxy.TurnOffWooHooEffect();
        }
예제 #5
0
            protected override bool Satisfies(Sim actor, Sim target, BotMakingStation obj, bool isAutonomous, ref GreyedOutTooltipCallback callback)
            {
                if (!base.Satisfies(actor, target, obj, isAutonomous, ref callback))
                {
                    return(false);
                }

                return(CommonPregnancy.SatisfiesRisky(actor, target, "BotMakerRisky", isAutonomous, true, ref callback));
            }
예제 #6
0
            protected override bool Satisfies(Sim actor, Sim target, ActorTrailer obj, bool isAutonomous, ref GreyedOutTooltipCallback callback)
            {
                if (!base.Satisfies(actor, target, obj, isAutonomous, ref callback))
                {
                    return(false);
                }

                return(CommonPregnancy.SatisfiesTryForBaby(actor, target, "HotTubTryForBaby", isAutonomous, true, ref callback));
            }
예제 #7
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));
            }
        }
예제 #8
0
            protected override bool Satisfies(Sim actor, Sim target, UnderwaterCave obj, bool isAutonomous, ref GreyedOutTooltipCallback callback)
            {
                if (!base.Satisfies(actor, target, obj, isAutonomous, ref callback))
                {
                    return(false);
                }

                return(CommonPregnancy.SatisfiesTryForBaby(actor, target, "UnderwaterCaveTryForBabyInCave", isAutonomous, true, ref callback));
            }
예제 #9
0
            protected override bool Satisfies(Sim a, Sim target, HoverTrainStation obj, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!base.Satisfies(a, target, obj, isAutonomous, ref greyedOutTooltipCallback))
                {
                    return(false);
                }

                return(CommonPregnancy.SatisfiesRisky(a, target, "HoverTrainRisky", isAutonomous, true, ref greyedOutTooltipCallback));
            }
예제 #10
0
            protected override bool Satisfies(Sim a, Sim target, Wardrobe obj, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!base.Satisfies(a, target, obj, isAutonomous, ref greyedOutTooltipCallback))
                {
                    return(false);
                }

                return(CommonPregnancy.SatisfiesTryForBaby(a, target, "WardrobeTryForBaby", isAutonomous, true, ref greyedOutTooltipCallback));
            }
예제 #11
0
            protected static List <Sim> GetRomanticSims(RabbitHole ths, Sim actor, bool isAutonomous, CommonWoohoo.WoohooStyle style, bool makeout)
            {
                List <Sim> list = new List <Sim>();
                GreyedOutTooltipCallback greyedOutTooltipCallback = null;

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

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

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

                            list.Add(sim);
                            break;

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

                            list.Add(sim);
                            break;

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

                            list.Add(sim);
                            break;
                        }
                    }
                }
                return(list);
            }
예제 #12
0
        public static bool PublicTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            if (!SimWoohoo.CommonTest(actor, target, ref greyedOutTooltipCallback))
            {
                return(false);
            }

            ScoringLookup.IncStat("OnTest TryForBaby Try");

            return(CommonPregnancy.SatisfiesTryForBaby(actor, target, "OnTest TryForBaby", isAutonomous, false, ref greyedOutTooltipCallback));
        }
예제 #13
0
        public static bool ShouldImpregnate(Sim abductee, SimDescription alien)
        {
            if (!CommonPregnancy.CanGetPregnant(abductee, true, out string reason))
            {
                Common.DebugNotify("Alien Pregnancy: Auto Fail - " + reason);
                return(false);
            }

            float chance = CommonPregnancy.sGetChanceOfSuccess(abductee, alien);

            return(RandomUtil.RandomChance(chance));
        }
예제 #14
0
        private void OnPregnancyEvent(StateMachineClient smc, IEvent evt)
        {
            IWooHooDefinition definition = InteractionDefinition as IWooHooDefinition;

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

            if (pregnancy != null)
            {
                if (RandomUtil.RandomChance(Sims3.Gameplay.Objects.Plumbing.Shower.kChanceOfHydrophobic))
                {
                    pregnancy.SetForcedBabyTrait(TraitNames.Hydrophobic);
                }
            }
        }
예제 #15
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);
                    }
                }
            }
예제 #16
0
            public virtual bool RomanticSimTest(Sim actor, Sim sim, bool isAutonomous)
            {
                GreyedOutTooltipCallback greyedOutTooltipCallback = null;

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

                case CommonWoohoo.WoohooStyle.TryForBaby:
                    return(CommonPregnancy.SatisfiesTryForBaby(actor, sim, "RabbitholeTryForBaby", isAutonomous, true, ref greyedOutTooltipCallback));
                }
                return(CommonWoohoo.SatisfiesWoohoo(actor, sim, "RabbitholeWoohoo", isAutonomous, true, true, ref greyedOutTooltipCallback));
            }
예제 #17
0
            public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    if (!base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback))
                    {
                        return(false);
                    }

                    return(CommonPregnancy.SatisfiesTryForBaby(a, target, "SaunaTryForBaby", isAutonomous, true, ref greyedOutTooltipCallback));
                }
                catch (Exception exception)
                {
                    Common.Exception(a, target, exception);
                }
                return(false);
            }
예제 #18
0
            protected override bool Satisfies(Sim a, Sim target, SaunaClassic obj, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    if (!base.Satisfies(a, target, obj, isAutonomous, ref greyedOutTooltipCallback))
                    {
                        return(false);
                    }

                    return(CommonPregnancy.SatisfiesRisky(a, target, "SaunaRisky", isAutonomous, true, ref greyedOutTooltipCallback));
                }
                catch (Exception exception)
                {
                    Common.Exception(a, target, exception);
                }
                return(false);
            }
예제 #19
0
            protected override bool Satisfies(Sim a, Sim target, PetHouse obj, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    if (!base.Satisfies(a, target, obj, isAutonomous, ref greyedOutTooltipCallback))
                    {
                        return(false);
                    }

                    return(CommonPregnancy.SatisfiesTryForBaby(a, target, "PetHouseTryForBaby", isAutonomous, true, ref greyedOutTooltipCallback));
                }
                catch (Exception exception)
                {
                    Common.Exception(a, target, exception);
                    return(false);
                }
            }
예제 #20
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);
            }
        }
예제 #21
0
        public static bool OnTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (!Jetpack.JetpackTestCommon(actor, target))
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("TestCommon Denied");
                    return(false);
                }

                if (actor.SkillManager.GetSkillLevel(SkillNames.Future) < SocialTest.kFutureSkillRequiredJetpackWoohoo)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Skill Denied");
                    return(false);
                }

                SocialJig socialjig = null;
                if (!Jetpack.CheckSpaceForFlyAroundJig(actor, target, ref socialjig, true, true))
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString("Gameplay/Objects/EP11/Jetpack:NotEnoughSpace", new object[] { target }));
                    return(false);
                }

                if (!Woohooer.Settings.mAutonomousJetPack)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Location Denied");
                    return(false);
                }

                return(CommonPregnancy.SatisfiesTryForBaby(actor, target, "JetPackTryForBaby", isAutonomous, true, ref greyedOutTooltipCallback));
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return(false);
            }
        }
예제 #22
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);
            }
        }
예제 #23
0
            public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    if (!base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback))
                    {
                        return(false);
                    }

                    return(CommonPregnancy.SatisfiesRisky(a, target, "HotAirBalloonRisky", isAutonomous, true, ref greyedOutTooltipCallback));
                }
                catch (ResetException)
                {
                    throw;
                }
                catch (Exception exception)
                {
                    Common.Exception(a, target, exception);
                    return(false);
                }
            }
예제 #24
0
        public override bool Run()
        {
            Target.BuffManager.AddElement(BuffsAndTraits.sAbductedEx, Origin.FromAbduction);

            if (!Target.SimDescription.IsPregnant)
            {
                AbductedEx.BuffInstanceAbductedEx instance = Target.BuffManager.GetElement(BuffsAndTraits.sAbductedEx) as AbductedEx.BuffInstanceAbductedEx;

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

                if (pregnancy != null)
                {
                    instance.IsAlienPregnancy       = true;
                    Target.SimDescription.Pregnancy = pregnancy;
                    EventTracker.SendEvent(EventTypeId.kGotPregnant, Target);
                }
            }


            return(true);
        }
예제 #25
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;
                    }
                }
            }
        }
예제 #26
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);
            }
        }
예제 #27
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);
            }
        }
예제 #28
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);
            }
        }
예제 #29
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);
            }
        }
예제 #30
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);
            }
        }