/// <summary> /// This method discovers all penetrations in the sex act and applies respective damage /// </summary> /// <param name="p1"></param> /// <param name="p2"></param> /// <param name="rape"></param> /// <param name="sextype"></param> /// <returns>Empty list if no eligible penetrations found, or an element for each penetration (can be DP etc.)</returns> public static void ProcessPenetrations(Pawn p1, Pawn p2, bool rape, xxx.rjwSextype sextype) { Dyspareunia.Log("Checking " + sextype + (rape ? " rape" : " sex") + " between " + p1.Label + " and " + p2.Label + "."); switch (sextype) { case xxx.rjwSextype.Vaginal: if (Dyspareunia.HasPenetratingOrgan(p1) && Genital_Helper.has_vagina(p2)) { ApplyDamage(Genital_Helper.get_penis_all(p1), Dyspareunia.GetVagina(p2), rape); } else { ApplyDamage(Genital_Helper.get_penis_all(p2), Dyspareunia.GetVagina(p1), false); } break; case xxx.rjwSextype.Anal: if (Dyspareunia.HasPenetratingOrgan(p1) && Genital_Helper.has_anus(p2)) { ApplyDamage(Genital_Helper.get_penis_all(p1), Dyspareunia.GetAnus(p2), rape); } else { ApplyDamage(Genital_Helper.get_penis_all(p2), Dyspareunia.GetAnus(p1), false); } break; case xxx.rjwSextype.Oral: // Oral penetration not supported ATM break; case xxx.rjwSextype.DoublePenetration: if (Genital_Helper.has_multipenis(p1) && Genital_Helper.has_vagina(p2) && Genital_Helper.has_anus(p2)) { ApplyDamage(Genital_Helper.get_penis_all(p1), Dyspareunia.GetVagina(p2), rape); ApplyDamage(Genital_Helper.get_penis_all(p1), Dyspareunia.GetAnus(p2), rape); } else { ApplyDamage(Genital_Helper.get_penis_all(p2), Dyspareunia.GetVagina(p1), false); ApplyDamage(Genital_Helper.get_penis_all(p2), Dyspareunia.GetAnus(p1), false); } break; case xxx.rjwSextype.Fingering: if (Genital_Helper.has_vagina(p2) || Genital_Helper.has_anus(p2)) { ApplyDamage(p1, GetFingerSize(p1), Dyspareunia.GetVagina(p2) ?? Dyspareunia.GetAnus(p2), rape); } else { ApplyDamage(p2, GetFingerSize(p2), Dyspareunia.GetVagina(p1) ?? Dyspareunia.GetAnus(p1), false); } break; case xxx.rjwSextype.Fisting: if (Genital_Helper.has_vagina(p2) || Genital_Helper.has_anus(p2)) { ApplyDamage(p1, GetHandSize(p1), Dyspareunia.GetVagina(p2) ?? Dyspareunia.GetAnus(p2), rape); } else { ApplyDamage(p2, GetHandSize(p2), Dyspareunia.GetVagina(p1) ?? Dyspareunia.GetAnus(p1), false); } break; case xxx.rjwSextype.MechImplant: Dyspareunia.Log("Processing mech implant sex between " + p1.Label + " and " + p2.Label); if (p1.kindDef.race.defName.ContainsAny("Mech_Centipede", "Mech_Lancer", "Mech_Scyther", "Mech_Crawler", "Mech_Skullywag", "Mech_Flamebot", "Mech_Mammoth", "Mech_Assaulter")) { ApplyDamage(p1, p1.BodySize, Dyspareunia.GetVagina(p2) ?? Dyspareunia.GetAnus(p2), rape); } else { ApplyDamage(p2, p2.BodySize, Dyspareunia.GetVagina(p1) ?? Dyspareunia.GetAnus(p1), false); } break; } }
public static void Postfix(PawnRenderer __instance, Pawn ___pawn, Vector3 rootLoc, float angle, bool renderBody, Rot4 bodyFacing, Rot4 headFacing, RotDrawMode bodyDrawType, bool portrait, bool headStump, bool invisible) { Pawn p = ___pawn; if (!Genital_Helper.has_penis_fertile(p) && !Genital_Helper.has_penis_infertile(p) && !Genital_Helper.has_multipenis(p)) { return; } string originalPath = __instance.graphics.nakedGraphic.path; string modifiedPath = originalPath + "_Lewd"; if (ContentFinder <Texture2D> .Get(modifiedPath + "_north", false) != null) { if (p?.jobs?.curDriver != null && p.jobs.curDriver is JobDriver_Sex || (timeSinceSex.ContainsKey(p))) { GraphicData originalGraphicData = p.ageTracker.CurKindLifeStage.bodyGraphicData; Graphic lewdGraphic = CachedGraphics.LewdGraphics.TryGetValue(modifiedPath); if (lewdGraphic != null) { Mesh lewdMesh = lewdGraphic.MeshAt(bodyFacing); rootLoc.y = (AltitudeLayer.LayingPawn - 1).AltitudeFor(); GenDraw.DrawMeshNowOrLater(lewdMesh, rootLoc, Quaternion.AngleAxis(angle, Vector3.up), lewdGraphic.MatAt(bodyFacing), portrait); } } if (p?.jobs?.curDriver != null && p.jobs.curDriver is JobDriver_Sex) { if (p.jobs.curDriver.ticksLeftThisToil <= 30f) { if (timeSinceSex.ContainsKey(p)) { timeSinceSex[p] = GenTicks.TicksGame - Rand.Range(0, 180); } else { timeSinceSex.Add(p, GenTicks.TicksGame); } } } else if (timeSinceSex.ContainsKey(p) && timeSinceSex[p] + 1000 < GenTicks.TicksGame) //time delay to disappearing texture on job end { timeSinceSex.Remove(p); } } }