diff --git a/CHANGELOG.md b/CHANGELOG.md index ab1db00..b087e0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,8 +22,6 @@ Most of the genes so far were positive or neutral, so I got some fair requests to introduce negative genes to keep xenotypes balanced. I know that this is some overlap with the STD mod, but well ... you are free to turn things off? -In theory, you can specify and gene of any kind to be spreadable by sex, not only ones written by this mod. - **Genetic Infectors**: These Genes can apply a genetic disease, but are not genetic diseases themselves. @@ -82,20 +80,12 @@ but they are meant mostly to have infectors immune against their own diseases. - Gene: Hardwired Progenity. Pawns with this get a malus on having no-children, and bonus on having a lot. - Gene: Sexual Genetic Swap. Pawns have a chance to switch a random gene with their sexpartner. - (Archite) Gene: Sexual Genetic Thief. Pawns have a chance to steal a gene from their sexpartner. Genetic Disease Immunity shields against this. -- Gene: Sperm Displacement. Pawns might overwrite an existing pregnancy, becoming the new father. The pregnancy will stay in its gestation progress. - Pawns will have negative thoughts about pawns with more genetic diseases than themselves. - Faction Penalties for spreading diseases, stealing genes and aging pawns with age transfer -- Patch for [Imphilee Xeno](https://steamcommunity.com/sharedfiles/filedetails/?id=2990674516) by @Bunuffin - -**Changes**:: - -- Cum-Amount-Changing genes now are XML Adjustable and share a single `.cs`-class -- Incubi are now Bisexual too, as they should be. **Fixes:** - Fixed an Issue where pawns would always get the Pheromone social boost, unless they had the pheromone (#113) -- Fixed two hidden dependencies on Ideology and Royalty (#115) **Internal:** @@ -103,18 +93,6 @@ but they are meant mostly to have infectors immune against their own diseases. - Introduced a `ModLog.Debug` Function that checks for the settings before printing - trying to spread it over the whole project. - Removed TODO File. I have enough to do. -**Notes:** - -The changes to the cum-gene will give a 1-time warning on loading the save. The warning looks like this: -``` -Could not find class RJW_Genes.Gene_MuchCum while resolving node li. Trying to use Verse.Gene instead. Full node:
  • rjw_genes_much_cumThing_Human697null82
  • -UnityEngine.StackTraceUtility:ExtractStackTrace () -Verse.Log:Error (string) -... -``` - -This is not dangerous. - # 2.1.0 (27-06-2024) **Additions**: diff --git a/Common/Defs/GeneDefs/GeneDefs_Breeding.xml b/Common/Defs/GeneDefs/GeneDefs_Breeding.xml index 463046f..832621a 100644 --- a/Common/Defs/GeneDefs/GeneDefs_Breeding.xml +++ b/Common/Defs/GeneDefs/GeneDefs_Breeding.xml @@ -153,4 +153,15 @@ 0 + + rjw_genes_pregnancy_overwrite + + Carriers of this gene can 'overwrite' an existing pregnancy, keeping the progress but effectively replacing the father. + Genes/Icons/RJW_Genes_PheromoneSpit + 75 + + 4 + -2 + + \ No newline at end of file diff --git a/Common/Defs/GeneDefs/GeneDefs_Cum.xml b/Common/Defs/GeneDefs/GeneDefs_Cum.xml index 95580a8..32ac80c 100644 --- a/Common/Defs/GeneDefs/GeneDefs_Cum.xml +++ b/Common/Defs/GeneDefs/GeneDefs_Cum.xml @@ -21,15 +21,10 @@ Males of these species have no fluid. Genes/Icons/No_Cum - RJW_Genes.Gene_ChangeCumAmount + RJW_Genes.Gene_NoCum 533 0 1 - -
  • - 0.0 -
  • -
    @@ -37,15 +32,10 @@ Males of this species produce a lot of fluid. Genes/Icons/Much_Cum - RJW_Genes.Gene_ChangeCumAmount + RJW_Genes.Gene_MuchCum 534 1 - 0 - -
  • - 3.0 -
  • -
    + -1
    @@ -54,15 +44,10 @@ Males of this species produce a whole lot of fluid. They are like fountains basically. Genes/Icons/Very_Much_Cum - RJW_Genes.Gene_ChangeCumAmount + RJW_Genes.Gene_VeryMuchCum 535 1 - -1 - -
  • - 15.0 -
  • -
    + -2
    \ No newline at end of file diff --git a/Common/Defs/GeneDefs/GeneDefs_Reproduction.xml b/Common/Defs/GeneDefs/GeneDefs_Reproduction.xml index 1c37ba3..7c305d4 100644 --- a/Common/Defs/GeneDefs/GeneDefs_Reproduction.xml +++ b/Common/Defs/GeneDefs/GeneDefs_Reproduction.xml @@ -115,6 +115,7 @@ +
  • rjw_genes_homosexuality_trait_giver
  • rjw_genes_sexual_orientation
  • @@ -143,7 +144,7 @@ -
  • rjw_genes_sexual_orientation
  • +
  • rjw_genes_sexual_orientation
  • rjw_genes_bisexuality_trait_giver
  • @@ -206,28 +207,4 @@ - - rjw_genes_pregnancy_overwrite - - Reproduction - Carriers of this gene can 'overwrite' an existing pregnancy, keeping the - progress but effectively replacing the father. - Genes/Icons/RJW_Genes_PheromoneSpit - 120 - - 4 - -2 - - -
  • - 0.5 -
  • -
  • - Genes/Icons/RJW_Genes_Endogene_Background - Genes/Icons/RJW_Genes_Xenogene_Background -
  • -
    -
    - \ No newline at end of file diff --git a/Common/Defs/GeneDefs/Xenotype_Lifeforce.xml b/Common/Defs/GeneDefs/Xenotype_Lifeforce.xml index f28f160..bc0c54b 100644 --- a/Common/Defs/GeneDefs/Xenotype_Lifeforce.xml +++ b/Common/Defs/GeneDefs/Xenotype_Lifeforce.xml @@ -75,7 +75,6 @@
  • rjw_genes_hypersexual
  • -
  • rjw_genes_bisexual
  • rjw_genes_male_only
  • rjw_genes_lifeforce
  • rjw_genes_lifeforce_drain
  • diff --git a/Common/Defs/HediffDefs/Hediffs_Fertilin.xml b/Common/Defs/HediffDefs/Hediffs_Fertilin.xml index 5b56717..fdca8d4 100644 --- a/Common/Defs/HediffDefs/Hediffs_Fertilin.xml +++ b/Common/Defs/HediffDefs/Hediffs_Fertilin.xml @@ -1,6 +1,6 @@ - + - + rjw_genes_fertilin_lost Hediff_HemogenCraving @@ -19,13 +19,12 @@ - + rjw_genes_succubus_drained HediffWithComps - The vitality of this pawn has been drained. Cannot be drained again until fully - recovered. + The vitality of this pawn has been drained. Cannot be drained again until fully recovered. (1,0,0.5) 1.0 1.0 @@ -75,13 +74,13 @@ -0.2 - 0.4 + 0.4 0.1 0.35 - + rjw_genes_fertilin_craving @@ -91,78 +90,77 @@ 1.0 0.01 -
  • - - 0.05 - -
  • - Consciousness - 0.9 -
  • - - -
  • - - 0.35 - 0.1 - -
  • - Consciousness - 0.8 -
  • - - -
  • - - 0.7 - 0.15 - -
  • - Consciousness - 0.5 -
  • - - +
  • + + 0.05 + +
  • + Consciousness + 0.9 +
  • + + +
  • + + 0.35 + 0.1 + +
  • + Consciousness + 0.8 +
  • + + +
  • + + 0.7 + 0.15 + +
  • + Consciousness + 0.5 +
  • + +
    -
  • - 0.05 - -0.1 -
  • +
  • + 0.05 + -0.1 +
  • - - rjw_genes_naked_prowess - (0.52, 1, 0.95) - - Driven by fertilin, this person has greatly increased strength and resilience. - HediffWithComps - -
  • - - - 0.5 - 0.5 - 0.5 - - - 0.5 - 1.5 - -
  • -
    - -
  • - True - 5000 -
  • -
  • - - - false - + + rjw_genes_naked_prowess + + Driven by fertilin, this person has greatly increased strength and resilience. + HediffWithComps + +
  • + + + 0.5 + 0.5 + 0.5 + + + + 0.5 + 1.5 + +
  • + + +
  • + True + 5000 +
  • +
  • + + + false + - \ No newline at end of file + diff --git a/Common/Defs/HediffDefs/Scrambler.xml b/Common/Defs/HediffDefs/Scrambler.xml index 4ab6071..a84299d 100644 --- a/Common/Defs/HediffDefs/Scrambler.xml +++ b/Common/Defs/HediffDefs/Scrambler.xml @@ -13,7 +13,7 @@
  • 0 - 0.40 + 0.40 3.0 diff --git a/Common/Defs/HistoryEventDefs/SpecialHistoryEventDefs.xml b/Common/Defs/HistoryEventDefs/SpecialHistoryEventDefs.xml index ded422c..c5668ad 100644 --- a/Common/Defs/HistoryEventDefs/SpecialHistoryEventDefs.xml +++ b/Common/Defs/HistoryEventDefs/SpecialHistoryEventDefs.xml @@ -10,9 +10,4 @@ - - rjw_genes_GoodwillChangedReason_OverwritePregnancy - - - \ No newline at end of file diff --git a/Common/Patches/Xenotypes/PatchImphileeXeno.xml b/Common/Patches/Xenotypes/PatchImphileeXeno.xml deleted file mode 100644 index 4a8655f..0000000 --- a/Common/Patches/Xenotypes/PatchImphileeXeno.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - -
  • - -
  • Imphilee Xeno
  • - - - Defs/XenotypeDef[defName="LD_Imphilee"]/genes - -
  • rjw_genes_tight_female_genitalia
  • -
  • rjw_genes_small_breasts
  • -
  • rjw_genes_elasticity
  • -
  • rjw_genes_demonic_genitalia
  • -
    -
    - -
  • - -
  • Imphilee Xeno
  • - - - Defs/XenotypeDef[defName="LD_Imphilee_Overlord"]/genes - -
  • rjw_genes_tight_female_genitalia
  • -
  • rjw_genes_small_breasts
  • -
  • rjw_genes_elasticity
  • -
  • rjw_genes_demonic_genitalia
  • -
  • rjw_genes_rapist
  • -
    -
    - - - - diff --git a/Source/Common/Defs/MultiplierExtension.cs b/Source/Common/Defs/MultiplierExtension.cs deleted file mode 100644 index 5be194e..0000000 --- a/Source/Common/Defs/MultiplierExtension.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Verse; - -namespace RJW_Genes -{ - public class MultiplierExtension : DefModExtension - { - public float multiplier; - } -} diff --git a/Source/Genes/Cum/CumUtility.cs b/Source/Genes/Cum/CumUtility.cs index dba96b1..b483aed 100644 --- a/Source/Genes/Cum/CumUtility.cs +++ b/Source/Genes/Cum/CumUtility.cs @@ -34,23 +34,8 @@ namespace RJW_Genes } - /// - /// 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. - /// - - 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(); - 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) + //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); diff --git a/Source/Genes/Cum/Gene_ChangeCumAmount.cs b/Source/Genes/Cum/Gene_MuchCum.cs similarity index 51% rename from Source/Genes/Cum/Gene_ChangeCumAmount.cs rename to Source/Genes/Cum/Gene_MuchCum.cs index dc10ba4..e88ac3f 100644 --- a/Source/Genes/Cum/Gene_ChangeCumAmount.cs +++ b/Source/Genes/Cum/Gene_MuchCum.cs @@ -1,38 +1,36 @@ namespace RJW_Genes { - public class Gene_ChangeCumAmount : RJW_Gene + public class Gene_MuchCum : RJW_Gene { bool has_been_fired = false; + float multiplier_much_cum = 3f; public override void PostMake() { base.PostMake(); - float multipier = CumUtility.LookupCumMultiplier(this); - CumUtility.MultiplyFluidAmountBy(pawn, multipier); + CumUtility.MultiplyFluidAmountBy(pawn, multiplier_much_cum); has_been_fired = true; } public override void PostAdd() { base.PostAdd(); - if (!has_been_fired) - { - float multipier = CumUtility.LookupCumMultiplier(this); - CumUtility.MultiplyFluidAmountBy(pawn, multipier); + if (!has_been_fired) { + CumUtility.MultiplyFluidAmountBy(pawn, multiplier_much_cum); has_been_fired = true; } } + public override void PostRemove() { base.PostAdd(); if (has_been_fired) { - float multipier = CumUtility.LookupCumMultiplier(this); - CumUtility.MultiplyFluidAmountBy(pawn, 1/ multipier); + CumUtility.MultiplyFluidAmountBy(pawn, 1/multiplier_much_cum); has_been_fired = false; } } diff --git a/Source/Genes/Cum/Gene_NoCum.cs b/Source/Genes/Cum/Gene_NoCum.cs new file mode 100644 index 0000000..0c3e888 --- /dev/null +++ b/Source/Genes/Cum/Gene_NoCum.cs @@ -0,0 +1,34 @@ +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(); + + } + + } +} diff --git a/Source/Genes/Cum/Gene_VeryMuchCum.cs b/Source/Genes/Cum/Gene_VeryMuchCum.cs new file mode 100644 index 0000000..21faecc --- /dev/null +++ b/Source/Genes/Cum/Gene_VeryMuchCum.cs @@ -0,0 +1,39 @@ +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; + } + } + + } +} diff --git a/Source/Genes/Special/Patches/Patch_PregnancyOverwrite.cs b/Source/Genes/Special/Patches/Patch_PregnancyOverwrite.cs index 704a2bd..b7b35a6 100644 --- a/Source/Genes/Special/Patches/Patch_PregnancyOverwrite.cs +++ b/Source/Genes/Special/Patches/Patch_PregnancyOverwrite.cs @@ -40,6 +40,8 @@ namespace RJW_Genes if (!pawn.IsPregnant() && !partner.IsPregnant()) return; + ModLog.Debug("Firing Pregnancy Overwrite Patch - Passed Simple NullChecks"); + if (pawn.IsPregnant() && GeneUtility.HasGeneNullCheck(partner, GeneDefOf.rjw_genes_pregnancy_overwrite)) TryReplacePregnancy(partner, pawn); @@ -49,52 +51,29 @@ namespace RJW_Genes TryReplacePregnancy(pawn, partner); } - /// - /// Tries to replace an existing pregnancy with a new pregnancy at the same gestation process. - /// The new pregnancy will have the same mother, but a new father and a new set of genes. - /// - /// There is a check for pregnancy that checks for the general fertility (using Vanilla Functions) and multiplies it with a xml-configurable chance. - /// If anything is replaced, there will be a faction penalty applied. - /// - /// - /// public static void TryReplacePregnancy(Pawn replacer, Pawn pregnant) { + // TODO: This mostly works, but needs some more checks. + // - Check if there is a pregnancy occurring + // - Check for Disease Immunity + // - Add Faction Penalties + + ModLog.Debug($"Firing Pregnancy Overwrite for {replacer} and {pregnant}"); + + // The "CanImpregnate" does not work as I want, as the pawn is already pregnant, so it wont allow to be pregnated. + //PregnancyHelper.CanImpregnate(pawn, partner, props.sexType) - // DevNote: - // There are some issues with just checking PregnancyUtility.PregnancyChanceForPartners or rjw.PregnancyHelper.CanImpregnate - // Both do give 0.0 chance when the pawn is already pregnant, which does not help me :/ Hediff pregnancyHediff = PregnancyUtility.GetPregnancyHediff(pregnant); if (pregnancyHediff == null) return; - if (DiseaseHelper.IsImmuneAgainstGeneticDisease(pregnant, GeneDefOf.rjw_genes_pregnancy_overwrite)) - { - ModLog.Debug($"{pregnant} is immune against rjw_genes_pregnancy_overwrite from {replacer}"); - return; - } + float gestationProgress = pregnancyHediff.Severity; - ChanceExtension chanceExt = GeneDefOf.rjw_genes_pregnancy_overwrite.GetModExtension(); - float chance = chanceExt != null ? chanceExt.chance : 0.25f; - float replacerFert = replacer.GetStatValueForPawn(StatDefOf.Fertility, replacer); - chance *= replacerFert ; - double roll = (new Random()).NextDouble(); - if (roll < chance) - { - ModLog.Debug($"Pregnancy-Overwrite for {replacer} and {pregnant}."); - float gestationProgress = pregnancyHediff.Severity; + PregnancyUtility.ForceEndPregnancy(pregnant); - PregnancyUtility.ForceEndPregnancy(pregnant); - - PregnancyHelper.StartVanillaPregnancy(pregnant, replacer); - Hediff replacementPregnancyHediff = PregnancyUtility.GetPregnancyHediff(pregnant); - replacementPregnancyHediff.Severity = gestationProgress; - - FactionUtility.HandleFactionGoodWillPenalties(replacer, pregnant, "rjw_genes_GoodwillChangedReason_OverwritePregnancy", FACTION_GOODWILL_CHANGE); - } else - { - ModLog.Debug($"Did not Pregnancy-Overwrite for {replacer} and {pregnant}. Failed: Rolled {roll} <({chanceExt.chance}[XML-Chance] x {replacerFert} [Fert:{replacer}])"); - } + PregnancyHelper.StartVanillaPregnancy(pregnant, replacer); + Hediff replacementPregnancyHediff = PregnancyUtility.GetPregnancyHediff(pregnant); + replacementPregnancyHediff.Severity = gestationProgress; } } diff --git a/Source/Rjw-Genes.csproj b/Source/Rjw-Genes.csproj index dabb692..8354632 100644 --- a/Source/Rjw-Genes.csproj +++ b/Source/Rjw-Genes.csproj @@ -59,7 +59,6 @@ - @@ -106,7 +105,9 @@ - + + +