From 601f7d156e4bcd9267d64491b4904e00087a7ac3 Mon Sep 17 00:00:00 2001
From: Shabakur <109368764+Shabakur@users.noreply.github.com>
Date: Wed, 30 Nov 2022 11:29:45 +0100
Subject: [PATCH] Add files via upload
---
About/About.xml | 31 ++++
Assemblies/RJW_BGS.dll | Bin 0 -> 10752 bytes
Defs/RaceGeneDefs/RaceGeneDefs _template.xml | 38 +++++
Defs/RaceGeneDefs/RaceGeneDefs.xml | 109 ++++++++++++++
Source/RJW_BGS/Class1.cs | 30 ++++
Source/RJW_BGS/Harmony_Init.cs | 21 +++
Source/RJW_BGS/InheritanceUtility.cs | 64 +++++++++
.../PatchRJWBestialityPregnancyUtility.cs | 49 +++++++
.../RJW_BGS/PatchVanillaPregnancyUtility.cs | 34 +++++
Source/RJW_BGS/Properties/AssemblyInfo.cs | 36 +++++
Source/RJW_BGS/RJW_BGS.csproj | 70 +++++++++
Source/RJW_BGS/RJW_BGS.sln | 25 ++++
Source/RJW_BGS/RJWcopies.cs | 133 ++++++++++++++++++
Source/RJW_BGS/RaceGeneDef.cs | 20 +++
.../DesignTimeResolveAssemblyReferences.cache | Bin 0 -> 205 bytes
...gnTimeResolveAssemblyReferencesInput.cache | Bin 0 -> 7216 bytes
.../RJW_BGS.csproj.AssemblyReference.cache | Bin 0 -> 55681 bytes
.../RJW_BGS.csproj.CoreCompileInputs.cache | 1 +
.../Debug/RJW_BGS.csproj.FileListAbsolute.txt | 4 +
Source/RJW_BGS/obj/Debug/RJW_BGS.dll | Bin 0 -> 10752 bytes
20 files changed, 665 insertions(+)
create mode 100644 About/About.xml
create mode 100644 Assemblies/RJW_BGS.dll
create mode 100644 Defs/RaceGeneDefs/RaceGeneDefs _template.xml
create mode 100644 Defs/RaceGeneDefs/RaceGeneDefs.xml
create mode 100644 Source/RJW_BGS/Class1.cs
create mode 100644 Source/RJW_BGS/Harmony_Init.cs
create mode 100644 Source/RJW_BGS/InheritanceUtility.cs
create mode 100644 Source/RJW_BGS/PatchRJWBestialityPregnancyUtility.cs
create mode 100644 Source/RJW_BGS/PatchVanillaPregnancyUtility.cs
create mode 100644 Source/RJW_BGS/Properties/AssemblyInfo.cs
create mode 100644 Source/RJW_BGS/RJW_BGS.csproj
create mode 100644 Source/RJW_BGS/RJW_BGS.sln
create mode 100644 Source/RJW_BGS/RJWcopies.cs
create mode 100644 Source/RJW_BGS/RaceGeneDef.cs
create mode 100644 Source/RJW_BGS/obj/Debug/DesignTimeResolveAssemblyReferences.cache
create mode 100644 Source/RJW_BGS/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
create mode 100644 Source/RJW_BGS/obj/Debug/RJW_BGS.csproj.AssemblyReference.cache
create mode 100644 Source/RJW_BGS/obj/Debug/RJW_BGS.csproj.CoreCompileInputs.cache
create mode 100644 Source/RJW_BGS/obj/Debug/RJW_BGS.csproj.FileListAbsolute.txt
create mode 100644 Source/RJW_BGS/obj/Debug/RJW_BGS.dll
diff --git a/About/About.xml b/About/About.xml
new file mode 100644
index 0000000..d445da6
--- /dev/null
+++ b/About/About.xml
@@ -0,0 +1,31 @@
+
+ RJW Animal Gene Inheritance
+ Shabakur
+ Shabakur.rjw.animal.gene.inheritance
+
+ 1.4
+
+ Allows pawn to inherit genes from beasts.
+
+
+ ludeon.rimworld.biotech
+ Biotech
+
+
+ rim.job.world
+ RimJobWorld
+ https://www.loverslab.com/files/file/7257-rimjobworld/
+
+
+ brrainz.harmony
+ Harmony
+ steam://url/CommunityFilePage/2009463077
+ https://github.com/pardeike/HarmonyRimWorld/releases/latest
+
+
+
+ brrainz.harmony
+ ludeon.rimworld.biotech
+ rim.job.world
+
+
\ No newline at end of file
diff --git a/Assemblies/RJW_BGS.dll b/Assemblies/RJW_BGS.dll
new file mode 100644
index 0000000000000000000000000000000000000000..6a03c3a96f458c4f7eb0b92ee1d8e612ad004338
GIT binary patch
literal 10752
zcmeHN4R9Rgd4BijcJEH7lkQHIZ4l=Cn?rZHN|wMj7)P=s%QBWNTf#pSBk$?f^5MJN
z^X>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d^0g+iZLRRhl)oA4BpClfY{bO28we5?@faK<4uz;z%us0=*|
zlzaT8dOM6thzU
ztanyV_7j31_FERZMZ}b^iEO_8G@j)0_~RK|jB#5rW=f3UtV=W_BAlXwu!b*8=ken7
z5VD+~YaHLNI&tz>EW)>cuHl?rceb+dQ-B{EZwM
+
+
+
\ No newline at end of file
diff --git a/Defs/RaceGeneDefs/RaceGeneDefs.xml b/Defs/RaceGeneDefs/RaceGeneDefs.xml
new file mode 100644
index 0000000..7802539
--- /dev/null
+++ b/Defs/RaceGeneDefs/RaceGeneDefs.xml
@@ -0,0 +1,109 @@
+
+
+
+ Canine
+ Canine_Group
+
+ Ears_Floppy
+
+
+ 90
+
+
+
+
+ Insect
+ Insect_Group
+
+ Beauty_Ugly
+
+
+ 50
+
+
+
+
+ Feline
+ Feline_Group
+
+ Ears_Cat
+ Sleepy
+ DarkVision
+
+
+ 90
+ 25
+ 25
+
+
+
+
+ Dragon
+ Dragon_Group
+
+ Unstoppable
+ Headbone_CenterHorn
+
+
+ 25
+ 90
+
+
+
+
+ Rodent
+ Rodent_Group
+
+ Fertile
+
+
+ 10
+
+
+
+
+ Racoon
+ Raccon_Group
+
+ StrongStomach
+
+
+ 50
+
+
+
+
+
\ No newline at end of file
diff --git a/Source/RJW_BGS/Class1.cs b/Source/RJW_BGS/Class1.cs
new file mode 100644
index 0000000..b987f18
--- /dev/null
+++ b/Source/RJW_BGS/Class1.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using rjw;
+using Verse;
+using RimWorld;
+namespace RJW_BGS
+{
+ [StaticConstructorOnStartup]
+ internal static class Class1
+ {
+ static Class1()
+ {
+ RJWcopy.Racegroupdictbuilder();
+ foreach (RaceGroupDef raceGroupDef2 in DefDatabase.AllDefs)
+ {
+ //Log.Message("defName = " + raceGroupDef2.defName);
+ if (raceGroupDef2.raceNames != null)
+ {
+ foreach (string race in raceGroupDef2.raceNames)
+ {
+ //Log.Message(race);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/Source/RJW_BGS/Harmony_Init.cs b/Source/RJW_BGS/Harmony_Init.cs
new file mode 100644
index 0000000..120a4e8
--- /dev/null
+++ b/Source/RJW_BGS/Harmony_Init.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HarmonyLib;
+using Verse;
+
+namespace RJW_BGS
+{
+ [StaticConstructorOnStartup]
+ internal static class HarmonyInit
+ {
+ // Token: 0x0600001F RID: 31 RVA: 0x000029A4 File Offset: 0x00000BA4
+ static HarmonyInit()
+ {
+ Harmony harmony = new Harmony("RJW_BGS");
+ harmony.PatchAll();
+ }
+ }
+}
diff --git a/Source/RJW_BGS/InheritanceUtility.cs b/Source/RJW_BGS/InheritanceUtility.cs
new file mode 100644
index 0000000..20724fa
--- /dev/null
+++ b/Source/RJW_BGS/InheritanceUtility.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Verse;
+using RimWorld;
+
+namespace RJW_BGS
+{
+ public class InheritanceUtility
+ {
+ public static List AnimalInheritedGenes(Pawn father, Pawn mother)
+ {
+ List genelist = new List();
+ if (father != null && !father.RaceProps.Humanlike)
+ {
+ PawnKindDef pawnKindDef = father.kindDef;
+ RaceGeneDef raceGeneDef = RJWcopy.GetRaceGenDefInternal(pawnKindDef);
+ if (raceGeneDef != null)
+ {
+ GeneDef gene = null;
+ //In case you hit a modded gene not currently active try again.
+ for (int i = 0; i < 50 || gene == null; i++)
+ {
+ if (raceGeneDef.genes.Any())
+ {
+ gene = DefDatabase.GetNamed(raceGeneDef.genes.RandomElement());
+ }
+ }
+ if (gene != null)
+ {
+ genelist.Add(gene);
+ }
+ }
+ }
+
+ if (mother != null && !mother.RaceProps.Humanlike)
+ {
+ PawnKindDef pawnKindDef = mother.kindDef;
+ RaceGeneDef raceGeneDef = RJWcopy.GetRaceGenDefInternal(pawnKindDef);
+ if (raceGeneDef != null)
+ {
+ GeneDef gene = null;
+ //In case you hit a modded gene not currently active try again.
+ for (int i = 0; i < 50 || gene == null; i++)
+ {
+ if (raceGeneDef.genes.Any())
+ {
+ gene = DefDatabase.GetNamed(raceGeneDef.genes.RandomElement());
+ }
+ }
+ if (gene != null)
+ {
+ genelist.Add(gene);
+
+ }
+
+ }
+ }
+ return genelist;
+ }
+ }
+}
diff --git a/Source/RJW_BGS/PatchRJWBestialityPregnancyUtility.cs b/Source/RJW_BGS/PatchRJWBestialityPregnancyUtility.cs
new file mode 100644
index 0000000..fc2bbc6
--- /dev/null
+++ b/Source/RJW_BGS/PatchRJWBestialityPregnancyUtility.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HarmonyLib;
+using RimWorld;
+using Verse;
+using rjw;
+
+namespace RJW_BGS
+{
+ [HarmonyPatch(typeof(Hediff_BasePregnancy), "Initialize")]
+ public static class PatchRJWBestialityPregnancyUtility
+ {
+ [HarmonyPostfix]
+ public static void AddGenes(Pawn mother, Pawn dad, ref Hediff_BasePregnancy __instance)
+ {
+ foreach (Pawn baby in __instance.babies)
+ {
+ if (baby.RaceProps.Humanlike)
+ {
+ if (baby.genes == null)
+ {
+ 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 beastgenes = InheritanceUtility.AnimalInheritedGenes(dad, mother);
+
+ foreach (GeneDef gene in beastgenes)
+ {
+ baby.genes.AddGene(gene, false);
+ }
+ foreach (GeneDef gene in genes)
+ {
+ baby.genes.AddGene(gene, false);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/Source/RJW_BGS/PatchVanillaPregnancyUtility.cs b/Source/RJW_BGS/PatchVanillaPregnancyUtility.cs
new file mode 100644
index 0000000..4321667
--- /dev/null
+++ b/Source/RJW_BGS/PatchVanillaPregnancyUtility.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using HarmonyLib;
+using RimWorld;
+using Verse;
+using rjw;
+namespace RJW_BGS
+{
+ [HarmonyPatch(typeof(PregnancyUtility), "GetInheritedGeneSet", new Type[]
+ {
+ typeof(Pawn),
+ typeof(Pawn),
+ //typeof(bool)
+ }
+ )]
+ public static class PatchVanillaPregnancyUtility
+ {
+ [HarmonyPostfix]
+ public static void AnimalInheritedGenes(Pawn father, Pawn mother, ref GeneSet __result)
+ {
+ List genes = InheritanceUtility.AnimalInheritedGenes(father, mother);
+ if (genes.Any())
+ {
+ foreach (GeneDef gene in genes)
+ {
+ __result.AddGene(gene);
+ }
+ }
+ }
+ }
+}
diff --git a/Source/RJW_BGS/Properties/AssemblyInfo.cs b/Source/RJW_BGS/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..e1325ac
--- /dev/null
+++ b/Source/RJW_BGS/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("RJW_BGS")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("HP Inc.")]
+[assembly: AssemblyProduct("RJW_BGS")]
+[assembly: AssemblyCopyright("Copyright © HP Inc. 2022")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("357a0848-8709-46ab-bd98-49fd8fd5dd13")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Source/RJW_BGS/RJW_BGS.csproj b/Source/RJW_BGS/RJW_BGS.csproj
new file mode 100644
index 0000000..b1eb624
--- /dev/null
+++ b/Source/RJW_BGS/RJW_BGS.csproj
@@ -0,0 +1,70 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {357A0848-8709-46AB-BD98-49FD8FD5DD13}
+ Library
+ Properties
+ RJW_BGS
+ RJW_BGS
+ v4.7.2
+ 512
+ true
+
+
+ false
+ none
+ false
+ ..\..\Assemblies\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\..\..\..\..\..\workshop\content\294100\2009463077\Current\Assemblies\0Harmony.dll
+ False
+
+
+ ..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll
+ False
+
+
+ ..\..\..\RJW\1.4\Assemblies\RJW.dll
+ False
+
+
+
+
+
+
+
+
+
+
+ ..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll
+ False
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Source/RJW_BGS/RJW_BGS.sln b/Source/RJW_BGS/RJW_BGS.sln
new file mode 100644
index 0000000..d256888
--- /dev/null
+++ b/Source/RJW_BGS/RJW_BGS.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.2.32519.379
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RJW_BGS", "RJW_BGS.csproj", "{357A0848-8709-46AB-BD98-49FD8FD5DD13}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {357A0848-8709-46AB-BD98-49FD8FD5DD13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {357A0848-8709-46AB-BD98-49FD8FD5DD13}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {357A0848-8709-46AB-BD98-49FD8FD5DD13}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {357A0848-8709-46AB-BD98-49FD8FD5DD13}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {BAF54302-9171-409B-BCFA-9817A3BF9A66}
+ EndGlobalSection
+EndGlobal
diff --git a/Source/RJW_BGS/RJWcopies.cs b/Source/RJW_BGS/RJWcopies.cs
new file mode 100644
index 0000000..c09f95a
--- /dev/null
+++ b/Source/RJW_BGS/RJWcopies.cs
@@ -0,0 +1,133 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using rjw;
+using Verse;
+using RimWorld;
+namespace RJW_BGS
+{
+ internal class RJWcopy
+ {
+ //Code copied from rjw, as their code was internal and I need the dictionary to know which genes to add to the pawn
+ public static void Racegroupdictbuilder()
+ {
+ foreach (PawnKindDef pawnKindDef2 in from pawnKindDef in DefDatabase.AllDefs
+ where pawnKindDef.race.race != null
+ select pawnKindDef)
+ {
+ RaceGroupDef raceGroupDef = null;
+ bool temp = TryGetRaceGroupDef(pawnKindDef2, out raceGroupDef);
+ }
+ }
+
+ public static bool TryGetRaceGroupDef(PawnKindDef pawnKindDef, out RaceGroupDef raceGroupDef)
+ {
+
+ if (RaceGroupByPawnKind.TryGetValue(pawnKindDef, out raceGroupDef))
+ {
+ return raceGroupDef != null;
+ }
+ raceGroupDef = GetRaceGroupDefInternal(pawnKindDef);
+ RaceGroupByPawnKind.Add(pawnKindDef, raceGroupDef);
+ return raceGroupDef != null;
+ }
+
+ public static RaceGroupDef GetRaceGroupDefInternal(PawnKindDef kindDef)
+ {
+ string raceName = kindDef.race.defName;
+ string pawnKindName = kindDef.defName;
+ IEnumerable allDefs = DefDatabase.AllDefs;
+ List list = allDefs.Where(delegate (RaceGroupDef group)
+ {
+ List pawnKindNames = group.pawnKindNames;
+ return pawnKindNames != null && pawnKindNames.Contains(pawnKindName);
+ }).ToList();
+ List list2 = allDefs.Where(delegate (RaceGroupDef group)
+ {
+ List raceNames = group.raceNames;
+ return raceNames != null && raceNames.Contains(raceName);
+ }).ToList();
+ int num = list.Count() + list2.Count();
+ if (num == 0)
+ {
+ return null;
+ }
+ if (num == 1)
+ {
+ return list.Concat(list2).Single();
+ }
+ RaceGroupDef result;
+ if ((result = list.FirstOrDefault((RaceGroupDef match) => !IsThisMod(match))) == null)
+ {
+ if ((result = list2.FirstOrDefault((RaceGroupDef match) => !IsThisMod(match))) == null)
+ {
+ result = (list.FirstOrDefault() ?? list2.FirstOrDefault());
+ }
+ }
+ return result;
+ }
+
+ public static RaceGeneDef GetRaceGenDefInternal(PawnKindDef kindDef)
+ {
+ string raceName = kindDef.race.defName;
+ string pawnKindName = kindDef.defName;
+ string raceGroupName = GetRaceGroupDef(kindDef).defName;
+ IEnumerable allDefs = DefDatabase.AllDefs;
+ List list = allDefs.Where(delegate (RaceGeneDef group)
+ {
+ List pawnKindNames = group.pawnKindNames;
+ return pawnKindNames != null && pawnKindNames.Contains(pawnKindName);
+ }).ToList();
+ List list2 = allDefs.Where(delegate (RaceGeneDef group)
+ {
+ List raceNames = group.raceNames;
+ return raceNames != null && raceNames.Contains(raceName);
+ }).ToList();
+ List list3 = allDefs.Where(delegate (RaceGeneDef group)
+ {
+ String raceGroupDefName = group.raceGroup;
+ return raceGroupDefName != null && raceGroupDefName == raceGroupName;
+ }).ToList();
+
+ RaceGeneDef result = null;
+ //First check if there is a matching pawnkinddef then race, then racegroup
+ if (list.Any())
+ {
+ result = list.RandomElement();
+ }
+ else if (list2.Any() && result == null)
+ {
+ result = list2.RandomElement();
+ }
+ else if (list3.Any() && result == null)
+ {
+ result = list3.RandomElement();
+ }
+ else
+ {
+ result = null;
+ }
+ return result;
+
+
+ }
+
+ private static RaceGroupDef GetRaceGroupDef(PawnKindDef kindDef)
+ {
+ RaceGroupDef raceGroupDef = null;
+ bool temp = TryGetRaceGroupDef(kindDef, out raceGroupDef);
+ return raceGroupDef;
+ }
+
+ private static bool IsThisMod(Def def)
+ {
+ return LoadedModManager.RunningMods.Single((ModContentPack pack) => pack.Name == "RimJobWorld").AllDefs.Contains(def);
+ }
+
+ private static readonly IDictionary RaceGroupByPawnKind = new Dictionary();
+ }
+
+
+}
diff --git a/Source/RJW_BGS/RaceGeneDef.cs b/Source/RJW_BGS/RaceGeneDef.cs
new file mode 100644
index 0000000..9e9b01e
--- /dev/null
+++ b/Source/RJW_BGS/RaceGeneDef.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Verse;
+using rjw;
+
+namespace RJW_BGS
+{
+ public class RaceGeneDef : Def
+ {
+ public String raceGroup;
+ public List raceNames;
+ public List pawnKindNames;
+ public List genes;
+ public List geneweights;
+ public String hybridName;
+ }
+}
diff --git a/Source/RJW_BGS/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Source/RJW_BGS/obj/Debug/DesignTimeResolveAssemblyReferences.cache
new file mode 100644
index 0000000000000000000000000000000000000000..c5634ba28c34795f55fe80d6277dfb5be1b4799f
GIT binary patch
literal 205
zcmZQ$WMp7qU`%wjiU}ynPcKT$RdCD9Ni9~;sIV~8j0s9jOD#&xOHNgAEG|yXP0Gnk
zEspWcOfJeV&QB|eaRaJPEzd8?j?wdT4MFhAO!Un4jAC+&lkUFgAhCM2vHm&gK&7&b>PU
zF2f(`m;QoIe`32UzlLC7Ce{oeEXHebFZN>SgIq+X}eEE2iO>w#9cVDc^E
zd19ZsFO;Hw#cM1dXv%R_>I#g`3tnZl73R?yhj5p