1.0.4.3
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 | 
					<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 | 
				
			||||||
<Manifest>
 | 
					<Manifest>
 | 
				
			||||||
	<identifier>RJW Menstruation</identifier>
 | 
						<identifier>RJW Menstruation</identifier>
 | 
				
			||||||
	<version>1.0.4.2a</version>
 | 
						<version>1.0.4.3</version>
 | 
				
			||||||
	<dependencies>
 | 
						<dependencies>
 | 
				
			||||||
	</dependencies>
 | 
						</dependencies>
 | 
				
			||||||
	<incompatibleWith />
 | 
						<incompatibleWith />
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										65
									
								
								Defs/Recipe_Surgery/Recipes_Surgery_Breast.xml
									
										
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -0,0 +1,65 @@
 | 
				
			||||||
 | 
					<?xml version="1.0" encoding="utf-8" ?>
 | 
				
			||||||
 | 
					<Defs>
 | 
				
			||||||
 | 
					  <RecipeDef Abstract="True" Name="BaseBreastSurgery">
 | 
				
			||||||
 | 
					    <effectWorking>Surgery</effectWorking>
 | 
				
			||||||
 | 
					    <soundWorking>Recipe_Surgery</soundWorking>
 | 
				
			||||||
 | 
					    <workSpeedStat>MedicalOperationSpeed</workSpeedStat>
 | 
				
			||||||
 | 
					    <workSkill>Medicine</workSkill>
 | 
				
			||||||
 | 
					    <workSkillLearnFactor>0.2</workSkillLearnFactor>
 | 
				
			||||||
 | 
					    <workAmount>400</workAmount>
 | 
				
			||||||
 | 
						<anesthetize>false</anesthetize>
 | 
				
			||||||
 | 
						<recipeUsers>
 | 
				
			||||||
 | 
							<li>Human</li>
 | 
				
			||||||
 | 
						</recipeUsers>
 | 
				
			||||||
 | 
					    <surgerySuccessChanceFactor>100</surgerySuccessChanceFactor>
 | 
				
			||||||
 | 
					    <ingredients>
 | 
				
			||||||
 | 
					      <li>
 | 
				
			||||||
 | 
					        <filter>
 | 
				
			||||||
 | 
					          <categories>
 | 
				
			||||||
 | 
					            <li>Medicine</li>
 | 
				
			||||||
 | 
					          </categories>
 | 
				
			||||||
 | 
					        </filter>
 | 
				
			||||||
 | 
					        <count>1</count>
 | 
				
			||||||
 | 
					      </li>
 | 
				
			||||||
 | 
					    </ingredients>
 | 
				
			||||||
 | 
					    <fixedIngredientFilter>
 | 
				
			||||||
 | 
					      <categories>
 | 
				
			||||||
 | 
					        <li>Medicine</li>
 | 
				
			||||||
 | 
					      </categories>
 | 
				
			||||||
 | 
					    </fixedIngredientFilter>
 | 
				
			||||||
 | 
					  </RecipeDef>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <RecipeDef ParentName="BaseBreastSurgery">
 | 
				
			||||||
 | 
					    <defName>Surgery_ExpandAreola</defName>
 | 
				
			||||||
 | 
					    <label>expand areola</label>
 | 
				
			||||||
 | 
					    <description>expand areola.</description>
 | 
				
			||||||
 | 
					    <workerClass>RJW_Menstruation.Recipe_ExpandAreola</workerClass>
 | 
				
			||||||
 | 
					    <jobString>expanding areola</jobString>
 | 
				
			||||||
 | 
					  </RecipeDef>
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					  <RecipeDef ParentName="BaseBreastSurgery">
 | 
				
			||||||
 | 
					    <defName>Surgery_ContractAreola</defName>
 | 
				
			||||||
 | 
					    <label>contract areola</label>
 | 
				
			||||||
 | 
					    <description>contract areola.</description>
 | 
				
			||||||
 | 
					    <workerClass>RJW_Menstruation.Recipe_ContractAreola</workerClass>
 | 
				
			||||||
 | 
					    <jobString>contracting areola</jobString>
 | 
				
			||||||
 | 
					  </RecipeDef>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <RecipeDef ParentName="BaseBreastSurgery">
 | 
				
			||||||
 | 
					    <defName>Surgery_ExpandNipple</defName>
 | 
				
			||||||
 | 
					    <label>expand nipple</label>
 | 
				
			||||||
 | 
					    <description>expand nipple.</description>
 | 
				
			||||||
 | 
					    <workerClass>RJW_Menstruation.Recipe_ExpandNipple</workerClass>
 | 
				
			||||||
 | 
					    <jobString>expanding nipple</jobString>
 | 
				
			||||||
 | 
					  </RecipeDef>
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					  <RecipeDef ParentName="BaseBreastSurgery">
 | 
				
			||||||
 | 
					    <defName>Surgery_ContractNipple</defName>
 | 
				
			||||||
 | 
					    <label>contract nipple</label>
 | 
				
			||||||
 | 
					    <description>contract nipple.</description>
 | 
				
			||||||
 | 
					    <workerClass>RJW_Menstruation.Recipe_ContractNipple</workerClass>
 | 
				
			||||||
 | 
					    <jobString>contracting nipple</jobString>
 | 
				
			||||||
 | 
					  </RecipeDef>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					</Defs>
 | 
				
			||||||
| 
		 Before Width: | Height: | Size: 637 B  | 
| 
		 Before Width: | Height: | Size: 760 B  | 
| 
		 Before Width: | Height: | Size: 877 B  | 
| 
		 Before Width: | Height: | Size: 123 B  | 
| 
		 Before Width: | Height: | Size: 123 B  | 
| 
		 Before Width: | Height: | Size: 1.4 KiB  | 
| 
		 Before Width: | Height: | Size: 1.8 KiB  | 
| 
		 Before Width: | Height: | Size: 829 B  | 
| 
		 Before Width: | Height: | Size: 722 B  | 
| 
		 Before Width: | Height: | Size: 841 B  | 
| 
		 Before Width: | Height: | Size: 238 B  | 
| 
		 Before Width: | Height: | Size: 973 B  | 
| 
		 Before Width: | Height: | Size: 415 B  | 
| 
		 Before Width: | Height: | Size: 721 B  | 
| 
		 Before Width: | Height: | Size: 750 B  | 
| 
		 Before Width: | Height: | Size: 3.8 KiB  | 
| 
		 Before Width: | Height: | Size: 530 B  | 
| 
		 Before Width: | Height: | Size: 1.3 KiB  | 
| 
		 Before Width: | Height: | Size: 360 B  | 
| 
		 Before Width: | Height: | Size: 282 B  | 
| 
		 Before Width: | Height: | Size: 282 B  | 
| 
		 Before Width: | Height: | Size: 1.9 KiB  | 
| 
		 Before Width: | Height: | Size: 818 B  | 
| 
		 Before Width: | Height: | Size: 1.7 KiB  | 
| 
		 Before Width: | Height: | Size: 1 KiB  | 
| 
		 Before Width: | Height: | Size: 622 B  | 
| 
						 | 
					@ -1,3 +1,13 @@
 | 
				
			||||||
 | 
					Version 1.0.4.3
 | 
				
			||||||
 | 
					 - fixed errors on pregnancy
 | 
				
			||||||
 | 
					 - added surgeries for nipple/areola
 | 
				
			||||||
 | 
					 - changed cum calculate method
 | 
				
			||||||
 | 
					   - cum's fertility will remain 
 | 
				
			||||||
 | 
					   - IUD will diminish cum's fertility
 | 
				
			||||||
 | 
					 - changed default settings
 | 
				
			||||||
 | 
					   - fertilization chance raised 5% to 15%
 | 
				
			||||||
 | 
					   - cum decay ratio raised 15% to 30%
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Version 1.0.4.2a
 | 
					Version 1.0.4.2a
 | 
				
			||||||
 - fixed hybrid custom UI
 | 
					 - fixed hybrid custom UI
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,10 +9,10 @@ namespace RJW_Menstruation
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public const float ImplantationChanceDefault = 0.65f;
 | 
					        public const float ImplantationChanceDefault = 0.65f;
 | 
				
			||||||
        public const int ImplantationChanceAdjustDefault = 65;
 | 
					        public const int ImplantationChanceAdjustDefault = 65;
 | 
				
			||||||
        public const float FertilizeChanceDefault = 0.05f;
 | 
					        public const float FertilizeChanceDefault = 0.15f;
 | 
				
			||||||
        public const int FertilizeChanceAdjustDefault = 50;
 | 
					        public const int FertilizeChanceAdjustDefault = 150;
 | 
				
			||||||
        public const float CumDecayRatioDefault = 0.15f;
 | 
					        public const float CumDecayRatioDefault = 0.30f;
 | 
				
			||||||
        public const int CumDecayRatioAdjustDefault = 150;
 | 
					        public const int CumDecayRatioAdjustDefault = 300;
 | 
				
			||||||
        public const float CumFertilityDecayRatioDefault = 0.2f;
 | 
					        public const float CumFertilityDecayRatioDefault = 0.2f;
 | 
				
			||||||
        public const int CumFertilityDecayRatioAdjustDefault = 200;
 | 
					        public const int CumFertilityDecayRatioAdjustDefault = 200;
 | 
				
			||||||
        public const int CycleAccelerationDefault = 6;
 | 
					        public const int CycleAccelerationDefault = 6;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,14 +9,30 @@ namespace RJW_Menstruation
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public Pawn pawn;
 | 
					        public Pawn pawn;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public float volume; // ml
 | 
					        protected float volume; // ml
 | 
				
			||||||
        public float fertvolume;
 | 
					        protected float fertvolume;
 | 
				
			||||||
        public float fertFactor = 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 = "";
 | 
				
			||||||
        private bool useCustomColor = false;
 | 
					        protected bool useCustomColor = false;
 | 
				
			||||||
        private float notcumthickness = 0;
 | 
					        protected float notcumthickness = 0;
 | 
				
			||||||
        private float cumthickness = 1.0f;
 | 
					        protected float cumthickness = 1.0f;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public float Volume
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                return volume;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public float FertVolume
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                return fertvolume;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public float CumThickness
 | 
					        public float CumThickness
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					@ -38,7 +54,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
                notcumthickness = value;
 | 
					                notcumthickness = value;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        private Color customColor;
 | 
					        protected Color customColor;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public PawnDNAModExtension DNA
 | 
					        public PawnDNAModExtension DNA
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					@ -63,7 +79,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
                else return DNAcache;
 | 
					                else return DNAcache;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        private PawnDNAModExtension DNAcache = null;
 | 
					        protected PawnDNAModExtension DNAcache = null;
 | 
				
			||||||
        public ThingDef FilthDef
 | 
					        public ThingDef FilthDef
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
| 
						 | 
					@ -76,7 +92,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
                filthDef = value;
 | 
					                filthDef = value;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        private ThingDef filthDef = null;
 | 
					        protected ThingDef filthDef = null;
 | 
				
			||||||
        public Color color
 | 
					        public Color color
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
| 
						 | 
					@ -102,6 +118,14 @@ namespace RJW_Menstruation
 | 
				
			||||||
            fertvolume = 1.0f;
 | 
					            fertvolume = 1.0f;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /// <summary>
 | 
				
			||||||
 | 
					        /// Not Cum
 | 
				
			||||||
 | 
					        /// </summary>
 | 
				
			||||||
 | 
					        /// <param name="pawn"></param>
 | 
				
			||||||
 | 
					        /// <param name="volume"></param>
 | 
				
			||||||
 | 
					        /// <param name="notcumlabel"></param>
 | 
				
			||||||
 | 
					        /// <param name="decayresist"></param>
 | 
				
			||||||
 | 
					        /// <param name="filthDef"></param>
 | 
				
			||||||
        public Cum(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthDef = null)
 | 
					        public Cum(Pawn pawn, float volume, string notcumlabel, float decayresist = 0, ThingDef filthDef = null)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            this.pawn = pawn;
 | 
					            this.pawn = pawn;
 | 
				
			||||||
