Modified how racegenedefs are formatted
This commit is contained in:
parent
33a37f26de
commit
33c0fa3e3b
Binary file not shown.
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Defs>
|
||||
<RJW_BGS.RaceGeneDef ParentName="Slime_base">
|
||||
<defName>AA_Aerofleet</defName>
|
||||
<raceNames>
|
||||
<li>AA_Aerofleet</li>
|
||||
<li>AA_ColossalAerofleet</li>
|
||||
</raceNames>
|
||||
<genes>
|
||||
<li>AG_BlueGelProduction</li>
|
||||
<li>AG_GasBags</li>
|
||||
<li>AG_AerofleetHead</li>
|
||||
<li>AG_SlimeBody</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>0.25</li>
|
||||
<li>0.25</li>
|
||||
<li>0.25</li>
|
||||
<li>0.25</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
</Defs>
|
|
@ -1,82 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Defs>
|
||||
<RJW_BGS.RaceGeneDef ParentName="Insect_base" Name="AA_lisks_base" Abstract="True">
|
||||
<defName>AA_lisks_base</defName>
|
||||
<!-- <raceNames>
|
||||
<li>AA_Animalisk</li>
|
||||
<li>AA_Blizzarisk</li>
|
||||
<li>AA_Cinderlisk</li>
|
||||
<li>AA_Dunealisk</li>
|
||||
<li>AA_Feralisk</li>
|
||||
<li>AA_Junglelisk</li>
|
||||
</raceNames> -->
|
||||
<genes>
|
||||
<li>AG_Spinnerets</li>
|
||||
<li>AG_EggLaying</li>
|
||||
<li>AG_FeraliskEyes</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>0.25</li>
|
||||
<li>0.25</li>
|
||||
<li>0.25</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
|
||||
<RJW_BGS.RaceGeneDef ParentName="AA_lisks_base">
|
||||
<defName>AA_Animalisk</defName>
|
||||
<raceNames>
|
||||
<li>AA_Animalisk</li>
|
||||
</raceNames>
|
||||
<genes>
|
||||
<li>PsychicAbility_Enhanced</li>
|
||||
<li>PsychicAbility_Extreme</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>0.8</li>
|
||||
<li>0.2</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
|
||||
<RJW_BGS.RaceGeneDef ParentName="AA_lisks_base">
|
||||
<defName>AA_Blizzarisk</defName>
|
||||
<raceNames>
|
||||
<li>AA_Blizzarisk</li>
|
||||
</raceNames>
|
||||
<genes>
|
||||
<li>MaxTemp_SmallDecrease</li>
|
||||
<li>MinTemp_SmallDecrease</li>
|
||||
<li>MinTemp_LargeDecrease</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>0.8</li>
|
||||
<li>0.8</li>
|
||||
<li>0.2</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
|
||||
<RJW_BGS.RaceGeneDef ParentName="AA_lisks_base">
|
||||
<defName>AA_Hotlisk</defName>
|
||||
<raceNames>
|
||||
<li>AA_Cinderlisk</li>
|
||||
<li>AA_Dunealisk</li>
|
||||
</raceNames>
|
||||
<genes>
|
||||
<li>MinTemp_SmallIncrease</li>
|
||||
<li>MaxTemp_SmallIncrease</li>
|
||||
<li>MaxTemp_LargeIncrease</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>0.8</li>
|
||||
<li>0.8</li>
|
||||
<li>0.2</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
|
||||
<RJW_BGS.RaceGeneDef ParentName="AA_lisks_base">
|
||||
<defName>AA_Normallisk</defName>
|
||||
<raceNames>
|
||||
<li>AA_Feralisk</li>
|
||||
<li>AA_Junglelisk</li>
|
||||
</raceNames>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
</Defs>
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Defs>
|
||||
<RJW_BGS.RaceGeneDef>
|
||||
<defName>AA_Wildpodgroup</defName>
|
||||
<raceNames>
|
||||
<li>AA_Wildpod</li>
|
||||
<li>AA_Wildpawn</li>
|
||||
<li>AA_Agaripawn</li>
|
||||
<li>AA_Agaripod</li>
|
||||
</raceNames>
|
||||
<genes>
|
||||
<li>AG_FungalSkin</li>
|
||||
<li>MoveSpeed_Slow</li>
|
||||
<li>FireWeakness</li>
|
||||
<li>FireTerror</li>
|
||||
<li>Robust</li>
|
||||
<li>Unstoppable</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>0.15</li>
|
||||
<li>0.25</li>
|
||||
<li>0.25</li>
|
||||
<li>0.25</li>
|
||||
<li>0.25</li>
|
||||
<li>0.25</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
</Defs>
|
|
@ -3,24 +3,28 @@
|
|||
<RJW_BGS.RaceGeneDef Name="Insect_base" Abstract="True">
|
||||
<defName>Insect_base</defName>
|
||||
<genes>
|
||||
<li>AG_InsectBlood</li>
|
||||
<li>rjw_genes_ovipositor_genitalia</li>
|
||||
<li>
|
||||
<defName>AG_InsectBlood</defName>
|
||||
<chance>0.5</chance>
|
||||
</li>
|
||||
<li>
|
||||
<defName>rjw_genes_ovipositor_genitalia</defName>
|
||||
<chance>0.5</chance>
|
||||
</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>0.5</li>
|
||||
<li>0.5</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
|
||||
<RJW_BGS.RaceGeneDef Name="Slime_base" Abstract="True">
|
||||
<defName>Slime_base</defName>
|
||||
<genes>
|
||||
<li>AG_SlimeBlood</li>
|
||||
<li>rjw_genes_slime_genitalia</li>
|
||||
<li>
|
||||
<defName>AG_SlimeBlood</defName>
|
||||
<chance>0.5</chance>
|
||||
</li>
|
||||
<li>
|
||||
<defName>rjw_genes_slime_genitalia</defName>
|
||||
<chance>0.5</chance>
|
||||
</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>0.5</li>
|
||||
<li>0.5</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
</Defs>
|
|
@ -4,107 +4,101 @@
|
|||
<defName>Canine</defName>
|
||||
<raceGroup>Canine_Group</raceGroup>
|
||||
<genes>
|
||||
<li>Ears_Floppy</li>
|
||||
<li>
|
||||
<defName>Ears_Floppy</defName>
|
||||
<chance>0.9</chance>
|
||||
</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>0.9</li>
|
||||
</genechances>
|
||||
</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>
|
||||
<defName>Insect</defName>
|
||||
<raceGroup>Insect_Group</raceGroup>
|
||||
<genes>
|
||||
<li>Beauty_Ugly</li>
|
||||
<li>
|
||||
<defName>Beauty_Ugly</defName>
|
||||
<chance>0.5</chance>
|
||||
</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>0.5</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
|
||||
<RJW_BGS.RaceGeneDef>
|
||||
<defName>Feline</defName>
|
||||
<raceGroup>Feline_Group</raceGroup>
|
||||
<genes>
|
||||
<li>Ears_Cat</li>
|
||||
<li>Sleepy</li>
|
||||
<li>DarkVision</li>
|
||||
<li>
|
||||
<defName>Ears_Cat</defName>
|
||||
<chance>0.9</chance>
|
||||
</li>
|
||||
<li>
|
||||
<defName>Sleepy</defName>
|
||||
<chance>0.25</chance>
|
||||
</li>
|
||||
<li>
|
||||
<defName>DarkVision</defName>
|
||||
<chance>0.25</chance>
|
||||
</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>0.9</li>
|
||||
<li>0.25</li>
|
||||
<li>0.25</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
<!--
|
||||
<RJW_BGS.RaceGeneDef>
|
||||
<defName>Equine</defName>
|
||||
<raceGroup>Equine_Group</raceGroup>
|
||||
<genes>
|
||||
<li>Ears_Floppy</li>
|
||||
<li>
|
||||
<defName>StrongStomach</defName>
|
||||
<chance>0.5</chance>
|
||||
</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>10</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
-->
|
||||
<RJW_BGS.RaceGeneDef>
|
||||
<defName>Dragon</defName>
|
||||
<raceGroup>Dragon_Group</raceGroup>
|
||||
<genes>
|
||||
<li>Unstoppable</li>
|
||||
<li>Headbone_CenterHorn</li>
|
||||
<li>
|
||||
<defName>Unstoppable</defName>
|
||||
<chance>0.25</chance>
|
||||
</li>
|
||||
<li>
|
||||
<defName>Headbone_CenterHorn</defName>
|
||||
<chance>0.9</chance>
|
||||
</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>0.25</li>
|
||||
<li>0.9</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
|
||||
<RJW_BGS.RaceGeneDef>
|
||||
<defName>Rodent</defName>
|
||||
<raceGroup>Rodent_Group</raceGroup>
|
||||
<genes>
|
||||
<li>Fertile</li>
|
||||
<li>
|
||||
<defName>Fertile</defName>
|
||||
<chance>0.25</chance>
|
||||
</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>0.25</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
|
||||
<RJW_BGS.RaceGeneDef>
|
||||
<defName>Racoon</defName>
|
||||
<raceGroup>Raccon_Group</raceGroup>
|
||||
<genes>
|
||||
<li>StrongStomach</li>
|
||||
<li>
|
||||
<defName>StrongStomach</defName>
|
||||
<chance>0.5</chance>
|
||||
</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>0.5</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
<!--
|
||||
<RJW_BGS.RaceGeneDef>
|
||||
<defName>Needle</defName>
|
||||
<raceGroup>Needle_Group</raceGroup>
|
||||
<genes>
|
||||
<li>Ears_Floppy</li>
|
||||
<li>
|
||||
<defName>StrongStomach</defName>
|
||||
<chance>0.5</chance>
|
||||
</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>10</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
-->
|
||||
<!--
|
||||
|
@ -112,11 +106,11 @@
|
|||
<defName>Hemi</defName>
|
||||
<raceGroup>Hemi_Group</raceGroup>
|
||||
<genes>
|
||||
<li>Ears_Floppy</li>
|
||||
<li>
|
||||
<defName>StrongStomach</defName>
|
||||
<chance>0.5</chance>
|
||||
</li>
|
||||
</genes>
|
||||
<genechances>
|
||||
<li>10</li>
|
||||
</genechances>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
-->
|
||||
</Defs>
|
|
@ -23,16 +23,33 @@
|
|||
which genes can be inherited
|
||||
|
||||
<genes>
|
||||
<li>Ears_Floppy</li>
|
||||
<li>
|
||||
<defName>Ears_Floppy</defName>
|
||||
<chance>0.5</chance>
|
||||
</li>
|
||||
<li>
|
||||
<defName>rjw_genes_slime_genitalia</defName> You can add modded genes which will be ignored if the mod is inactive.
|
||||
<chance>0.5</chance>
|
||||
</li>
|
||||
</genes>
|
||||
The genes which may be inherited. Use the defName of the gene, you can also add modded genes.
|
||||
|
||||
<genechances>
|
||||
<li>0.9</li>
|
||||
</genechances>
|
||||
WIP, the chance of each gene to be inherited. Is in same order as genes, so for the second gene the chance to inherit is based on the second line in geweights.
|
||||
For each gene you need to find the defname and give it a chance to appear. Each gene is rolled independently.
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
|
||||
|
||||
-->
|
||||
|
||||
<!-- You can use parents to have animals get specific genes in addition to the group. So warg children will have a chance for Ears_Floppy, rjw_genes_slime_genitalia and StrongStomach
|
||||
<RJW_BGS.RaceGeneDef ParentName = "Canine">
|
||||
<defName>Warg</defName>
|
||||
<raceNames>
|
||||
<li>Warg</li>
|
||||
</raceNames>
|
||||
<genes>
|
||||
<li>
|
||||
<defName>StrongStomach</defName>
|
||||
<chance>0.5</chance>
|
||||
</li>
|
||||
</genes>
|
||||
</RJW_BGS.RaceGeneDef>
|
||||
-->
|
||||
</Defs>
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RJW_BGS
|
||||
{
|
||||
public class GeneChance
|
||||
{
|
||||
public string defName;
|
||||
public float chance = 1f;
|
||||
}
|
||||
}
|
|
@ -53,18 +53,11 @@ namespace RJW_BGS
|
|||
RaceGeneDef raceGeneDef = RJWcopy.GetRaceGenDefInternal(pawnKindDef);
|
||||
if (raceGeneDef != null)
|
||||
{
|
||||
int num1 = raceGeneDef.genes.Count;
|
||||
int num2 = raceGeneDef.genechances.Count;
|
||||
if (num1 != num2)
|
||||
foreach (GeneChance gene in raceGeneDef.genes)
|
||||
{
|
||||
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))
|
||||
if (gene.chance >= Rand.Range(0.01f,1f))
|
||||
{
|
||||
genelist.Add(DefDatabase<GeneDef>.GetNamed(raceGeneDef.genes[i]));
|
||||
genelist.Add(DefDatabase<GeneDef>.GetNamed(gene.defName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
using UnityEngine;
|
||||
namespace RJW_Genes.Animal_Inheritance
|
||||
{
|
||||
public class RJW_BGSSettings : ModSettings
|
||||
{
|
||||
public static void DoWindowContents(Rect inRect)
|
||||
{
|
||||
//Copied from RJW settings mostly
|
||||
Rect outRect = new Rect(0f, 30f, inRect.width, inRect.height - 30f);
|
||||
Rect rect = new Rect(0f, 0f, inRect.width - 16f, inRect.height + 300f);
|
||||
//Widgets.BeginScrollView(outRect, ref RJWSettings.scrollPosition, rect, true);
|
||||
Listing_Standard listing_Standard = new Listing_Standard();
|
||||
listing_Standard.maxOneColumn = true;
|
||||
listing_Standard.ColumnWidth = rect.width / 2.05f;
|
||||
listing_Standard.Begin(rect);
|
||||
listing_Standard.Gap(24f);
|
||||
listing_Standard.CheckboxLabeled("enabled", ref enabled, "no function yet", 0f, 1f);
|
||||
//listing_Standard.CheckboxLabeled("sexfrenzy", ref sexfrenzy, "disable the effects", 0f, 1f);
|
||||
listing_Standard.End();
|
||||
}
|
||||
|
||||
public override void ExposeData()
|
||||
{
|
||||
base.ExposeData();
|
||||
Scribe_Values.Look<bool>(ref RJW_BGSSettings.enabled, "enabled", RJW_BGSSettings.enabled, true);
|
||||
}
|
||||
|
||||
public static bool enabled;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Verse;
|
||||
using UnityEngine;
|
||||
|
||||
namespace RJW_Genes.Animal_Inheritance
|
||||
{
|
||||
public class RJW_BGSSettingsController : Mod
|
||||
{
|
||||
public RJW_BGSSettingsController(ModContentPack content) : base(content)
|
||||
{
|
||||
base.GetSettings<RJW_BGSSettings>();
|
||||
}
|
||||
|
||||
public override string SettingsCategory()
|
||||
{
|
||||
return "RJW Genes Animal Gene Inheritance";
|
||||
}
|
||||
public override void DoSettingsWindowContents(Rect inRect)
|
||||
{
|
||||
RJW_BGSSettings.DoWindowContents(inRect);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -35,7 +35,7 @@ namespace RJW_BGS
|
|||
return raceGroupDef != null;
|
||||
}
|
||||
|
||||
//slightly modified code so it also works racegroupdefs
|
||||
|
||||
public static RaceGroupDef GetRaceGroupDefInternal(PawnKindDef kindDef)
|
||||
{
|
||||
string raceName = kindDef.race.defName;
|
||||
|
@ -71,6 +71,7 @@ namespace RJW_BGS
|
|||
return result;
|
||||
}
|
||||
|
||||
//slightly modified copy of code above so it also works for racegenedefs
|
||||
public static RaceGeneDef GetRaceGenDefInternal(PawnKindDef kindDef)
|
||||
{
|
||||
if (kindDef == null)
|
||||
|
|
|
@ -10,11 +10,12 @@ namespace RJW_BGS
|
|||
{
|
||||
public class RaceGeneDef : Def
|
||||
{
|
||||
|
||||
public String raceGroup;
|
||||
public List<string> raceNames;
|
||||
public List<string> pawnKindNames;
|
||||
public List<string> genes;
|
||||
public List<float> genechances;
|
||||
public List<GeneChance> genes;
|
||||
//public List<float> genechances;
|
||||
public String hybridName;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,9 +50,8 @@
|
|||
<None Include="..\Common\Defs\Genes\GeneDefs_GenitaliaTypeEndogenes.xml" />
|
||||
<None Include="..\Common\Languages\**" />
|
||||
<None Include="..\Common\Patches\**" />
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -64,6 +63,9 @@
|
|||
<Compile Include="Animal_Inheritance\PatchVanillaPregnancyUtility.cs" />
|
||||
<Compile Include="Animal_Inheritance\RaceGeneDef.cs" />
|
||||
<Compile Include="Animal_Inheritance\RJWcopies.cs" />
|
||||
<Compile Include="Animal_Inheritance\RJW_BGSSettings.cs" />
|
||||
<Compile Include="Animal_Inheritance\RJW_BGSSettingsController.cs" />
|
||||
<Compile Include="Animal_Inheritance\GeneChance.cs" />
|
||||
<Compile Include="GeneDefOf.cs" />
|
||||
<Compile Include="Genes\Breeding\Gene_MechBreeder.cs" />
|
||||
<Compile Include="Genes\Breeding\PatchMechBirth.cs" />
|
||||
|
|
Loading…
Reference in New Issue