State After Health Loss - AndroidQuazar/VanillaExpandedFramework GitHub Wiki

CompStateAfterHealthLoss is a comp class that makes an animal adopt a certain mental state after a given percentage of health has been lost

    //A comp class that applies a mental state to the pawn after losing a precent of it health

    public int healthPercent = 50;
    public int tickInterval = 1000;
    public string mentalState = "PanicFlee";

How do I use this code?

It is a comp class, so you just add it in XML in the <comps> tag. For example, this allows Nekkers in RimWorld - Witcher Monster Hunt to flee in panic if they lose health

<comps>
	<li Class="AnimalBehaviours.CompProperties_StateAfterHealthLoss">
		<healthPercent>70</healthPercent>
		<tickInterval>50</tickInterval>
		<mentalState>PanicFlee</mentalState>
	</li>
</comps>
⚠️ **GitHub.com Fallback** ⚠️