Exemplo n.º 1
0
 public static bool RaceHasSexNeed(this Pawn pawn)
 {
     // True by default.
     if (RaceGroupDef_Helper.TryGetRaceGroupDef(pawn, out var raceGroupDef))
     {
         return(raceGroupDef.hasSexNeed);
     }
     return(true);
 }
Exemplo n.º 2
0
 public static bool RaceImplantEggs(this Pawn pawn)
 {
     // False by default.
     if (RaceGroupDef_Helper.TryGetRaceGroupDef(pawn, out var raceGroupDef))
     {
         return(raceGroupDef.ImplantEggs);
     }
     return(false);
 }
Exemplo n.º 3
0
 public static bool RaceHasOviPregnancy(this Pawn pawn)
 {
     // False by default.
     if (RaceGroupDef_Helper.TryGetRaceGroupDef(pawn, out var raceGroupDef))
     {
         return(raceGroupDef.oviPregnancy);
     }
     return(false);
 }
Exemplo n.º 4
0
 public static bool Has(this Pawn pawn, RaceTag tag)
 {
     if (RaceGroupDef_Helper.TryGetRaceGroupDef(pawn, out var raceGroupDef))
     {
         return(raceGroupDef.tags != null && raceGroupDef.tags.Contains(tag.Key));
     }
     else
     {
         return(tag.DefaultWhenNoRaceGroupDef(pawn));
     }
 }
Exemplo n.º 5
0
        public static void sexualize_pawn(Pawn pawn)
        {
            //Log.Message("[RJW] sexualize_pawn( " + xxx.get_pawnname(pawn) + " ) called");
            if (pawn == null)
            {
                return;
            }

            if (RaceGroupDef_Helper.TryGetRaceGroupDef(pawn, out var raceGroupDef) &&
                raceGroupDef.hasSingleGender)
            {
                Log.Message($"[RJW] sexualize_pawn() - sexualizing single gender pawn {xxx.get_pawnname(pawn)}  race: {raceGroupDef.defName}");
                SexualizeSingleGenderPawn(pawn);
            }
            else if (pawn.RaceProps.hasGenders)
            {
                SexualizeGenderedPawn(pawn);
            }
            else
            {
                if (Current.ProgramState == ProgramState.Playing)                 // DO NOT run at world generation, throws error in generating relationship stuff
                {
                    SexulaizeGenderlessPawn(pawn);
                    return;
                }
            }

            if (!pawn.Dead)
            {
                //Add ticks at generation, so pawns don't instantly start lovin' when generated (esp. on scenario start).
                //if (xxx.RoMIsActive && pawn.health.hediffSet.HasHediff(HediffDef.Named("TM_ShapeshiftHD"))) // Rimworld of Magic's polymorph/shapeshift
                //	pawn.mindState.canLovinTick = Find.TickManager.TicksGame + (int)(SexUtility.GenerateMinTicksToNextLovin(pawn) * Rand.Range(0.01f, 0.05f));
                if (!xxx.is_insect(pawn))
                {
                    pawn.mindState.canLovinTick = Find.TickManager.TicksGame + (int)(SexUtility.GenerateMinTicksToNextLovin(pawn) * Rand.Range(0.1f, 1.0f));
                }
                else
                {
                    pawn.mindState.canLovinTick = Find.TickManager.TicksGame + (int)(SexUtility.GenerateMinTicksToNextLovin(pawn) * Rand.Range(0.01f, 0.2f));
                }

                //Log.Message("[RJW] sexualize_pawn( " + xxx.get_pawnname(pawn) + " ) add sexneed");
                if (pawn.RaceProps.Humanlike)
                {
                    var sex_need = pawn.needs.TryGetNeed <Need_Sex>();
                    if (pawn.Faction != null && !(pawn.Faction?.IsPlayer ?? false) && sex_need != null)
                    {
                        sex_need.CurLevel = Rand.Range(0.01f, 0.75f);
                    }
                }
            }
        }
Exemplo n.º 6
0
        public PawnData(Pawn pawn)
        {
            //Log.Message("Creating pawndata for " + pawn);
            Pawn = pawn;
            //Log.Message("This data is valid " + this.IsValid);

            if (RaceGroupDef_Helper.TryGetRaceGroupDef(Pawn, out var raceGroupDef))
            {
                oviPregnancy = raceGroupDef.oviPregnancy;
            }

            isDemon = Pawn.Has(RaceTag.Demon);
            isSlime = Pawn.Has(RaceTag.Slime);

            //Log.Warning("PawnData:: Pawn:" + xxx.get_pawnname(pawn));
            //Log.Warning("PawnData:: isSlime:" + isSlime);
            //Log.Warning("PawnData:: isDemon:" + isDemon);
            //Log.Warning("PawnData:: oviPregnancy:" + oviPregnancy);
        }
Exemplo n.º 7
0
 public static bool TryAddRacePart(this Pawn pawn, SexPartType sexPartType)
 {
     return(RaceGroupDef_Helper.TryAddRacePart(pawn, sexPartType));
 }