Exemplo n.º 1
0
        public override bool HasJobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            if (t == null || pawn == null)
            {
                return(false);
            }
            if (t is Pawn pawn2 &&
                pawn != pawn2 &&
                (forced || canAutoLove(pawn, pawn2)) &&
                !pawn2.Downed &&
                !pawn2.Drafted &&
                !pawn.Drafted &&
                PawnHelper.is_human(pawn) &&
                PawnHelper.is_human(pawn2) &&
                PawnHelper.IsNotWoohooing(pawn) &&
                PawnHelper.IsNotWoohooing(pawn2))
            {
                LocalTargetInfo target = pawn2;
                if (!pawn.CanReserve(target, 1, -1, null, forced))
                {
                    return(false);
                }
                bed = BetterBedFinder.DoBetterBedFinder(pawn, pawn2);
                return(bed != null);
            }

            return(false);
        }
Exemplo n.º 2
0
        public override Job JobOnThing(Pawn pawn, Thing t, bool forced = false)
        {
            if (t == null || pawn == null)
            {
                return(null);
            }

            Pawn pawn2 = t as Pawn;

            if (!PawnHelper.is_human(pawn) || !PawnHelper.is_human(pawn2))
            {
                return(null);
            }

            if (IsMate(pawn, pawn2))
            {
                return(new Job(Constants.JobWooHoo_Baby, pawn2, bed)
                {
                    count = 1
                });
            }
            else
            {
                return(new Job(Constants.JobWooHoo, pawn2, bed)
                {
                    count = 1
                });
            }
        }
Exemplo n.º 3
0
        public static IEnumerable <Toil> MakePartnerWoohoo(Pawn pawn, Pawn mate, Building_Bed bed)
        {
            int tick = 400;

            void NewFunction()
            {
                if (PawnHelper.IsNotWoohooing(mate))
                {
                    /* Log.Message("Asking for love job"); */
                    Job newJob = new Job(Constants.JobWooHooRecieve, pawn, bed)
                    {
                        playerForced = true //its important
                    };
                    mate.jobs.StartJob(newJob, JobCondition.InterruptForced);

                    /* Log.Message("Make Lover Go To Bed"); */
                    //mate.jobs.StartJob(, JobCondition.InterruptForced);
                }
                else
                {
                    /* Log.Message("Partner already doin it"); */
                }
            }

            Toil t = new Toil()
            {
                socialMode = RandomSocialMode.Off,
                tickAction = NewFunction,
                initAction = NewFunction
            };

            t.AddEndCondition(() => PawnHelper.IsNotWoohooing(mate) && (tick--) > 0 ? JobCondition.Ongoing : JobCondition.Succeeded);

            yield return(t);
        }
Exemplo n.º 4
0
        private static void addEqualsMoodlets(Pawn pawn, Pawn mate)
        {
            if (isKinky(pawn) && isKinky(mate) || PawnHelper.isStranger(pawn, mate))
            {
                addMemory(mate, WoohooKink);
                addMemoryOfOther(mate, WoohooKinkMemory, pawn);
                addMemory(pawn, WoohooKink);
                addMemoryOfOther(pawn, WoohooKinkMemory, mate);
            }
            else
            {
                addMemory(mate, WoohooColonist);
                if (Rand.Value < WoohooSettingHelper.latest.lovedItChance)
                {
                    addMemoryOfOther(mate, ThoughtDefOf.GotSomeLovin, pawn);
                }

                addMemory(pawn, WoohooColonist);

                if (Rand.Value < WoohooSettingHelper.latest.lovedItChance)
                {
                    addMemoryOfOther(pawn, ThoughtDefOf.GotSomeLovin, mate);
                }
            }
        }
Exemplo n.º 5
0
        private static void addPrisonMoodlets(Pawn torturer, Pawn victim)
        {
            victim.records.Increment(Constants.HorrificMemories);
            if (PawnHelper.is_bloodlust(torturer) || PawnHelper.is_psychopath(torturer))
            {
                addMemory(torturer, WoohooColonist);
            }
            else if (PawnHelper.is_kind(torturer))
            {
                addMemory(torturer, WoohooColonistRegret);
            }
            else
            {
                addMemory(torturer, WoohooNeutral);
            }


            if (PawnHelper.is_masochist(victim))
            {
                addMemory(victim, MasochistPrisonerWoohoo);
                addMemoryOfOther(victim, MasochistPrisonerWoohooMemory, torturer);
            }
            else
            {
                addMemory(victim, PrisonerWoohoo);
                if (PawnHelper.is_psychopath(victim) || PawnHelper.is_bloodlust(victim))
                {
                    addMemoryOfOther(victim, WoohooNeutral, torturer);
                }
                else
                {
                    addMemoryOfOther(victim, PrisonerWoohooMemory, torturer);
                }
            }
        }
