2022-11-20 16:33:50 +00:00
using Verse ;
using rjw ;
namespace RJW_Genes
{
2023-04-27 00:56:55 +00:00
public class Gene_MaleOnly : RJW_Gene
2022-11-20 16:33:50 +00:00
{
public override void PostMake ( )
{
base . PostMake ( ) ;
AdjustPawnToMale ( ) ;
// Here we call Sexualization after the Sex-Change
if ( GenitaliaUtility . PawnStillNeedsGenitalia ( pawn ) )
Sexualizer . sexualize_pawn ( pawn ) ;
}
public override void PostAdd ( )
{
base . PostMake ( ) ;
AdjustPawnToMale ( ) ;
}
private void AdjustPawnToMale ( )
{
if ( pawn . gender = = Gender . Male )
return ;
else
{
GenderHelper . ChangeSex ( pawn , ( ) = > {
pawn . gender = Gender . Male ;
GenitaliaChanger . RemoveAllGenitalia ( pawn ) ;
Sexualizer . sexualize_pawn ( pawn ) ;
} ) ;
GenderUtility . AdjustBodyToTargetGender ( pawn , Gender . Male ) ;
}
}
2023-04-27 00:56:55 +00:00
public override void Notify_OnPawnGeneration ( )
{
base . Notify_OnPawnGeneration ( ) ;
2023-04-30 08:06:53 +00:00
// If this is Pawn generation, then we can assume that the pawn was never any gender other than male, so they shouldn't have sex change thoughts. (Issue #32)
2023-04-27 00:56:55 +00:00
GenderUtility . RemoveAllSexChangeThoughts ( pawn ) ;
}
2022-11-20 16:33:50 +00:00
}
}