Add or Append Hediff on Ingest - KonradHeinser/EBSGFramework GitHub Wiki
This Ingestion Outcome Doer allows you to add and/or change the severity of the specified hediff. Unlike vanilla's IngestionOutcomeDoer_GiveHediff, this allows for negative severity change, and allows you to differentiate between initial and added severity. If you are familiar with the vanilla version of the comp, the only difference is that this one uses initialSeverity and severityChange in place of severity, and they default to 0 instead of initial severity:
<outcomeDoers>
<li Class="EBSGFramework.IngestionOutcomeDoer_AddOrAppendHediff">
</li>
</outcomeDoers>
These are the options available in the doer:
- hediffDef : The HediffDef to apply
- initialSeverity : Default (0) : The severity to give the hediff if a new one needs to be made. If left at 0, no hediff will be made. If set to -1, it will use the intialSeverity set in the HediffDef. If multiple items are consumed and this is not 0, the additional items increase the severity based on severityChange
- severityChange : Default (0) : If the pawn already has the hediffDef, this is the amount of severity added. In the event that multiple items are consumed, the change is multiplied by the count
- toleranceChemical : ChemicalDef that determines tolerance to the hediff. If the item isn't a drug, this can usually be ignored. This affects both initialSeverity and severityChange
- multiplyByGeneToleranceFactors : Default (False) : If there is a toleranceChemical, this allows genes to also alter the severity. This affects both initialSeverity and severityChange
- divideByBodySize : Default (False) : When set to true, both initialSeverity and severityChange are divided by the pawn's body size
- finalRange : A range of severities which the final hediff severity must be between. If the ingestion would not alter the severity, then the range gets ignored
This example from Det's Buzzers xenotype reduces the severity of toxic buildup if the pawn has that hediff, and does nothing if the pawn has no toxic buildup:
<ThingDef ParentName="MakeableDrugPillBase">
<defName>DV_LungPurifier</defName>
<label>lung purifier</label>
<description>.</description>
<possessionCount>3</possessionCount>
<techLevel>Industrial</techLevel>
<stackLimit>8</stackLimit>
<descriptionHyperlinks>
<HediffDef>ToxicBuildup</HediffDef>
</descriptionHyperlinks>
<graphicData>
<texPath>Things/Item/Drug/LungPurifier</texPath>
<graphicClass>Graphic_StackCount</graphicClass>
<drawSize>0.75</drawSize>
</graphicData>
<socialPropernessMatters>false</socialPropernessMatters>
<rotatable>false</rotatable>
<statBases>
<WorkToMake>800</WorkToMake>
<MarketValue>11</MarketValue>
<Mass>0.22</Mass>
<Flammability>0.5</Flammability>
</statBases>
<ingestible>
<drugCategory>Medical</drugCategory>
<foodType>Processed</foodType>
<ingestSound>Ingest_Snort</ingestSound>
<ingestCommandString>Inhale {0}</ingestCommandString>
<ingestReportString>Inhaling {0}.</ingestReportString>
<outcomeDoers>
<li Class="EBSGFramework.IngestionOutcomeDoer_AddOrAppendHediff">
<hediffDef>ToxicBuildup</hediffDef>
<severityChange>-0.14</severityChange>
</li>
</outcomeDoers>
</ingestible>
<costList>
<Neutroamine>1</Neutroamine>
<MedicineHerbal>1</MedicineHerbal>
<Steel>4</Steel>
</costList>
<recipeMaker>
<workSpeedStat>DrugSynthesisSpeed</workSpeedStat>
<workSkill>Intellectual</workSkill>
<recipeUsers>
<li>DrugLab</li>
</recipeUsers>
<researchPrerequisite>MedicineProduction</researchPrerequisite>
<skillRequirements>
<Crafting>6</Crafting>
<Intellectual>4</Intellectual>
</skillRequirements>
<bulkRecipeCount>4</bulkRecipeCount>
<displayPriority>2100</displayPriority>
</recipeMaker>
<comps>
<li Class="CompProperties_Drug">
<listOrder>1000</listOrder>
<overdoseSeverityOffset>0.08~0.14</overdoseSeverityOffset>
</li>
</comps>
</ThingDef>