mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Interrim Documentation Update
This commit is contained in:
parent
147892ea18
commit
f51a85f191
10 changed files with 141 additions and 119 deletions
26
CHANGELOG.md
26
CHANGELOG.md
|
@ -1,3 +1,29 @@
|
|||
# 2.1.0
|
||||
|
||||
**Additions**:
|
||||
|
||||
- Human + Animal Pregnancy can (if enabled in settings) produce Vanilla Expanded Genetics Hybrids. Thanks to @Jaaldabaoth (#88)
|
||||
- Xenogenes for "Big and Small" Xenotypes thanks to @Flock-of-birds (#83)
|
||||
- Xenogenes for "Biotech Expansion Mammalia" and "Biotech Expansion - Mythic" thanks to @Ohreallyow (#86)
|
||||
- Xenogenes update for (many?) "Vanilla Races Expanded (VRE)" Mods - Thanks to @Jaaldabaoth (#84 / #88 )
|
||||
- Genes can now fulfill RJW Quirks, configurable in XML. Thanks to @Jaaldabaoth (#84 / #88)
|
||||
- "Genes" to support VRE Androids having Mechanical Genitalia. Thanks to @Jaaldabaoth (#88)
|
||||
- "Curiosity Genes" alongside other Curiosities from VRE. Thanks to @Jaaldabaoth (#88)
|
||||
- Support for many VE-Genetics Animals into the Animal-Framework. Thanks to @Jaaldabaoth (#88)
|
||||
|
||||
**Fixes**:
|
||||
|
||||
- Lower-casing most labels to fit rimworld standards, thanks to @Flock-of-birds (#83)
|
||||
- X-Gender-Only Genes leave / re-add artificial genitalia. Thanks to @Jaaldabaoth (#84 / #88)
|
||||
|
||||
|
||||
**Changes**:
|
||||
|
||||
- Minified some Race-Patches, thanks to @Flock-of-birds (#83)
|
||||
- XML-Genitalia-Genes can now also provide Breasts. Thanks to @Jaaldabaoth (#84 / #88)
|
||||
- "Wasters" can have Orgasmic Mytosis, but need a special "polluted" version. Thanks to @Jaaldabaoth (#84 / #88)
|
||||
|
||||
|
||||
# 2.0.0
|
||||
|
||||
**Summary**:
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Defs>
|
||||
|
||||
|
||||
|
||||
|
||||
<HediffDef>
|
||||
<defName>RJWGenes_AnimalControlHediff</defName>
|
||||
<defName>rjw_genes_animal_control_hediff</defName>
|
||||
<label>part human</label>
|
||||
<description>This creature is more controlable with a natural huamn part.</description>
|
||||
<description>This creature is more controlable with a natural human part.</description>
|
||||
<hediffClass>HediffWithComps</hediffClass>
|
||||
<defaultLabelColor>(0.9, 1.0, 0.35)</defaultLabelColor>
|
||||
<initialSeverity>1</initialSeverity>
|
||||
|
@ -17,6 +15,5 @@
|
|||
</comps>
|
||||
<isBad>false</isBad>
|
||||
</HediffDef>
|
||||
|
||||
|
||||
</Defs>
|
|
@ -7,6 +7,7 @@ using Verse;
|
|||
using UnityEngine;
|
||||
using HarmonyLib;
|
||||
using rjw;
|
||||
using RimWorld;
|
||||
|
||||
namespace RJW_BGS
|
||||
{
|
||||
|
@ -83,12 +84,14 @@ namespace RJW_BGS
|
|||
"Cobra",
|
||||
"Tortoise"
|
||||
};
|
||||
public static HediffDef controler = DefDatabase<HediffDef>.GetNamed("RJWGenes_AnimalControlHediff", true);
|
||||
|
||||
//public static HediffDef controler = DefDatabase<HediffDef>.GetNamed("RJWGenes_AnimalControlHediff", true);
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch("GenerateBabies")]
|
||||
public static void addHedif (Hediff_BasePregnancy __instance)
|
||||
public static void AddComfortableWithHumansHediff (Hediff_BasePregnancy __instance)
|
||||
{
|
||||
if (controler == null) return;
|
||||
//if (controler == null) return;
|
||||
|
||||
foreach (Pawn p in __instance.babies)
|
||||
{
|
||||
|
@ -96,7 +99,7 @@ namespace RJW_BGS
|
|||
{
|
||||
if (racesgen1.Contains(p.kindDef.race.defName))
|
||||
{
|
||||
p.health.AddHediff(controler);
|
||||
p.health.AddHediff(RJW_Genes.HediffDefOf.rjw_genes_animal_control_hediff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -106,3 +109,26 @@ namespace RJW_BGS
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Error Received on 04.06.2024
|
||||
* Failed to find Verse.HediffDef named RJWGenes_AnimalControlHediff. There are 446 defs of this type loaded.
|
||||
UnityEngine.StackTraceUtility:ExtractStackTrace ()
|
||||
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch1 (string)
|
||||
Verse.DefDatabase`1<Verse.HediffDef>:GetNamed (string,bool)
|
||||
RJW_BGS.BasePregnancyPatcher:.cctor ()
|
||||
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:rjw.PregnancyHelper.AddPregnancyHediff_Patch1 (Verse.Pawn,Verse.Pawn)
|
||||
rjw.PregnancyHelper:DoImpregnate (Verse.Pawn,Verse.Pawn)
|
||||
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:rjw.PregnancyHelper.impregnate_Patch1 (rjw.SexProps)
|
||||
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:rjw.JobDriver_Sex.Orgasm_Patch1 (rjw.JobDriver_Sex)
|
||||
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:rjw.JobDriver_Sex.SexTick_Patch2 (rjw.JobDriver_Sex,Verse.Pawn,Verse.Thing,bool,bool)
|
||||
rjw.JobDriver_Mating/<>c__DisplayClass1_0:<MakeNewToils>b__5 ()
|
||||
Verse.AI.JobDriver:DriverTick ()
|
||||
Verse.AI.Pawn_JobTracker:JobTrackerTick ()
|
||||
Verse.Pawn:Tick ()
|
||||
Verse.TickList:Tick ()
|
||||
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.TickManager.DoSingleTick_Patch2 (Verse.TickManager)
|
||||
Verse.TickManager:TickManagerUpdate ()
|
||||
Verse.Game:UpdatePlay ()
|
||||
Verse.Root_Play:Update ()
|
||||
*/
|
|
@ -1,60 +0,0 @@
|
|||
using Verse;
|
||||
using RimWorld;
|
||||
using rjw;
|
||||
using System.Collections.Generic;
|
||||
using rjw.Modules.Quirks;
|
||||
using System;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class QuirkPatcher
|
||||
{
|
||||
public static void CountSatisfiedPostfix(ref int __result, SexProps props)
|
||||
{
|
||||
Pawn pawn = props.pawn;
|
||||
Pawn partner = props.partner;
|
||||
if(pawn!=null && partner != null)
|
||||
{
|
||||
if(!pawn.IsHuman()||!partner.IsHuman())
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
int count = -1;
|
||||
List<string> listquirk = new List<string>();
|
||||
string s;
|
||||
foreach (Gene g in partner.genes.GenesListForReading)
|
||||
{
|
||||
if (partner.genes.HasActiveGene(g.def))
|
||||
{
|
||||
s = null;
|
||||
s = g.def?.GetModExtension<QirkExtension>()?.Satisfiedquirk;
|
||||
if (!string.IsNullOrEmpty(s))
|
||||
{
|
||||
listquirk.Add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Quirk q in Quirk.All)
|
||||
{
|
||||
if (pawn.Has(q))
|
||||
{
|
||||
|
||||
foreach (string s2 in listquirk)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(s2))
|
||||
if (q.LocaliztionKey==s2)
|
||||
{
|
||||
count++;
|
||||
Quirk.AddThought(pawn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(count>0)__result = __result + count;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -7,7 +7,6 @@ namespace RJW_Genes
|
|||
{
|
||||
public class QirkExtension : DefModExtension
|
||||
{
|
||||
public String Satisfiedquirk;
|
||||
|
||||
public string Satisfiedquirk;
|
||||
}
|
||||
}
|
64
Source/Genes/Quirks/QuirkPatcher.cs
Normal file
64
Source/Genes/Quirks/QuirkPatcher.cs
Normal file
|
@ -0,0 +1,64 @@
|
|||
using Verse;
|
||||
using RimWorld;
|
||||
using rjw;
|
||||
using System.Collections.Generic;
|
||||
using rjw.Modules.Quirks;
|
||||
using System;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class QuirkPatcher
|
||||
{
|
||||
/// <summary>
|
||||
/// This Patch is applied after the quirk-satisfaction and checks
|
||||
/// a) which quirks can the sex-partner satisfy?
|
||||
/// b) which of the quirks has the pawn?
|
||||
///
|
||||
/// The result of the Satisfied is an integer, based on the original framework.
|
||||
/// The framework "just checks" the number of satisfied quirks - we increase this number with this postfix.
|
||||
/// </summary>
|
||||
public static void CountSatisfiedPostfix(ref int __result, SexProps props)
|
||||
{
|
||||
if (props == null) return;
|
||||
Pawn pawn = props.pawn;
|
||||
Pawn partner = props.partner;
|
||||
if (partner == null || pawn == null) return;
|
||||
if(!pawn.IsHuman()||!partner.IsHuman()) return;
|
||||
|
||||
List<string> potentiallySatisfiedQuirks = new List<string>();
|
||||
foreach (Gene gene in partner.genes.GenesListForReading)
|
||||
{
|
||||
if (partner.genes.HasActiveGene(gene.def))
|
||||
{
|
||||
string satisfiable_quirk = gene.def?.GetModExtension<QirkExtension>()?.Satisfiedquirk;
|
||||
if (!string.IsNullOrEmpty(satisfiable_quirk))
|
||||
{
|
||||
potentiallySatisfiedQuirks.Add(satisfiable_quirk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int QuirksSatisfiedByGenes = -1;
|
||||
|
||||
foreach (Quirk quirk in Quirk.All)
|
||||
{
|
||||
if (pawn.Has(quirk))
|
||||
{
|
||||
foreach (string satisfiableQuirk in potentiallySatisfiedQuirks)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(satisfiableQuirk) && quirk.LocaliztionKey == satisfiableQuirk)
|
||||
{
|
||||
QuirksSatisfiedByGenes++;
|
||||
Quirk.AddThought(pawn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(QuirksSatisfiedByGenes > 0)
|
||||
__result = __result + QuirksSatisfiedByGenes;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -171,7 +171,6 @@ namespace RJW_Genes
|
|||
private static Pawn_GeneTracker CopyGeneTracker(Pawn toCopyTo, Pawn_GeneTracker toCopyFrom)
|
||||
{
|
||||
var tracker = new Pawn_GeneTracker(toCopyTo);
|
||||
|
||||
// Due to Overwrite logics, we first add Endogenes and then a second pass on xenogenes
|
||||
|
||||
// Pass 1: Endogenes
|
||||
|
@ -190,12 +189,6 @@ namespace RJW_Genes
|
|||
}
|
||||
|
||||
tracker.Reset();
|
||||
var skin = tracker.GetMelaninGene();
|
||||
var hair = tracker.GetHairColorGene();
|
||||
|
||||
//ModLog.Message($"{toCopyTo} had Skin {skin.defName} and {hair.defName} as colour-genes");
|
||||
|
||||
|
||||
return tracker;
|
||||
}
|
||||
|
||||
|
@ -302,9 +295,6 @@ namespace RJW_Genes
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -328,5 +318,4 @@ Verse.TickList:Tick ()
|
|||
Verse.TickManager:TickManagerUpdate ()
|
||||
Verse.Game:UpdatePlay ()
|
||||
Verse.Root_Play:Update ()
|
||||
|
||||
*/
|
|
@ -11,13 +11,13 @@ namespace RJW_Genes
|
|||
[StaticConstructorOnStartup]
|
||||
internal static class HarmonyInit
|
||||
{
|
||||
public static Type Gene_Randomizer_Instance = null;
|
||||
|
||||
static HarmonyInit()
|
||||
{
|
||||
Harmony harmony = new Harmony("rjw_genes");
|
||||
|
||||
var original = typeof(Hediff_Pregnant).GetMethod("Tick");
|
||||
harmony.Unpatch(original, HarmonyPatchType.Prefix, "rjw");
|
||||
var RJW_Pregnancy_Tick_Prefixes = typeof(Hediff_Pregnant).GetMethod("Tick");
|
||||
harmony.Unpatch(RJW_Pregnancy_Tick_Prefixes, HarmonyPatchType.Prefix, "rjw");
|
||||
|
||||
harmony.PatchAll();
|
||||
if (ModsConfig.BiotechActive)
|
||||
|
@ -26,37 +26,26 @@ namespace RJW_Genes
|
|||
}
|
||||
harmony.Patch(AccessTools.Method(typeof(SexAppraiser), nameof(SexAppraiser.would_rape)),
|
||||
postfix: new HarmonyMethod(typeof(PatchImplants), nameof(PatchImplants.would_rape_PostFix)));
|
||||
|
||||
harmony.Patch(AccessTools.Method(typeof(xxx), nameof(xxx.is_rapist)),
|
||||
postfix: new HarmonyMethod(typeof(PatchImplants), nameof(PatchImplants.is_rapist_PostFix)));
|
||||
|
||||
harmony.Patch(AccessTools.Method(typeof(AfterSexUtility), nameof(AfterSexUtility.think_about_sex_Rapist)),
|
||||
postfix: new HarmonyMethod(typeof(PatchImplants), nameof(PatchImplants.think_about_sex_Rapist_PostFix)));
|
||||
|
||||
harmony.Patch(AccessTools.Method(typeof(PawnUtility), nameof(PawnUtility.BodyResourceGrowthSpeed)),
|
||||
postfix: new HarmonyMethod(typeof(PatchImplants), nameof(PatchImplants.MultiplyPregnancy)));
|
||||
|
||||
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)));
|
||||
|
||||
|
||||
harmony.Patch(AccessTools.Method(typeof(Quirk), nameof(Quirk.CountSatisfiedQuirks)),
|
||||
postfix: new HarmonyMethod(typeof(QuirkPatcher), nameof(QuirkPatcher.CountSatisfiedPostfix)));
|
||||
|
||||
/*
|
||||
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<GeneDef>.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)));
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,17 +23,6 @@ namespace RJW_Genes
|
|||
public static readonly HediffDef OvaryAgitator;
|
||||
public static readonly HediffDef Bioscaffold;
|
||||
|
||||
/*public static HediffDef NeedlePenis = HediffDef.Named("NeedlePenis");
|
||||
public static HediffDef PigPenis = HediffDef.Named("PigPenis");
|
||||
public static HediffDef MarinePenis = HediffDef.Named("MarinePenis");
|
||||
public static HediffDef TentaclePenis = HediffDef.Named("TentaclePenis");
|
||||
public static HediffDef GolemPenis = HediffDef.Named("GolemPenis");
|
||||
public static HediffDef OrcPenis = HediffDef.Named("OrcPenis");
|
||||
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");*/
|
||||
public static readonly HediffDef rjw_genes_animal_control_hediff;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,8 +163,8 @@
|
|||
<Compile Include="Genes\Patches\LustFeeding.cs" />
|
||||
<Compile Include="Genes\Patches\MultiplePregnancies.cs" />
|
||||
<Compile Include="Genes\Patch_AddNotifyOnGeneration.cs" />
|
||||
<Compile Include="Genes\QuirkPatching\Defs\QirkExtension.cs" />
|
||||
<Compile Include="Genes\QuirkPatching\QuirkPatcher.cs" />
|
||||
<Compile Include="Genes\Quirks\Defs\QirkExtension.cs" />
|
||||
<Compile Include="Genes\Quirks\QuirkPatcher.cs" />
|
||||
<Compile Include="Genes\Special\Abilities\CompAbilityEffect_CocoonWeaver.cs" />
|
||||
<Compile Include="Genes\Special\Abilities\CompProperties_AbilityCocoonWeaver.cs" />
|
||||
<Compile Include="Genes\Special\Defs\AgeTransferExtension.cs" />
|
||||
|
@ -205,12 +205,15 @@
|
|||
<HintPath>..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="LicentiaLabs">
|
||||
<HintPath>..\..\licentia-labs-master\Assemblies\LicentiaLabs.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RJW">
|
||||
<HintPath>..\..\rjw\1.5\Assemblies\RJW.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="RJWSexperience">
|
||||
<HintPath>..\..\rjw-sexperience-master\1.5\Assemblies\RJWSexperience.dll</HintPath>
|
||||
<HintPath>..\..\rjw-sexperience\1.5\Assemblies\RJWSexperience.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
|
|
Loading…
Reference in a new issue