rjw-plasticsurgeries/Source/RJW_PlasticSurgeries/Recipe_Surgery_Vaginoplasty.cs

42 lines
1.3 KiB
C#
Raw Normal View History

2021-12-29 19:54:45 +00:00
using RimWorld;
using rjw;
2021-12-29 19:54:45 +00:00
using System.Collections.Generic;
2021-12-29 19:55:19 +00:00
using Dyspareunia;
using Verse;
namespace RJW_PlasticSurgeries
{
public class Recipe_Surgery_Vaginoplasty : Recipe_Surgery
{
public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
{
if (pawn.gender != Gender.Female) yield break;
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<Thing> ingredients,
Bill bill)
{
if (billDoer != null)
{
TaleRecorder.RecordTale(TaleDefOf.DidSurgery, billDoer, pawn);
SurgeryResult(pawn);
}
}
protected void SurgeryResult(Pawn pawn)
{
2021-12-29 19:55:19 +00:00
pawn.GetGenitalsList().FindAll(Genital_Helper.is_vagina).ForEach(hed =>
{
hed.Severity *= 0.75f;
PenetrationUtility.AddDamageHediff(Dyspareunia.DamageDefOf.SexStretch, 0.5f, hed, null);
});
}
}
}