mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Merge branch 'dev' of https://github.com/Shabakur/RJW-Genes into dev
This commit is contained in:
commit
982339a84e
40 changed files with 492 additions and 214 deletions
|
|
@ -1,10 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RJW_BGS
|
||||
namespace RJW_BGS
|
||||
{
|
||||
public class BestialityGeneInheritanceDef
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
using rjw;
|
||||
|
|
@ -20,14 +16,18 @@ namespace RJW_BGS
|
|||
if (mother.RaceProps.Humanlike && father.RaceProps.Humanlike)
|
||||
return genelist;
|
||||
|
||||
|
||||
ModLog.Message($"Trigger an Animal-Gene-Inheritance for {father.Name} and {mother.Name}");
|
||||
//One parent must be an animal and the other must be human, so only one needs to return
|
||||
if (father != null && !father.RaceProps.Humanlike)
|
||||
{
|
||||
if (RJW_BGSSettings.rjw_bgs_detailed_debug)
|
||||
ModLog.Message($"Father was found to be animal - looking up genes for {father.Name}");
|
||||
return SelectGenes(father);
|
||||
}
|
||||
if (mother != null && !mother.RaceProps.Humanlike)
|
||||
{
|
||||
if (RJW_BGSSettings.rjw_bgs_detailed_debug)
|
||||
ModLog.Message($"Mother was found to be animal - looking up genes for {mother.Name}");
|
||||
return SelectGenes(mother);
|
||||
}
|
||||
|
||||
|
|
@ -48,30 +48,48 @@ namespace RJW_BGS
|
|||
{
|
||||
foreach (BestialityGeneInheritanceDef gene in raceGeneDef.genes)
|
||||
{
|
||||
if (gene.chance * RJW_BGSSettings.global_gene_chance >= Rand.Range(0.01f,1f))
|
||||
if (gene.chance * RJW_BGSSettings.rjw_bgs_global_gene_chance >= Rand.Range(0.01f,1f))
|
||||
{
|
||||
genelist.Add(DefDatabase<GeneDef>.GetNamed(gene.defName));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (RJW_BGSSettings.rjw_bgs_detailed_debug)
|
||||
ModLog.Message($"From {raceGeneDef.genes.Count} possible genes in {raceGeneDef.defName}, {genelist.Count} were added by chance ({RJW_BGSSettings.rjw_bgs_global_gene_chance} chance multiplier from Settings).");
|
||||
return genelist;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Adds a list of Genes to the pawns existing GeneSet.
|
||||
/// Whether it is added as a Xenogene or Endogene is configured in Mod-Settings.
|
||||
/// </summary>
|
||||
/// <param name="pawn">The pawn for which Genes will be added</param>
|
||||
/// <param name="genes">The Genes to add (Endogene by default, Xenogene with Mod Settings)</param>
|
||||
public static void AddGenes(Pawn pawn, List<GeneDef> genes)
|
||||
{
|
||||
foreach (GeneDef gene in genes)
|
||||
{
|
||||
pawn.genes.AddGene(gene, false);
|
||||
pawn.genes.AddGene(gene, RJW_BGSSettings.rjw_bgs_animal_genes_as_xenogenes);
|
||||
}
|
||||
}
|
||||
|
||||
//For ParchRJWHediffInsect_egg
|
||||
/// <summary>
|
||||
/// Initiates a bestiality baby with genes if the baby does not exist earlier.
|
||||
/// This is used to make rjw-egg-pregnancies work.
|
||||
/// Related file: PatchRJWHediffInsect_Egg.cs
|
||||
/// </summary>
|
||||
/// <param name="mother">The mother of the baby.</param>
|
||||
/// <param name="dad">The father of the baby.</param>
|
||||
/// <param name="baby">The baby created in non-pregnancy-way (has 0 Genes yet)</param>
|
||||
public static void NewGenes(Pawn mother, Pawn dad, Pawn baby)
|
||||
{
|
||||
if (!RJW_BGSSettings.enabled)
|
||||
if (!RJW_BGSSettings.rjw_bgs_enabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ModLog.Message($"Triggering an New-Gene Animal-Gene-Inheritance for {baby.Name} ({dad.Name} + {mother.Name})");
|
||||
if (baby.RaceProps.Humanlike)
|
||||
{
|
||||
if (baby.genes == null)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace RJW_BGS
|
|||
[HarmonyPostfix]
|
||||
public static void AddGenes(Pawn mother, Pawn dad, ref Hediff_BasePregnancy __instance)
|
||||
{
|
||||
if (!RJW_BGSSettings.enabled)
|
||||
if (!RJW_BGSSettings.rjw_bgs_enabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using HarmonyLib;
|
||||
using rjw;
|
||||
using RimWorld;
|
||||
using Verse;
|
||||
|
||||
namespace RJW_BGS
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using HarmonyLib;
|
||||
using RimWorld;
|
||||
using Verse;
|
||||
using rjw;
|
||||
|
||||
namespace RJW_BGS
|
||||
{
|
||||
/// <summary>
|
||||
/// This Patch is applied to change the normal pregnancy to add animal-inheritance.
|
||||
/// If the settings allow animal gene inheritance,
|
||||
/// the genes are determined and "simply added".
|
||||
/// </summary>
|
||||
[HarmonyPatch(typeof(PregnancyUtility), "GetInheritedGeneSet", new Type[]
|
||||
{
|
||||
typeof(Pawn),
|
||||
|
|
@ -22,7 +24,7 @@ namespace RJW_BGS
|
|||
[HarmonyPostfix]
|
||||
public static void AnimalInheritedGenes(Pawn father, Pawn mother, ref GeneSet __result)
|
||||
{
|
||||
if (!RJW_BGSSettings.enabled)
|
||||
if (!RJW_BGSSettings.rjw_bgs_enabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,23 +21,31 @@ namespace RJW_BGS
|
|||
listing_Standard.ColumnWidth = rect.width / 2.05f;
|
||||
listing_Standard.Begin(rect);
|
||||
listing_Standard.Gap(24f);
|
||||
listing_Standard.CheckboxLabeled("enabled", ref enabled, "no function yet", 0f, 1f);
|
||||
listing_Standard.CheckboxLabeled("enabled", ref rjw_bgs_enabled, "If toggled, Animal Pregnancies will try inherit genes.", 0f, 1f);
|
||||
//listing_Standard.CheckboxLabeled("sexfrenzy", ref sexfrenzy, "disable the effects", 0f, 1f);
|
||||
listing_Standard.Gap(5f);
|
||||
listing_Standard.Label("gene inheritance chance"+ ": " +
|
||||
Math.Round((double)(RJW_BGSSettings.global_gene_chance * 100f), 0).ToString() + "%", -1f, "modify chance for a gene to be inherited.");
|
||||
RJW_BGSSettings.global_gene_chance = listing_Standard.Slider(RJW_BGSSettings.global_gene_chance, 0f, 5f);
|
||||
Math.Round((double)(RJW_BGSSettings.rjw_bgs_global_gene_chance * 100f), 0).ToString() + "%", -1f, "modify chance for a gene to be inherited.");
|
||||
RJW_BGSSettings.rjw_bgs_global_gene_chance = listing_Standard.Slider(RJW_BGSSettings.rjw_bgs_global_gene_chance, 0f, 5f);
|
||||
listing_Standard.Gap(5f);
|
||||
listing_Standard.CheckboxLabeled("genes as xenogenes", ref rjw_bgs_animal_genes_as_xenogenes, "If toggled, animal genes will be added as xenogenes.", 0f, 1f);
|
||||
listing_Standard.Gap(5f);
|
||||
listing_Standard.CheckboxLabeled("detailed-debug", ref rjw_bgs_detailed_debug, "Adds detailed information to the log about pregnancies and genes.", 0f, 1f);
|
||||
listing_Standard.End();
|
||||
}
|
||||
|
||||
public override void ExposeData()
|
||||
{
|
||||
base.ExposeData();
|
||||
Scribe_Values.Look<bool>(ref RJW_BGSSettings.enabled, "enabled", RJW_BGSSettings.enabled, true);
|
||||
Scribe_Values.Look<float>(ref RJW_BGSSettings.global_gene_chance, "global_gene_chance", RJW_BGSSettings.global_gene_chance, true);
|
||||
Scribe_Values.Look<bool>(ref RJW_BGSSettings.rjw_bgs_enabled, "rjw_bgs_enabled", RJW_BGSSettings.rjw_bgs_enabled, true);
|
||||
Scribe_Values.Look<float>(ref RJW_BGSSettings.rjw_bgs_global_gene_chance, "rjw_bgs_global_gene_chance", RJW_BGSSettings.rjw_bgs_global_gene_chance, true);
|
||||
Scribe_Values.Look<bool>(ref RJW_BGSSettings.rjw_bgs_animal_genes_as_xenogenes, "rjw_bgs_animal_genes_as_xenogenes", RJW_BGSSettings.rjw_bgs_animal_genes_as_xenogenes, true);
|
||||
Scribe_Values.Look<bool>(ref RJW_BGSSettings.rjw_bgs_detailed_debug, "rjw_bgs_detailed_debug", RJW_BGSSettings.rjw_bgs_detailed_debug, true);
|
||||
}
|
||||
|
||||
public static float global_gene_chance = 1f;
|
||||
public static bool enabled = true;
|
||||
public static float rjw_bgs_global_gene_chance = 1f;
|
||||
public static bool rjw_bgs_enabled = true;
|
||||
public static bool rjw_bgs_animal_genes_as_xenogenes = false;
|
||||
public static bool rjw_bgs_detailed_debug = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ namespace RJW_BGS
|
|||
public class RaceGeneDef : Def
|
||||
{
|
||||
public int priority;
|
||||
public String raceGroup;
|
||||
public string raceGroup; //keeping this for backwards compatibility
|
||||
public List<string> raceGroups; //racegroup, but in list form so multiple can be entered, preference to use this over racegroup
|
||||
public List<string> raceNames;
|
||||
public List<string> pawnKindNames;
|
||||
public List<BestialityGeneInheritanceDef> genes;
|
||||
//public List<float> genechances;
|
||||
public String hybridName;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
using System;
|
||||
using rjw;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using rjw;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
|
||||
namespace RJW_BGS
|
||||
{
|
||||
|
|
@ -21,14 +18,14 @@ namespace RJW_BGS
|
|||
return result;
|
||||
}
|
||||
return null;
|
||||
//First check if there is a matching pawnkinddef then race, then racegroup
|
||||
|
||||
}
|
||||
|
||||
public static List<RaceGeneDef> ValidRaceGeneDefs(Pawn pawn)
|
||||
{
|
||||
PawnKindDef kindDef = pawn.kindDef;
|
||||
if (kindDef == null)
|
||||
{
|
||||
ModLog.Warning($"Error looking up PawnKindDef for {pawn.Name} - Could not lookup Animal Inheritance Genes");
|
||||
return null;
|
||||
}
|
||||
string raceName = kindDef.race.defName;
|
||||
|
|
@ -36,6 +33,9 @@ namespace RJW_BGS
|
|||
PawnData pawnData = SaveStorage.DataStore.GetPawnData(pawn);
|
||||
RaceGroupDef raceGroupDef = pawnData.RaceSupportDef;
|
||||
|
||||
if (RJW_BGSSettings.rjw_bgs_detailed_debug)
|
||||
ModLog.Message($"Looking up Animal-Inheritable Genes for {pawn.Name} with KindDef {kindDef.defName},RaceName {raceName}, PawnKind {pawnKindName} and RaceGroup {raceGroupDef.defName}");
|
||||
|
||||
IEnumerable<RaceGeneDef> allDefs = DefDatabase<RaceGeneDef>.AllDefs;
|
||||
List<RaceGeneDef> pawnKindDefs = allDefs.Where(delegate (RaceGeneDef group)
|
||||
{
|
||||
|
|
@ -43,26 +43,60 @@ namespace RJW_BGS
|
|||
return pawnKindNames != null && pawnKindNames.Contains(pawnKindName);
|
||||
}).ToList<RaceGeneDef>();
|
||||
if (pawnKindDefs.Count() > 0)
|
||||
{
|
||||
DebugPrintRaceGeneDefs("PawnKindDefs",pawn.Name.ToStringFull,pawnKindDefs);
|
||||
return pawnKindDefs;
|
||||
}
|
||||
else if (RJW_BGSSettings.rjw_bgs_detailed_debug)
|
||||
ModLog.Message($"Did not find PawnKindDefs for {pawn.Name.ToStringFull}");
|
||||
|
||||
List<RaceGeneDef> raceKindDefs = allDefs.Where(delegate (RaceGeneDef group)
|
||||
{
|
||||
List<string> raceNames = group.raceNames;
|
||||
return raceNames != null && raceNames.Contains(raceName);
|
||||
}).ToList<RaceGeneDef>();
|
||||
if (raceKindDefs.Count() > 0)
|
||||
{
|
||||
DebugPrintRaceGeneDefs("PawnKindDefs", pawn.Name.ToStringFull, raceKindDefs);
|
||||
return raceKindDefs;
|
||||
}
|
||||
else if (RJW_BGSSettings.rjw_bgs_detailed_debug)
|
||||
ModLog.Message($"Did not find RaceKindDefs for {pawn.Name.ToStringFull}");
|
||||
|
||||
List<RaceGeneDef> raceGroupDefs = new List<RaceGeneDef>();
|
||||
if (raceGroupDef != null)
|
||||
{
|
||||
raceGroupDefs = allDefs.Where(delegate (RaceGeneDef group)
|
||||
{
|
||||
String raceGroupDefName = group.raceGroup;
|
||||
return raceGroupDefName != null && raceGroupDefName == raceGroupDef.defName;
|
||||
string raceGroupDefName = group.raceGroup;
|
||||
List<string> list_raceGroupDefName = group.raceGroups;
|
||||
return (raceGroupDefName != null && raceGroupDefName == raceGroupDef.defName)
|
||||
|| (list_raceGroupDefName != null && list_raceGroupDefName.Contains(raceGroupDef.defName));
|
||||
}).ToList<RaceGeneDef>();
|
||||
}
|
||||
|
||||
if (raceGroupDefs.Count() > 0)
|
||||
{
|
||||
DebugPrintRaceGeneDefs("RaceKindDefs", pawn.Name.ToStringFull, raceGroupDefs);
|
||||
return raceGroupDefs;
|
||||
}
|
||||
else if (RJW_BGSSettings.rjw_bgs_detailed_debug)
|
||||
ModLog.Message($"Did not find RaceGroupDefs for {pawn.Name.ToStringFull}");
|
||||
|
||||
ModLog.Message($"Did not find any Genes inheritable for {pawn.Name.ToStringFull}");
|
||||
return new List<RaceGeneDef>();
|
||||
}
|
||||
|
||||
private static void DebugPrintRaceGeneDefs(String header,String identifier,List<RaceGeneDef> defs)
|
||||
{
|
||||
if (RJW_BGSSettings.rjw_bgs_detailed_debug)
|
||||
{
|
||||
var defString = "[";
|
||||
foreach (RaceGeneDef raceGeneDef in defs)
|
||||
defString += $"({raceGeneDef.priority}:{raceGeneDef.defName} - {raceGeneDef.genes.Count} Genes)";
|
||||
defString += "]";
|
||||
ModLog.Message($"Found the following {header}-Genes for {identifier}: {defString}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
34
Source/Common/ModLog.cs
Normal file
34
Source/Common/ModLog.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
internal class ModLog
|
||||
{
|
||||
public static string ModId => "RJW-Genes";
|
||||
|
||||
/// <summary>
|
||||
/// Logs the given message with [SaveStorage.ModId] appended.
|
||||
/// </summary>
|
||||
public static void Error(string message)
|
||||
{
|
||||
Log.Error($"[{ModId}] {message}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs the given message with [SaveStorage.ModId] appended.
|
||||
/// </summary>
|
||||
public static void Message(string message)
|
||||
{
|
||||
Log.Message($"[{ModId}] {message}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs the given message with [SaveStorage.ModId] appended.
|
||||
/// </summary>
|
||||
public static void Warning(string message)
|
||||
{
|
||||
Log.Warning($"[{ModId}] {message}");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -51,6 +51,7 @@ namespace RJW_Genes
|
|||
public static readonly GeneDef rjw_genes_mechbreeder;
|
||||
public static readonly GeneDef rjw_genes_insectincubator;
|
||||
public static readonly GeneDef rjw_genes_insectbreeder;
|
||||
public static readonly GeneDef rjw_genes_zoophile;
|
||||
|
||||
// Cum
|
||||
public static readonly GeneDef rjw_genes_no_cum;
|
||||
|
|
@ -63,7 +64,8 @@ namespace RJW_Genes
|
|||
// Reproduction
|
||||
public static readonly GeneDef rjw_genes_hypersexual;
|
||||
public static readonly GeneDef rjw_genes_rapist;
|
||||
public static readonly GeneDef rjw_genes_zoophile;
|
||||
public static readonly GeneDef rjw_genes_homosexual;
|
||||
public static readonly GeneDef rjw_genes_bisexual;
|
||||
|
||||
// Damage & Side Effects
|
||||
[MayRequire("LustLicentia.RJWLabs")] public static readonly GeneDef rjw_genes_elasticity;
|
||||
|
|
@ -71,23 +73,29 @@ namespace RJW_Genes
|
|||
|
||||
// Special
|
||||
public static readonly GeneDef rjw_genes_orgasm_rush;
|
||||
public static readonly GeneDef rjw_genes_youth_fountain;
|
||||
public static readonly GeneDef rjw_genes_sex_age_drain;
|
||||
public static readonly GeneDef rjw_genes_aphrodisiac_pheromones;
|
||||
|
||||
// LifeForce
|
||||
public static readonly GeneDef rjw_genes_lifeforce;
|
||||
public static readonly GeneDef rjw_genes_pussyhealing;
|
||||
public static readonly GeneDef rjw_genes_lifeforce_drain;
|
||||
public static readonly GeneDef rjw_genes_vaginal_absorber;
|
||||
public static readonly GeneDef rjw_genes_anal_absorber;
|
||||
public static readonly GeneDef rjw_genes_drainer;
|
||||
|
||||
// Cosmetic
|
||||
public static readonly GeneDef rjw_genes_succubus_tail;
|
||||
public static readonly GeneDef rjw_genes_succubus_wings;
|
||||
|
||||
|
||||
// Others & Non-Genes
|
||||
public static readonly GeneDef rjw_genes_youth_fountain;
|
||||
public static readonly GeneDef rjw_genes_sex_age_drain;
|
||||
public static readonly HediffDef rjw_genes_orgasm_rush_hediff;
|
||||
|
||||
public static readonly XenotypeDef Succubus;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using LicentiaLabs;
|
||||
using rjw;
|
||||
using rjw;
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
|
|
|
|||
|
|
@ -13,6 +13,12 @@ namespace RJW_Genes
|
|||
{
|
||||
base.PostMake();
|
||||
|
||||
// If the Pawn is already a Futa, do not do anything. Can Happen by Base-RJW Spawn Chance or potentially races / other mods.
|
||||
if (IsAlreadyFuta(pawn))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (GenderUtility.IsFemale(pawn) && additional_genital == null)
|
||||
{
|
||||
createAndAddPenis();
|
||||
|
|
@ -27,6 +33,12 @@ namespace RJW_Genes
|
|||
{
|
||||
base.PostAdd();
|
||||
|
||||
// If the Pawn is already a Futa, do not do anything. Can Happen by Base-RJW Spawn Chance or potentially races / other mods.
|
||||
if (IsAlreadyFuta(pawn))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (pawn.gender == Gender.Female && additional_genital == null)
|
||||
{
|
||||
createAndAddPenis();
|
||||
|
|
@ -79,5 +91,15 @@ namespace RJW_Genes
|
|||
pawn.health.AddHediff(additional_genital, partBPR);
|
||||
}
|
||||
|
||||
private static bool IsAlreadyFuta(Pawn pawn)
|
||||
{
|
||||
if (pawn == null)
|
||||
return false;
|
||||
if (!Genital_Helper.has_genitals(pawn))
|
||||
return false;
|
||||
return
|
||||
(Genital_Helper.has_penis_fertile(pawn) || Genital_Helper.has_penis_infertile(pawn))
|
||||
&& Genital_Helper.has_vagina(pawn) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
namespace RJW_Genes
|
||||
|
|
@ -102,7 +103,7 @@ namespace RJW_Genes
|
|||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_youth_fountain);
|
||||
}
|
||||
|
||||
internal static bool IsAgeDrainer(Pawn pawn)
|
||||
public static bool IsAgeDrainer(Pawn pawn)
|
||||
{
|
||||
if (pawn.genes == null)
|
||||
{
|
||||
|
|
@ -173,5 +174,20 @@ namespace RJW_Genes
|
|||
}
|
||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_unbreakable);
|
||||
}
|
||||
|
||||
public static List<Gene_GenitaliaResizingGene> GetGenitaliaResizingGenes(Pawn pawn)
|
||||
{
|
||||
var ResizingGenes = new List<Gene_GenitaliaResizingGene>();
|
||||
|
||||
// Error Handling: Issue with Pawn or Genes return empty.
|
||||
if (pawn == null || pawn.genes == null)
|
||||
return ResizingGenes;
|
||||
|
||||
foreach (Gene gene in pawn.genes.GenesListForReading)
|
||||
if (gene is Gene_GenitaliaResizingGene resizing_gene)
|
||||
ResizingGenes.Add(resizing_gene);
|
||||
|
||||
return ResizingGenes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +1,12 @@
|
|||
using Verse;
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_BigBreasts : RJW_Gene
|
||||
public class Gene_BigBreasts : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
if (pawn.gender == Gender.Female)
|
||||
SizeAdjuster.AdjustAllBreastSizes(pawn,0.5f,1.0f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
if (pawn.gender == Gender.Female)
|
||||
SizeAdjuster.AdjustAllBreastSizes(pawn, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +1,10 @@
|
|||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_BigMaleGenitalia : RJW_Gene
|
||||
public class Gene_BigMaleGenitalia : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
SizeAdjuster.AdjustAllPenisSizes(pawn,0.5f,1.0f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
SizeAdjuster.AdjustAllPenisSizes(pawn, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Source/Genes/GenitaliaSize/Gene_GenitaliaResizingGene.cs
Normal file
49
Source/Genes/GenitaliaSize/Gene_GenitaliaResizingGene.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
namespace RJW_Genes
|
||||
{
|
||||
/// <summary>
|
||||
/// Parent Gene for Genitalia Resizing. All Resizing genes should inherit for this class.
|
||||
///
|
||||
/// This helps with some functions (e.g. "hasGenitaliaResizingGenes(pawn)") but also to fire genitalia resizing later in life for Pawns.
|
||||
/// (No Children with huge ding dongs, and I don't want kids with tight anuses I am not that degenerate)
|
||||
/// </summary>
|
||||
public abstract class Gene_GenitaliaResizingGene : RJW_Gene
|
||||
{
|
||||
|
||||
public const int RESIZING_AGE = 20;
|
||||
public bool WasApplied { get; set; }
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (pawn.ageTracker.AgeBiologicalYears >= RESIZING_AGE)
|
||||
{
|
||||
Resize();
|
||||
WasApplied = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
if (pawn.ageTracker.AgeBiologicalYears >= RESIZING_AGE)
|
||||
{
|
||||
Resize();
|
||||
WasApplied = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to resize the pawns genitalia.
|
||||
/// All Logic should be put here:
|
||||
/// 1. Filters for Gender
|
||||
/// 2. Filters for Genitalia Existance
|
||||
/// 3. Selection of right Genitalia
|
||||
/// 4. Adjustment of Size
|
||||
///
|
||||
/// I kept it intentionally broad, so that e.g. the Penis Resize can resize multiple penises and also for futas,
|
||||
/// while the breast-gene is female only.
|
||||
/// </summary>
|
||||
public abstract void Resize();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,22 +1,12 @@
|
|||
namespace RJW_Genes
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_LooseAnus : RJW_Gene
|
||||
public class Gene_LooseAnus : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
SizeAdjuster.AdjustAllAnusSizes(pawn, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
SizeAdjuster.AdjustAllAnusSizes(pawn, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,12 @@
|
|||
namespace RJW_Genes
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_LooseFemaleGenitalia : RJW_Gene
|
||||
public class Gene_LooseFemaleGenitalia : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
SizeAdjuster.AdjustAllVaginaSizes(pawn, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
SizeAdjuster.AdjustAllVaginaSizes(pawn, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,11 @@
|
|||
namespace RJW_Genes
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_SmallBreasts : RJW_Gene
|
||||
public class Gene_SmallBreasts : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
SizeAdjuster.AdjustAllBreastSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
SizeAdjuster.AdjustAllBreastSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,10 @@
|
|||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_SmallMaleGenitalia : RJW_Gene
|
||||
public class Gene_SmallMaleGenitalia : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
SizeAdjuster.AdjustAllPenisSizes(pawn,0.0f,0.5f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
SizeAdjuster.AdjustAllPenisSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,21 +1,10 @@
|
|||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_TightAnus : RJW_Gene
|
||||
public class Gene_TightAnus : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
SizeAdjuster.AdjustAllAnusSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
SizeAdjuster.AdjustAllAnusSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +1,10 @@
|
|||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_TightFemaleGenitalia : RJW_Gene
|
||||
public class Gene_TightFemaleGenitalia : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
SizeAdjuster.AdjustAllVaginaSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
SizeAdjuster.AdjustAllVaginaSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
30
Source/Genes/GenitaliaSize/Patch_ResizingOnAdulthood.cs
Normal file
30
Source/Genes/GenitaliaSize/Patch_ResizingOnAdulthood.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using HarmonyLib;
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
/// <summary>
|
||||
/// This Patch adds behavior to all resizing genes:
|
||||
/// At Age RESIZING_MIN_AGE the Pawns Resizing Genes will trigger again, if not already triggered somewhere else.
|
||||
/// This is meant to allow kids to grow up without resized genitals, and resize later (Fixing #11).
|
||||
/// </summary>
|
||||
[HarmonyPatch(typeof(Pawn_AgeTracker), "BirthdayBiological")]
|
||||
public class Patch_ResizingOnAdulthood
|
||||
{
|
||||
|
||||
static void Postfix(Pawn ___pawn, int birthdayAge)
|
||||
{
|
||||
if (birthdayAge >= Gene_GenitaliaResizingGene.RESIZING_AGE)
|
||||
{
|
||||
foreach(Gene_GenitaliaResizingGene gene in GeneUtility.GetGenitaliaResizingGenes(___pawn))
|
||||
{
|
||||
if (!gene.WasApplied)
|
||||
{
|
||||
gene.Resize();
|
||||
gene.WasApplied = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ namespace RJW_Genes
|
|||
Pawn pawn = this.pawn;
|
||||
|
||||
return ((pawn != null) ? pawn.ageTracker : null) == null ||
|
||||
((float)this.pawn.ageTracker.AgeBiologicalYears >= this.def.minAgeActive && this.pawn.ageTracker.AgeBiologicalYears >= (RJWSettings.AllowYouthSex ? 13f : 18f));
|
||||
((float)this.pawn.ageTracker.AgeBiologicalYears >= this.def.minAgeActive);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,9 +13,11 @@ namespace RJW_Genes.Genes.Special
|
|||
{
|
||||
|
||||
const long AGE_TRANSFERED = 120000; // 120k == 2 days
|
||||
// 20 Years * 60 Days / Year * 60k Ticks/Day + 1 for safety
|
||||
const long MINIMUM_AGE = 20 * 60 * 60000 + 1;
|
||||
|
||||
// Comment Below in for debugging, changes years
|
||||
// const long AGE_TRANSFERED = 6000000; // 6000k == 100 days
|
||||
// const long AGE_TRANSFERED = 12000000;
|
||||
public static void Postfix(SexProps props)
|
||||
{
|
||||
if (props == null || props.pawn == null || props.partner == null || props.partner.IsAnimal() )
|
||||
|
|
@ -25,12 +27,12 @@ namespace RJW_Genes.Genes.Special
|
|||
if (GeneUtility.IsAgeDrainer(props.pawn))
|
||||
{
|
||||
var pawnAge = props.pawn.ageTracker.AgeBiologicalTicks;
|
||||
var pawnMinAge = props.pawn.ageTracker.AdultMinAgeTicks;
|
||||
//ModLog.Error($"Firing Age Drain \nMinimum Age is \t{MINIMUM_AGE} \nPawn Age is \t{pawnAge} \nTransferred \t{AGE_TRANSFERED}\nResulting in \t{pawnAge - AGE_TRANSFERED}");
|
||||
|
||||
// Make Partner older
|
||||
props.partner.ageTracker.AgeBiologicalTicks += AGE_TRANSFERED;
|
||||
// Make Pawn younger
|
||||
props.pawn.ageTracker.AgeBiologicalTicks = Math.Max(pawnMinAge, pawnAge - AGE_TRANSFERED);
|
||||
props.pawn.ageTracker.AgeBiologicalTicks = Math.Max(MINIMUM_AGE, (pawnAge - AGE_TRANSFERED));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,10 +46,10 @@ namespace RJW_Genes
|
|||
/// <returns></returns>
|
||||
public static Hediff GetOrgasmRushHediff(Pawn orgasmed)
|
||||
{
|
||||
Hediff orgasmRushHediff = orgasmed.health.hediffSet.GetFirstHediffOfDef(GeneDefOf.rjw_genes_orgasm_rush_hediff);
|
||||
Hediff orgasmRushHediff = orgasmed.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.rjw_genes_orgasm_rush_hediff);
|
||||
if (orgasmRushHediff == null)
|
||||
{
|
||||
orgasmRushHediff = HediffMaker.MakeHediff(GeneDefOf.rjw_genes_orgasm_rush_hediff, orgasmed);
|
||||
orgasmRushHediff = HediffMaker.MakeHediff(HediffDefOf.rjw_genes_orgasm_rush_hediff, orgasmed);
|
||||
orgasmRushHediff.Severity = 0;
|
||||
orgasmed.health.AddHediff(orgasmRushHediff);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,11 @@ namespace RJW_Genes.Genes.Special
|
|||
{
|
||||
|
||||
const long AGE_REDUCTION = 60000; // 60k == 1 day
|
||||
// 20 Years * 60 Days / Year * 60k Ticks/Day + 1 for safety
|
||||
const long MINIMUM_AGE = 20 * 60 * 60000 + 1;
|
||||
|
||||
// Comment Below in for debugging
|
||||
//const long AGE_REDUCTION = 6000000; // 6000k == 100 days
|
||||
// const long AGE_REDUCTION = 6000000; // 6000k == 100 days
|
||||
public static void Postfix(SexProps props)
|
||||
{
|
||||
if (props == null || props.pawn == null || props.partner == null || props.partner.IsAnimal())
|
||||
|
|
@ -25,12 +27,18 @@ namespace RJW_Genes.Genes.Special
|
|||
if (GeneUtility.IsYouthFountain(props.pawn))
|
||||
{
|
||||
var partnerAge = props.partner.ageTracker.AgeBiologicalTicks;
|
||||
var minAge = props.partner.ageTracker.AdultMinAgeTicks;
|
||||
|
||||
props.partner.ageTracker.AgeBiologicalTicks = Math.Max(minAge, partnerAge - AGE_REDUCTION);
|
||||
//ModLog.Error($"Firing Youth Fountain \nMinimum Age is \t{MINIMUM_AGE}\t{ticksToYears(MINIMUM_AGE)}y\nPawn Age is \t{partnerAge}\t{ticksToYears(partnerAge)}y \nTransferred \t {AGE_REDUCTION}\t{ticksToYears(AGE_REDUCTION)}y\nResulting in \t{partnerAge - AGE_REDUCTION}\t{ticksToYears(partnerAge - AGE_REDUCTION)}y");
|
||||
|
||||
props.partner.ageTracker.AgeBiologicalTicks = Math.Max(MINIMUM_AGE, partnerAge - AGE_REDUCTION);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static float ticksToYears(long ticks)
|
||||
{
|
||||
return (ticks / 60000f) / 60f;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,5 +14,6 @@ namespace RJW_Genes
|
|||
public static readonly HediffDef Aphrodisiac_Pheromone;
|
||||
public static readonly HediffDef Fertilin_Lost;
|
||||
public static readonly HediffDef Succubus_Drained;
|
||||
public static readonly HediffDef rjw_genes_orgasm_rush_hediff;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@
|
|||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="First.cs" />
|
||||
<Compile Include="Animal_Inheritance\Harmony_Init.cs" />
|
||||
<Compile Include="Animal_Inheritance\InheritanceUtility.cs" />
|
||||
<Compile Include="Animal_Inheritance\PatchRJWBestialityPregnancyUtility.cs" />
|
||||
|
|
@ -74,6 +73,7 @@
|
|||
<Compile Include="Animal_Inheritance\RJW_BGSSettings.cs" />
|
||||
<Compile Include="Animal_Inheritance\RJW_BGSSettingsController.cs" />
|
||||
<Compile Include="Animal_Inheritance\BestialityGeneInheritanceDef.cs" />
|
||||
<Compile Include="Common\ModLog.cs" />
|
||||
<Compile Include="GeneDefOf.cs" />
|
||||
<Compile Include="Genes\Breeding\Gene_MechBreeder.cs" />
|
||||
<Compile Include="Genes\Breeding\PatchMechBirth.cs" />
|
||||
|
|
@ -85,6 +85,7 @@
|
|||
<Compile Include="Genes\Cum\Gene_MuchCum.cs" />
|
||||
<Compile Include="Genes\Cum\Gene_NoCum.cs" />
|
||||
<Compile Include="Genes\Cum\Patch_TransferNutrition.cs" />
|
||||
<Compile Include="Genes\Damage\Gene_Unbreakable.cs" />
|
||||
<Compile Include="Genes\Damage\Gene_Elasticity.cs" />
|
||||
<Compile Include="Genes\Cum\Patch_Cumflation.cs" />
|
||||
<Compile Include="Genes\ExtraGenitalia\Gene_ExtraBreasts.cs" />
|
||||
|
|
@ -101,6 +102,7 @@
|
|||
<Compile Include="Genes\Gender\Gene_MaleOnly.cs" />
|
||||
<Compile Include="Genes\GeneUtility.cs" />
|
||||
<Compile Include="Genes\GenitaliaSize\Gene_BigBreasts.cs" />
|
||||
<Compile Include="Genes\GenitaliaSize\Gene_GenitaliaResizingGene.cs" />
|
||||
<Compile Include="Genes\GenitaliaSize\Gene_LooseAnus.cs" />
|
||||
<Compile Include="Genes\GenitaliaSize\Gene_LooseFemaleGenitalia.cs" />
|
||||
<Compile Include="Genes\GenitaliaSize\Gene_TightAnus.cs" />
|
||||
|
|
@ -108,6 +110,7 @@
|
|||
<Compile Include="Genes\GenitaliaSize\Gene_TightFemaleGenitalia.cs" />
|
||||
<Compile Include="Genes\GenitaliaSize\Gene_SmallMaleGenitalia.cs" />
|
||||
<Compile Include="Genes\GenitaliaSize\Gene_BigMaleGenitalia.cs" />
|
||||
<Compile Include="Genes\GenitaliaSize\Patch_ResizingOnAdulthood.cs" />
|
||||
<Compile Include="Genes\GenitaliaSize\SizeAdjuster.cs" />
|
||||
<Compile Include="Genes\Genitalia\Gene_SlimeGenitalia.cs" />
|
||||
<Compile Include="Genes\Genitalia\Gene_DragonGenitalia.cs" />
|
||||
|
|
@ -134,9 +137,7 @@
|
|||
<Compile Include="Genes\Life_Force\ThinkNode_ConditionalLowLifeForce.cs" />
|
||||
<Compile Include="Genes\Life_Force\ThinkNode_ConditionalCritcalLifeForce.cs" />
|
||||
<Compile Include="Genes\Life_Force\JobGiver_GetLifeForce.cs" />
|
||||
<Compile Include="Genes\Damage\Gene_Unbreakable.cs" />
|
||||
<Compile Include="Genes\Special\Patch_AgeDrain.cs" />
|
||||
<Compile Include="Genes\Special\Patch_Youth_Fountain.cs" />
|
||||
<Compile Include="Interactions\CompAbility_SexInteractionRequirements.cs" />
|
||||
<Compile Include="Genes\Life_Force\Abilities\CompAbilityEffect_PussyHeal.cs" />
|
||||
<Compile Include="Genes\Life_Force\Abilities\CompProperties_AbilityLifeForceCost.cs" />
|
||||
|
|
@ -155,6 +156,7 @@
|
|||
<Compile Include="Genes\Special\Gene_Aphrodisiac_Pheromones_.cs" />
|
||||
<Compile Include="Genes\Life_Force\Patch_LifeForce.cs" />
|
||||
<Compile Include="Genes\Special\Patch_OrgasmRush.cs" />
|
||||
<Compile Include="Genes\Special\Patch_Youth_Fountain.cs" />
|
||||
<Compile Include="HarmonyInit.cs" />
|
||||
<Compile Include="HediffDefOf.cs" />
|
||||
<Compile Include="Interactions\CustomSexInteraction_Helper.cs" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue