mirror of
				https://github.com/vegapnk/RJW-Genes.git
				synced 2024-08-15 00:23:31 +00:00 
			
		
		
		
	Unified Cum-Genes and made them configurable
This commit is contained in:
		
							parent
							
								
									7339bd41a1
								
							
						
					
					
						commit
						832c3aa0b8
					
				
					 8 changed files with 66 additions and 90 deletions
				
			
		| 
						 | 
				
			
			@ -34,8 +34,23 @@ namespace RJW_Genes
 | 
			
		|||
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		//Get total fluidamount a person has.
 | 
			
		||||
		public static float GetTotalFluidAmount(Pawn pawn, float multiplier = 1f)
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// Looks up the "MultiplierExtensions" Value for a given Gene, with a fall back. 
 | 
			
		||||
		/// Returns the fallback if there is no Extension, or if the Multiplier is smaller than 0. 
 | 
			
		||||
		/// </summary>
 | 
			
		||||
 | 
			
		||||
        public static float LookupCumMultiplier(Gene gene, float FALLBACK = 3.0f) => LookupCumMultiplier(gene.def,FALLBACK);
 | 
			
		||||
        public static float LookupCumMultiplier(GeneDef def, float FALLBACK = 3.0f)
 | 
			
		||||
        {
 | 
			
		||||
            MultiplierExtension multiplier = def.GetModExtension<MultiplierExtension>();
 | 
			
		||||
            if (multiplier == null || multiplier.multiplier < 0)
 | 
			
		||||
                return FALLBACK;
 | 
			
		||||
            else return multiplier.multiplier;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        //Get total fluidamount a person has.
 | 
			
		||||
        public static float GetTotalFluidAmount(Pawn pawn, float multiplier = 1f)
 | 
			
		||||
		{
 | 
			
		||||
			var partBPR = Genital_Helper.get_genitalsBPR(pawn);
 | 
			
		||||
			var parts = Genital_Helper.get_PartsHediffList(pawn, partBPR);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,36 +1,38 @@
 | 
			
		|||
namespace RJW_Genes
 | 
			
		||||
{
 | 
			
		||||
    public class Gene_MuchCum : RJW_Gene
 | 
			
		||||
    public class Gene_ChangeCumAmount : RJW_Gene
 | 
			
		||||
    {
 | 
			
		||||
        bool has_been_fired = false;
 | 
			
		||||
 | 
			
		||||
        float multiplier_much_cum = 3f;
 | 
			
		||||
 | 
			
		||||
        public override void PostMake()
 | 
			
		||||
        {
 | 
			
		||||
            base.PostMake();
 | 
			
		||||
 | 
			
		||||
            CumUtility.MultiplyFluidAmountBy(pawn, multiplier_much_cum);
 | 
			
		||||
            float multipier = CumUtility.LookupCumMultiplier(this);
 | 
			
		||||
            CumUtility.MultiplyFluidAmountBy(pawn, multipier);
 | 
			
		||||
            has_been_fired = true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void PostAdd()
 | 
			
		||||
        {
 | 
			
		||||
            base.PostAdd();
 | 
			
		||||
            if (!has_been_fired) { 
 | 
			
		||||
                CumUtility.MultiplyFluidAmountBy(pawn, multiplier_much_cum); 
 | 
			
		||||
            if (!has_been_fired)
 | 
			
		||||
            {
 | 
			
		||||
                float multipier = CumUtility.LookupCumMultiplier(this);
 | 
			
		||||
                CumUtility.MultiplyFluidAmountBy(pawn, multipier);
 | 
			
		||||
                has_been_fired = true;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        public override void PostRemove()
 | 
			
		||||
        {
 | 
			
		||||
            base.PostAdd();
 | 
			
		||||
 | 
			
		||||
            if (has_been_fired)
 | 
			
		||||
            {
 | 
			
		||||
                CumUtility.MultiplyFluidAmountBy(pawn, 1/multiplier_much_cum);
 | 
			
		||||
                float multipier = CumUtility.LookupCumMultiplier(this);
 | 
			
		||||
                CumUtility.MultiplyFluidAmountBy(pawn, 1/ multipier);
 | 
			
		||||
                has_been_fired = false;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -1,34 +0,0 @@
 | 
			
		|||
namespace RJW_Genes
 | 
			
		||||
{
 | 
			
		||||
    public class Gene_NoCum : RJW_Gene
 | 
			
		||||
    {
 | 
			
		||||
        bool has_been_fired = false;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        public override void PostMake()
 | 
			
		||||
        {
 | 
			
		||||
            base.PostMake();
 | 
			
		||||
 | 
			
		||||
            CumUtility.MultiplyFluidAmountBy(pawn, 0f);
 | 
			
		||||
            has_been_fired = true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void PostAdd()
 | 
			
		||||
        {
 | 
			
		||||
            base.PostAdd();
 | 
			
		||||
            if (!has_been_fired) { 
 | 
			
		||||
                CumUtility.MultiplyFluidAmountBy(pawn, 0f); 
 | 
			
		||||
                has_been_fired = true;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        public override void PostRemove()
 | 
			
		||||
        {
 | 
			
		||||
            // Cum Removal does not do at the moment :/ I would need to safe the old cum amount but I don't want to at the moment
 | 
			
		||||
            base.PostAdd();
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,39 +0,0 @@
 | 
			
		|||
namespace RJW_Genes
 | 
			
		||||
{
 | 
			
		||||
    public class Gene_VeryMuchCum : RJW_Gene
 | 
			
		||||
    {
 | 
			
		||||
        bool has_been_fired = false;
 | 
			
		||||
 | 
			
		||||
        float multiplier_much_cum = 10f;
 | 
			
		||||
 | 
			
		||||
        public override void PostMake()
 | 
			
		||||
        {
 | 
			
		||||
            base.PostMake();
 | 
			
		||||
 | 
			
		||||
            CumUtility.MultiplyFluidAmountBy(pawn, multiplier_much_cum);
 | 
			
		||||
            has_been_fired = true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public override void PostAdd()
 | 
			
		||||
        {
 | 
			
		||||
            base.PostAdd();
 | 
			
		||||
            if (!has_been_fired) { 
 | 
			
		||||
                CumUtility.MultiplyFluidAmountBy(pawn, multiplier_much_cum); 
 | 
			
		||||
                has_been_fired = true;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        public override void PostRemove()
 | 
			
		||||
        {
 | 
			
		||||
            base.PostAdd();
 | 
			
		||||
 | 
			
		||||
            if (has_been_fired)
 | 
			
		||||
            {
 | 
			
		||||
                CumUtility.MultiplyFluidAmountBy(pawn, 1/multiplier_much_cum);
 | 
			
		||||
                has_been_fired = false;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue