Temporary Relation - KonradHeinser/EBSGFramework GitHub Wiki

This hediff comp allows you to make pawns have a temporary PawnRelationDef with another pawn until the hediff is removed. The hediff this comp is attached to must be a HediffWithTarget, or some child of that:

        <comps>
            <li Class="EBSGFramework.HediffCompProperties_TemporaryRelation">
            </li>
        </comps>

This comp has two options in it. You do not need to use both of them if you want the opinion to only go one way:

  • ownRelation : This is the PawnRelationDef the pawn with the hediff will have of the hediff's target
  • otherRelation : This is the PawnRelationDef the hediff's target has of the pawn with the hediff

This example makes use of Create Linked Hediff to force the target to have a much more positive opinion of the caster:

    <AbilityDef>
        <defName>Domination</defName>
        <label>test ability</label>
        <description>.</description>
        <iconPath>Things/Mote/SpeechSymbols/Speech</iconPath>
        <cooldownTicksRange>60</cooldownTicksRange>
        <hostile>false</hostile>
        <verbProperties>
            <verbClass>Verb_CastAbility</verbClass>
            <range>30</range>
            <warmupTime>0.5</warmupTime>
            <requireLineOfSight>False</requireLineOfSight>
        </verbProperties>
        <comps>
            <li Class="EBSGFramework.CompProperties_CreateLinkedHediff">
                <hediffOnTarget>Domination</hediffOnTarget>
            </li>
        </comps>
    </AbilityDef>

    <HediffDef>
        <defName>Domination</defName>
        <label>test hediff</label>
        <description>This is on the target</description>
        <everCurableByItem>false</everCurableByItem>
        <initialSeverity>0.001</initialSeverity>
        <stages />
        <hediffClass>HediffWithTarget</hediffClass>
        <scenarioCanAdd>false</scenarioCanAdd>
        <comps>
            <li Class="EBSGFramework.HediffCompProperties_TemporaryRelation">
                <ownRelation>Controller</ownRelation>
                <otherRelation>Thrall</otherRelation>
            </li>
        </comps>
    </HediffDef>

 <!--The target, or the one with the hediff, is using this relation to gain +50 opinion of the caster-->
    <PawnRelationDef>
        <defName>Controller</defName>
        <label>controller</label>
        <importance>85</importance>
        <opinionOffset>50</opinionOffset>
        <implied>false</implied>
        <reflexive>false</reflexive>
    </PawnRelationDef>

 <!--The caster, or the one the hediff targets, is using this relation to gain +10 opinion of the target-->
    <PawnRelationDef>
        <defName>Thrall</defName>
        <label>thrall</label>
        <importance>85</importance>
        <opinionOffset>10</opinionOffset>
        <implied>false</implied>
        <reflexive>false</reflexive>
    </PawnRelationDef>
⚠️ **GitHub.com Fallback** ⚠️