For modders 1.5 - WVCSergkart/WVC_RacesBiotech GitHub Wiki
A special def that is needed for compatibility with other mods.
<WVC_XenotypesAndGenes.XenotypesAndGenesListDef>
<defName>AnyDefName</defName>
<!-- Keywords that allow you to filter out defNames of xenotypes. -->
<!-- Xenotypes containing these words will not spawn in serums. Any string -->
<blackListedXenotypesForSerums>
<li>Baseliner</li>
</blackListedXenotypesForSerums>
<!-- List of xenotypes that can be in the resurrection serum. Any xenotype defs -->
<!-- It is combined with the usual list, it is only necessary to determine which of the prohibited xenotypes are allowed specifically for these purposes. -->
<whiteListedXenotypesForResurrectorSerums>
<!-- <li>WVC_Undead</li> -->
</whiteListedXenotypesForResurrectorSerums>
<!-- List of backstories that will not be overridden by the backstory changer. Required backstory defNames -->
<blackListedBackstoryForChanger>
<!-- <li>Colonist</li> -->
</blackListedBackstoryForChanger>
<!-- Words that should not be in the defName of Mechanoids. Used to random summon mechanoids. Required any string -->
<mechDefNameShouldNotContain>
<!-- <li>Zombie_</li> -->
</mechDefNameShouldNotContain>
<!-- Work only for WVC -XaG CompSpawnSubplant. Required thing defNames -->
<!-- WVC_XenotypesAndGenes.CompSpawnOnDeath_Subplants or WVC_XenotypesAndGenes.CompSpawnSubplantDuration -->
<plantsToNotOverwrite_SpawnSubplant>
<!-- <li>GauranlenTree</li> -->
</plantsToNotOverwrite_SpawnSubplant>
<!-- Ignored dryad modes by dryad queen gene. Required any GauranlenTreeModeDefs -->
<ignoredGauranlenTreeModeDefs>
<!-- <li MayRequire="ludeon.rimworld.ideology">Gaumaker</li> -->
<!-- <li MayRequire="sarg.alphamemes">AM_Corruptor</li> -->
</ignoredGauranlenTreeModeDefs>
</WVC_XenotypesAndGenes.XenotypesAndGenesListDef>
Mod extension
<li Class="WVC_XenotypesAndGenes.GeneExtension_General">
<canBePredatorPrey>true</canBePredatorPrey>
</li>
<canBePredatorPrey>true</canBePredatorPrey>
- if false
, then animals will not be able to hunt the carrier of the gene.
Mod extension
<li Class="WVC_XenotypesAndGenes.GeneExtension_General">
<inheritableGeneDefs>
<li>PerfectImmunity</li>
<li>DiseaseFree</li>
</inheritableGeneDefs>
</li>
allows genes to inherit different stats from other genes.
For example, the "Perfect senescent" gene inherits immunity from the vanilla "Perfect immunity" and "Non-senescent" genes.
Currently inherited: exclusionTags
, makeImmuneTo
, hediffGiversCannotGive
, suppressedTraits
, forcedTraits
, conditionalStatAffecters
, statFactors
, statOffsets
, symbolPack
.
Allows you to create a furskin gene with visible tattoos and a mask.
Please note that the "Disable mecha/node/rune/stone(skin) graphic" option disables this mechanic.
<modExtensions>
<li Class="WVC_XenotypesAndGenes.GeneExtension_Graphic">
<furIsSkin>true</furIsSkin>
<furIsSkinWithHair>false</furIsSkinWithHair>
</li>
</modExtensions>
furIsSkin
- If true, then the furskin will replace the pawn skin.
furIsSkinWithHair
- If true, then the furskin will replace the pawn skin and use a mask. Red for skin color, green for hair color.
<FurDef>
<defName>WVC_StoneSkin</defName>
<bodyTypeGraphicPaths>
<Male>WVC/Bodies/StoneGene_Body/Naked_Male</Male>
<Female>WVC/Bodies/StoneGene_Body/Naked_Female</Female>
<Hulk>WVC/Bodies/StoneGene_Body/Naked_Hulk</Hulk>
<Fat>WVC/Bodies/StoneGene_Body/Naked_Fat</Fat>
<Thin>WVC/Bodies/StoneGene_Body/Naked_Thin</Thin>
<Child>Things/Pawn/Humanlike/Bodies/Naked_Child</Child>
<Baby>Things/Pawn/Humanlike/Bodies/Naked_Child</Baby>
</bodyTypeGraphicPaths>
<modExtensions>
<li Class="WVC_XenotypesAndGenes.GeneExtension_Graphic">
<furIsSkin>true</furIsSkin>
</li>
</modExtensions>
</FurDef>
Allows you to create a spawner gene for any item.
<GeneDef>
<defName>SteelSpawner</defName>
<label>steel spawner</label>
<description>Spawn steel.</description>
<geneClass>WVC_XenotypesAndGenes.Gene_Spawner</geneClass>
<iconPath>WVC/UI/Genes/Gene_Spawner</iconPath>
<customEffectDescriptions>
<li>Spawns steel every (*DateTime)2-3 days(/DateTime).</li>
<li>Stack count increases or decreases relative to metabolism.</li>
</customEffectDescriptions>
<exclusionTags>
<li>ResourceSpawner</li>
</exclusionTags>
<modExtensions>
<li Class="WVC_XenotypesAndGenes.GeneExtension_Spawner">
<thingDefToSpawn>Steel</thingDefToSpawn>
<stackCount>22</stackCount>
<spawnIntervalRange><min>120000</min><max>360000</max></spawnIntervalRange>
</li>
</modExtensions>
</GeneDef>
The thrall mechanic allows the player to transform corpses into obedient servants of the colony.
New types of thralls can be easily added via ThrallDef.
<WVC_XenotypesAndGenes.ThrallDef>
<defName>NewThrall</defName>
<label>thrall</label>
<description>Information specifically about this thrall.</description>
<generalDesc>General information about thralls. (Obsolete)</generalDesc>
<!-- Used if the thrall xenotype is disabled in the settings, and also for the icon in the thrall selection menu. -->
<xenotypeIconDef>WVC_Thrall_Ghoul1c</xenotypeIconDef>
<!-- If set, the pawn will turn into a mutant. -->
<mutantDef>Ghoul</mutantDef>
<!-- If true, the pawn will receive the genes specified in the ability in geneDefs. -->
<addGenesFromAbility>false</addGenesFromAbility>
<!-- If true, the pawn will receive the genes specified in the ability in inheritableGenes. -->
<!-- <addGenesFromMaster>true</addGenesFromMaster> -->
<!-- The state of the corpse on which the thrall maker can be used. -->
<!-- <acceptableRotStages> -->
<!-- <li>Fresh</li> -->
<!-- </acceptableRotStages> -->
<!-- Used only for internal randomizations and is largely useless. -->
<!-- <selectionWeight>1</selectionWeight> -->
<genes>
<li>WVC_GauntSkin</li>
<li>Hair_DarkBlack</li>
<li>WVC_SkinColor_Granite</li>
<li>WVC_SkinColor_Limestone</li>
<li>WVC_SkinColor_Marble</li>
<li>WVC_SkinColor_Slate</li>
<li>WVC_GeneSavant</li>
<li>ToxicEnvironmentResistance_Total</li>
<li>Aggression_DeadCalm</li>
<li>WVC_NoLearning</li>
<li>WVC_PredatorPrey_NotTasty</li>
</genes>
</WVC_XenotypesAndGenes.ThrallDef>
The morpher can be assigned xenotypes and trigger genes in advance, in xml.
By adding this to the XenotypeDef, the morpher will first try to add the specified gene.
<modExtensions>
<li Class="WVC_XenotypesAndGenes.GeneExtension_Giver">
<morpherTriggerGene>WVC_MorphCondition_Deathrest</morpherTriggerGene>
</li>
</modExtensions>
If this is present in the XenotypeDef, then a random xenotype is selected from the given list.
<modExtensions>
<li Class="WVC_XenotypesAndGenes.GeneExtension_Giver">
<morpherXenotypeDefs>
<li>WVC_Shadoweater</li>
</morpherXenotypeDefs>
<!-- or -->
<morpherXenotypeChances>
<WVC_Resurgent>0.80</WVC_Resurgent>
<WVC_Featherdust>0.33</WVC_Featherdust>
<WVC_Ashen>0.11</WVC_Ashen>
</morpherXenotypeChances>
</li>
</modExtensions>
To add a new trigger gene, you need knowledge of C#.
Anything that inherits from the Gene_MorpherTrigger
class is considered a gene trigger.
Anything that inherits from the Gene_AbilityMorph
class is also considered a trigger, but is ignored by the trigger change function.
Anything that inherits from the Gene_MorpherOneTimeUse
class makes the morpher one-time and blocks most of its functions.
Simple check, if true
, morph is possible.
The value is cached for 2 seconds, so you can do moderately complex checks without risking performance.
public virtual bool CanMorph()
{
return false;
}
Responsible for the dialogue when pressing the trigger button. It can be removed, but then miss-clicking will become the player's main enemy.
public virtual void MorpherWarining(PawnGeneSetHolder geneSet)
{
Dialog_MessageBox window = Dialog_MessageBox.CreateConfirmation("WVC_XaG_GeneAbilityMorphWarning".Translate(), delegate
{
MorpherTrigger(geneSet);
});
Find.WindowStack.Add(window);
}
Responsible for the morpher trigger. It is advisable to perform it after the code of the gene that calls the outcomes, otherwise the effect will be reflected on the new pawn geneset, not the old one.
The morpher trigger itself is completely located in the morpher gene.
public virtual void MorpherTrigger(PawnGeneSetHolder geneSet)
{
try
{
Morpher?.TryMorph(geneSet, true, OneTimeUse);
}
catch (Exception arg)
{
Log.Error("Failed create form and morph. Reason: " + arg);
}
}