mirror of
https://github.com/amevarashi/RJW-Sexperience.git
synced 2024-08-14 23:54:08 +00:00
67c2328ad6
Fix some IDE messages
35 lines
976 B
C#
35 lines
976 B
C#
using RimWorld;
|
|
using rjw;
|
|
using System.Collections.Generic;
|
|
using Verse;
|
|
|
|
namespace RJWSexperience.Virginity
|
|
{
|
|
public class Recipe_HymenSurgery : Recipe_Surgery
|
|
{
|
|
public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
|
|
{
|
|
if (pawn.gender != Gender.Female)
|
|
yield break;
|
|
|
|
BodyPartRecord part = Genital_Helper.get_genitalsBPR(pawn);
|
|
if (part == null)
|
|
yield break;
|
|
|
|
List<Hediff> hediffs = Genital_Helper.get_PartsHediffList(pawn, part);
|
|
if (Genital_Helper.has_vagina(pawn, hediffs) && !HasHymen(pawn))
|
|
yield return part;
|
|
}
|
|
|
|
public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients, Bill bill)
|
|
{
|
|
if (billDoer == null)
|
|
return;
|
|
|
|
TaleRecorder.RecordTale(TaleDefOf.DidSurgery, billDoer, pawn);
|
|
TraitHandler.AddVirginTrait(pawn);
|
|
}
|
|
|
|
private static bool HasHymen(Pawn pawn) => pawn.story?.traits?.GetTrait(RsDefOf.Trait.Virgin)?.Degree > 0;
|
|
}
|
|
}
|