public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List <Thing> ingredients, Bill bill) { var preg = (PregnancyHelper.GetPregnancy(pawn) as Hediff_BasePregnancy); if (preg != null) { preg.CheckPregnancy(); } else { Messages.Message(xxx.get_pawnname(billDoer) + " has determined " + xxx.get_pawnname(pawn) + " is not pregnant.", MessageTypeDefOf.NeutralEvent); } }
public override void PostAdd(DamageInfo?dinfo) { if (pawn.gender == Gender.Female) { string key = "CumsTransported"; string text = TranslatorFormattedStringExtensions.Translate(key, pawn.LabelIndefinite()).CapitalizeFirst(); Messages.Message(text, pawn, MessageTypeDefOf.NeutralEvent); PawnGenerationRequest req = new PawnGenerationRequest(PawnKindDefOf.Drifter, fixedGender: Gender.Male); Pawn cumSender = PawnGenerator.GeneratePawn(req); Find.WorldPawns.PassToWorld(cumSender); //Pawn cumSender = (from p in Find.WorldPawns.AllPawnsAlive where p.gender == Gender.Male select p).RandomElement<Pawn>(); //--Log.Message("[RJW]" + this.GetType().ToString() + "PostAdd() - Sending " + xxx.get_pawnname(cumSender) + "'s cum into " + xxx.get_pawnname(pawn) + "'s v****a"); PregnancyHelper.impregnate(pawn, cumSender, xxx.rjwSextype.Vaginal); } pawn.health.RemoveHediff(this); }
private static bool on_cleanup_driver(JobDriver __instance, JobCondition condition) { if (__instance == null) { return(true); } if (condition == JobCondition.Succeeded) { Pawn pawn = __instance.pawn; Pawn partner = null; //Log.Message("[RJW]patches_lovin::on_cleanup_driver" + xxx.get_pawnname(pawn)); //[RF] Rational Romance [1.0] loving if (xxx.RomanceDiversifiedIsActive && __instance.GetType() == JobDriverDoLovinCasual) { // not sure RR can even cause pregnancies but w/e var any_ins = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; partner = (Pawn)(__instance.GetType().GetProperty("Partner", any_ins).GetValue(__instance, null)); Log.Message("[RJW]patches_lovin::on_cleanup_driver RomanceDiversified/RationalRomance:" + xxx.get_pawnname(pawn) + "+" + xxx.get_pawnname(partner)); } //Vanilla loving else if (__instance.GetType() == JobDriverLovin) { var any_ins = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; partner = (Pawn)(__instance.GetType().GetProperty("Partner", any_ins).GetValue(__instance, null)); //CnP loving if (xxx.RimWorldChildrenIsActive && RJWPregnancySettings.humanlike_pregnancy_enabled && xxx.is_human(pawn) && xxx.is_human(partner)) { Log.Message("[RJW]patches_lovin:: RimWorldChildren/ChildrenAndPregnancy pregnancy:" + xxx.get_pawnname(pawn) + "+" + xxx.get_pawnname(partner)); PregnancyHelper.cleanup_CnP(pawn); PregnancyHelper.cleanup_CnP(partner); } else { Log.Message("[RJW]patches_lovin:: JobDriverLovin pregnancy:" + xxx.get_pawnname(pawn) + "+" + xxx.get_pawnname(partner)); } } //Vanilla mating else if (__instance.GetType() == JobDriverMate) { var any_ins = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; partner = (Pawn)(__instance.GetType().GetProperty("Female", any_ins).GetValue(__instance, null)); Log.Message("[RJW]patches_lovin:: JobDriverMate pregnancy:" + xxx.get_pawnname(pawn) + "+" + xxx.get_pawnname(partner)); } else { return(true); } // TODO: Doing TryUseCondom here is a bit weird... it should happen before. var usedCondom = CondomUtility.TryUseCondom(pawn) || CondomUtility.TryUseCondom(partner); //vanilla will probably be f****d up for non humanlikes... but only humanlikes do loving, right? //if rjw pregnancy enabled, remove vanilla for: //human-human //animal-animal //bestiality //always remove when someone is insect or mech if (RJWPregnancySettings.humanlike_pregnancy_enabled && xxx.is_human(pawn) && xxx.is_human(partner) || RJWPregnancySettings.animal_pregnancy_enabled && xxx.is_animal(pawn) && xxx.is_animal(partner) || (RJWPregnancySettings.bestial_pregnancy_enabled && xxx.is_human(pawn) && xxx.is_animal(partner) || RJWPregnancySettings.bestial_pregnancy_enabled && xxx.is_animal(pawn) && xxx.is_human(partner)) || xxx.is_insect(pawn) || xxx.is_insect(partner) || xxx.is_mechanoid(pawn) || xxx.is_mechanoid(partner) ) { Log.Message("[RJW]patches_lovin::on_cleanup_driver vanilla pregnancy:" + xxx.get_pawnname(pawn) + "+" + xxx.get_pawnname(partner)); PregnancyHelper.cleanup_vanilla(pawn); PregnancyHelper.cleanup_vanilla(partner); } SexUtility.ProcessSex(pawn, partner, usedCondom, false, true); } return(true); }