示例#1
0
        static float GetImpregnationChance(Sim abductee, SimDescription alien)
        {
            float result = Abductor.Settings.mImpregnantionChance;

            if (result <= 0)
            {
                Logger.Append("Alien Pregnancy: Disabled");
                return(0);
            }

            if (Abductor.Settings.mUseFertility)
            {
                if ((abductee.BuffManager != null && abductee.BuffManager.HasElement(BuffNames.ATwinkleInTheEye)) ||
                    abductee.TraitManager.HasElement(TraitNames.FertilityTreatment))
                {
                    result += TraitTuning.kFertilityBabyMakingChanceIncrease;
                }

                if (abductee.BuffManager != null && abductee.BuffManager.HasElement(BuffNames.MagicInTheAir))
                {
                    result += BuffMagicInTheAir.kBabyMakingChanceIncrease;
                }

                if (abductee.TraitManager.HasElement(TraitNames.WishedForLargeFamily))
                {
                    result += 100f;
                    abductee.BuffManager.RemoveElement(BuffNames.WishForLargeFamily);
                }

                if ((alien.CreatedSim != null && alien.CreatedSim.BuffManager != null && alien.CreatedSim.BuffManager.HasElement(BuffNames.ATwinkleInTheEye)) ||
                    alien.TraitManager.HasElement(TraitNames.FertilityTreatment))
                {
                    result += TraitTuning.kFertilityBabyMakingChanceIncrease;
                }

                if (alien.CreatedSim != null && alien.CreatedSim.BuffManager != null && alien.CreatedSim.BuffManager.HasElement(BuffNames.MagicInTheAir))
                {
                    result += BuffMagicInTheAir.kBabyMakingChanceIncrease;
                }

                if (alien.TraitManager.HasElement(TraitNames.WishedForLargeFamily))
                {
                    result += 100f;

                    if (alien.CreatedSim != null)
                    {
                        alien.CreatedSim.BuffManager.RemoveElement(BuffNames.WishForLargeFamily);
                    }
                }

                if (GameUtils.IsInstalled(ProductVersion.EP7) && SimClock.IsNightTime() && SimClock.IsFullMoon())
                {
                    result += Pregnancy.kFullMoonImprovedBabyChance * 100f;
                }
            }

            return(result);
        }
