예제 #1
0
        public override void NeedInterval()         //150 ticks between each calls from Pawn_NeedsTracker()
        {
            if (isInvisible)
            {
                return;                        // no caravans
            }
            if (needsex_tick <= 0)             // every 10 ticks - real tick
            {
                std_updater.update(pawn);

                if (xxx.is_asexual(pawn))
                {
                    CurLevel = 0.5f;
                    return;
                }

                //--Log.Message("[RJW]Need_Sex::NeedInterval is called0 - pawn is "+xxx.get_pawnname(pawn));
                needsex_tick = needsex_tick_timer;

                if (!def.freezeWhileSleeping || pawn.Awake())
                {
                    var fall_per_call = 150 * needsex_tick_timer * fall_per_tick(pawn);
                    CurLevel -= fall_per_call * xxx.get_sex_drive(pawn) * RJWSettings.sexneed_decay_rate;
                    // Each day has 60000 ticks, each hour has 2500 ticks, so each hour has 50/3 calls, in other words, each call takes .06 hour.

                    //Log.Message("[RJW] " + xxx.get_pawnname(pawn) + "'s sex need stats:: Decay/call: " + fall_per_call * decay_rate_modifier * xxx.get_sex_drive(pawn) + ", Cur.lvl: " + CurLevel + ", Dec. rate: " + decay_rate_modifier + ", Sex drive: " +  xxx.get_sex_drive(pawn));

                    if (CurLevel < thresh_horny())
                    {
                        SexUtility.OffsetPsyfocus(pawn, -0.01f);
                    }
                    if (CurLevel < thresh_frustrated() || CurLevel > thresh_ahegao())
                    {
                        SexUtility.OffsetPsyfocus(pawn, -0.05f);
                    }
                }

                //--Log.Message("[RJW]Need_Sex::NeedInterval is called1");

                //If they need it, they should seek it
                if (CurLevel < thresh_horny() && (pawn.mindState.canLovinTick - Find.TickManager.TicksGame > 300))
                {
                    pawn.mindState.canLovinTick = Find.TickManager.TicksGame + 300;
                }

                // the bootstrap of the mapInjector will only be triggered once per visible pawn.
                if (!BootStrapTriggered)
                {
                    //--Log.Message("[RJW]Need_Sex::NeedInterval::calling boostrap - pawn is " + xxx.get_pawnname(pawn));
                    xxx.bootstrap(pawn.Map);
                    BootStrapTriggered = true;
                }
            }
            else
            {
                needsex_tick--;
            }
            //--Log.Message("[RJW]Need_Sex::NeedInterval is called2 - needsex_tick is "+needsex_tick);
        }
예제 #2
0
        /// <summary>
        /// handle Psyfocus
        /// </summary>
        public void ChangePsyfocus(Pawn pawn, Thing target)
        {
            if (pawn.jobs?.curDriver is JobDriver_ViolateCorpse)
            {
                if (xxx.is_necrophiliac(pawn) && MeditationFocusTypeAvailabilityCache.PawnCanUse(pawn, DefDatabase <MeditationFocusDef> .GetNamedSilentFail("Morbid")))
                {
                    SexUtility.OffsetPsyfocus(pawn, 0.01f);
                }
            }

            if (target != null)
            {
                var partner = target as Pawn;
                if (partner != null)
                {
                    if (xxx.is_nympho(pawn))
                    {
                        SexUtility.OffsetPsyfocus(pawn, 0.01f);
                    }
                    else if (xxx.is_zoophile(pawn) && xxx.is_animal(partner) && MeditationFocusTypeAvailabilityCache.PawnCanUse(pawn, MeditationFocusDefOf.Natural))
                    {
                        SexUtility.OffsetPsyfocus(pawn, 0.01f);
                    }

                    if (xxx.is_nympho(partner))
                    {
                        SexUtility.OffsetPsyfocus(partner, 0.01f);
                    }
                    else if (xxx.is_zoophile(partner) && xxx.is_animal(pawn) && MeditationFocusTypeAvailabilityCache.PawnCanUse(partner, MeditationFocusDefOf.Natural))
                    {
                        SexUtility.OffsetPsyfocus(partner, 0.01f);
                    }

                    if (xxx.RoMIsActive)
                    {
                        if (pawn.story.traits.HasTrait(TraitDef.Named("Succubus")))
                        {
                            SexUtility.OffsetPsyfocus(pawn, 0.01f);
                        }

                        if (partner.story.traits.HasTrait(TraitDef.Named("Succubus")))
                        {
                            SexUtility.OffsetPsyfocus(partner, 0.01f);
                        }
                    }
                }
            }
        }