Skip to content

Turn When Dead

juanosarg edited this page Feb 10, 2021 · 1 revision

HediffCompProperties_TurnWhenDead is a comp class that can be applied to a hediff so if this hediff kills the creature, or if the creature dies while having this hediff and having a severity greater than specified, it turns into a different animal.

    public string thingToTurnTo = "";
    public float severityToTurn = 0.85f;
    public List<int> numberOfSpawn = null;
    public bool isHostile = true;
    public bool keepGender = false;
    public string factionToTurnTo = "";

How do I use this code?

It is a comp class, so you just add it in XML in the <comps> tag of the hediff you want to have this behaviour. For example, Werewolves in RimWorld - Witcher Monster Hunt cause the Lycanthropy hediff with their attacks, which turns their victims into werewolves

<comps>
	<li Class="AnimalBehaviours.HediffCompProperties_TurnWhenDead">
		<thingToTurnTo>WMH_Werewolf</thingToTurnTo>
		<severityToTurn>0.85</severityToTurn>
		<numberOfSpawn><li>1</li><li>1</li></numberOfSpawn>
		<isHostile>true</isHostile> 
		<keepGender>true</keepGender>
		<factionToTurnTo>WMH_Monsters</factionToTurnTo>
	</li>
</comps>

VFE Core

General Comp classes

General DefModExtensions

Item Processor

PipeSystem

Custom Structure Generation

Multi Verb Combat Framework - MVCF

Animal Behaviours

Genes

Apparel

Cuisine

Furniture

Plants

Deprecated

Clone this wiki locally