示例#2
0
        public static float OnGetChanceOfSuccess(Sim a, Sim b, CommonWoohoo.WoohooStyle style)
        {
            float chance = 0;

            bool useFertility = true;

            int speciesIndex = PersistedSettings.GetSpeciesIndex(a);

            switch (style)
            {
            case CommonWoohoo.WoohooStyle.Risky:
                if ((a.SimDescription.Teen) || (b.SimDescription.Teen))
                {
                    chance = Woohooer.Settings.mRiskyTeenBabyMadeChance;
                }
                else
                {
                    chance = Woohooer.Settings.mRiskyBabyMadeChanceV2[speciesIndex];
                }

                useFertility = Woohooer.Settings.mRiskyFertility[speciesIndex];
                break;

            case CommonWoohoo.WoohooStyle.TryForBaby:
                if ((a.SimDescription.Teen) || (b.SimDescription.Teen))
                {
                    chance = Woohooer.Settings.mTryForBabyTeenBabyMadeChance;
                }
                else
                {
                    chance = Woohooer.Settings.mTryForBabyMadeChanceV2[speciesIndex];
                }

                useFertility = Woohooer.Settings.mTryForBabyFertility[speciesIndex];
                break;
            }

            if (chance <= 0)
            {
                Common.DebugNotify("Pregnancy: No Chance");
                return(0);
            }

            if (useFertility)
            {
                if (a.IsHuman)
                {
                    if ((a.BuffManager != null) && a.BuffManager.HasTransformBuff())
                    {
                        return(0);
                    }

                    if ((b.BuffManager == null) && b.BuffManager.HasTransformBuff())
                    {
                        return(0);
                    }

                    if ((a.TraitManager.HasElement(TraitNames.FertilityTreatment)) || ((a.BuffManager != null) && a.BuffManager.HasElement(BuffNames.ATwinkleInTheEye)))
                    {
                        chance += TraitTuning.kFertilityBabyMakingChanceIncrease;
                    }

                    if ((b.TraitManager.HasElement(TraitNames.FertilityTreatment)) || ((b.BuffManager != null) && b.BuffManager.HasElement(BuffNames.ATwinkleInTheEye)))
                    {
                        chance += TraitTuning.kFertilityBabyMakingChanceIncrease;
                    }
                }
                else
                {
                    if (a.TraitManager.HasElement(TraitNames.FertilityTreatmentPet))
                    {
                        chance += TraitTuning.kFertilityLitterMakingChanceIncrease;
                    }

                    if (b.TraitManager.HasElement(TraitNames.FertilityTreatmentPet))
                    {
                        chance += TraitTuning.kFertilityLitterMakingChanceIncrease;
                    }
                }

                if (a.TraitManager.HasElement(TraitNames.WishedForLargeFamily))
                {
                    chance += 100f;
                    a.BuffManager.RemoveElement(BuffNames.WishForLargeFamily);
                }

                if (b.TraitManager.HasElement(TraitNames.WishedForLargeFamily))
                {
                    chance += 100f;
                    b.BuffManager.RemoveElement(BuffNames.WishForLargeFamily);
                }

                if ((a.BuffManager != null) && a.BuffManager.HasElement(BuffNames.MagicInTheAir))
                {
                    chance += BuffMagicInTheAir.kBabyMakingChanceIncrease * 100f;
                }

                if ((b.BuffManager != null) && b.BuffManager.HasElement(BuffNames.MagicInTheAir))
                {
                    chance += BuffMagicInTheAir.kBabyMakingChanceIncrease * 100f;
                }

                if ((GameUtils.IsInstalled(ProductVersion.EP7)) && (SimClock.IsNightTime()) && (SimClock.IsFullMoon()))
                {
                    chance += Pregnancy.kFullMoonImprovedBabyChance * 100f;
                }
            }

            return(chance);
        }
示例#3
0
        public static float OnGetChanceOfSuccess(Sim a, Sim b)
        {
            float chance = Abductor.Settings.mImpregnationChance;

            if (chance <= 0)
            {
                Common.DebugNotify("Alien Pregnancy: No Chance");
                return(0);
            }

            bool useFertility = Abductor.Settings.mUseFertility;

            if (useFertility)
            {
                if (a.BuffManager != null && a.BuffManager.HasTransformBuff())
                {
                    return(0);
                }

                if (b.BuffManager != null && b.BuffManager.HasTransformBuff())
                {
                    return(0);
                }

                if ((a.BuffManager != null && a.BuffManager.HasElement(BuffNames.ATwinkleInTheEye)) || a.TraitManager.HasElement(TraitNames.FertilityTreatment))
                {
                    chance += TraitTuning.kFertilityBabyMakingChanceIncrease;
                }

                if (a.BuffManager != null && a.BuffManager.HasElement(BuffNames.MagicInTheAir))
                {
                    chance += BuffMagicInTheAir.kBabyMakingChanceIncrease * 100f;
                }

                if (a.TraitManager.HasElement(TraitNames.WishedForLargeFamily))
                {
                    chance += 100f;
                    a.BuffManager.RemoveElement(BuffNames.WishForLargeFamily);
                }

                if ((b.BuffManager != null && b.BuffManager.HasElement(BuffNames.ATwinkleInTheEye)) || b.TraitManager.HasElement(TraitNames.FertilityTreatment))
                {
                    chance += TraitTuning.kFertilityBabyMakingChanceIncrease;
                }

                if (b.TraitManager.HasElement(TraitNames.WishedForLargeFamily))
                {
                    chance += 100f;
                    b.BuffManager.RemoveElement(BuffNames.WishForLargeFamily);
                }

                if (b.BuffManager != null && b.BuffManager.HasElement(BuffNames.MagicInTheAir))
                {
                    chance += BuffMagicInTheAir.kBabyMakingChanceIncrease * 100f;
                }

                if (GameUtils.IsInstalled(ProductVersion.EP7) && SimClock.IsNightTime() && SimClock.IsFullMoon())
                {
                    chance += Pregnancy.kFullMoonImprovedBabyChance * 100f;
                }
            }

            return(chance);
        }