Exemplo n.º 6
0
        public IEnumerable <Toil> MakeMyLoveToils(Pawn pawn, Pawn mate)
        {
            if (!PawnHelper.is_psychopath(pawn) && PawnHelper.isStranger(pawn, mate) && !JailHelper.IsThisJailLovin(pawn, mate))
            {
                /* Log.Message("Lets try and recruit with woohoo as this guest might like you that much"); */
                Toils_Interpersonal.TryRecruit(TargetIndex.A);
            }

            /* Log.Message("Appending Moods"); */
            yield return(MemoryManager.addMoodletsToil(pawn, mate));

            if (isMakeBaby())
            {
                /* Log.Message("Apppending Baby"); */
                yield return(BabyMaker.DoMakeBaby(pawn, mate));
            }
        }
        protected override IEnumerable <Toil> MakeNewToils()
        {
            /* Log.Message("I got asked to do woohoo!!!!"); */
            var list = new List <Toil>();

            list.Add(Toils_Goto.Goto(TargetIndex.A, PathEndMode.ClosestTouch));
            list.Add(Toils_Goto.Goto(TargetIndex.B, PathEndMode.ClosestTouch));
            list.AddRange(WoohooManager.AnimateLovin(pawn, TargetA.Thing as Pawn, TargetB.Thing as Building_Bed));

            Toil t;

            list.Add(t = new Toil {
                initAction = delegate { Log.Message("Getting Woohooing, will be done in 400 ticks"); }, defaultDuration = 400, defaultCompleteMode = ToilCompleteMode.Delay
            });
            t.AddFinishAction(delegate { Log.Message("Done Woohing Get"); });

            PawnHelper.DelayNextWooHoo(pawn);
            //add a moodlet for being asked
            return(list);
        }
Exemplo n.º 8
0
        public override bool TryMakePreToilReservations(bool errorOnFailed)
        {
            Pawn         mate;
            Building_Bed bed;

            if (TargetA != null && TargetA.Thing != null && (mate = TargetA.Thing as Pawn) != null &&
                TargetB != null && TargetB.Thing != null && (bed = TargetB.Thing as Building_Bed) != null &&
                pawn != null &&
                PawnHelper.is_human(pawn) &&
                PawnHelper.is_human(mate) &&
                !bed.IsBurning() &&
                pawn.mindState.canLovinTick < Find.TickManager.TicksGame
                )
            {
                return(true); //base.TryMakePreToilReservations(errorOnFailed);
            }

            Log.Message("[" + pawn.Name +
                        "] can't woohoo right. Timing out their lovin for 500 ticks. They tried to some weird stuff:" +
                        this.GetReport(), true);
            pawn.mindState.canLovinTick = Find.TickManager.TicksGame + 500;

            return(false);
        }
Exemplo n.º 9
0
 private bool AskPartner(Pawn pawn, Pawn mate)
 {
     return(pawn != null && mate != null && (JailHelper.IsThisJailLovin(pawn, mate, null) || !PawnHelper.isStranger(pawn, mate) || Rand.Bool));
 }
Exemplo n.º 10
0
        protected override IEnumerable <Toil> MakeNewToils()
        {
            //Pawn mate = TargetA.Thing as Pawn;
            //Building_Bed bed = TargetB.Thing as Building_Bed;

            Pawn         mate;
            Building_Bed bed;

            if (TargetA != null && TargetA.Thing != null && (mate = TargetA.Thing as Pawn) != null &&
                TargetB != null && TargetB.Thing != null && (bed = TargetB.Thing as Building_Bed) != null &&
                pawn != null &&
                PawnHelper.is_human(pawn) &&
                PawnHelper.is_human(mate) &&
                !bed.IsBurning()
                )
            {
                //everything is in order then
            }
            else
            {
                Log.Error("[" + pawn.Name + "] can't woohoo right.", true);
                EndJobWith(JobCondition.Errored);
                return(null);
            }

            if (pawn == mate)
            {
                throw new Exception("You cant WooHoo Alone and Together with yourself");
            }

            var hookupBedManager = new HookupBedManager(bed);

            bool partnerSaidYes;
            IEnumerable <Toil> toilsAskForWoohoo;

            if (PawnHelper.IsNotWoohooing(mate))
            {
                pawn.records.Increment(Constants.CountAskedForWoohoo);
                mate.records.Increment(Constants.CountGotAskedToWooHoo);

                partnerSaidYes = AskPartner(pawn, mate);

                toilsAskForWoohoo = WoohooManager.ToilsAskForWoohoo(pawn, mate, bed, partnerSaidYes, hookupBedManager);
            }
            else
            {
                /* Log.Message("Partner already woohooin, dont need to ask."); */
                partnerSaidYes    = true;
                toilsAskForWoohoo = nothing();
            }

            ///Log.Message("[WooHoo]Toils Ongoing: ["+r.Count()+"]");
            if (partnerSaidYes)
            {
                toilsAskForWoohoo = toilsAskForWoohoo?.Union(WoohooManager.MakePartnerWoohoo(pawn, mate, bed))
                                    .Union(WoohooManager.AnimateLovin(pawn, mate, bed))
                                    .Union(MakeMyLoveToils(pawn, mate))
                                    .Union(
                    WoohooManager.AnimateLovin(pawn, mate, bed,
                                               null
                                               , 500)
                    );
            }
            else
            {
                mate.records.Increment(Constants.CountGotAskedToWooHooSaidNo);
            }

            toilsAskForWoohoo = toilsAskForWoohoo?.Union(hookupBedManager.GiveBackToil());

            /* Log.Message("[WooHoo]Toils: ["+r.Count()+"]"); */
            PawnHelper.DelayNextWooHoo(pawn);

            return(toilsAskForWoohoo);
        }
Exemplo n.º 11
0
 private static bool isKinky(Pawn pawn)
 {
     return(PawnHelper.is_bloodlust(pawn) || PawnHelper.is_psychopath(pawn) || PawnHelper.is_masochist(pawn));
 }