diff --git a/Common/Assemblies/Rjw-Genes.dll b/Common/Assemblies/Rjw-Genes.dll index 5d2ac73..d278990 100644 Binary files a/Common/Assemblies/Rjw-Genes.dll and b/Common/Assemblies/Rjw-Genes.dll differ diff --git a/Common/Defs/GeneDefs/GeneCategories.xml b/Common/Defs/GeneDefs/GeneCategories.xml index 8106c8e..ecce35f 100644 --- a/Common/Defs/GeneDefs/GeneCategories.xml +++ b/Common/Defs/GeneDefs/GeneCategories.xml @@ -21,7 +21,7 @@ rjw_genes_genitalia_type - + 19 @@ -67,11 +67,5 @@ 8 - - rjw_genes_hive - - 7 - - \ No newline at end of file diff --git a/Common/Defs/GeneDefs/GeneDefs_GenitaliaTypes.xml b/Common/Defs/GeneDefs/GeneDefs_GenitaliaTypes.xml index aaf412d..d637209 100644 --- a/Common/Defs/GeneDefs/GeneDefs_GenitaliaTypes.xml +++ b/Common/Defs/GeneDefs/GeneDefs_GenitaliaTypes.xml @@ -7,6 +7,7 @@
  • GenitalType
  • + true 0 @@ -32,6 +33,21 @@ 802 + + rjw_genes_human_genitalia + + Carriers of this gene develop human genitalia. + Genes/Icons/Genitalia_human + +
  • + Penis + Vagina + Anus +
  • +
    + 802 +
    + rjw_genes_canine_genitalia diff --git a/Common/Textures/Genes/Icons/Gene_LitteredBirths.dds b/Common/Textures/Genes/Icons/Gene_LitteredBirths.dds new file mode 100644 index 0000000..ebf7069 Binary files /dev/null and b/Common/Textures/Genes/Icons/Gene_LitteredBirths.dds differ diff --git a/Common/Textures/Genes/Icons/Genitalia_human.dds b/Common/Textures/Genes/Icons/Genitalia_human.dds new file mode 100644 index 0000000..f0a502c Binary files /dev/null and b/Common/Textures/Genes/Icons/Genitalia_human.dds differ diff --git a/Common/Textures/Genes/Icons/Genitalia_human.png b/Common/Textures/Genes/Icons/Genitalia_human.png new file mode 100644 index 0000000..c16c4ea Binary files /dev/null and b/Common/Textures/Genes/Icons/Genitalia_human.png differ diff --git a/Source/Common/Helpers/RJW_GenesLogger.cs b/Source/Common/Helpers/RJW_GenesLogger.cs deleted file mode 100644 index cfd41ea..0000000 --- a/Source/Common/Helpers/RJW_GenesLogger.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Verse; - -namespace RJW_Genes -{ - public static class RJW_GenesLogger - { - public static void Message(string message) - { - Log.Message("[INFO][RJW_Genes] - " + message); - } - - public static void Warning(string message) - { - Log.Message("[WARN][RJW_Genes] - " + message); - } - - public static void Error(string message) - { - Log.Message("[ ERR][RJW_Genes] - " + message); - } - - public static void MessageGroupHead(string message) - { - Log.Message("[INFO][RJW_Genes]╦═ " + message); - } - public static void MessageGroupBody(string message) - { - Log.Message("[INFO][RJW_Genes]╠═══ " + message); - } - public static void MessageGroupFoot(string message) - { - Log.Message("[INFO][RJW_Genes]╚═══ " + message); - } - } -} diff --git a/Source/Common/patches/PatchImplants.cs b/Source/Common/patches/PatchImplants.cs index c2dd098..5cd3c8c 100644 --- a/Source/Common/patches/PatchImplants.cs +++ b/Source/Common/patches/PatchImplants.cs @@ -7,7 +7,7 @@ using HarmonyLib; using RimWorld; using Verse; using rjw; -using LewdBiotech; + namespace RJW_Genes { @@ -24,16 +24,16 @@ namespace RJW_Genes { if (rapist.health.hediffSet.HasHediff(HediffDef.Named("LimbicStimulator"))) { - if (LBTSettings.devMode) + if (RJW_Genes_Settings.rjw_genes_detailed_debug) { - RJW_GenesLogger.MessageGroupHead("Found LimbicStimulator hediff during xxx.would_rape check"); - RJW_GenesLogger.MessageGroupBody("Pawn: " + rapist.NameShortColored + " (" + rapist.ThingID + ")"); - RJW_GenesLogger.MessageGroupBody("__result (Before roll): " + __result); + ModLog.Message("Found LimbicStimulator hediff during xxx.would_rape check"); + ModLog.Message("Pawn: " + rapist.NameShortColored + " (" + rapist.ThingID + ")"); + ModLog.Message("__result (Before roll): " + __result); } __result = Rand.Chance(0.95f); - if (LBTSettings.devMode) + if (RJW_Genes_Settings.rjw_genes_detailed_debug) { - RJW_GenesLogger.MessageGroupFoot("__result (After roll): " + __result); + ModLog.Message("__result (After roll): " + __result); } } } @@ -42,9 +42,9 @@ namespace RJW_Genes { if (pawn.health.hediffSet.HasHediff(HediffDef.Named("LimbicStimulator"))) { - if (LBTSettings.devMode) + if (RJW_Genes_Settings.rjw_genes_detailed_debug) { - RJW_GenesLogger.Message("Found LimbicStimulator hediff during xxx.is_rapist check for " + pawn.NameShortColored + " (" + pawn.ThingID + ")" + " with __result = " + __result + " - forcing to true"); + ModLog.Message("Found LimbicStimulator hediff during xxx.is_rapist check for " + pawn.NameShortColored + " (" + pawn.ThingID + ")" + " with __result = " + __result + " - forcing to true"); __result = true; } } @@ -52,7 +52,7 @@ namespace RJW_Genes static public void think_about_sex_Rapist_PostFix(ref ThoughtDef __result, Pawn pawn) { - if (LBTSettings.regretStealingLovinThoughtDisabled) return; + if (RJW_Genes_Settings.regretStealingLovinThoughtDisabled) return; if (pawn.health.hediffSet.HasHediff(HediffDef.Named("LimbicStimulator")) && (__result == stoleSomeLovin || __result == bloodlustStoleSomeLovin) && !pawn.story.traits.HasTrait(rapist) && !pawn.story.traits.HasTrait(sadist)) { diff --git a/Source/GeneDefOf.cs b/Source/GeneDefOf.cs index 556eb00..ef269cf 100644 --- a/Source/GeneDefOf.cs +++ b/Source/GeneDefOf.cs @@ -33,6 +33,7 @@ namespace RJW_Genes public static readonly GeneDef rjw_genes_Orc_genitalia; public static readonly GeneDef rjw_genes_Pig_genitalia; public static readonly GeneDef rjw_genes_Tentacle_genitalia; + public static readonly GeneDef rjw_genes_human_genitalia; // Extra Genitalia public static readonly GeneDef rjw_genes_extra_penis; diff --git a/Source/Genes/Genital_Helper_2.cs b/Source/Genes/Genital_Helper_2.cs index a82d93e..d6b2f34 100644 --- a/Source/Genes/Genital_Helper_2.cs +++ b/Source/Genes/Genital_Helper_2.cs @@ -14,6 +14,9 @@ namespace RJW_Genes public static HediffDef GhostPenis = HediffDef.Named("GhostPenis"); public static HediffDef NecroPenis = HediffDef.Named("NecroPenis"); public static HediffDef GhostVagina = HediffDef.Named("GhostVagina"); + public static HediffDef Vagina = HediffDef.Named("Vagina"); + public static HediffDef Penis = HediffDef.Named("Penis"); + public static HediffDef Anus = HediffDef.Named("Anus"); } } diff --git a/Source/Genes/Genitalia/Gene_GenitaliaType.cs b/Source/Genes/Genitalia/Gene_GenitaliaType.cs index 8cdb1a5..7ffda55 100644 --- a/Source/Genes/Genitalia/Gene_GenitaliaType.cs +++ b/Source/Genes/Genitalia/Gene_GenitaliaType.cs @@ -8,7 +8,7 @@ namespace RJW_Genes public override void PostMake() { base.PostMake(); - Apply(); + } public override void PostAdd() @@ -19,13 +19,16 @@ namespace RJW_Genes protected virtual void Apply() { - GenitaliaTypeExtension genitals = def.GetModExtension(); - if (genitals == null && RJW_Genes_Settings.rjw_genes_detailed_debug) + if (this.Active) { - ModLog.Error($"Gene {def} failed to change genitals - Need a modExtension with Class=\"{typeof(GenitaliaTypeExtension).FullName}\"."); - return; + GenitaliaTypeExtension genitals = def.GetModExtension(); + if (genitals == null && RJW_Genes_Settings.rjw_genes_detailed_debug) + { + ModLog.Error($"Gene {def} failed to change genitals - Need a modExtension with Class=\"{typeof(GenitaliaTypeExtension).FullName}\"."); + return; + } + GenitaliaChanger.ChangeGenitalia(pawn, genitals.penis, genitals.vagina, genitals.anus); } - GenitaliaChanger.ChangeGenitalia(pawn, genitals.penis, genitals.vagina, genitals.anus); } } } \ No newline at end of file diff --git a/Source/Genes/Genitalia/GenitaliaUtility.cs b/Source/Genes/Genitalia/GenitaliaUtility.cs index b2c4488..a56d9ae 100644 --- a/Source/Genes/Genitalia/GenitaliaUtility.cs +++ b/Source/Genes/Genitalia/GenitaliaUtility.cs @@ -61,7 +61,7 @@ namespace RJW_Genes case "rjw_genes_udder_breasts": return Genital_Helper.udder_breasts; case "rjw_genes_ovipositor_genitalia": return Genital_Helper.average_breasts; - default: return Genital_Helper.generic_breasts; + default: return Genital_Helper.average_breasts; } } diff --git a/Source/Genes/GenitaliaSize/Gene_EvergrowingGenitalia.cs b/Source/Genes/GenitaliaSize/Gene_EvergrowingGenitalia.cs index cb843f5..552ac20 100644 --- a/Source/Genes/GenitaliaSize/Gene_EvergrowingGenitalia.cs +++ b/Source/Genes/GenitaliaSize/Gene_EvergrowingGenitalia.cs @@ -9,22 +9,15 @@ namespace RJW_Genes public class Gene_EvergrowingGenitalia : RJW_Gene { - /// - /// The age (in years) at which the Pawns Genes will take effect, resizing their genitalia. - /// - public const int RESIZING_AGE = 20; - - //public const int GROWTH_INTERVAL = 1000; // Test value for Quick Trials - public const int GROWTH_INTERVAL_FALLBACK = 60000; // 60k == 1 day public override void Tick() { base.Tick(); - int interval = ModExtensionHelper.GetTickIntervalFromModExtension(GeneDefOf.rjw_genes_evergrowth, GROWTH_INTERVAL_FALLBACK); + int interval = ModExtensionHelper.GetTickIntervalFromModExtension(GeneDefOf.rjw_genes_evergrowth, RJW_Genes_Settings.rjw_genes_evergrowth_ticks); if (pawn.IsHashIntervalTick(interval) && this.pawn.Map != null - && pawn.ageTracker.AgeBiologicalYears >= RESIZING_AGE) + && pawn.ageTracker.AgeBiologicalYears >= RJW_Genes_Settings.rjw_genes_resizing_age) { GrowPenisses(); GrowVaginas(); diff --git a/Source/Common/patches/PatchLitteredBirth.cs b/Source/Genes/Patches/PatchLitteredBirth.cs similarity index 78% rename from Source/Common/patches/PatchLitteredBirth.cs rename to Source/Genes/Patches/PatchLitteredBirth.cs index 825b78f..8528d0f 100644 --- a/Source/Common/patches/PatchLitteredBirth.cs +++ b/Source/Genes/Patches/PatchLitteredBirth.cs @@ -7,7 +7,6 @@ using HarmonyLib; using RimWorld; using Verse; using rjw; -using LewdBiotech; namespace RJW_Genes { @@ -33,11 +32,11 @@ namespace RJW_Genes // with littered births gene, move on if (!laborStateIsNull && hasLitteredBirthsGene) { - if (LBTSettings.devMode) + if (RJW_Genes_Settings.rjw_genes_detailed_debug) { - RJW_GenesLogger.MessageGroupHead("Found active LaborState and LitteredBirths gene - skipping additional Hediff_Labor_PostRemovedPostFix work"); - RJW_GenesLogger.MessageGroupBody("Pawn: " + __instance.pawn.NameShortColored + " (" + __instance.pawn.ThingID + ")"); - RJW_GenesLogger.MessageGroupFoot("birthCount: " + laborStateMap.TryGetValue(__instance.pawn.ThingID).birthCount); + ModLog.Message("Found active LaborState and LitteredBirths gene - skipping additional Hediff_Labor_PostRemovedPostFix work"); + ModLog.Message("Pawn: " + __instance.pawn.NameShortColored + " (" + __instance.pawn.ThingID + ")"); + ModLog.Message("birthCount: " + laborStateMap.TryGetValue(__instance.pawn.ThingID).birthCount); } return; @@ -46,7 +45,7 @@ namespace RJW_Genes // Make a new LaborState for the null case with littered births if (laborStateIsNull && hasLitteredBirthsGene) { - RJW_GenesLogger.Message("Found littered births gene"); + ModLog.Message("Found littered births gene"); int litteredBirthsTotalRoll = Rand.RangeInclusive(2, 4); laborStateMap.SetOrAdd(__instance.pawn.ThingID, new LaborState(__instance.pawn, litteredBirthsTotalRoll)); return; @@ -56,9 +55,9 @@ namespace RJW_Genes // pawns that don't already have state, so return if state is !null (STATE SHOULD ALWAYS BE CLEANED IN LABORPUSHING POSTFIX) if (!laborStateIsNull) { - if (LBTSettings.devMode) + if (RJW_Genes_Settings.rjw_genes_detailed_debug) { - RJW_GenesLogger.Warning("Labor state for pawn " + __instance.pawn.NameShortColored + " (" + __instance.pawn.ThingID + ") is not null despite all checks passing for determining first instance of Hediff_Labor - this warning should never occur, and may indicate a bug in Hediff_LaborPushing of lingering labor state from a previous pregnancy"); + ModLog.Warning("Labor state for pawn " + __instance.pawn.NameShortColored + " (" + __instance.pawn.ThingID + ") is not null despite all checks passing for determining first instance of Hediff_Labor - this warning should never occur, and may indicate a bug in Hediff_LaborPushing of lingering labor state from a previous pregnancy"); } return; } @@ -77,12 +76,12 @@ namespace RJW_Genes if (!randomTwinsRoll && !hasAgitator) { // We failed rolls, and we don't have an agitator - no additional processing, do vanilla single baby birth - if (LBTSettings.devMode) + if (RJW_Genes_Settings.rjw_genes_detailed_debug) { - RJW_GenesLogger.MessageGroupHead("Inside Hediff_Labor_PostRemovedPostFix random twins check fail"); - RJW_GenesLogger.MessageGroupBody("Pawn: " + __instance.pawn.NameShortColored); - RJW_GenesLogger.MessageGroupBody("Random twins roll outcome: " + randomTwinsRoll); - RJW_GenesLogger.MessageGroupFoot("Has OvaryAgitator: " + hasAgitator); + ModLog.Message("Inside Hediff_Labor_PostRemovedPostFix random twins check fail"); + ModLog.Message("Pawn: " + __instance.pawn.NameShortColored); + ModLog.Message("Random twins roll outcome: " + randomTwinsRoll); + ModLog.Message("Has OvaryAgitator: " + hasAgitator); } return; } @@ -134,9 +133,9 @@ namespace RJW_Genes if (!hasAgitator && !hasLitteredBirthsGene) { - if (LBTSettings.devMode) + if (RJW_Genes_Settings.rjw_genes_detailed_debug) { - RJW_GenesLogger.Message("Pawn " + __instance.pawn.NameShortColored + " (" + __instance.pawn.ThingID + ") is having random twins"); + ModLog.Message("Pawn " + __instance.pawn.NameShortColored + " (" + __instance.pawn.ThingID + ") is having random twins"); } Find.LetterStack.ReceiveLetter("Twins!", __instance.pawn.NameShortColored + " is still in labor and is having twins!\n\nBe sure to gather your doctor and additional friends and family to ensure the other baby is also born healthy!", LetterDefOf.AnotherBaby, __instance.pawn); return; diff --git a/Source/Rjw-Genes.csproj b/Source/Rjw-Genes.csproj index ac54fa5..e796fb8 100644 --- a/Source/Rjw-Genes.csproj +++ b/Source/Rjw-Genes.csproj @@ -43,11 +43,10 @@ - - + @@ -157,7 +156,6 @@ - diff --git a/Source/Settings/LBTSettings.cs b/Source/Settings/LBTSettings.cs deleted file mode 100644 index cf874b9..0000000 --- a/Source/Settings/LBTSettings.cs +++ /dev/null @@ -1,54 +0,0 @@ -using UnityEngine; -using Verse; - -// If it isn't blatantly obvious, I unabashedly ripped this settings template from RJW, minus the fact that -// I won't be (personally) supporting multiplayer, and it's all in one file - but I digress ... -namespace LewdBiotech -{ - class LBTSettingsController : Mod - { - public LBTSettingsController(ModContentPack content) : base(content) - { - GetSettings(); - } - - public override string SettingsCategory() - { - return "LBTSettings".Translate(); - } - - public override void DoSettingsWindowContents(Rect inRect) - { - LBTSettings.DoWindowContents(inRect); - } - } - - public class LBTSettings : ModSettings - { - // For my own sanity, all now and future settings will have a default disabled/false state (at least, that's the plan), and - // the settings name and description should reflect that (not that I'm going to add that many settings, mind you) - public static bool devMode = false; - public static bool regretStealingLovinThoughtDisabled = false; - - public static void DoWindowContents(Rect inRect) - { - // Shrink the settings window a bit - don't need to be that w i d e - inRect.width = inRect.width - 400; - inRect.x = inRect.x + 200; - Listing_Standard listingStandard = new Listing_Standard(); - listingStandard.Begin(inRect); - listingStandard.Gap(4f); - listingStandard.CheckboxLabeled("EnableLBTDevLogging".Translate(), ref devMode, "EnableLBTDevLoggingDesc".Translate()); - listingStandard.Gap(4f); - listingStandard.CheckboxLabeled("RegretStealingLovinThoughtDisabled".Translate(), ref regretStealingLovinThoughtDisabled, "RegretStealingLovinThoughtDisabledDesc".Translate()); - listingStandard.End(); - } - - public override void ExposeData() - { - base.ExposeData(); - Scribe_Values.Look(ref devMode, "EnableLBTDevLogging", devMode, true); - Scribe_Values.Look(ref regretStealingLovinThoughtDisabled, "regretStealingLovinThoughtDisabled", regretStealingLovinThoughtDisabled, true); - } - } -} diff --git a/Source/Settings/RJW_Genes_Settings.cs b/Source/Settings/RJW_Genes_Settings.cs index 8dc4f6c..53e5d51 100644 --- a/Source/Settings/RJW_Genes_Settings.cs +++ b/Source/Settings/RJW_Genes_Settings.cs @@ -21,12 +21,22 @@ namespace RJW_Genes listing_Standard.Label("Genitalia resizing age" + ": " + Math.Round((double)(RJW_Genes_Settings.rjw_genes_resizing_age), 0).ToString() , -1f, "years."); RJW_Genes_Settings.rjw_genes_resizing_age = listing_Standard.Slider(RJW_Genes_Settings.rjw_genes_resizing_age, 18f, 100f); - + listing_Standard.Gap(4f); listing_Standard.Label("Fertilin-Gain from Animals" + ": " + + Math.Round((double)(RJW_Genes_Settings.rjw_genes_evergrowth_ticks), 0).ToString() , -1f, "ticks."); + RJW_Genes_Settings.rjw_genes_evergrowth_ticks = (int) listing_Standard.Slider(RJW_Genes_Settings.rjw_genes_evergrowth_ticks, 600, 60000); + + listing_Standard.Gap(4f); + listing_Standard.Label("nunmber of ticks between genitalia evergrowth updates (600 tick for ~2cm/day)" + ": " + Math.Round((double)(RJW_Genes_Settings.rjw_genes_fertilin_from_animals_factor * 100f), 0).ToString() + "%", -1f, "of fertilin gained (compared to human-baseline)."); RJW_Genes_Settings.rjw_genes_fertilin_from_animals_factor = listing_Standard.Slider(RJW_Genes_Settings.rjw_genes_fertilin_from_animals_factor, 0f, 3f); + + + listing_Standard.Gap(4f); + listing_Standard.CheckboxLabeled("RegretStealingLovinThoughtDisabled".Translate(), ref regretStealingLovinThoughtDisabled, "RegretStealingLovinThoughtDisabledDesc".Translate()); + listing_Standard.Gap(5f); listing_Standard.CheckboxLabeled("generous-donor cheatmode", ref rjw_genes_generous_donor_cheatmode, "When enabled, pawns with the 'generous donor' are not drained and not fertilin exhausted. Hence they can fuel succubi and incubi non-stop. This makes them drastically easier to keep, and you should not do it.", 0f, 1f); @@ -38,16 +48,20 @@ namespace RJW_Genes public override void ExposeData() { base.ExposeData(); + Scribe_Values.Look(ref RJW_Genes_Settings.rjw_genes_evergrowth_ticks, "rjw_genes_evergrowth_ticks", RJW_Genes_Settings.rjw_genes_evergrowth_ticks, true); Scribe_Values.Look(ref RJW_Genes_Settings.rjw_genes_resizing_age, "rjw_genes_resizing_age", RJW_Genes_Settings.rjw_genes_resizing_age, true); Scribe_Values.Look(ref RJW_Genes_Settings.rjw_genes_fertilin_from_animals_factor, "rjw_genes_fertilin_from_animals_factor", RJW_Genes_Settings.rjw_genes_fertilin_from_animals_factor, true); Scribe_Values.Look(ref RJW_Genes_Settings.rjw_genes_detailed_debug, "rjw_genes_detailed_debug", RJW_Genes_Settings.rjw_genes_detailed_debug, true); - + Scribe_Values.Look(ref regretStealingLovinThoughtDisabled, "regretStealingLovinThoughtDisabled", regretStealingLovinThoughtDisabled, true); Scribe_Values.Look(ref RJW_Genes_Settings.rjw_genes_generous_donor_cheatmode, "rjw_genes_generous_donor_cheatmode", RJW_Genes_Settings.rjw_genes_generous_donor_cheatmode, true); } public static bool rjw_genes_detailed_debug = false; public static float rjw_genes_fertilin_from_animals_factor = 0.1f; public static float rjw_genes_resizing_age = 20; + public static int rjw_genes_evergrowth_ticks = 60000; + public static bool regretStealingLovinThoughtDisabled = false; +