diff --git a/Common/Assemblies/Rjw-Genes.dll b/Common/Assemblies/Rjw-Genes.dll index fac437a..1312f85 100644 Binary files a/Common/Assemblies/Rjw-Genes.dll and b/Common/Assemblies/Rjw-Genes.dll differ diff --git a/Common/Defs/GeneDefs/GeneDefs_SexSpecial.xml b/Common/Defs/GeneDefs/GeneDefs_SexSpecial.xml index 6cd34be..f575190 100644 --- a/Common/Defs/GeneDefs/GeneDefs_SexSpecial.xml +++ b/Common/Defs/GeneDefs/GeneDefs_SexSpecial.xml @@ -82,11 +82,12 @@ rjw_genes_sexual_mytosis - Carriers of this gene grow more unstable with ongoing multiple orgasms - climaxing in a process of mytosis. This will result in an (biologically) identical pawn and both twins are set in a regenerative state. Also, the pawn can have multiple orgasms: In a state of higher unstableness, they come quicker. + Carriers have malfunctioning regenerative archites that grow more unstable with ongoing multiple orgasms - climaxing in a process of mytosis. This will result in an (biologically) identical pawn and both twins are set in a regenerative state. Also, the pawn can have multiple orgasms: In a state of higher unstableness, they come quicker. UI/Icons/Genes/Gene_PsychicBonding 5 5 -5 + 1 diff --git a/LoadFolders.xml b/LoadFolders.xml index d708230..b53e2d0 100644 --- a/LoadFolders.xml +++ b/LoadFolders.xml @@ -5,5 +5,7 @@
  • Common
  • Mods/NotRaceSupport
  • +
  • Mods/VREwaster
  • + \ No newline at end of file diff --git a/Mods/VREwaster/Defs/GeneDefs_SexSpecial.xml b/Mods/VREwaster/Defs/GeneDefs_SexSpecial.xml new file mode 100644 index 0000000..1e2b0c5 --- /dev/null +++ b/Mods/VREwaster/Defs/GeneDefs_SexSpecial.xml @@ -0,0 +1,20 @@ + + + + + rjw_genes_mytosis_mutation + + + Carriers of this gene grow more unstable with ongoing multiple orgasms in a polluted environnement - climaxing in a process of mytosis. This will result in an (biologically) identical pawn and both twins are set in a regenerative state. Also, the pawn can have multiple orgasms: In a state of higher unstableness, they come quicker. + UI/Icons/Genes/Gene_PsychicBonding + -1 + 1 + -1 + +
  • + UI/Icons/Genes/GeneBackground_PollutionMutation + +
  • +
    +
    +
    \ No newline at end of file diff --git a/Source/Common/patches/PatchGetParents.cs b/Source/Common/patches/PatchGetParents.cs index 9038d17..98f3aff 100644 --- a/Source/Common/patches/PatchGetParents.cs +++ b/Source/Common/patches/PatchGetParents.cs @@ -125,5 +125,43 @@ namespace RJW_Genes } } } + + [HarmonyPrefix] + [HarmonyPatch("SetFather")] + private static bool SetFatherPrefix(Pawn pawn, Pawn newFather) + { + Pawn father = pawn.GetFather(); + if (father != newFather) + { + if (father != null) + { + pawn.relations.RemoveDirectRelation(PawnRelationDefOf.Parent, father); + } + if (newFather != null) + { + pawn.relations.AddDirectRelation(PawnRelationDefOf.Parent, newFather); + } + } + return false; + } + + [HarmonyPrefix] + [HarmonyPatch("SetMother")] + private static bool SetMotherPrefix(Pawn pawn, Pawn newMother) + { + Pawn mother = pawn.GetMother(); + if (mother != newMother) + { + if (mother != null) + { + pawn.relations.RemoveDirectRelation(PawnRelationDefOf.Parent, mother); + } + if (newMother != null) + { + pawn.relations.AddDirectRelation(PawnRelationDefOf.Parent, newMother); + } + } + return false; + } } } diff --git a/Source/GeneDefOf.cs b/Source/GeneDefOf.cs index ef269cf..0f44278 100644 --- a/Source/GeneDefOf.cs +++ b/Source/GeneDefOf.cs @@ -114,6 +114,9 @@ namespace RJW_Genes public static readonly GeneDef rjw_genes_cockeater; public static readonly GeneDef rjw_genes_lifeforce_empath; + //waster + [MayRequire("vanillaracesexpanded.waster")] public static readonly GeneDef rjw_genes_mytosis_mutation; + //Other Defs public static readonly XenotypeDef rjw_genes_succubus; public static readonly DutyDef rjw_genes_flirt; diff --git a/Source/Genes/QuirkPatching/Defs/QirkExtension.cs b/Source/Genes/QuirkPatching/Defs/QirkExtension.cs new file mode 100644 index 0000000..565bdc9 --- /dev/null +++ b/Source/Genes/QuirkPatching/Defs/QirkExtension.cs @@ -0,0 +1,12 @@ +using Verse; +using RimWorld; +using rjw; + +namespace RJW_Genes +{ + public class QirkExtension : DefModExtension + { + public Quirk Satisfiedquirk; + + } +} diff --git a/Source/Genes/QuirkPatching/QuirkPatcher.cs b/Source/Genes/QuirkPatching/QuirkPatcher.cs new file mode 100644 index 0000000..222a9ec --- /dev/null +++ b/Source/Genes/QuirkPatching/QuirkPatcher.cs @@ -0,0 +1,36 @@ +using Verse; +using RimWorld; +using rjw; +using System.Collections.Generic; +using rjw.Modules.Quirks; + +namespace RJW_Genes +{ + public class QuirkPatcher + { + public static void CountSatisfiedPostfix(ref int __result, SexProps props) + { + Pawn pawn = props.pawn; + Pawn partner = props.partner; + int count= 0; + List listquirk= new List(); + + foreach(Gene g in partner.genes.GenesListForReading) { + if (partner.genes.HasActiveGene(g.def)) + { + listquirk.Add(g.def?.GetModExtension().Satisfiedquirk); + } + } + + foreach (Quirk q in listquirk) + { + if (pawn.Has(q)){ + count++; + } + } + __result = __result + count; + return; + } + + } +} diff --git a/Source/Genes/Special/Patches/Patch_OrgasmMytosis.cs b/Source/Genes/Special/Patches/Patch_OrgasmMytosis.cs index 709d05b..eaf45ab 100644 --- a/Source/Genes/Special/Patches/Patch_OrgasmMytosis.cs +++ b/Source/Genes/Special/Patches/Patch_OrgasmMytosis.cs @@ -1,5 +1,6 @@ using HarmonyLib; using RimWorld; +using RimWorld.BaseGen; using RimWorld.QuestGen; using rjw; using rjw.Modules.Shared.Extensions; @@ -9,6 +10,8 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Verse; +using VanillaRacesExpandedWaster; + namespace RJW_Genes { @@ -23,14 +26,26 @@ namespace RJW_Genes { private const float SEVERITY_INCREASE_PER_ORGASM = 0.075f; - - public static void Postfix(JobDriver_Sex __instance) + public static Def mytosis_mutation = DefDatabase.GetNamed("rjw_genes_mytosis_mutation",false); + public static void Postfix(JobDriver_Sex __instance) { Pawn orgasmingPawn = __instance.pawn; - if (orgasmingPawn != null && GeneUtility.HasGeneNullCheck(orgasmingPawn, GeneDefOf.rjw_genes_sexual_mytosis) && ! orgasmingPawn.health.hediffSet.HasHediff(HediffDefOf.rjw_genes_mytosis_shock_hediff)) + bool hasPollutedMytosis = false; + if (mytosis_mutation != null) + { + if (GeneUtility.HasGeneNullCheck(orgasmingPawn, GeneDefOf.rjw_genes_mytosis_mutation)) + { + hasPollutedMytosis = true; + } + } + if (orgasmingPawn != null && (GeneUtility.HasGeneNullCheck(orgasmingPawn, GeneDefOf.rjw_genes_sexual_mytosis) || hasPollutedMytosis) && ! orgasmingPawn.health.hediffSet.HasHediff(HediffDefOf.rjw_genes_mytosis_shock_hediff)) { var mytosisHediff = GetOrgasmMytosisHediff(orgasmingPawn); mytosisHediff.Severity += SEVERITY_INCREASE_PER_ORGASM; + if(hasPollutedMytosis && orgasmingPawn.Spawned && GridsUtility.IsPolluted(orgasmingPawn.Position, orgasmingPawn.Map)) + { + mytosisHediff.Severity -= SEVERITY_INCREASE_PER_ORGASM; + } if (mytosisHediff.Severity >= 1.0) { @@ -295,6 +310,8 @@ namespace RJW_Genes } + + } /* diff --git a/Source/Genes/Special/Patches/Patch_Waster.cs b/Source/Genes/Special/Patches/Patch_Waster.cs new file mode 100644 index 0000000..9c43cbc --- /dev/null +++ b/Source/Genes/Special/Patches/Patch_Waster.cs @@ -0,0 +1,62 @@ +using HarmonyLib; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; +using VanillaRacesExpandedWaster; + +namespace RJW_Genes +{ + + + public static class Patch_Waster + { + public static void Gene_Randomizer_Prefix(Gene_Randomizer __instance) + { + if (Patch_OrgasmMytosis.mytosis_mutation != null) + { + if (!__instance.mutationGenes.Contains(GeneDefOf.rjw_genes_mytosis_mutation)) + { + __instance.mutationGenes.Add(GeneDefOf.rjw_genes_mytosis_mutation); + } + if (!__instance.mutationGenes.Contains(GeneDefOf.rjw_genes_Necro_genitalia)) + { + __instance.mutationGenes.Add(GeneDefOf.rjw_genes_Necro_genitalia); + } + if (!__instance.mutationGenes.Contains(GeneDefOf.rjw_genes_Tentacle_genitalia)) + { + __instance.mutationGenes.Add(GeneDefOf.rjw_genes_Tentacle_genitalia); + } + } + } + public static GeneDef VRE_GauntBody = DefDatabase.GetNamed("VRE_GauntBody", false); + public static void SatisfiesTeratophile_Postfix(ref bool __result, Pawn partner) + { + if (!__result) + { + ModLog.Message("check 1"); + if (VRE_GauntBody != null) + { + ModLog.Message("check 2"); + if (partner.genes.HasActiveGene(VRE_GauntBody)) + { + ModLog.Message("check 3"); + __result = true; + return; + } + } + + + } + } + + + + + } + +} diff --git a/Source/HarmonyInit.cs b/Source/HarmonyInit.cs index c2cba10..b693e5d 100644 --- a/Source/HarmonyInit.cs +++ b/Source/HarmonyInit.cs @@ -4,6 +4,7 @@ using System; using rjw; using RJWLoveFeeding; using RimWorld; +using System.Linq; namespace RJW_Genes { @@ -22,32 +23,41 @@ namespace RJW_Genes { harmony.Patch(typeof(SexUtility).GetMethod("ProcessSex"), new HarmonyMethod(typeof(LustFeeding), "Postfix", null)); } - // Non-rapist would_rape bypass for limbic stimulator harmony.Patch(AccessTools.Method(typeof(SexAppraiser), nameof(SexAppraiser.would_rape)), postfix: new HarmonyMethod(typeof(PatchImplants), nameof(PatchImplants.would_rape_PostFix))); - - // Non-rapist is_rapist bypass for limbic stimulator harmony.Patch(AccessTools.Method(typeof(xxx), nameof(xxx.is_rapist)), postfix: new HarmonyMethod(typeof(PatchImplants), nameof(PatchImplants.is_rapist_PostFix))); - - // Non-Rapist trait rape thoughts harmony.Patch(AccessTools.Method(typeof(AfterSexUtility), nameof(AfterSexUtility.think_about_sex_Rapist)), postfix: new HarmonyMethod(typeof(PatchImplants), nameof(PatchImplants.think_about_sex_Rapist_PostFix))); - - // Bioscaffold double gestation speed tick harmony.Patch(AccessTools.Method(typeof(PawnUtility), nameof(PawnUtility.BodyResourceGrowthSpeed)), postfix: new HarmonyMethod(typeof(PatchImplants), nameof(PatchImplants.MultiplyPregnancy))); - - // Hediff_Labor state capture harmony.Patch(AccessTools.Method(typeof(Hediff_Labor), nameof(Hediff_Labor.PostRemoved)), postfix: new HarmonyMethod(typeof(PatchLitteredBirth), nameof(PatchLitteredBirth.Hediff_Labor_PostRemovedPostFix))); - - // OvaryAgitator/Gene_LitteredBirths multibirth logic harmony.Patch(AccessTools.Method(typeof(Hediff_LaborPushing), nameof(Hediff_LaborPushing.PostRemoved)), postfix: new HarmonyMethod(typeof(PatchLitteredBirth), nameof(PatchLitteredBirth.Hediff_LaborPushing_PostRemovedPostFix))); - // Patch Licentia, if Licentia exists - // Logic & Explanation taken from https://rimworldwiki.com/wiki/Modding_Tutorials/Compatibility_with_DLLs - // Adjusted to use ModsConfig (which makes it work, the example above does not run out of the box) + + harmony.Patch(AccessTools.Method(typeof(Quirk), nameof(Quirk.CountSatisfiedQuirks)), + postfix: new HarmonyMethod(typeof(QuirkPatcher), nameof(QuirkPatcher.CountSatisfiedPostfix))); + + Type Gene_Randomizer_Instance = null; + try + { + Gene_Randomizer_Instance = (from asm in AppDomain.CurrentDomain.GetAssemblies() + from type in asm.GetTypes() + where type.IsClass && type.Name == "Gene_Randomizer" + select type).Single(); + } + catch (Exception ex) { } + Def mytosis_mutation = DefDatabase.GetNamed("rjw_genes_mytosis_mutation", false); + if (mytosis_mutation != null) + { + harmony.Patch(AccessTools.Method(Gene_Randomizer_Instance, "PostAdd"), + prefix: new HarmonyMethod(typeof(Patch_Waster), nameof(Patch_Waster.Gene_Randomizer_Prefix))); + harmony.Patch(AccessTools.Method(typeof(Quirk), nameof(Quirk.SatisfiesTeratophile)), + postfix: new HarmonyMethod(typeof(Patch_Waster), nameof(Patch_Waster.SatisfiesTeratophile_Postfix))); + } + + } } diff --git a/Source/RJW.dll b/Source/RJW.dll deleted file mode 100644 index c07fda1..0000000 Binary files a/Source/RJW.dll and /dev/null differ diff --git a/Source/RJWSexperience.dll b/Source/RJWSexperience.dll deleted file mode 100644 index 533e46c..0000000 Binary files a/Source/RJWSexperience.dll and /dev/null differ diff --git a/Source/Rjw-Genes.csproj b/Source/Rjw-Genes.csproj index 757086f..c821352 100644 --- a/Source/Rjw-Genes.csproj +++ b/Source/Rjw-Genes.csproj @@ -161,6 +161,8 @@ + + @@ -168,6 +170,7 @@ + @@ -203,14 +206,11 @@ ..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll False - - False + ..\..\rjw\1.5\Assemblies\RJW.dll - False - ..\..\rjw-sexperience\1.5\Assemblies\RJWSexperience.dll - False + ..\..\rjw-sexperience-master\1.5\Assemblies\RJWSexperience.dll @@ -227,9 +227,15 @@ ..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll False + + ..\..\..\..\..\workshop\content\294100\2983471725\1.5\Assemblies\VanillaRacesExpanded-Waster.dll + + + + \ No newline at end of file