示例#4
0
        public override bool Run()
        {
            try
            {
                if (!StartSync())
                {
                    return(false);
                }

                StandardEntry(false);
                BeginCommodityUpdates();
                if (IsMaster)
                {
                    ReturnInstance.EnsureMaster();
                    StartSocial("Kiss");
                    InitiateSocialUI(Actor, Target);
                    (LinkedInteractionInstance as NestedCuddleInteraction).Rejected = Rejected;

                    // Custom
                    mReactToSocialBroadcaster = new ReactionBroadcaster(Actor, Conversation.ReactToSocialParams, SocialComponentEx.ReactToJealousEventMedium);
                    //SocialComponent.SendCheatingEvents(Actor, Target, !Rejected);

                    if (Rejected)
                    {
                        ReturnInstance.mCurrentStateMachine.RequestState(null, "KissReject");
                        ReturnInstance.mCurrentStateMachine.RequestState(null, "ExitSitting");
                        FinishSocial("Kiss", true);
                        FinishSocialContext();
                    }
                    else
                    {
                        ReturnInstance.mCurrentStateMachine.RequestState(null, "Kiss");
                        FinishSocial("Kiss", true);
                    }
                }
                else
                {
                    DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                }

                FinishLinkedInteraction(IsMaster);
                EndCommodityUpdates(!Rejected);
                StandardExit(false, false);
                EventTracker.SendEvent(new SocialEvent(EventTypeId.kSocialInteraction, Actor, Target, "Kiss", !IsMaster, !Rejected, false, CommodityTypes.Undefined));
                if (Rejected)
                {
                    InvokeDoResumeOnCleanup = false;
                }
                else
                {
                    Actor.SimDescription.SetFirstKiss(Target.SimDescription);
                    if (SimClock.IsNightTime() && SimClock.IsFullMoon())
                    {
                        Actor.BuffManager.AddElement(BuffNames.KissedUnderFullMoon, Origin.None);
                        EventTracker.SendEvent(EventTypeId.kKissedUnderFullMoon, Actor);
                    }
                }

                WaitForSyncComplete();
                return(!Rejected);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
示例#5
0
        public static float OnGetChanceOfSuccess(Sim abductee, SimDescription alien)
        {
            float chance = Aliens.Settings.mPregnancyChance;

            if (chance <= 0)
            {
                Common.DebugNotify("Abductions: Pregnancy Disabled");
                return(0);
            }

            if (Aliens.Settings.mUseFertility)
            {
                if ((abductee.BuffManager != null && abductee.BuffManager.HasElement(BuffNames.ATwinkleInTheEye)) ||
                    (abductee.TraitManager.HasElement(TraitNames.FertilityTreatment)))
                {
                    chance += TraitTuning.kFertilityBabyMakingChanceIncrease;
                }

                if (abductee.BuffManager != null && abductee.BuffManager.HasElement(BuffNames.MagicInTheAir))
                {
                    chance += BuffMagicInTheAir.kBabyMakingChanceIncrease;
                }

                if (abductee.TraitManager.HasElement(TraitNames.WishedForLargeFamily))
                {
                    chance += 100f;
                    abductee.BuffManager.RemoveElement(BuffNames.WishForLargeFamily);
                }

                if (GameUtils.IsInstalled(ProductVersion.EP7) && SimClock.IsNightTime() && SimClock.IsFullMoon())
                {
                    chance += Pregnancy.kFullMoonImprovedBabyChance;
                }
            }

            return(chance);
        }