Virgin trait degree enum

This commit is contained in:
amevarashi 2022-06-12 09:20:12 +05:00
parent 77ddd1da33
commit 518e683dd4
2 changed files with 23 additions and 13 deletions

View file

@ -114,20 +114,20 @@ namespace RJWSexperience
public static void AddVirginTrait(this Pawn pawn)
{
if (pawn.story?.traits != null)
if (pawn.story?.traits == null)
return;
if (pawn.IsVirgin())
{
if (pawn.IsVirgin())
{
int degree = 0;
if (pawn.gender == Gender.Female) degree = 2;
Trait virgin = new Trait(VariousDefOf.Virgin, degree, true);
pawn.story.traits.GainTrait(virgin);
}
else if (pawn.gender == Gender.Female && Rand.Chance(0.05f))
{
Trait virgin = new Trait(VariousDefOf.Virgin, 1, true);
pawn.story.traits.GainTrait(virgin);
}
Virginity.TraitDegree degree = Virginity.TraitDegree.MaleVirgin;
if (pawn.gender == Gender.Female) degree = Virginity.TraitDegree.FemaleVirgin;
Trait virgin = new Trait(VariousDefOf.Virgin, (int)degree, true);
pawn.story.traits.GainTrait(virgin);
}
else if (pawn.gender == Gender.Female && Rand.Chance(0.05f))
{
Trait virgin = new Trait(VariousDefOf.Virgin, (int)Virginity.TraitDegree.FemaleAfterSurgery, true);
pawn.story.traits.GainTrait(virgin);
}
}
}

View file

@ -0,0 +1,10 @@
namespace RJWSexperience.Virginity
{
public enum TraitDegree
{
FemaleDamagedVirgin = -1,
MaleVirgin = 0,
FemaleAfterSurgery = 1,
FemaleVirgin = 2
}
}