Hediff while having Thought - AndroidQuazar/VanillaExpandedFramework GitHub Wiki

The HediffComp_WhileHavingThoughts class keeps a Hediff active while a Thought (or thoughts, provided through a list) is active on the pawn. When the Thought ends, it deletes the Hediff. It does this calculation every 10 seconds to avoid unnecessary lag.

It also checks if other given thoughts are active on the pawn, and removes them as needed. For example, in Vanilla Cooking Expanded it removes the "Consumed Lavish Meal" Thought if the pawn receives the "Consumed Gourmet Meal" Thought, so they don't stack.

An example of use of these two first features can be seen here.

It also ALSO checks if the Hediff was caused by a resurrecting ingredient (basically the Resurrector nanites condiment from Vanilla Cooking Expanded), and if the pawn dies while the Hediff is active, it resurrects it (example). This is super specific and probably shouldn't be part of this class, but oh well. Bite me.