mirror of
https://github.com/Shabakur/RJW_Animal_Gene_Inheritance.git
synced 2024-08-14 22:46:41 +00:00
Made each gene to have a chance to be inherited
This commit is contained in:
parent
3c5cf22169
commit
ddd55d1400
14 changed files with 69 additions and 36 deletions
Binary file not shown.
0
Source/RJW_BGS/.vs/RJW_BGS/FileContentIndex/read.lock
Normal file
0
Source/RJW_BGS/.vs/RJW_BGS/FileContentIndex/read.lock
Normal file
BIN
Source/RJW_BGS/.vs/RJW_BGS/v17/.suo
Normal file
BIN
Source/RJW_BGS/.vs/RJW_BGS/v17/.suo
Normal file
Binary file not shown.
|
@ -60,5 +60,30 @@ namespace RJW_BGS
|
|||
}
|
||||
return genelist;
|
||||
}
|
||||
|
||||
public static List<GeneDef> SelectGenes(Pawn pawn)
|
||||
{
|
||||
List<GeneDef> genelist = new List<GeneDef>();
|
||||
PawnKindDef pawnKindDef = pawn.kindDef;
|
||||
RaceGeneDef raceGeneDef = RJWcopy.GetRaceGenDefInternal(pawnKindDef);
|
||||
if (raceGeneDef != null)
|
||||
{
|
||||
int num1 = raceGeneDef.genes.Count;
|
||||
int num2 = raceGeneDef.genechances.Count;
|
||||
if (num1 != num2)
|
||||
{
|
||||
Log.Error("The amount of genes and genechanches are different in " + raceGeneDef.defName + ". Can't select genes to inherit");
|
||||
return genelist;
|
||||
}
|
||||
for (int i = 0; i<num1; i++)
|
||||
{
|
||||
if (raceGeneDef.genechances[i] > Rand.Range(0.01f, 1f))
|
||||
{
|
||||
genelist.Add(DefDatabase<GeneDef>.GetNamed(raceGeneDef.genes[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
return genelist;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,15 +32,15 @@
|
|||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>..\..\..\..\..\..\workshop\content\294100\2009463077\Current\Assemblies\0Harmony.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\workshop\content\294100\2009463077\Current\Assemblies\0Harmony.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="RJW">
|
||||
<HintPath>..\..\..\RJW\1.4\Assemblies\RJW.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\RJW\1.4\Assemblies\RJW.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
|
@ -52,7 +52,7 @@
|
|||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace RJW_BGS
|
|||
public List<string> raceNames;
|
||||
public List<string> pawnKindNames;
|
||||
public List<string> genes;
|
||||
public List<float> geneweights;
|
||||
public List<float> genechances;
|
||||
public String hybridName;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
|
Binary file not shown.
Binary file not shown.
|
@ -2,3 +2,7 @@ C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\RJW_Bestiality_Gene_
|
|||
C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\RJW_Bestiality_Gene_Support\Source\RJW_BGS\obj\Debug\RJW_BGS.csproj.AssemblyReference.cache
|
||||
C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\RJW_Bestiality_Gene_Support\Source\RJW_BGS\obj\Debug\RJW_BGS.csproj.CoreCompileInputs.cache
|
||||
C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\RJW_Bestiality_Gene_Support\Source\RJW_BGS\obj\Debug\RJW_BGS.dll
|
||||
C:\Users\tyrob\OneDrive\Documenten\GitHub\RJW_Animal_Gene_Inheritance\Assemblies\RJW_BGS.dll
|
||||
C:\Users\tyrob\OneDrive\Documenten\GitHub\RJW_Animal_Gene_Inheritance\Source\RJW_BGS\obj\Debug\RJW_BGS.csproj.AssemblyReference.cache
|
||||
C:\Users\tyrob\OneDrive\Documenten\GitHub\RJW_Animal_Gene_Inheritance\Source\RJW_BGS\obj\Debug\RJW_BGS.csproj.CoreCompileInputs.cache
|
||||
C:\Users\tyrob\OneDrive\Documenten\GitHub\RJW_Animal_Gene_Inheritance\Source\RJW_BGS\obj\Debug\RJW_BGS.dll
|
||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue