Thought Mood by Hediff Severity - KonradHeinser/EBSGFramework GitHub Wiki
This thought worker and class allow you to make a thought that has a mood level evaluated by a curved based on a hediff's severity. These are the fundamental stuff that you'll need in the thought:
<thoughtClass>EBSGFramework.Thought_Situational_HediffSeverity</thoughtClass>
<workerClass>EBSGFramework.ThoughtWorker_HediffSeverity</workerClass>
<modExtensions>
<li Class="EBSGFramework.EBSGThoughtExtension">
<hediff>InsertHediffDefNameHere</hediff>
<curve>
<points>
<li>(0, 0)</li>
<li>(1, -4)</li>
<li>(6, -20)</li>
</points>
</curve>
</li>
</modExtensions>
The left number in the curve is the hediff severity, while the right number is the mood level associated with it. Any time this curve would result in a number between -1 and 1 exclusive, the thought is treated as inactive.
For stages, you only need one stage, and the value you set for baseMoodEffect won't impact anything because it should be overridden by the worker. For the label and description, you can use {PAWN} to reference the pawn's name, and {HEDIFF} to reference the hediff's label. If it is an Ingestible Dependency Gene's hediff, you can also use {DEPENDENCY} when you want to reference the label assigned for the dependency.
This example is the basic thought that one of the aforementioned Ingestible Dependency Gene hediffs use:
<ThoughtDef>
<defName>EBSG_GeneticDrugDependency</defName>
<thoughtClass>EBSGFramework.Thought_Situational_HediffSeverity</thoughtClass>
<workerClass>EBSGFramework.ThoughtWorker_HediffSeverity</workerClass>
<validWhileDespawned>true</validWhileDespawned>
<stages>
<li>
<label>genetic {DEPENDENCY} dependency</label>
<description>I need {DEPENDENCY} because of my genetic deficiency. It's been so long since I've had any.</description>
<baseMoodEffect>-1</baseMoodEffect>
</li>
</stages>
<modExtensions>
<li Class="EBSGFramework.EBSGThoughtExtension">
<hediff>EBSG_GeneticDrugDependency</hediff>
<curve>
<points>
<li>(0, 0)</li>
<li>(1, -4)</li>
<li>(6, -20)</li>
</points>
</curve>
</li>
</modExtensions>
</ThoughtDef>