rjw-plasticsurgeries/Source/RJW_PlasticSurgeries/Recipe_Surgery_Sphinctoplasty.cs
2022-01-15 22:54:53 +01:00

77 lines
No EOL
2.4 KiB
C#

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_Sphinctoplasty : Recipe_Surgery
{
public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
{
var part = Genital_Helper.get_anusBPR(pawn);
if (part != null)
{
var hediffs = Genital_Helper.get_PartsHediffList(pawn, part);
if (Genital_Helper.has_anus(pawn, hediffs)) yield return part;
}
}
/// <inheritdoc />
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);
}
}
public abstract void SurgeryResult(Pawn pawn);
protected void SurgeryX(Pawn pawn, float severity)
{
pawn.GetAnusList().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_Sphinctoplasty_Micro : Recipe_Surgery_Sphinctoplasty
{
public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.1f);
}
public class Recipe_Surgery_Sphinctoplasty_Tight : Recipe_Surgery_Sphinctoplasty
{
public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.3f);
}
public class Recipe_Surgery_Sphinctoplasty_Average : Recipe_Surgery_Sphinctoplasty
{
public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.5f);
}
public class Recipe_Surgery_Sphinctoplasty_Accomodating : Recipe_Surgery_Sphinctoplasty
{
public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.7f);
}
public class Recipe_Surgery_Sphinctoplasty_Cavernous : Recipe_Surgery_Sphinctoplasty
{
public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.9f);
}
}