Skip to content

Commit 394066d

Browse files
Initial submission
1 parent cc9ed7f commit 394066d

13 files changed

+499
-0
lines changed

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/[Oo]bj/
2+
3+
# Autogenerated VS/MD solution and project files
4+
ExportedObj/
5+
*.suo
6+
*.tmp
7+
*.user
8+
*.userprefs
9+
*.pidb
10+
*.booproj
11+
*.svd
12+
Source/CM_No_Pawn_Left_Behind/.idea/
13+
Source/CM_No_Pawn_Left_Behind/.vs/
14+
Source/CM_No_Pawn_Left_Behind/bin/
15+
Source/CM_No_Pawn_Left_Behind/obj/
16+
Source/CM_No_Pawn_Left_Behind/packages/

About/About.xml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ModMetaData>
3+
<name>No Pawn Left Behind</name>
4+
<author>Captain Muscles (Nathan Harbour)</author>
5+
<packageId>CaptainMuscles.NoPawnLeftBehind</packageId>
6+
<url>https://github.com/CaptainMuscles/CM_No_Pawn_Left_Behind</url>
7+
<supportedVersions>
8+
<li>1.2</li>
9+
</supportedVersions>
10+
<description>Would you sit idly by and leave your friends to die? Now your enemies won't either (maybe).
11+
12+
No Pawn Left Behind enables your enemies to rescue their fallen allies when fleeing a battle.</description>
13+
<modDependencies>
14+
<li>
15+
<packageId>brrainz.harmony</packageId>
16+
<displayName>Harmony</displayName>
17+
<steamWorkshopUrl>steam://url/CommunityFilePage/2009463077</steamWorkshopUrl>
18+
<downloadUrl>https://github.com/pardeike/HarmonyRimWorld/releases/latest</downloadUrl>
19+
</li>
20+
</modDependencies>
21+
22+
<loadAfter>
23+
<li>Ludeon.RimWorld</li>
24+
<li>brrainz.harmony</li>
25+
</loadAfter>
26+
</ModMetaData>

About/Manifest.xml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<Manifest>
3+
<identifier>CaptainMuscles.NoPawnLeftBehind</identifier>
4+
<version>1.0.0</version>
5+
<dependencies>
6+
<li>Ludeon.RimWorld</li>
7+
<li>brrainz.harmony</li>
8+
</dependencies>
9+
<loadAfter>
10+
<li>Ludeon.RimWorld</li>
11+
<li>brrainz.harmony</li>
12+
</loadAfter>
13+
<showCrossPromotions>true</showCrossPromotions>
14+
<downloadUri>https://github.com/CaptainMuscles/CM_No_Pawn_Left_Behind/releases</downloadUri>
15+
</Manifest>

About/Preview.png

256 KB
Loading

Assemblies/CM_No_Pawn_Left_Behind.dll

9.5 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<LanguageData>
3+
4+
<CM_No_Pawn_Left_Behind_Settings_Log_Priorities_Label>Log priority calculations in dev mode</CM_No_Pawn_Left_Behind_Settings_Log_Priorities_Label>
5+
6+
</LanguageData>

Patches/PatchInRescueBehavior.xml

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Patch>
3+
4+
<Operation Class="PatchOperationSequence">
5+
<!--<success>Always</success>-->
6+
<operations>
7+
8+
<!-- Raiders kidnapping -->
9+
<li Class="PatchOperationAdd">
10+
<xpath>/Defs/DutyDef[defName="Kidnap"]/thinkNode/subNodes</xpath>
11+
<order>Prepend</order>
12+
<value>
13+
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
14+
<rescueChance>0.33</rescueChance>
15+
<searchRadius>10.0</searchRadius>
16+
<opinionPriorityWeight>1.0</opinionPriorityWeight>
17+
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
18+
<distancePriorityWeight>1.0</distancePriorityWeight>
19+
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
20+
</li>
21+
</value>
22+
</li>
23+
24+
<!-- Raiders stealing -->
25+
<li Class="PatchOperationAdd">
26+
<xpath>/Defs/DutyDef[defName="Steal"]/thinkNode/subNodes</xpath>
27+
<order>Prepend</order>
28+
<value>
29+
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
30+
<rescueChance>0.33</rescueChance>
31+
<searchRadius>10.0</searchRadius>
32+
<opinionPriorityWeight>1.0</opinionPriorityWeight>
33+
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
34+
<distancePriorityWeight>1.0</distancePriorityWeight>
35+
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
36+
</li>
37+
</value>
38+
</li>
39+
40+
<!-- PanicFlee mental state used by raiders who fleeing in panic -->
41+
<li Class="PatchOperationAdd">
42+
<xpath>/Defs/ThinkTreeDef[defName="MentalStateNonCritical"]/thinkRoot/subNodes/li[state="PanicFlee"]/subNodes</xpath>
43+
<order>Prepend</order>
44+
<value>
45+
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
46+
<rescueChance>0.5</rescueChance>
47+
<searchRadius>10.0</searchRadius>
48+
<opinionPriorityWeight>1.0</opinionPriorityWeight>
49+
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
50+
<distancePriorityWeight>1.0</distancePriorityWeight>
51+
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
52+
</li>
53+
</value>
54+
</li>
55+
56+
<!-- ExitMapBest duty used by raiders who are giving up -->
57+
<li Class="PatchOperationReplace">
58+
<xpath>/Defs/DutyDef[defName="ExitMapBest"]/thinkNode</xpath>
59+
<value>
60+
<thinkNode Class="ThinkNode_Priority">
61+
<subNodes>
62+
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
63+
<rescueChance>1.00</rescueChance>
64+
<searchRadius>20.0</searchRadius>
65+
<opinionPriorityWeight>1.0</opinionPriorityWeight>
66+
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
67+
<distancePriorityWeight>1.0</distancePriorityWeight>
68+
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
69+
</li>
70+
<li Class="JobGiver_ExitMapBest">
71+
<defaultLocomotion>Walk</defaultLocomotion>
72+
<jobMaxDuration>300</jobMaxDuration>
73+
</li>
74+
</subNodes>
75+
</thinkNode>
76+
</value>
77+
</li>
78+
79+
<!-- ExitMapRandom duty used for fleeing pawns -->
80+
<li Class="PatchOperationReplace">
81+
<xpath>/Defs/DutyDef[defName="ExitMapRandom"]/thinkNode</xpath>
82+
<value>
83+
<thinkNode Class="ThinkNode_Priority">
84+
<subNodes>
85+
<li Class="CM_No_Pawn_Left_Behind.JobGiver_Rescue">
86+
<!-- 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)-->
87+
<rescueChance>0.5</rescueChance>
88+
89+
<!-- Radius to search (default 10.0) -->
90+
<searchRadius>10.0</searchRadius>
91+
92+
<!-- Remove any of the following parameters or set their value below 0.0 to remove them from calculations -->
93+
<!-- Weight of the opinion of the rescuer on target priority -->
94+
<opinionPriorityWeight>1.0</opinionPriorityWeight>
95+
<!-- Weight of the market value of the target on target priority -->
96+
<marketValuePriorityWeight>1.0</marketValuePriorityWeight>
97+
<!-- Weight of the distance to the target on target priority (divisor) -->
98+
<distancePriorityWeight>1.0</distancePriorityWeight>
99+
100+
<!-- Weight of the health of the rescuer on target search range -->
101+
<healthSearchDistanceWeight>1.0</healthSearchDistanceWeight>
102+
</li>
103+
<li Class="JobGiver_ExitMapRandom">
104+
<defaultLocomotion>Walk</defaultLocomotion>
105+
<jobMaxDuration>300</jobMaxDuration>
106+
</li>
107+
</subNodes>
108+
</thinkNode>
109+
</value>
110+
</li>
111+
112+
</operations>
113+
</Operation>
114+
115+
</Patch>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{9269D4B6-8D8F-4247-A71E-D3603A311590}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>CM_No_Pawn_Left_Behind</RootNamespace>
11+
<AssemblyName>CM_No_Pawn_Left_Behind</AssemblyName>
12+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>false</DebugSymbols>
18+
<DebugType>none</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>..\..\Assemblies\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="0Harmony">
35+
<HintPath>..\..\..\..\..\..\workshop\content\294100\2009463077\Current\Assemblies\0Harmony.dll</HintPath>
36+
<Private>False</Private>
37+
</Reference>
38+
<Reference Include="Assembly-CSharp">
39+
<HintPath>..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
40+
<Private>False</Private>
41+
</Reference>
42+
<Reference Include="System" />
43+
<Reference Include="System.Core" />
44+
<Reference Include="System.Xml.Linq" />
45+
<Reference Include="System.Data.DataSetExtensions" />
46+
<Reference Include="Microsoft.CSharp" />
47+
<Reference Include="System.Data" />
48+
<Reference Include="System.Net.Http" />
49+
<Reference Include="System.Xml" />
50+
<Reference Include="UnityEngine.CoreModule">
51+
<HintPath>..\..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
52+
<Private>False</Private>
53+
</Reference>
54+
</ItemGroup>
55+
<ItemGroup>
56+
<Compile Include="JobGiver_Rescue.cs" />
57+
<Compile Include="RescueMod.cs" />
58+
<Compile Include="Properties\AssemblyInfo.cs" />
59+
<Compile Include="RescueModSettings.cs" />
60+
</ItemGroup>
61+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
62+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.28307.136
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CM_No_Pawn_Left_Behind", "CM_No_Pawn_Left_Behind.csproj", "{9269D4B6-8D8F-4247-A71E-D3603A311590}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{9269D4B6-8D8F-4247-A71E-D3603A311590}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{9269D4B6-8D8F-4247-A71E-D3603A311590}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{9269D4B6-8D8F-4247-A71E-D3603A311590}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{9269D4B6-8D8F-4247-A71E-D3603A311590}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {1A953B2E-2B6F-4DF1-B2E2-53CCCE9B8C82}
24+
EndGlobalSection
25+
EndGlobal

0 commit comments

Comments
 (0)