diff --git a/CHANGELOG.md b/CHANGELOG.md index fce2807..22ede1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +# 1.1.0 (2023-xx-xx) + +Features: + +- Succubus (see below) +- Orgasm Rush got a Hediff +- Unbreakable Gene +- Age-Transfer and Youth-Fountain per Sex Gene +- Balancing some Genes by changing metabolism and complexity + +Succubus: + +Fixes: + +- Issue with Breast-Size (#8) fixed by lowercasing breast-match (Shabakur) +- Error on Game Load when Licentia Genes are tried to be added to Xenotypes for players without Licentia (#5) + # 1.0.1 (2022-12-20) - Fix issue with Orgasm Rush throwing an Error on Animal Orgasm (Thanks Shabakur) diff --git a/Common/Defs/Genes/GeneDefs_Breeding.xml b/Common/Defs/Genes/GeneDefs_Breeding.xml index fa65c52..bd201cc 100644 --- a/Common/Defs/Genes/GeneDefs_Breeding.xml +++ b/Common/Defs/Genes/GeneDefs_Breeding.xml @@ -8,7 +8,9 @@ Pawns with this gene are able to birth mechanoids unharmed. World/WorldObjects/Expanding/Mechanoids 51 - rjw_genes_breeding + rjw_genes_breeding + 1 + -1 @@ -17,7 +19,9 @@ Pawns with this gene are able to hold more insect eggs. Genes/Icons/More_Egg_Space 52 - rjw_genes_breeding + rjw_genes_breeding + 1 + -1 @@ -27,6 +31,8 @@ World/WorldObjects/Expanding/Insects 53 rjw_genes_breeding + 1 + -1 diff --git a/Common/Defs/Genes/GeneDefs_Damage.xml b/Common/Defs/Genes/GeneDefs_Damage.xml index b3c21ef..f2b0e07 100644 --- a/Common/Defs/Genes/GeneDefs_Damage.xml +++ b/Common/Defs/Genes/GeneDefs_Damage.xml @@ -8,7 +8,25 @@ This Xenotype cannot get stretched by huge penetrators. Genes/Icons/Elasticity RJW_Genes.Gene_Elasticity + -1 + 1 1 + + rjw_genes_unbreakable + + rjw_genes_damage + This Gene makes the Carrier unable to get mood or social penalties from being raped and they cannot be broken for a long period of time. + UI/Icons/Rituals/TrialDefend + 2 + -1 + 1 + + RJW_Genes.Gene_Unbreakable + +
  • FeelingBroken
  • +
    +
    + \ No newline at end of file diff --git a/Common/Defs/Genes/GeneDefs_Reproduction.xml b/Common/Defs/Genes/GeneDefs_Reproduction.xml index ef348fd..614bb38 100644 --- a/Common/Defs/Genes/GeneDefs_Reproduction.xml +++ b/Common/Defs/Genes/GeneDefs_Reproduction.xml @@ -21,6 +21,7 @@ Reproduction Xenotypes with this Gene are Rapists. Genes/Icons/Rape + 1 2
  • diff --git a/Common/Defs/Genes/GeneDefs_SexSpecial.xml b/Common/Defs/Genes/GeneDefs_SexSpecial.xml index 74881d7..86666d7 100644 --- a/Common/Defs/Genes/GeneDefs_SexSpecial.xml +++ b/Common/Defs/Genes/GeneDefs_SexSpecial.xml @@ -6,6 +6,7 @@ rjw_genes_special On Orgasm, carriers of this gene get a boost in activity. (rest-need is partially filled) 1 + -2 UI/Memes/FleshPurity 1 @@ -14,11 +15,34 @@ rjw_genes_aphrodisiac_pheromones rjw_genes_special - RJW_Genes.Gene_Aphrodisiac_Pheromones + RJW_Genes.Gene_Aphrodisiac_Pheromones Carriers of this gene create an aphrodisiac pheremones which induce an increased sexdrive to others nearby, increasing in strength as the sexdrive of the carrier increases.\n\nCarriers are unaffected by others with this gene. Things/Mote/Heart 2 - 1 - 1 + 1 + 1 + + + + + rjw_genes_youth_fountain + + rjw_genes_special + Having sex with a carrier of this gene makes the partner slightly younger. (Partner stays adult) + 2 + -2 + UI/Ideoligions/FireLeaves + 2 + + + + rjw_genes_sex_age_drain + + rjw_genes_special + Having sex transfers some of the partners life-time to themselves. (Pawn stays adult) + 2 + -1 + UI/Icons/ColonistBar/Idle + 3 \ No newline at end of file diff --git a/Common/Defs/HediffDefs/Hediffs_OrgasmRush.xml b/Common/Defs/HediffDefs/Hediffs_OrgasmRush.xml new file mode 100644 index 0000000..f68663f --- /dev/null +++ b/Common/Defs/HediffDefs/Hediffs_OrgasmRush.xml @@ -0,0 +1,78 @@ + + + + + rjw_genes_orgasm_rush_hediff + HediffWithComps + + Xenotypes with this Gene are pushed beyond normal limits when they have an orgasm. + (240,200,110) + false + 1.0 + false + false + +
  • + -0.75 +
  • + + +
  • + + + 4 + 4 + + +
  • + Consciousness + 0.05 +
  • + + +
  • + + 0.4 + + 8 + 8 + + +
  • + Moving + 0.08 +
  • +
  • + Consciousness + 0.08 +
  • + + +
  • + + 0.7 + + 10 + 10 + + +
  • + Moving + 0.1 +
  • +
  • + Consciousness + 0.1 +
  • +
  • + BloodPumping + 0.1 +
  • + + + +
    + + + + diff --git a/Common/Patches/Genes/Patch_Unbreakable.xml b/Common/Patches/Genes/Patch_Unbreakable.xml new file mode 100644 index 0000000..a2d674a --- /dev/null +++ b/Common/Patches/Genes/Patch_Unbreakable.xml @@ -0,0 +1,68 @@ + + + + + Defs/ThoughtDef[defName="FeelingBroken"] + + +
  • rjw_genes_unbreakable
  • +
    +
    +
    + + + + Defs/ThoughtDef[defName="GotRaped"] + + +
  • rjw_genes_unbreakable
  • +
    +
    +
    + + + Defs/ThoughtDef[defName="GotAnalRaped"] + + +
  • rjw_genes_unbreakable
  • +
    +
    +
    + + + Defs/ThoughtDef[defName="GotAnalRapedByFemale"] + + +
  • rjw_genes_unbreakable
  • +
    +
    +
    + + + Defs/ThoughtDef[defName="GotRapedUnconscious"] + + +
  • rjw_genes_unbreakable
  • +
    +
    +
    + + + Defs/ThoughtDef[defName="HateMyRapist"] + + +
  • rjw_genes_unbreakable
  • +
    +
    +
    + + + Defs/ThoughtDef[defName="AllowedMeToGetRaped"] + + +
  • rjw_genes_unbreakable
  • +
    +
    +
    + +
    \ No newline at end of file diff --git a/Common/Patches/Xenotypes/GenitaliaUpdate.xml b/Common/Patches/Xenotypes/GenitaliaUpdate.xml index ac8754d..fd6e360 100644 --- a/Common/Patches/Xenotypes/GenitaliaUpdate.xml +++ b/Common/Patches/Xenotypes/GenitaliaUpdate.xml @@ -1,44 +1,6 @@ - - - Defs/XenotypeDef[defName="Neanderthal"]/genes @@ -77,16 +39,18 @@ + - -
  • RimJobWorld - Licentia Labs
  • -
    - - Defs/XenotypeDef[defName="Highmate"]/genes - -
  • rjw_genes_likes_cumflation
  • -
    -
    + +
  • LustLicentia.RJWLabs
  • +
    + + Defs/XenotypeDef[defName="Highmate"]/genes + +
  • rjw_genes_likes_cumflation
  • +
    +
    diff --git a/Source/Animal_Inheritance/InheritanceUtility.cs b/Source/Animal_Inheritance/InheritanceUtility.cs index ee5c664..d860b14 100644 --- a/Source/Animal_Inheritance/InheritanceUtility.cs +++ b/Source/Animal_Inheritance/InheritanceUtility.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using Verse; using RimWorld; +using rjw; namespace RJW_BGS { @@ -120,5 +121,22 @@ namespace RJW_BGS } } + /// + /// Used only for debugging, to see what you loaded and how it looks. + /// + private static void logAllFoundRaceGroupGenes() + { + foreach (RaceGroupDef def in DefDatabase.AllDefs) + { + Log.Message("defName = " + def.defName); + if (def.raceNames != null) + { + foreach (string race in def.raceNames) + { + Log.Message(race); + } + } + } + } } } diff --git a/Source/Animal_Inheritance/PatchRJWBestialityPregnancyUtility.cs b/Source/Animal_Inheritance/PatchRJWBestialityPregnancyUtility.cs index 8160c8c..31f9bfd 100644 --- a/Source/Animal_Inheritance/PatchRJWBestialityPregnancyUtility.cs +++ b/Source/Animal_Inheritance/PatchRJWBestialityPregnancyUtility.cs @@ -29,20 +29,21 @@ namespace RJW_BGS baby.genes = new Pawn_GeneTracker(baby); } + //Remove the hair and skin genes pawns always start with, should get correct ones from human parent anyway. for (int i = baby.genes.Endogenes.Count - 1; i >= 0; i--) { baby.genes.RemoveGene(baby.genes.Endogenes[i]); } - List genes = PregnancyUtility.GetInheritedGenes(dad, mother); + List humangenes = PregnancyUtility.GetInheritedGenes(dad, mother); List beastgenes = InheritanceUtility.AnimalInheritedGenes(dad, mother); InheritanceUtility.AddGenes(baby, beastgenes); - InheritanceUtility.AddGenes(baby, genes); - //foreach (GeneDef gene in genes) - //{ - // baby.genes.AddGene(gene, false); - //} + InheritanceUtility.AddGenes(baby, humangenes); + + // The mix-breed babies should be labelled hybrids + baby.genes.hybrid = true; + baby.genes.xenotypeName = "Hybrid"; } } } diff --git a/Source/GeneDefOf.cs b/Source/GeneDefOf.cs index b9ed677..2bd18c2 100644 --- a/Source/GeneDefOf.cs +++ b/Source/GeneDefOf.cs @@ -67,6 +67,7 @@ namespace RJW_Genes // Damage & Side Effects [MayRequire("LustLicentia.RJWLabs")] public static readonly GeneDef rjw_genes_elasticity; + public static readonly GeneDef rjw_genes_unbreakable; // Special public static readonly GeneDef rjw_genes_orgasm_rush; @@ -81,5 +82,10 @@ namespace RJW_Genes // Cosmetic public static readonly GeneDef rjw_genes_succubus_tail; + 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; } } diff --git a/Source/Genes/Breeding/Patch_EggFertilization.cs b/Source/Genes/Breeding/Patch_EggFertilization.cs index 46ec598..d2f2dcf 100644 --- a/Source/Genes/Breeding/Patch_EggFertilization.cs +++ b/Source/Genes/Breeding/Patch_EggFertilization.cs @@ -14,9 +14,8 @@ namespace RJW_Genes /// Normal Egg-Pregnancy logic is in https://gitgud.io/Ed86/rjw/-/blob/master/1.4/Source/Modules/Pregnancy/Pregnancy_Helper.cs /// [HarmonyPatch(typeof(SexUtility), "Aftersex")] - static class PatchEggFertilizationHelper + static class Patch_EggFertilization { - [HarmonyTranspiler] public static void Postfix(SexProps props) { // Only Fertilize on vaginal / anal sex @@ -59,7 +58,7 @@ namespace RJW_Genes } - private static Boolean canDoEggFertilization(Pawn a, Pawn b) + private static bool canDoEggFertilization(Pawn a, Pawn b) { // No Partner / Other Errors diff --git a/Source/Genes/Damage/Gene_Elasticity.cs b/Source/Genes/Damage/Gene_Elasticity.cs index 603a18d..5d92b51 100644 --- a/Source/Genes/Damage/Gene_Elasticity.cs +++ b/Source/Genes/Damage/Gene_Elasticity.cs @@ -10,8 +10,6 @@ namespace RJW_Genes /// public class Gene_Elasticity : Gene { - - private int ticksToReset = RESET_INTERVAL; private const int RESET_INTERVAL = 60000; // 60k should be 1 day public override void PostAdd() @@ -26,11 +24,8 @@ namespace RJW_Genes public override void Tick() { base.Tick(); - --this.ticksToReset; - if (this.ticksToReset > 0) - return; - this.ticksToReset = RESET_INTERVAL; - ResetSeverity(); + if (pawn.IsHashIntervalTick(RESET_INTERVAL)) + ResetSeverity(); } public override void PostRemove() diff --git a/Source/Genes/Damage/Gene_Unbreakable.cs b/Source/Genes/Damage/Gene_Unbreakable.cs new file mode 100644 index 0000000..2ebdad3 --- /dev/null +++ b/Source/Genes/Damage/Gene_Unbreakable.cs @@ -0,0 +1,41 @@ +using LicentiaLabs; +using rjw; +using Verse; + +namespace RJW_Genes +{ + /// + /// This Gene regularly removes the broken hediff of a pawn. + /// Blocking / Removing thoughts are done in an XML Patch. + /// + public class Gene_Unbreakable : Gene + { + /// DevNote: I first tried to Harmony-Postfix the AfterSexUtility and never add it - but that failed? + + private const int RESET_INTERVAL = 30000; // 30k should be 0.5 day + public override void PostAdd() + { + base.PostAdd(); + RemoveBrokenHediff(); + } + + public override void Tick() + { + base.Tick(); + if (pawn.IsHashIntervalTick(RESET_INTERVAL)) + RemoveBrokenHediff(); + } + + + + private void RemoveBrokenHediff() + { + // Clean-Up of existing feeling brokens + var maybeBrokenHediff = pawn.health.hediffSet.GetFirstHediffOfDef(xxx.feelingBroken); + if (maybeBrokenHediff != null) + { + pawn.health.RemoveHediff(maybeBrokenHediff); + } + } + } +} diff --git a/Source/Genes/GeneUtility.cs b/Source/Genes/GeneUtility.cs index 9ae4711..3a81943 100644 --- a/Source/Genes/GeneUtility.cs +++ b/Source/Genes/GeneUtility.cs @@ -86,6 +86,24 @@ namespace RJW_Genes return pawn.genes.HasGene(GeneDefOf.rjw_genes_insectincubator); } + public static bool IsYouthFountain(Pawn pawn) + { + if (pawn.genes == null) + { + return false; + } + return pawn.genes.HasGene(GeneDefOf.rjw_genes_youth_fountain); + } + + internal static bool IsAgeDrainer(Pawn pawn) + { + if (pawn.genes == null) + { + return false; + } + return pawn.genes.HasGene(GeneDefOf.rjw_genes_sex_age_drain); + } + public static bool IsInsectBreeder(Pawn pawn) { if (pawn.genes == null) @@ -139,5 +157,14 @@ namespace RJW_Genes } return pawn.genes.HasGene(GeneDefOf.rjw_genes_pussyhealer); } + + public static bool IsUnbreakable(Pawn pawn) + { + if (pawn.genes == null) + { + return false; + } + return pawn.genes.HasGene(GeneDefOf.rjw_genes_unbreakable); + } } } \ No newline at end of file diff --git a/Source/Genes/Special/Patch_AgeDrain.cs b/Source/Genes/Special/Patch_AgeDrain.cs new file mode 100644 index 0000000..981f483 --- /dev/null +++ b/Source/Genes/Special/Patch_AgeDrain.cs @@ -0,0 +1,38 @@ +using HarmonyLib; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RJW_Genes.Genes.Special +{ + [HarmonyPatch(typeof(SexUtility), "Aftersex")] + public static class Patch_AgeDrain + { + + const long AGE_TRANSFERED = 120000; // 120k == 2 days + + // Comment Below in for debugging, changes years + // const long AGE_TRANSFERED = 6000000; // 6000k == 100 days + public static void Postfix(SexProps props) + { + if (props == null || props.pawn == null || props.partner == null || props.partner.IsAnimal() ) + { + return; + } + if (GeneUtility.IsAgeDrainer(props.pawn)) + { + var pawnAge = props.pawn.ageTracker.AgeBiologicalTicks; + var pawnMinAge = props.pawn.ageTracker.AdultMinAgeTicks; + + // Make Partner older + props.partner.ageTracker.AgeBiologicalTicks += AGE_TRANSFERED; + // Make Pawn younger + props.pawn.ageTracker.AgeBiologicalTicks = Math.Max(pawnMinAge, pawnAge - AGE_TRANSFERED); + } + + } + } +} diff --git a/Source/Genes/Special/Patch_OrgasmRush.cs b/Source/Genes/Special/Patch_OrgasmRush.cs index 0b881f2..fefcb7a 100644 --- a/Source/Genes/Special/Patch_OrgasmRush.cs +++ b/Source/Genes/Special/Patch_OrgasmRush.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Verse; namespace RJW_Genes { @@ -14,6 +15,7 @@ namespace RJW_Genes { private const float REST_INCREASE = 0.05f; + private const float ORGASMS_NEEDED_FOR_SUPERCHARGE = 3.0f; public static void Postfix(SexProps props) { @@ -23,9 +25,37 @@ namespace RJW_Genes if (props.pawn.genes != null && props.pawn.genes.HasGene(GeneDefOf.rjw_genes_orgasm_rush)) { - props.pawn.needs.rest.CurLevel += REST_INCREASE; - } + + // Pump up Wake-Ness + if (props.pawn.needs.rest != null) + props.pawn.needs.rest.CurLevel += REST_INCREASE; + + // Add or Update Hediff for Orgasm Rush + Hediff rush = GetOrgasmRushHediff(props.pawn); + float added_severity = props.orgasms / ORGASMS_NEEDED_FOR_SUPERCHARGE; + rush.Severity += added_severity; + // Severity should be capped to 1 by the XML logic + } + + } + + /// + /// Helps to get the Orgasm Rush Hediff of a Pawn. If it does not exist, one is added. + /// + /// The pawn that had the orgasm, for which a hediff is looked up or created. + /// + public static Hediff GetOrgasmRushHediff(Pawn orgasmed) + { + Hediff orgasmRushHediff = orgasmed.health.hediffSet.GetFirstHediffOfDef(GeneDefOf.rjw_genes_orgasm_rush_hediff); + if (orgasmRushHediff == null) + { + orgasmRushHediff = HediffMaker.MakeHediff(GeneDefOf.rjw_genes_orgasm_rush_hediff, orgasmed); + orgasmRushHediff.Severity = 0; + orgasmed.health.AddHediff(orgasmRushHediff); + } + return orgasmRushHediff; } } + } diff --git a/Source/Genes/Special/Patch_Youth_Fountain.cs b/Source/Genes/Special/Patch_Youth_Fountain.cs new file mode 100644 index 0000000..f2c7e13 --- /dev/null +++ b/Source/Genes/Special/Patch_Youth_Fountain.cs @@ -0,0 +1,36 @@ +using HarmonyLib; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RJW_Genes.Genes.Special +{ + [HarmonyPatch(typeof(SexUtility), "Aftersex")] + public static class Patch_Youth_Fountain + { + + const long AGE_REDUCTION = 60000; // 60k == 1 day + + // Comment Below in for debugging + //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()) + { + return; + } + 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); + } + + } + + } +} diff --git a/Source/Rjw-Genes.csproj b/Source/Rjw-Genes.csproj index 4241be9..be3ba24 100644 --- a/Source/Rjw-Genes.csproj +++ b/Source/Rjw-Genes.csproj @@ -27,16 +27,14 @@ False - ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll - False + ..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\licentia-labs-master\Assemblies\LicentiaLabs.dll False - ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\rjw-master\1.4\Assemblies\RJW.dll - False + ..\..\rjw\1.4\Assemblies\RJW.dll @@ -51,12 +49,14 @@ - ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll + ..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll False - ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll - False + ..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll + + + ..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll