public static bool RaceHasSexNeed(this Pawn pawn) { // True by default. if (RaceGroupDef_Helper.TryGetRaceGroupDef(pawn, out var raceGroupDef)) { return(raceGroupDef.hasSexNeed); } return(true); }
public static bool RaceImplantEggs(this Pawn pawn) { // False by default. if (RaceGroupDef_Helper.TryGetRaceGroupDef(pawn, out var raceGroupDef)) { return(raceGroupDef.ImplantEggs); } return(false); }
public static bool RaceHasOviPregnancy(this Pawn pawn) { // False by default. if (RaceGroupDef_Helper.TryGetRaceGroupDef(pawn, out var raceGroupDef)) { return(raceGroupDef.oviPregnancy); } return(false); }
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)); } }
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); } } } }
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); }