mirror of
https://gitgud.io/Stardust3D/rjw-plasticsurgeries.git
synced 2024-08-14 23:57:25 +00:00
moved most surgery logic into Recipe_Plastic_Surgery.cs
This commit is contained in:
parent
69d9346ee5
commit
94711f740a
6 changed files with 227 additions and 183 deletions
|
@ -1,80 +1,64 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Dyspareunia;
|
||||
using RimWorld;
|
||||
using System.Collections.Generic;
|
||||
using rjw;
|
||||
using Verse;
|
||||
using DamageDefOf = Dyspareunia.DamageDefOf;
|
||||
|
||||
namespace RJW_PlasticSurgeries
|
||||
{
|
||||
public abstract class Recipe_Surgery_Sphinctoplasty : Recipe_Surgery
|
||||
public abstract class Recipe_Surgery_Sphinctoplasty : Recipe_Plastic_Surgery
|
||||
{
|
||||
private readonly bool hasDyspareunia = ModLister.HasActiveModWithName("Dyspareunia");
|
||||
|
||||
public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
|
||||
protected override BodyPartRecord GetPartCandidate(Pawn pawn)
|
||||
{
|
||||
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;
|
||||
}
|
||||
return Genital_Helper.get_anusBPR(pawn);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients,
|
||||
Bill bill)
|
||||
protected override bool HasPart(Pawn pawn, List<Hediff> hediffs)
|
||||
{
|
||||
if (billDoer != null)
|
||||
{
|
||||
TaleRecorder.RecordTale(TaleDefOf.DidSurgery, billDoer, pawn);
|
||||
SurgeryResult(pawn);
|
||||
}
|
||||
return Genital_Helper.has_anus(pawn, hediffs);
|
||||
}
|
||||
|
||||
public abstract void SurgeryResult(Pawn pawn);
|
||||
|
||||
protected void SurgeryX(Pawn pawn, float severity)
|
||||
protected override List<Hediff> GetHediffs(Pawn pawn)
|
||||
{
|
||||
pawn.GetAnusList().ForEach(hed =>
|
||||
{
|
||||
hed.Severity = severity;
|
||||
if (hasDyspareunia)
|
||||
{
|
||||
DamageHediff(hed);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void DamageHediff(Hediff hed)
|
||||
{
|
||||
PenetrationUtility.AddDamageHediff(DamageDefOf.SexStretch, 0.5f, hed, null);
|
||||
return pawn.GetAnusList();
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Sphinctoplasty_Micro : Recipe_Surgery_Sphinctoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.1f);
|
||||
protected override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
SurgeryX(pawn, 0.1f, true);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Sphinctoplasty_Tight : Recipe_Surgery_Sphinctoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.3f);
|
||||
protected override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
SurgeryX(pawn, 0.3f, true);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Sphinctoplasty_Average : Recipe_Surgery_Sphinctoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.5f);
|
||||
protected override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
SurgeryX(pawn, 0.5f, true);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Sphinctoplasty_Accomodating : Recipe_Surgery_Sphinctoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.7f);
|
||||
protected override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
SurgeryX(pawn, 0.7f, true);
|
||||
}
|
||||
}
|
||||
|
||||
public class Recipe_Surgery_Sphinctoplasty_Cavernous : Recipe_Surgery_Sphinctoplasty
|
||||
{
|
||||
public override void SurgeryResult(Pawn pawn) => SurgeryX(pawn, 0.9f);
|
||||
protected override void SurgeryResult(Pawn pawn)
|
||||
{
|
||||
SurgeryX(pawn, 0.9f, true);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue