Murderous Need - KonradHeinser/EBSGFramework GitHub Wiki

This need class allows you to create a customizable version of kill thirst that allows you to specify the rate that it falls and recovers, along with what counts as a kill. For this need to function, it requires the related class, and if you want to add specifications it needs the EBSG Extension. Unlike most needs, it uses a fall rate designated in the extension rather than in the NeedDef itself:

        <needClass>EBSGFramework.Need_Murderous</needClass>

        <modExtensions>
            <li Class="EBSGFramework.EBSGExtension">
            </li>
        </modExtensions>

See Generic Needs for all the basic need stuff which this can use. This page only covers the murder side of things. It is important to note that if you're using stuff in this extension, you'll need to add <ageRange>13</ageRange> to ensure the pawn is capable of murder. The 13 can be a higher number, but probably shouldn't be lower. Also, unless you want the pawn to be excessively desperate for murder, you will need to specify the fallPerDay in the NeedDef

These are the options available within the extension:

  • increasePerKill : Default (1) : Increase when the pawn kills any valid target with any weapon or body part
  • increasePerMeleeKill : Default (0) : Increase when the pawn kills any valid target with a melee weapon or body part
  • increasePerRangedKill : Default (0) : Increase when the pawn kills any valid target with a ranged weapon
  • targetParams : The same targeting parameters you can find in things like abilities which restricts what counts as valid targets for need increase on kill

This example creates a variation of the kill thirst gene that accepts any kill to satisfy the need. The need will display the small tick marks at the 30% and the 60% thresholds. Because it just uses the default increasePerKill it technically doesn't need to have that node at all, it's just there to provide a more thorough example of what it would look like:

    <GeneDef>
        <defName>Murderous</defName>
        <label>murderous</label>
        <labelShortAdj>murderous</labelShortAdj>
        <description>This person just wants to kill things and doesn't really care how.</description>
        <displayCategory>Violence</displayCategory>
        <displayOrderInCategory>61</displayOrderInCategory>
        <iconPath>UI/Icons/Genes/Gene_Killthirst</iconPath>
        <geneClass>EBSGFramework.HediffAdder</geneClass>
        <enablesNeeds><li>Murderous</li></enablesNeeds> <!--Any need adding method works, gene was just easiest here-->
        <biostatMet>3</biostatMet>
        <minAgeActive>13</minAgeActive>
        <exclusionTags>
            <li>KillThirst</li>
        </exclusionTags>
    </GeneDef>
    
    <NeedDef>
        <defName>Murderous</defName>
        <needClass>EBSGFramework.Need_Murderous</needClass>
        <label>murderous</label>
        <description>This person just wants to kill things and doesn't really care how.</description>
        <baseLevel>0</baseLevel>
        <fallPerDay>0.0333</fallPerDay> <!--Manually set because the normal need rate is really high-->
        <minIntelligence>ToolUser</minIntelligence>
        <colonistAndPrisonersOnly>true</colonistAndPrisonersOnly>
        <onlyIfCausedByGene>true</onlyIfCausedByGene>
        <modExtensions>
            <li Class="EBSGFramework.EBSGExtension">
                <increasePerKill>1</increasePerKill>
                <thresholdPercentages>
                    <li>0.3</li>
                    <li>0.6</li>
                </thresholdPercentages>
            </li>
        </modExtensions>
    </NeedDef>
⚠️ **GitHub.com Fallback** ⚠️