| 
						 | 
					@ -117,12 +141,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            this.pawn = pawn;
 | 
					            this.pawn = pawn;
 | 
				
			||||||
            this.volume = volume;
 | 
					            this.volume = volume;
 | 
				
			||||||
            if (fertility > 0)
 | 
					            this.fertvolume = volume * fertility;
 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                this.fertvolume = volume;
 | 
					 | 
				
			||||||
                this.fertFactor = fertility;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            else this.fertvolume = 0;
 | 
					 | 
				
			||||||
            this.filthDef = filthDef;
 | 
					            this.filthDef = filthDef;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -150,21 +169,57 @@ namespace RJW_Menstruation
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void MergeWithCum(float volumein, ThingDef updatefilthDef = null)
 | 
					        public void MergeWithCum(float volumein, float fertility,  ThingDef updatefilthDef = null)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (updatefilthDef != null) filthDef = updatefilthDef;
 | 
					            if (updatefilthDef != null) filthDef = updatefilthDef;
 | 
				
			||||||
            volume = volumein;
 | 
					            volume += volumein;
 | 
				
			||||||
            fertvolume = volumein;
 | 
					            fertvolume += volumein*fertility;
 | 
				
			||||||
            cumthickness = Mathf.Lerp(cumthickness, 1.0f, volumein / volume);
 | 
					            cumthickness = Mathf.Lerp(cumthickness, 1.0f, volumein / volume);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void MergeWithFluid(float volumein, float thickness, ThingDef updatefilthDef = null)
 | 
					        public void MergeWithFluid(float volumein, float thickness, ThingDef updatefilthDef = null)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (updatefilthDef != null) filthDef = updatefilthDef;
 | 
					            if (updatefilthDef != null) filthDef = updatefilthDef;
 | 
				
			||||||
            volume = volumein;
 | 
					            volume += volumein;
 | 
				
			||||||
            cumthickness = Mathf.Lerp(cumthickness, thickness, volumein / volume);
 | 
					            cumthickness = Mathf.Lerp(cumthickness, thickness, volumein / volume);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool ShouldRemove()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (fertvolume < 0.001f && volume < 0.001f) return true;
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public float DismishNatural(float leakfactor, float antisperm = 0.0f)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            float totalleak = volume;
 | 
				
			||||||
 | 
					            volume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - decayresist)) * leakfactor));
 | 
				
			||||||
 | 
					            fertvolume *= Math.Max(0, 1 - (Configurations.CumFertilityDecayRatio * (1 - decayresist) + antisperm));
 | 
				
			||||||
 | 
					            CutMinor();
 | 
				
			||||||
 | 
					            totalleak -= volume;
 | 
				
			||||||
 | 
					            return totalleak;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        public float DismishForce(float portion, float leakfactor = 1.0f)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            float totalleak = volume;
 | 
				
			||||||
 | 
					            volume *= Math.Max(0, 1 - (portion * (1 - decayresist)) * leakfactor);
 | 
				
			||||||
 | 
					            fertvolume *= Math.Max(0, 1 - (portion * (1 - decayresist)) * leakfactor);
 | 
				
			||||||
 | 
					            CutMinor();
 | 
				
			||||||
 | 
					            totalleak -= volume;
 | 
				
			||||||
 | 
					            return totalleak;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        protected void CutMinor()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (volume < 0.01f) volume = 0f;
 | 
				
			||||||
 | 
					            if (fertvolume < 0.001f) fertvolume = 0f;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -260,9 +260,26 @@ namespace RJW_Menstruation
 | 
				
			||||||
            float variance = breastSizeIncreased * Math.Min(ratio, 1.0f);
 | 
					            float variance = breastSizeIncreased * Math.Min(ratio, 1.0f);
 | 
				
			||||||
            breastSizeIncreased -= variance;
 | 
					            breastSizeIncreased -= variance;
 | 
				
			||||||
            parent.Severity -= variance;
 | 
					            parent.Severity -= variance;
 | 
				
			||||||
            
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
 | 
					        public void AdjustNippleSizeImmidiately(float amount)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            originnipple = Math.Max(0, originnipple + amount);
 | 
				
			||||||
 | 
					            nippleSizePermanent = Math.Min(MaxNipple, nippleSizePermanent + amount);
 | 
				
			||||||
 | 
					            nippleSize = Math.Min(MaxNipple, nippleSize + amount);
 | 
				
			||||||
 | 
					            nippleSizeCurrent = nippleSize;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public void AdjustAreolaSizeImmidiately(float amount)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            originareola = Math.Max(0, originareola + amount);
 | 
				
			||||||
 | 
					            areolaSizePermanent = Math.Min(MaxAreola, areolaSizePermanent + amount);
 | 
				
			||||||
 | 
					            areolaSize = Math.Min(MaxAreola, areolaSize + amount);
 | 
				
			||||||
 | 
					            areolaSizeCurrent = areolaSize;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void UpdateColor()
 | 
					        public void UpdateColor()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            cachedcolor = Colors.CMYKLerp(parent?.pawn?.story?.SkinColor ?? Color.white, Props.BlackNippleColor, Alpha);
 | 
					            cachedcolor = Colors.CMYKLerp(parent?.pawn?.story?.SkinColor ?? Color.white, Props.BlackNippleColor, Alpha);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -43,7 +43,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public override void AfterCumIn(Pawn cummer)
 | 
					        protected override void AfterCumIn(Pawn cummer)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            base.AfterCumIn(cummer);
 | 
					            base.AfterCumIn(cummer);
 | 
				
			||||||
            if (curStage == Stage.Follicular) curStage = Stage.Ovulatory;
 | 
					            if (curStage == Stage.Follicular) curStage = Stage.Ovulatory;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -111,6 +111,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
        protected bool estrusflag = false;
 | 
					        protected bool estrusflag = false;
 | 
				
			||||||
        protected int opcache = -1;
 | 
					        protected int opcache = -1;
 | 
				
			||||||
        protected HediffComp_Breast breastcache = null;
 | 
					        protected HediffComp_Breast breastcache = null;
 | 
				
			||||||
 | 
					        protected float antisperm = 0.0f;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public int ovarypowerthreshold
 | 
					        public int ovarypowerthreshold
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					@ -137,7 +138,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
                if (cums.NullOrEmpty()) return 0;
 | 
					                if (cums.NullOrEmpty()) return 0;
 | 
				
			||||||
                foreach (Cum cum in cums)
 | 
					                foreach (Cum cum in cums)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    res += cum.volume;
 | 
					                    res += cum.Volume;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                return res;
 | 
					                return res;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -150,7 +151,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
                if (cums.NullOrEmpty()) return 0;
 | 
					                if (cums.NullOrEmpty()) return 0;
 | 
				
			||||||
                foreach (Cum cum in cums)
 | 
					                foreach (Cum cum in cums)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    if (!cum.notcum) res += cum.fertvolume;
 | 
					                    if (!cum.notcum) res += cum.FertVolume;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                return res;
 | 
					                return res;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -163,7 +164,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
                if (cums.NullOrEmpty()) return 0;
 | 
					                if (cums.NullOrEmpty()) return 0;
 | 
				
			||||||
                foreach (Cum cum in cums)
 | 
					                foreach (Cum cum in cums)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    res += cum.volume;
 | 
					                    res += cum.Volume;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                return res / Props.maxCumCapacity;
 | 
					                return res / Props.maxCumCapacity;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -214,8 +215,8 @@ namespace RJW_Menstruation
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
 | 
					                if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        if (!cum.notcum) yield return String.Format(cum.pawn?.Label + ": {0:0.##}ml", cum.volume);
 | 
					                        if (!cum.notcum) yield return String.Format(cum.pawn?.Label + ": {0:0.##}ml", cum.Volume);
 | 
				
			||||||
                        else yield return String.Format(cum.notcumLabel + ": {0:0.##}ml", cum.volume);
 | 
					                        else yield return String.Format(cum.notcumLabel + ": {0:0.##}ml", cum.Volume);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                else yield return Translations.Info_noCum;
 | 
					                else yield return Translations.Info_noCum;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -231,8 +232,11 @@ namespace RJW_Menstruation
 | 
				
			||||||
                    float mixedsofar = 0;
 | 
					                    float mixedsofar = 0;
 | 
				
			||||||
                    foreach (Cum cum in cums)
 | 
					                    foreach (Cum cum in cums)
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        mixedcolor = Colors.CMYKLerp(mixedcolor, cum.color, cum.volume / (mixedsofar + cum.volume));
 | 
					                        if (cum.Volume > 0)
 | 
				
			||||||
                        mixedsofar += cum.volume;
 | 
					                        {
 | 
				
			||||||
 | 
					                            mixedcolor = Colors.CMYKLerp(mixedcolor, cum.color, cum.Volume / (mixedsofar + cum.Volume));
 | 
				
			||||||
 | 
					                            mixedsofar += cum.Volume;
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                return mixedcolor;
 | 
					                return mixedcolor;
 | 
				
			||||||
| 
						 | 
					@ -334,7 +338,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
 | 
					                    if (!cums.NullOrEmpty()) foreach (Cum cum in cums)
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            if (cum.fertvolume > 0) return true;
 | 
					                            if (cum.FertVolume > 0) return true;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    return false;
 | 
					                    return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -367,6 +371,8 @@ namespace RJW_Menstruation
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
					                if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (curStage == Stage.Follicular || curStage == Stage.ClimactericFollicular)
 | 
					                if (curStage == Stage.Follicular || curStage == Stage.ClimactericFollicular)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    if (curStageHrs > 0.7f * (follicularIntervalhours - bleedingIntervalhours)) return true;
 | 
					                    if (curStageHrs > 0.7f * (follicularIntervalhours - bleedingIntervalhours)) return true;
 | 
				
			||||||
| 
						 | 
					@ -432,7 +438,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
            Scribe_Values.Look(ref eggstack, "eggstack", eggstack, true);
 | 
					            Scribe_Values.Look(ref eggstack, "eggstack", eggstack, true);
 | 
				
			||||||
            Scribe_Values.Look(ref estrusflag, "estrusflag", estrusflag, true);
 | 
					            Scribe_Values.Look(ref estrusflag, "estrusflag", estrusflag, true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -510,11 +516,10 @@ namespace RJW_Menstruation
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        if (cum.pawn.Equals(pawn))
 | 
					                        if (cum.pawn.Equals(pawn))
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            cum.MergeWithCum(volume, filthdef);
 | 
					                            cum.MergeWithCum(volume, fertility, filthdef);
 | 
				
			||||||
                            merged = true;
 | 
					                            merged = true;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        cum.volume *= 1 - cumoutrate;
 | 
					                        cum.DismishForce(cumoutrate);
 | 
				
			||||||
                        cum.fertvolume *= 1 - cumoutrate;
 | 
					 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate), fertility, filthdef));
 | 
					                if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate), fertility, filthdef));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -526,7 +531,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        if (cum.pawn.Equals(pawn))
 | 
					                        if (cum.pawn.Equals(pawn))
 | 
				
			||||||
                        {
 | 
					                        {
 | 
				
			||||||
                            cum.MergeWithCum(volume, filthdef);
 | 
					                            cum.MergeWithCum(volume, fertility, filthdef);
 | 
				
			||||||
                            merged = true;
 | 
					                            merged = true;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
| 
						 | 
					@ -560,8 +565,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
                            cum.MergeWithFluid(volume, decayresist, filthdef);
 | 
					                            cum.MergeWithFluid(volume, decayresist, filthdef);
 | 
				
			||||||
                            merged = true;
 | 
					                            merged = true;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        cum.volume *= 1 - cumoutrate;
 | 
					                        cum.DismishForce(cumoutrate);
 | 
				
			||||||
                        cum.fertvolume *= 1 - cumoutrate;
 | 
					 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate), notcumlabel, decayresist, filthdef));
 | 
					                if (!merged) cums.Add(new Cum(pawn, volume * (1 - cumoutrate), notcumlabel, decayresist, filthdef));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -584,13 +588,13 @@ namespace RJW_Menstruation
 | 
				
			||||||
            AfterFluidIn(cumd);
 | 
					            AfterFluidIn(cumd);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public virtual void AfterCumIn(Pawn cummer)
 | 
					        protected virtual void AfterCumIn(Pawn cummer)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            ThoughtCumInside(cummer);
 | 
					            ThoughtCumInside(cummer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public virtual void AfterNotCumIn()
 | 
					        protected virtual void AfterNotCumIn()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -599,15 +603,19 @@ namespace RJW_Menstruation
 | 
				
			||||||
        /// Action for both Cum and NotCum
 | 
					        /// Action for both Cum and NotCum
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="fd">Fluid deviation</param>
 | 
					        /// <param name="fd">Fluid deviation</param>
 | 
				
			||||||
        public virtual void AfterFluidIn(float fd)
 | 
					        protected virtual void AfterFluidIn(float fd)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void BeforeCumOut(out Absorber absorber)
 | 
					        protected void BeforeCumOut(out Absorber absorber)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) antisperm = 0.70f;
 | 
				
			||||||
 | 
					            else antisperm = 0.0f;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            absorber = (Absorber)parent.pawn.apparel?.WornApparel?.Find(x => x is Absorber);
 | 
					            absorber = (Absorber)parent.pawn.apparel?.WornApparel?.Find(x => x is Absorber);
 | 
				
			||||||
            if (absorber != null)
 | 
					            if (absorber != null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -619,7 +627,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// For natural leaking
 | 
					        /// For natural leaking
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public virtual void AfterCumOut()
 | 
					        protected virtual void AfterCumOut()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            parent.pawn.needs?.mood?.thoughts?.memories?.TryGainMemory(VariousDefOf.LeakingFluids);
 | 
					            parent.pawn.needs?.mood?.thoughts?.memories?.TryGainMemory(VariousDefOf.LeakingFluids);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -628,7 +636,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
        /// For all type of leaking
 | 
					        /// For all type of leaking
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="fd"></param>
 | 
					        /// <param name="fd"></param>
 | 
				
			||||||
        public virtual void AfterFluidOut(float fd)
 | 
					        protected virtual void AfterFluidOut(float fd)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -651,16 +659,12 @@ namespace RJW_Menstruation
 | 
				
			||||||
            List<Cum> removecums = new List<Cum>();
 | 
					            List<Cum> removecums = new List<Cum>();
 | 
				
			||||||
            foreach (Cum cum in cums)
 | 
					            foreach (Cum cum in cums)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                float vd = cum.volume;
 | 
					                float vd = cum.DismishNatural(leakfactor, antisperm);
 | 
				
			||||||
                cum.volume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist)) * leakfactor));
 | 
					 | 
				
			||||||
                cum.fertvolume *= Math.Max(0, (1 - (Configurations.CumDecayRatio * (1 - cum.decayresist)) * leakfactor) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist))));
 | 
					 | 
				
			||||||
                vd -= cum.volume;
 | 
					 | 
				
			||||||
                cum.MakeThinner(Configurations.CycleAcceleration);
 | 
					                cum.MakeThinner(Configurations.CycleAcceleration);
 | 
				
			||||||
                totalleak += AbsorbCum(cum, vd, absorber);
 | 
					                totalleak += AbsorbCum(cum, vd, absorber);
 | 
				
			||||||
                string tmp = "FilthLabelWithSource".Translate(cum.FilthDef.label, cum.pawn?.LabelShort ?? "Unknown", 1.ToString());
 | 
					                string tmp = "FilthLabelWithSource".Translate(cum.FilthDef.label, cum.pawn?.LabelShort ?? "Unknown", 1.ToString());
 | 
				
			||||||
                filthlabels.Add(tmp.Replace(" x1", ""));
 | 
					                filthlabels.Add(tmp.Replace(" x1", ""));
 | 
				
			||||||
                if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
 | 
					                if (cum.ShouldRemove()) removecums.Add(cum);
 | 
				
			||||||
                if (cum.volume < 0.01f) removecums.Add(cum);
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (cums.Count > 1) MakeCumFilthMixture(totalleak, filthlabels);
 | 
					            if (cums.Count > 1) MakeCumFilthMixture(totalleak, filthlabels);
 | 
				
			||||||
            else if (cums.Count == 1) MakeCumFilth(cums.First(), totalleak);
 | 
					            else if (cums.Count == 1) MakeCumFilth(cums.First(), totalleak);
 | 
				
			||||||
| 
						 | 
					@ -683,25 +687,21 @@ namespace RJW_Menstruation
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public float CumOut(Cum targetcum, float portion = 0.1f)
 | 
					        public float CumOut(Cum targetcum, float portion = 0.1f)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            float leakfactor = 1.0f;
 | 
					            if (cums.NullOrEmpty()) return 0;
 | 
				
			||||||
            float totalleak = 0;
 | 
					            float totalleak = 0;
 | 
				
			||||||
            List<string> filthlabels = new List<string>();
 | 
					            List<string> filthlabels = new List<string>();
 | 
				
			||||||
            if (cums.NullOrEmpty()) return 0;
 | 
					 | 
				
			||||||
            float outcum = 0;
 | 
					            float outcum = 0;
 | 
				
			||||||
            float cumd = TotalCumPercent;
 | 
					            float cumd = TotalCumPercent;
 | 
				
			||||||
            List<Cum> removecums = new List<Cum>();
 | 
					            List<Cum> removecums = new List<Cum>();
 | 
				
			||||||
            foreach (Cum cum in cums)
 | 
					            foreach (Cum cum in cums)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                float vd = cum.volume;
 | 
					                float vd = cum.DismishForce(portion);
 | 
				
			||||||
                if (cum.Equals(targetcum)) outcum = cum.volume * (portion * (1 - cum.decayresist));
 | 
					                if (cum.Equals(targetcum)) outcum = vd;
 | 
				
			||||||
                cum.volume *= Math.Max(0, 1 - (portion * (1 - cum.decayresist)) * leakfactor);
 | 
					 | 
				
			||||||
                cum.fertvolume *= Math.Max(0, (1 - (portion * (1 - cum.decayresist)) * leakfactor) * (1 - (Configurations.CumFertilityDecayRatio * (1 - cum.decayresist))));
 | 
					 | 
				
			||||||
                //MakeCumFilth(cum, vd - cum.volume);
 | 
					                //MakeCumFilth(cum, vd - cum.volume);
 | 
				
			||||||
                string tmp = "FilthLabelWithSource".Translate(cum.FilthDef.label, cum.pawn?.LabelShort ?? "Unknown", 1.ToString());
 | 
					                string tmp = "FilthLabelWithSource".Translate(cum.FilthDef.label, cum.pawn?.LabelShort ?? "Unknown", 1.ToString());
 | 
				
			||||||
                filthlabels.Add(tmp.Replace(" x1", ""));
 | 
					                filthlabels.Add(tmp.Replace(" x1", ""));
 | 
				
			||||||
                totalleak += vd - cum.volume;
 | 
					                totalleak += vd;
 | 
				
			||||||
                if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
 | 
					                if (cum.ShouldRemove()) removecums.Add(cum);
 | 
				
			||||||
                if (cum.volume < 0.01f) removecums.Add(cum);
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (cums.Count > 1) MakeCumFilthMixture(totalleak, filthlabels);
 | 
					            if (cums.Count > 1) MakeCumFilthMixture(totalleak, filthlabels);
 | 
				
			||||||
            else if (cums.Count == 1) MakeCumFilth(cums.First(), totalleak);
 | 
					            else if (cums.Count == 1) MakeCumFilth(cums.First(), totalleak);
 | 
				
			||||||
| 
						 | 
					@ -715,54 +715,13 @@ namespace RJW_Menstruation
 | 
				
			||||||
            return outcum;
 | 
					            return outcum;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					 | 
				
			||||||
        /// Ignores cum's decayratio and absorber and get excreted amount of specific cum
 | 
					 | 
				
			||||||
        /// </summary>
 | 
					 | 
				
			||||||
        /// <param name="targetcum"></param>
 | 
					 | 
				
			||||||
        /// <param name="portion"></param>
 | 
					 | 
				
			||||||
        /// <returns></returns>
 | 
					 | 
				
			||||||
        public float CumOutForce(Cum targetcum = null, float portion = 0.1f)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            if (cums.NullOrEmpty()) return 0;
 | 
					 | 
				
			||||||
            float outcum = 0;
 | 
					 | 
				
			||||||
            float totalleak = 0;
 | 
					 | 
				
			||||||
            List<string> filthlabels = new List<string>();
 | 
					 | 
				
			||||||
            float cumd = TotalCumPercent;
 | 
					 | 
				
			||||||
            List<Cum> removecums = new List<Cum>();
 | 
					 | 
				
			||||||
            foreach (Cum cum in cums)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                float vd = cum.volume;
 | 
					 | 
				
			||||||
                if (cum.Equals(targetcum)) outcum = cum.volume * (portion);
 | 
					 | 
				
			||||||
                cum.volume *= 1 - (portion);
 | 
					 | 
				
			||||||
                cum.fertvolume *= (1 - (portion)) * (1 - (Configurations.CumFertilityDecayRatio));
 | 
					 | 
				
			||||||
                //MakeCumFilth(cum, vd - cum.volume);
 | 
					 | 
				
			||||||
                string tmp = "FilthLabelWithSource".Translate(cum.FilthDef.label, cum.pawn?.LabelShort ?? "Unknown", 1.ToString());
 | 
					 | 
				
			||||||
                filthlabels.Add(tmp.Replace(" x1", ""));
 | 
					 | 
				
			||||||
                totalleak += vd - cum.volume;
 | 
					 | 
				
			||||||
                if (cum.fertvolume < 0.01f) cum.fertvolume = 0;
 | 
					 | 
				
			||||||
                if (cum.volume < 0.1f) removecums.Add(cum);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            if (cums.Count > 1) MakeCumFilthMixture(totalleak, filthlabels);
 | 
					 | 
				
			||||||
            else if (cums.Count == 1) MakeCumFilth(cums.First(), totalleak);
 | 
					 | 
				
			||||||
            foreach (Cum cum in removecums)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                cums.Remove(cum);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            removecums.Clear();
 | 
					 | 
				
			||||||
            cumd = TotalCumPercent - cumd;
 | 
					 | 
				
			||||||
            AfterFluidOut(cumd);
 | 
					 | 
				
			||||||
            return outcum;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// Fertilize eggs and return the result
 | 
					        /// Fertilize eggs and return the result
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public bool FertilizationCheck()
 | 
					        protected bool FertilizationCheck()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (!eggs.NullOrEmpty())
 | 
					            if (!eggs.NullOrEmpty())
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -864,7 +823,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
            loaded = true;
 | 
					            loaded = true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void AfterSimulator()
 | 
					        protected void AfterSimulator()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (Configurations.EnableMenopause && ovarypower < ovarypowerthreshold)
 | 
					            if (Configurations.EnableMenopause && ovarypower < ovarypowerthreshold)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
| 
						 | 
					@ -926,7 +885,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
            foreach (Cum cum in cums)
 | 
					            foreach (Cum cum in cums)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                float rand = Rand.Range(0.0f, 1.0f);
 | 
					                float rand = Rand.Range(0.0f, 1.0f);
 | 
				
			||||||
                if (cum.pawn != null && !cum.notcum && rand < cum.fertvolume * cum.fertFactor * Configurations.FertilizeChance * Props.basefertilizationChanceFactor)
 | 
					                if (cum.pawn != null && !cum.notcum && rand < cum.FertVolume * cum.fertFactor * Configurations.FertilizeChance * Props.basefertilizationChanceFactor)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    if (!RJWPregnancySettings.bestial_pregnancy_enabled && (xxx.is_animal(parent.pawn) ^ xxx.is_animal(cum.pawn))) continue;
 | 
					                    if (!RJWPregnancySettings.bestial_pregnancy_enabled && (xxx.is_animal(parent.pawn) ^ xxx.is_animal(cum.pawn))) continue;
 | 
				
			||||||
                    return cum.pawn;
 | 
					                    return cum.pawn;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,22 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using RimWorld;
 | 
				
			||||||
 | 
					using Verse;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace RJW_Menstruation
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public static class MenstruationUtility
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public static float GetFertilityChance(this HediffComp_Menstruation comp)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return comp.TotalFertCum * Configurations.FertilizeChance;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -490,11 +490,17 @@ namespace RJW_Menstruation
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            PawnKindDef res = null;
 | 
					            PawnKindDef res = null;
 | 
				
			||||||
            Pawn opposite = second;
 | 
					            Pawn opposite = second;
 | 
				
			||||||
            HybridInformations info = Configurations.HybridOverride.FirstOrDefault(x => x.defName == first.def?.defName && (x.hybridExtension?.Exists(y => y.defName == second.def?.defName) ?? false));
 | 
					            HybridInformations info = null;
 | 
				
			||||||
            if (info == null)
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (!Configurations.HybridOverride.NullOrEmpty())
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                info = Configurations.HybridOverride.FirstOrDefault(x => x.defName == second.def?.defName && (x.hybridExtension?.Exists(y => y.defName == first.def?.defName) ?? false));
 | 
					                info = Configurations.HybridOverride.FirstOrDefault(x => x.defName == first.def?.defName && (x.hybridExtension?.Exists(y => y.defName == second.def?.defName) ?? false));
 | 
				
			||||||
                opposite = first;
 | 
					                if (info == null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    info = Configurations.HybridOverride.FirstOrDefault(x => x.defName == second.def?.defName && (x.hybridExtension?.Exists(y => y.defName == first.def?.defName) ?? false));
 | 
				
			||||||
 | 
					                    opposite = first;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (info != null)
 | 
					            if (info != null)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,7 +20,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
            HediffComp_Menstruation Comp = Utility.GetMenstruationComp(pawn);
 | 
					            HediffComp_Menstruation Comp = Utility.GetMenstruationComp(pawn);
 | 
				
			||||||
            this.FailOn(delegate
 | 
					            this.FailOn(delegate
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return !(Comp.TotalCumPercent > 0.01);
 | 
					                return !(Comp.TotalCumPercent > 0.001);
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            Toil excreting = Toils_General.Wait(excretingTime, TargetIndex.None);//duration of 
 | 
					            Toil excreting = Toils_General.Wait(excretingTime, TargetIndex.None);//duration of 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -30,8 +30,8 @@ namespace RJW_Menstruation
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                initAction = delegate ()
 | 
					                initAction = delegate ()
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    Comp.CumOutForce(null, 0.5f);
 | 
					                    Comp.CumOut(null, 0.5f);
 | 
				
			||||||
                    if (Comp.TotalCumPercent > 0.01) this.JumpToToil(excreting);
 | 
					                    if (Comp.TotalCumPercent > 0.001) JumpToToil(excreting);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
            //yield return excreting;
 | 
					            //yield return excreting;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -57,6 +57,8 @@
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
    <Compile Include="Configurations.cs" />
 | 
					    <Compile Include="Configurations.cs" />
 | 
				
			||||||
    <Compile Include="Cum.cs" />
 | 
					    <Compile Include="Cum.cs" />
 | 
				
			||||||
 | 
					    <Compile Include="HediffComps\MenstruationUtility.cs" />
 | 
				
			||||||
 | 
					    <Compile Include="Recipe_Surgery.cs" />
 | 
				
			||||||
    <Compile Include="UI\Dialog_HybridCustom.cs" />
 | 
					    <Compile Include="UI\Dialog_HybridCustom.cs" />
 | 
				
			||||||
    <Compile Include="UI\Dialog_WombStatus.cs" />
 | 
					    <Compile Include="UI\Dialog_WombStatus.cs" />
 | 
				
			||||||
    <Compile Include="DrugOutcomDoers.cs" />
 | 
					    <Compile Include="DrugOutcomDoers.cs" />
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										82
									
								
								source/RJW_Menstruation/RJW_Menstruation/Recipe_Surgery.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						| 
						 | 
					@ -0,0 +1,82 @@
 | 
				
			||||||
 | 
					using System;
 | 
				
			||||||
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					using System.Text;
 | 
				
			||||||
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using RimWorld;
 | 
				
			||||||
 | 
					using Verse;
 | 
				
			||||||
 | 
					using rjw;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace RJW_Menstruation
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    public class Recipe_BreastSurgery : Recipe_Surgery
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public override IEnumerable<BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (pawn.gender != Gender.Female)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                yield break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            BodyPartRecord part = Genital_Helper.get_breastsBPR(pawn);
 | 
				
			||||||
 | 
					            if (part != null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
 | 
					                if (pawn.GetBreastComp() != null) yield return part;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public override void ApplyOnPawn(Pawn pawn, BodyPartRecord part, Pawn billDoer, List<Thing> ingredients, Bill bill)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            HediffComp_Breast breast = pawn.GetBreastComp();
 | 
				
			||||||
 | 
					            if (billDoer != null && breast != null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                TaleRecorder.RecordTale(TaleDefOf.DidSurgery, new object[]
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    billDoer,
 | 
				
			||||||
 | 
					                    pawn
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					                SurgeryResult(breast);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        protected virtual void SurgeryResult(HediffComp_Breast breast)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public class Recipe_ExpandAreola : Recipe_BreastSurgery
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        protected override void SurgeryResult(HediffComp_Breast breast)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            breast.AdjustAreolaSizeImmidiately(0.1f);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public class Recipe_ContractAreola : Recipe_BreastSurgery
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        protected override void SurgeryResult(HediffComp_Breast breast)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            breast.AdjustAreolaSizeImmidiately(-0.1f);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public class Recipe_ExpandNipple : Recipe_BreastSurgery
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        protected override void SurgeryResult(HediffComp_Breast breast)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            breast.AdjustNippleSizeImmidiately(0.1f);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public class Recipe_ContractNipple : Recipe_BreastSurgery
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        protected override void SurgeryResult(HediffComp_Breast breast)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            breast.AdjustNippleSizeImmidiately(-0.1f);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -86,7 +86,7 @@ namespace RJW_Menstruation
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        
 | 
					        public static readonly Texture2D FertChanceTex = SolidColorMaterials.NewSolidColorTexture(new Color(1f, 1f, 1f, 0.4f));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private static Texture2D milktexturecache = null;
 | 
					        private static Texture2D milktexturecache = null;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -394,6 +394,8 @@ namespace RJW_Menstruation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            statvalue = Configurations.ImplantationChance * comp.Props.baseImplantationChanceFactor * comp.ImplantFactor;
 | 
					            statvalue = Configurations.ImplantationChance * comp.Props.baseImplantationChanceFactor * comp.ImplantFactor;
 | 
				
			||||||
            FillableBarLabeled(lineRect, "  " + xxx.reproduction.LabelCap.CapitalizeFirst() + " " + statvalue.ToStringPercent(), statvalue, TextureCache.fertilityTexture, Texture2D.blackTexture);
 | 
					            FillableBarLabeled(lineRect, "  " + xxx.reproduction.LabelCap.CapitalizeFirst() + " " + statvalue.ToStringPercent(), statvalue, TextureCache.fertilityTexture, Texture2D.blackTexture);
 | 
				
			||||||
 | 
					            Rect overayRect = new Rect(lineRect.x, lineRect.y, lineRect.width * Math.Min(1.0f, comp.GetFertilityChance()), lineRect.height);
 | 
				
			||||||
 | 
					            GUI.DrawTexture(overayRect, TextureCache.FertChanceTex);
 | 
				
			||||||
            lineRect.y += height;
 | 
					            lineRect.y += height;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||