Exemplo n.º 1
0
        public static Pawn find_breeder_animal(Pawn pawn, Map m)
        {
            DebugText("BreederHelper::find_breeder_animal( " + xxx.get_pawnname(pawn) + " ) called");

            float min_fuckability = 0.10f;                                      // Don't rape pawns with <10% fuckability
            float avg_fuckability = 0f;                                         // Average targets fuckability, choose target higher than that
            var   valid_targets   = new Dictionary <Pawn, float>();             // Valid pawns and their fuckability
            Pawn  chosentarget    = null;                                       // Final target pawn

            //Pruning initial pawn list.
            IEnumerable <Pawn> targets = m.mapPawns.AllPawnsSpawned.Where(x
                                                                          => x != pawn &&
                                                                          xxx.is_animal(x) &&
                                                                          xxx.can_get_raped(x) &&
                                                                          !x.IsForbidden(pawn) &&
                                                                          !x.Suspended &&
                                                                          !x.HostileTo(pawn) &&
                                                                          pawn.CanReserveAndReach(x, PathEndMode.Touch, Danger.Some, max_animals_at_once)
                                                                          //&& SameRace ? pawn.kindDef.race == x.kindDef.race : true
                                                                          );

            if (targets.Any())
            {
                var partBPR = Genital_Helper.get_genitalsBPR(pawn);
                var parts   = Genital_Helper.get_PartsHediffList(pawn, partBPR);

                //filter pawns for female, who can f**k her
                //not sure if faction check should be but w/e
                if (!Genital_Helper.has_penis_fertile(pawn, parts) && !Genital_Helper.has_penis_infertile(pawn, parts) && (Genital_Helper.has_vagina(pawn, parts) || Genital_Helper.has_anus(pawn)))
                {
                    targets = targets.Where(x => xxx.can_fuck(x) && x.Faction == pawn.Faction);
                }

                //for humans, animals dont have need - always = 3f
                //if not horny, seek only targets with safe temp
                if (xxx.need_some_sex(pawn) < 3.0f)
                {
                    targets = targets.Where(x => pawn.CanReach(x, PathEndMode.Touch, Danger.None));
                }

                //Used for interspecies animal-on-animal.
                //Animals will only go for targets they can see.
                if (xxx.is_animal(pawn))
                {
                    targets = targets.Where(x => pawn.CanSee(x) && pawn.def.defName != x.def.defName);
                }
                else
                {
                    // Pickier about the targets if the pawn has no prior experience.
                    if (pawn.records.GetValue(xxx.CountOfSexWithAnimals) < 3 && !xxx.is_zoophile(pawn))
                    {
                        min_fuckability *= 2f;
                    }

                    if (xxx.is_frustrated(pawn))
                    {                       // Less picky when frustrated...
                        min_fuckability *= 0.6f;
                    }
                    else if (!xxx.is_hornyorfrustrated(pawn))
                    {                       // ...and far more picky when satisfied.
                        min_fuckability *= 2.5f;
                    }
                }
            }

            DebugText("[RJW]BreederHelper::find_breeder_animal::" + targets.Count() + " targets found on map.");

            if (!targets.Any())
            {
                return(null);                //None found.
            }

            foreach (Pawn target in targets)
            {
                DebugText("[RJW]BreederHelper::find_breeder_animal::Checking target " + target.kindDef.race.defName.ToLower());

                if (!xxx.can_path_to_target(pawn, target.Position))
                {
                    continue;                                             // too far
                }
                float fuc = SexAppraiser.would_fuck_animal(pawn, target); // 0.0 to ~3.0, orientation checks etc.

                if (!(fuc > min_fuckability))
                {
                    continue;
                }
                DebugText("Adding target" + target.kindDef.race.defName.ToLower());
                valid_targets.Add(target, fuc);
            }

            DebugText(valid_targets.Count() + " valid targets found on map.");
            //Rand.PopState();
            //Rand.PushState(RJW_Multiplayer.PredictableSeed());
            if (valid_targets.Any())
            {
                avg_fuckability = valid_targets.Average(x => x.Value);

                // choose pawns to f**k with above average fuckability
                var valid_targetsFilteredAnimals = valid_targets.Where(x => x.Value >= avg_fuckability);

                if (valid_targetsFilteredAnimals.Any())
                {
                    chosentarget = valid_targetsFilteredAnimals.RandomElement().Key;
                }
            }

            return(chosentarget);
        }
        public override bool MoreChecks(Pawn pawn, Thing t, bool forced = false)
        {
            //Log.Message("[RJW]" + this.GetType().ToString() + ":: base checks: pass");
            if (!RJWSettings.bestiality_enabled)
            {
                return(false);
            }

            Pawn target = t as Pawn;

            if (!WorkGiverChecks(pawn, t, forced))
            {
                return(false);
            }

            if (!xxx.can_be_fucked(pawn))
            {
                if (RJWSettings.DevMode)
                {
                    JobFailReason.Is("pawn cant be f****d");
                }
                return(false);
            }

            if (!(pawn.IsDesignatedHero() || RJWSettings.override_control))
            {
                if (!RJWSettings.WildMode)
                {
                    if (!xxx.is_zoophile(pawn) && !xxx.is_frustrated(pawn))
                    {
                        if (RJWSettings.DevMode)
                        {
                            JobFailReason.Is("not willing to have sex with animals");
                        }
                        return(false);
                    }
                    if (!xxx.is_hornyorfrustrated(pawn))
                    {
                        if (RJWSettings.DevMode)
                        {
                            JobFailReason.Is("not horny enough");
                        }
                        return(false);
                    }
                    if (!xxx.is_healthy_enough(target))
                    {
                        if (RJWSettings.DevMode)
                        {
                            JobFailReason.Is("target not healthy enough");
                        }
                        return(false);
                    }

                    //Log.Message("[RJW]WorkGiver_BestialityForFemale::" + SexAppraiser.would_fuck_animal(pawn, target));
                    if (SexAppraiser.would_fuck_animal(pawn, target) < 0.1f)
                    {
                        return(false);
                    }
                    //add some more fancy conditions from JobGiver_Bestiality?
                }
            }

            //Log.Message("[RJW]" + this.GetType().ToString() + ":: extended checks: can start sex");
            return(true);
        }
        public static Pawn find_targetCP(Pawn pawn, Map m)
        {
            if (!DesignatorsData.rjwComfort.Any())
            {
                return(null);
            }

            float min_fuckability = 0.10f;                                              // Don't rape prisoners with <10% fuckability
            float avg_fuckability = 0f;                                                 // Average targets fuckability, choose target higher than that
            var   valid_targets   = new Dictionary <Pawn, float>();                     // Valid pawns and their fuckability
            Pawn  chosentarget    = null;                                               // Final target pawn

            IEnumerable <Pawn> targets = DesignatorsData.rjwComfort.Where(x
                                                                          => x != pawn &&
                                                                          xxx.can_get_raped(x) &&
                                                                          pawn.CanReserveAndReach(x, PathEndMode.Touch, Danger.Some, xxx.max_rapists_per_prisoner, 0) &&
                                                                          !x.IsForbidden(pawn) &&
                                                                          SexAppraiser.would_rape(pawn, x)
                                                                          );

            if (xxx.is_animal(pawn))
            {
                // Animals only consider targets they can see, instead of seeking them out.
                targets = targets.Where(x => pawn.CanSee(x)).ToList();
            }

            foreach (Pawn target in targets)
            {
                if (!xxx.can_path_to_target(pawn, target.Position))
                {
                    continue;                    // too far
                }
                float fuc = 0f;
                if (xxx.is_animal(target))
                {
                    fuc = SexAppraiser.would_fuck_animal(pawn, target, true);
                }
                else if (xxx.is_human(target))
                {
                    fuc = SexAppraiser.would_fuck(pawn, target, true);
                }

                if (fuc > min_fuckability)
                {
                    valid_targets.Add(target, fuc);
                }
            }

            if (valid_targets.Any())
            {
                // avg_fuckability = valid_targets.Average(x => x.Value); // disabled for CP

                // choose pawns to f**k with above average fuckability
                var valid_targetsFiltered = valid_targets.Where(x => x.Value >= avg_fuckability);

                if (valid_targetsFiltered.Any())
                {
                    chosentarget = valid_targetsFiltered.RandomElement().Key;
                }
            }

            return(chosentarget);
        }