using System; using System.Collections.Generic; using Dyspareunia; using RimWorld; using rjw; using Verse; using DamageDefOf = Dyspareunia.DamageDefOf; namespace RJW_PlasticSurgeries { public abstract class Recipe_Surgery_Vaginoplasty : Recipe_Surgery { public override IEnumerable GetPartsToApplyOn(Pawn pawn, RecipeDef recipe) { var part = Genital_Helper.get_genitalsBPR(pawn); if (part != null) { var hediffs = Genital_Helper.get_PartsHediffList(pawn, part); if (Genital_Helper.has_vagina(pawn, hediffs)) yield return part; } } /// public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List ingredients, Bill bill) { if (billDoer != null) { TaleRecorder.RecordTale(TaleDefOf.DidSurgery, billDoer, pawn); SurgeryResult(pawn); } } public abstract void SurgeryResult(Pawn pawn); protected void SurgeryX(Pawn pawn, float severity) { pawn.GetGenitalsList().FindAll(Genital_Helper.is_vagina).ForEach(hed => { hed.Severity = severity; try { PenetrationUtility.AddDamageHediff(DamageDefOf.SexStretch, 0.5f, hed, null); } catch (Exception e) { Log.Error("Try enabling Dyspareunia for sore genitals"); } }); } } public class Recipe_Surgery_Vaginoplasty_Micro : Recipe_Surgery_Vaginoplasty { public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.1f); } public class Recipe_Surgery_Vaginoplasty_Tight : Recipe_Surgery_Vaginoplasty { public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.3f); } public class Recipe_Surgery_Vaginoplasty_Average : Recipe_Surgery_Vaginoplasty { public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.5f); } public class Recipe_Surgery_Vaginoplasty_Accomodating : Recipe_Surgery_Vaginoplasty { public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.7f); } public class Recipe_Surgery_Vaginoplasty_Cavernous : Recipe_Surgery_Vaginoplasty { public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.9f); } }