mirror of
				https://gitgud.io/lutepickle/rjw_menstruation.git
				synced 2024-08-14 22:46:52 +00:00 
			
		
		
		
	Split animal cycle check into generic ShouldCycle function, exclude egglaying races from cycling
This commit is contained in:
		
							parent
							
								
									ebf0db8ae6
								
							
						
					
					
						commit
						f08ff58b64
					
				
					 8 changed files with 16 additions and 7 deletions
				
			
		
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
					@ -150,7 +150,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool ShouldSimulate()
 | 
					        public bool ShouldSimulate()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (!Configurations.EnableAnimalCycle && Pawn.IsAnimal()) return false;
 | 
					            if (!Pawn.ShouldCycle()) return false;
 | 
				
			||||||
            if (Pawn.SpawnedOrAnyParentSpawned || Pawn.IsCaravanMember() || PawnUtility.IsTravelingInTransportPodWorldObject(Pawn)) return true;
 | 
					            if (Pawn.SpawnedOrAnyParentSpawned || Pawn.IsCaravanMember() || PawnUtility.IsTravelingInTransportPodWorldObject(Pawn)) return true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -714,7 +714,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool ShouldSimulate()
 | 
					        public bool ShouldSimulate()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (!Configurations.EnableAnimalCycle && Pawn.IsAnimal()) return false;
 | 
					            if (!Pawn.ShouldCycle()) return false;
 | 
				
			||||||
            if (Pawn.SpawnedOrAnyParentSpawned || Pawn.IsCaravanMember() || PawnUtility.IsTravelingInTransportPodWorldObject(Pawn)) return true;
 | 
					            if (Pawn.SpawnedOrAnyParentSpawned || Pawn.IsCaravanMember() || PawnUtility.IsTravelingInTransportPodWorldObject(Pawn)) return true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -403,6 +403,14 @@ namespace RJW_Menstruation
 | 
				
			||||||
            else return variability;
 | 
					            else return variability;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public static bool ShouldCycle(this Pawn pawn)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (!Configurations.EnableAnimalCycle && pawn.IsAnimal()) return false;
 | 
				
			||||||
 | 
					            if (pawn.RaceHasOviPregnancy()) return false;
 | 
				
			||||||
 | 
					            // TODO: Exclude egglaying genes
 | 
				
			||||||
 | 
					            return true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public static bool IsInEstrus(this Pawn pawn, bool visible = true)
 | 
					        public static bool IsInEstrus(this Pawn pawn, bool visible = true)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (pawn.Dead) return false;
 | 
					            if (pawn.Dead) return false;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,7 +24,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (sextype != xxx.rjwSextype.Vaginal && sextype != xxx.rjwSextype.DoublePenetration) return true;
 | 
					            if (sextype != xxx.rjwSextype.Vaginal && sextype != xxx.rjwSextype.DoublePenetration) return true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (partner.IsAnimal() && !Configurations.EnableAnimalCycle) return true;
 | 
					            if (!partner.ShouldCycle()) return true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (!InteractionCanCausePregnancy(props)) return false;
 | 
					            if (!InteractionCanCausePregnancy(props)) return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -100,7 +100,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public static bool Prefix(Pawn pawn, Pawn partner) // partner has vagina
 | 
					        public static bool Prefix(Pawn pawn, Pawn partner) // partner has vagina
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (partner.IsAnimal() && !Configurations.EnableAnimalCycle) return true;
 | 
					            if (!partner.ShouldCycle()) return true;
 | 
				
			||||||
            HediffComp_Menstruation comp;
 | 
					            HediffComp_Menstruation comp;
 | 
				
			||||||
            if (pawn.HasQuirk(QuirkUtility.Quirks.ImpregnationFetish) || partner.HasQuirk(QuirkUtility.Quirks.ImpregnationFetish) || partner.IsInEstrus())
 | 
					            if (pawn.HasQuirk(QuirkUtility.Quirks.ImpregnationFetish) || partner.HasQuirk(QuirkUtility.Quirks.ImpregnationFetish) || partner.IsInEstrus())
 | 
				
			||||||
                comp = partner.GetFertileMenstruationComp();
 | 
					                comp = partner.GetFertileMenstruationComp();
 | 
				
			||||||
| 
						 | 
					@ -125,7 +125,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        private static bool PregnancyBlocksImpregnation(this Pawn pawn, bool _)
 | 
					        private static bool PregnancyBlocksImpregnation(this Pawn pawn, bool _)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (!Configurations.EnableAnimalCycle && pawn.IsAnimal()) return pawn.IsPregnant();
 | 
					            if (!pawn.ShouldCycle()) return pawn.IsPregnant();
 | 
				
			||||||
            else if (pawn.GetMenstruationComps().Any()) return false;
 | 
					            else if (pawn.GetMenstruationComps().Any()) return false;
 | 
				
			||||||
            else return pawn.IsPregnant();
 | 
					            else return pawn.IsPregnant();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -347,7 +347,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
            if (__instance.Sexprops.usedCondom) return;
 | 
					            if (__instance.Sexprops.usedCondom) return;
 | 
				
			||||||
            if (AndroidsCompatibility.IsAndroid(pawn)) return;
 | 
					            if (AndroidsCompatibility.IsAndroid(pawn)) return;
 | 
				
			||||||
            if (!Impregnate_Patch.InteractionCanCausePregnancy(__instance.Sexprops)) return;
 | 
					            if (!Impregnate_Patch.InteractionCanCausePregnancy(__instance.Sexprops)) return;
 | 
				
			||||||
            if (!Configurations.EnableAnimalCycle && xxx.is_animal(partner)) return;
 | 
					            if (!partner.ShouldCycle()) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // Archotech penises have more control. Or something.
 | 
					            // Archotech penises have more control. Or something.
 | 
				
			||||||
            CompHediffBodyPart penisComp = pawn.GetGenitalsList()?.Find(genital => (genital as Hediff_PartBaseNatural)?.def.defName.ToLower().Contains("penis") ?? false)?.TryGetComp<CompHediffBodyPart>();
 | 
					            CompHediffBodyPart penisComp = pawn.GetGenitalsList()?.Find(genital => (genital as Hediff_PartBaseNatural)?.def.defName.ToLower().Contains("penis") ?? false)?.TryGetComp<CompHediffBodyPart>();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -448,7 +448,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (!Configurations.EnableWombIcon) return false;
 | 
					            if (!Configurations.EnableWombIcon) return false;
 | 
				
			||||||
            if (pawn.Drafted && !Configurations.EnableDraftedIcon) return false;
 | 
					            if (pawn.Drafted && !Configurations.EnableDraftedIcon) return false;
 | 
				
			||||||
            if (pawn.IsAnimal() && !Configurations.EnableAnimalCycle) return false;
 | 
					            if (!pawn.ShouldCycle()) return false;
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,6 +2,7 @@ Version 1.0.9.2
 | 
				
			||||||
 - Fixed the no bleeding gene having positive metabolic efficiency instead of negative.
 | 
					 - Fixed the no bleeding gene having positive metabolic efficiency instead of negative.
 | 
				
			||||||
 - Removed status button in health tab for non-genitals to avoid errors.
 | 
					 - Removed status button in health tab for non-genitals to avoid errors.
 | 
				
			||||||
 - Handle errors more gracefully when starting a pregnancy.
 | 
					 - Handle errors more gracefully when starting a pregnancy.
 | 
				
			||||||
 | 
					 - Egglaying races no longer have a menstrual cycle, regardless of vagina type.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Version 1.0.9.1
 | 
					Version 1.0.9.1
 | 
				
			||||||
 - Japanese translation for most text by Lokuzt.
 | 
					 - Japanese translation for most text by Lokuzt.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue