2022-11-14 14:55:52 +00:00
|
|
|
|
using Verse;
|
|
|
|
|
using rjw;
|
|
|
|
|
using RimWorld;
|
|
|
|
|
|
|
|
|
|
namespace RJW_Genes
|
|
|
|
|
{
|
2022-11-20 16:33:50 +00:00
|
|
|
|
public class Gene_NoPenis : RJW_Gene
|
2022-11-14 14:55:52 +00:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
internal Hediff removed_penis;
|
|
|
|
|
|
|
|
|
|
public override void PostMake()
|
|
|
|
|
{
|
|
|
|
|
base.PostMake();
|
|
|
|
|
|
2022-11-20 16:33:50 +00:00
|
|
|
|
// Penis are only removed for male pawns!
|
|
|
|
|
if (GenderUtility.IsMale(pawn) && removed_penis == null)
|
2022-11-14 14:55:52 +00:00
|
|
|
|
{
|
|
|
|
|
RemoveButStorePenis();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void PostAdd()
|
|
|
|
|
{
|
|
|
|
|
base.PostAdd();
|
|
|
|
|
|
2022-11-20 16:33:50 +00:00
|
|
|
|
// Penis are only removed for male pawns!
|
|
|
|
|
if (GenderUtility.IsMale(pawn) && removed_penis == null)
|
2022-11-14 14:55:52 +00:00
|
|
|
|
{
|
|
|
|
|
RemoveButStorePenis();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void PostRemove()
|
|
|
|
|
{
|
|
|
|
|
base.PostRemove();
|
|
|
|
|
if(removed_penis != null)
|
|
|
|
|
pawn.health.AddHediff(removed_penis);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal void RemoveButStorePenis()
|
|
|
|
|
{
|
|
|
|
|
var partBPR = Genital_Helper.get_genitalsBPR(pawn);
|
|
|
|
|
Hediff penisToRemove = Genital_Helper.get_AllPartsHediffList(pawn).FindLast(x => Genital_Helper.is_penis(x));
|
|
|
|
|
|
|
|
|
|
if(penisToRemove != null)
|
|
|
|
|
{
|
|
|
|
|
removed_penis = penisToRemove;
|
|
|
|
|
pawn.health.RemoveHediff(penisToRemove);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|