Compare commits
3 Commits
3cc62ba818
...
5000d918fe
Author | SHA1 | Date |
---|---|---|
Shabakur | 5000d918fe | |
Shabakur | a36bdb7e9a | |
Shabakur | b8a5e64baf |
|
@ -27,5 +27,6 @@
|
||||||
<li>brrainz.harmony</li>
|
<li>brrainz.harmony</li>
|
||||||
<li>ludeon.rimworld.biotech</li>
|
<li>ludeon.rimworld.biotech</li>
|
||||||
<li>rim.job.world</li>
|
<li>rim.job.world</li>
|
||||||
|
<li>ASMR.RJW.RaceSupport</li>
|
||||||
</loadAfter>
|
</loadAfter>
|
||||||
</ModMetaData>
|
</ModMetaData>
|
Binary file not shown.
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Defs>
|
<Defs>
|
||||||
<RJW_BGS.RaceGeneDef>
|
<RJW_BGS.RaceGeneDef Name = "Canine">
|
||||||
<defName>Canine</defName>
|
<defName>Canine</defName>
|
||||||
<raceGroup>Canine_Group</raceGroup>
|
<raceGroup>Canine_Group</raceGroup>
|
||||||
<genes>
|
<genes>
|
||||||
|
@ -10,7 +10,20 @@
|
||||||
<li>0.9</li>
|
<li>0.9</li>
|
||||||
</genechances>
|
</genechances>
|
||||||
</RJW_BGS.RaceGeneDef>
|
</RJW_BGS.RaceGeneDef>
|
||||||
|
<!-- You can use parents to have animals get specific genes in addition to the group.
|
||||||
|
<RJW_BGS.RaceGeneDef ParentName = "Canine">
|
||||||
|
<defName>Warg</defName>
|
||||||
|
<raceNames>
|
||||||
|
<li>Warg</li>
|
||||||
|
</raceNames>
|
||||||
|
<genes>
|
||||||
|
<li>DarkVision</li>
|
||||||
|
</genes>
|
||||||
|
<genechances>
|
||||||
|
<li>0.9</li>
|
||||||
|
</genechances>
|
||||||
|
</RJW_BGS.RaceGeneDef>
|
||||||
|
-->
|
||||||
<RJW_BGS.RaceGeneDef>
|
<RJW_BGS.RaceGeneDef>
|
||||||
<defName>Insect</defName>
|
<defName>Insect</defName>
|
||||||
<raceGroup>Insect_Group</raceGroup>
|
<raceGroup>Insect_Group</raceGroup>
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,30 +1,30 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using rjw;
|
using rjw;
|
||||||
using Verse;
|
using Verse;
|
||||||
using RimWorld;
|
using RimWorld;
|
||||||
namespace RJW_BGS
|
namespace RJW_BGS
|
||||||
{
|
{
|
||||||
[StaticConstructorOnStartup]
|
[StaticConstructorOnStartup]
|
||||||
internal static class Class1
|
internal static class First
|
||||||
{
|
{
|
||||||
static Class1()
|
static First()
|
||||||
{
|
{
|
||||||
RJWcopy.Racegroupdictbuilder();
|
RJWcopy.Racegroupdictbuilder();
|
||||||
//foreach (RaceGroupDef raceGroupDef2 in DefDatabase<RaceGroupDef>.AllDefs)
|
//foreach (RaceGroupDef raceGroupDef2 in DefDatabase<RaceGroupDef>.AllDefs)
|
||||||
//{
|
//{
|
||||||
//Log.Message("defName = " + raceGroupDef2.defName);
|
//Log.Message("defName = " + raceGroupDef2.defName);
|
||||||
// if (raceGroupDef2.raceNames != null)
|
// if (raceGroupDef2.raceNames != null)
|
||||||
// {
|
// {
|
||||||
// foreach (string race in raceGroupDef2.raceNames)
|
// foreach (string race in raceGroupDef2.raceNames)
|
||||||
// {
|
// {
|
||||||
//Log.Message(race);
|
//Log.Message(race);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -24,7 +24,8 @@ namespace RJW_BGS
|
||||||
|
|
||||||
foreach (CodeInstruction instruction in instructions)
|
foreach (CodeInstruction instruction in instructions)
|
||||||
{
|
{
|
||||||
if(instruction.opcode == OpCodes.Call && instruction.operand.ToString() == "Void BabyPostBirth(Verse.Pawn, Verse.Pawn, Verse.Pawn)")
|
yield return instruction;
|
||||||
|
if (instruction.opcode == OpCodes.Call && instruction.operand.ToString() == "Void BabyPostBirth(Verse.Pawn, Verse.Pawn, Verse.Pawn)")
|
||||||
{
|
{
|
||||||
yield return new CodeInstruction(OpCodes.Ldloc_0, null);
|
yield return new CodeInstruction(OpCodes.Ldloc_0, null);
|
||||||
yield return new CodeInstruction(OpCodes.Ldfld, implanter);
|
yield return new CodeInstruction(OpCodes.Ldfld, implanter);
|
||||||
|
@ -33,7 +34,7 @@ namespace RJW_BGS
|
||||||
yield return new CodeInstruction(OpCodes.Ldloc_1, null);
|
yield return new CodeInstruction(OpCodes.Ldloc_1, null);
|
||||||
yield return new CodeInstruction(OpCodes.Call, newgenes);
|
yield return new CodeInstruction(OpCodes.Call, newgenes);
|
||||||
}
|
}
|
||||||
yield return instruction;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Class1.cs" />
|
<Compile Include="First.cs" />
|
||||||
<Compile Include="Harmony_Init.cs" />
|
<Compile Include="Harmony_Init.cs" />
|
||||||
<Compile Include="InheritanceUtility.cs" />
|
<Compile Include="InheritanceUtility.cs" />
|
||||||
<Compile Include="PatchRJWBestialityPregnancyUtility.cs" />
|
<Compile Include="PatchRJWBestialityPregnancyUtility.cs" />
|
||||||
|
|
|
@ -34,6 +34,7 @@ namespace RJW_BGS
|
||||||
return raceGroupDef != null;
|
return raceGroupDef != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//slightly modified code so it also works racegroupdefs
|
||||||
public static RaceGroupDef GetRaceGroupDefInternal(PawnKindDef kindDef)
|
public static RaceGroupDef GetRaceGroupDefInternal(PawnKindDef kindDef)
|
||||||
{
|
{
|
||||||
string raceName = kindDef.race.defName;
|
string raceName = kindDef.race.defName;
|
||||||
|
@ -71,9 +72,14 @@ namespace RJW_BGS
|
||||||
|
|
||||||
public static RaceGeneDef GetRaceGenDefInternal(PawnKindDef kindDef)
|
public static RaceGeneDef GetRaceGenDefInternal(PawnKindDef kindDef)
|
||||||
{
|
{
|
||||||
|
if (kindDef == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
string raceName = kindDef.race.defName;
|
string raceName = kindDef.race.defName;
|
||||||
string pawnKindName = kindDef.defName;
|
string pawnKindName = kindDef.defName;
|
||||||
string raceGroupName = GetRaceGroupDef(kindDef).defName;
|
RaceGroupDef raceGroupDef = GetRaceGroupDef(kindDef);
|
||||||
|
//string raceGroupName = GetRaceGroupDef(kindDef).defName;
|
||||||
IEnumerable<RaceGeneDef> allDefs = DefDatabase<RaceGeneDef>.AllDefs;
|
IEnumerable<RaceGeneDef> allDefs = DefDatabase<RaceGeneDef>.AllDefs;
|
||||||
List<RaceGeneDef> list = allDefs.Where(delegate (RaceGeneDef group)
|
List<RaceGeneDef> list = allDefs.Where(delegate (RaceGeneDef group)
|
||||||
{
|
{
|
||||||
|
@ -85,12 +91,15 @@ namespace RJW_BGS
|
||||||
List<string> raceNames = group.raceNames;
|
List<string> raceNames = group.raceNames;
|
||||||
return raceNames != null && raceNames.Contains(raceName);
|
return raceNames != null && raceNames.Contains(raceName);
|
||||||
}).ToList<RaceGeneDef>();
|
}).ToList<RaceGeneDef>();
|
||||||
List<RaceGeneDef> list3 = allDefs.Where(delegate (RaceGeneDef group)
|
List<RaceGeneDef> list3 = new List<RaceGeneDef>();
|
||||||
|
if (raceGroupDef != null)
|
||||||
{
|
{
|
||||||
String raceGroupDefName = group.raceGroup;
|
list3 = allDefs.Where(delegate (RaceGeneDef group)
|
||||||
return raceGroupDefName != null && raceGroupDefName == raceGroupName;
|
{
|
||||||
}).ToList<RaceGeneDef>();
|
String raceGroupDefName = group.raceGroup;
|
||||||
|
return raceGroupDefName != null && raceGroupDefName == raceGroupDef.defName;
|
||||||
|
}).ToList<RaceGeneDef>();
|
||||||
|
}
|
||||||
RaceGeneDef result = null;
|
RaceGeneDef result = null;
|
||||||
//First check if there is a matching pawnkinddef then race, then racegroup
|
//First check if there is a matching pawnkinddef then race, then racegroup
|
||||||
if (list.Any())
|
if (list.Any())
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
bbcef32adb57331bca8d9d64ae20e770e4ed1e71
|
0b0a8825bf7e783f74047adfd92c6a9898735e8c
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue