Faction Bond - KonradHeinser/EBSGFramework GitHub Wiki
This hediff comp sets the related hediff's severity to be equal to the number of people in the faction with the hediff (i.e. 1 person with the hediff sets the severity to 1, while 3 pawns sets the severity to 3). This doesn't work with any other hediff that has a severity setting/changing comp. This comp checks specifically for the hediff defName, so two different hediff defs will be handled separately, but one hediff provided by two different sources will be on the same list.
There aren't any extra options for this one, so all you need to do is add the comp into your hediff comps:
<comps>
<li Class="EBSGFramework.HediffCompProperties_FactionBond" />
</comps>
This is an example from SHG - Just the Psionist. The related ability added a permanent hediff to the target and the caster(if the caster didn't have the hediff already), and grants ever increasing bonuses based on how many people in the faction are included in the team.
<HediffDef>
<defName>SHG_Psionist_UnshakableTeam</defName>
<label>unshakable team</label>
<description>The more people in the faction with this hediff, the better the benefits. This caps at 20 people.</description>
<hediffClass>HediffWithComps</hediffClass>
<isBad>false</isBad>
<stages>
<li>
<minSeverity>1</minSeverity>
<label>alone</label>
<statFactors>
<WorkSpeedGlobal>0.80</WorkSpeedGlobal>
<ShootingAccuracyPawn>0.80</ShootingAccuracyPawn>
<MeleeHitChance>0.80</MeleeHitChance>
</statFactors>
</li>
<li>
<minSeverity>2</minSeverity>
<label>duo</label>
<statFactors>
<WorkSpeedGlobal>1.20</WorkSpeedGlobal>
<ShootingAccuracyPawn>1.20</ShootingAccuracyPawn>
<MeleeHitChance>1.20</MeleeHitChance>
</statFactors>
</li>
<li>
<minSeverity>3</minSeverity>
<label>trio</label>
<statFactors>
<WorkSpeedGlobal>1.30</WorkSpeedGlobal>
<ShootingAccuracyPawn>1.30</ShootingAccuracyPawn>
<MeleeHitChance>1.30</MeleeHitChance>
</statFactors>
</li>
<li>
<minSeverity>4</minSeverity>
<label>small team</label>
<statFactors>
<WorkSpeedGlobal>1.40</WorkSpeedGlobal>
<ShootingAccuracyPawn>1.40</ShootingAccuracyPawn>
<MeleeHitChance>1.40</MeleeHitChance>
</statFactors>
</li>
<li>
<minSeverity>6</minSeverity>
<label>team</label>
<statFactors>
<WorkSpeedGlobal>1.60</WorkSpeedGlobal>
<ShootingAccuracyPawn>1.60</ShootingAccuracyPawn>
<MeleeHitChance>1.60</MeleeHitChance>
</statFactors>
</li>
<li>
<minSeverity>8</minSeverity>
<label>large team</label>
<statFactors>
<WorkSpeedGlobal>1.80</WorkSpeedGlobal>
<ShootingAccuracyPawn>1.80</ShootingAccuracyPawn>
<MeleeHitChance>1.80</MeleeHitChance>
</statFactors>
</li>
<li>
<minSeverity>10</minSeverity>
<label>mini legion</label>
<statFactors>
<WorkSpeedGlobal>2.00</WorkSpeedGlobal>
<ShootingAccuracyPawn>2.00</ShootingAccuracyPawn>
<MeleeHitChance>2.00</MeleeHitChance>
</statFactors>
</li>
<li>
<minSeverity>12</minSeverity>
<label>tiny legion</label>
<statFactors>
<WorkSpeedGlobal>2.40</WorkSpeedGlobal>
<ShootingAccuracyPawn>2.40</ShootingAccuracyPawn>
<MeleeHitChance>2.40</MeleeHitChance>
</statFactors>
</li>
<li>
<minSeverity>14</minSeverity>
<label>small legion</label>
<statFactors>
<WorkSpeedGlobal>2.80</WorkSpeedGlobal>
<ShootingAccuracyPawn>2.80</ShootingAccuracyPawn>
<MeleeHitChance>2.80</MeleeHitChance>
</statFactors>
</li>
<li>
<minSeverity>16</minSeverity>
<label>minor legion</label>
<statFactors>
<WorkSpeedGlobal>3.20</WorkSpeedGlobal>
<ShootingAccuracyPawn>3.20</ShootingAccuracyPawn>
<MeleeHitChance>3.20</MeleeHitChance>
</statFactors>
</li>
<li>
<minSeverity>18</minSeverity>
<label>notable legion</label>
<statFactors>
<WorkSpeedGlobal>3.60</WorkSpeedGlobal>
<ShootingAccuracyPawn>3.60</ShootingAccuracyPawn>
<MeleeHitChance>3.60</MeleeHitChance>
</statFactors>
</li>
<li>
<minSeverity>20</minSeverity>
<label>we are legion</label>
<statFactors>
<WorkSpeedGlobal>4.00</WorkSpeedGlobal>
<ShootingAccuracyPawn>4.00</ShootingAccuracyPawn>
<MeleeHitChance>4.00</MeleeHitChance>
</statFactors>
</li>
</stages>
<comps>
<li Class="EBSGFramework.HediffCompProperties_FactionBond" />
</comps>
</HediffDef>