diff --git a/1.4/Assemblies/RJW-Quirks.dll b/1.4/Assemblies/RJW-Quirks.dll index 0d790aa..58678fc 100644 Binary files a/1.4/Assemblies/RJW-Quirks.dll and b/1.4/Assemblies/RJW-Quirks.dll differ diff --git a/RJW-Quirks/Data/RaceTags.cs b/RJW-Quirks/Data/RaceTags.cs deleted file mode 100644 index bd5cde5..0000000 --- a/RJW-Quirks/Data/RaceTags.cs +++ /dev/null @@ -1,64 +0,0 @@ -using rjw; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Verse; - -namespace rjwquirks.Data -{ - public class RaceTags - { - private readonly static Dictionary tagDatabase = new Dictionary(); - - // I only created tags for RaceGroupDef properties that seemed like keywords (like slime) rather than behavior (like oviPregnancy). - public readonly static RaceTags Chitin = new RaceTags("Chitin"); - public readonly static RaceTags Demon = new RaceTags("Demon"); - public readonly static RaceTags Feathers = new RaceTags("Feathers"); - public readonly static RaceTags Fur = new RaceTags("Fur"); - public readonly static RaceTags Plant = new RaceTags("Plant"); - public readonly static RaceTags Robot = new RaceTags("Robot"); - public readonly static RaceTags Scales = new RaceTags("Scales"); - public readonly static RaceTags Skin = new RaceTags("Skin"); - public readonly static RaceTags Slime = new RaceTags("Slime"); - - - public string Key { get; } - - private RaceTags(string key) - { - Key = key; - tagDatabase.Add(key, this); - } - - public static bool TryParse(string key, out RaceTags raceTag) - { - return tagDatabase.TryGetValue(key, out raceTag); - } - - /// - /// For backwards compatability only. Shouldn't add more special cases here. - /// - public bool DefaultWhenNoRaceGroupDef(Pawn pawn) - { - if (this == Demon) - { - return xxx.is_demon(pawn); - } - else if (this == Slime) - { - return xxx.is_slime(pawn); - } - else if (this == Skin) - { - return true; - } - else - { - return false; - } - } - - } -} diff --git a/RJW-Quirks/HarmonyPatches/Patch_CasualSex_Helper.cs b/RJW-Quirks/HarmonyPatches/Patch_CasualSex_Helper.cs index 57302ae..a1ce668 100644 --- a/RJW-Quirks/HarmonyPatches/Patch_CasualSex_Helper.cs +++ b/RJW-Quirks/HarmonyPatches/Patch_CasualSex_Helper.cs @@ -49,10 +49,10 @@ namespace rjwquirks.HarmonyPatches // Readd the 30 score removed in regular RJW __result += 30; // Readd the 100 score taken from being in a doorway in regular RJW - __result += 100; + if (room.IsDoorway) __result += 100; if (might_be_seen) - __result += 5; + __result += 35; else __result -= 10; diff --git a/RJW-Quirks/HarmonyPatches/Patch_CondomUtility.cs b/RJW-Quirks/HarmonyPatches/Patch_CondomUtility.cs index 3f3add0..f9a2d69 100644 --- a/RJW-Quirks/HarmonyPatches/Patch_CondomUtility.cs +++ b/RJW-Quirks/HarmonyPatches/Patch_CondomUtility.cs @@ -18,8 +18,7 @@ namespace rjwquirks.HarmonyPatches [HarmonyPatch(nameof(CondomUtility.TryUseCondom))] public static bool UseCondomPrefix(Pawn pawn) { - if (xxx.is_human(pawn) && pawn.HasQuirk(QuirkDefOf.ImpregnationFetish)) - return false; + if (xxx.is_human(pawn) && pawn.HasQuirk(QuirkDefOf.ImpregnationFetish)) return false; return true; } @@ -28,8 +27,7 @@ namespace rjwquirks.HarmonyPatches [HarmonyPatch(nameof(CondomUtility.GetCondomFromRoom))] public static bool GetCondomPrefix(Pawn pawn) { - if (xxx.is_human(pawn) && pawn.HasQuirk(QuirkDefOf.ImpregnationFetish)) - return false; + if (xxx.is_human(pawn) && pawn.HasQuirk(QuirkDefOf.ImpregnationFetish)) return false; return true; } diff --git a/RJW-Quirks/HarmonyPatches/Patch_DrawNude.cs b/RJW-Quirks/HarmonyPatches/Patch_DrawNude.cs deleted file mode 100644 index b227131..0000000 --- a/RJW-Quirks/HarmonyPatches/Patch_DrawNude.cs +++ /dev/null @@ -1,24 +0,0 @@ -using HarmonyLib; -using rjw; -using rjwquirks.Modules.Quirks; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Verse; - -namespace rjwquirks.HarmonyPatches -{ - [HarmonyPatch(typeof(SexUtility), nameof(SexUtility.DrawNude))] - public class Patch_DrawNude - { - public static bool Prefix(Pawn pawn) - { - if (pawn.HasQuirk(QuirkDefOf.Endytophile)) - return false; - - return true; - } - } -} diff --git a/RJW-Quirks/HarmonyPatches/Patch_Hediff_BasePregnancy.cs b/RJW-Quirks/HarmonyPatches/Patch_Hediff_BasePregnancy.cs deleted file mode 100644 index c5268a4..0000000 --- a/RJW-Quirks/HarmonyPatches/Patch_Hediff_BasePregnancy.cs +++ /dev/null @@ -1,35 +0,0 @@ -using HarmonyLib; -using rjw; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection.Emit; -using System.Text; -using System.Threading.Tasks; -using Verse; - -namespace rjwquirks.HarmonyPatches -{ - /*[HarmonyPatch(typeof(Hediff_BasePregnancy))] - public class Patch_Hediff_BasePregnancy - { - [HarmonyTranspiler] - [HarmonyPatch("GenerateBabies")] - public static IEnumerable AdjustMaxLitterSize(IEnumerable instructions) - { - bool found = false; - - foreach (CodeInstruction i in instructions) - { - if (i.opcode == OpCodes.Ldc_R4 && i.operand as string == "0.33333334") - found = true; - - if (found && i.opcode == OpCodes.Stloc_S) - Log.Warning(i.operand as string); - - - yield return i; - } - } - }*/ -} diff --git a/RJW-Quirks/HarmonyPatches/Patch_Hediff_PartBaseArtifical.cs b/RJW-Quirks/HarmonyPatches/Patch_Hediff_PartBaseArtifical.cs deleted file mode 100644 index b10bc50..0000000 --- a/RJW-Quirks/HarmonyPatches/Patch_Hediff_PartBaseArtifical.cs +++ /dev/null @@ -1,43 +0,0 @@ -using HarmonyLib; -using rjw; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Reflection.Emit; -using System.Text; -using System.Threading.Tasks; -using Verse; - -namespace rjwquirks.HarmonyPatches -{ - [HarmonyPatch(typeof(Hediff_PartBaseArtifical))] - public class Patch_Hediff_PartBaseArtifical - { - [HarmonyTranspiler] - [HarmonyPatch(nameof(Hediff_PartBaseArtifical.Tick))] - public static IEnumerable ChangeMaxEggsSize(IEnumerable instructions) - { - FieldInfo Pawn = AccessTools.Field(typeof(Hediff_PartBaseArtifical), nameof(Hediff_PartBaseArtifical.pawn)); - MethodInfo EggSize = AccessTools.Method(typeof(Patch_Hediff_PartBaseArtifical), nameof(EditMaxEggsSize)); - - foreach (CodeInstruction i in instructions) - { - if (i.opcode == OpCodes.Ldc_R4 && i.operand as string == "0.0") - { - yield return new CodeInstruction(OpCodes.Ldfld, Pawn); - yield return new CodeInstruction(OpCodes.Ldloc_3); - yield return new CodeInstruction(OpCodes.Call, EggSize); - } - - yield return i; - } - } - - public static void EditMaxEggsSize(Pawn pawn, float eggsSize) - { - if (pawn.GetQuirks() != null) - pawn.GetQuirks().ApplyValueModifiers("maxEggsSize", ref eggsSize); - } - } -} diff --git a/RJW-Quirks/HarmonyPatches/Patch_Hediff_PartBaseNatural.cs b/RJW-Quirks/HarmonyPatches/Patch_Hediff_PartBaseNatural.cs deleted file mode 100644 index 9818e11..0000000 --- a/RJW-Quirks/HarmonyPatches/Patch_Hediff_PartBaseNatural.cs +++ /dev/null @@ -1,47 +0,0 @@ -using HarmonyLib; -using rjw; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection.Emit; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Verse; - -namespace rjwquirks.HarmonyPatches -{ - [HarmonyPatch(typeof(Hediff_PartBaseNatural))] - public class Patch_Hediff_PartBaseNatural - { - [HarmonyTranspiler] - [HarmonyPatch(nameof(Hediff_PartBaseNatural.Tick))] - public static IEnumerable ChangeMaxEggsSize(IEnumerable instructions) - { - FieldInfo Pawn = AccessTools.Field(typeof(Hediff_PartBaseNatural), nameof(Hediff_PartBaseNatural.pawn)); - MethodInfo EggSize = AccessTools.Method(typeof(Patch_Hediff_PartBaseNatural), nameof(EditMaxEggsSize)); - bool found = false; - - foreach (CodeInstruction i in instructions) - { - if (i.opcode == OpCodes.Ldc_R4 && i.operand as string == "0.0" && found) - { - yield return new CodeInstruction(OpCodes.Ldfld, Pawn); - yield return new CodeInstruction(OpCodes.Ldloc_3); - yield return new CodeInstruction(OpCodes.Call, EggSize); - } - - if (i.opcode == OpCodes.Ldc_R4 && i.operand as string == "0.0") - found = true; - - yield return i; - } - } - - public static void EditMaxEggsSize(Pawn pawn, float eggsSize) - { - if (pawn.GetQuirks() != null) - pawn.GetQuirks().ApplyValueModifiers("maxEggsSize", ref eggsSize); - } - } -} diff --git a/RJW-Quirks/HarmonyPatches/Patch_JobGiver_Masturbate.cs b/RJW-Quirks/HarmonyPatches/Patch_JobGiver_Masturbate.cs index 03ae20a..7feb8c9 100644 --- a/RJW-Quirks/HarmonyPatches/Patch_JobGiver_Masturbate.cs +++ b/RJW-Quirks/HarmonyPatches/Patch_JobGiver_Masturbate.cs @@ -12,48 +12,16 @@ using rjwquirks.Modules.Quirks; namespace rjwquirks.HarmonyPatches { - /*[HarmonyPatch(typeof(JobGiver_Masturbate))] + [HarmonyPatch(typeof(JobGiver_Masturbate), nameof(JobGiver_Masturbate.WantsToMasturbate))] public class Patch_JobGiver_Masturbate { - [HarmonyTranspiler] - [HarmonyPatch("TryGiveJob")] - public static IEnumerable ApplyQuirkToMasturbate(IEnumerable instructions) + [HarmonyPostfix] + public static void ApplyQuirkToMasturbate(Pawn pawn, ref bool __result) { - MethodInfo Frustrated = AccessTools.Method(typeof(xxx), nameof(xxx.is_frustrated)); - MethodInfo Apply = AccessTools.Method(typeof(Patch_JobGiver_Masturbate), nameof(ApplyQuirk)); - var labels = instructions.ElementAt(0).labels.ListFullCopy