mirror of
				https://gitgud.io/amevarashi/rjw-sexperience-ideology.git
				synced 2024-08-15 00:43:19 +00:00 
			
		
		
		
	Added a Precept on Genital Size
This commit is contained in:
		
							parent
							
								
									8f4ebb749a
								
							
						
					
					
						commit
						4af1890a0e
					
				
					 7 changed files with 325 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -1,4 +1,5 @@
 | 
			
		|||
using RimWorld;
 | 
			
		||||
using rjw;
 | 
			
		||||
using Verse;
 | 
			
		||||
 | 
			
		||||
namespace RJWSexperience.Ideology
 | 
			
		||||
| 
						 | 
				
			
			@ -33,5 +34,29 @@ namespace RJWSexperience.Ideology
 | 
			
		|||
			}
 | 
			
		||||
			return finalMultiplier;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public static float getGenitalSize(Pawn p)
 | 
			
		||||
		{
 | 
			
		||||
			if (p == null)
 | 
			
		||||
				return 0f;
 | 
			
		||||
 | 
			
		||||
			// Iff the pawn has multiple genitalia, the "best" is picked (the biggest penis or tightest vagina)
 | 
			
		||||
			float best_seen_size = 0f;
 | 
			
		||||
			foreach (Hediff part in rjw.Genital_Helper.get_AllPartsHediffList(p))
 | 
			
		||||
			{
 | 
			
		||||
				// Only check for Vaginas and Penises, not for Anus or for things not categorized as primary sexual parts
 | 
			
		||||
				if (Genital_Helper.is_penis(part) || Genital_Helper.is_vagina(part))
 | 
			
		||||
				{
 | 
			
		||||
					best_seen_size = part.Severity > best_seen_size ? part.Severity : best_seen_size;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
			// For Women, the scale is inverted.
 | 
			
		||||
			if (p.gender == Gender.Female)
 | 
			
		||||
				return 1 - best_seen_size;
 | 
			
		||||
 | 
			
		||||
			return best_seen_size;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,31 @@
 | 
			
		|||
using RimWorld;
 | 
			
		||||
using rjw;
 | 
			
		||||
using Verse;
 | 
			
		||||
 | 
			
		||||
namespace RJWSexperience.Ideology
 | 
			
		||||
{
 | 
			
		||||
    public class ThoughtWorker_Precept_GenitalSize_Approved : ThoughtWorker_Precept
 | 
			
		||||
    {
 | 
			
		||||
        protected override ThoughtState ShouldHaveThought(Pawn p)
 | 
			
		||||
        {
 | 
			
		||||
            // We have 5 stages, which map directly to genitalia severity:
 | 
			
		||||
            // Micro(<0.2), Small(>0.2&&<0.4), Normal(>0.4&&<0.6), Big(>0.6&&<0.8), Huge(>0.8)
 | 
			
		||||
            if (p != null && Genital_Helper.get_AllPartsHediffList(p).Count > 0)
 | 
			
		||||
            {
 | 
			
		||||
                float best_size = IdeoUtility.getGenitalSize(p);
 | 
			
		||||
                if (best_size < 0.2f)
 | 
			
		||||
                    return ThoughtState.ActiveAtStage(0);
 | 
			
		||||
                else if (best_size < 0.4f)
 | 
			
		||||
                    return ThoughtState.ActiveAtStage(1);
 | 
			
		||||
                else if (best_size < 0.6f)
 | 
			
		||||
                    return ThoughtState.ActiveAtStage(2);
 | 
			
		||||
                else if (best_size < 0.8f)
 | 
			
		||||
                    return ThoughtState.ActiveAtStage(3);
 | 
			
		||||
                else if (best_size > 0.8f)
 | 
			
		||||
                    return ThoughtState.ActiveAtStage(4);
 | 
			
		||||
            }
 | 
			
		||||
            // This might can happen if the pawn has no genitalia ... maybe?
 | 
			
		||||
            return ThoughtState.Inactive;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,29 @@
 | 
			
		|||
using RimWorld;
 | 
			
		||||
using rjw;
 | 
			
		||||
using Verse;
 | 
			
		||||
 | 
			
		||||
namespace RJWSexperience.Ideology
 | 
			
		||||
{
 | 
			
		||||
    public class ThoughtWorker_Precept_GenitalSize_Approved_Social : ThoughtWorker_Precept_Social
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        // Important Note: For the Social Worker, we measure otherPawns genitalia 
 | 
			
		||||
        protected override ThoughtState ShouldHaveThought(Pawn p, Pawn otherPawn)
 | 
			
		||||
        {
 | 
			
		||||
            // We have 3 stages, which map directly to genitalia severity:
 | 
			
		||||
            // Unfavorable(<0.4), Normal(>0.4&&<0.6), Favorable(>0.6)
 | 
			
		||||
            if (otherPawn != null && Genital_Helper.get_AllPartsHediffList(otherPawn).Count > 0)
 | 
			
		||||
            {
 | 
			
		||||
                float best_size = IdeoUtility.getGenitalSize(otherPawn);
 | 
			
		||||
                if (best_size < 0.4f)
 | 
			
		||||
                    return ThoughtState.ActiveAtStage(0);
 | 
			
		||||
                else if (best_size < 0.6f)
 | 
			
		||||
                    return ThoughtState.ActiveAtStage(1);
 | 
			
		||||
                else if (best_size > 0.6f)
 | 
			
		||||
                    return ThoughtState.ActiveAtStage(2);
 | 
			
		||||
            }
 | 
			
		||||
            // This might can happen if the pawn has no genitalia ... maybe?
 | 
			
		||||
            return ThoughtState.Inactive;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,32 @@
 | 
			
		|||
using RimWorld;
 | 
			
		||||
using rjw;
 | 
			
		||||
using Verse;
 | 
			
		||||
 | 
			
		||||
namespace RJWSexperience.Ideology
 | 
			
		||||
{
 | 
			
		||||
    public class ThoughtWorker_Precept_GenitalSize_Disapproved : ThoughtWorker_Precept
 | 
			
		||||
    {
 | 
			
		||||
        protected override ThoughtState ShouldHaveThought(Pawn p)
 | 
			
		||||
        {
 | 
			
		||||
            // We have 5 stages, which map directly to genitalia severity:
 | 
			
		||||
            // Micro(<0.2), Small(>0.2&&<0.4), Normal(>0.4&&<0.6), Big(>0.6&&<0.8), Huge(>0.8)
 | 
			
		||||
            if (p != null && Genital_Helper.get_AllPartsHediffList(p).Count > 0)
 | 
			
		||||
            {
 | 
			
		||||
                float best_size = IdeoUtility.getGenitalSize(p);
 | 
			
		||||
                if (best_size < 0.2f)
 | 
			
		||||
                    return ThoughtState.ActiveAtStage(0);
 | 
			
		||||
                else if (best_size < 0.4f)
 | 
			
		||||
                    return ThoughtState.ActiveAtStage(1);
 | 
			
		||||
                else if (best_size < 0.6f)
 | 
			
		||||
                    return ThoughtState.ActiveAtStage(2);
 | 
			
		||||
                else if (best_size < 0.8f)
 | 
			
		||||
                    return ThoughtState.ActiveAtStage(3);
 | 
			
		||||
                else if (best_size > 0.8f)
 | 
			
		||||
                    return ThoughtState.ActiveAtStage(4);
 | 
			
		||||
            }
 | 
			
		||||
            // This might can happen if the pawn has no genitalia ... maybe?
 | 
			
		||||
            return ThoughtState.Inactive;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,28 @@
 | 
			
		|||
using RimWorld;
 | 
			
		||||
using rjw;
 | 
			
		||||
using Verse;
 | 
			
		||||
 | 
			
		||||
namespace RJWSexperience.Ideology
 | 
			
		||||
{
 | 
			
		||||
    public class ThoughtWorker_Precept_GenitalSize_Disapproved_Social : ThoughtWorker_Precept_Social
 | 
			
		||||
    {
 | 
			
		||||
            // Important Note: For the Social Worker, we measure otherPawns genitalia 
 | 
			
		||||
            protected override ThoughtState ShouldHaveThought(Pawn p, Pawn otherPawn)
 | 
			
		||||
            {
 | 
			
		||||
                // We have 3 stages, which map directly to genitalia severity:
 | 
			
		||||
                // Unfavorable(<0.4), Normal(>0.4&&<0.6), Favorable(>0.6)
 | 
			
		||||
                if (otherPawn != null && Genital_Helper.get_AllPartsHediffList(otherPawn).Count > 0)
 | 
			
		||||
                {
 | 
			
		||||
                    float best_size = IdeoUtility.getGenitalSize(otherPawn);
 | 
			
		||||
                    if (best_size < 0.4f)
 | 
			
		||||
                        return ThoughtState.ActiveAtStage(0);
 | 
			
		||||
                    else if (best_size < 0.6f)
 | 
			
		||||
                        return ThoughtState.ActiveAtStage(1);
 | 
			
		||||
                    else if (best_size > 0.6f)
 | 
			
		||||
                        return ThoughtState.ActiveAtStage(2);
 | 
			
		||||
                }
 | 
			
		||||
                // This might can happen if the pawn has no genitalia ... maybe?
 | 
			
		||||
                return ThoughtState.Inactive;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -51,6 +51,14 @@
 | 
			
		|||
    <Compile Include="Harmony.cs" />
 | 
			
		||||
    <Compile Include="Ideology\HistoryEvents\ArgsNamesCustom.cs" />
 | 
			
		||||
    <Compile Include="Ideology\Keyed.cs" />
 | 
			
		||||
    <Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_GenitalSize_Approved.cs" />
 | 
			
		||||
    <Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_GenitalSize_Approved_Social.cs" />
 | 
			
		||||
    <Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_GenitalSize_Disapproved.cs" />
 | 
			
		||||
    <Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_GenitalSize_Disapproved_Social.cs" />
 | 
			
		||||
    <Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_NonPregnant.cs" />
 | 
			
		||||
    <Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_NonPregnant_Social.cs" />
 | 
			
		||||
    <Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_Pregnant.cs" />
 | 
			
		||||
    <Compile Include="Ideology\PreceptWorkers\ThoughtWorker_Precept_Pregnant_Social.cs" />
 | 
			
		||||
    <Compile Include="Ideology\RelationFilter.cs" />
 | 
			
		||||
    <Compile Include="Ideology\RsiHistoryEventDefOf.cs" />
 | 
			
		||||
    <Compile Include="Ideology\TwoPawnFilter.cs" />
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue