Skip to content
Snippets Groups Projects
Commit 67533671 authored by Ed86's avatar Ed86
Browse files

added ability to set custom child stories in race support

parent 297b720e
No related branches found
No related tags found
No related merge requests found
......@@ -224,6 +224,18 @@
-->
</hybridChildKindDef>
<backstoryChildTribal><!-- Tribal: can use nature meditation focus from start -->
<!--
<li>rjw_childT</li>
-->
</backstoryChildTribal>
<backstoryChildCivil>
<!--
<li>rjw_childC</li>
-->
</backstoryChildCivil>
<!-- All the values below are the defaults and can be omitted. -->
<raceSexDrive>1.0</raceSexDrive> <!--how fast race sex need reduces(no effect for animals, not shown in sex stats, goes directly to sex need calc )-->
<hasSingleGender>false</hasSingleGender> <!--if genderless race, set futa without gender change to female. -->
......
......@@ -29,6 +29,8 @@ namespace rjw
public List<string> hybridRaceParents = null;
public List<string> hybridChildKindDef = null;
public List<string> backstoryChildTribal = null;
public List<string> backstoryChildCivil = null;
public List<string> tags = null;
public bool hasSingleGender = false;
......
......@@ -1046,16 +1046,40 @@ namespace rjw
{
// set child to civil
Backstory bs = null;
BackstoryDatabase.TryGetWithIdentifier("rjw_childC", out bs);
String bsDef = null;
bool isTribal = false;
// set child to tribal if both parents tribals
if (father != null)
if (father.story != null)
if (mother.story.GetBackstory(BackstorySlot.Adulthood) != null && father.story.GetBackstory(BackstorySlot.Adulthood).spawnCategories.Contains("Tribal"))
BackstoryDatabase.TryGetWithIdentifier("rjw_childT", out bs);
else if(mother.story.GetBackstory(BackstorySlot.Adulthood) == null && father.story.GetBackstory(BackstorySlot.Childhood).spawnCategories.Contains("Tribal"))
BackstoryDatabase.TryGetWithIdentifier("rjw_childT", out bs);
if (father != null && father.story != null)
{
if (mother.story.GetBackstory(BackstorySlot.Adulthood) != null && father.story.GetBackstory(BackstorySlot.Adulthood).spawnCategories.Contains("Tribal"))
isTribal = true;
else if (mother.story.GetBackstory(BackstorySlot.Adulthood) == null && father.story.GetBackstory(BackstorySlot.Childhood).spawnCategories.Contains("Tribal"))
isTribal = true;
}
else
{
//(int)Find.GameInitData.playerFaction.def.techLevel < 4;
if ((int)mother.Faction.def.techLevel < 4)
isTribal = true;
}
if (isTribal)
{
bsDef = "rjw_childT";
if (baby.GetRJWPawnData().RaceSupportDef != null)
if (!baby.GetRJWPawnData().RaceSupportDef.backstoryChildTribal.NullOrEmpty())
bsDef = baby.GetRJWPawnData().RaceSupportDef.backstoryChildTribal.RandomElement();
}
else
{
bsDef = "rjw_childC";
if (baby.GetRJWPawnData().RaceSupportDef != null)
if (!baby.GetRJWPawnData().RaceSupportDef.backstoryChildCivil.NullOrEmpty())
bsDef = baby.GetRJWPawnData().RaceSupportDef.backstoryChildCivil.RandomElement();
}
BackstoryDatabase.TryGetWithIdentifier(bsDef, out bs);
baby.story.childhood = bs;
}
catch (Exception e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment