mirror of
				https://gitgud.io/lutepickle/rjw_menstruation.git
				synced 2024-08-14 22:46:52 +00:00 
			
		
		
		
	Compare commits
	
		
			12 commits
		
	
	
		
			7a92cce993
			...
			44f7b692d3
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
							 | 
						44f7b692d3 | ||
| 
							 | 
						36c88d2752 | ||
| 
							 | 
						3d9b22776e | ||
| 
							 | 
						80611882c9 | ||
| 
							 | 
						f70c2ad585 | ||
| 
							 | 
						cdfe9b44b8 | ||
| 
							 | 
						b21fc85a29 | ||
| 
							 | 
						48f020d832 | ||
| 
							 | 
						23ae342722 | ||
| 
							 | 
						509eeabddc | ||
| 
							 | 
						6fabfd6aaf | ||
| 
							 | 
						ebbbf8ee7f | 
					 5 changed files with 23 additions and 8 deletions
				
			
		| 
						 | 
					@ -276,7 +276,10 @@ namespace RJW_Menstruation
 | 
				
			||||||
            float res = 0;
 | 
					            float res = 0;
 | 
				
			||||||
            if (VariousDefOf.Hediff_Heavy_Lactating_Permanent != null)
 | 
					            if (VariousDefOf.Hediff_Heavy_Lactating_Permanent != null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Heavy_Lactating_Permanent)) milkcomp = pawn.AllComps.FirstOrDefault(x => x.GetType().ToString().ToLower().Contains("hypermilkable"));
 | 
					                if (pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Heavy_Lactating_Permanent)
 | 
				
			||||||
 | 
					                    || pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Lactating_Permanent)
 | 
				
			||||||
 | 
					                    || pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Lactating_Natural)
 | 
				
			||||||
 | 
					                    || pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Lactating_Drug)) milkcomp = pawn.AllComps.FirstOrDefault(x => x.GetType().ToString().ToLower().Contains("milkablehuman"));
 | 
				
			||||||
                else milkcomp = pawn.AllComps.FirstOrDefault(x => x.GetType().ToString().ToLower().Contains("milkable"));
 | 
					                else milkcomp = pawn.AllComps.FirstOrDefault(x => x.GetType().ToString().ToLower().Contains("milkable"));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -158,7 +158,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
        public static readonly HediffDef Hediff_Lactating_Natural = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Natural");
 | 
					        public static readonly HediffDef Hediff_Lactating_Natural = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Natural");
 | 
				
			||||||
        public static readonly HediffDef Hediff_Lactating_Permanent = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Permanent");
 | 
					        public static readonly HediffDef Hediff_Lactating_Permanent = DefDatabase<HediffDef>.GetNamedSilentFail("Lactating_Permanent");
 | 
				
			||||||
        public static readonly HediffDef Hediff_Heavy_Lactating_Permanent = DefDatabase<HediffDef>.GetNamedSilentFail("Heavy_Lactating_Permanent");
 | 
					        public static readonly HediffDef Hediff_Heavy_Lactating_Permanent = DefDatabase<HediffDef>.GetNamedSilentFail("Heavy_Lactating_Permanent");
 | 
				
			||||||
        public static readonly JobDef Job_LactateSelf_MC = DefDatabase<JobDef>.GetNamedSilentFail("LactateSelf_MC");
 | 
					        public static readonly JobDef Job_LactateSelf_MC = DefDatabase<JobDef>.GetNamedSilentFail("MilkSelf");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Defs from Sexperience Ideology
 | 
					        // Defs from Sexperience Ideology
 | 
				
			||||||
        public static readonly PreceptDef Pregnancy_Elevated = DefDatabase<PreceptDef>.GetNamedSilentFail("Pregnancy_Elevated");
 | 
					        public static readonly PreceptDef Pregnancy_Elevated = DefDatabase<PreceptDef>.GetNamedSilentFail("Pregnancy_Elevated");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -639,10 +639,14 @@ namespace RJW_Menstruation
 | 
				
			||||||
            if (Scribe.mode == LoadSaveMode.PostLoadInit)
 | 
					            if (Scribe.mode == LoadSaveMode.PostLoadInit)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                Initialize();
 | 
					                Initialize();
 | 
				
			||||||
                if (pregnancy is HediffWithParents vanillaPreg && vanillaPreg.Mother == vanillaPreg.Father)   // Fix mother == father issue
 | 
					                // Biotech labor errors if the mother is also the father, so don't let that happen
 | 
				
			||||||
 | 
					                if (pregnancy is HediffWithParents vanillaPreg && vanillaPreg.Mother == vanillaPreg.Father && vanillaPreg.Mother != null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    Log.Warning($"Pregnancy of {Pawn} has same mother and father, setting father to null");
 | 
				
			||||||
                    vanillaPreg.SetParents(vanillaPreg.Mother, null, vanillaPreg.geneSet);
 | 
					                    vanillaPreg.SetParents(vanillaPreg.Mother, null, vanillaPreg.geneSet);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public override void CompPostPostAdd(DamageInfo? dinfo)
 | 
					        public override void CompPostPostAdd(DamageInfo? dinfo)
 | 
				
			||||||
| 
						 | 
					@ -790,7 +794,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (Pawn.Dead) return null;
 | 
					                if (Pawn.Dead || !Pawn.ShouldCycle()) return null;
 | 
				
			||||||
                StringBuilder tip = new StringBuilder();
 | 
					                StringBuilder tip = new StringBuilder();
 | 
				
			||||||
                tip.Append(Translations.Dialog_WombInfo01);
 | 
					                tip.Append(Translations.Dialog_WombInfo01);
 | 
				
			||||||
                tip.Append(": ");
 | 
					                tip.Append(": ");
 | 
				
			||||||
| 
						 | 
					@ -812,7 +816,11 @@ namespace RJW_Menstruation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public override string CompDebugString()
 | 
					        public override string CompDebugString()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (Pawn.Dead || curStage == Stage.None || curStage == Stage.Infertile || curStage == Stage.Pregnant) return null;
 | 
					            if (Pawn.Dead ||
 | 
				
			||||||
 | 
					                !Pawn.ShouldCycle() ||
 | 
				
			||||||
 | 
					                curStage == Stage.None ||
 | 
				
			||||||
 | 
					                curStage == Stage.Infertile ||
 | 
				
			||||||
 | 
					                curStage == Stage.Pregnant) return null;
 | 
				
			||||||
            StringBuilder debugString = new StringBuilder();
 | 
					            StringBuilder debugString = new StringBuilder();
 | 
				
			||||||
            debugString.Append($"Time to next state: ");
 | 
					            debugString.Append($"Time to next state: ");
 | 
				
			||||||
            debugString.Append(GenDate.ToStringTicksToPeriod(TicksToNextStage()));
 | 
					            debugString.Append(GenDate.ToStringTicksToPeriod(TicksToNextStage()));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -242,7 +242,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
            bool isInduced = comp is HediffComp_InducedOvulator;
 | 
					            bool isInduced = comp is HediffComp_InducedOvulator;
 | 
				
			||||||
            if (comp.curStage == HediffComp_Menstruation.Stage.Follicular &&
 | 
					            if (comp.curStage == HediffComp_Menstruation.Stage.Follicular &&
 | 
				
			||||||
                isInduced &&
 | 
					                isInduced &&
 | 
				
			||||||
                comp.Pawn.jobs.curDriver is JobDriver_Sex job &&
 | 
					                comp.Pawn.jobs?.curDriver is JobDriver_Sex job &&
 | 
				
			||||||
                job.Sexprops != null &&
 | 
					                job.Sexprops != null &&
 | 
				
			||||||
                !UsingCondom(comp.Pawn, job.Partner) &&
 | 
					                !UsingCondom(comp.Pawn, job.Partner) &&
 | 
				
			||||||
                (job.Sexprops.sexType == xxx.rjwSextype.Vaginal || job.Sexprops.sexType == xxx.rjwSextype.DoublePenetration))
 | 
					                (job.Sexprops.sexType == xxx.rjwSextype.Vaginal || job.Sexprops.sexType == xxx.rjwSextype.DoublePenetration))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,10 +33,14 @@ namespace RJW_Menstruation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            foreach (LocalTargetInfo t in selftargets)
 | 
					            foreach (LocalTargetInfo t in selftargets)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (t.Pawn == pawn && pawn.HasMenstruationComp()) opts.AddDistinct(MakeSelfMenu(pawn, t));
 | 
					                if (t.Pawn == pawn)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    if (pawn.HasMenstruationComp() && pawn.ShouldCycle())
 | 
				
			||||||
 | 
					                        opts.AddDistinct(MakeSelfMenu(pawn, t));
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public static FloatMenuOption MakeSelfMenu(Pawn pawn, LocalTargetInfo target)
 | 
					        public static FloatMenuOption MakeSelfMenu(Pawn pawn, LocalTargetInfo target)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue