Skip to content
Matthew Walls edited this page Nov 3, 2018 · 3 revisions

ThinkNode_ConditionalWorkTypeDefs

Do subnodes if assigned to one of these work types

Example

<li Class="ThinkNode.ThinkNode_ConditionalWorkTypeDefs">
  <workTypeDefs>
    <li>Warden</li>
  </workTypeDefs>
  <subNodes>
    <li Class="JobGiver_WanderOwnRoom"/>
  </subNodes>
</li>

ThinkNodes.JobGiver_Capture

If a pawn is downed and hostile to you within a radius of you take them to a jail bed.

<li Class="ThinkNodes.JobGiver_Capture">
    <targetAcquireRadius>18</targetAcquireRadius>
</li>

JobGiver_GoToClosestThingDef

Choose a thing to go to and max path danger.

<li Class="ThinkNode.JobGiver_GoToClosestThingDef><danger>Some</danger><thingDef>PartySpot</thingDef></li>

ThinkNode_ConditionalHediff

Looks if the pawn has the given hediff then perform the subnodes.

<li Class="ThinkNode.ThinkNode_ConditionalHediff>
<hediffDef>BloodLoss</hediffDef>
<subNodes>
            <li Class="JobGiver_WanderOwnRoom"/>
<subNodes>

</li>

ThinkNodes.ThinkNode_ConditionalHunter

  • allowBrawlers - true,false

ThinkNode_ConditionalDelay

  • min, max - Whole Numbers

ThinkNode_ConditionalMissingHuntingWeapon

  • No properties

Example Patch:

<?xml version="1.0" encoding="UTF-8"?>
<Patch>
    <Operation Class="PatchOperationInsert">
        <xpath>/Defs/ThinkTreeDef[defName = "Humanlike"]/thinkRoot/subNodes/li[@Class="ThinkNode_SubtreesByTag"]</xpath>
        <value>
            <li Class="ThinkNode_ConditionalDrafted">
                <invert>true</invert>
                <subNodes>
                    <li Class="ThinkNodes.ThinkNode_ConditionalDelay">
                        <min>1000</min>
                        <max>5000</max>
                        <subNodes>
                          ...
                        </subNodes>
                    </li>
                    <li Class="ThinkNodes.ThinkNode_ConditionalHunter">
                        <allowBrawlers>false</allowBrawlers>
                        <subNodes>
                            <li Class="ThinkNodes.ThinkNode_ConditionalMissingHuntingWeapon">
                                <subNodes>
                                   ...
                                </subNodes>
                            </li>
                        </subNodes>
                    </li>
                </subNodes>
            </li>
        </value>
    </Operation>
</Patch>

Remember all conditionals can have flag.