Skip to content

Commit

Permalink
RimWorld 1.3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainMuscles committed Jul 25, 2021
1 parent 410049d commit 2bb1427
Show file tree
Hide file tree
Showing 9 changed files with 293 additions and 1 deletion.
Binary file added 1.2/Assemblies/CM_No_Pawn_Left_Behind.dll
Binary file not shown.
142 changes: 142 additions & 0 deletions 1.2/Patches/PatchInRescueBehavior.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8" ?>
<Patch>

<Operation Class="PatchOperationSequence">
<success>Always</success>
<operations>

<!-- Raiders kidnapping -->
<li Class="PatchOperationAdd">
<xpath>/Defs/DutyDef[defName="Kidnap"]/thinkNode/subNodes</xpath>
<order>Prepend</order>
<value>
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
<rescueChance>0.33</rescueChance>
<searchRadius>10.0</searchRadius>
<opinionPriorityWeight>1.0</opinionPriorityWeight>
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
<distancePriorityWeight>1.0</distancePriorityWeight>
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
</li>
</value>
</li>

<!-- Raiders stealing -->
<li Class="PatchOperationAdd">
<xpath>/Defs/DutyDef[defName="Steal"]/thinkNode/subNodes</xpath>
<order>Prepend</order>
<value>
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
<rescueChance>0.33</rescueChance>
<searchRadius>10.0</searchRadius>
<opinionPriorityWeight>1.0</opinionPriorityWeight>
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
<distancePriorityWeight>1.0</distancePriorityWeight>
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
</li>
</value>
</li>

<!-- PanicFlee mental state used by raiders who fleeing in panic -->
<li Class="PatchOperationAdd">
<xpath>/Defs/ThinkTreeDef[defName="MentalStateNonCritical"]/thinkRoot/subNodes/li[state="PanicFlee"]/subNodes</xpath>
<order>Prepend</order>
<value>
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
<rescueChance>0.5</rescueChance>
<searchRadius>10.0</searchRadius>
<opinionPriorityWeight>1.0</opinionPriorityWeight>
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
<distancePriorityWeight>1.0</distancePriorityWeight>
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
</li>
</value>
</li>

<!-- ExitMapBest duty used by raiders who are giving up -->
<li Class="PatchOperationReplace">
<xpath>/Defs/DutyDef[defName="ExitMapBest"]/thinkNode</xpath>
<value>
<thinkNode Class="ThinkNode_Priority">
<subNodes>
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
<rescueChance>1.00</rescueChance>
<searchRadius>20.0</searchRadius>
<opinionPriorityWeight>1.0</opinionPriorityWeight>
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
<distancePriorityWeight>1.0</distancePriorityWeight>
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
</li>
<li Class="JobGiver_ExitMapBest">
<defaultLocomotion>Walk</defaultLocomotion>
<jobMaxDuration>300</jobMaxDuration>
</li>
</subNodes>
</thinkNode>
</value>
</li>

<!-- ExitMapRandom duty used for fleeing pawns -->
<li Class="PatchOperationReplace">
<xpath>/Defs/DutyDef[defName="ExitMapRandom"]/thinkNode</xpath>
<value>
<thinkNode Class="ThinkNode_Priority">
<subNodes>
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
<!-- Rescue chance checked every time we try this node: once at the beginning and then once every (jobMaxDuration) ticks of the exit map job that follows (default 0.33)-->
<rescueChance>0.5</rescueChance>

<!-- Radius to search (default 10.0) -->
<searchRadius>10.0</searchRadius>

<!-- Remove any of the following parameters or set their value below 0.0 to remove them from calculations -->
<!-- Weight of the opinion of the rescuer on target priority -->
<opinionPriorityWeight>1.0</opinionPriorityWeight>
<!-- Weight of the market value of the target on target priority -->
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
<!-- Weight of the distance to the target on target priority (divisor) -->
<distancePriorityWeight>1.0</distancePriorityWeight>

<!-- Weight of the health of the rescuer on target search range -->
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
</li>
<li Class="JobGiver_ExitMapRandom">
<defaultLocomotion>Walk</defaultLocomotion>
<jobMaxDuration>300</jobMaxDuration>
</li>
</subNodes>
</thinkNode>
</value>
</li>

<!-- ExitMapBestAndDefendSelf duty used by traders who are leaving -->
<li Class="PatchOperationReplace">
<xpath>/Defs/DutyDef[defName="ExitMapBestAndDefendSelf"]/thinkNode</xpath>
<value>
<thinkNode Class="ThinkNode_Priority">
<subNodes>
<li Class="JobGiver_AIDefendSelf">
<targetAcquireRadius>35</targetAcquireRadius>
<targetKeepRadius>40</targetKeepRadius>
</li>
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
<rescueChance>1.00</rescueChance>
<searchRadius>20.0</searchRadius>
<opinionPriorityWeight>1.0</opinionPriorityWeight>
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
<distancePriorityWeight>1.0</distancePriorityWeight>
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
</li>
<li Class="JobGiver_ExitMapBest">
<defaultLocomotion>Walk</defaultLocomotion>
<jobMaxDuration>120</jobMaxDuration>
</li>
</subNodes>
</thinkNode>
</value>
</li>

</operations>
</Operation>

</Patch>
Binary file added 1.3/Assemblies/CM_No_Pawn_Left_Behind.dll
Binary file not shown.
142 changes: 142 additions & 0 deletions 1.3/Patches/PatchInRescueBehavior.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8" ?>
<Patch>

<Operation Class="PatchOperationSequence">
<success>Always</success>
<operations>

<!-- Raiders kidnapping -->
<li Class="PatchOperationAdd">
<xpath>/Defs/DutyDef[defName="Kidnap"]/thinkNode/subNodes</xpath>
<order>Prepend</order>
<value>
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
<rescueChance>0.33</rescueChance>
<searchRadius>10.0</searchRadius>
<opinionPriorityWeight>1.0</opinionPriorityWeight>
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
<distancePriorityWeight>1.0</distancePriorityWeight>
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
</li>
</value>
</li>

<!-- Raiders stealing -->
<li Class="PatchOperationAdd">
<xpath>/Defs/DutyDef[defName="Steal"]/thinkNode/subNodes</xpath>
<order>Prepend</order>
<value>
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
<rescueChance>0.33</rescueChance>
<searchRadius>10.0</searchRadius>
<opinionPriorityWeight>1.0</opinionPriorityWeight>
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
<distancePriorityWeight>1.0</distancePriorityWeight>
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
</li>
</value>
</li>

<!-- PanicFlee mental state used by raiders who fleeing in panic -->
<li Class="PatchOperationAdd">
<xpath>/Defs/ThinkTreeDef[defName="MentalStateNonCritical"]/thinkRoot/subNodes/li[state="PanicFlee"]/subNodes</xpath>
<order>Prepend</order>
<value>
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
<rescueChance>0.5</rescueChance>
<searchRadius>10.0</searchRadius>
<opinionPriorityWeight>1.0</opinionPriorityWeight>
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
<distancePriorityWeight>1.0</distancePriorityWeight>
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
</li>
</value>
</li>

<!-- ExitMapBest duty used by raiders who are giving up -->
<li Class="PatchOperationReplace">
<xpath>/Defs/DutyDef[defName="ExitMapBest"]/thinkNode</xpath>
<value>
<thinkNode Class="ThinkNode_Priority">
<subNodes>
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
<rescueChance>1.00</rescueChance>
<searchRadius>20.0</searchRadius>
<opinionPriorityWeight>1.0</opinionPriorityWeight>
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
<distancePriorityWeight>1.0</distancePriorityWeight>
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
</li>
<li Class="JobGiver_ExitMapBest">
<defaultLocomotion>Walk</defaultLocomotion>
<jobMaxDuration>300</jobMaxDuration>
</li>
</subNodes>
</thinkNode>
</value>
</li>

<!-- ExitMapRandom duty used for fleeing pawns -->
<li Class="PatchOperationReplace">
<xpath>/Defs/DutyDef[defName="ExitMapRandom"]/thinkNode</xpath>
<value>
<thinkNode Class="ThinkNode_Priority">
<subNodes>
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
<!-- Rescue chance checked every time we try this node: once at the beginning and then once every (jobMaxDuration) ticks of the exit map job that follows (default 0.33)-->
<rescueChance>0.5</rescueChance>

<!-- Radius to search (default 10.0) -->
<searchRadius>10.0</searchRadius>

<!-- Remove any of the following parameters or set their value below 0.0 to remove them from calculations -->
<!-- Weight of the opinion of the rescuer on target priority -->
<opinionPriorityWeight>1.0</opinionPriorityWeight>
<!-- Weight of the market value of the target on target priority -->
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
<!-- Weight of the distance to the target on target priority (divisor) -->
<distancePriorityWeight>1.0</distancePriorityWeight>

<!-- Weight of the health of the rescuer on target search range -->
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
</li>
<li Class="JobGiver_ExitMapRandom">
<defaultLocomotion>Walk</defaultLocomotion>
<jobMaxDuration>300</jobMaxDuration>
</li>
</subNodes>
</thinkNode>
</value>
</li>

<!-- ExitMapBestAndDefendSelf duty used by traders who are leaving -->
<li Class="PatchOperationReplace">
<xpath>/Defs/DutyDef[defName="ExitMapBestAndDefendSelf"]/thinkNode</xpath>
<value>
<thinkNode Class="ThinkNode_Priority">
<subNodes>
<li Class="JobGiver_AIDefendSelf">
<targetAcquireRadius>35</targetAcquireRadius>
<targetKeepRadius>40</targetKeepRadius>
</li>
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
<rescueChance>1.00</rescueChance>
<searchRadius>20.0</searchRadius>
<opinionPriorityWeight>1.0</opinionPriorityWeight>
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
<distancePriorityWeight>1.0</distancePriorityWeight>
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
</li>
<li Class="JobGiver_ExitMapBest">
<defaultLocomotion>Walk</defaultLocomotion>
<jobMaxDuration>120</jobMaxDuration>
</li>
</subNodes>
</thinkNode>
</value>
</li>

</operations>
</Operation>

</Patch>
1 change: 1 addition & 0 deletions About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<url>https://github.com/CaptainMuscles/CM_No_Pawn_Left_Behind</url>
<supportedVersions>
<li>1.2</li>
<li>1.3</li>
</supportedVersions>
<description>Would you sit idly by and leave your friends to die? Now your enemies won't either (maybe).

Expand Down
2 changes: 1 addition & 1 deletion About/Manifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>CaptainMuscles.NoPawnLeftBehind</identifier>
<version>1.1.0</version>
<version>1.1.1</version>
<dependencies>
<li>Ludeon.RimWorld</li>
</dependencies>
Expand Down
1 change: 1 addition & 0 deletions About/PublishedFileId.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2401146569
Binary file modified Assemblies/CM_No_Pawn_Left_Behind.dll
Binary file not shown.
6 changes: 6 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [1.1.1] - 2021-07-23

### Added
- Support for RimWorld version 1.3


## [1.1.0] - 2021-03-15

### Added
Expand Down

0 comments on commit 2bb1427

Please sign in to comment.