mirror of
				https://gitgud.io/lutepickle/rjw_menstruation.git
				synced 2024-08-14 22:46:52 +00:00 
			
		
		
		
	Cum fertility overhaul. Now track volume and fertility percentage instead of fertvolume.
This commit is contained in:
		
							parent
							
								
									24e7f93bcc
								
							
						
					
					
						commit
						8a048ea7e5
					
				
					 1 changed files with 10 additions and 13 deletions
				
			
		| 
						 | 
					@ -11,8 +11,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
        public Pawn pawn;
 | 
					        public Pawn pawn;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        protected float volume; // ml
 | 
					        protected float volume; // ml
 | 
				
			||||||
        protected float fertvolume;
 | 
					        public float fertility = 1.0f;
 | 
				
			||||||
        public float fertFactor = 1.0f;
 | 
					 | 
				
			||||||
        public bool notcum = false; // for other fluids
 | 
					        public bool notcum = false; // for other fluids
 | 
				
			||||||
        public string notcumLabel = "";
 | 
					        public string notcumLabel = "";
 | 
				
			||||||
        protected bool useCustomColor = false;
 | 
					        protected bool useCustomColor = false;
 | 
				
			||||||
| 
						 | 
					@ -32,7 +31,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return fertvolume;
 | 
					                return volume * fertility;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -130,7 +129,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            this.pawn = pawn;
 | 
					            this.pawn = pawn;
 | 
				
			||||||
            volume = 1.0f;
 | 
					            volume = 1.0f;
 | 
				
			||||||
            fertvolume = 1.0f;
 | 
					            fertility = 1.0f;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -145,7 +144,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            this.pawn = pawn;
 | 
					            this.pawn = pawn;
 | 
				
			||||||
            this.volume = volume;
 | 
					            this.volume = volume;
 | 
				
			||||||
            this.fertvolume = volume;
 | 
					            this.fertility = 0f;
 | 
				
			||||||
            this.notcum = true;
 | 
					            this.notcum = true;
 | 
				
			||||||
            this.notcumLabel = notcumlabel;
 | 
					            this.notcumLabel = notcumlabel;
 | 
				
			||||||
            this.notcumthickness = decayresist;
 | 
					            this.notcumthickness = decayresist;
 | 
				
			||||||
| 
						 | 
					@ -156,7 +155,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            this.pawn = pawn;
 | 
					            this.pawn = pawn;
 | 
				
			||||||
            this.volume = volume;
 | 
					            this.volume = volume;
 | 
				
			||||||
            this.fertvolume = volume * fertility;
 | 
					            this.fertility = fertility;
 | 
				
			||||||
            this.filthDef = filthDef;
 | 
					            this.filthDef = filthDef;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -167,9 +166,8 @@ namespace RJW_Menstruation
 | 
				
			||||||
            Scribe_References.Look(ref pawn, "pawn", true);
 | 
					            Scribe_References.Look(ref pawn, "pawn", true);
 | 
				
			||||||
            Scribe_References.Look(ref internalThing, "internalThing", true);
 | 
					            Scribe_References.Look(ref internalThing, "internalThing", true);
 | 
				
			||||||
            Scribe_Values.Look(ref volume, "volume", volume, true);
 | 
					            Scribe_Values.Look(ref volume, "volume", volume, true);
 | 
				
			||||||
            Scribe_Values.Look(ref fertvolume, "fertvolume", fertvolume, true);
 | 
					            Scribe_Values.Look(ref fertility, "fertility", fertility, true);
 | 
				
			||||||
            Scribe_Values.Look(ref notcumthickness, "notcumthickness", notcumthickness, true);
 | 
					            Scribe_Values.Look(ref notcumthickness, "notcumthickness", notcumthickness, true);
 | 
				
			||||||
            Scribe_Values.Look(ref fertFactor, "fertFactor", fertFactor, true);
 | 
					 | 
				
			||||||
            Scribe_Values.Look(ref notcum, "notcum", notcum, true);
 | 
					            Scribe_Values.Look(ref notcum, "notcum", notcum, true);
 | 
				
			||||||
            Scribe_Values.Look(ref notcumLabel, "notcumLabel", notcumLabel, true);
 | 
					            Scribe_Values.Look(ref notcumLabel, "notcumLabel", notcumLabel, true);
 | 
				
			||||||
            Scribe_Values.Look(ref useCustomColor, "useCustomColor", useCustomColor, true);
 | 
					            Scribe_Values.Look(ref useCustomColor, "useCustomColor", useCustomColor, true);
 | 
				
			||||||
| 
						 | 
					@ -187,7 +185,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (updatefilthDef != null) filthDef = updatefilthDef;
 | 
					            if (updatefilthDef != null) filthDef = updatefilthDef;
 | 
				
			||||||
            volume += volumein;
 | 
					            volume += volumein;
 | 
				
			||||||
            fertvolume += volumein*fertility;
 | 
					            this.fertility = (this.volume * this.fertility + volumein * fertility) / (this.volume + volumein);
 | 
				
			||||||
            cumthickness = Mathf.Lerp(cumthickness, 1.0f, volumein / volume);
 | 
					            cumthickness = Mathf.Lerp(cumthickness, 1.0f, volumein / volume);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -195,12 +193,13 @@ namespace RJW_Menstruation
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (updatefilthDef != null) filthDef = updatefilthDef;
 | 
					            if (updatefilthDef != null) filthDef = updatefilthDef;
 | 
				
			||||||
            volume += volumein;
 | 
					            volume += volumein;
 | 
				
			||||||
 | 
					            fertility = volume * fertility / (volume + volumein);
 | 
				
			||||||
            notcumthickness = Mathf.Lerp(notcumthickness, thickness, volumein / volume);
 | 
					            notcumthickness = Mathf.Lerp(notcumthickness, thickness, volumein / volume);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool ShouldRemove()
 | 
					        public bool ShouldRemove()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if ((notcum || fertvolume < 0.001f) && volume < 0.01f) return true;
 | 
					            if ((notcum || FertVolume < 0.001f) && volume < 0.01f) return true;
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -209,7 +208,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            float totalleak = volume;
 | 
					            float totalleak = volume;
 | 
				
			||||||
            volume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - DecayResist)) * leakfactor));
 | 
					            volume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - DecayResist)) * leakfactor));
 | 
				
			||||||
            fertvolume *= Math.Max(0, 1 - (Configurations.CumFertilityDecayRatio * (1 - DecayResist) + antisperm));
 | 
					            fertility *= Math.Max(0, 1 - (Configurations.CumFertilityDecayRatio * (1 - DecayResist) + antisperm));
 | 
				
			||||||
            CutMinor();
 | 
					            CutMinor();
 | 
				
			||||||
            totalleak -= volume;
 | 
					            totalleak -= volume;
 | 
				
			||||||
            return totalleak;
 | 
					            return totalleak;
 | 
				
			||||||
| 
						 | 
					@ -219,7 +218,6 @@ namespace RJW_Menstruation
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            float totalleak = volume;
 | 
					            float totalleak = volume;
 | 
				
			||||||
            volume *= Math.Max(0, 1 - (portion * (1 - DecayResist/10)) * leakfactor);
 | 
					            volume *= Math.Max(0, 1 - (portion * (1 - DecayResist/10)) * leakfactor);
 | 
				
			||||||
            fertvolume *= Math.Max(0, 1 - (portion * (1 - DecayResist)) * leakfactor);
 | 
					 | 
				
			||||||
            CutMinor();
 | 
					            CutMinor();
 | 
				
			||||||
            totalleak -= volume;
 | 
					            totalleak -= volume;
 | 
				
			||||||
            return totalleak;
 | 
					            return totalleak;
 | 
				
			||||||
| 
						 | 
					@ -241,7 +239,6 @@ namespace RJW_Menstruation
 | 
				
			||||||
        protected void CutMinor()
 | 
					        protected void CutMinor()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (volume < 0.01f) volume = 0f;
 | 
					            if (volume < 0.01f) volume = 0f;
 | 
				
			||||||
            if (fertvolume < 0.001f) fertvolume = 0f;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue