diff --git a/.gitignore b/.gitignore
index 3210abc2..3f913b82 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,36 +1,61 @@
-# Windows image file caches
+#About/PublishedFileId.txt # shouldn't be ignored; needed to ensure same Steam workshop item is updated (and is ignored outside of Steam anyway)
+Source/DiscordWebhookToken.txt
+updateinfo
+RimworldModReleaseTool.exe
+
+# Ensure RimWorld/Unity assemblies are ignored
+Assemblies/Assembly-CSharp*.dll
+Assemblies/UnityEngine.*dll*
+Assemblies/Unity.*dll
+Assemblies/Mono.*dll
+Assemblies/mscorlib.dll
+Assemblies/System.*dll
+Assemblies/TextMeshPro-*.dll
+Assemblies/ISharpZipLib.dll
+Assemblies/NAudio.dll
+Assemblies/NVorbis.dll
+
+
+## Ignore Windows temporary/cache files
+## Get latest from https://github.com/github/gitignore/blob/master/Global/Windows.gitignore
+
+# Windows thumbnail cache files
Thumbs.db
+Thumbs.db:encryptable
ehthumbs.db
+ehthumbs_vista.db
+
+# Dump file
+*.stackdump
# Folder config file
-Desktop.ini
+[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
-#folders we don't need
-[Oo]bj/
-
# Windows Installer files
*.cab
*.msi
+*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
-# =========================
-# Operating System Files
-# =========================
-# OSX
-# =========================
+## Ignore macOS temporary/cache files
+## Get latest from https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
+# General
.DS_Store
.AppleDouble
.LSOverride
+# Icon must end with two \r
+Icon
+
# Thumbnails
._*
@@ -41,6 +66,7 @@ $RECYCLE.BIN/
.TemporaryItems
.Trashes
.VolumeIcon.icns
+.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
@@ -49,23 +75,6 @@ Network Trash Folder
Temporary Items
.apdisk
-[Oo]bj/
-About/PublishedFileId.txt
-Assemblies/Assembly-CSharp.dll
-Assemblies/UnityEngine.dll
-Assemblies/Assembly-CSharp-firstpass.dll
-Assemblies/UnityEngine.UI.dll
-Assemblies/TextMeshPro-1.0.55.56.0b11.dll
-Assemblies/NAudio.dll
-Assemblies/NVorbis.dll
-Source/Dependencies
-Source/DiscordWebhookToken.txt
-updateinfo
-
-
-# Prevents node or other packages.
-
-packages/
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
@@ -82,6 +91,9 @@ packages/
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
+# Mono auto generated files
+mono_crash.*
+
# Build results
[Dd]ebug/
[Dd]ebugPublic/
@@ -89,10 +101,14 @@ packages/
[Rr]eleases/
x64/
x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
+[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
@@ -106,9 +122,10 @@ Generated\ Files/
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
-# NUNIT
+# NUnit
*.VisualState.xml
TestResult.xml
+nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
@@ -123,6 +140,9 @@ project.lock.json
project.fragment.lock.json
artifacts/
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
# StyleCop
StyleCopReport.xml
@@ -189,9 +209,6 @@ _ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
-# JustCode is a .NET coding add-in
-.JustCode
-
# TeamCity is a build add-in
_TeamCity*
@@ -202,6 +219,9 @@ _TeamCity*
.axoCover/*
!.axoCover/settings.json
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*[.json, .xml, .info]
+
# Visual Studio code coverage results
*.coverage
*.coveragexml
@@ -249,6 +269,8 @@ PublishScripts/
# NuGet Packages
*.nupkg
+# NuGet Symbol Packages
+*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
@@ -273,12 +295,14 @@ BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
+*.appxbundle
+*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
-!*.[Cc]ache/
+!?*.[Cc]ache/
# Others
ClientBin/
@@ -322,6 +346,9 @@ ServiceFabricBackup/
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
@@ -357,10 +384,6 @@ paket-files/
# FAKE - F# Make
.fake/
-# JetBrains Rider
-.idea/
-*.sln.iml
-
# CodeRush personal settings
.cr/personal
@@ -401,11 +424,33 @@ ASALocalRun/
# Local History for Visual Studio
.localhistory/
-*.ide-shm
-*.ide-wal
-Source/.vs/JecsTools/v15/.suo
-Source/.vs/JecsTools/v15/.suo
-Source/.vs/JecsTools/v15/Server/sqlite3/storage.ide-shm
-Source/.vs/JecsTools/v15/.suo
-Source/DiscordWebhookToken.txt
-updateinfo
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+
+## Ignore Visual Studio Code workspace and settings
+## Get latest from https://github.com/github/gitignore/blob/master/Global/VisualStudioCode.gitignore
+
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+*.code-workspace
+
+# Local History for Visual Studio Code
+.history/
diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite
deleted file mode 100644
index dae54cad..00000000
Binary files a/.vs/slnx.sqlite and /dev/null differ
diff --git a/1.3/Assemblies/AbilityUserAI.dll b/1.3/Assemblies/AbilityUserAI.dll
index 75582f38..5d925ce5 100644
Binary files a/1.3/Assemblies/AbilityUserAI.dll and b/1.3/Assemblies/AbilityUserAI.dll differ
diff --git a/1.3/Assemblies/CompActivatableEffect.dll b/1.3/Assemblies/CompActivatableEffect.dll
index 16126188..8a31d133 100644
Binary files a/1.3/Assemblies/CompActivatableEffect.dll and b/1.3/Assemblies/CompActivatableEffect.dll differ
diff --git a/1.3/Assemblies/CompAnimated.dll b/1.3/Assemblies/CompAnimated.dll
index 09fdfc1e..cef92b7e 100644
Binary files a/1.3/Assemblies/CompAnimated.dll and b/1.3/Assemblies/CompAnimated.dll differ
diff --git a/1.3/Assemblies/CompBalloon.dll b/1.3/Assemblies/CompBalloon.dll
index 42220e93..2aa33200 100644
Binary files a/1.3/Assemblies/CompBalloon.dll and b/1.3/Assemblies/CompBalloon.dll differ
diff --git a/1.3/Assemblies/CompBigBox.dll b/1.3/Assemblies/CompBigBox.dll
index 31479095..879bcfbe 100644
Binary files a/1.3/Assemblies/CompBigBox.dll and b/1.3/Assemblies/CompBigBox.dll differ
diff --git a/1.3/Assemblies/CompDeflector.dll b/1.3/Assemblies/CompDeflector.dll
index d68d4221..da5ba8a7 100644
Binary files a/1.3/Assemblies/CompDeflector.dll and b/1.3/Assemblies/CompDeflector.dll differ
diff --git a/1.3/Assemblies/CompDelayedSpawner.dll b/1.3/Assemblies/CompDelayedSpawner.dll
index 234c054f..91cbd6fd 100644
Binary files a/1.3/Assemblies/CompDelayedSpawner.dll and b/1.3/Assemblies/CompDelayedSpawner.dll differ
diff --git a/1.3/Assemblies/CompExtraSounds.dll b/1.3/Assemblies/CompExtraSounds.dll
index feca712a..83cca71b 100644
Binary files a/1.3/Assemblies/CompExtraSounds.dll and b/1.3/Assemblies/CompExtraSounds.dll differ
diff --git a/1.3/Assemblies/CompInstalledPart.dll b/1.3/Assemblies/CompInstalledPart.dll
index b20777a3..39fd1101 100644
Binary files a/1.3/Assemblies/CompInstalledPart.dll and b/1.3/Assemblies/CompInstalledPart.dll differ
diff --git a/1.3/Assemblies/CompLumbering.dll b/1.3/Assemblies/CompLumbering.dll
index 1d1eb043..3cce4e10 100644
Binary files a/1.3/Assemblies/CompLumbering.dll and b/1.3/Assemblies/CompLumbering.dll differ
diff --git a/1.3/Assemblies/CompOverlays.dll b/1.3/Assemblies/CompOverlays.dll
index e70e9016..5bbe179e 100644
Binary files a/1.3/Assemblies/CompOverlays.dll and b/1.3/Assemblies/CompOverlays.dll differ
diff --git a/1.3/Assemblies/CompOversizedWeapon.dll b/1.3/Assemblies/CompOversizedWeapon.dll
index 7c546b78..b7c14cd0 100644
Binary files a/1.3/Assemblies/CompOversizedWeapon.dll and b/1.3/Assemblies/CompOversizedWeapon.dll differ
diff --git a/1.3/Assemblies/CompSlotLoadable.dll b/1.3/Assemblies/CompSlotLoadable.dll
index 06b90070..3be036ac 100644
Binary files a/1.3/Assemblies/CompSlotLoadable.dll and b/1.3/Assemblies/CompSlotLoadable.dll differ
diff --git a/1.3/Assemblies/CompToggleDef.dll b/1.3/Assemblies/CompToggleDef.dll
index 8698d401..2b1701db 100644
Binary files a/1.3/Assemblies/CompToggleDef.dll and b/1.3/Assemblies/CompToggleDef.dll differ
diff --git a/1.3/Assemblies/PawnShields.dll b/1.3/Assemblies/PawnShields.dll
index c805aad6..9190eab5 100644
Binary files a/1.3/Assemblies/PawnShields.dll and b/1.3/Assemblies/PawnShields.dll differ
diff --git a/1.3/Assemblies/ThinkNodes.dll b/1.3/Assemblies/ThinkNodes.dll
index 4a7f2957..bf2d6284 100644
Binary files a/1.3/Assemblies/ThinkNodes.dll and b/1.3/Assemblies/ThinkNodes.dll differ
diff --git a/1.3/Languages/Japanese/Keyed/Grapple.xml b/1.3/Languages/Japanese/Keyed/Grapple.xml
index 986a776d..10ab3a5d 100644
--- a/1.3/Languages/Japanese/Keyed/Grapple.xml
+++ b/1.3/Languages/Japanese/Keyed/Grapple.xml
@@ -1,11 +1,12 @@
-
-
-
- 捕縛に成功
- 捕縛に失敗
- 倒れている相手:捕縛に成功
- 奇襲攻撃の相手:捕縛に成功
- 拘束中の相手:捕縛に成功
- 睡眠中の相手:捕縛に成功
-
+
+
+
+ 捕縛に成功
+ 捕縛に失敗
+ 倒れている相手:捕縛に成功
+ 奇襲攻撃の相手:捕縛に成功
+ 拘束中の相手:捕縛に成功
+ 睡眠中の相手:捕縛に成功
+ 屠畜中の動物:捕縛に成功
+
\ No newline at end of file
diff --git a/1.4/Assemblies/0JecsTools.dll b/1.4/Assemblies/0JecsTools.dll
index bf4e2c17..3f0619d0 100644
Binary files a/1.4/Assemblies/0JecsTools.dll and b/1.4/Assemblies/0JecsTools.dll differ
diff --git a/1.4/Assemblies/AbilityUser.dll b/1.4/Assemblies/AbilityUser.dll
index 48a22137..119acd95 100644
Binary files a/1.4/Assemblies/AbilityUser.dll and b/1.4/Assemblies/AbilityUser.dll differ
diff --git a/1.4/Assemblies/AbilityUserAI.dll b/1.4/Assemblies/AbilityUserAI.dll
index f6d31c81..ef2844ef 100644
Binary files a/1.4/Assemblies/AbilityUserAI.dll and b/1.4/Assemblies/AbilityUserAI.dll differ
diff --git a/1.4/Assemblies/CompActivatableEffect.dll b/1.4/Assemblies/CompActivatableEffect.dll
index d8a8fb82..f900c46e 100644
Binary files a/1.4/Assemblies/CompActivatableEffect.dll and b/1.4/Assemblies/CompActivatableEffect.dll differ
diff --git a/1.4/Assemblies/CompAnimated.dll b/1.4/Assemblies/CompAnimated.dll
index bccf873c..9a4d5991 100644
Binary files a/1.4/Assemblies/CompAnimated.dll and b/1.4/Assemblies/CompAnimated.dll differ
diff --git a/1.4/Assemblies/CompBalloon.dll b/1.4/Assemblies/CompBalloon.dll
index b30f8544..b2879f70 100644
Binary files a/1.4/Assemblies/CompBalloon.dll and b/1.4/Assemblies/CompBalloon.dll differ
diff --git a/1.4/Assemblies/CompBigBox.dll b/1.4/Assemblies/CompBigBox.dll
index 7ad69631..d6bf993a 100644
Binary files a/1.4/Assemblies/CompBigBox.dll and b/1.4/Assemblies/CompBigBox.dll differ
diff --git a/1.4/Assemblies/CompDeflector.dll b/1.4/Assemblies/CompDeflector.dll
index ed5bab0e..498b0e4a 100644
Binary files a/1.4/Assemblies/CompDeflector.dll and b/1.4/Assemblies/CompDeflector.dll differ
diff --git a/1.4/Assemblies/CompDelayedSpawner.dll b/1.4/Assemblies/CompDelayedSpawner.dll
index dd070d21..09a326c8 100644
Binary files a/1.4/Assemblies/CompDelayedSpawner.dll and b/1.4/Assemblies/CompDelayedSpawner.dll differ
diff --git a/1.4/Assemblies/CompExtraSounds.dll b/1.4/Assemblies/CompExtraSounds.dll
index 870924e8..bbef5229 100644
Binary files a/1.4/Assemblies/CompExtraSounds.dll and b/1.4/Assemblies/CompExtraSounds.dll differ
diff --git a/1.4/Assemblies/CompInstalledPart.dll b/1.4/Assemblies/CompInstalledPart.dll
index 7ba08e38..5b6d60f4 100644
Binary files a/1.4/Assemblies/CompInstalledPart.dll and b/1.4/Assemblies/CompInstalledPart.dll differ
diff --git a/1.4/Assemblies/CompLumbering.dll b/1.4/Assemblies/CompLumbering.dll
index 68b2c3e8..38a1c8c4 100644
Binary files a/1.4/Assemblies/CompLumbering.dll and b/1.4/Assemblies/CompLumbering.dll differ
diff --git a/1.4/Assemblies/CompOverlays.dll b/1.4/Assemblies/CompOverlays.dll
index a5df9371..8c3208a1 100644
Binary files a/1.4/Assemblies/CompOverlays.dll and b/1.4/Assemblies/CompOverlays.dll differ
diff --git a/1.4/Assemblies/CompOversizedWeapon.dll b/1.4/Assemblies/CompOversizedWeapon.dll
index 021db99b..dc273e84 100644
Binary files a/1.4/Assemblies/CompOversizedWeapon.dll and b/1.4/Assemblies/CompOversizedWeapon.dll differ
diff --git a/1.4/Assemblies/CompSlotLoadable.dll b/1.4/Assemblies/CompSlotLoadable.dll
index 251357e1..9b3fae54 100644
Binary files a/1.4/Assemblies/CompSlotLoadable.dll and b/1.4/Assemblies/CompSlotLoadable.dll differ
diff --git a/1.4/Assemblies/CompToggleDef.dll b/1.4/Assemblies/CompToggleDef.dll
index 67a33ecc..a9146861 100644
Binary files a/1.4/Assemblies/CompToggleDef.dll and b/1.4/Assemblies/CompToggleDef.dll differ
diff --git a/1.4/Assemblies/PawnShields.dll b/1.4/Assemblies/PawnShields.dll
index f8f157d2..680c59b6 100644
Binary files a/1.4/Assemblies/PawnShields.dll and b/1.4/Assemblies/PawnShields.dll differ
diff --git a/1.4/Assemblies/ThinkNodes.dll b/1.4/Assemblies/ThinkNodes.dll
index 694cd5b5..b9c9ec70 100644
Binary files a/1.4/Assemblies/ThinkNodes.dll and b/1.4/Assemblies/ThinkNodes.dll differ
diff --git a/1.4/Languages/Japanese/Keyed/Grapple.xml b/1.4/Languages/Japanese/Keyed/Grapple.xml
index 986a776d..1369b187 100644
--- a/1.4/Languages/Japanese/Keyed/Grapple.xml
+++ b/1.4/Languages/Japanese/Keyed/Grapple.xml
@@ -7,5 +7,6 @@
奇襲攻撃の相手:捕縛に成功
拘束中の相手:捕縛に成功
睡眠中の相手:捕縛に成功
+ 屠畜中の動物:捕縛に成功
\ No newline at end of file
diff --git a/About/About.xml b/About/About.xml
index 0a85bfd5..2b68befd 100644
--- a/About/About.xml
+++ b/About/About.xml
@@ -19,7 +19,7 @@
https://github.com/pardeike/HarmonyRimWorld/releases/latest
- 1.3.0.5 (10-09-2022)
+ 1.4.0.0 (10-21-2022)
Adds modding components to RimWorld: vehicles, spell casting, weapon slots, oversized weapons, and more!
@@ -76,13 +76,26 @@ Michael Fisher, Storm D Bain, Luke Salinas, WonkyWoo WeebHoo, Daniel Schott, Rai
========================
Changelog
========================
+1.4.0.0 (10-21-2022)
+========================
+Initial update for RimWorld 1.4 of JecsTools
+
+1.3.0.5 (10-09-2022)
+========================
+Updated assemblies for RimWorld 1.4 unstable support.
+- JecsTools BackstoryDef now inherits new RimWorld BackstoryDef setup. Once again based on erdelf's work.
+
1.3.0.4 (08-08-2022)
========================
damageTypesToExclude was not working correctly and has been fixed. Grappling a pet will always succeed which should prevent some fustration. Credit for this update goes to Gefallener from our RoM Discord.
+1.3.0.3b (07-31-2021)
+====================
+Workaround for mod lists that contain other mods with an outdated copy of CompOversizedWeapon that's loaded before ours
+
1.3.0.3 (07-30-2021)
========================
-Due to comptability issues, the patch for Enable Oversized Weapons will require additional work. Reverting back to the previous version.
+Due to compatibility issues, the patch for Enable Oversized Weapons will require additional work. Reverting back to the previous version.
1.3.0.2 (07-29-2021)
========================
diff --git a/About/Changelog.txt b/About/Changelog.txt
index 50a29654..e9716461 100644
--- a/About/Changelog.txt
+++ b/About/Changelog.txt
@@ -1,3 +1,7 @@
+1.4.0.0 (10-21-2022)
+========================
+Initial update for RimWorld 1.4 of JecsTools
+
1.3.0.5 (10-09-2022)
========================
Updated assemblies for RimWorld 1.4 unstable support.
@@ -7,9 +11,13 @@ Updated assemblies for RimWorld 1.4 unstable support.
========================
damageTypesToExclude was not working correctly and has been fixed. Grappling a pet will always succeed which should prevent some fustration. Credit for this update goes to Gefallener from our RoM Discord.
+1.3.0.3b (07-31-2021)
+====================
+Workaround for mod lists that contain other mods with an outdated copy of CompOversizedWeapon that's loaded before ours
+
1.3.0.3 (07-30-2021)
========================
-Due to comptability issues, the patch for Enable Oversized Weapons will require additional work. Reverting back to the previous version.
+Due to compatibility issues, the patch for Enable Oversized Weapons will require additional work. Reverting back to the previous version.
1.3.0.2 (07-29-2021)
========================
diff --git a/About/Manifest.xml b/About/Manifest.xml
index 61d04602..cbd9e1ab 100644
--- a/About/Manifest.xml
+++ b/About/Manifest.xml
@@ -1,7 +1,7 @@
JecsTools
- 1.3.0.5
+ 1.4.0.0
https://raw.githubusercontent.com/jecrell/JecsTools/master/About/Manifest.xml
diff --git a/About/PatreonURL.txt b/About/PatreonURL.txt
index dd02ada6..6c414d7d 100644
--- a/About/PatreonURL.txt
+++ b/About/PatreonURL.txt
@@ -1 +1 @@
-https://www.patreon.com/posts/54071148
\ No newline at end of file
+https://www.patreon.com/posts/73617775
\ No newline at end of file
diff --git a/About/Version.txt b/About/Version.txt
index e474c207..149bb3c1 100644
--- a/About/Version.txt
+++ b/About/Version.txt
@@ -1 +1 @@
-1.3.0.5
+1.4.0.0
diff --git a/Assemblies/0Harmony.dll b/Assemblies/0Harmony.dll
deleted file mode 100644
index 106a81a9..00000000
Binary files a/Assemblies/0Harmony.dll and /dev/null differ
diff --git a/Assemblies/0JecsTools.dll b/Assemblies/0JecsTools.dll
deleted file mode 100644
index 60d63d23..00000000
Binary files a/Assemblies/0JecsTools.dll and /dev/null differ
diff --git a/Assemblies/AbilityUser.dll b/Assemblies/AbilityUser.dll
deleted file mode 100644
index b9ce009d..00000000
Binary files a/Assemblies/AbilityUser.dll and /dev/null differ
diff --git a/Assemblies/AbilityUserAI.dll b/Assemblies/AbilityUserAI.dll
deleted file mode 100644
index 3783fa05..00000000
Binary files a/Assemblies/AbilityUserAI.dll and /dev/null differ
diff --git a/Assemblies/CompActivatableEffect.dll b/Assemblies/CompActivatableEffect.dll
deleted file mode 100644
index 8f49cb75..00000000
Binary files a/Assemblies/CompActivatableEffect.dll and /dev/null differ
diff --git a/Assemblies/CompAnimated.dll b/Assemblies/CompAnimated.dll
deleted file mode 100644
index 332d7e45..00000000
Binary files a/Assemblies/CompAnimated.dll and /dev/null differ
diff --git a/Assemblies/CompBalloon.dll b/Assemblies/CompBalloon.dll
deleted file mode 100644
index b0153a9c..00000000
Binary files a/Assemblies/CompBalloon.dll and /dev/null differ
diff --git a/Assemblies/CompBigBox.dll b/Assemblies/CompBigBox.dll
deleted file mode 100644
index 23b2662d..00000000
Binary files a/Assemblies/CompBigBox.dll and /dev/null differ
diff --git a/Assemblies/CompDeflector.dll b/Assemblies/CompDeflector.dll
deleted file mode 100644
index 5bccfdb2..00000000
Binary files a/Assemblies/CompDeflector.dll and /dev/null differ
diff --git a/Assemblies/CompDelayedSpawner.dll b/Assemblies/CompDelayedSpawner.dll
deleted file mode 100644
index a8602cd3..00000000
Binary files a/Assemblies/CompDelayedSpawner.dll and /dev/null differ
diff --git a/Assemblies/CompExtraSounds.dll b/Assemblies/CompExtraSounds.dll
deleted file mode 100644
index ac8784d0..00000000
Binary files a/Assemblies/CompExtraSounds.dll and /dev/null differ
diff --git a/Assemblies/CompInstalledPart.dll b/Assemblies/CompInstalledPart.dll
deleted file mode 100644
index 8b798d90..00000000
Binary files a/Assemblies/CompInstalledPart.dll and /dev/null differ
diff --git a/Assemblies/CompLumbering.dll b/Assemblies/CompLumbering.dll
deleted file mode 100644
index 8b8db7a8..00000000
Binary files a/Assemblies/CompLumbering.dll and /dev/null differ
diff --git a/Assemblies/CompOverlays.dll b/Assemblies/CompOverlays.dll
deleted file mode 100644
index dc984e0f..00000000
Binary files a/Assemblies/CompOverlays.dll and /dev/null differ
diff --git a/Assemblies/CompOversizedWeapon.dll b/Assemblies/CompOversizedWeapon.dll
deleted file mode 100644
index bb2dc146..00000000
Binary files a/Assemblies/CompOversizedWeapon.dll and /dev/null differ
diff --git a/Assemblies/CompSlotLoadable.dll b/Assemblies/CompSlotLoadable.dll
deleted file mode 100644
index aeee2b5e..00000000
Binary files a/Assemblies/CompSlotLoadable.dll and /dev/null differ
diff --git a/Assemblies/CompToggleDef.dll b/Assemblies/CompToggleDef.dll
deleted file mode 100644
index 44641a5f..00000000
Binary files a/Assemblies/CompToggleDef.dll and /dev/null differ
diff --git a/Assemblies/CompVehicle.dll b/Assemblies/CompVehicle.dll
deleted file mode 100644
index 23b36ea9..00000000
Binary files a/Assemblies/CompVehicle.dll and /dev/null differ
diff --git a/Assemblies/PawnShields.dll b/Assemblies/PawnShields.dll
deleted file mode 100644
index 06704eb6..00000000
Binary files a/Assemblies/PawnShields.dll and /dev/null differ
diff --git a/Assemblies/ThinkNodes.dll b/Assemblies/ThinkNodes.dll
deleted file mode 100644
index d0425434..00000000
Binary files a/Assemblies/ThinkNodes.dll and /dev/null differ
diff --git a/Defs/AbilityDefs/Abilities_Base.xml b/Defs/AbilityDefs/Abilities_Base.xml
deleted file mode 100755
index 477dd882..00000000
--- a/Defs/AbilityDefs/Abilities_Base.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
- UI/Glow_Corrupt
-
-
-
diff --git a/Defs/DamageDefs/AbilityUser_Damages.xml b/Defs/DamageDefs/AbilityUser_Damages.xml
deleted file mode 100755
index 4d662397..00000000
--- a/Defs/DamageDefs/AbilityUser_Damages.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
- Laser
- DamageWorker_AddInjury
- burn
- true
- false
-
- false
- true
- {0} has been shot to death.
- Burn
- Heat
- 15
- Mote_BlastFlame
- (1, 0.7, 0.7)
- (1, 1, 0.7)
- Explosion_Flame
-
-
-
diff --git a/Defs/JobDefs/AbilityUser_Jobs.xml b/Defs/JobDefs/AbilityUser_Jobs.xml
deleted file mode 100755
index b39575ae..00000000
--- a/Defs/JobDefs/AbilityUser_Jobs.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
- CastAbilityVerb
- AbilityUser.JobDriver_CastAbilityVerb
- Using an ability
- true
- false
-
-
-
- CastAbilitySelf
- AbilityUser.JobDriver_CastAbilitySelf
- Using an ability
- true
- false
-
-
-
\ No newline at end of file
diff --git a/Defs/JobDefs/CompDeflector_Jobs.xml b/Defs/JobDefs/CompDeflector_Jobs.xml
deleted file mode 100755
index ec1ca382..00000000
--- a/Defs/JobDefs/CompDeflector_Jobs.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
- CastDeflectVerb
- CompDeflector.JobDriver_CastDeflectVerb
- Deflecting
- true
- false
-
-
-
\ No newline at end of file
diff --git a/Defs/JobDefs/CompInstalledPart_Jobs.xml b/Defs/JobDefs/CompInstalledPart_Jobs.xml
deleted file mode 100755
index 183535d5..00000000
--- a/Defs/JobDefs/CompInstalledPart_Jobs.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
- CompInstalledPart_InstallPart
- CompInstalledPart.JobDriver_InstallPart
- installing TargetA.
- false
-
-
-
- CompInstalledPart_UninstallPart
- CompInstalledPart.JobDriver_UninstallPart
- uninstalling TargetA.
- false
-
-
-
diff --git a/Defs/JobDefs/CompSlotLoadable_Jobs.xml b/Defs/JobDefs/CompSlotLoadable_Jobs.xml
deleted file mode 100755
index 98af40fc..00000000
--- a/Defs/JobDefs/CompSlotLoadable_Jobs.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- GatherSlotItem
- CompSlotLoadable.JobDriver_GatherSlotItem
- equipping TargetA.
-
-
-
\ No newline at end of file
diff --git a/Defs/JobDefs/CompVehicle_Jobs.xml b/Defs/JobDefs/CompVehicle_Jobs.xml
deleted file mode 100755
index e69311a1..00000000
--- a/Defs/JobDefs/CompVehicle_Jobs.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- CompVehicle_LoadPassenger
- CompVehicle.JobDriver_LoadPassenger
- entering TargetA.
-
-
- CompVehicle_Assemble
- CompVehicle.JobDriver_AssembleVehicle
- assembling TargetA.
-
-
diff --git a/Defs/PawnShields/Shields.xml b/Defs/PawnShields/Shields.xml
deleted file mode 100644
index 8e51b641..00000000
--- a/Defs/PawnShields/Shields.xml
+++ /dev/null
@@ -1,197 +0,0 @@
-
-
-
- Shield
- Shield
- 35
-
-
-
- Shield_BaseMeleeBlockChance
- melee block chance
- Shield users melee block chance is multiplied by this. The higher the better.
- Shield
- PawnShields.StatWorker_Shield
- 1
- 0.05
- PercentZero
- false
-
-
-
- Shield_BaseRangedBlockChance
- ranged block chance
- Shield users ranged block chance is multiplied by this. The higher the better.
- Shield
- PawnShields.StatWorker_Shield
- 0.5
- 0.05
- PercentZero
- false
-
-
-
- Shield_DamageAbsorbed
- damage absorption
- How much damage the shield absorbs from a blocked attack.
- Shield
- PawnShields.StatWorker_Shield
- 1
- 0.05
- PercentZero
- false
-
-
-
-
- ShieldFatigue
- shield fatigue
- HediffWithComps
- Shield Fatigue
- 1.0
-
-
- -48.0
-
-
-
-
- minor
-
-
- Manipulation
- -0.02
-
-
- Moving
- -0.02
-
-
-
-
- 0.5
- major
-
-
- Manipulation
- -0.06
-
-
- Moving
- -0.06
-
-
-
-
- 0.8
- severe
-
-
- Manipulation
- -0.1
-
-
- Moving
- -0.1
-
-
-
-
- 1.0
- extreme
-
-
- Manipulation
- -0.1
-
-
- Moving
- -0.1
-
-
-
-
-
-
-
-
- MeleeShieldBlockChance
- melee block chance
- Chance to block a melee attack that would've otherwise hit.
- PawnCombat
- 99
- false
- 0.3
- PercentZero
- FloatOne
- 0
-
-
- Melee
- 5
- 7
-
-
-
-
- Moving
- 18
-
-
- Sight
- 8
- 1.4
-
-
-
-
- (5, 0.10)
- (20, 0.30)
- (60, 0.50)
- (100, 0.80)
- (140, 0.90)
-
-
-
-
-
-
- RangedShieldBlockChance
- ranged block chance
- Chance to block a ranged attack that would've otherwise hit.
- PawnCombat
- 99
- false
- 0.1
- PercentZero
- FloatOne
- 0
-
-
- Melee
- 5
- 3
-
-
-
-
- Moving
- 18
-
-
- Sight
- 8
- 1.4
-
-
-
-
- (5, 0.05)
- (20, 0.10)
- (60, 0.30)
- (100, 0.60)
- (140, 0.80)
-
-
-
-
diff --git a/Defs/RulePackDefs/JT_DeflectionRules.xml b/Defs/RulePackDefs/JT_DeflectionRules.xml
deleted file mode 100644
index 36125c88..00000000
--- a/Defs/RulePackDefs/JT_DeflectionRules.xml
+++ /dev/null
@@ -1,198 +0,0 @@
-
-
-
-
- Combat_RangedDamage
-
- Combat_WoundIncludes
- Combat_MeleeIncludes
-
-
-
-
- r_logentry->[INITIATOR_definite]'s [WEAPON_projectile_label] [destroyed_past] [RECIPIENT_definite]'s [destroyed_targets].
- r_logentry->[INITIATOR_definite]'s [WEAPON_projectile_label] [destroyed_past] [RECIPIENT_definite]'s [destroyed_targets] [to] [destroyed_suffix].
- r_logentry->[INITIATOR_definite]'s [WEAPON_projectile_label] [destroyed_past] [RECIPIENT_definite]'s [destroyed_targets] [expertly].
- r_logentry(p=2)->[INITIATOR_definite]'s [WEAPON_projectile_label] [missed] [ORIGINALTARGET_definite] and [destroyed_past] [RECIPIENT_definite]'s [destroyed_targets].
- r_logentry(p=2)->[INITIATOR_definite]'s [WEAPON_projectile_label] [missed] [ORIGINALTARGET_definite], [destroyed_present] [RECIPIENT_definite]'s [destroyed_targets].
- r_logentry->[RECIPIENT_definite]'s [destroyed_targets] was [destroyed_past] by [INITIATOR_definite]'s [WEAPON_projectile_label].
- r_logentry->[RECIPIENT_definite]'s [destroyed_targets] was [destroyed_past] by [INITIATOR_definite]'s [expert] [WEAPON_projectile_label].
- r_logentry->[RECIPIENT_definite]'s [destroyed_targets] was [destroyed_past] into [destroyed_suffix] by [INITIATOR_definite]'s [WEAPON_projectile_label].
- r_logentry->[INITIATOR_definite] [expertly] returned the incoming fire. It [destroyed_past] [RECIPIENT_definite]'s [destroyed_targets].
- r_logentry(p=0.7)->[INITIATOR_definite], wielding [INITIATOR_possessive] [WEAPON_label] [expertly], [damaged_past] [RECIPIENT_definite] in the [damaged_targets].
-
-
- r_logentry(recipient_partDestroyed_count==0)->[INITIATOR_definite]'s [WEAPON_projectile_label] [damaged_past] [RECIPIENT_definite]'s [damaged_targets].
- r_logentry(recipient_partDestroyed_count==0)->[INITIATOR_definite]'s [WEAPON_projectile_label] [damaged_past] [RECIPIENT_definite]'s [damaged_targets] [expertly].
- r_logentry(recipient_partDestroyed_count==0,p=2)->[INITIATOR_definite]'s [WEAPON_projectile_label] [missed] [ORIGINALTARGET_definite] and [damaged_past] [RECIPIENT_definite]'s [damaged_targets].
- r_logentry(recipient_partDestroyed_count==0,p=2)->[INITIATOR_definite]'s [WEAPON_projectile_label] [missed] [ORIGINALTARGET_definite], [damaged_present] [RECIPIENT_definite]'s [damaged_targets].
- r_logentry(recipient_partDestroyed_count==0)->[RECIPIENT_definite]'s [damaged_targets] was [damaged_past] by [INITIATOR_definite]'s [WEAPON_projectile_label].
- r_logentry(recipient_partDestroyed_count==0)->[RECIPIENT_definite]'s [damaged_targets] was [damaged_past] by [INITIATOR_definite]'s [expert] [WEAPON_projectile_label].
- r_logentry(recipient_partDestroyed_count==0)->[RECIPIENT_definite]'s [damaged_targets] was [damaged_past] by [INITIATOR_definite]'s shot.
-
-
- r_logentry(p=3)->[INITIATOR_definite]'s [WEAPON_projectile_label] [destroyed_past] [RECIPIENT_definite]'s [destroyed_targets] and [damaged_past] [RECIPIENT_possessive] [damaged_targets].
- r_logentry(p=6)->[INITIATOR_definite]'s [WEAPON_projectile_label] [missed] [ORIGINALTARGET_definite], [destroyed_present] [RECIPIENT_definite]'s [destroyed_targets] and [damaged_present] [RECIPIENT_possessive] [damaged_targets].
- r_logentry(p=6)->[INITIATOR_definite] sent a wild ricochet - [destroyed_present] [RECIPIENT_definite]'s [destroyed_targets] and [damaged_present] [RECIPIENT_possessive] [damaged_targets].
-
-
- r_logentry(p=0.2)->[INITIATOR_definite] hit [RECIPIENT_definite] with a [WEAPON_projectile_label].
- r_logentry(p=0.2)->[INITIATOR_definite]'s [WEAPON_projectile_label] hit [RECIPIENT_definite].
- r_logentry(p=0.4)->[INITIATOR_definite] [missed] [ORIGINALTARGET_definite] and hit [RECIPIENT_definite] with a [WEAPON_projectile_label].
- r_logentry(p=0.4)->[INITIATOR_definite]'s [WEAPON_projectile_label] [missed] [ORIGINALTARGET_definite] and hit [RECIPIENT_definite].
- r_logentry(p=0.2)->[INITIATOR_definite] hit [RECIPIENT_definite] with a [WEAPON_projectile_label] intended for [ORIGINALTARGET_definite].
- r_logentry(p=0.2)->[INITIATOR_definite] hit [RECIPIENT_definite] with a projectile.
-
-
- WEAPON_projectile_label(p=0.05)->shot
- WEAPON_projectile_label(p=0.05)->projectile
- WEAPON_projectile_label(p=0.05)->blast
-
- destroyed_past->shattered
- destroyed_past->crushed
- destroyed_past->obliterated
- destroyed_past->annihilated
- destroyed_past->pierced
- destroyed_past->perforated
- destroyed_past->punctured
-
- destroyed_present->shattering
- destroyed_present->crushing
- destroyed_present->obliterating
- destroyed_present->annihilating
- destroyed_present->piercing
- destroyed_present->perforating
- destroyed_present->puncturing
-
- destroyed_suffix->pieces
- destroyed_suffix->bits
- destroyed_suffix->a fine mist
- destroyed_suffix->fragments
- destroyed_suffix(p=0.5)->a holey mess
- destroyed_suffix(recipient_flesh!=Mechanoid,p=0.2)->ground beef
-
- damaged_past->wounded
- damaged_past->injured
- damaged_past->pierced
- damaged_past->damaged
- damaged_past->shot
-
- damaged_present->wounding
- damaged_present->injuring
- damaged_present->piercing
- damaged_present->damaging
- damaged_present->shooting
-
- damaged_suffix->in an ugly fashion
- damaged_suffix(recipient_flesh!=Mechanoid)->with visible blood
- damaged_suffix(recipient_flesh!=Mechanoid)->with the flesh visible
-
- to->to
- to->into
-
- missed->missed
- missed->narrowly missed
-
-
-
-
-
- Combat_RangedDeflect
-
- Combat_DeflectIncludes
-
-
-
- r_logentry->[INITIATOR_definite]'s [WEAPON_projectile_label] [damaged_past] [RECIPIENT_definite][damaged_target] [deflected_result].
- r_logentry(p=2)->[INITIATOR_definite]'s [WEAPON_projectile_label] [missed] [ORIGINALTARGET_definite] and [damaged_past] [RECIPIENT_definite][damaged_target_possessive_opt] [deflected_result].
- r_logentry->[RECIPIENT_definite][damaged_target_possessive_opt] was [damaged_past] by [INITIATOR_definite]'s [WEAPON_projectile_label] [deflected_result].
-
- r_logentry(p=0.2)->[INITIATOR_definite] hit [RECIPIENT_definite][damaged_target_possessive_opt] with a shot [deflected_result].
- r_logentry(p=0.2)->[INITIATOR_definite]'s projectile hit [RECIPIENT_definite][damaged_target_possessive_opt] [deflected_result].
- r_logentry(p=0.4)->[INITIATOR_definite] [missed] [ORIGINALTARGET_definite] and hit [RECIPIENT_definite][damaged_target_possessive_opt] with a [WEAPON_projectile_label] [deflected_result].
- r_logentry(p=0.4)->[INITIATOR_definite]'s [WEAPON_projectile_label] [missed] [ORIGINALTARGET_definite] and hit [RECIPIENT_definite][damaged_target_possessive_opt] [deflected_result].
- r_logentry(p=0.2)->[INITIATOR_definite] hit [RECIPIENT_definite][damaged_target_possessive_opt] with a [WEAPON_projectile_label] intended for [ORIGINALTARGET_definite] [deflected_result].
-
-
- WEAPON_projectile_label(p=0.05)->shot
- WEAPON_projectile_label(p=0.05)->projectile
- WEAPON_projectile_label(p=0.05)->blast
- ORIGINALTARGET_definite(p=0.5)->someone else
-
- damaged_target_possessive_opt->
- damaged_target_possessive_opt(recipient_part_damaged0_outside==True)->'s [RECIPIENT_part_damaged0_label]
-
- deflected_result-> [adverb_deflected]
- deflected_result->, [deflected_consequence]
-
- adverb_deflected_opt(p=4)->
- adverb_deflected_opt->[adverb_deflected]
-
- adverb_deflected->harmlessly
- adverb_deflected->uselessly
-
- deflected_consequence->but it [scraped_past] off [adverb_deflected_opt]
- deflected_consequence->[scraped_present] off [RECIPIENT_possessive] armor [adverb_deflected_opt]
-
- scraped_past->ricocheted
-
- scraped_present->ricocheting
-
- missed->missed
- missed->narrowly missed
-
-
-
-
-
-
- Combat_RangedMiss
-
-
- r_logentry->[INITIATOR_definite]'s [WEAPON_projectile_label] [missed].
-
- r_logentry->[INITIATOR_definite] missed [ORIGINALTARGET_definite].
- r_logentry->[ORIGINALTARGET_definite] [avoidance], [INITIATOR_definite]'s [WEAPON_projectile_label] [missing].
-
- WEAPON_projectile_label(p=0.05)->shot
- WEAPON_projectile_label(p=0.05)->projectile
- WEAPON_projectile_label(p=0.05)->blast
- missed(p=4)->missed
- missed(p=2)->missed by a small margin
- missed(p=2)->missed by a wide margin
- missed->went wide
- missed->flew into the air
- missed->flew high into the air
- missed->dug into the ground
- missed->skipped off the ground and was lost
- missed->dug a divot out of the ground
- missed(p=0.2)->passed within millimeters of [ORIGINALTARGET_definite]
- missed->passed within centimeters of [ORIGINALTARGET_definite]
- missed->passed within a meter of [ORIGINALTARGET_definite]
- missed->was blown offcourse
-
- missing->missing
- missing->missing by a small margin
- missing->missing by a wide margin
- missing->going wide
- missing->flying into the air
- missing->flying high into the air
- missing->digging into the ground
- missing->skipping off the ground and becoming lost
- missing->digging a divot out of the ground
- missing(p=0.2)->passing within millimeters of [ORIGINALTARGET_definite]
- missing->passing within centimeters of [ORIGINALTARGET_definite]
- missing->passing within a meter of [ORIGINALTARGET_definite]
- missing->blowing offcourse
-
- avoidance(ORIGINALTARGET_mobile==True)->jerked aside at the last second
- avoidance(ORIGINALTARGET_mobile==True)->stumbled in an attempt to escape
- avoidance(ORIGINALTARGET_mobile==True)->threw [ORIGINALTARGET_objective]self to the ground
- avoidance(ORIGINALTARGET_mobile==True,p=0.3)->ducked behind [COVER_definite]
- avoidance(ORIGINALTARGET_mobile==True,p=0.3)->leaped behind [COVER_definite]
-
-
-
-
-
-
diff --git a/Defs/RulePackDefs/JT_GrappleRules.xml b/Defs/RulePackDefs/JT_GrappleRules.xml
deleted file mode 100644
index f0f93fdf..00000000
--- a/Defs/RulePackDefs/JT_GrappleRules.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
- JT_GrappleSuccess
-
- Transition_Include
-
-
-
- r_logentry->[INITIATOR_nameDef] [grappled] [SUBJECT_definite].
-
- grappled->grappled
- grappled->seized
- grappled->took hold of
-
-
-
-
-
- JT_GrappleFailed
-
- Transition_Include
-
-
-
- r_logentry->[INITIATOR_nameDef] [triedtograpple] [SUBJECT_definite], [but] [failedmeta].
-
- tried->tried
- tried->attempted
- grappleinf->to grapple
- grappleinf->to seize
- grappleinf->to hold onto
- triedtograpple->[tried] [grappleinf]
-
- but->but
- but->however
- but->even so
- but->yet
-
- failed->failed
- failed->missed
- dodged->dodged
- dodged->slipped away
- spectacularly->spectacularly
- spectacularly->miserably
- spectacularly->completely
- spectacularly->utterly
- failedmeta->[INITIATOR_pronoun] [failed]
- failedmeta->[INITIATOR_pronoun] [failed] [spectacularly]
- failedmeta->[SUBJECT_definite] [dodged]
-
-
-
-
-
diff --git a/Defs/Stats/CompDeflection_StatWorkers.xml b/Defs/Stats/CompDeflection_StatWorkers.xml
deleted file mode 100755
index 1223fd5c..00000000
--- a/Defs/Stats/CompDeflection_StatWorkers.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
- MeleeWeapon_DeflectionChance
- CompDeflector.StatWorker_DeflectionChance
- deflection chance
- Chance to deflect ranged projectiles with melee weapon.
- PawnCombat
- 0
- 0
- PercentZero
- true
- 10
-
-
-
\ No newline at end of file
diff --git a/Defs/ThingDefs_Projectiles/JT_Projectiles.xml b/Defs/ThingDefs_Projectiles/JT_Projectiles.xml
deleted file mode 100644
index dc29ad63..00000000
--- a/Defs/ThingDefs_Projectiles/JT_Projectiles.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
- Projectile
- Normal
- Projectile
- Bullet
- bullet
- False
- True
-
- Transparent
-
-
-
-
-
- JT_FlyingObject
- AbilityUser.FlyingObject
- flying object
-
- NullTex
- Graphic_Single
-
-
- true
- Stun
- 0
- 10
-
-
-
-
diff --git a/Defs/ThingDefs_Slots/CompSlotLoadable_Slots.xml b/Defs/ThingDefs_Slots/CompSlotLoadable_Slots.xml
deleted file mode 100755
index 8f4c0ad0..00000000
--- a/Defs/ThingDefs_Slots/CompSlotLoadable_Slots.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
- SlotTest
- CompSlotLoadable.SlotLoadable
- Test
-
- MeleeWeapon_Gladius
-
- true
- (255, 255, 255, 255)
-
-
-
diff --git a/Defs/ThingDefs_WeaponMelee/CompSlotLoadable_ThingDefExample b/Defs/ThingDefs_WeaponMelee/CompSlotLoadable_ThingDefExample
deleted file mode 100644
index 08d6e4ed..00000000
--- a/Defs/ThingDefs_WeaponMelee/CompSlotLoadable_ThingDefExample
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
-
-
-
- MeleeWeapon_TestKnife
- slotted knife
- Never
- 0
- 0
- One of humankind's oldest tools, the knife is both an everyday tool and a deadly weapon.
- Normal
-
-
-
- SlotTest
-
-
-
-
-
-
-
- Things/Item/Equipment/WeaponMelee/Knife
- Graphic_Single
-
- InteractAutopistol
- 40
-
- 4000
- 0.5
-
- -65
-
- Metallic
-
-
-
- handle
-
- Blunt
-
- 6
- 2.5
-
-
- point
-
- Stab
-
- 16
- 2.5
-
-
- edge
-
- Cut
-
- 21
- 2.5
-
-
-
-
-
-
-
- ThingWithComps
- Item
- true
- Item
- true
- Never
- Primary
- true
- 10
- true
- Never
-
- 100
- 1.0
- 2
- 1
- -6
- 0.20
-
-
-
-
- CompEquippable
-
-
-
- 35
-
-
-
-
- Industrial
- true
-
- Melee
-
-
- WeaponsMelee
-
-
-
- CompQuality
-
-
- ArtName_WeaponMelee
- ArtDescription_WeaponMelee
- Excellent
-
-
-
- ITab_Art
-
-
-
-
-
-
-
- Root
-
-
- Silver
- Gold
- WoodLog
-
-
-
-
-
-
-
diff --git a/Defs/ThinkTreeDefs/CompVehicles_ThinkTree.xml b/Defs/ThinkTreeDefs/CompVehicles_ThinkTree.xml
deleted file mode 100644
index 53be174a..00000000
--- a/Defs/ThinkTreeDefs/CompVehicles_ThinkTree.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-
-
-
-
-
-
-
- CompVehicle_Simple
-
-
-
- Downed
-
-
- LordDuty
-
-
- Idle
-
-
-
-
-
-
-
- DraftedOrder
-
-
-
-
-
-
-
-
-
- JoinAutoJoinableCaravan
-
-
-
-
-
- Fieldwork
-
-
-
-
-
-
-
-
-
- UnloadingOwnInventory
-
-
-
-
-
-
-
-
-
-
-
- Misc
-
-
-
-
-
-
-
-
-
-
-
-
- Misc
-
-
- Walk
-
-
-
-
-
-
-
-
- LordDuty
-
-
-
-
- Idle
-
-
-
-
-
-
-
-
-
-
-
-
- CompVehicle_SimpleConstant
-
-
-
-
-
-
-
-
-
-
- LordDutyConstant
-
-
-
-
-
-
-
-
diff --git a/Defs/ThinkTreeDefs/InsertHook_AbilityUserAI.xml b/Defs/ThinkTreeDefs/InsertHook_AbilityUserAI.xml
deleted file mode 100644
index dbea8898..00000000
--- a/Defs/ThinkTreeDefs/InsertHook_AbilityUserAI.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
- InsertHookTest
- Humanlike_PostMentalState
- 1000
-
- true
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Defs/WorldObjectDefs/WorldObjects.xml b/Defs/WorldObjectDefs/WorldObjects.xml
deleted file mode 100644
index eaeee9ce..00000000
--- a/Defs/WorldObjectDefs/WorldObjects.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
- WorldObject_ProgressBar
- progress bar
- true
- This should not be visible to players.
- JecsTools.WorldObject_ProgressBar
- World/WorldObjects/TribalFactionBase
- true
- World/WorldObjects/Expanding/RoutePlannerWaypoint
- 1
- true
- false
- false
-
-
-
diff --git a/Languages/Japanese/DefInjected/DamageDef/AbilityUser_Damages.xml b/Languages/Japanese/DefInjected/DamageDef/AbilityUser_Damages.xml
index 192a82bd..2fb18e0d 100644
--- a/Languages/Japanese/DefInjected/DamageDef/AbilityUser_Damages.xml
+++ b/Languages/Japanese/DefInjected/DamageDef/AbilityUser_Damages.xml
@@ -1,7 +1,7 @@
-
-
-
- 火傷
- {0}はレーザーに焼かれて死んだ。
-
+
+
+
+ 火傷
+ {0}はレーザーに焼かれて死んだ。
+
\ No newline at end of file
diff --git a/Languages/Japanese/DefInjected/HediffDef/Shields.xml b/Languages/Japanese/DefInjected/HediffDef/Shields.xml
index 8483e233..3c37f56f 100644
--- a/Languages/Japanese/DefInjected/HediffDef/Shields.xml
+++ b/Languages/Japanese/DefInjected/HediffDef/Shields.xml
@@ -1,12 +1,12 @@
-
-
-
-
-
- シールド損耗
- 少し
- かなり
- 厳しい
- 枯渇
-
+
+
+
+
+
+ シールド損耗
+ 少し
+ かなり
+ 厳しい
+ 枯渇
+
\ No newline at end of file
diff --git a/Languages/Japanese/DefInjected/JobDef/AbilityUser_Jobs.xml b/Languages/Japanese/DefInjected/JobDef/AbilityUser_Jobs.xml
index e0a940b5..4f4d3f89 100644
--- a/Languages/Japanese/DefInjected/JobDef/AbilityUser_Jobs.xml
+++ b/Languages/Japanese/DefInjected/JobDef/AbilityUser_Jobs.xml
@@ -1,7 +1,7 @@
-
-
-
- 能力を使用中
- 能力を使用中
-
+
+
+
+ 能力を使用中
+ 能力を使用中
+
\ No newline at end of file
diff --git a/Languages/Japanese/DefInjected/JobDef/CompDeflector_Jobs.xml b/Languages/Japanese/DefInjected/JobDef/CompDeflector_Jobs.xml
index dcd26ed8..07662d64 100644
--- a/Languages/Japanese/DefInjected/JobDef/CompDeflector_Jobs.xml
+++ b/Languages/Japanese/DefInjected/JobDef/CompDeflector_Jobs.xml
@@ -1,6 +1,6 @@
-
-
-
- 逸らしている
-
+
+
+
+ 逸らしている
+
\ No newline at end of file
diff --git a/Languages/Japanese/DefInjected/JobDef/CompInstalledPart_Jobs.xml b/Languages/Japanese/DefInjected/JobDef/CompInstalledPart_Jobs.xml
index 7fac5432..753833c7 100644
--- a/Languages/Japanese/DefInjected/JobDef/CompInstalledPart_Jobs.xml
+++ b/Languages/Japanese/DefInjected/JobDef/CompInstalledPart_Jobs.xml
@@ -1,7 +1,7 @@
-
-
-
- TargetAを装着中
- TargetAを取り外し中
-
+
+
+
+ TargetAを装着中
+ TargetAを取り外し中
+
\ No newline at end of file
diff --git a/Languages/Japanese/DefInjected/JobDef/CompSlotLoadable_Jobs.xml b/Languages/Japanese/DefInjected/JobDef/CompSlotLoadable_Jobs.xml
index a3ba4537..9534d0cd 100644
--- a/Languages/Japanese/DefInjected/JobDef/CompSlotLoadable_Jobs.xml
+++ b/Languages/Japanese/DefInjected/JobDef/CompSlotLoadable_Jobs.xml
@@ -1,6 +1,6 @@
-
-
-
- TargetAをスロットに装着中
-
+
+
+
+ TargetAをスロットに装着中
+
\ No newline at end of file
diff --git a/Languages/Japanese/DefInjected/JobDef/CompVehicle_Jobs.xml b/Languages/Japanese/DefInjected/JobDef/CompVehicle_Jobs.xml
index 9da68c0a..9d316c70 100644
--- a/Languages/Japanese/DefInjected/JobDef/CompVehicle_Jobs.xml
+++ b/Languages/Japanese/DefInjected/JobDef/CompVehicle_Jobs.xml
@@ -1,7 +1,7 @@
-
-
-
- TargetAに乗り込む
- TargetAを組み立てる
-
+
+
+
+ TargetAに乗り込む
+ TargetAを組み立てる
+
\ No newline at end of file
diff --git a/Languages/Japanese/DefInjected/RulePackDef/JT_GrappleRules.xml b/Languages/Japanese/DefInjected/RulePackDef/JT_GrappleRules.xml
index bed2f170..0e83ea9d 100644
--- a/Languages/Japanese/DefInjected/RulePackDef/JT_GrappleRules.xml
+++ b/Languages/Japanese/DefInjected/RulePackDef/JT_GrappleRules.xml
@@ -1,32 +1,32 @@
-
-
-
- r_logentry->[INITIATOR_nameDef]は、[SUBJECT_definite][grappled]。
- grappled->と取っ組み合った
- grappled->を抑えつけた
- grappled->を手で掴みました
-
- r_logentry->[INITIATOR_nameDef]は、[SUBJECT_definite]を[triedtograpple]、[but][failedmeta]。
- tried->試みた
- tried->attempted
- grappleinf->捕まえようと
- grappleinf->捕らえようと
- grappleinf->抑えつけようと
- triedtograpple->[grappleinf][tried]が
- but->しかし
- but->またしても
- but->それでも
- but->すでに
- failed->失敗しました
- failed->逃げられました
- dodged->避けました
- dodged->外しました
- spectacularly->見事に
- spectacularly->無様に
- spectacularly->完全に
- spectacularly->ことごとく
- failedmeta->[INITIATOR_pronoun]は[failed]
- failedmeta->[INITIATOR_pronoun]は[spectacularly][failed]
- failedmeta->[SUBJECT_definite]は[dodged]
-
+
+
+
+ r_logentry->[INITIATOR_nameDef]は、[SUBJECT_definite][grappled]。
+ grappled->と取っ組み合った
+ grappled->を抑えつけた
+ grappled->を手で掴みました
+
+ r_logentry->[INITIATOR_nameDef]は、[SUBJECT_definite]を[triedtograpple]、[but][failedmeta]。
+ tried->試みた
+ tried->attempted
+ grappleinf->捕まえようと
+ grappleinf->捕らえようと
+ grappleinf->抑えつけようと
+ triedtograpple->[grappleinf][tried]が
+ but->しかし
+ but->またしても
+ but->それでも
+ but->すでに
+ failed->失敗しました
+ failed->逃げられました
+ dodged->避けました
+ dodged->外しました
+ spectacularly->見事に
+ spectacularly->無様に
+ spectacularly->完全に
+ spectacularly->ことごとく
+ failedmeta->[INITIATOR_pronoun]は[failed]
+ failedmeta->[INITIATOR_pronoun]は[spectacularly][failed]
+ failedmeta->[SUBJECT_definite]は[dodged]
+
\ No newline at end of file
diff --git a/Languages/Japanese/DefInjected/StatCategoryDef/Shields.xml b/Languages/Japanese/DefInjected/StatCategoryDef/Shields.xml
index 26f14254..099e37f5 100644
--- a/Languages/Japanese/DefInjected/StatCategoryDef/Shields.xml
+++ b/Languages/Japanese/DefInjected/StatCategoryDef/Shields.xml
@@ -1,6 +1,6 @@
-
-
-
- シールド
-
+
+
+
+ シールド
+
\ No newline at end of file
diff --git a/Languages/Japanese/DefInjected/StatDef/CompDeflection_StatWorkers.xml b/Languages/Japanese/DefInjected/StatDef/CompDeflection_StatWorkers.xml
index 277bcd76..8def147d 100644
--- a/Languages/Japanese/DefInjected/StatDef/CompDeflection_StatWorkers.xml
+++ b/Languages/Japanese/DefInjected/StatDef/CompDeflection_StatWorkers.xml
@@ -1,7 +1,7 @@
-
-
-
- 逸らす確率
- 近距離武器で遠距離攻撃の発射物を逸らす確率
-
+
+
+
+ 逸らす確率
+ 近距離武器で遠距離攻撃の発射物を逸らす確率
+
\ No newline at end of file
diff --git a/Languages/Japanese/DefInjected/StatDef/Shields.xml b/Languages/Japanese/DefInjected/StatDef/Shields.xml
index cb4b1976..595ebda9 100644
--- a/Languages/Japanese/DefInjected/StatDef/Shields.xml
+++ b/Languages/Japanese/DefInjected/StatDef/Shields.xml
@@ -1,25 +1,25 @@
-
-
-
- 近接防御補正
- シールドを構えた者の近接攻撃を防ぐ確率はこの値で補正乗算されます。より高いほど防御率が高い。
-
- 遠距離防御補正
- シールドを構えた者の遠距離攻撃を防ぐ確率はこの値で補正乗算されます。より高いほど防御率が高い。
-
- ダメージ吸収
- 防御した攻撃からシールドがどれだけのダメージを吸収できるか。
-
-
-
-
- 近接防御率
- 近接攻撃を阻止する確立で、失敗すると攻撃が命中します。
-
-
-
-
- 遠距離防御率
- 遠距離攻撃を阻止する確立で、失敗すると攻撃が命中します。
-
+
+
+
+ 近接防御補正
+ シールドを構えた者の近接攻撃を防ぐ確率はこの値で補正乗算されます。より高いほど防御率が高い。
+
+ 遠距離防御補正
+ シールドを構えた者の遠距離攻撃を防ぐ確率はこの値で補正乗算されます。より高いほど防御率が高い。
+
+ ダメージ吸収
+ 防御した攻撃からシールドがどれだけのダメージを吸収できるか。
+
+
+
+
+ 近接防御率
+ 近接攻撃を阻止する確立で、失敗すると攻撃が命中します。
+
+
+
+
+ 遠距離防御率
+ 遠距離攻撃を阻止する確立で、失敗すると攻撃が命中します。
+
\ No newline at end of file
diff --git a/Languages/Japanese/DefInjected/ThingDef/CompSlotLoadable_Slots.xml b/Languages/Japanese/DefInjected/ThingDef/CompSlotLoadable_Slots.xml
index ef2f3841..f0c19f89 100644
--- a/Languages/Japanese/DefInjected/ThingDef/CompSlotLoadable_Slots.xml
+++ b/Languages/Japanese/DefInjected/ThingDef/CompSlotLoadable_Slots.xml
@@ -1,6 +1,6 @@
-
-
-
- テスト
-
+
+
+
+ テスト
+
\ No newline at end of file
diff --git a/Languages/Japanese/DefInjected/ThingDef/JT_Projectiles.xml b/Languages/Japanese/DefInjected/ThingDef/JT_Projectiles.xml
index 2f358779..ebe7213a 100644
--- a/Languages/Japanese/DefInjected/ThingDef/JT_Projectiles.xml
+++ b/Languages/Japanese/DefInjected/ThingDef/JT_Projectiles.xml
@@ -1,6 +1,6 @@
-
-
-
- 飛翔体
-
+
+
+
+ 飛翔体
+
\ No newline at end of file
diff --git a/Languages/Japanese/DefInjected/WorldObjectDef/WorldObjects.xml b/Languages/Japanese/DefInjected/WorldObjectDef/WorldObjects.xml
index 0a89366c..f17fe8e5 100644
--- a/Languages/Japanese/DefInjected/WorldObjectDef/WorldObjects.xml
+++ b/Languages/Japanese/DefInjected/WorldObjectDef/WorldObjects.xml
@@ -1,7 +1,7 @@
-
-
-
- 進展度
- これはプレーヤーには見えないはずです。
-
+
+
+
+ 進展度
+ これはプレーヤーには見えないはずです。
+
\ No newline at end of file
diff --git a/Languages/Japanese/Keyed/AbilityUser.xml b/Languages/Japanese/Keyed/AbilityUser.xml
index b163609d..4713458f 100644
--- a/Languages/Japanese/Keyed/AbilityUser.xml
+++ b/Languages/Japanese/Keyed/AbilityUser.xml
@@ -1,27 +1,27 @@
-
-
-
- 指定可能な目標がありません。
-
- 機能停止
-
- タイプ:
- 目標(範囲)
- 目標(自分)
- 目標(他者)
- 目標(場所)
- クールダウン:
- 特殊
- 精神状態変化率
- 影響確率
- {0}は回復する時間が必要
-
-
- 影響範囲の詳細
- 目標:
- キャラクター
- 味方への誤射:
- 最大目標数:
- 使用者から開始:
-
+
+
+
+ 指定可能な目標がありません。
+
+ 機能停止
+
+ タイプ:
+ 目標(範囲)
+ 目標(自分)
+ 目標(他者)
+ 目標(場所)
+ クールダウン:
+ 特殊
+ 精神状態変化率
+ 影響確率
+ {0}は回復する時間が必要
+
+
+ 影響範囲の詳細
+ 目標:
+ キャラクター
+ 味方への誤射:
+ 最大目標数:
+ 使用者から開始:
+
\ No newline at end of file
diff --git a/Languages/Japanese/Keyed/CompActivatableEffect.xml b/Languages/Japanese/Keyed/CompActivatableEffect.xml
index adc5621c..5bf0cc6d 100644
--- a/Languages/Japanese/Keyed/CompActivatableEffect.xml
+++ b/Languages/Japanese/Keyed/CompActivatableEffect.xml
@@ -1,6 +1,6 @@
-
-
-
- 警告:{0}の現在所持している武器は不活性です!
-
+
+
+
+ 警告:{0}の現在所持している武器は不活性です!
+
\ No newline at end of file
diff --git a/Languages/Japanese/Keyed/CompDeflector.xml b/Languages/Japanese/Keyed/CompDeflector.xml
index ca955c87..285ac1ef 100644
--- a/Languages/Japanese/Keyed/CompDeflector.xml
+++ b/Languages/Japanese/Keyed/CompDeflector.xml
@@ -1,28 +1,28 @@
-
-
-
- 反射率
- この武器が発射体を攻撃者に跳ね返す頻度を決定します。
-
- 最大反射率
- {0}ヵ所の各射撃地点に対して、使用者は攻撃してきた目標に対して発射された攻撃を反射する可能性が{1}回あります。反射可能な最大回数は{2}回です。
-
- {0}スキルLv毎の反射率(%)
- 使用者は{0}の各レベルごとに、この反射率(%)を加算して発射体を跳ね返すことができます。
-
- 基本反射率
-
- ステータスは次の計算式で表示されます。\n反射率=(基本反射率+(スキルレベル×スキルLvごとの反射率(%))\n\n
-
- 反射率
-
- 基本反射率
-
- スキルLv
-
-
- スキルLvごとの反射率(%)
-
- 念動操作率
-
+
+
+
+ 反射率
+ この武器が発射体を攻撃者に跳ね返す頻度を決定します。
+
+ 最大反射率
+ {0}ヵ所の各射撃地点に対して、使用者は攻撃してきた目標に対して発射された攻撃を反射する可能性が{1}回あります。反射可能な最大回数は{2}回です。
+
+ {0}スキルLv毎の反射率(%)
+ 使用者は{0}の各レベルごとに、この反射率(%)を加算して発射体を跳ね返すことができます。
+
+ 基本反射率
+
+ ステータスは次の計算式で表示されます。\n反射率=(基本反射率+(スキルレベル×スキルLvごとの反射率(%))\n\n
+
+ 反射率
+
+ 基本反射率
+
+ スキルLv
+
+
+ スキルLvごとの反射率(%)
+
+ 念動操作率
+
\ No newline at end of file
diff --git a/Languages/Japanese/Keyed/CompInstalledPart.xml b/Languages/Japanese/Keyed/CompInstalledPart.xml
index 5c78800c..f3783cb8 100644
--- a/Languages/Japanese/Keyed/CompInstalledPart.xml
+++ b/Languages/Japanese/Keyed/CompInstalledPart.xml
@@ -1,9 +1,9 @@
-
-
-
- 何かを装着します
- {0}を取り外す
- {0}は{2}に{1}を装着しました
- {0}は{2}から{1}を取り外しました
-
+
+
+
+ 何かを装着します
+ {0}を取り外す
+ {0}は{2}に{1}を装着しました
+ {0}は{2}から{1}を取り外しました
+
\ No newline at end of file
diff --git a/Languages/Japanese/Keyed/CompVehicle.xml b/Languages/Japanese/Keyed/CompVehicle.xml
index c9a74e2b..730bcef9 100644
--- a/Languages/Japanese/Keyed/CompVehicle.xml
+++ b/Languages/Japanese/Keyed/CompVehicle.xml
@@ -1,33 +1,33 @@
-
-
-
-
- 入植者が乗り物に乗車している間は、キャラバン隊を分割することはできません。
-
-
-
- {0}は現在移動できません。
-
-
-
- 燃料が残り少ない
- {0}の燃料が不足しています({1})。 {0}は現在、通常速度の4分の1で移動しています。
- {0}には{2}が必要なので、車両({1})を降りました。
- {0}日分の燃料を積んでいます
- 燃料が足りなくなることは無いでしょう
- このキャラバン隊の燃料がなくなるまでのおよその日数です。\n\nキャラバン隊に属するすべての車両を考慮して、最悪の場合のシナリオを示します。 これは、この日数が経過した後、少なくとも1台の車両が燃料切れになることを意味します。
- このキャラバン隊は燃料を搭載しておらず、最高速度で移動することができません。\n\nこのキャラバン隊を編成してもよろしいですか?
- このキャラバン隊は{0}日分の燃料しか運んでおらず、すぐに燃料が枯渇します。\n\nこのままキャラバン隊を編成しますか?
- 燃料切れ
- キャラバン隊の乗り物に燃料を供給する必要があります。
-
- 乗り物
- {0}を積み下ろす
- {0}を下ろす
- {0}を積む
- {0}を載せるか1つ取り出します。
- {0}を1つ積み込む
- {0}を1つ取り出す
- 乗り物が無効になっているか、破壊されているか、または単に損傷しており、荷物を搭載できません。
-
-
+
+
+
+
+ 入植者が乗り物に乗車している間は、キャラバン隊を分割することはできません。
+
+
+
+ {0}は現在移動できません。
+
+
+
+ 燃料が残り少ない
+ {0}の燃料が不足しています({1})。 {0}は現在、通常速度の4分の1で移動しています。
+ {0}には{2}が必要なので、車両({1})を降りました。
+ {0}日分の燃料を積んでいます
+ 燃料が足りなくなることは無いでしょう
+ このキャラバン隊の燃料がなくなるまでのおよその日数です。\n\nキャラバン隊に属するすべての車両を考慮して、最悪の場合のシナリオを示します。 これは、この日数が経過した後、少なくとも1台の車両が燃料切れになることを意味します。
+ このキャラバン隊は燃料を搭載しておらず、最高速度で移動することができません。\n\nこのキャラバン隊を編成してもよろしいですか?
+ このキャラバン隊は{0}日分の燃料しか運んでおらず、すぐに燃料が枯渇します。\n\nこのままキャラバン隊を編成しますか?
+ 燃料切れ
+ キャラバン隊の乗り物に燃料を供給する必要があります。
+
+ 乗り物
+ {0}を積み下ろす
+ {0}を下ろす
+ {0}を積む
+ {0}を載せるか1つ取り出します。
+ {0}を1つ積み込む
+ {0}を1つ取り出す
+ 乗り物が無効になっているか、破壊されているか、または単に損傷しており、荷物を搭載できません。
+
+
diff --git a/Languages/Japanese/Keyed/Eng_WorldObjectMods.xml b/Languages/Japanese/Keyed/Eng_WorldObjectMods.xml
index 649798de..57c5c404 100644
--- a/Languages/Japanese/Keyed/Eng_WorldObjectMods.xml
+++ b/Languages/Japanese/Keyed/Eng_WorldObjectMods.xml
@@ -1,10 +1,10 @@
-
-
-
- この場所にキャラバン隊がありません
- 必要な資源:{0}
- 特定のアイテムが足りません。{2}が{1}が必要ですが、{0}しかありません
- {2}が不足しています。{1}が{1}が必要ですが、{0}しかありません
- 資源不足のために、{0}の建設に失敗しました
-
-
+
+
+
+ この場所にキャラバン隊がありません
+ 必要な資源:{0}
+ 特定のアイテムが足りません。{2}が{1}が必要ですが、{0}しかありません
+ {2}が不足しています。{1}が{1}が必要ですが、{0}しかありません
+ 資源不足のために、{0}の建設に失敗しました
+
+
diff --git a/Languages/Japanese/Keyed/Grapple.xml b/Languages/Japanese/Keyed/Grapple.xml
index 9203b6ea..986a776d 100644
--- a/Languages/Japanese/Keyed/Grapple.xml
+++ b/Languages/Japanese/Keyed/Grapple.xml
@@ -1,11 +1,11 @@
-
-
-
- 捕縛に成功
- 捕縛に失敗
- 倒れている相手:捕縛に成功
- 奇襲攻撃の相手:捕縛に成功
- 拘束中の相手:捕縛に成功
- 睡眠中の相手:捕縛に成功
-
+
+
+
+ 捕縛に成功
+ 捕縛に失敗
+ 倒れている相手:捕縛に成功
+ 奇襲攻撃の相手:捕縛に成功
+ 拘束中の相手:捕縛に成功
+ 睡眠中の相手:捕縛に成功
+
\ No newline at end of file
diff --git a/Languages/Japanese/Keyed/Misc.xml b/Languages/Japanese/Keyed/Misc.xml
index 88f9be82..012588fb 100644
--- a/Languages/Japanese/Keyed/Misc.xml
+++ b/Languages/Japanese/Keyed/Misc.xml
@@ -1,11 +1,11 @@
-
-
- 天井の下に置く必要があります。
- 壁に置く必要があります。
- {0}ダメージ吸収した
- 貫通量:{0}
- ノックバック率:{0}
- 追加ダメージ:
- 炸裂
-
+
+
+ 天井の下に置く必要があります。
+ 壁に置く必要があります。
+ {0}ダメージ吸収した
+ 貫通量:{0}
+ ノックバック率:{0}
+ 追加ダメージ:
+ 炸裂
+
\ No newline at end of file
diff --git a/Languages/Japanese/LanguageInfo.xml b/Languages/Japanese/LanguageInfo.xml
index de78ac11..d74dc636 100644
--- a/Languages/Japanese/LanguageInfo.xml
+++ b/Languages/Japanese/LanguageInfo.xml
@@ -1,13 +1,13 @@
-
-
- 日本語
- Japanese
- true
- LanguageWorker_Japanese
-
-
- Translator
- Proxyer
-
-
-
+
+
+ 日本語
+ Japanese
+ true
+ LanguageWorker_Japanese
+
+
+ Translator
+ Proxyer
+
+
+
diff --git a/RimworldModReleaseTool.exe b/RimworldModReleaseTool.exe
deleted file mode 100644
index 44e9e821..00000000
Binary files a/RimworldModReleaseTool.exe and /dev/null differ
diff --git a/Source/.idea/.idea.JecsTools/.idea/.name b/Source/.idea/.idea.JecsTools/.idea/.name
deleted file mode 100644
index 2cd2cc82..00000000
--- a/Source/.idea/.idea.JecsTools/.idea/.name
+++ /dev/null
@@ -1 +0,0 @@
-JecsTools
\ No newline at end of file
diff --git a/Source/.idea/.idea.JecsTools/.idea/contentModel.xml b/Source/.idea/.idea.JecsTools/.idea/contentModel.xml
deleted file mode 100644
index 8f52a367..00000000
--- a/Source/.idea/.idea.JecsTools/.idea/contentModel.xml
+++ /dev/null
@@ -1,388 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Source/.idea/.idea.JecsTools/.idea/indexLayout.xml b/Source/.idea/.idea.JecsTools/.idea/indexLayout.xml
deleted file mode 100644
index 27ba142e..00000000
--- a/Source/.idea/.idea.JecsTools/.idea/indexLayout.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Source/.idea/.idea.JecsTools/.idea/modules.xml b/Source/.idea/.idea.JecsTools/.idea/modules.xml
deleted file mode 100644
index c1e4164c..00000000
--- a/Source/.idea/.idea.JecsTools/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Source/.idea/.idea.JecsTools/.idea/vcs.xml b/Source/.idea/.idea.JecsTools/.idea/vcs.xml
deleted file mode 100644
index 6c0b8635..00000000
--- a/Source/.idea/.idea.JecsTools/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Source/.idea/.idea.JecsTools/.idea/workspace.xml b/Source/.idea/.idea.JecsTools/.idea/workspace.xml
deleted file mode 100644
index 22e15a56..00000000
--- a/Source/.idea/.idea.JecsTools/.idea/workspace.xml
+++ /dev/null
@@ -1,2317 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Addvehicle
- faction
- PreventAssigningRandomFaction
- Stealth
- Outof
- Needs
- Calculate
- OfFuel
- RedPhone
- Apparel
- apparel
- add
- trader
- overla
- TryGetAttackVerb(
- NameStringShort
- laying
- VerbProps.range
- damageFalloff
- CodeInstru
- CodeInstruction
- _Transpiler
- Transpiler
- CodeInst
- CodeInstr
- coveredParts
- GetPostArmor
- GroupKind
- harmonyInstance.Debug
- .GetMethod("
-
-
- soakSetting
- //Log.Message
- thisPawn.
- JecsTools
- TryGetAttackVerb(null
- NameStringShort
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- DEFINITION_ORDER
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1513946062191
-
-
- 1513946062191
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Source/.idea/.idea.JecsTools/riderModule.iml b/Source/.idea/.idea.JecsTools/riderModule.iml
deleted file mode 100644
index 1a4e0d95..00000000
--- a/Source/.idea/.idea.JecsTools/riderModule.iml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Source/.vs/AbilityUser/v15/.suo b/Source/.vs/AbilityUser/v15/.suo
deleted file mode 100644
index d3b8ba4b..00000000
Binary files a/Source/.vs/AbilityUser/v15/.suo and /dev/null differ
diff --git a/Source/.vs/CompActivatableEffect/v15/.suo b/Source/.vs/CompActivatableEffect/v15/.suo
deleted file mode 100644
index ee174cea..00000000
Binary files a/Source/.vs/CompActivatableEffect/v15/.suo and /dev/null differ
diff --git a/Source/.vs/CompDeflector/v15/.suo b/Source/.vs/CompDeflector/v15/.suo
deleted file mode 100644
index b573dc18..00000000
Binary files a/Source/.vs/CompDeflector/v15/.suo and /dev/null differ
diff --git a/Source/.vs/JecsTools/v15/.suo b/Source/.vs/JecsTools/v15/.suo
deleted file mode 100644
index 70ad9f54..00000000
Binary files a/Source/.vs/JecsTools/v15/.suo and /dev/null differ
diff --git a/Source/.vs/JecsTools/v15/Server/sqlite3/db.lock b/Source/.vs/JecsTools/v15/Server/sqlite3/db.lock
deleted file mode 100644
index e69de29b..00000000
diff --git a/Source/.vs/JecsTools/v15/Server/sqlite3/storage.ide b/Source/.vs/JecsTools/v15/Server/sqlite3/storage.ide
deleted file mode 100644
index aacef7d2..00000000
Binary files a/Source/.vs/JecsTools/v15/Server/sqlite3/storage.ide and /dev/null differ
diff --git a/Source/.vs/JecsTools/v15/Server/sqlite3/storage.ide-shm b/Source/.vs/JecsTools/v15/Server/sqlite3/storage.ide-shm
deleted file mode 100644
index e7f88e4a..00000000
Binary files a/Source/.vs/JecsTools/v15/Server/sqlite3/storage.ide-shm and /dev/null differ
diff --git a/Source/.vs/JecsTools/v15/Server/sqlite3/storage.ide-wal b/Source/.vs/JecsTools/v15/Server/sqlite3/storage.ide-wal
deleted file mode 100644
index 747b0328..00000000
Binary files a/Source/.vs/JecsTools/v15/Server/sqlite3/storage.ide-wal and /dev/null differ
diff --git a/Source/.vs/config/applicationhost.config b/Source/.vs/config/applicationhost.config
deleted file mode 100755
index 4b9bf477..00000000
--- a/Source/.vs/config/applicationhost.config
+++ /dev/null
@@ -1,1031 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Source/AllModdingComponents/.idea/.idea.PawnShields/.idea/.name b/Source/AllModdingComponents/.idea/.idea.PawnShields/.idea/.name
deleted file mode 100644
index 29ff4d27..00000000
--- a/Source/AllModdingComponents/.idea/.idea.PawnShields/.idea/.name
+++ /dev/null
@@ -1 +0,0 @@
-PawnShields
\ No newline at end of file
diff --git a/Source/AllModdingComponents/.idea/.idea.PawnShields/.idea/contentModel.xml b/Source/AllModdingComponents/.idea/.idea.PawnShields/.idea/contentModel.xml
deleted file mode 100644
index 809bd6f9..00000000
--- a/Source/AllModdingComponents/.idea/.idea.PawnShields/.idea/contentModel.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Source/AllModdingComponents/.idea/.idea.PawnShields/.idea/indexLayout.xml b/Source/AllModdingComponents/.idea/.idea.PawnShields/.idea/indexLayout.xml
deleted file mode 100644
index 6d4b6778..00000000
--- a/Source/AllModdingComponents/.idea/.idea.PawnShields/.idea/indexLayout.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Source/AllModdingComponents/.idea/.idea.PawnShields/.idea/modules.xml b/Source/AllModdingComponents/.idea/.idea.PawnShields/.idea/modules.xml
deleted file mode 100644
index 3bf3610a..00000000
--- a/Source/AllModdingComponents/.idea/.idea.PawnShields/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Source/AllModdingComponents/.idea/.idea.PawnShields/.idea/workspace.xml b/Source/AllModdingComponents/.idea/.idea.PawnShields/.idea/workspace.xml
deleted file mode 100644
index bbbc43a5..00000000
--- a/Source/AllModdingComponents/.idea/.idea.PawnShields/.idea/workspace.xml
+++ /dev/null
@@ -1,147 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- DEFINITION_ORDER
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1518187958325
-
-
- 1518187958325
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Source/AllModdingComponents/.idea/.idea.PawnShields/riderModule.iml b/Source/AllModdingComponents/.idea/.idea.PawnShields/riderModule.iml
deleted file mode 100644
index 1a4e0d95..00000000
--- a/Source/AllModdingComponents/.idea/.idea.PawnShields/riderModule.iml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Source/AllModdingComponents/.vs/CompAbilityUser/v15/.suo b/Source/AllModdingComponents/.vs/CompAbilityUser/v15/.suo
deleted file mode 100644
index 8de029b2..00000000
Binary files a/Source/AllModdingComponents/.vs/CompAbilityUser/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/.vs/CompAnimated/v15/.suo b/Source/AllModdingComponents/.vs/CompAnimated/v15/.suo
deleted file mode 100644
index 3d788d86..00000000
Binary files a/Source/AllModdingComponents/.vs/CompAnimated/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/.vs/CompDelayedSpawner/v15/.suo b/Source/AllModdingComponents/.vs/CompDelayedSpawner/v15/.suo
deleted file mode 100644
index 31d3be48..00000000
Binary files a/Source/AllModdingComponents/.vs/CompDelayedSpawner/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/.vs/CompExtraSounds/v15/.suo b/Source/AllModdingComponents/.vs/CompExtraSounds/v15/.suo
deleted file mode 100644
index f238153c..00000000
Binary files a/Source/AllModdingComponents/.vs/CompExtraSounds/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/.vs/CompInstalledPart/v15/.suo b/Source/AllModdingComponents/.vs/CompInstalledPart/v15/.suo
deleted file mode 100644
index cc3009ac..00000000
Binary files a/Source/AllModdingComponents/.vs/CompInstalledPart/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/.vs/CompLumbering/v15/.suo b/Source/AllModdingComponents/.vs/CompLumbering/v15/.suo
deleted file mode 100644
index f4014721..00000000
Binary files a/Source/AllModdingComponents/.vs/CompLumbering/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/.vs/CompOverlays/v15/.suo b/Source/AllModdingComponents/.vs/CompOverlays/v15/.suo
deleted file mode 100644
index e7e03744..00000000
Binary files a/Source/AllModdingComponents/.vs/CompOverlays/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/.vs/CompOversizedWeapon/v15/.suo b/Source/AllModdingComponents/.vs/CompOversizedWeapon/v15/.suo
deleted file mode 100644
index a82ed43d..00000000
Binary files a/Source/AllModdingComponents/.vs/CompOversizedWeapon/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/.vs/CompPilotable/v15/.suo b/Source/AllModdingComponents/.vs/CompPilotable/v15/.suo
deleted file mode 100644
index 9fdf9947..00000000
Binary files a/Source/AllModdingComponents/.vs/CompPilotable/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/.vs/CompToggleDef/v15/.suo b/Source/AllModdingComponents/.vs/CompToggleDef/v15/.suo
deleted file mode 100644
index afb90553..00000000
Binary files a/Source/AllModdingComponents/.vs/CompToggleDef/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/.vs/CompVehicle/v15/.suo b/Source/AllModdingComponents/.vs/CompVehicle/v15/.suo
deleted file mode 100644
index f44cd4aa..00000000
Binary files a/Source/AllModdingComponents/.vs/CompVehicle/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/.vs/JecsTools/v15/.suo b/Source/AllModdingComponents/.vs/JecsTools/v15/.suo
deleted file mode 100644
index 61604ccb..00000000
Binary files a/Source/AllModdingComponents/.vs/JecsTools/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/.vs/PawnShields/v15/.suo b/Source/AllModdingComponents/.vs/PawnShields/v15/.suo
deleted file mode 100644
index c5264290..00000000
Binary files a/Source/AllModdingComponents/.vs/PawnShields/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/AbilityUserAI.sln b/Source/AllModdingComponents/AbilityUserAI.sln
deleted file mode 100644
index 734440bb..00000000
--- a/Source/AllModdingComponents/AbilityUserAI.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26430.14
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbilityUserAI", "AbilityUserAI\AbilityUserAI.csproj", "{4FC16277-5CB6-4A78-90FB-27F09888708A}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {4FC16277-5CB6-4A78-90FB-27F09888708A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4FC16277-5CB6-4A78-90FB-27F09888708A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4FC16277-5CB6-4A78-90FB-27F09888708A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4FC16277-5CB6-4A78-90FB-27F09888708A}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/AbilityUserAI/AbilityUserAI.csproj b/Source/AllModdingComponents/AbilityUserAI/AbilityUserAI.csproj
index 1d2eb57e..73df7105 100644
--- a/Source/AllModdingComponents/AbilityUserAI/AbilityUserAI.csproj
+++ b/Source/AllModdingComponents/AbilityUserAI/AbilityUserAI.csproj
@@ -3,7 +3,6 @@
AbilityUserAI
- RW1.3;RW1.3Unstable;RW1.4;RW1.4Unstable
diff --git a/Source/AllModdingComponents/AbilityUserAI/Properties/AssemblyInfo.cs b/Source/AllModdingComponents/AbilityUserAI/Properties/AssemblyInfo.cs
deleted file mode 100644
index 8bb5c330..00000000
--- a/Source/AllModdingComponents/AbilityUserAI/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("AbilityUserAI")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("AbilityUserAI")]
-[assembly: AssemblyCopyright("Copyright © 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("4fc16277-5cb6-4a78-90fb-27f09888708a")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.18.0.0")]
-[assembly: AssemblyFileVersion("1.18.0.0")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/AbilityUserAI/Utility/AbilityUtility.cs b/Source/AllModdingComponents/AbilityUserAI/Utility/AbilityUtility.cs
index 0a73d874..6c248cdb 100644
--- a/Source/AllModdingComponents/AbilityUserAI/Utility/AbilityUtility.cs
+++ b/Source/AllModdingComponents/AbilityUserAI/Utility/AbilityUtility.cs
@@ -93,25 +93,23 @@ public static IEnumerable GetPawnsInsideRadius(LocalTargetInfo center, Map
}
///
- /// Convenience function for checking whether the pawns are allies.
+ /// Convenience function for checking whether the pawns are allies. Handles null Factions.
///
/// Initiator pawn that is checking.
/// Second pawn to check with.
/// True if they are allies. False if not.
public static bool AreAllies(Thing first, Thing second)
{
- //If you are yourself, then you are definitely allies.
- if (first == second)
+ //You are allies with yourself and others in your factions. Treat null as a faction
+ if (first.Faction == second.Faction)
return true;
- //Null factions are allies.
- if (first.Faction == null && second.Faction == null)
- return true;
+ //Otherwise, null Factions are not allies with non-null Factions
+ if (first.Faction == null || second.Faction == null)
+ return false;
- //Be allies if in the same Faction or if the goodwill with the other Faction is abouve 50%.
- if (second.Faction == null)
- return first.Faction == second.Faction;
- return first.Faction == second.Faction || first.Faction.GoodwillWith(second.Faction) >= 0.5f;
+ //Be allies if the goodwill with the other Faction is above 50%.
+ return first.Faction.GoodwillWith(second.Faction) >= 0.5f;
}
///
diff --git a/Source/AllModdingComponents/CompAbilityUser.sln b/Source/AllModdingComponents/CompAbilityUser.sln
deleted file mode 100755
index cf7e26e9..00000000
--- a/Source/AllModdingComponents/CompAbilityUser.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26228.12
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompAbilityUser", "CompAbilityUser\CompAbilityUser.csproj", "{417B8649-7A66-4580-8C75-473E46DA9C7A}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {417B8649-7A66-4580-8C75-473E46DA9C7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {417B8649-7A66-4580-8C75-473E46DA9C7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {417B8649-7A66-4580-8C75-473E46DA9C7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {417B8649-7A66-4580-8C75-473E46DA9C7A}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompAbilityUser/.vs/AbilityUser/v14/.suo b/Source/AllModdingComponents/CompAbilityUser/.vs/AbilityUser/v14/.suo
deleted file mode 100644
index 4132f901..00000000
Binary files a/Source/AllModdingComponents/CompAbilityUser/.vs/AbilityUser/v14/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/CompAbilityUser/.vs/AbilityUser/v15/.suo b/Source/AllModdingComponents/CompAbilityUser/.vs/AbilityUser/v15/.suo
deleted file mode 100644
index 4132f901..00000000
Binary files a/Source/AllModdingComponents/CompAbilityUser/.vs/AbilityUser/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/CompAbilityUser/AbilityPowerManager.cs b/Source/AllModdingComponents/CompAbilityUser/AbilityPowerManager.cs
deleted file mode 100755
index 0a77e6af..00000000
--- a/Source/AllModdingComponents/CompAbilityUser/AbilityPowerManager.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Verse;
-
-namespace AbilityUser
-{
- public class AbilityPowerManager : IExposable
- {
-
- private CompAbilityUser CompAbilityUser;
- public List powersint = new List();
- public List Powers = new List();
-
-
- public AbilityPowerManager(CompAbilityUser CompAbilityUser)
- {
- this.CompAbilityUser = CompAbilityUser;
- }
-
- public void Initialize()
- {
-
- }
-
-
- public void AbilityPowerManagerTick()
- {
- }
-
- public void AddPawnAbility(AbilityDef psydef)
- {
- if (!this.CompAbilityUser.Powers.Any(x => x.powerdef.defName == psydef.defName))
- {
- this.CompAbilityUser.Powers.Add(new PawnAbility(this.CompAbilityUser.abilityUser, psydef));
- }
-
- this.CompAbilityUser.UpdateAbilities();
- }
-
- public void RemovePawnAbility(AbilityDef abilityDef)
- {
- PawnAbility abilityToRemove = this.CompAbilityUser.Powers.FirstOrDefault(x => x.powerdef.defName == abilityDef.defName);
- if (abilityToRemove != null)
- {
- this.CompAbilityUser.Powers.Remove(abilityToRemove);
- }
-
- this.CompAbilityUser.UpdateAbilities();
- }
-
- public void ExposeData()
- {
- Scribe_Values.LookValue(ref this.CompAbilityUser, "CompAbilityUser", null);
- }
-
- }
-}
diff --git a/Source/AllModdingComponents/CompAbilityUser/Projectile_AbilityAoE.cs b/Source/AllModdingComponents/CompAbilityUser/Projectile_AbilityAoE.cs
deleted file mode 100755
index 567a4adf..00000000
--- a/Source/AllModdingComponents/CompAbilityUser/Projectile_AbilityAoE.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using RimWorld;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using UnityEngine;
-using Verse;
-
-namespace AbilityUser
-{
- public class Projectile_AbilityAoE : Projectile_AbilityBase
- {
- public Thing target;
-
- public Vector3 drawpos
- {
- get
- {
- if (this.target != null)
- {
- return target.DrawPos;
- }
- return destination;
- }
- }
-
- public override void PostMake()
- {
- base.PostMake();
- TargetingParameters parms = new TargetingParameters();
- parms.canTargetPawns = true;
- target = this.Map.thingGrid.ThingAt(destination.ToIntVec3(), ThingCategory.Pawn);
- if (target != null) Log.Message("FoundTarget");
- if (target == null) Log.Message("No Target??");
- }
-
- public override void Draw()
- {
- if (target != null)
- {
- Vector3 vector = drawpos;
- Vector3 distance = this.destination - this.origin;
- Vector3 curpos = this.destination - this.Position.ToVector3();
- var num = 1 - (Mathf.Sqrt(Mathf.Pow(curpos.x, 2) + Mathf.Pow(curpos.z, 2)) / (Mathf.Sqrt(Mathf.Pow(distance.x, 2) + Mathf.Pow(distance.z, 2))));
- float angle = 0f;
- Material mat = this.Graphic.MatSingle;
- Vector3 s = new Vector3(num, 1f, num);
- Matrix4x4 matrix = default(Matrix4x4);
- vector.y = 3;
- matrix.SetTRS(vector, Quaternion.AngleAxis(angle, Vector3.up), s);
- Graphics.DrawMesh(MeshPool.plane10, matrix, mat, 0);
- }
- }
-
- public override void DrawAt(Vector3 drawLoc)
- {
- if (target != null)
- {
- Vector3 vector = drawpos;
- Vector3 distance = this.destination - this.origin;
- Vector3 curpos = this.destination - this.Position.ToVector3();
- var num = 1 - (Mathf.Sqrt(Mathf.Pow(curpos.x, 2) + Mathf.Pow(curpos.z, 2)) / (Mathf.Sqrt(Mathf.Pow(distance.x, 2) + Mathf.Pow(distance.z, 2))));
- float angle = 0f;
- Material mat = this.Graphic.MatSingle;
- Vector3 s = new Vector3(num, 1f, num);
- Matrix4x4 matrix = default(Matrix4x4);
- vector.y = 3;
- matrix.SetTRS(vector, Quaternion.AngleAxis(angle, Vector3.up), s);
- Graphics.DrawMesh(MeshPool.plane10, matrix, mat, 0);
- }
- }
-
- }
-}
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompAbilityUser/Properties/AssemblyInfo.cs b/Source/AllModdingComponents/CompAbilityUser/Properties/AssemblyInfo.cs
deleted file mode 100755
index 4ddcf8fd..00000000
--- a/Source/AllModdingComponents/CompAbilityUser/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("AbilityUser")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("AbilityUser")]
-[assembly: AssemblyCopyright("Copyright © Cpt Ohu & Jecrell 2016-2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("417b8649-7a66-4580-8c75-473e46da9c7a")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.18.0.0")]
-[assembly: AssemblyFileVersion("1.18.0.0")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompAbilityUser/bin/Release/0Harmony.dll b/Source/AllModdingComponents/CompAbilityUser/bin/Release/0Harmony.dll
deleted file mode 100644
index 106a81a9..00000000
Binary files a/Source/AllModdingComponents/CompAbilityUser/bin/Release/0Harmony.dll and /dev/null differ
diff --git a/Source/AllModdingComponents/CompActivatableEffect.sln b/Source/AllModdingComponents/CompActivatableEffect.sln
deleted file mode 100755
index 2e899c51..00000000
--- a/Source/AllModdingComponents/CompActivatableEffect.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26228.12
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompActivatableEffect", "CompActivatableEffect\CompActivatableEffect.csproj", "{EC1AEA45-45FE-4A6A-A835-81B289E03BC9}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {EC1AEA45-45FE-4A6A-A835-81B289E03BC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {EC1AEA45-45FE-4A6A-A835-81B289E03BC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {EC1AEA45-45FE-4A6A-A835-81B289E03BC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {EC1AEA45-45FE-4A6A-A835-81B289E03BC9}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompActivatableEffect/.vs/CompActivatableEffect/v14/.suo b/Source/AllModdingComponents/CompActivatableEffect/.vs/CompActivatableEffect/v14/.suo
deleted file mode 100644
index f0a04c70..00000000
Binary files a/Source/AllModdingComponents/CompActivatableEffect/.vs/CompActivatableEffect/v14/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/CompActivatableEffect/.vs/CompActivatableEffect/v15/.suo b/Source/AllModdingComponents/CompActivatableEffect/.vs/CompActivatableEffect/v15/.suo
deleted file mode 100644
index a78ea36d..00000000
Binary files a/Source/AllModdingComponents/CompActivatableEffect/.vs/CompActivatableEffect/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/CompActivatableEffect/Properties/AssemblyInfo.cs b/Source/AllModdingComponents/CompActivatableEffect/Properties/AssemblyInfo.cs
deleted file mode 100755
index b3e3b575..00000000
--- a/Source/AllModdingComponents/CompActivatableEffect/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyTitle("CompActivatableEffect")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("CompActivatableEffect")]
-[assembly: AssemblyCopyright("Copyright © Jecrell 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-[assembly: ComVisible(false)]
-
-[assembly: Guid("ec1aea45-45fe-4a6a-a835-81b289e03bc9")]
-
-[assembly: AssemblyVersion("1.18.0.0")]
-[assembly: AssemblyFileVersion("1.18.0.0")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompActivatableEffect/xml/CompActivatableEffect.xml b/Source/AllModdingComponents/CompActivatableEffect/xml/CompActivatableEffect.xml
deleted file mode 100755
index 2279a178..00000000
--- a/Source/AllModdingComponents/CompActivatableEffect/xml/CompActivatableEffect.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
- WARNING: {0}'s current weapon is deactivated!
-
-
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompAnimated.sln b/Source/AllModdingComponents/CompAnimated.sln
deleted file mode 100644
index 8bdb25d2..00000000
--- a/Source/AllModdingComponents/CompAnimated.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26228.12
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompAnimated", "CompAnimated\CompAnimated.csproj", "{CF56EA3A-AEC6-4817-BF46-A886FBEAA49B}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {CF56EA3A-AEC6-4817-BF46-A886FBEAA49B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CF56EA3A-AEC6-4817-BF46-A886FBEAA49B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CF56EA3A-AEC6-4817-BF46-A886FBEAA49B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CF56EA3A-AEC6-4817-BF46-A886FBEAA49B}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompAnimated/HarmonyCompLumbering.cs b/Source/AllModdingComponents/CompAnimated/HarmonyCompLumbering.cs
deleted file mode 100644
index 3604d107..00000000
--- a/Source/AllModdingComponents/CompAnimated/HarmonyCompLumbering.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using Harmony;
-using RimWorld;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Verse;
-using Verse.AI;
-using System.Reflection;
-using UnityEngine;
-
-namespace CompLumbering
-{
- [StaticConstructorOnStartup]
- static class HarmonyCompLumbering
- {
- static HarmonyCompLumbering()
- {
- HarmonyInstance harmony = HarmonyInstance.Create("rimworld.jecrell.comps.lumbering");
- harmony.Patch(AccessTools.Method(typeof(PawnGraphicSet), "nakedGraphic"), null, new HarmonyMethod(typeof(HarmonyCompLumbering), "SoundMissPrefix"));
- }
- // Verse.PawnGraphicSet
-
-
- }
-}
diff --git a/Source/AllModdingComponents/CompAnimated/Properties/AssemblyInfo.cs b/Source/AllModdingComponents/CompAnimated/Properties/AssemblyInfo.cs
deleted file mode 100644
index 5245f6a9..00000000
--- a/Source/AllModdingComponents/CompAnimated/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("CompAnimated")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("CompAnimated")]
-[assembly: AssemblyCopyright("Copyright © Jecrell 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("20f7f767-99cd-42b1-8643-504f0b932468")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.18.0.0")]
-[assembly: AssemblyFileVersion("1.18.0.0")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompBalloon.sln b/Source/AllModdingComponents/CompBalloon.sln
deleted file mode 100644
index e1aa80a8..00000000
--- a/Source/AllModdingComponents/CompBalloon.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26228.12
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompBalloon", "CompBalloon\CompBalloon.csproj", "{CE293DBE-D76A-4F24-A086-42051996698D}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompBalloon/HarmonyCompBalloon.cs b/Source/AllModdingComponents/CompBalloon/HarmonyCompBalloon.cs
deleted file mode 100644
index 3604d107..00000000
--- a/Source/AllModdingComponents/CompBalloon/HarmonyCompBalloon.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using Harmony;
-using RimWorld;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Verse;
-using Verse.AI;
-using System.Reflection;
-using UnityEngine;
-
-namespace CompLumbering
-{
- [StaticConstructorOnStartup]
- static class HarmonyCompLumbering
- {
- static HarmonyCompLumbering()
- {
- HarmonyInstance harmony = HarmonyInstance.Create("rimworld.jecrell.comps.lumbering");
- harmony.Patch(AccessTools.Method(typeof(PawnGraphicSet), "nakedGraphic"), null, new HarmonyMethod(typeof(HarmonyCompLumbering), "SoundMissPrefix"));
- }
- // Verse.PawnGraphicSet
-
-
- }
-}
diff --git a/Source/AllModdingComponents/CompBalloon/Properties/AssemblyInfo.cs b/Source/AllModdingComponents/CompBalloon/Properties/AssemblyInfo.cs
deleted file mode 100644
index a59f740a..00000000
--- a/Source/AllModdingComponents/CompBalloon/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("CompLumbering")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("CompLumbering")]
-[assembly: AssemblyCopyright("Copyright © Jecrell 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("ad466182-ac71-4e53-a0e0-3c8b5cecc2ff")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.18.0.0")]
-[assembly: AssemblyFileVersion("1.18.0.0")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompBigBox.sln b/Source/AllModdingComponents/CompBigBox.sln
deleted file mode 100644
index 631de132..00000000
--- a/Source/AllModdingComponents/CompBigBox.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompBigBox", "CompBigBox\CompBigBox.csproj", "{6EC26D07-B5A0-4075-8919-3B05AF74CE87}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6EC26D07-B5A0-4075-8919-3B05AF74CE87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6EC26D07-B5A0-4075-8919-3B05AF74CE87}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6EC26D07-B5A0-4075-8919-3B05AF74CE87}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6EC26D07-B5A0-4075-8919-3B05AF74CE87}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompBigBox/Properties/AssemblyInfo.cs b/Source/AllModdingComponents/CompBigBox/Properties/AssemblyInfo.cs
deleted file mode 100644
index 5bca1494..00000000
--- a/Source/AllModdingComponents/CompBigBox/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("CompSlotLoadable")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("CompSlotLoadable")]
-[assembly: AssemblyCopyright("Copyright © Jecrell 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("6ec26d07-b5a0-4075-8919-3b05af74ce87")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.18.0.0")]
-[assembly: AssemblyFileVersion("1.18.0.0")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompDeflector.sln b/Source/AllModdingComponents/CompDeflector.sln
deleted file mode 100755
index 516cf265..00000000
--- a/Source/AllModdingComponents/CompDeflector.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompDeflector", "CompDeflector\CompDeflector.csproj", "{4A2FA470-0CA5-442B-B04D-2C4A62859CA7}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {4A2FA470-0CA5-442B-B04D-2C4A62859CA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4A2FA470-0CA5-442B-B04D-2C4A62859CA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4A2FA470-0CA5-442B-B04D-2C4A62859CA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4A2FA470-0CA5-442B-B04D-2C4A62859CA7}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompDeflector/.vs/CompDeflector/v14/.suo b/Source/AllModdingComponents/CompDeflector/.vs/CompDeflector/v14/.suo
deleted file mode 100644
index eb590e5a..00000000
Binary files a/Source/AllModdingComponents/CompDeflector/.vs/CompDeflector/v14/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/CompDeflector/Properties/AssemblyInfo.cs b/Source/AllModdingComponents/CompDeflector/Properties/AssemblyInfo.cs
deleted file mode 100755
index 6df806ef..00000000
--- a/Source/AllModdingComponents/CompDeflector/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("CompDeflector")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("CompDeflector")]
-[assembly: AssemblyCopyright("Copyright © Jecrell 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("4a2fa470-0ca5-442b-b04d-2c4a62859ca7")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.18.0.0")]
-[assembly: AssemblyFileVersion("1.18.0.0")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompDelayedSpawner.sln b/Source/AllModdingComponents/CompDelayedSpawner.sln
deleted file mode 100644
index b8a337a1..00000000
--- a/Source/AllModdingComponents/CompDelayedSpawner.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26228.12
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompDelayedSpawner", "CompDelayedSpawner\CompDelayedSpawner.csproj", "{417B8649-7A66-4580-8C75-473E46DA9C7A}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {417B8649-7A66-4580-8C75-473E46DA9C7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {417B8649-7A66-4580-8C75-473E46DA9C7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {417B8649-7A66-4580-8C75-473E46DA9C7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {417B8649-7A66-4580-8C75-473E46DA9C7A}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompDelayedSpawner/.vs/AbilityUser/v14/.suo b/Source/AllModdingComponents/CompDelayedSpawner/.vs/AbilityUser/v14/.suo
deleted file mode 100644
index 4132f901..00000000
Binary files a/Source/AllModdingComponents/CompDelayedSpawner/.vs/AbilityUser/v14/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/CompDelayedSpawner/.vs/AbilityUser/v15/.suo b/Source/AllModdingComponents/CompDelayedSpawner/.vs/AbilityUser/v15/.suo
deleted file mode 100644
index 4132f901..00000000
Binary files a/Source/AllModdingComponents/CompDelayedSpawner/.vs/AbilityUser/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/CompDelayedSpawner/.vs/CompAbilityUser/v15/.suo b/Source/AllModdingComponents/CompDelayedSpawner/.vs/CompAbilityUser/v15/.suo
deleted file mode 100644
index a840d3d6..00000000
Binary files a/Source/AllModdingComponents/CompDelayedSpawner/.vs/CompAbilityUser/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/CompDelayedSpawner/.vs/CompDelayedSpawner/v15/.suo b/Source/AllModdingComponents/CompDelayedSpawner/.vs/CompDelayedSpawner/v15/.suo
deleted file mode 100644
index ded414f2..00000000
Binary files a/Source/AllModdingComponents/CompDelayedSpawner/.vs/CompDelayedSpawner/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/CompDelayedSpawner/AbilityPowerManager.cs b/Source/AllModdingComponents/CompDelayedSpawner/AbilityPowerManager.cs
deleted file mode 100644
index 0a77e6af..00000000
--- a/Source/AllModdingComponents/CompDelayedSpawner/AbilityPowerManager.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Verse;
-
-namespace AbilityUser
-{
- public class AbilityPowerManager : IExposable
- {
-
- private CompAbilityUser CompAbilityUser;
- public List powersint = new List();
- public List Powers = new List();
-
-
- public AbilityPowerManager(CompAbilityUser CompAbilityUser)
- {
- this.CompAbilityUser = CompAbilityUser;
- }
-
- public void Initialize()
- {
-
- }
-
-
- public void AbilityPowerManagerTick()
- {
- }
-
- public void AddPawnAbility(AbilityDef psydef)
- {
- if (!this.CompAbilityUser.Powers.Any(x => x.powerdef.defName == psydef.defName))
- {
- this.CompAbilityUser.Powers.Add(new PawnAbility(this.CompAbilityUser.abilityUser, psydef));
- }
-
- this.CompAbilityUser.UpdateAbilities();
- }
-
- public void RemovePawnAbility(AbilityDef abilityDef)
- {
- PawnAbility abilityToRemove = this.CompAbilityUser.Powers.FirstOrDefault(x => x.powerdef.defName == abilityDef.defName);
- if (abilityToRemove != null)
- {
- this.CompAbilityUser.Powers.Remove(abilityToRemove);
- }
-
- this.CompAbilityUser.UpdateAbilities();
- }
-
- public void ExposeData()
- {
- Scribe_Values.LookValue(ref this.CompAbilityUser, "CompAbilityUser", null);
- }
-
- }
-}
diff --git a/Source/AllModdingComponents/CompDelayedSpawner/Projectile_AbilityAoE.cs b/Source/AllModdingComponents/CompDelayedSpawner/Projectile_AbilityAoE.cs
deleted file mode 100644
index 567a4adf..00000000
--- a/Source/AllModdingComponents/CompDelayedSpawner/Projectile_AbilityAoE.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-using RimWorld;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using UnityEngine;
-using Verse;
-
-namespace AbilityUser
-{
- public class Projectile_AbilityAoE : Projectile_AbilityBase
- {
- public Thing target;
-
- public Vector3 drawpos
- {
- get
- {
- if (this.target != null)
- {
- return target.DrawPos;
- }
- return destination;
- }
- }
-
- public override void PostMake()
- {
- base.PostMake();
- TargetingParameters parms = new TargetingParameters();
- parms.canTargetPawns = true;
- target = this.Map.thingGrid.ThingAt(destination.ToIntVec3(), ThingCategory.Pawn);
- if (target != null) Log.Message("FoundTarget");
- if (target == null) Log.Message("No Target??");
- }
-
- public override void Draw()
- {
- if (target != null)
- {
- Vector3 vector = drawpos;
- Vector3 distance = this.destination - this.origin;
- Vector3 curpos = this.destination - this.Position.ToVector3();
- var num = 1 - (Mathf.Sqrt(Mathf.Pow(curpos.x, 2) + Mathf.Pow(curpos.z, 2)) / (Mathf.Sqrt(Mathf.Pow(distance.x, 2) + Mathf.Pow(distance.z, 2))));
- float angle = 0f;
- Material mat = this.Graphic.MatSingle;
- Vector3 s = new Vector3(num, 1f, num);
- Matrix4x4 matrix = default(Matrix4x4);
- vector.y = 3;
- matrix.SetTRS(vector, Quaternion.AngleAxis(angle, Vector3.up), s);
- Graphics.DrawMesh(MeshPool.plane10, matrix, mat, 0);
- }
- }
-
- public override void DrawAt(Vector3 drawLoc)
- {
- if (target != null)
- {
- Vector3 vector = drawpos;
- Vector3 distance = this.destination - this.origin;
- Vector3 curpos = this.destination - this.Position.ToVector3();
- var num = 1 - (Mathf.Sqrt(Mathf.Pow(curpos.x, 2) + Mathf.Pow(curpos.z, 2)) / (Mathf.Sqrt(Mathf.Pow(distance.x, 2) + Mathf.Pow(distance.z, 2))));
- float angle = 0f;
- Material mat = this.Graphic.MatSingle;
- Vector3 s = new Vector3(num, 1f, num);
- Matrix4x4 matrix = default(Matrix4x4);
- vector.y = 3;
- matrix.SetTRS(vector, Quaternion.AngleAxis(angle, Vector3.up), s);
- Graphics.DrawMesh(MeshPool.plane10, matrix, mat, 0);
- }
- }
-
- }
-}
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompDelayedSpawner/Properties/AssemblyInfo.cs b/Source/AllModdingComponents/CompDelayedSpawner/Properties/AssemblyInfo.cs
deleted file mode 100644
index 294f8082..00000000
--- a/Source/AllModdingComponents/CompDelayedSpawner/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("CompDelayedSpawner")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("CompDelayedSpawner")]
-[assembly: AssemblyCopyright("Copyright © Jecrell 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("417b8649-7a66-4580-8c75-473e46da9c7a")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.18.0.0")]
-[assembly: AssemblyFileVersion("1.18.0.0")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompExtraSounds.sln b/Source/AllModdingComponents/CompExtraSounds.sln
deleted file mode 100755
index 5e4017b0..00000000
--- a/Source/AllModdingComponents/CompExtraSounds.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26228.12
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompExtraSounds", "CompExtraSounds\CompExtraSounds.csproj", "{05E24FAB-C6BF-43B5-BF69-B92AA38338CA}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompExtraSounds/Properties/AssemblyInfo.cs b/Source/AllModdingComponents/CompExtraSounds/Properties/AssemblyInfo.cs
deleted file mode 100755
index eb99f767..00000000
--- a/Source/AllModdingComponents/CompExtraSounds/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("CompExtraSounds")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("CompExtraSounds")]
-[assembly: AssemblyCopyright("Copyright © Jecrell 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("05e24fab-c6bf-43b5-bf69-b92aa38338ca")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.18.0.0")]
-[assembly: AssemblyFileVersion("1.18.0.0")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompInstalledPart.sln b/Source/AllModdingComponents/CompInstalledPart.sln
deleted file mode 100755
index 099d6811..00000000
--- a/Source/AllModdingComponents/CompInstalledPart.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26228.12
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompInstalledPart", "CompInstalledPart\CompInstalledPart.csproj", "{05E24FAB-C6BF-43B5-BF69-B92AA38338CA}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompInstalledPart/.vs/CompInstalledPart/v15/.suo b/Source/AllModdingComponents/CompInstalledPart/.vs/CompInstalledPart/v15/.suo
deleted file mode 100644
index dd8ccfbd..00000000
Binary files a/Source/AllModdingComponents/CompInstalledPart/.vs/CompInstalledPart/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/CompInstalledPart/Properties/AssemblyInfo.cs b/Source/AllModdingComponents/CompInstalledPart/Properties/AssemblyInfo.cs
deleted file mode 100755
index 974db03a..00000000
--- a/Source/AllModdingComponents/CompInstalledPart/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("CompInstalledPart")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("CompInstalledPart")]
-[assembly: AssemblyCopyright("Copyright © Jecrell 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("05e24fab-c6bf-43b5-bf69-b92aa38338ca")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.18.0.0")]
-[assembly: AssemblyFileVersion("1.18.0.0")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompLumbering.sln b/Source/AllModdingComponents/CompLumbering.sln
deleted file mode 100755
index bcccb063..00000000
--- a/Source/AllModdingComponents/CompLumbering.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26228.12
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompLumbering", "CompLumbering\CompLumbering.csproj", "{05E24FAB-C6BF-43B5-BF69-B92AA38338CA}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompLumbering/HarmonyCompLumbering.cs b/Source/AllModdingComponents/CompLumbering/HarmonyCompLumbering.cs
deleted file mode 100755
index 3604d107..00000000
--- a/Source/AllModdingComponents/CompLumbering/HarmonyCompLumbering.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using Harmony;
-using RimWorld;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Verse;
-using Verse.AI;
-using System.Reflection;
-using UnityEngine;
-
-namespace CompLumbering
-{
- [StaticConstructorOnStartup]
- static class HarmonyCompLumbering
- {
- static HarmonyCompLumbering()
- {
- HarmonyInstance harmony = HarmonyInstance.Create("rimworld.jecrell.comps.lumbering");
- harmony.Patch(AccessTools.Method(typeof(PawnGraphicSet), "nakedGraphic"), null, new HarmonyMethod(typeof(HarmonyCompLumbering), "SoundMissPrefix"));
- }
- // Verse.PawnGraphicSet
-
-
- }
-}
diff --git a/Source/AllModdingComponents/CompLumbering/Properties/AssemblyInfo.cs b/Source/AllModdingComponents/CompLumbering/Properties/AssemblyInfo.cs
deleted file mode 100755
index a59f740a..00000000
--- a/Source/AllModdingComponents/CompLumbering/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("CompLumbering")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("CompLumbering")]
-[assembly: AssemblyCopyright("Copyright © Jecrell 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("ad466182-ac71-4e53-a0e0-3c8b5cecc2ff")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.18.0.0")]
-[assembly: AssemblyFileVersion("1.18.0.0")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompOverlays.sln b/Source/AllModdingComponents/CompOverlays.sln
deleted file mode 100644
index 22856840..00000000
--- a/Source/AllModdingComponents/CompOverlays.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26228.12
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompOverlays", "CompOverlays\CompOverlays.csproj", "{05E24FAB-C6BF-43B5-BF69-B92AA38338CA}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompOverlays/.vs/CompExtraSounds/v15/.suo b/Source/AllModdingComponents/CompOverlays/.vs/CompExtraSounds/v15/.suo
deleted file mode 100644
index 4d326f12..00000000
Binary files a/Source/AllModdingComponents/CompOverlays/.vs/CompExtraSounds/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/CompOverlays/Properties/AssemblyInfo.cs b/Source/AllModdingComponents/CompOverlays/Properties/AssemblyInfo.cs
deleted file mode 100644
index b158e9dd..00000000
--- a/Source/AllModdingComponents/CompOverlays/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("CompOverlays")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("CompOverlays")]
-[assembly: AssemblyCopyright("Copyright © Jecrell 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("05e24fab-c6bf-43b5-bf69-b92aa38338ca")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.18.0.0")]
-[assembly: AssemblyFileVersion("1.18.0.0")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompOverlays/bin/Release/CompOverlays.dll b/Source/AllModdingComponents/CompOverlays/bin/Release/CompOverlays.dll
deleted file mode 100644
index d8bdc670..00000000
Binary files a/Source/AllModdingComponents/CompOverlays/bin/Release/CompOverlays.dll and /dev/null differ
diff --git a/Source/AllModdingComponents/CompOversizedWeapon.sln b/Source/AllModdingComponents/CompOversizedWeapon.sln
deleted file mode 100755
index b74d2f2a..00000000
--- a/Source/AllModdingComponents/CompOversizedWeapon.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompOversizedWeapon", "CompOversizedWeapon\CompOversizedWeapon.csproj", "{05E24FAB-C6BF-43B5-BF69-B92AA38338CA}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompOversizedWeapon/.vs/CompExtraSounds/v14/.suo b/Source/AllModdingComponents/CompOversizedWeapon/.vs/CompExtraSounds/v14/.suo
deleted file mode 100644
index 640169b9..00000000
Binary files a/Source/AllModdingComponents/CompOversizedWeapon/.vs/CompExtraSounds/v14/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/CompOversizedWeapon/HarmonyCompOversizedWeaponOLD.cs b/Source/AllModdingComponents/CompOversizedWeapon/HarmonyCompOversizedWeaponOLD.cs
deleted file mode 100755
index 6f8ac5f4..00000000
--- a/Source/AllModdingComponents/CompOversizedWeapon/HarmonyCompOversizedWeaponOLD.cs
+++ /dev/null
@@ -1,199 +0,0 @@
-using Harmony;
-using RimWorld;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Verse;
-using Verse.AI;
-using System.Reflection;
-using UnityEngine;
-
-namespace CompOversizedWeapon
-{
- [StaticConstructorOnStartup]
- static class HarmonyCompOversizedWeapon
- {
- static HarmonyCompOversizedWeapon()
- {
-
- HarmonyInstance harmony = HarmonyInstance.Create("rimworld.jecrell.comps.oversized");
- harmony.Patch(AccessTools.Method(typeof(PawnRenderer), "DrawEquipmentAiming"), new HarmonyMethod(typeof(HarmonyCompOversizedWeapon).GetMethod("DrawEquipmentAimingPreFix")), null);
- //harmony.Patch(AccessTools.Method(typeof(PawnRenderer), "DrawEquipmentAiming"), null, new HarmonyMethod(typeof(HarmonyCompOversizedWeapon).GetMethod("DrawEquipmentAimingPostFix")));
- harmony.Patch(AccessTools.Method(typeof(Thing), "get_Graphic"), null, new HarmonyMethod(typeof(HarmonyCompOversizedWeapon).GetMethod("get_Graphic_PostFix")));
-
-
- }
-
-
- //public static void DrawEquipmentAimingPostFix(PawnRenderer __instance, Thing eq, Vector3 drawLoc, float aimAngle)
- //{
- // Pawn pawn = (Pawn)AccessTools.Field(typeof(PawnRenderer), "pawn").GetValue(__instance);
-
- // Pawn_EquipmentTracker pawn_EquipmentTracker = pawn.equipment;
- // if (pawn_EquipmentTracker != null)
- // {
- // ThingWithComps thingWithComps = (ThingWithComps)AccessTools.Field(typeof(Pawn_EquipmentTracker), "primaryInt").GetValue(pawn_EquipmentTracker);
- // if (thingWithComps != null)
- // {
- // CompOversizedWeapon compOversizedWeapon = thingWithComps.TryGetComp();
- // if (compOversizedWeapon != null)
- // {
- // bool flip = false;
- // float num = aimAngle - 90f;
- // Mesh mesh;
- // if (aimAngle > 20f && aimAngle < 160f)
- // {
- // mesh = MeshPool.plane10;
- // num += eq.def.equippedAngleOffset;
- // }
- // else if (aimAngle > 200f && aimAngle < 340f)
- // {
- // mesh = MeshPool.plane10Flip;
- // flip = true;
- // num -= 180f;
- // num -= eq.def.equippedAngleOffset;
- // }
- // else
- // {
- // mesh = MeshPool.plane10;
- // num += eq.def.equippedAngleOffset;
- // }
- // num %= 360f;
- // Graphic_StackCount graphic_StackCount = eq.Graphic as Graphic_StackCount;
- // Material matSingle;
- // if (graphic_StackCount != null)
- // {
- // matSingle = graphic_StackCount.SubGraphicForStackCount(1, eq.def).MatSingle;
- // }
- // else
- // {
- // matSingle = eq.Graphic.MatSingle;
- // }
- // //mesh = MeshPool.GridPlane(thingWithComps.def.graphicData.drawSize);
- // //Graphics.DrawMesh(mesh, drawLoc, Quaternion.AngleAxis(num, Vector3.up), matSingle, 0);
- // //Log.Message("Oversized Draw");
-
- // //Vector3 s = new Vector3(eq.def.graphicData.drawSize.x, 1f, eq.def.graphicData.drawSize.y);
- // //Matrix4x4 matrix = default(Matrix4x4);
- // //matrix.SetTRS(drawLoc, Quaternion.AngleAxis(num, Vector3.up), s);
- // //if (!flip) Graphics.DrawMesh(MeshPool.plane10, matrix, matSingle, 0);
- // //else Graphics.DrawMesh(MeshPool.plane10Flip, matrix, matSingle, 0);
- // //Log.Message("Oversized Called");
-
- // }
- // }
- // }
- //}
- ///
- /// Adds another "layer" to the equipment aiming if they have a
- /// weapon with a CompActivatableEffect.
- ///
- ///
- ///
- ///
- ///
- public static bool DrawEquipmentAimingPreFix(PawnRenderer __instance, Thing eq, Vector3 drawLoc, float aimAngle)
- {
- Pawn pawn = (Pawn)AccessTools.Field(typeof(PawnRenderer), "pawn").GetValue(__instance);
-
- Pawn_EquipmentTracker pawn_EquipmentTracker = pawn.equipment;
- if (pawn_EquipmentTracker != null)
- {
- ThingWithComps thingWithComps = (ThingWithComps)AccessTools.Field(typeof(Pawn_EquipmentTracker), "primaryInt").GetValue(pawn_EquipmentTracker);
- if (thingWithComps != null)
- {
- //If the deflector is active, it's already using this code.
- ThingComp deflector = thingWithComps.AllComps.FirstOrDefault((ThingComp y) => y.GetType().ToString().Contains("Deflect"));
- if (deflector != null)
- {
- //Log.Message("Prefix");
- bool isAnimatingNow = (bool)AccessTools.Property(deflector.GetType(), "IsAnimatingNow").GetValue(deflector, null);
- if (isAnimatingNow)
- {
- return false;
- }
- }
- }
- CompOversizedWeapon compOversizedWeapon = thingWithComps.TryGetComp();
- if (compOversizedWeapon != null)
- {
- bool flip = false;
- float num = aimAngle - 90f;
- Mesh mesh;
- if (aimAngle > 20f && aimAngle < 160f)
- {
- mesh = MeshPool.plane10;
- num += eq.def.equippedAngleOffset;
- }
- else if (aimAngle > 200f && aimAngle < 340f)
- {
- mesh = MeshPool.plane10Flip;
- flip = true;
- num -= 180f;
- num -= eq.def.equippedAngleOffset;
- }
- else
- {
- mesh = MeshPool.plane10;
- num += eq.def.equippedAngleOffset;
- }
- num %= 360f;
- Graphic_StackCount graphic_StackCount = eq.Graphic as Graphic_StackCount;
- Material matSingle;
- if (graphic_StackCount != null)
- {
- matSingle = graphic_StackCount.SubGraphicForStackCount(1, eq.def).MatSingle;
- }
- else
- {
- matSingle = eq.Graphic.MatSingle;
- }
- //mesh = MeshPool.GridPlane(thingWithComps.def.graphicData.drawSize);
- //Graphics.DrawMesh(mesh, drawLoc, Quaternion.AngleAxis(num, Vector3.up), matSingle, 0);
- //Log.Message("Oversized Draw");
-
- Vector3 s = new Vector3(eq.def.graphicData.drawSize.x, 1f, eq.def.graphicData.drawSize.y);
- Matrix4x4 matrix = default(Matrix4x4);
- matrix.SetTRS(drawLoc, Quaternion.AngleAxis(num, Vector3.up), s);
- if (!flip) Graphics.DrawMesh(MeshPool.plane10, matrix, matSingle, 0);
- else Graphics.DrawMesh(MeshPool.plane10Flip, matrix, matSingle, 0);
- return false;
- //Log.Message("Oversized Called");
-
- }
- }
- return true;
- }
-
-
- public static void get_Graphic_PostFix(Thing __instance, ref Graphic __result)
- {
- Graphic tempGraphic = (Graphic)AccessTools.Field(typeof(Thing), "graphicInt").GetValue(__instance);
- if (tempGraphic != null)
- {
- ThingWithComps thingWithComps = __instance as ThingWithComps;
- if (thingWithComps != null)
- {
- if (thingWithComps.holdingContainer != null)
- {
- return;
- }
- ThingComp activatableEffect = thingWithComps.AllComps.FirstOrDefault((ThingComp y) => y.GetType().ToString().Contains("ActivatableEffect"));
- if (activatableEffect != null)
- {
- return;
- }
- CompOversizedWeapon compOversizedWeapon = thingWithComps.TryGetComp();
- if (compOversizedWeapon != null)
- {
- tempGraphic.drawSize = __instance.def.graphicData.drawSize;
- __result = tempGraphic;
- }
- }
- }
-
- }
-
- }
-}
diff --git a/Source/AllModdingComponents/CompOversizedWeapon/Properties/AssemblyInfo.cs b/Source/AllModdingComponents/CompOversizedWeapon/Properties/AssemblyInfo.cs
deleted file mode 100755
index 5744d350..00000000
--- a/Source/AllModdingComponents/CompOversizedWeapon/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("CompOversizedWeapon")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("CompOversizedWeapon")]
-[assembly: AssemblyCopyright("Copyright © Jecrell 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("05e24fab-c6bf-43b5-bf69-b92aa38338ca")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.18.0.0")]
-[assembly: AssemblyFileVersion("1.18.0.0")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompOversizedWeapon/bin/Release/CompOversizedWeapon.dll b/Source/AllModdingComponents/CompOversizedWeapon/bin/Release/CompOversizedWeapon.dll
deleted file mode 100644
index f4c606c4..00000000
Binary files a/Source/AllModdingComponents/CompOversizedWeapon/bin/Release/CompOversizedWeapon.dll and /dev/null differ
diff --git a/Source/AllModdingComponents/CompSlotLoadable.sln b/Source/AllModdingComponents/CompSlotLoadable.sln
deleted file mode 100755
index e97bbd54..00000000
--- a/Source/AllModdingComponents/CompSlotLoadable.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompSlotLoadable", "CompSlotLoadable\CompSlotLoadable.csproj", "{6EC26D07-B5A0-4075-8919-3B05AF74CE87}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6EC26D07-B5A0-4075-8919-3B05AF74CE87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6EC26D07-B5A0-4075-8919-3B05AF74CE87}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6EC26D07-B5A0-4075-8919-3B05AF74CE87}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6EC26D07-B5A0-4075-8919-3B05AF74CE87}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompSlotLoadable/Properties/AssemblyInfo.cs b/Source/AllModdingComponents/CompSlotLoadable/Properties/AssemblyInfo.cs
deleted file mode 100755
index 5bca1494..00000000
--- a/Source/AllModdingComponents/CompSlotLoadable/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("CompSlotLoadable")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("CompSlotLoadable")]
-[assembly: AssemblyCopyright("Copyright © Jecrell 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("6ec26d07-b5a0-4075-8919-3b05af74ce87")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.18.0.0")]
-[assembly: AssemblyFileVersion("1.18.0.0")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompToggleDef.sln b/Source/AllModdingComponents/CompToggleDef.sln
deleted file mode 100755
index d8a7c6ee..00000000
--- a/Source/AllModdingComponents/CompToggleDef.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26228.12
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompToggleDef", "CompToggleDef\CompToggleDef.csproj", "{9BECA870-0C2F-4F40-BEA1-6E99D68F9EDF}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {9BECA870-0C2F-4F40-BEA1-6E99D68F9EDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {9BECA870-0C2F-4F40-BEA1-6E99D68F9EDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9BECA870-0C2F-4F40-BEA1-6E99D68F9EDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {9BECA870-0C2F-4F40-BEA1-6E99D68F9EDF}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompToggleDef/.vs/CompToggleDef/v15/.suo b/Source/AllModdingComponents/CompToggleDef/.vs/CompToggleDef/v15/.suo
deleted file mode 100644
index 61a1459d..00000000
Binary files a/Source/AllModdingComponents/CompToggleDef/.vs/CompToggleDef/v15/.suo and /dev/null differ
diff --git a/Source/AllModdingComponents/CompToggleDef/Properties/AssemblyInfo.cs b/Source/AllModdingComponents/CompToggleDef/Properties/AssemblyInfo.cs
deleted file mode 100644
index 3b8f1f0c..00000000
--- a/Source/AllModdingComponents/CompToggleDef/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("CompToggleDef")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("CompToggleDef")]
-[assembly: AssemblyCopyright("Copyright © roxxploxx 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("9beca870-0c2f-4f40-bea1-6e99d68f9edf")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.18.0.0")]
-[assembly: AssemblyFileVersion("1.18.0.0")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompToggleDef/bin/Release/CompToggleDef.pdb b/Source/AllModdingComponents/CompToggleDef/bin/Release/CompToggleDef.pdb
deleted file mode 100644
index cbf603fe..00000000
Binary files a/Source/AllModdingComponents/CompToggleDef/bin/Release/CompToggleDef.pdb and /dev/null differ
diff --git a/Source/AllModdingComponents/CompVehicle.sln b/Source/AllModdingComponents/CompVehicle.sln
deleted file mode 100755
index cb7572b2..00000000
--- a/Source/AllModdingComponents/CompVehicle.sln
+++ /dev/null
@@ -1,22 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26228.12
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompVehicle", "CompVehicle\CompVehicle.csproj", "{05E24FAB-C6BF-43B5-BF69-B92AA38338CA}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {05E24FAB-C6BF-43B5-BF69-B92AA38338CA}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompVehicle.userprefs b/Source/AllModdingComponents/CompVehicle.userprefs
deleted file mode 100644
index c17463f8..00000000
--- a/Source/AllModdingComponents/CompVehicle.userprefs
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompVehicle/AbandonedVehicleContentsComp.cs b/Source/AllModdingComponents/CompVehicle/AbandonedVehicleContentsComp.cs
deleted file mode 100755
index 8f01eaa3..00000000
--- a/Source/AllModdingComponents/CompVehicle/AbandonedVehicleContentsComp.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-
-using System.Collections.Generic;
-using UnityEngine;
-using Verse;
-using RimWorld.Planet;
-namespace CompVehicle
-{
- //WIP
- public class AbandonedVehicleContentsComp : WorldObjectComp, IThingHolder
- {
- public ThingOwner contents;
- private static List tmpContents = new List();
- private static List tmpContentsStr = new List();
-
- public AbandonedVehicleContentsComp()
- {
- this.contents = new ThingOwner(this);
- }
- public void GetChildHolders(List outChildren)
- {
- ThingOwnerUtility.AppendThingHoldersFromThings(outChildren, this.GetDirectlyHeldThings());
- }
-
- public ThingOwner GetDirectlyHeldThings()
- {
- return this.contents;
- }
- public override void PostExposeData()
- {
- base.PostExposeData();
- Scribe_Deep.Look(ref this.contents, "contents", new object[]
- {
- this
- });
- }
-
-
- }
-}
diff --git a/Source/AllModdingComponents/CompVehicle/Bill_LoadVehicle.cs b/Source/AllModdingComponents/CompVehicle/Bill_LoadVehicle.cs
deleted file mode 100755
index 212b4ecf..00000000
--- a/Source/AllModdingComponents/CompVehicle/Bill_LoadVehicle.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using Verse;
-
-namespace CompVehicle
-{
- public class Bill_LoadVehicle : IExposable
- {
- public VehicleHandlerGroup group;
- public Pawn pawnToLoad;
-
- public Bill_LoadVehicle()
- {
- }
-
- public Bill_LoadVehicle(Pawn newLoad, Pawn newVehicle, VehicleHandlerGroup newGroup)
- {
- pawnToLoad = newLoad;
- group = newGroup;
- }
-
- public void ExposeData()
- {
- Scribe_References.Look(ref pawnToLoad, "pawnToLoad");
- Scribe_References.Look(ref group, "group");
- }
- }
-}
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompVehicle/CVPathFinder.cs b/Source/AllModdingComponents/CompVehicle/CVPathFinder.cs
deleted file mode 100644
index e87b3214..00000000
--- a/Source/AllModdingComponents/CompVehicle/CVPathFinder.cs
+++ /dev/null
@@ -1,829 +0,0 @@
-using RimWorld;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using UnityEngine;
-using Verse.AI;
-using Verse;
-
-namespace CompVehicle
-{
- public class CVPathFinder
- {
- internal struct CostNode
- {
- public int index;
-
- public int cost;
-
- public CostNode(int index, int cost)
- {
- this.index = index;
- this.cost = cost;
- }
- }
-
- private struct CVPathFinderNodeFast
- {
- public int knownCost;
-
- public int heuristicCost;
-
- public int parentIndex;
-
- public int costNodeCost;
-
- public ushort status;
- }
-
- internal class CostNodeComparer : IComparer
- {
- public int Compare(CVPathFinder.CostNode a, CVPathFinder.CostNode b)
- {
- return a.cost.CompareTo(b.cost);
- }
- }
-
- private Map map;
-
- private FastPriorityQueue openList;
-
- private CVPathFinder.CVPathFinderNodeFast[] calcGrid;
-
- private ushort statusOpenValue = 1;
-
- private ushort statusClosedValue = 2;
-
- private RegionCostCalculatorWrapper regionCostCalculator;
-
- private int mapSizeX;
-
- private int mapSizeZ;
-
- private PathGrid pathGrid;
-
- private Building[] edificeGrid;
-
- private CellIndices cellIndices;
-
- private List disallowedCornerIndices = new List(4);
-
- public const int DefaultMoveTicksCardinal = 13;
-
- private const int DefaultMoveTicksDiagonal = 18;
-
- private const int SearchLimit = 160000;
-
- private static readonly int[] Directions = new int[]
- {
- 0,
- 1,
- 0,
- -1,
- 1,
- 1,
- -1,
- -1,
- -1,
- 0,
- 1,
- 0,
- -1,
- 1,
- 1,
- -1
- };
-
- private const int Cost_DoorToBash = 300;
-
- private const int Cost_BlockedWall = 70;
-
- private const float Cost_BlockedWallPerHitPoint = 0.11f;
-
- public const int Cost_OutsideAllowedArea = 600;
-
- private const int Cost_PawnCollision = 175;
-
- private const int NodesToOpenBeforeRegionBasedPathing = 2000;
-
- private const float NonRegionBasedHeuristicStrengthAnimal = 1.75f;
-
- private static readonly SimpleCurve NonRegionBasedHeuristicStrengthHuman_DistanceCurve = new SimpleCurve
- {
- {
- new CurvePoint(40f, 1f),
- true
- },
- {
- new CurvePoint(120f, 2.8f),
- true
- }
- };
-
- private static readonly SimpleCurve RegionHeuristicWeightByNodesOpened = new SimpleCurve
- {
- {
- new CurvePoint(0f, 5f),
- true
- },
- {
- new CurvePoint(4000f, 5f),
- true
- },
- {
- new CurvePoint(5000f, 500f),
- true
- }
- };
-
- public CVPathFinder(Map map)
- {
- this.map = map;
- this.mapSizeX = map.Size.x;
- this.mapSizeZ = map.Size.z;
- this.calcGrid = new CVPathFinder.CVPathFinderNodeFast[this.mapSizeX * this.mapSizeZ];
- this.openList = new FastPriorityQueue(new CVPathFinder.CostNodeComparer());
- this.regionCostCalculator = new RegionCostCalculatorWrapper(map);
- }
-
- //public PawnPath FindPath(IntVec3 start, LocalTargetInfo dest, Pawn pawn, PathEndMode peMode = PathEndMode.OnCell)
- //{
- // bool flag = false;
- // if (pawn != null && pawn.CurJob != null && pawn.CurJob.canBash)
- // {
- // flag = true;
- // }
- // Danger maxDanger = Danger.Deadly;
- // bool canBash = flag;
- // return this.FindPath(start, dest, TraverseParms.For(pawn, maxDanger, TraverseMode.ByPawn, canBash), peMode);
- //}
-
- public PawnPath FindPath(IntVec3 start, LocalTargetInfo dest, TraverseParms traverseParms, PathEndMode peMode = PathEndMode.OnCell)
- {
- //Walk through Walls Mode
- if (DebugSettings.pathThroughWalls)
- {
- traverseParms.mode = TraverseMode.PassAllDestroyableThings;
- }
- //Check if there's a pawn to path for
- Pawn pawn = traverseParms.pawn;
- if (pawn != null && pawn.Map != this.map)
- {
- Log.Error(string.Concat(new object[]
- {
- "Tried to FindPath for pawn which is spawned in another map. His map CVPathFinder should have been used, not this one. pawn=",
- pawn,
- " pawn.Map=",
- pawn.Map,
- " map=",
- this.map
- }));
- return PawnPath.NotFound;
- }
- //Make sure the start is valid
- if (!start.IsValid)
- {
- Log.Error(string.Concat(new object[]
- {
- "Tried to FindPath with invalid start ",
- start,
- ", pawn= ",
- pawn
- }));
- return PawnPath.NotFound;
- }
- //Make sure the end is valid
- if (!dest.IsValid)
- {
- Log.Error(string.Concat(new object[]
- {
- "Tried to FindPath with invalid dest ",
- dest,
- ", pawn= ",
- pawn
- }));
- return PawnPath.NotFound;
- }
- //Check if it's possible to get to the destination
- Log.Error(traverseParms.mode.ToString());
- if (traverseParms.mode == TraverseMode.ByPawn)
- {
- if (!pawn.CanReach(dest, peMode, Danger.Deadly, traverseParms.canBash, traverseParms.mode))
- {
- return PawnPath.NotFound;
- }
- }
- else if (!this.map.reachability.CanReach(start, dest, peMode, traverseParms))
- {
- return PawnPath.NotFound;
- }
- Log.Error("a");
- this.PfProfilerBeginSample(string.Concat(new object[]
- {
- "FindPath for ",
- pawn,
- " from ",
- start,
- " to ",
- dest,
- (!dest.HasThing) ? string.Empty : (" at " + dest.Cell)
- }));
- this.cellIndices = this.map.cellIndices;
- this.pathGrid = this.map.pathGrid;
- this.edificeGrid = this.map.edificeGrid.InnerArray;
- int x = dest.Cell.x;
- int z = dest.Cell.z;
- int num = this.cellIndices.CellToIndex(start);
- int num2 = this.cellIndices.CellToIndex(dest.Cell);
- ByteGrid byteGrid = (pawn == null) ? null : pawn.GetAvoidGrid();
- bool flag = traverseParms.mode == TraverseMode.PassAllDestroyableThings;
- bool flag2 = traverseParms.mode != TraverseMode.NoPassClosedDoorsOrWater && traverseParms.mode != TraverseMode.PassAllDestroyableThingsNotWater;
- bool flag3 = !flag;
- CellRect cellRect = this.CalculateDestinationRect(dest, peMode);
- bool flag4 = cellRect.Width == 1 && cellRect.Height == 1;
- int[] array = this.map.pathGrid.pathGrid;
- EdificeGrid edificeGrid = this.map.edificeGrid;
- int num3 = 0;
- int num4 = 0;
- Area allowedArea = this.GetAllowedArea(pawn);
- bool flag5 = pawn != null && PawnUtility.ShouldCollideWithPawns(pawn);
- bool flag6 = true && DebugViewSettings.drawPaths;
- bool flag7 = !flag && start.GetRegion(this.map, RegionType.Set_Passable) != null;
- bool flag8 = !flag || !flag3;
- bool flag9 = false;
- int num5 = 0;
- int num6 = 0;
- float num7 = this.DetermineHeuristicStrength(pawn, start, dest);
- int num8;
- int num9;
- Log.Error("b");
- if (pawn != null)
- {
- num8 = pawn.TicksPerMoveCardinal;
- num9 = pawn.TicksPerMoveDiagonal;
- }
- else
- {
- num8 = 13;
- num9 = 18;
- }
- this.CalculateAndAddDisallowedCorners(traverseParms, peMode, cellRect);
- this.InitStatusesAndPushStartNode(ref num, start);
- while (true)
- {
- Log.Error("c");
- this.PfProfilerBeginSample("Open cell");
- if (this.openList.Count <= 0)
- {
- break;
- }
- num5 += this.openList.Count;
- num6++;
- CVPathFinder.CostNode costNode = this.openList.Pop();
- num = costNode.index;
- if (costNode.cost != this.calcGrid[num].costNodeCost)
- {
- Log.Error("d");
- this.PfProfilerEndSample();
- }
- else if (this.calcGrid[num].status == this.statusClosedValue)
- {
- Log.Error("e");
- this.PfProfilerEndSample();
- }
- else
- {
- Log.Error("f");
- IntVec3 c = this.cellIndices.IndexToCell(num);
- int x2 = c.x;
- int z2 = c.z;
- if (flag6)
- {
- this.DebugFlash(c, (float)this.calcGrid[num].knownCost / 1500f, this.calcGrid[num].knownCost.ToString());
- }
- if (flag4)
- {
- if (num == num2)
- {
- goto Block_27;
- }
- }
- else if (cellRect.Contains(c) && !this.disallowedCornerIndices.Contains(num))
- {
- goto Block_29;
- }
- if (num3 > 160000)
- {
- goto Block_30;
- }
- this.PfProfilerEndSample();
- this.PfProfilerBeginSample("Neighbor consideration");
- for (int i = 0; i < 8; i++)
- {
- uint num10 = (uint)(x2 + CVPathFinder.Directions[i]);
- uint num11 = (uint)(z2 + CVPathFinder.Directions[i + 8]);
- if ((ulong)num10 < (ulong)((long)this.mapSizeX) && (ulong)num11 < (ulong)((long)this.mapSizeZ))
- {
- int num12 = (int)num10;
- int num13 = (int)num11;
- int num14 = this.cellIndices.CellToIndex(num12, num13);
- if (this.calcGrid[num14].status != this.statusClosedValue || flag9)
- {
- int num15 = 0;
- bool flag10 = false;
- if (flag2 || !new IntVec3(num12, 0, num13).GetTerrain(this.map).HasTag("Water") || (pawn.GetComp() != null && pawn.GetComp().Props.vehicleType == VehicleType.Amphibious))
- {
- if (!this.pathGrid.WalkableFast(num14))
- {
- if (!flag)
- {
- if (flag6)
- {
- this.DebugFlash(new IntVec3(num12, 0, num13), 0.22f, "walk");
- }
- goto IL_C2E;
- }
- flag10 = true;
- num15 += 70;
- Building building = edificeGrid[num14];
- if (building == null)
- {
- goto IL_C2E;
- }
- if (!CVPathFinder.IsDestroyable(building))
- {
- goto IL_C2E;
- }
- num15 += (int)((float)building.HitPoints * 0.11f);
- }
- if (i > 3)
- {
- switch (i)
- {
- case 4:
- if (this.BlocksDiagonalMovement(num - this.mapSizeX))
- {
- if (flag8)
- {
- if (flag6)
- {
- this.DebugFlash(new IntVec3(x2, 0, z2 - 1), 0.9f, "corn");
- }
- goto IL_C2E;
- }
- num15 += 70;
- }
- if (this.BlocksDiagonalMovement(num + 1))
- {
- if (flag8)
- {
- if (flag6)
- {
- this.DebugFlash(new IntVec3(x2 + 1, 0, z2), 0.9f, "corn");
- }
- goto IL_C2E;
- }
- num15 += 70;
- }
- break;
- case 5:
- if (this.BlocksDiagonalMovement(num + this.mapSizeX))
- {
- if (flag8)
- {
- if (flag6)
- {
- this.DebugFlash(new IntVec3(x2, 0, z2 + 1), 0.9f, "corn");
- }
- goto IL_C2E;
- }
- num15 += 70;
- }
- if (this.BlocksDiagonalMovement(num + 1))
- {
- if (flag8)
- {
- if (flag6)
- {
- this.DebugFlash(new IntVec3(x2 + 1, 0, z2), 0.9f, "corn");
- }
- goto IL_C2E;
- }
- num15 += 70;
- }
- break;
- case 6:
- if (this.BlocksDiagonalMovement(num + this.mapSizeX))
- {
- if (flag8)
- {
- if (flag6)
- {
- this.DebugFlash(new IntVec3(x2, 0, z2 + 1), 0.9f, "corn");
- }
- goto IL_C2E;
- }
- num15 += 70;
- }
- if (this.BlocksDiagonalMovement(num - 1))
- {
- if (flag8)
- {
- if (flag6)
- {
- this.DebugFlash(new IntVec3(x2 - 1, 0, z2), 0.9f, "corn");
- }
- goto IL_C2E;
- }
- num15 += 70;
- }
- break;
- case 7:
- if (this.BlocksDiagonalMovement(num - this.mapSizeX))
- {
- if (flag8)
- {
- if (flag6)
- {
- this.DebugFlash(new IntVec3(x2, 0, z2 - 1), 0.9f, "corn");
- }
- goto IL_C2E;
- }
- num15 += 70;
- }
- if (this.BlocksDiagonalMovement(num - 1))
- {
- if (flag8)
- {
- if (flag6)
- {
- this.DebugFlash(new IntVec3(x2 - 1, 0, z2), 0.9f, "corn");
- }
- goto IL_C2E;
- }
- num15 += 70;
- }
- break;
- }
- }
- Log.Error("g");
- int num16 = (i <= 3) ? num8 : num9;
- num16 += num15;
- if (!flag10)
- {
- num16 += array[num14];
- }
- if (byteGrid != null)
- {
- num16 += (int)(byteGrid[num14] * 8);
- }
- if (allowedArea != null && !allowedArea[num14])
- {
- num16 += 600;
- }
- if (flag5 && PawnUtility.AnyPawnBlockingPathAt(new IntVec3(num12, 0, num13), pawn, false, false))
- {
- num16 += 175;
- }
- Log.Error("h");
- Building building2 = this.edificeGrid[num14];
- if (building2 != null)
- {
- this.PfProfilerBeginSample("Edifices");
- int buildingCost = CVPathFinder.GetBuildingCost(building2, traverseParms, pawn);
- if (buildingCost == 2147483647)
- {
- this.PfProfilerEndSample();
- goto IL_C2E;
- }
- num16 += buildingCost;
- this.PfProfilerEndSample();
- }
- int num17 = num16 + this.calcGrid[num].knownCost;
- ushort status = this.calcGrid[num14].status;
- if (status == this.statusClosedValue || status == this.statusOpenValue)
- {
- int num18 = 0;
- if (status == this.statusClosedValue)
- {
- num18 = num8;
- }
- if (this.calcGrid[num14].knownCost <= num17 + num18)
- {
- goto IL_C2E;
- }
- }
- if (status != this.statusClosedValue && status != this.statusOpenValue)
- {
- if (flag9)
- {
- this.calcGrid[num14].heuristicCost = Mathf.RoundToInt((float)this.regionCostCalculator.GetPathCostFromDestToRegion(num14) * CVPathFinder.RegionHeuristicWeightByNodesOpened.Evaluate((float)num4));
- }
- else
- {
- int dx = Math.Abs(num12 - x);
- int dz = Math.Abs(num13 - z);
- int num19 = GenMath.OctileDistance(dx, dz, num8, num9);
- this.calcGrid[num14].heuristicCost = Mathf.RoundToInt((float)num19 * num7);
- }
- }
- int num20 = num17 + this.calcGrid[num14].heuristicCost;
- this.calcGrid[num14].parentIndex = num;
- this.calcGrid[num14].knownCost = num17;
- this.calcGrid[num14].status = this.statusOpenValue;
- this.calcGrid[num14].costNodeCost = num20;
- num4++;
- this.openList.Push(new CVPathFinder.CostNode(num14, num20));
- }
- }
- }
- IL_C2E:;
- }
- this.PfProfilerEndSample();
- num3++;
- this.calcGrid[num].status = this.statusClosedValue;
- if (num4 >= 2000 && flag7 && !flag9)
- {
- flag9 = true;
- this.regionCostCalculator.Init(cellRect, traverseParms, num8, num9, byteGrid, allowedArea, this.disallowedCornerIndices);
- this.InitStatusesAndPushStartNode(ref num, start);
- num4 = 0;
- num3 = 0;
- }
- }
- }
- string text = (pawn == null || pawn.CurJob == null) ? "null" : pawn.CurJob.ToString();
- string text2 = (pawn == null || pawn.Faction == null) ? "null" : pawn.Faction.ToString();
- Log.Warning(string.Concat(new object[]
- {
- pawn,
- " pathing from ",
- start,
- " to ",
- dest,
- " ran out of cells to process.\nJob:",
- text,
- "\nFaction: ",
- text2
- }));
- this.DebugDrawRichData();
- this.PfProfilerEndSample();
- return PawnPath.NotFound;
- Block_27:
- this.PfProfilerEndSample();
- PawnPath result = this.FinalizedPath(num);
- this.PfProfilerEndSample();
- return result;
- Block_29:
- this.PfProfilerEndSample();
- PawnPath result2 = this.FinalizedPath(num);
- this.PfProfilerEndSample();
- return result2;
- Block_30:
- Log.Warning(string.Concat(new object[]
- {
- pawn,
- " pathing from ",
- start,
- " to ",
- dest,
- " hit search limit of ",
- 160000,
- " cells."
- }));
- this.DebugDrawRichData();
- this.PfProfilerEndSample();
- return PawnPath.NotFound;
- }
-
- public static int GetBuildingCost(Building b, TraverseParms traverseParms, Pawn pawn)
- {
- Building_Door building_Door = b as Building_Door;
- if (building_Door != null)
- {
- switch (traverseParms.mode)
- {
- case TraverseMode.ByPawn:
- if (!traverseParms.canBash && building_Door.IsForbiddenToPass(pawn))
- {
- if (DebugViewSettings.drawPaths)
- {
- CVPathFinder.DebugFlash(b.Position, b.Map, 0.77f, "forbid");
- }
- return 2147483647;
- }
- if (!building_Door.FreePassage)
- {
- if (building_Door.PawnCanOpen(pawn))
- {
- return building_Door.TicksToOpenNow;
- }
- if (traverseParms.canBash)
- {
- return 300;
- }
- if (DebugViewSettings.drawPaths)
- {
- CVPathFinder.DebugFlash(b.Position, b.Map, 0.34f, "cant pass");
- }
- return 2147483647;
- }
- break;
- case TraverseMode.NoPassClosedDoors:
- case TraverseMode.NoPassClosedDoorsOrWater:
- if (!building_Door.FreePassage)
- {
- return 2147483647;
- }
- break;
- }
- }
- else if (pawn != null)
- {
- return (int)b.PathFindCostFor(pawn);
- }
- return 0;
- }
-
- public static bool IsDestroyable(Thing th)
- {
- return th.def.useHitPoints && th.def.destroyable;
- }
-
- private bool BlocksDiagonalMovement(int x, int z)
- {
- return CVPathFinder.BlocksDiagonalMovement(x, z, this.map);
- }
-
- private bool BlocksDiagonalMovement(int index)
- {
- return CVPathFinder.BlocksDiagonalMovement(index, this.map);
- }
-
- public static bool BlocksDiagonalMovement(int x, int z, Map map)
- {
- return CVPathFinder.BlocksDiagonalMovement(map.cellIndices.CellToIndex(x, z), map);
- }
-
- public static bool BlocksDiagonalMovement(int index, Map map)
- {
- return !map.pathGrid.WalkableFast(index) || map.edificeGrid[index] is Building_Door;
- }
-
- private void DebugFlash(IntVec3 c, float colorPct, string str)
- {
- CVPathFinder.DebugFlash(c, this.map, colorPct, str);
- }
-
- private static void DebugFlash(IntVec3 c, Map map, float colorPct, string str)
- {
- map.debugDrawer.FlashCell(c, colorPct, str, 50);
- }
-
- private PawnPath FinalizedPath(int finalIndex)
- {
- PawnPath emptyPawnPath = this.map.pawnPathPool.GetEmptyPawnPath();
- int num = finalIndex;
- while (true)
- {
- CVPathFinder.CVPathFinderNodeFast pathFinderNodeFast = this.calcGrid[num];
- int parentIndex = pathFinderNodeFast.parentIndex;
- emptyPawnPath.AddNode(this.map.cellIndices.IndexToCell(num));
- if (num == parentIndex)
- {
- break;
- }
- num = parentIndex;
- }
- emptyPawnPath.SetupFound((float)this.calcGrid[finalIndex].knownCost);
- return emptyPawnPath;
- }
-
- private void InitStatusesAndPushStartNode(ref int curIndex, IntVec3 start)
- {
- this.statusOpenValue += 2;
- this.statusClosedValue += 2;
- if (this.statusClosedValue >= 65435)
- {
- this.ResetStatuses();
- }
- curIndex = this.cellIndices.CellToIndex(start);
- this.calcGrid[curIndex].knownCost = 0;
- this.calcGrid[curIndex].heuristicCost = 0;
- this.calcGrid[curIndex].costNodeCost = 0;
- this.calcGrid[curIndex].parentIndex = curIndex;
- this.calcGrid[curIndex].status = this.statusOpenValue;
- this.openList.Clear();
- this.openList.Push(new CVPathFinder.CostNode(curIndex, 0));
- }
-
- private void ResetStatuses()
- {
- int num = this.calcGrid.Length;
- for (int i = 0; i < num; i++)
- {
- this.calcGrid[i].status = 0;
- }
- this.statusOpenValue = 1;
- this.statusClosedValue = 2;
- }
-
- [Conditional("PFPROFILE")]
- private void PfProfilerBeginSample(string s)
- {
- }
-
- [Conditional("PFPROFILE")]
- private void PfProfilerEndSample()
- {
- }
-
- private void DebugDrawRichData()
- {
- if (DebugViewSettings.drawPaths)
- {
- while (this.openList.Count > 0)
- {
- int index = this.openList.Pop().index;
- IntVec3 c = new IntVec3(index % this.mapSizeX, 0, index / this.mapSizeX);
- this.map.debugDrawer.FlashCell(c, 0f, "open", 50);
- }
- }
- }
-
- private float DetermineHeuristicStrength(Pawn pawn, IntVec3 start, LocalTargetInfo dest)
- {
- if (pawn != null && pawn.RaceProps.Animal)
- {
- return 1.75f;
- }
- float lengthHorizontal = (start - dest.Cell).LengthHorizontal;
- return (float)Mathf.RoundToInt(CVPathFinder.NonRegionBasedHeuristicStrengthHuman_DistanceCurve.Evaluate(lengthHorizontal));
- }
-
- private CellRect CalculateDestinationRect(LocalTargetInfo dest, PathEndMode peMode)
- {
- CellRect result;
- if (!dest.HasThing || peMode == PathEndMode.OnCell)
- {
- result = CellRect.SingleCell(dest.Cell);
- }
- else
- {
- result = dest.Thing.OccupiedRect();
- }
- if (peMode == PathEndMode.Touch)
- {
- result = result.ExpandedBy(1);
- }
- return result;
- }
-
- private Area GetAllowedArea(Pawn pawn)
- {
- if (pawn != null && pawn.playerSettings != null && !pawn.Drafted && ForbidUtility.CaresAboutForbidden(pawn, true))
- {
- Area area = pawn.playerSettings.EffectiveAreaRestrictionInPawnCurrentMap;
- if (area != null && area.TrueCount <= 0)
- {
- area = null;
- }
- return area;
- }
- return null;
- }
-
- private void CalculateAndAddDisallowedCorners(TraverseParms traverseParms, PathEndMode peMode, CellRect destinationRect)
- {
- this.disallowedCornerIndices.Clear();
- if (peMode == PathEndMode.Touch)
- {
- int minX = destinationRect.minX;
- int minZ = destinationRect.minZ;
- int maxX = destinationRect.maxX;
- int maxZ = destinationRect.maxZ;
- if (!this.IsCornerTouchAllowed(minX + 1, minZ + 1, minX + 1, minZ, minX, minZ + 1))
- {
- this.disallowedCornerIndices.Add(this.map.cellIndices.CellToIndex(minX, minZ));
- }
- if (!this.IsCornerTouchAllowed(minX + 1, maxZ - 1, minX + 1, maxZ, minX, maxZ - 1))
- {
- this.disallowedCornerIndices.Add(this.map.cellIndices.CellToIndex(minX, maxZ));
- }
- if (!this.IsCornerTouchAllowed(maxX - 1, maxZ - 1, maxX - 1, maxZ, maxX, maxZ - 1))
- {
- this.disallowedCornerIndices.Add(this.map.cellIndices.CellToIndex(maxX, maxZ));
- }
- if (!this.IsCornerTouchAllowed(maxX - 1, minZ + 1, maxX - 1, minZ, maxX, minZ + 1))
- {
- this.disallowedCornerIndices.Add(this.map.cellIndices.CellToIndex(maxX, minZ));
- }
- }
- }
-
- private bool IsCornerTouchAllowed(int cornerX, int cornerZ, int adjCardinal1X, int adjCardinal1Z, int adjCardinal2X, int adjCardinal2Z)
- {
- return TouchPathEndModeUtility.IsCornerTouchAllowed(cornerX, cornerZ, adjCardinal1X, adjCardinal1Z, adjCardinal2X, adjCardinal2Z, this.map);
- }
- }
-}
diff --git a/Source/AllModdingComponents/CompVehicle/Command_VehicleHandler.cs b/Source/AllModdingComponents/CompVehicle/Command_VehicleHandler.cs
deleted file mode 100755
index 1334e5cb..00000000
--- a/Source/AllModdingComponents/CompVehicle/Command_VehicleHandler.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using UnityEngine;
-using Verse;
-
-namespace CompVehicle
-{
- public class Command_VehicleHandler : Command
- {
- public Action action;
-
- public override float GetWidth(float maxWidth) => NewWidth(maxWidth);
-
- public float NewWidth(float maxWidth)
- {
- return base.GetWidth(maxWidth) * 0.75f;
- }
-
- public override void ProcessInput(Event ev)
- {
- base.ProcessInput(ev);
- action();
- }
- }
-}
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompVehicle/CompProperties_Vehicle.cs b/Source/AllModdingComponents/CompVehicle/CompProperties_Vehicle.cs
deleted file mode 100755
index 4e5b84c6..00000000
--- a/Source/AllModdingComponents/CompVehicle/CompProperties_Vehicle.cs
+++ /dev/null
@@ -1,112 +0,0 @@
-using System.Collections.Generic;
-using UnityEngine;
-using Verse;
-
-namespace CompVehicle
-{
- public enum VehicleType
- {
- Aircraft,
- AircraftAmphibious,
- AircraftSpace,
- Amphibious,
- LandWheeled,
- LandHover,
- LandWalker,
- Sea,
- SeaSubmarine,
- SpaceOuter
- }
-
- public enum HandlingType
- {
- Incapable = 0,
- HandlerRequired = 1,
- NoHandlerRequired = 2
- }
-
- public class CompProperties_Vehicle : CompProperties
- {
- //Added by Swenzi 1/1/2018
- //Allow animals to pull vehicles and be in a role that controls Movement Handling
- public bool animalDrivers = false;
-
- //Modifies the draw offset of the animal when it's attached to the vehicle
- public Vector3 drawOffset = new Vector3(0, 0, 0);
-
- //Whether or not the drivers of a pawn should be drawn, i.e. animals pulling a wagon or a pawn on a motorcycle
- public bool drawDrivers = false;
-
- //The minimum body size requirement for an animal to haul a vehicle
- public float minBodySize = 0;
-
-
- public bool canBeDowned = false; // Does this become downed?
-
- public bool canWiggleWhenDowned = false; // Does this wiggle when downed?
-
- //Added 7/23/17
- public float cargoCapacity = 385.554f; // Cargo capacity for your vehicle in kilograms.
-
- public float ejectIfBelowHealthPercent = 0.0f
- ; // Unloads all passengers when health percentage drops below this point
-
- //---------- Additions made by Swenzi ------------
-
- public float ejectIfBelowNeedPercent = 0.2f
- ; //Unloads passenger when one of their major needs drops below this percent
-
- public float foodNeedRate = 2.0E-05f; //The rate at which the food need changes while in the vehicle
- public float joyNeedRate = 1.5E-05f; //The rate at which the joy need changes while in the vehicle
- public string labelBroken = "Broken"; // Label replacer for when the vehicle is broken / "dead".
- public string labelDamaged = "Damaged"; // Label replacer for when the vehicle is damaged.
- public string labelInoperable = "Inoperable"; // Label replacer for when the vehicle is inoperable / "downed".
- public string labelUndamaged = "Undamaged"; // Label replacer for when the vehicle is undamaged.
-
- public HandlingType manipulationHandling = HandlingType.Incapable
- ; // Does this vehicle rely on others to load it? Or can it "pick" up objects?
-
- public int momentumTimeSeconds = 2; //Counter for how long the vehicle can travel without a driver in seconds
- public HandlingType movementHandling = HandlingType.HandlerRequired; // Is the movement automatic?
- public float restNeedRate = 2.0E-05f; //The rate at which the rest need changes while in the vehicle
- public List roles = new List(); // Defines roles of passengers.
- public float seatHitCriticalHitChance = 0.05f; // Chance of doubling the damage.
- public float seatHitDamageFactor = 2.0f; // Multiply & apply this damage to passengers in seats
- public SoundDef soundEject = null; // Sound when a character exits the vehicle.
- public SoundDef soundEntry = null; // Sound for when a character enters the vehicle.
- public SoundDef soundMoving = null; // For a sound to play while the vehicle is moving.
-
- public VehicleType vehicleType = VehicleType.LandWheeled; // Defaults to wheeled land vehicles.
- public HandlingType weaponHandling = HandlingType.HandlerRequired; // Are the weapons automatic?
-
- public float worldSpeedFactor = 2.0f
- ; // How much faster does this move on the world map than a standard pawn? Caravan speed is calculated from an average of the combined speeds (Vanilla formula)
-
- public float worldSpeedFactorNoFuel = 0.5f
- ; //Modifies the change in world speed if this vehicle is present but does not have fuel
-
- public CompProperties_Vehicle()
- {
- compClass = typeof(CompVehicle);
- }
-
- //Vehicle type (Can only be one, effects not implemented yet)
- //public bool isAir = false; //Is the vehicle an aircraft? i.e. airplane, helicopter
- //public bool isLand = false; //Is the vehicle a land based vehicle? i.e. car, tank
- //public bool isWater = false; //Is the vehicle a water based vehicle? i.e. boat
-
- //---------- Additions made by Swenzi end -------------
-
- public int TotalCapacity
- {
- get
- {
- var result = 0;
- if (roles != null && roles.Count > 0)
- foreach (var role in roles)
- result += role.slots;
- return result;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompVehicle/CompProperties_VehicleSpawner.cs b/Source/AllModdingComponents/CompVehicle/CompProperties_VehicleSpawner.cs
deleted file mode 100644
index bf7e15fe..00000000
--- a/Source/AllModdingComponents/CompVehicle/CompProperties_VehicleSpawner.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using RimWorld;
-using Verse;
-
-namespace CompVehicle
-{
- public class CompProperties_VehicleSpawner : CompProperties
- {
- public float assemblyTime = 20f; //In seconds
- public string useVerb = "Assemble {0}";
- public PawnKindDef vehicleToSpawn = null;
- public EffecterDef workEffect = EffecterDefOf.ConstructMetal;
-
- public CompProperties_VehicleSpawner()
- {
- compClass = typeof(CompVehicleSpawner);
- }
- }
-}
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompVehicle/CompVehicle.cs b/Source/AllModdingComponents/CompVehicle/CompVehicle.cs
deleted file mode 100644
index 0ef117a3..00000000
--- a/Source/AllModdingComponents/CompVehicle/CompVehicle.cs
+++ /dev/null
@@ -1,817 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using RimWorld;
-using RimWorld.Planet;
-using UnityEngine;
-using Verse;
-using Verse.AI;
-using Verse.AI.Group;
-using Verse.Sound;
-
-namespace CompVehicle
-{
- public enum PilotableSlotType
- {
- pilot,
- gunner,
- crew,
- dutiless
- }
-
- public enum MovingState
- {
- frozen = 0,
- able
- }
-
- public enum WeaponState
- {
- frozen = 0,
- able
- }
-
- public enum ManipulationState
- {
- frozen = 0,
- able
- }
-
-
- public class CompVehicle : ThingComp
- {
- public List bills = new List();
-
- public bool draftStatusChanged = false
- ; //Boolean connected to comp to prevent excessive changing of the draftstatus when forming a caravan
-
- public float fuelConsumptionRate = 80f; //Stores what the fuel usage rate is, i.e. how much fuel is lost
- public List handlers = new List();
- public Rot4 lastDirection = Rot4.South; //J Stores the last direction a vehicle was facing.
- public ManipulationState manipulationStatus = ManipulationState.able;
-
- public MovingState movingStatus = MovingState.able;
- private Sustainer movingSustainer;
- public List repairCostList = new List();
-
- public bool ResolvedITTab;
- public bool ResolvedPawns;
- public int tickCount; //Counter for how long the vehicle has traveled without a driver
-
- public List vehicleContents = new List()
- ; //Stores the handlergroups of the vehicle and its pawns while the vehicle is in a caravan
-
- public bool warnedNoFuel; //Boolean connected to comp to prevent spamming of the Caravan No Fuel warning message
- public WeaponState weaponStatus = WeaponState.able;
-
- public bool CanManipulate =>
- Props.manipulationHandling > HandlingType.HandlerRequired || ManipulationHandlerAvailable;
-
- public bool ManipulationHandlerAvailable
- {
- get
- {
- var result = false;
- if (handlers != null && handlers.Count > 0)
- foreach (var group in handlers)
- if (group.handlers != null && group.handlers.Count > 0)
- if (group.role != null)
- if ((group.role.handlingTypes & HandlingTypeFlags.Manipulation) !=
- HandlingTypeFlags.None)
- result = group.handlers.Any((Pawn x) => !x.Dead && !x.Downed);
- return result;
- }
- }
-
- public bool CanMove => Props.movementHandling > HandlingType.HandlerRequired || MovementHandlerAvailable;
-
- public bool MovementHandlerAvailable
- {
- get
- {
- var result = false;
- if (handlers != null && handlers.Count > 0)
- foreach (var group in handlers)
- if (group.handlers != null && group.handlers.Count > 0)
- if (group.role != null)
- if ((group.role.handlingTypes & HandlingTypeFlags.Movement) != HandlingTypeFlags.None)
- result = group.handlers.Any((Pawn x) => !x.Dead && !x.Downed);
- return result;
- }
- }
-
- public bool CanFireWeapons => Props.weaponHandling > HandlingType.HandlerRequired || WeaponHandlerAvailable;
-
- public bool WeaponHandlerAvailable
- {
- get
- {
- var result = false;
- if (handlers != null && handlers.Count > 0)
- foreach (var group in handlers)
- if (group.role != null && group.handlers != null && group.handlers.Count > 0)
- if ((group.role.handlingTypes & HandlingTypeFlags.Weapons) != HandlingTypeFlags.None)
- result = group.handlers.Any((Pawn x) => !x.Dead && !x.Downed);
- return result;
- }
- }
-
- public Pawn Pawn => parent as Pawn;
-
-
- public List AllOccupants
- {
- get
- {
- var result = new List();
- if (handlers != null && handlers.Count > 0)
- foreach (var group in handlers)
- if (group.handlers != null && group.handlers.Count > 0) result.AddRange(group.handlers);
- return result;
- }
- }
-
- public CompProperties_Vehicle Props => (CompProperties_Vehicle) props;
-
- public void ResolveITab()
- {
- if (!ResolvedITTab)
- {
- ResolvedITTab = true;
- //PostExposeData();
- //Make the ITab
- var tabs = Pawn.GetInspectTabs();
- if (tabs != null && tabs.Count() > 0)
- if (tabs.FirstOrDefault(x => x is ITab_Passengers) == null)
- try
- {
- Pawn.def.inspectorTabsResolved.Add(
- InspectTabManager.GetSharedInstance(typeof(ITab_Passengers)));
- }
- catch (Exception ex)
- {
- Log.Error(string.Concat("Could not instantiate inspector tab of type ",
- typeof(ITab_Passengers), ": ", ex));
- }
- }
- }
-
- private Pawn GeneratePawn(List optionalDefs = null)
- {
- var newPawnKind = Pawn.Faction.RandomPawnKind();
- if (optionalDefs != null && optionalDefs.Count > 0)
- newPawnKind = optionalDefs.RandomElementByWeight(x => x.selectionWeight).kind;
-
- var request = new PawnGenerationRequest(newPawnKind, Pawn.Faction, PawnGenerationContext.NonPlayer,
- Pawn.Map.Tile, false, false, false, false, true, true, 1f, false, true, true, false, false, false,
- false, false, 0, null, (0-1), null, null, null, null);
- var item = PawnGenerator.GeneratePawn(request);
- return item;
- }
-
- public void InitializeVehicleHandlers()
- {
- if (handlers != null && handlers.Count > 0) return;
-
- if (Props.roles != null && Props.roles.Count > 0)
- foreach (var role in Props.roles)
- handlers.Add(new VehicleHandlerGroup(Pawn, role, new List()));
- }
-
- public void ResolveFactionPilots()
- {
- //this.Pawn.pather.
- //-------- Additions Made By Swenzi --------
- //Purpose: Remove Spawning of Premade Pawns in Vehicles
- //Logic: Players should not get free pawns for making vehicles
- //Improvements: None I can think of
-
- //Premade Pawns should only appear for non-player-faction vehicles
- if (!Pawn.Faction.IsPlayer)
- if (!ResolvedPawns)
- {
- ResolvedPawns = true;
-
- if (handlers != null && handlers.Count > 0)
- foreach (var group in handlers)
- {
- var role = group.role;
- if (role.slotsToOperate > 0)
- {
- var minimum = Math.Min(role.slotsToOperate, role.slots);
- var maximum = Math.Max(role.slotsToOperate, role.slots);
- var range = Rand.Range(minimum, maximum);
- for (var i = 0; i < range; i++)
- {
- var newPawn = GeneratePawn(role.preferredHandlers);
- if (newPawn != null)
- group.handlers.TryAdd(newPawn);
- }
- }
- }
- }
- }
-
- public void ResolveEjection()
- {
- //----Additions Made By Swenzi-----
- //Purpose: Ejects pawns if the need of that pawn is below the threshold set by ejectIfBelowNeedPercent
- //Logic: Prevents pawns from starving to death or other need related issues i.e. moral from poor management of pawns in vehicles
- //Improvements: Have pawns remember the vehicle they left, so they return after needs are satisfied?
- //Adjustments by Jecrell
-
- if (parent is Pawn vehicle && vehicle.Spawned && handlers != null && handlers.Count > 0 &&
- !(Pawn.GetLord()?.LordJob?.ToString() == "RimWorld.LordJob_FormAndSendCaravan") &&
- !(Pawn.CurJob?.def == JobDefOf.UnloadYourInventory) && !Pawn.Position.InNoBuildEdgeArea(Pawn.Map) &&
- !Pawn.IsFighting()
- )
- {
- //Do not eject anyone from the vehicle for needs during combat.
- //It's too dangerous to leave during combat.
- if (this?.Pawn?.Map?.attackTargetsCache?.GetPotentialTargetsFor(Pawn)
- ?.FirstOrDefault(x => !x.ThreatDisabled(vehicle)) == null) //TODO May require further investigation for proper update
- foreach (var group in handlers)
- {
- var toEject = group?.handlers?.InnerListForReading?.FirstOrDefault(x =>
- !x.Spawned &&
- x?.needs?.AllNeeds?.FirstOrDefault(
- y => y.CurLevelPercentage < Props.ejectIfBelowNeedPercent) != null);
- if (toEject != null)
- {
- Messages.Message("MessagePawnLeftVehicle".Translate(toEject.Label, Pawn.Label, "low"), Pawn,
- MessageTypeDefOf.NegativeHealthEvent);
- Pawn b;
- Eject(toEject);
- }
- }
-
- //}
-
- //----Additions Made By Swenzi-----
-
- //Every 250 ticks
- if (Props.ejectIfBelowHealthPercent > 0.0f)
- if (Find.TickManager.TicksGame % 250 == 0)
- {
- if (Pawn.Dead || Pawn.Downed)
- if (handlers != null && handlers.Count > 0)
- {
- foreach (var group in handlers)
- EjectAll();
- weaponStatus = WeaponState.frozen;
- movingStatus = MovingState.frozen;
- if (Pawn.Downed && Pawn.Faction != Faction.OfPlayerSilentFail)
- Pawn.SetFaction(Faction.OfPlayerSilentFail);
- return;
- }
-
- if (Pawn.health != null)
- if (Pawn.health.summaryHealth != null)
- {
- var currentHealthPercentage = Pawn.health.summaryHealth.SummaryHealthPercent;
- if (currentHealthPercentage < Props.ejectIfBelowHealthPercent)
- if (handlers != null && handlers.Count > 0)
- {
- foreach (var group in handlers)
- EjectAll();
- weaponStatus = WeaponState.frozen;
- movingStatus = MovingState.frozen;
- if (Pawn.Downed) Pawn.SetFaction(Faction.OfPlayerSilentFail);
- }
- }
- }
- }
- }
-
- public void ResolveStatus()
- {
- //-------- Additions Made By Swenzi --------
- //Purpose: Fixes bugs and adds better fuel consumption if the vehicle is refuelable
- //Logic: Better fuel consumption logic saves chemfuel, less bugs is good
- //Improvements: None I can think of.
- //Other Info: Changes marked with --- ADB Swenzi --- due to the dispersion of modifications in the method
- if (Pawn?.GetComp() is CompRefuelable compRefuelable)
- {
- //------ ADB Swenzi ------
- //If it isn't moving than it shouldn't use fuel
- if (Pawn.pather != null && !Pawn.pather.Moving ||
- Pawn.GetCaravan() != null && Pawn.GetCaravan().CantMove)
- compRefuelable.Props.fuelConsumptionRate = 0f;
- else
- //If it's moving than it should use fuel
- compRefuelable.Props.fuelConsumptionRate = fuelConsumptionRate;
- //------ ADB Swenzi ------
-
- if (!compRefuelable.HasFuel)
- {
- weaponStatus = WeaponState.frozen;
- movingStatus = MovingState.frozen;
- return;
- }
- }
-
- if (MovementHandlerAvailable && movingStatus == MovingState.frozen)
- movingStatus = MovingState.able;
-
- if (WeaponHandlerAvailable && weaponStatus == WeaponState.frozen)
- weaponStatus = WeaponState.able;
-
- if (!MovementHandlerAvailable && movingStatus == MovingState.able &&
- Props.movementHandling != HandlingType.NoHandlerRequired)
- movingStatus = MovingState.frozen;
-
- if (!WeaponHandlerAvailable && weaponStatus == WeaponState.able &&
- Props.weaponHandling != HandlingType.NoHandlerRequired)
- weaponStatus = WeaponState.frozen;
-
- if (!ManipulationHandlerAvailable && manipulationStatus == ManipulationState.able &&
- Props.manipulationHandling != HandlingType.NoHandlerRequired)
- manipulationStatus = ManipulationState.frozen;
-
- // ------ ADB Swenzi -------
- //If it can move and it's in a caravan wandering than it might be stuck
- //aka the movement thing hasn't kicked in. Change draft status just to be safe.
-
- //Fixes bug where weapon tries to fire even after gunner is removed
- if (weaponStatus != WeaponState.able)
- if (this?.Pawn?.CurJob?.def == JobDefOf.Wait_Combat ||
- this?.Pawn?.CurJob?.def == JobDefOf.AttackStatic ||
- this?.Pawn?.CurJob?.def == JobDefOf.AttackMelee)
- if (!this?.Pawn?.pather?.Moving ?? false)
- Pawn.jobs.EndCurrentJob(JobCondition.None, false);
- else
- Pawn.jobs.EndCurrentJob(JobCondition.None, true);
- if (movingStatus == MovingState.able)
- {
- //Removed caravan member check as apparently pawns currently forming a caravan aren't part of one yet
- // if (this.Pawn.CurJob != null && this.Pawn.CurJob.def == JobDefOf.GotoWander)
- // {
- // if (!this.draftStatusChanged){
- //this.Pawn.drafter.Drafted = !this.Pawn.Drafted;
- //this.draftStatusChanged = true;
- // }
- // }
- // else
- // {
- // //Safety to allow this for future caravans
- // this.draftStatusChanged = false;
- // }
- }
- else
- {
- //Vehicles that can't move shouldn't have Lords, it causes problems cause they never complete their jobs and toils
- if (this?.Pawn?.GetLord() != null)
- Pawn.GetLord().lordManager.RemoveLord(Pawn.GetLord());
-
- if (Pawn.pather != null && Pawn.pather.Moving)
- if (tickCount > Props.momentumTimeSeconds * 60)
- {
- //No more fake momentum, vehicle should stop
- //this.Pawn.jobs.
- if (Pawn.pather.Moving) Pawn.jobs.EndCurrentJob(JobCondition.None, false);
- Pawn.pather.StopDead();
- tickCount = 0;
- }
- else
- {
- //Be cool, keep the momentum going
- tickCount++;
- }
- }
- if (movingStatus != MovingState.able && weaponStatus != WeaponState.able &&
- this?.Pawn?.mindState != null)
- Pawn.mindState.lastJobTag = JobTag.Idle;
- // ------ ADB Swenzi -------
- if (Pawn.Drafted && movingStatus == MovingState.frozen)
- Pawn.drafter.Drafted = false;
- }
-
- // ------ Additions made by Swenzi ------
- //Purpose: Reduce the needs of pawns while in the vehicle
- //Logic: Prevent cryosleep gimmicks by storing pawns in vehicles forever
- //To prevent unneccessary patching of game methods, needs are modified by this function
- //Improvements: Mood modifiers if they stay too long? Traits effecting mood? Driving Experience?
- //
- //Addendum by Jecrell:
- //-Added the ability for some pawns to resolve needs inside the vehicle.
- //-Prevent needs from falling while resting.
- public void ResolveNeeds()
- {
- //Player only, NPC factions is weird unless better logic is make them go back to vehicles after being ejected
- if (Pawn.Faction.IsPlayer)
- if (handlers != null && handlers.Count > 0)
- foreach (var group in handlers)
- if ((group?.handlers?.Count ?? 0) > 0)
- for (var i = 0; i < group.handlers.Count; i++)
- {
- var pawn = group.handlers[i];
- //Don't change needs while a caravan member.
- if (pawn.IsCaravanMember()) continue;
- var pawn_needs = pawn.needs.AllNeeds;
- //These needs are major and should change
- for (var j = 0; j < pawn_needs.Count; j++)
- {
- if (pawn_needs[j] is Need_Rest need_Rest)
- {
- pawn_needs[j].CurLevel -= Props.restNeedRate;
- CompVehicleUtility.TrySatisfyRestNeed(pawn, need_Rest, Pawn);
- }
- if (pawn_needs[j] is Need_Food need_Food)
- {
- pawn_needs[j].CurLevel -= Props.foodNeedRate;
- CompVehicleUtility.TrySatisfyFoodNeed(pawn, need_Food, Pawn);
- }
- if (pawn_needs[j] is Need_Chemical need_Chemical)
- {
- pawn_needs[j].CurLevel -= Props.foodNeedRate;
- CompVehicleUtility.TrySatisfyChemicalNeed(pawn, need_Chemical, Pawn);
- }
- if (pawn_needs[j].def == NeedDefOf.Joy)
- pawn_needs[j].CurLevel -= Props.joyNeedRate;
- }
- }
- }
-
- // ------ Additions made by Swenzi ------
-
- public void RemovePawn(Pawn pawn)
- {
- //Log.Message("Remove1");
- if (handlers is List groups && !groups.NullOrEmpty())
- {
- //Log.Message("Remove2");
-
- var tempGroups = groups.FindAll(x => x.handlers.InnerListForReading.Contains(pawn));
- if (!tempGroups.NullOrEmpty())
- foreach (var group in tempGroups)
- //Log.Message("Remove4");
-
- if (group.handlers.InnerListForReading.Remove(pawn))
- return;
- }
- }
-
- public void Eject(Pawn pawn)
- {
- if (!pawn.Spawned)
- GenSpawn.Spawn(pawn, Pawn.PositionHeld.RandomAdjacentCell8Way(), Pawn.MapHeld);
- RemovePawn(pawn);
- }
-
- public void EjectAll()
- {
- var pawnsToEject = new List(AllOccupants);
- if (pawnsToEject != null && pawnsToEject.Count > 0)
- foreach (var p in pawnsToEject)
- Eject(p);
- }
-
- public void GiveLoadJob(Thing thingToLoad, VehicleHandlerGroup group)
- {
- if (thingToLoad is Pawn pawn)
- {
- var newJob = new Job(DefDatabase.GetNamed("CompVehicle_LoadPassenger"), Pawn);
- pawn.jobs.TryTakeOrderedJob(newJob);
-
- if (bills != null && bills.Count > 0)
- {
- var bill = bills.FirstOrDefault(x => x.pawnToLoad == pawn);
- if (bill != null)
- {
- bill.group = group;
- return;
- }
- }
- bills.Add(new Bill_LoadVehicle(pawn, Pawn, group));
- }
- }
-
- public void Notify_Loaded(Pawn pawnToLoad)
- {
- if ((bills != null) & (bills.Count > 0))
- {
- var bill = bills.FirstOrDefault(x => x.pawnToLoad == pawnToLoad);
- if (bill != null)
- {
- if (pawnToLoad.IsWorldPawn())
- Log.Warning("Called LoadPawn on world pawn");
- //var curFaction = pawnToLoad.Faction;
- pawnToLoad.DeSpawn();
- if (pawnToLoad.holdingOwner != null)
- pawnToLoad.holdingOwner.TryTransferToContainer(pawnToLoad, bill.group.handlers);
- else bill.group.handlers.TryAdd(pawnToLoad);
- if (!pawnToLoad.IsWorldPawn())
- Find.WorldPawns.PassToWorld(pawnToLoad, PawnDiscardDecideMode.Decide);
- //pawnToLoad.SetFaction(curFaction);
- bills.Remove(bill);
- }
- }
- }
-
- public override void CompTick()
- {
- base.CompTick();
- InitializeVehicleHandlers();
- ResolveITab();
- ResolveFactionPilots();
- ResolveEjection();
- ResolveStatus();
- ResolveMovementSound();
-
- //------ Additions made by Swenzi ------
- ResolveNeeds();
- //------ Additions made by Swenzi ------
-
- }
-
- //Additions by Swenzi 1/1/2018
- public override void PostDraw()
- {
- //Additions by Swenzi 1/1/2018
- ResolveGraphics();
- base.PostDraw();
- }
- //Draw the drivers in the vehicle if drawDrivers is true
- public void ResolveGraphics(){
- if(Props.drawDrivers){
- List haulers = new List();
- if (handlers != null && handlers.Count > 0)
- {
- //Amass a list of drivers that are alive and in a slot modifying movement
- foreach (var group in handlers)
- {
- if (group.handlers != null && group.handlers.Count > 0){
- if (group.role != null && (group.role.handlingTypes & HandlingTypeFlags.Movement) != HandlingTypeFlags.None)
- {
- if (group.handlers.Any((Pawn x) => !x.Downed && !x.Dead))
- {
- foreach (Pawn p in group.handlers)
- {
- if (!p.Downed && !p.Dead)
- {
- haulers.Add(p);
- }
- }
- }
- }
- }
- }
- if(haulers.Count > 0){
- //Display the drivers that are in the vehicle
- Pawn p = parent as Pawn;
- float width = p.ageTracker.CurKindLifeStage.bodyGraphicData.drawSize.x;
- float height = p.ageTracker.CurKindLifeStage.bodyGraphicData.drawSize.y;
- float xMod = -width / 4;
- float yMod = 0;
- foreach(Pawn d in haulers){
- d.Rotation = parent.Rotation;
- //If it's the last driver to be displayed and on a new row, put it in the center
- if (haulers.Count % 2 == 1 && d == haulers.Last())
- {
- d.Drawer.renderer.RenderPawnAt(ResolveOffset(ResolveOffset(p.Drawer.DrawPos, new Vector3(0, 0, yMod), parent.Rotation), Props.drawOffset, parent.Rotation));
- }
- else{
- //Draw drivers in 2 x 1 rows
- d.Drawer.renderer.RenderPawnAt(ResolveOffset(ResolveOffset(p.Drawer.DrawPos,new Vector3(xMod, 0, yMod),parent.Rotation), Props.drawOffset, parent.Rotation));
- xMod += 2 * width/4;
- if(xMod > 2 * width / 4){
- xMod = -width/3;
- yMod += height/3;
- }
- }
- }
- }
- }
- }
- }
-
- public Vector3 ResolveOffset(Vector3 oldPos, Vector3 offset, Rot4 rot){
- Vector3 newPos = oldPos;
- if(rot == Rot4.North){
- newPos = new Vector3(oldPos.x + offset.x, oldPos.y, oldPos.z + offset.z);
- }
- if(rot == Rot4.East){
- newPos = new Vector3(oldPos.x + offset.z, oldPos.y, oldPos.z - offset.x);
- }
- if(rot == Rot4.South){
- newPos = new Vector3(oldPos.x - offset.x, oldPos.y, oldPos.z - offset.z);
- }
- if(rot == Rot4.West){
- newPos = new Vector3(oldPos.x - offset.z, oldPos.y, oldPos.z + offset.x);
- }
- return newPos;
- }
-
-
- public void ResolveMovementSound()
- {
- if (parent is Pawn p && Props.soundMoving != null)
- {
- var isMovingNow = p?.pather?.Moving ?? false;
- if (isMovingNow && movingSustainer == null)
- {
- var info = SoundInfo.InMap(parent, MaintenanceType.None);
- movingSustainer = Props.soundMoving.TrySpawnSustainer(info);
- }
- else if (!isMovingNow && movingSustainer != null)
- {
- movingSustainer.End();
- movingSustainer = null;
- }
- }
- }
-
- public void GetVehicleButtonFloatMenu(VehicleHandlerGroup group, bool canLoad)
- {
- var list = new List();
- var map = Pawn.Map;
- var tempList = group?.handlers?.InnerListForReading != null
- ? new List(group.handlers.InnerListForReading)
- : new List();
- if (canLoad && tempList.Count == 0)
- {
- SoundDefOf.Tick_Tiny.PlayOneShotOnCamera(null);
- //Additions by Swenzi 1/1/2018
- //Allow animals to ride in vehicles or pull vehicles (animals only allowed to be in slots that allow movement)
- if (Props.animalDrivers && (group.role.handlingTypes & HandlingTypeFlags.Movement) != HandlingTypeFlags.None)
- {
- Find.Targeter.BeginTargeting(
- new TargetingParameters
- {
- validator = ti => ti.Thing is Pawn p && p.Faction != null && p.Faction.IsPlayer && p.training != null && p.training.HasLearned(DefDatabase.GetNamed("Haul")) && p.BodySize > Props.minBodySize
- }, delegate (LocalTargetInfo target) { GiveLoadJob(target.Thing, group); }, null, null, null);
- }else{
- Find.Targeter.BeginTargeting(
- new TargetingParameters
- {
- validator = ti => ti.Thing is Pawn p && p.RaceProps.Humanlike && p.IsColonistPlayerControlled
- }, delegate (LocalTargetInfo target) { GiveLoadJob(target.Thing, group); }, null, null, null);
-
- }
- return;
- }
- if (canLoad)
- {
- var text = "CompVehicle_Load".Translate(group.role.label);
- //Func extraPartOnGUI = (Rect rect) => Widgets.InfoCardButton(rect.x + 5f, rect.y + (rect.height - 24f) / 2f, handler);
-
- //Additions by Swenzi 1/1/2018
- //Allow animals to ride in vehicles or pull vehicles (animals only allowed to be in slots that allow movement)
- if(Props.animalDrivers && (group.role.handlingTypes & HandlingTypeFlags.Movement) != HandlingTypeFlags.None){
- list.Add(new FloatMenuOption(text, delegate
- {
- SoundDefOf.Tick_Tiny.PlayOneShotOnCamera(null);
- Find.Targeter.BeginTargeting(
- new TargetingParameters
- {
- validator = ti =>
- ti.Thing is Pawn p && p.Faction != null && p.Faction.IsPlayer && p.training != null && p.training.HasLearned(DefDatabase.GetNamed("Haul")) && p.BodySize > Props.minBodySize
- }, delegate (LocalTargetInfo target) { GiveLoadJob(target.Thing, group); }, null, null, null);
- }, MenuOptionPriority.Default, null, null, 29f, null, null));
- }
- else{
- list.Add(new FloatMenuOption(text, delegate
- {
- SoundDefOf.Tick_Tiny.PlayOneShotOnCamera(null);
- Find.Targeter.BeginTargeting(
- new TargetingParameters
- {
- validator = ti =>
- ti.Thing is Pawn p && p.RaceProps.Humanlike && p.IsColonistPlayerControlled
- }, delegate (LocalTargetInfo target) { GiveLoadJob(target.Thing, group); }, null, null, null);
- }, MenuOptionPriority.Default, null, null, 29f, null, null));
-
- }
- }
- if (!canLoad && tempList.Count == 1)
- {
- var temptempList = new List(tempList);
- foreach (var handler in temptempList)
- Eject(handler);
- temptempList.Clear();
- return;
- }
- if (tempList.Count != 0)
- foreach (var handler in tempList)
- {
- var text = "CompVehicle_Unload".Translate(handler.Name.ToStringFull);
- var arg_121_0 = list;
- Func extraPartOnGUI = rect =>
- Widgets.InfoCardButton(rect.x + 5f, rect.y + (rect.height - 24f) / 2f, handler);
- list.Add(new FloatMenuOption(text, delegate { Eject(handler); }, MenuOptionPriority.Default, null,
- null, 29f, extraPartOnGUI, null));
- }
- Find.WindowStack.Add(new FloatMenu(list));
- }
-
- public override IEnumerable CompGetGizmosExtra()
- {
- var enumerator = base.CompGetGizmosExtra().GetEnumerator();
- while (enumerator.MoveNext())
- {
- var current = enumerator.Current;
- yield return current;
- }
- //Log.Message("0");
- if (Pawn.Faction == Faction.OfPlayerSilentFail)
- {
- //Log.Message("1");
- if (Props.roles != null && Props.roles.Count > 0)
- foreach (var group in handlers)
- //Log.Message("3");
- if (group.role != null)
- {
- //Log.Message("4");
- var loadable = group.AreSlotsAvailable;
- var unloadable = (group?.handlers?.Count ?? 0) > 0;
- if (loadable || unloadable)
- {
- //Log.Message("5");
- var button = new Command_VehicleHandler
- {
- action = delegate
- {
- SoundDefOf.Tick_Tiny.PlayOneShotOnCamera(null);
- GetVehicleButtonFloatMenu(group, loadable);
- },
- hotKey = KeyBindingDefOf.Misc1
- };
- var label = "CompVehicle_Load";
- var desc = "CompVehicle_LoadDesc";
- if (!loadable && unloadable)
- {
- label = "CompVehicle_Unload";
- desc = "CompVehicle_UnloadDesc";
- }
- if (loadable && unloadable)
- {
- label = "CompVehicle_LoadUnload";
- desc = "CompVehicle_LoadUnloadDesc";
- }
-
- button.defaultLabel = label.Translate(group.role.label.CapitalizeFirst());
- button.defaultDesc = desc.Translate(group.role.label.CapitalizeFirst());
- button.icon =
- TexCommand
- .Install; //ContentFinder.Get("UI/Commands/TryReconnect", true);
-
- var pctFilled = Pawn.health.summaryHealth.SummaryHealthPercent;
- button.disabled = Pawn.Downed || Pawn.Dead ||
- pctFilled < Props.ejectIfBelowHealthPercent;
- button.disabledReason = "CompVehicle_DisabledDesc".Translate();
-
- //Log.Message(button.ToString());
- yield return button;
- }
- }
- if (Pawn.drafter == null) Pawn.drafter = new Pawn_DraftController(Pawn);
- }
- }
-
- public override void PostExposeData()
- {
- base.PostExposeData();
- Scribe_Values.Look(ref ResolvedPawns, "ResolvedPawns", false);
- Scribe_Values.Look(ref weaponStatus, "weaponStatus", WeaponState.able);
- Scribe_Values.Look(ref movingStatus, "movingStatus", MovingState.able);
- Scribe_Values.Look(ref lastDirection, "lastDirection", Rot4.South);
-
- Scribe_Collections.Look(ref vehicleContents, "vehicleContents",
- LookMode.Deep); //Stores the handlergroups of the vehicle and its pawns while the vehicle is in a caravan
- Scribe_Collections.Look(ref handlers, "handlers", LookMode.Deep);
- Scribe_Collections.Look(ref bills, "bills", LookMode.Deep);
-
- //Scribe_Collections.Look(ref this.pilots, "pilots", LookMode.Deep, new object[0]);
- //Scribe_Collections.Look(ref this.gunners, "gunners", LookMode.Deep, new object[0]);
- //Scribe_Collections.Look(ref this.crew, "crew", LookMode.Deep, new object[0]);
- //Scribe_Collections.Look(ref this.passengers, "passengers", LookMode.Deep, new object[0]);
- }
-
- #region SwenzisCode
-
- //------ Additions By Swenzi -------
- //Purpose: Control the boolean warnedOnNoFuel
- //Logic: Needed to prevent spamming of the warning message
-
- public bool WarnedOnNoFuel
- {
- get => warnedNoFuel;
-
- set => warnedNoFuel = value;
- }
-
- //Purpose: Store the pawns in the vehicle while it is in a caravan
- //Logic: Allows the vehicle to remember what pawns were inside it so they can be put back in later on map entry
-
- public List PawnsInVehicle
- {
- get => vehicleContents;
-
- set => vehicleContents = value;
- }
-
- //------ Additions By Swenzi -------
-
- #endregion SwenzisCode
- }
-}
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompVehicle/CompVehicle.csproj b/Source/AllModdingComponents/CompVehicle/CompVehicle.csproj
deleted file mode 100644
index 4e00fb0b..00000000
--- a/Source/AllModdingComponents/CompVehicle/CompVehicle.csproj
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {6E907669-2299-47E1-B144-8BC7488DF5C4}
- Library
- Properties
- CompVehicle
- CompVehicle
- v4.7.2
- 512
-
-
-
- false
- none
- false
- ..\..\..\Assemblies\
- DEBUG;TRACE
- prompt
- 4
- false
-
-
- none
- true
- ..\..\..\Assemblies\
- TRACE
- prompt
- 4
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1.1.2566
-
-
- 2.0.0.8
-
-
-
-
-
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompVehicle/CompVehicle.sln b/Source/AllModdingComponents/CompVehicle/CompVehicle.sln
deleted file mode 100644
index 201b28ef..00000000
--- a/Source/AllModdingComponents/CompVehicle/CompVehicle.sln
+++ /dev/null
@@ -1,17 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompVehicle", "CompVehicle.csproj", "{6E907669-2299-47E1-B144-8BC7488DF5C4}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6E907669-2299-47E1-B144-8BC7488DF5C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6E907669-2299-47E1-B144-8BC7488DF5C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6E907669-2299-47E1-B144-8BC7488DF5C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6E907669-2299-47E1-B144-8BC7488DF5C4}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
-EndGlobal
diff --git a/Source/AllModdingComponents/CompVehicle/CompVehicle.userprefs b/Source/AllModdingComponents/CompVehicle/CompVehicle.userprefs
deleted file mode 100644
index 6fd6f72e..00000000
--- a/Source/AllModdingComponents/CompVehicle/CompVehicle.userprefs
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompVehicle/CompVehicleSpawner.cs b/Source/AllModdingComponents/CompVehicle/CompVehicleSpawner.cs
deleted file mode 100644
index 05c956cf..00000000
--- a/Source/AllModdingComponents/CompVehicle/CompVehicleSpawner.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System.Collections.Generic;
-using Verse;
-using Verse.AI;
-
-namespace CompVehicle
-{
- /// Component that spawns a vehicle.
- public class CompVehicleSpawner : ThingComp
- {
- /// Get the thing that is creating the vehicle.
- public ThingWithComps Spawner => parent;
-
- /// Use the XML configurations.
- public CompProperties_VehicleSpawner Props => props as CompProperties_VehicleSpawner;
-
- /// Adds a right click option to unpack and spawn the vehicle.
- public override IEnumerable CompFloatMenuOptions(Pawn selPawn)
- {
- foreach (var o in base.CompFloatMenuOptions(selPawn)) yield return o;
-
- if (!Spawner.DestroyedOrNull() && Spawner.Spawned &&
- !selPawn.DestroyedOrNull() && selPawn.Spawned)
- yield return new FloatMenuOption(string.Format(Props.useVerb, Spawner.Label),
- delegate
- {
- selPawn.jobs.TryTakeOrderedJob(new Job(DefDatabase.GetNamed("CompVehicle_Assemble"),
- Spawner));
- });
- }
-
- /// When assembled, be sure to spawn the vehicle and destroy this object.
- public void Notify_Assembled(Pawn assembler)
- {
- var pawn = (Pawn) GenSpawn.Spawn(PawnGenerator.GeneratePawn(Props.vehicleToSpawn, assembler.Faction),
- Spawner.PositionHeld, Spawner.MapHeld);
- Spawner.Destroy(DestroyMode.KillFinalize);
- }
- }
-}
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompVehicle/CompVehicleUtility.cs b/Source/AllModdingComponents/CompVehicle/CompVehicleUtility.cs
deleted file mode 100644
index 4ed971e6..00000000
--- a/Source/AllModdingComponents/CompVehicle/CompVehicleUtility.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-using RimWorld;
-using RimWorld.Planet;
-using Verse;
-
-namespace CompVehicle
-{
- public class CompVehicleUtility
- {
- // ToDo: Rotate pawns to allow for some pawns to rest while others
- // use the vehicle.
- // RimWorld.Planet.CaravanPawnsNeedsUtility
- public static void TrySatisfyRestNeed(Pawn pawn, Need_Rest rest, Pawn Vehicle)
- {
- //Do not try to rest in the vehicle during combat.
- //It's too dangerous to sleep while driving.
- //if (Vehicle.Map?.attackTargetsCache?.GetPotentialTargetsFor(Vehicle)?.FirstOrDefault(x => !x.ThreatDisabled()) == null)
- //{
- // float restEffectiveness = RestUtility.PawnHealthRestEffectivenessFactor(pawn);
- // rest.TickResting(restEffectiveness);
- //}
- }
-
-
- // RimWorld.Planet.CaravanPawnsNeedsUtility
- public static void TrySatisfyFoodNeed(Pawn pawn, Need_Food food, Pawn vehicle)
- {
- if (food.CurCategory < HungerCategory.Hungry)
- return;
- Thing thing;
- Pawn pawn2;
- if (VirtualPlantsUtility.CanEatVirtualPlantsNow(pawn))
- {
- VirtualPlantsUtility.EatVirtualPlants(pawn);
- }
- else if (TryGetBestFood(vehicle, pawn, out thing, out pawn2))
- {
- food.CurLevel += thing.Ingested(pawn, food.NutritionWanted);
- if (thing.Destroyed)
- if (pawn2 != null)
- vehicle.inventory.innerContainer.Remove(thing);
- }
- }
-
- // RimWorld.Planet.CaravanInventoryUtility
- public static bool TryGetBestFood(Pawn vehicle, Pawn forPawn, out Thing food, out Pawn owner)
- {
- var list = vehicle?.inventory?.innerContainer?.InnerListForReading;
- Thing thing = null;
- var num = 0f;
- for (var i = 0; i < list.Count; i++)
- {
- var thing2 = list[i];
- if (CanNowEatForNutrition(thing2, forPawn))
- {
- var foodScore = CaravanPawnsNeedsUtility.GetFoodScore(thing2, forPawn);
- if (thing == null || foodScore > num)
- {
- thing = thing2;
- num = foodScore;
- }
- }
- }
- if (thing != null)
- {
- food = thing;
- owner = forPawn; //CaravanInventoryUtility.GetOwnerOf(caravan, thing);
- return true;
- }
- food = null;
- owner = null;
- return false;
- }
-
- // RimWorld.Planet.CaravanPawnsNeedsUtility
- public static bool CanNowEatForNutrition(Thing food, Pawn pawn)
- {
- return food.IngestibleNow && CanNowEatForNutrition(food.def, pawn);
- }
-
- // RimWorld.Planet.CaravanPawnsNeedsUtility
- public static bool CanNowEatForNutrition(ThingDef food, Pawn pawn)
- {
- return CanEverEatForNutrition(food, pawn) && (pawn.needs.food.CurCategory >= HungerCategory.Starving ||
- food.ingestible.preferability >
- FoodPreferability.DesperateOnly);
- }
-
- // RimWorld.Planet.CaravanPawnsNeedsUtility
- public static bool CanEverEatForNutrition(ThingDef food, Pawn pawn)
- {
- return food.IsNutritionGivingIngestible && pawn.RaceProps.CanEverEat(food) &&
- food.ingestible.preferability > FoodPreferability.NeverForNutrition &&
- (!pawn.IsTeetotaler() || !food.IsDrug);
- }
-
- // RimWorld.Planet.CaravanPawnsNeedsUtility
- public static void TrySatisfyChemicalNeed(Pawn pawn, Need_Chemical chemical, Pawn vehicle)
- {
- if (chemical.CurCategory >= DrugDesireCategory.Satisfied)
- return;
- Thing drug;
- Pawn drugOwner;
- if (TryGetBestDrug(vehicle, pawn, chemical, out drug, out drugOwner))
- IngestDrug(pawn, drug, drugOwner, vehicle);
- }
-
- // RimWorld.Planet.CaravanInventoryUtility
- public static bool TryGetBestDrug(Pawn vehicle, Pawn forPawn, Need_Chemical chemical, out Thing drug,
- out Pawn owner)
- {
- var addictionHediff = chemical.AddictionHediff;
- if (addictionHediff == null)
- {
- drug = null;
- owner = null;
- return false;
- }
- var list = vehicle?.inventory?.innerContainer?.InnerListForReading;
- Thing thing = null;
- for (var i = 0; i < list.Count; i++)
- {
- var thing2 = list[i];
- if (thing2.IngestibleNow && thing2.def.IsDrug)
- {
- var compDrug = thing2.TryGetComp();
- if (compDrug != null && compDrug.Props.chemical != null)
- if (compDrug.Props.chemical.addictionHediff == addictionHediff.def)
- if (forPawn.drugs == null || forPawn.drugs.CurrentPolicy[thing2.def].allowedForAddiction ||
- forPawn.story == null || forPawn.story.traits.DegreeOfTrait(TraitDefOf.DrugDesire) > 0)
- {
- thing = thing2;
- break;
- }
- }
- }
- if (thing != null)
- {
- drug = thing;
- owner = forPawn;
- return true;
- }
- drug = null;
- owner = null;
- return false;
- }
-
- // RimWorld.Planet.CaravanPawnsNeedsUtility
- public static void IngestDrug(Pawn pawn, Thing drug, Pawn drugOwner, Pawn vehicle)
- {
- var num = drug.Ingested(pawn, 0f);
- var food = pawn.needs.food;
- if (food != null)
- food.CurLevel += num;
- if (drug.Destroyed && drugOwner != null)
- vehicle.inventory.innerContainer.Remove(drug);
- }
- }
-}
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompVehicle/DeathActionWorker_NoCorpse.cs b/Source/AllModdingComponents/CompVehicle/DeathActionWorker_NoCorpse.cs
deleted file mode 100755
index 25562405..00000000
--- a/Source/AllModdingComponents/CompVehicle/DeathActionWorker_NoCorpse.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using Verse;
-
-namespace CompVehicle
-{
- public class DeathActionWorker_NoCorpse : DeathActionWorker
- {
- private Map map;
-
- public override void PawnDied(Corpse corpse)
- {
- //Corpse NullCheck
- if (corpse == null)
- return;
- //Get Corpse Properties
- map = corpse.Map;
- var pos = corpse.Position;
- var pawn = corpse.InnerPawn;
-
- //Destroy Corpse
- corpse.Destroy();
- //Read through killedLeavings of the pawn
- var thingOwner = new ThingOwner();
- for (var i = 0; i < pawn.def.killedLeavings.Count; i++)
- {
- var thing = ThingMaker.MakeThing(pawn.def.killedLeavings[i].thingDef, null);
- thing.stackCount = pawn.def.killedLeavings[i].count;
- thingOwner.TryAdd(thing, true);
- }
- //Generate items/amount in list
- for (var i = 0; i < thingOwner.Count; i++)
- GenPlace.TryPlaceThing(thingOwner[i], pos, map, ThingPlaceMode.Near, null);
- }
- }
-}
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompVehicle/GlobalSuppressions.cs b/Source/AllModdingComponents/CompVehicle/GlobalSuppressions.cs
deleted file mode 100644
index 4a338905..00000000
--- a/Source/AllModdingComponents/CompVehicle/GlobalSuppressions.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file is used by Code Analysis to maintain SuppressMessage
-// attributes that are applied to this project.
-// Project-level suppressions either have no target or are given
-// a specific target and scoped to a namespace, type, member, etc.
-
-using System.Diagnostics.CodeAnalysis;
-
-[assembly:
- SuppressMessage("Style", "IDE0019:Use pattern matching", Justification = "", Scope = "member",
- Target = "~M:CompVehicle.HarmonyCompVehicle.VehicleRotatorTick(Verse.Pawn_RotationTracker)~System.Boolean")]
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompVehicle/HandlingTypeFlags.cs b/Source/AllModdingComponents/CompVehicle/HandlingTypeFlags.cs
deleted file mode 100755
index cbed0fb4..00000000
--- a/Source/AllModdingComponents/CompVehicle/HandlingTypeFlags.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-
-namespace CompVehicle
-{
- [Flags]
- public enum HandlingTypeFlags
- {
- None = 0,
- Movement = 1,
- Manipulation = 2,
- Weapons = 4
- }
-}
\ No newline at end of file
diff --git a/Source/AllModdingComponents/CompVehicle/HarmonyCompVehicle.cs b/Source/AllModdingComponents/CompVehicle/HarmonyCompVehicle.cs
deleted file mode 100644
index 1cb60098..00000000
--- a/Source/AllModdingComponents/CompVehicle/HarmonyCompVehicle.cs
+++ /dev/null
@@ -1,3065 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Reflection.Emit;
-using System.Runtime.CompilerServices;
-using System.Text;
-using HarmonyLib;
-using RimWorld;
-using RimWorld.BaseGen;
-using RimWorld.Planet;
-using UnityEngine;
-using UnityEngine.AI;
-using Verse;
-using Verse.AI;
-using Verse.AI.Group;
-using Verse.Sound;
-
-namespace CompVehicle
-{
- [StaticConstructorOnStartup]
- internal static class HarmonyCompVehicle
- {
- static HarmonyCompVehicle()
- {
-
-// var harmony = new Harmony("jecstools.jecrell.comps.vehicle");
-// //HarmonyInstance.DEBUG = true;
-
-// #region Functions
-
-// ///
-// /// VEHICLE FUNCTIONS
-// /// Implements new systems to RimWorld when
-// /// vehicles are present.
-// ///
-// harmony.Patch(
-// AccessTools.Method(typeof(Pawn_RotationTracker), nameof(Pawn_RotationTracker.RotationTrackerTick)),
-// new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(VehicleRotatorTick)), null);
-
-// harmony.Patch(
-// typeof(DamageWorker_AddInjury).GetMethods(bindingAttr: AccessTools.all).First(
-// mi => mi.ReturnType == typeof(float) &&
-// mi.GetParameters().ElementAt(1).ParameterType == typeof(Hediff_Injury)
-//// new[]
-//// {
-//// typeof(Pawn), typeof(Hediff_Injury), typeof(DamageInfo),
-//// AccessTools.TypeByName("DamageWorker.DamageResult").MakeByRefType(), typeof(float)
-//// }
-// ), null,
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(TryInjureVehicleOccupants)));
-// harmony.Patch(AccessTools.Method(typeof(HealthUtility), nameof(HealthUtility.GetGeneralConditionLabel)),
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(ReplaceConditionLabel)), null);
-// //TODO: Fix for 1.0
-// //harmony.Patch(AccessTools.Method(typeof(HealthCardUtility), "DrawOverviewTab"),
-// // new HarmonyMethod(typeof(HarmonyCompVehicle),
-// // nameof(DisplayOperationalSystems)), null);
-// harmony.Patch(
-// AccessTools.Property(typeof(MapPawns), nameof(MapPawns.FreeColonistsSpawnedCount)).GetGetMethod(), null,
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(IncludeVehicleOccupantsInMapPawns)));
-// harmony.Patch(
-// AccessTools.Property(typeof(MapPawns),
-// nameof(MapPawns.FreeColonistsSpawnedOrInPlayerEjectablePodsCount)).GetGetMethod(), null,
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(IncludeVehicleOccupantsInMapPawns)));
-// harmony.Patch(AccessTools.Method(typeof(Pawn_HealthTracker), "ShouldBeDowned"),
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(VehicleShouldBeDowned)), null);
-// harmony.Patch(AccessTools.Method(typeof(PawnDownedWiggler), nameof(PawnDownedWiggler.WigglerTick)),
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(VehicleShouldWiggle)), null);
-//// harmony.Patch(AccessTools.Method(typeof(FloatMenuUtility), nameof(FloatMenuUtility.GetRangedAttackAction)),
-//// null, null,
-//// new HarmonyMethod(typeof(HarmonyCompVehicle),
-//// nameof(FightActionTranspiler)));
-//// harmony.Patch(AccessTools.Method(typeof(FloatMenuUtility), nameof(FloatMenuUtility.GetMeleeAttackAction)),
-//// null, null,
-//// new HarmonyMethod(typeof(HarmonyCompVehicle),
-//// nameof(FightActionTranspiler)));
-// //Not enough experience Disabled
-// harmony.Patch(AccessTools.Method(typeof(VerbTracker), nameof(VerbTracker.GetVerbsCommands)),
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(GetVerbsCommands_PreFix)), null, null);
-// //Not enough experience Disabled
-// // harmony.Patch(AccessTools.Method(typeof(PathFinder), "FindPath",new[] { typeof(IntVec3),typeof(LocalTargetInfo),typeof(TraverseParms),typeof(PathEndMode) }), new HarmonyMethod(typeof(HarmonyCompVehicle),
-// //nameof(FindPath_PreFix)), null, null);
-
-// #endregion Functions
-
-// #region ErrorHandling
-
-// ///
-// /// VEHICLE ERROR HANDLING
-// /// These patches help integrate vehicles safely
-// /// into existing/new games and handle errors / exceptions.
-// ///
-
-// //harmony.Patch(AccessTools.)
-// harmony.Patch(
-// AccessTools.Method(typeof(PawnUtility), nameof(PawnUtility.IsTravelingInTransportPodWorldObject)), null,
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(PreventAssigningRandomFaction)));
-// harmony.Patch(AccessTools.Method(typeof(SocialCardUtility), "Recache"), new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(SocialTabNullHandling)), null);
-// harmony.Patch(AccessTools.Property(typeof(Pawn), nameof(Pawn.IsColonistPlayerControlled)).GetGetMethod(),
-// null, new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(IncludeVehiclesInIsColonistPlayerControlled)));
-// harmony.Patch(AccessTools.Method(typeof(Pawn), nameof(Pawn.CurrentlyUsableForBills)), null,
-// new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(CantUseMovingVehicles)));
-// harmony.Patch(
-// AccessTools.Property(typeof(Pawn_DraftController), nameof(Pawn_DraftController.Drafted)).GetSetMethod(),
-// new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(DraftedVehiclesCanMove)), null);
-// //TODO: Fix for 1.0
-// //harmony.Patch(AccessTools.Method(typeof(Pawn_PathFollower), nameof(Pawn_PathFollower.StartPath)),
-// // new HarmonyMethod(
-// // typeof(HarmonyCompVehicle),
-// // nameof(CanVehicleMove)), null);
-// harmony.Patch(AccessTools.Method(typeof(Verb_Shoot), "TryCastShot"), new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(CanVehicleShoot)), null);
-// harmony.Patch(AccessTools.Method(typeof(GameEnder), "IsPlayerControlledWithFreeColonist"), null,
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(CanEndGame)));
-// harmony.Patch(
-// typeof(RestUtility).GetMethods(BindingFlags.Public | BindingFlags.Static)
-// .First(mi => mi.Name == "FindBedFor" && mi.GetParameters().Count() > 1), null, new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(DontRescueVehicles)), null);
-// harmony.Patch(AccessTools.Method(typeof(FloatMenuMakerMap), "AddHumanlikeOrders"), null, new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(DontRescueVehiclesInFloatMenus)));
-
-// harmony.Patch(
-// typeof(SymbolResolver_RandomMechanoidGroup).GetMethods(BindingFlags.NonPublic | BindingFlags.Static)
-// .First(mi =>
-// mi.HasAttribute() && mi.ReturnType == typeof(bool) &&
-// mi.GetParameters().Count() == 1 && mi.GetParameters()[0].ParameterType == typeof(PawnKindDef)),
-// null, new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(MechanoidsFixerAncient)));
-
-//// Tad Patched out the Mechanoid on damaged method as its no longer recognised.
-//// harmony.Patch(
-//// typeof(CompSpawnerMechanoidsOnDamaged).GetMethods(BindingFlags.NonPublic | BindingFlags.Instance).First(
-//// mi => mi.HasAttribute() && mi.ReturnType == typeof(bool) &&
-//// mi.GetParameters().Count() == 1 &&
-//// mi.GetParameters()[0].ParameterType == typeof(PawnKindDef)), null, new HarmonyMethod(
-//// typeof(HarmonyCompVehicle),
-//// nameof(MechanoidsFixer)));
-
-//// harmony.Patch(AccessTools.Method(typeof(JobDriver_Wait), "CheckForAutoAttack"), null, null,
-//// new HarmonyMethod(typeof(HarmonyCompVehicle),
-//// nameof(CheckForAutoAttackTranspiler)));
-// //harmony.Patch(
-// //AccessTools.Method(
-// // typeof(VerbTracker).GetNestedTypes(BindingFlags.NonPublic | BindingFlags.Instance)
-// // .First(t => AccessTools.Method(t, "MoveNext") != null), "MoveNext"), null, null,
-// //new HarmonyMethod(typeof(HarmonyCompVehicle),
-// //nameof(GetVerbsCommandsTranspiler)));
-// harmony.Patch(AccessTools.Method(typeof(ThinkNode_ConditionalColonist), "Satisfied"), null,
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(Satisfied_PostFix)), null);
-//// harmony.Patch(AccessTools.Method(typeof(FloatMenuMakerMap), "AddUndraftedOrders"), null, null,new HarmonyMethod(typeof(HarmonyCompVehicle),
-//// nameof(AddUndraftedOrders_Transpiler)));
-// harmony.Patch(AccessTools.Method(typeof(JobGiver_Haul), "TryGiveJob"), new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(TryGiveJob_PreFix)), null, null);
-
-// #endregion ErrorHandling
-
-// #region AIHandling
-
-// /// AI HANDLING
-// /// Handles various AI issues for vehicles to function
-// /// properly.
-
-// harmony.Patch(AccessTools.Method(typeof(JobGiver_Orders), "TryGiveJob"), null, new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(PreventWaitAttackError)));
-
-// harmony.Patch(
-// AccessTools.Method(typeof(LordToil_PrepareCaravan_GatherItems),
-// nameof(LordToil_PrepareCaravan_GatherItems.UpdateAllDuties)),
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(GiveVehiclesLoadItemDuties)), null);
-
-// harmony.Patch(
-// AccessTools.Method(typeof(LordToil_PrepareCaravan_GatherAnimals),
-// nameof(LordToil_PrepareCaravan_GatherAnimals.UpdateAllDuties)),
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(GiveVehiclesLoadAnimalDuties)), null);
-
-// harmony.Patch(
-// AccessTools.Method(typeof(LordToil_PrepareCaravan_GatherSlaves),
-// nameof(LordToil_PrepareCaravan_GatherSlaves.LordToilTick)),
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(GiveVehiclesLoadSlaveDuties)), null);
-
-// harmony.Patch(
-// AccessTools.Method(typeof(LordToil_PrepareCaravan_GatherItems),
-// nameof(LordToil_PrepareCaravan_GatherItems.LordToilTick)),
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(GiveVehiclesLoadItemToil)), null);
-
-// harmony.Patch(AccessTools.Method(typeof(Caravan_NeedsTracker), "TrySatisfyPawnNeeds"),
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(TrySatisfyFuelNeeds)), null);
-// //Reminder to check this code....
-
-// harmony.Patch(AccessTools.Method(typeof(JobGiver_PrepareCaravan_GatherItems), "TryGiveJob"),
-// new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(TryGiveItemJob_PreFix)), null);
-
-// #endregion AIHandling
-
-// #region CaravanHandling
-
-// ///
-// /// CARAVAN HANDLING
-// /// These patches handle exceptions and
-// /// cases involving vehicles and caravans.
-// ///
-
-// harmony.Patch(AccessTools.Method(typeof(Caravan), nameof(Caravan.AddPawn)), new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(AddVehiclePawnsToCaravan)), null);
-// harmony.Patch(AccessTools.Method(typeof(Dialog_SplitCaravan), "CheckForErrors"), new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(DontSplitCaravansWithVehicles)), null);
-// harmony.Patch(AccessTools.Method(typeof(Dialog_FormCaravan), "CheckForErrors"), new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(CheckForErrors_PreFix)), null);
-
-// //TODO New patch
-// //harmony.Patch(AccessTools.Method(typeof(CaravanPeopleAndItemsTabUtility), "DoRows"), new HarmonyMethod(
-// // typeof(HarmonyCompVehicle),
-// // nameof(DoRows_PreFix)), null);
-// harmony.Patch(AccessTools.Method(typeof(CaravanUIUtility), nameof(CaravanUIUtility.AddPawnsSections)), null,
-// new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(AddPawnsSections_PostFix)));
-
-// harmony.Patch(
-// AccessTools.Method(typeof(CaravanExitMapUtility),
-// nameof(CaravanExitMapUtility.CanExitMapAndJoinOrCreateCaravanNow)),
-// null, new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(CanExit_PostFix)), null);
-
-// harmony.Patch(AccessTools.Method(typeof(MassUtility), nameof(MassUtility.Capacity)), null,
-// new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(Capacity_PostFix)), null);
-
-// harmony.Patch(
-// typeof(CaravanTicksPerMoveUtility).GetMethods().First(mi =>
-// mi.GetParameters().ElementAt(0).ParameterType == typeof(List)),
-// null, new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(GetTicksPerMove_PostFix)));
-
-
-// //harmony.Patch(AccessTools.Method(typeof(RimWorld.Planet.CaravanMaker), "MakeCaravan"), null, new HarmonyMethod(typeof(HarmonyCompVehicle),
-// // nameof(MakeCaravan_PostFix)));
-//// harmony.Patch(AccessTools.Method(typeof(CaravanExitMapUtility), "ExitMapAndJoinOrCreateCaravan"),
-//// new HarmonyMethod(typeof(HarmonyCompVehicle),
-//// nameof(ExitMapAndJoinOrCreateCaravan_PreFix)), null);
-// harmony.Patch(
-// AccessTools.Method(typeof(CaravanEnterMapUtility), nameof(CaravanEnterMapUtility.Enter),
-// new[]
-// {
-// typeof(Caravan), typeof(Map), typeof(Func), typeof(CaravanDropInventoryMode),
-// typeof(bool)
-// }), new HarmonyMethod(typeof(HarmonyCompVehicle),
-// nameof(Enter_PreFix)), null, null);
-// harmony.Patch(AccessTools.Method(typeof(Caravan), "GetInspectString"), null, new HarmonyMethod(
-// typeof(HarmonyCompVehicle),
-// nameof(GetInspectString_PostFix)));
-
-// //TODO New patch
-//// harmony.Patch(
-//// AccessTools.Method(typeof(CaravanPeopleAndItemsTabUtility), "DoRow",
-//// new[]
-//// {
-//// typeof(Rect), typeof(Thing), typeof(Caravan), typeof(Pawn).MakeByRefType(), typeof(bool),
-//// typeof(bool)
-//// }), null, null, new HarmonyMethod(typeof(HarmonyCompVehicle),
-//// nameof(DoRow_Transpiler)));
-// //harmony.Patch(AccessTools.Method(typeof(Dialog_FormCaravan), "DoWindowContents"), new HarmonyMethod(
-// // typeof(HarmonyCompVehicle),
-// // nameof(DoWindowContents_PreFix)), null);
-
-// #endregion CaravanHandling
-
-// #region Tests
-
-// ///
-// /// TESTS
-// /// This is for testing or debugging for errors.
-// /// Most of these methods are prefix detours to make tests.
-// ///
-
-
-// //harmony.Patch(AccessTools.Method(typeof(CaravanExitMapUtility), "ExitMapAndCreateCaravan", new Type[] { typeof(IEnumerable), typeof(Faction), typeof(int) }), new HarmonyMethod(typeof(HarmonyCompVehicle),
-// //nameof(ExitMapAndCreateCaravan_Test)), null);
-// //harmony.Patch(AccessTools.Method(typeof(Pawn_PathFollower), "TrySetNewPath"), new HarmonyMethod(typeof(HarmonyCompVehicle),
-// //nameof(TrySetNewPath_Test)), null);
-
-// #endregion
- }
-
- /// CODE LEGEND
- /// J = Jec's patch.
- /// S = Swenzi's patch.
- /// E = Erdelf's patch.
- /// ??? = Needs cleaning
-
- #region FunctionsMethods
-
- //S I don't have enough experience with AI or pathing, will come back to this in the future.
- //S Temporary prefix patching solution until a transpiler is made
- //Patches PathFinder to create custom pathing based off of a vehicles stats, i.e. boats can only be in water
- //Due to PathFinder being a none static method, I used slightly destructive patching to call a copy of the PathFinder class (CVPathFinder)
- //public static bool FindPath_PreFix(IntVec3 start, LocalTargetInfo dest, TraverseParms traverseParms, PathFinder __instance, ref PawnPath __result, PathEndMode peMode = PathEndMode.OnCell){
- // Pawn pawn = traverseParms.pawn;
- // if(pawn.GetComp() != null){
- // CVPathFinder test = new CVPathFinder(pawn.Map);
- // __result = test.FindPath(start, dest, traverseParms, peMode);
- // //Log.Error((__result.Found.ToString()));
- // return false;
- // }
- // return true;
- //}
-
- // J This patch allows colonists to freely join vehicles
- // without having their factions randomly switched around.
- // RimWorld.PawnUtility
- public static void PreventAssigningRandomFaction(ref bool __result, Pawn pawn)
- {
- bool prevResult = __result;
- //Check for vehicles...
- if (pawn?.Faction != null)
- __result = prevResult || (ThingOwnerUtility.AnyParentIs(pawn));
- }
-
-
- //S Temporary prefix patching solution until a transpiler is made
- //Patches Pawn_PathFollower to create custom pathing based off of a vehicles stats, i.e. boats can only be in water
- public static bool CostToMoveIntoCell_PreFix(IntVec3 c, ref int __result, Pawn_PathFollower __instance)
- {
- Pawn pawn = (Pawn) AccessTools.Field(typeof(Pawn_PathFollower), "pawn").GetValue(__instance);
- if (pawn.GetComp() != null)
- {
- int num;
- if (c.x == pawn.Position.x || c.z == pawn.Position.z)
- {
- num = pawn.TicksPerMoveCardinal;
- }
- else
- {
- num = pawn.TicksPerMoveDiagonal;
- }
- num += CalculatedCostAt(c, false, pawn.Position, __instance,
- pawn.GetComp().Props.vehicleType, pawn);
- Building edifice = c.GetEdifice(pawn.Map);
- if (edifice != null)
- {
- num += (int) edifice.PathWalkCostFor(pawn);
- }
- if (num > 450)
- {
- num = 450;
- }
- if (pawn.jobs.curJob != null)
- {
- switch (pawn.jobs.curJob.locomotionUrgency)
- {
- case LocomotionUrgency.Amble:
- num *= 3;
- if (num < 60)
- {
- num = 60;
- }
- break;
- case LocomotionUrgency.Walk:
- num *= 2;
- if (num < 50)
- {
- num = 50;
- }
- break;
- case LocomotionUrgency.Jog:
- num = num;
- break;
- case LocomotionUrgency.Sprint:
- num = Mathf.RoundToInt((float) num * 0.75f);
- break;
- }
- }
- __result = Mathf.Max(num, 1);
- return false;
- }
-
- return true;
- }
-
- //S Patches FloatingMenuMakerMap so that null reference errors don't occur when generating the GUI for
- //pawns that don't have worksettings
-// public static IEnumerable AddUndraftedOrders_Transpiler(
-// IEnumerable instructions)
-// {
-// var instructionList = instructions.ToList();
-// var workSettings = AccessTools.Field(typeof(Pawn), nameof(Pawn.workSettings));
-// for (var i = 0; i < instructionList.Count; i++)
-// {
-// var instruction = instructionList[i];
-//
-// yield return instruction;
-// if (instruction.operand == workSettings)
-// {
-// yield return new CodeInstruction(OpCodes.Brfalse_S, instructionList[i + 3].operand);
-// yield return new CodeInstruction(instructionList[i - 2]) {labels = new List()};
-// yield return new CodeInstruction(instructionList[i - 1]);
-// yield return new CodeInstruction(instruction);
-// }
-// }
-// }
-
- //S Patches JobGiver_Haul so that jobs aren't assigned to vehicles that can't move so that a better suited pawn can take the job
- //Couldn't get a transpiler to work for this one
- public static bool TryGiveJob_PreFix(Pawn pawn, ref Job __result)
- {
- if (pawn.GetComp() != null && pawn.GetComp().movingStatus == MovingState.frozen)
- {
- __result = null;
- return false;
- }
- return true;
- }
-
- //J Vehicles will no longer rotate when drafted.
- public static bool VehicleRotatorTick(Pawn_RotationTracker __instance)
- {
- if (Traverse.Create(__instance).Field("pawn").GetValue() is Pawn thisPawn &&
- thisPawn?.GetComp() is CompVehicle compVehicle)
- {
- if (thisPawn?.Destroyed ?? false)
- return false;
- if (thisPawn?.jobs?.HandlingFacing ?? false)
- return false;
- if (thisPawn?.pather?.Moving ?? false)
- {
- if (thisPawn.pather.curPath == null || thisPawn.pather.curPath.NodesLeftCount < 1)
- return false;
- //this.FaceAdjacentCell(thisPawn.pather.nextCell);
- AccessTools.Method(typeof(Pawn_RotationTracker), "FaceAdjacentCell")
- .Invoke(__instance, new object[] {thisPawn.pather.nextCell});
- //Traverse.Create(__instance).Method("FaceAdjacentCell", new object[] { thisPawn.pather.nextCell });
- //compVehicle.lastDirection = thisPawn.Rotation;
- return false;
- }
- var stance_Busy = thisPawn.stances.curStance as Stance_Busy;
- if (stance_Busy != null && stance_Busy.focusTarg.IsValid)
- {
- if (stance_Busy.focusTarg.HasThing)
- AccessTools.Method(typeof(Pawn_RotationTracker), "Face").Invoke(__instance,
- new object[] {stance_Busy.focusTarg.Thing.DrawPos});
- else
- AccessTools.Method(typeof(Pawn_RotationTracker), "FaceCell")
- .Invoke(__instance, new object[] {stance_Busy.focusTarg.Cell});
- return false;
- }
- if (thisPawn?.jobs?.curJob != null)
- {
- var target = thisPawn.CurJob.GetTarget(thisPawn.jobs.curDriver.rotateToFace);
- if (target.HasThing)
- {
- if (compVehicle.CanMove)
- {
- var flag = false;
- var c = default(IntVec3);
- var cellRect = target.Thing.OccupiedRect();
- for (var i = cellRect.minZ; i <= cellRect.maxZ; i++)
- for (var j = cellRect.minX; j <= cellRect.maxX; j++)
- if (thisPawn.Position == new IntVec3(j, 0, i))
- {
- //this.Face(target.Thing.DrawPos);
- //Traverse.Create(__instance).Method("Face", new object[] { target.Thing.DrawPos });
- AccessTools.Method(typeof(Pawn_RotationTracker), "Face")
- .Invoke(__instance, new object[] {target.Thing.DrawPos});
- return false;
- }
- for (var k = cellRect.minZ; k <= cellRect.maxZ; k++)
- for (var l = cellRect.minX; l <= cellRect.maxX; l++)
- {
- var intVec = new IntVec3(l, 0, k);
- if (intVec.AdjacentToCardinal(thisPawn.Position))
- {
- //this.FaceAdjacentCell(intVec);
- AccessTools.Method(typeof(Pawn_RotationTracker), "FaceAdjacentCell")
- .Invoke(__instance, new object[] {intVec});
- //Traverse.Create(__instance).Method("FaceAdjacentCell", new object[] { intVec });
- return false;
- }
- if (intVec.AdjacentTo8Way(thisPawn.Position))
- {
- flag = true;
- c = intVec;
- }
- }
- if (flag)
- {
- if (DebugViewSettings.drawPawnRotatorTarget)
- {
- thisPawn.Map.debugDrawer.FlashCell(thisPawn.Position, 0.6f, "jbthing");
- GenDraw.DrawLineBetween(thisPawn.Position.ToVector3Shifted(), c.ToVector3Shifted());
- }
- //this.FaceAdjacentCell(c);
- AccessTools.Method(typeof(Pawn_RotationTracker), "FaceAdjacentCell")
- .Invoke(__instance, new object[] {c});
- //Traverse.Create(__instance).Method("FaceAdjacentCell", new object[] { c });
- return false;
- }
- AccessTools.Method(typeof(Pawn_RotationTracker), "Face")
- .Invoke(__instance, new object[] {target.Thing.DrawPos});
- //Traverse.Create(__instance).Method("Face", new object[] { target.Thing.DrawPos });
- return false;
- }
- }
- else
- {
- if (thisPawn.Position.AdjacentTo8Way(target.Cell))
- {
- if (DebugViewSettings.drawPawnRotatorTarget)
- {
- thisPawn.Map.debugDrawer.FlashCell(thisPawn.Position, 0.2f, "jbloc");
- GenDraw.DrawLineBetween(thisPawn.Position.ToVector3Shifted(),
- target.Cell.ToVector3Shifted());
- }
- //this.FaceAdjacentCell(target.Cell);
- AccessTools.Method(typeof(Pawn_RotationTracker), "FaceAdjacentCell")
- .Invoke(__instance, new object[] {target.Cell});
- //Traverse.Create(__instance).Method("FaceAdjacentCell", new object[] { target.Cell });
- return false;
- }
- if (target.Cell.IsValid && target.Cell != thisPawn.Position)
- {
- //this.Face(target.Cell.ToVector3());
- //Traverse.Create(__instance).Method("Face", new object[] { target.Cell.ToVector3() });
- AccessTools.Method(typeof(Pawn_RotationTracker), "Face")
- .Invoke(__instance, new object[] {target.Cell.ToVector3()});
- return false;
- }
- }
- }
- //if (thisPawn.Drafted)
- //{
- // thisPawn.Rotation = compVehicle.lastDirection;
- //}
- return false;
- }
- return true;
- }
-
- //J When characters fire upon the vehicle, if the vehicle's body part defs include a tag that references a vehicle role,
- //J there is a chance that a character holding that role can be injured. Critical injury chances also exist.
- // Verse.DamageWorker_AddInjury
- public static void TryInjureVehicleOccupants(DamageWorker_AddInjury __instance, Pawn pawn, Hediff_Injury injury,
- DamageInfo dinfo, ref DamageWorker.DamageResult result, ref float __result)
- {
- var compPilotable = pawn.GetComp();
- if (compPilotable != null)
- {
- var affectedPawns = new List();
-
- if (compPilotable.handlers != null && compPilotable.handlers.Count > 0)
- foreach (var group in compPilotable.handlers)
- if (group.occupiedParts != null && group.handlers != null && group.handlers.Count > 0)
- if (group.occupiedParts.Contains(injury.Part))
- affectedPawns.AddRange(group.handlers);
-
- //Attack the seatholder
- if (affectedPawns != null && affectedPawns.Count > 0)
- {
- var newDamageInfo = new DamageInfo(dinfo);
- var criticalBonus = 0f;
- if (Rand.Value < compPilotable.Props.seatHitCriticalHitChance) criticalBonus = dinfo.Amount * 2;
- var newDamFloat = dinfo.Amount * compPilotable.Props.seatHitDamageFactor + criticalBonus;
- newDamageInfo.SetAmount((int) newDamFloat);
- affectedPawns.RandomElement().TakeDamage(newDamageInfo);
- }
- }
- }
-
- //J Allows for various condition labels to be changed in CompVehicle's properties.
- // Verse.HealthUtility
- public static bool ReplaceConditionLabel(ref string __result, Pawn pawn, bool shortVersion = false)
- {
- if (pawn != null)
- {
- var compPilotable = pawn.GetComp();
- if (compPilotable != null)
- {
- if (pawn.Downed || !pawn.health.capacities.CanBeAwake)
- {
- __result = compPilotable.Props.labelInoperable;
- return false;
- }
- if (pawn.Dead)
- {
- __result = compPilotable.Props.labelBroken;
- return false;
- }
- if (pawn.health.summaryHealth.SummaryHealthPercent < 0.95)
- {
- __result = compPilotable.Props.labelDamaged;
- return false;
- }
- __result = compPilotable.Props.labelUndamaged;
- return false;
- }
- }
- return true;
- }
-
- //J Changes the CompVehicle health card to display which systems are operational rather than standard pawn capacities.
- // RimWorld.HealthCardUtility
- public static bool DisplayOperationalSystems(Rect leftRect, Pawn pawn, float curY, ref float __result)
- {
- if (pawn != null)
- {
- var compPilotable = pawn.GetComp();
- if (compPilotable != null)
- {
- curY += 4f;
-
- if (compPilotable.Props.movementHandling > HandlingType.Incapable)
- {
- //Movement Systems: Online
-
- Text.Font = GameFont.Tiny;
- Text.Anchor = TextAnchor.UpperLeft;
- GUI.color = new Color(0.9f, 0.9f, 0.9f);
- var text = StringOf.Movement;
- if (compPilotable.movingStatus == MovingState.able)
- text = text + ": " + StringOf.On;
- else
- text = text + ": " + StringOf.Off;
- var rect = new Rect(0f, curY, leftRect.width, 34f);
- Widgets.Label(rect, text.CapitalizeFirst());
- }
-
- if (compPilotable.Props.manipulationHandling > HandlingType.Incapable)
- {
- //Manipulation Systems: Online
-
- curY += 34f;
- Text.Font = GameFont.Tiny;
- Text.Anchor = TextAnchor.UpperLeft;
- GUI.color = new Color(0.9f, 0.9f, 0.9f);
- var textM = StringOf.Manipulation;
- if (compPilotable.manipulationStatus == ManipulationState.able)
- textM = textM + ": " + StringOf.On;
- else
- textM = textM + ": " + StringOf.Off;
- var rectM = new Rect(0f, curY, leftRect.width, 34f);
- Widgets.Label(rectM, textM.CapitalizeFirst());
- }
-
- if (compPilotable.Props.weaponHandling > HandlingType.Incapable)
- {
- //Weapons Systems: Online
-
- curY += 34f;
- Text.Font = GameFont.Tiny;
- Text.Anchor = TextAnchor.UpperLeft;
- GUI.color = new Color(0.9f, 0.9f, 0.9f);
- var text2 = StringOf.Weapons;
- if (compPilotable.weaponStatus == WeaponState.able)
- text2 = text2 + ": " + StringOf.On;
- else
- text2 = text2 + ": " + StringOf.Off;
- var rect2 = new Rect(0f, curY, leftRect.width, 34f);
- Widgets.Label(rect2, text2.CapitalizeFirst());
- }
- curY += 34f;
- __result = curY;
- return false;
- }
- }
- return true;
- }
-
- //E Adds colonists to the map pawns list when they are inside vehicles.
- //
- public static void IncludeVehicleOccupantsInMapPawns(MapPawns __instance, ref int __result)
- {
- __result += __instance.AllPawns
- .Where(p => p.Faction == Faction.OfPlayer && p.TryGetComp() != null)
- .Sum(p => p.TryGetComp().AllOccupants.Count);
- }
-
- //J Downed can be disabled from CompProperties_Vehicle.
- // Verse.Pawn_HealthTracker
- public static bool VehicleShouldBeDowned(Pawn_HealthTracker __instance, ref bool __result)
- {
- var pawn = (Pawn) AccessTools.Field(typeof(Pawn_HealthTracker), "pawn").GetValue(__instance);
- if (pawn != null)
- {
- var compPilotable = pawn.GetComp();
- if (compPilotable != null)
- if (!compPilotable.Props.canBeDowned)
- {
- __result = false;
- return false;
- }
- }
- return true;
- }
-
- //J Wiggling can be disabled from CompProperties_Vehicle.
- // Verse.PawnDownedWiggler
- public static bool VehicleShouldWiggle(PawnDownedWiggler __instance)
- {
- var pawn = Traverse.Create(__instance).Field("pawn").GetValue();
- if (pawn != null)
- {
- var compPilotable = pawn.GetComp();
- if (compPilotable != null)
- if (!compPilotable.Props.canWiggleWhenDowned) return false;
- }
- return true;
- }
-
- //E Right click attack options allowed.
-// public static IEnumerable FightActionTranspiler(IEnumerable instructions,
-// ILGenerator il)
-// {
-// var storyInfo = AccessTools.Field(typeof(Pawn), nameof(Pawn.story));
-// var done = false;
-// var instructionList = instructions.ToList();
-// for (var i = 0; i < instructionList.Count; i++)
-// {
-// var instruction = instructionList[i];
-//
-// if (!done && instruction.operand == storyInfo)
-// {
-// yield return instruction;
-// yield return new CodeInstruction(instructionList[i + 3]);
-// yield return new CodeInstruction(instructionList[i - 2]) {labels = new List()};
-// yield return new CodeInstruction(instructionList[i - 1]);
-// instruction = new CodeInstruction(instruction);
-// done = true;
-// }
-//
-// yield return instruction;
-// }
-// }
-
- #endregion FunctionsMethods
-
- #region ErrorHandlingMethods
-
- // J This patch allows colonists to freely join vehicles
- // without having their factions randomly switched around.
- // RimWorld.PawnUtility
-
-
- //S Bug fixes social tab issue with vehicles
- //Purpose: Bug fixes IWTab social issue for caravans
- //Logic: Vehicles don't have socialinfo so skip them
- //Improvements: None I can think of
- public static bool SocialTabNullHandling(Pawn selPawnForSocialInfo)
- {
- if (selPawnForSocialInfo == null || selPawnForSocialInfo.relations == null)
- return false;
- return true;
- }
-
- //J IsColonistPlayerControlled includes vehicles.
- public static void IncludeVehiclesInIsColonistPlayerControlled(Pawn __instance, ref bool __result)
- {
- var vehicle = __instance.GetComp();
- if (vehicle != null)
- if (__instance.Faction == Faction.OfPlayer) __result = true;
- }
-
- //J Moving vehicles can't be used.
- // Verse.Pawn
- public static void CantUseMovingVehicles(Pawn __instance, ref bool __result)
- {
- var vehicle = __instance.GetComp();
- if (vehicle != null)
- if (!__instance.pather.MovingNow) __result = true;
- }
-
- //J Drafted vehicles can move.
- public static bool DraftedVehiclesCanMove(Pawn_DraftController __instance, bool value)
- {
- if (__instance?.pawn?.TryGetComp() is CompVehicle v)
- if (value && !__instance.Drafted)
- if (!v.CanMove)
- {
- Messages.Message("CompVehicle_CannotMove".Translate(__instance.pawn.KindLabel),
- MessageTypeDefOf.RejectInput);
- return false;
- }
- return true;
- }
-
- //J If needed drivers are absent, Vehicles don't move.
- // Verse.AI.Pawn_PathFollower
- public static bool CanVehicleMove(Pawn_PathFollower __instance, LocalTargetInfo dest, PathEndMode peMode)
- {
- var pawn = (Pawn) AccessTools.Field(typeof(Pawn_PathFollower), "pawn").GetValue(__instance);
- if (pawn != null)
- {
- var compPilotable = pawn.GetComp();
- if (compPilotable != null)
- if (compPilotable.movingStatus == MovingState.frozen) return false;
- }
- return true;
- }
-
- //J If needed gunners are absent, Vehicles don't shoot.
- // Verse.Verb_Shoot
- public static bool CanVehicleShoot(Verb_Shoot __instance, ref bool __result)
- {
- var pawn = __instance.CasterPawn;
- if (pawn != null)
- {
- var compPilotable = pawn.GetComp();
- if (compPilotable != null)
- if (compPilotable.weaponStatus == WeaponState.frozen)
- {
- __result = false;
- return false;
- }
- }
- return true;
- }
-
- //E Prevents the game from suddenly ending if everyone is loaded in a vehicle.
- public static void CanEndGame(Caravan caravan, ref bool __result)
- {
- if (!__result)
- __result = caravan.PawnsListForReading.Any(p =>
- p.Faction == Faction.OfPlayer && (p.TryGetComp()?.AllOccupants.Any() ?? false));
- }
-
- //J Prevents characters from finding beds to "rescue" vehicles.
- public static void DontRescueVehicles(ref Building_Bed __result, Pawn sleeper)
- {
- __result = sleeper?.GetComp() is CompVehicle compVehicle ? null : __result;
- }
-
- //J Removes option to *rescue* vehicles.
- // RimWorld.FloatMenuMakerMap
- public static void DontRescueVehiclesInFloatMenus(Vector3 clickPos, Pawn pawn, List opts)
- {
- var c = IntVec3.FromVector3(clickPos);
- var groundPawn = c.GetThingList(pawn.Map).FirstOrDefault(x => x is Pawn) as Pawn;
- if (groundPawn != null)
- if (groundPawn?.GetComp() is CompVehicle compVehicle)
- {
- //Remove "Equip" option from right click.
- var toCheck = "Rescue".Translate(groundPawn.LabelCap);
- var optToRemove = opts.FirstOrDefault(x => x.Label.Contains(toCheck));
- if (optToRemove != null) opts.Remove(optToRemove);
- }
- }
-
- //E No vehicles in ancient dangers.
- // RimWorld.Building_CrashedShipPart
- public static void MechanoidsFixerAncient(ref bool __result, PawnKindDef kind)
- {
- ////Log.Message("1");
- if (kind.race.HasComp(typeof(CompVehicle))) __result = false;
- }
-
- //E No vehicles in crashed ships.
- // RimWorld.Building_CrashedShipPart
- public static void MechanoidsFixer(ref bool __result, PawnKindDef def)
- {
- ////Log.Message("1");
- if (def.race.HasComp(typeof(CompVehicle))) __result = false;
- }
-
- //E Stops verb exceptions.
- //Logic: Checks for NREs that can result from the original method's check for a StoryTracker.
-// public static IEnumerable CheckForAutoAttackTranspiler(
-// IEnumerable instructions)
-// {
-// var playerFactionInfo = AccessTools.Property(typeof(Faction), nameof(Faction.OfPlayer)).GetGetMethod();
-// var done = false;
-// var instructionList = instructions.ToList();
-// for (var i = 0; i < instructionList.Count; i++)
-// {
-// var instruction = instructionList[i];
-//
-// if (!done && instruction.operand == playerFactionInfo)
-// {
-// done = true;
-// yield return instruction;
-// yield return instructionList[i + 1];
-// yield return instructionList[i + 2];
-// yield return instructionList[i + 3];
-// yield return instructionList[i + 4];
-// instruction = new CodeInstruction(OpCodes.Brfalse_S, instructionList[i + 1].operand);
-// i++;
-// }
-//
-// yield return instruction;
-// }
-// }
-
-// public static IEnumerable GetVerbsCommandsTranspiler(IEnumerable instructions)
-// {
-// var storyInfo = AccessTools.Field(typeof(Pawn), nameof(Pawn.story));
-// Log.Error(storyInfo.ToString());
-// var done = false;
-// var instructionList = instructions.ToList();
-// for (var i = 0; i < instructionList.Count; i++)
-// {
-// var instruction = instructionList[i];
-// Log.Error(instruction.ToString());
-// if (!done && instruction.operand == storyInfo)
-// {
-// Log.Error("Patching");
-// Log.Error(instruction.ToString());
-// Log.Error(instructionList[i + 3].operand.ToString());
-// Log.Error(instructionList[i - 3].ToString());
-// Log.Error(instructionList[i - 2].ToString());
-// Log.Error(instructionList[i - 1].ToString());
-// yield return instruction;
-// yield return new CodeInstruction(OpCodes.Brfalse_S, instructionList[i + 3].operand);
-// yield return new CodeInstruction(instructionList[i - 3]);
-// yield return new CodeInstruction(instructionList[i - 2]);
-// yield return new CodeInstruction(instructionList[i - 1]);
-// instruction = new CodeInstruction(instruction);
-// done = true;
-// }
-//
-// yield return instruction;
-// }
-// }
-
- //J Vehicles with a movement handler are considered colonists.
- //public class ThinkNode_ConditionalColonist : ThinkNode_Conditional
- public static void Satisfied_PostFix(Pawn pawn, ref bool __result)
- {
- __result = pawn.IsColonist || pawn.GetComp() is CompVehicle compVehicle &&
- compVehicle.MovementHandlerAvailable;
- }
-
- #endregion ErrorHandlingMethods
-
- #region AIHandlingMethods
-
- //J Disable the WaitCombat job when our vehicle cannot fire.
- //public class JobGiver_Orders : ThinkNode_JobGiver
- public static void PreventWaitAttackError(ref Job __result, Pawn pawn)
- {
- if (__result != null && pawn?.GetComp() is CompVehicle compVehicle && pawn.Drafted &&
- !compVehicle.CanFireWeapons)
- __result = null;
- }
-
- //J Handles vehicles in preparing caravans. If this code isn't executed, they will never load to leave.
- // RimWorld.LordToil_PrepareCaravan_GatherItems
- // RimWorld.LordToil_PrepareCaravan_GatherAnimals
- // RimWorld.LordToil_PrepareCaravan_GatherSlaves
- public static bool GiveVehiclesLoadItemDuties(LordToil_PrepareCaravan_GatherItems __instance)
- {
- ////Log.Message("1");
- if (__instance.lord.ownedPawns.FindAll(x => x.GetComp() != null) is List pawns &&
- !pawns.NullOrEmpty())
- {
- ////Log.Message("2");
-
- for (var i = 0; i < pawns.Count; i++)
- {
- var pawn = pawns[i];
- if (pawn.IsColonist || pawn.GetComp() is CompVehicle comp && comp.CanMove)
- {
- pawn.mindState.duty = new PawnDuty(DutyDefOf.PrepareCaravan_GatherItems);
- }
- else if (pawn.RaceProps.Animal)
- {
- var meetingPoint = Traverse.Create(__instance).Field("meetingPoint").GetValue();
- pawn.mindState.duty = new PawnDuty(DutyDefOf.PrepareCaravan_Wait, meetingPoint, -1f);
- }
- else
- {
- pawn.mindState.duty = new PawnDuty(DutyDefOf.PrepareCaravan_Wait);
- }
- //Log.Error(pawns[i].mindState.duty.def.defName);
- }
- //Log.Error("f");
- return false;
- }
- //Log.Error("t");
- return true;
- }
-
- public static void GiveVehiclesLoadAnimalDuties(LordToil_PrepareCaravan_GatherAnimals __instance)
- {
- ////Log.Message("Two1");
- if (__instance.lord.ownedPawns is List pawns && !pawns.NullOrEmpty() &&
- pawns.FirstOrDefault(x => x.GetComp() != null) != null)
- for (var i = 0; i < __instance.lord.ownedPawns.Count; i++)
- {
- var pawn = __instance.lord.ownedPawns[i];
- if (pawn.IsColonist || pawn.RaceProps.Animal ||
- pawn.GetComp() is CompVehicle compVehicle && compVehicle.MovementHandlerAvailable)
- {
- var meetingPoint = Traverse.Create(__instance).Field("meetingPoint").GetValue();
-
- pawn.mindState.duty = new PawnDuty(DutyDefOf.PrepareCaravan_GatherPawns, meetingPoint, -1f)
- {
- pawnsToGather = PawnsToGather.Animals
- };
- }
- else
- {
- pawn.mindState.duty = new PawnDuty(DutyDefOf.PrepareCaravan_Wait);
- }
- }
- }
-
- public static void GiveVehiclesLoadSlaveDuties(LordToil_PrepareCaravan_GatherSlaves __instance)
- {
- if (Find.TickManager.TicksGame % 100 == 0)
- {
-
- List ownedPawns = __instance.lord.ownedPawns;
- var meetingPoint = Traverse.Create(__instance).Field("meetingPoint").GetValue();
- GatherAnimalsAndSlavesForCaravanUtility.CheckArrived(__instance.lord, ownedPawns, meetingPoint, "AllSlavesGathered",
- x => !x.IsColonist &&
- !(x.GetComp() is CompVehicle compVehicle && compVehicle.CanMove) &&
- !x.RaceProps.Animal, x => GatherAnimalsAndSlavesForCaravanUtility.IsFollowingAnyone(x));
- }
- }
-
- //S Vehicles Item Pickup Fix!
- //RimWorld.LordToil_PrepareCaravan_GatherItems
- //Needs a transpiler i think.... Can't transpile cause my VM is down so i can't see IL code
- private static bool firstRun;
-
- public static bool GiveVehiclesLoadItemToil(LordToil_PrepareCaravan_GatherItems __instance)
- {
- if (Find.TickManager.TicksGame % 120 == 0)
- {
- var flag = true;
- for (var i = 0; i < __instance.lord.ownedPawns.Count; i++)
- {
- var pawn = __instance.lord.ownedPawns[i];
- if ((pawn.IsColonist || pawn.GetComp() != null) && pawn.mindState.lastJobTag !=
- JobTag.WaitingForOthersToFinishGatheringItems)
- if (!firstRun)
- {
- flag = false;
- firstRun = true;
- break;
- }
- else
- {
- if (pawn.CurJob.def != JobDefOf.Wait_Wander)
- {
- flag = false;
- break;
- }
- }
- }
- if (flag)
- {
- //Log.Error("2nd Statement");
- var allPawnsSpawned = __instance.Map.mapPawns.AllPawnsSpawned;
- for (var j = 0; j < allPawnsSpawned.Count; j++)
- if (allPawnsSpawned[j].CurJob != null &&
- allPawnsSpawned[j].jobs.curDriver is JobDriver_PrepareCaravan_GatherItems &&
- allPawnsSpawned[j].CurJob.lord == __instance.lord)
- {
- flag = false;
- break;
- }
- }
- if (flag)
- {
- __instance.lord.ReceiveMemo("AllItemsGathered");
- firstRun = false;
- }
- }
- return false;
- }
-
- //S Tries to find satisfy the vehicle's fuel "need"
- //Purpose: Try and find satisfy the vehicle's fuel "need"
- //Logic: If the vehicle is using fuel, it needs to refuel while on caravan trips
- //Improvements: Effects of different fuel sources on vehicle performance or effectiveness of fuel source?
- //RimWorld.Planet.CaravanPawnsNeedsUtility
- public static bool TrySatisfyFuelNeeds(Caravan_NeedsTracker __instance, Pawn pawn)
- {
- //If the pawn's dead, not a vehicle, or doesn't need fuel, it's a regular pawn and has needs
- var refuelable = pawn.GetComp();
- var vehicle = pawn.GetComp();
- if (pawn.Dead || refuelable == null || vehicle == null)
- return true;
-
- //It's a vehicle and it uses fuel and the amount of fuel is less than the auto refuel percent
- if (refuelable.FuelPercentOfMax < refuelable.Props.autoRefuelPercent)
- {
- var num = refuelable.GetFuelCountToFullyRefuel();
- //Call the private function TryGetFuel to find fuel for the vehicle
- if (TryGetFuel(__instance.caravan, pawn, refuelable, out var thing, out var pawn2))
- {
- //Fuel the Vehicle
- refuelable.Refuel(num);
-
- //Remove fuel from inventory
- if (thing.stackCount < num)
- num = thing.stackCount;
- thing.SplitOff(num);
- if (thing.Destroyed)
- if (pawn2 != null)
- pawn2.inventory.innerContainer.Remove(thing);
- }
- }
-
- //Vehicles don't have other needs, continuing the original method is a waste of time
- return false;
- }
-
- //J TB
- // RimWorld.JobGiver_PrepareCaravan_GatherItems
- public static bool TryGiveItemJob_PreFix(ref Job __result, Pawn pawn)
- {
- if (pawn?.TryGetComp() is CompVehicle v)
- {
- if (!pawn.health.capacities.CapableOf(PawnCapacityDefOf.Manipulation))
- {
- __result = null;
- return false;
- }
- var lord = pawn.GetLord();
- var thing = GatherItemsForCaravanUtility.FindThingToHaul(pawn, lord);
- if (thing == null)
- {
- __result = null;
- return false;
- }
- __result = new Job(JobDefOf.PrepareCaravan_GatherItems, thing)
- {
- lord = lord
- };
- return false;
- }
- return true;
- }
-
- #endregion AIHandlingMethods
-
- #region CaravanHandlingMethods
-
- //J This code checks all the characters inside a vehicle.
- // It then adds all of the characters into a temporary list to track them.
- // Then it adds them all to the caravan, as well.
- // RimWorld.Planet.Caravan
- public static bool AddVehiclePawnsToCaravan(Caravan __instance, Pawn p, bool addCarriedPawnToWorldPawnsIfAny)
- {
- ////Log.Message("AddVehicles0");
-
- if (p?.GetComp() is CompVehicle compVehicle)
- {
- ////Log.Message("AddVehicles1");
- if (p == null || p.Dead)
- {
- Log.Warning("Tried to add a null or dead pawn to " + __instance);
- return false;
- }
- if (p.Spawned) p.DeSpawn();
- if (p.holdingOwner != null)
- {
- p.holdingOwner?.TryTransferToContainer(p, __instance.pawns);
- }
- else __instance.pawns.TryAdd(p);
- //if (__instance.pawns.TryAdd(p, true))
- //{
- ////Log.Message("AddVehicles2");
-
- //All passengers in the vehicle go into the caravan.
- if (compVehicle.handlers != null && compVehicle.handlers.Count > 0)
- {
- ////Log.Message("AddVehicles3");
-
- //Store vehicle handler group structure in comp variable
- //compVehicle.PawnsInVehicle.Clear();
- compVehicle.PawnsInVehicle = new List();
- foreach (var group in compVehicle.handlers)
- {
- ////Log.Message("AddVehicles4");
- compVehicle.PawnsInVehicle.Add(new VehicleHandlerTemp(group));
- ////Log.Message("AddVehicles5");
-
- for (var i = 0; i < group.handlers.Count; i++)
- {
- ////Log.Message("AddVehicles6a");
-
- var innerPawn = group.handlers[i];
-
- //Remove the pawn from the vehicle and add it to the caravan
- if (innerPawn.Spawned) innerPawn.DeSpawn();
- if (innerPawn.holdingOwner != null)
- {
- ////Log.Message("AddVehicles7a");
-
- innerPawn?.holdingOwner?.TryTransferToContainer(innerPawn, __instance.pawns);
- //innerPawn.holdingOwner.Remove(innerPawn);
- //if (!__instance.pawns.TryAdd(innerPawn, true))
- // //Log.Message("Failed to load caravan with vehicle pawn: " + innerPawn.Label);
- ////Log.Message("AddVehicles7b");
- }
- else
- {
- ////Log.Message("AddVehicles8a");
-
- if (!__instance.pawns.TryAdd(innerPawn, true))
- Log.Message("Failed to load caravan with vehicle pawn: " + innerPawn.Label);
- ////Log.Message("AddVehicles8b");
- }
- ////Log.Message("AddVehicles6b");
-
- //group.handlers.Remove(pawn);
- }
- }
- //}
-
-
-#pragma warning disable IDE0019 // Use pattern matching
- var pawn = p.carryTracker.CarriedThing as Pawn;
-#pragma warning restore IDE0019 // Use pattern matching
- if (pawn != null)
- {
- //Anything in-hand also goes into the caravan.
- p.carryTracker.innerContainer.Remove(pawn);
- __instance.AddPawn(pawn, addCarriedPawnToWorldPawnsIfAny);
- if (addCarriedPawnToWorldPawnsIfAny)
- Find.WorldPawns.PassToWorld(pawn, PawnDiscardDecideMode.Decide);
- }
- }
- else
- {
- Log.Error("Couldn't add pawn " + p + " to caravan.");
- }
- return false;
- }
- return true;
- }
-
-
- //J Prevents caravans from being split while having colonists that are in vehicles.
- // This is a lazy fix for now. It may need to be revised later.
- // RimWorld.Planet.Dialog_SplitCaravan
- public static bool DontSplitCaravansWithVehicles(Dialog_SplitCaravan __instance,
- List pawns, ref bool __result)
- {
- var thisCaravan = Traverse.Create(__instance).Field("caravan").GetValue();
- if (thisCaravan?.pawns?.InnerListForReading?.Any(x => x.GetComp() != null) ?? false)
- {
- var result = __result;
- //Check the caravan's pawn list.
- if ((!thisCaravan?.PawnsListForReading?.NullOrEmpty() ?? false) && !pawns.NullOrEmpty())
- foreach (var p in thisCaravan.PawnsListForReading)
- if (p.GetComp() is CompVehicle compVehicle &&
- compVehicle?.PawnsInVehicle is List vehicleHandlers &&
- !vehicleHandlers.NullOrEmpty())
- foreach (var temp in vehicleHandlers)
- foreach (var o in pawns)
- if (temp?.handlers?.Contains(o) ?? false)
- {
- Messages.Message("CompVehicle_CannotSplitWhileInVehicles".Translate(),
- MessageTypeDefOf.RejectInput);
- __result = false;
- return false;
- }
- }
- return true;
- }
-
-
- //J ??? Forces caravan checks to be accepted if a vehicle is loaded.
- // ??? MESSY CODE ???
- // ??? NEEDS A TRANSPILER ???
- // RimWorld.Dialog_FormCaravan
- // Modified vanilla method, because I'm terrible.
- public static bool CheckForErrors_PreFix(Dialog_FormCaravan __instance, List pawns, ref bool __result)
- {
- if (pawns.FindAll(x => x.GetComp() != null) is List vehicles)
- {
- ////Log.Message("TestA");
- var localReform = Traverse.Create(__instance).Field("reform").GetValue();
- if (!localReform &&
- Traverse.Create(__instance).Field("startingTile").GetValue() < 0)
- {
- Messages.Message("NoExitDirectionForCaravanChosen".Translate(), MessageTypeDefOf.RejectInput);
- return false;
- }
- if (!pawns.Any(x => CaravanUtility.IsOwner(x, Faction.OfPlayer) && !x.Downed))
- if (!pawns.Any(y => y.TryGetComp() is CompVehicle v))
- if (!pawns.Any(z => z.TryGetComp() is CompVehicle v && v.CanMove))
- {
- Messages.Message("CaravanMustHaveAtLeastOneColonist".Translate(),
- MessageTypeDefOf.RejectInput);
- return false;
- }
- if (!localReform && Traverse.Create(__instance).Property("MassUsage").GetValue() >
- Traverse.Create(__instance).Property("MassCapacity").GetValue())
- {
- AccessTools.Method(typeof(Dialog_FormCaravan), "FlashMass").Invoke(__instance, null);
- Messages.Message("TooBigCaravanMassUsage".Translate(), MessageTypeDefOf.RejectInput);
- return false;
- }
- var pawn = pawns.Find(x =>
- (x.TryGetComp() == null ||
- x.TryGetComp() is CompVehicle v && !v.CanMove) &&
- !pawns.Any(y =>
- !y.IsPrisoner && !y.RaceProps.Animal && y.CanReach(x, PathEndMode.Touch, Danger.Deadly, false,
- TraverseMode.ByPawn)));
- if (pawn != null)
- {
- Messages.Message("CaravanPawnIsUnreachable".Translate(pawn.LabelShort).CapitalizeFirst(), pawn,
- MessageTypeDefOf.RejectInput);
- return false;
- }
- for (var i = 0; i < __instance.transferables.Count; i++)
- if (__instance.transferables[i].ThingDef.category == ThingCategory.Item)
- {
- var countToTransfer = __instance.transferables[i].CountToTransfer;
- var num = 0;
- if (countToTransfer > 0)
- {
- for (var j = 0; j < __instance.transferables[i].things.Count; j++)
- {
- var t = __instance.transferables[i].things[j];
- if (!t.Spawned || pawns.Any(x =>
- (x.IsColonist || x.TryGetComp() is CompVehicle v && v.CanMove) &&
- x.CanReach(t, PathEndMode.Touch, Danger.Deadly, false, TraverseMode.ByPawn)))
- {
- num += t.stackCount;
- if (num >= countToTransfer)
- break;
- }
- }
- if (num < countToTransfer)
- if (countToTransfer == 1)
- Messages.Message(
- "CaravanItemIsUnreachableSingle".Translate(__instance.transferables[i].ThingDef
- .label), MessageTypeDefOf.RejectInput);
- else
- Messages.Message(
- "CaravanItemIsUnreachableMulti".Translate(countToTransfer,
- __instance.transferables[i].ThingDef.label), MessageTypeDefOf.RejectInput);
- }
- }
- __result = true;
- return false;
- }
- return true;
- }
-
- //J ??? Shows "Vehicles" in the caravan tab. Messy patch.
- // ??? MESSY CODE ???
- // ??? NEEDS A TRANSPILER ???
- // This is a lazy prefix to reroute the code to use our list if they have a vehicle in the list.
- // RimWorld.Planet.CaravanPeopleAndItemsTabUtility
-// public static bool DoRows_PreFix(Vector2 size, ref List things, Caravan caravan,
-// ref Vector2 scrollPosition, ref float scrollViewHeight, bool alwaysShowItemsSection,
-// ref Pawn specificNeedsTabForPawn, bool doNeeds = true)
-// {
-// if (things.Any(x => x is Pawn p && p.TryGetComp() != null))
-// {
-// if (specificNeedsTabForPawn != null &&
-// (!things.Contains(specificNeedsTabForPawn) || specificNeedsTabForPawn.Dead))
-// specificNeedsTabForPawn = null;
-// var methodDoRow = typeof(CaravanPeopleAndItemsTabUtility)
-// .GetMethods(BindingFlags.NonPublic | BindingFlags.Static)
-// .First(mi => mi.Name == "DoRow" && mi.GetParameters().Count() == 9);
-// var methodAnyItemOrEmpty =
-// AccessTools.Method(typeof(CaravanPeopleAndItemsTabUtility), "AnyItemOrEmpty");
-//
-// Text.Font = GameFont.Small;
-// var rect = new Rect(0f, 0f, size.x, size.y).ContractedBy(10f);
-// var viewRect = new Rect(0f, 0f, rect.width - 16f, scrollViewHeight);
-// var listingUsesAbandonSpecificCountButtons =
-// (bool) methodAnyItemOrEmpty.Invoke(null, new object[] {things});
-// Widgets.BeginScrollView(rect, ref scrollPosition, viewRect, true);
-// var num = 0f;
-// var flag = false;
-// for (var i = 0; i < things.Count; i++)
-// {
-//#pragma warning disable IDE0019 // Use pattern matching
-// var pawn = things[i] as Pawn;
-//#pragma warning restore IDE0019 // Use pattern matching
-// if (pawn != null && pawn.IsColonist)
-// {
-// if (!flag)
-// {
-// Widgets.ListSeparator(ref num, viewRect.width, "CaravanColonists".Translate());
-// flag = true;
-// }
-// var args = new object[]
-// {
-// num, viewRect, rect, scrollPosition, pawn, caravan, specificNeedsTabForPawn, doNeeds,
-// listingUsesAbandonSpecificCountButtons
-// };
-// methodDoRow.Invoke(null, args);
-// num = (float) args[0];
-// specificNeedsTabForPawn = (Pawn) args[6];
-// }
-// }
-// var flagV = false;
-// for (var k = 0; k < things.Count; k++)
-// {
-//#pragma warning disable IDE0019 // Use pattern matching
-// var pawnV = things[k] as Pawn;
-//#pragma warning restore IDE0019 // Use pattern matching
-// if (pawnV != null && pawnV.TryGetComp() != null)
-// {
-// if (!flagV)
-// {
-// Widgets.ListSeparator(ref num, viewRect.width, "CompVehicle_VehicleSection".Translate());
-// flagV = true;
-// }
-// var args = new object[]
-// {
-// num, viewRect, rect, scrollPosition, pawnV, caravan, specificNeedsTabForPawn, doNeeds,
-// listingUsesAbandonSpecificCountButtons
-// };
-// methodDoRow.Invoke(null, args);
-// num = (float) args[0];
-// specificNeedsTabForPawn = (Pawn) args[6];
-// }
-// }
-//
-// var flag2 = false;
-// for (var j = 0; j < things.Count; j++)
-// {
-//#pragma warning disable IDE0019 // Use pattern matching
-// var pawn2 = things[j] as Pawn;
-//#pragma warning restore IDE0019 // Use pattern matching
-// if (pawn2 != null && !pawn2.IsColonist && pawn2.TryGetComp() == null)
-// {
-// if (!flag2)
-// {
-// Widgets.ListSeparator(ref num, viewRect.width, "CaravanPrisonersAndAnimals".Translate());
-// flag2 = true;
-// }
-// var args = new object[]
-// {
-// num, viewRect, rect, scrollPosition, pawn2, caravan, specificNeedsTabForPawn, doNeeds,
-// listingUsesAbandonSpecificCountButtons
-// };
-// methodDoRow.Invoke(null, args);
-// num = (float) args[0];
-// specificNeedsTabForPawn = (Pawn) args[6];
-// }
-// }
-// var flag3 = false;
-// if (alwaysShowItemsSection)
-// Widgets.ListSeparator(ref num, viewRect.width, "CaravanItems".Translate());
-// for (var k = 0; k < things.Count; k++)
-// if (!(things[k] is Pawn))
-// {
-// if (!flag3)
-// {
-// if (!alwaysShowItemsSection)
-// Widgets.ListSeparator(ref num, viewRect.width, "CaravanItems".Translate());
-// flag3 = true;
-// }
-// var args = new object[]
-// {
-// num, viewRect, rect, scrollPosition, things[k], caravan, specificNeedsTabForPawn, doNeeds,
-// listingUsesAbandonSpecificCountButtons
-// };
-// methodDoRow.Invoke(null, args);
-// num = (float) args[0];
-// specificNeedsTabForPawn = (Pawn) args[6];
-// }
-// if (alwaysShowItemsSection && !flag3)
-// {
-// GUI.color = Color.gray;
-// Text.Anchor = TextAnchor.UpperCenter;
-// Widgets.Label(new Rect(0f, num, viewRect.width, 25f), "NoneBrackets".Translate());
-// Text.Anchor = TextAnchor.UpperLeft;
-// num += 25f;
-// GUI.color = Color.white;
-// }
-// if (Event.current.type == EventType.Layout)
-// scrollViewHeight = num + 30f;
-// Widgets.EndScrollView();
-// return false;
-// }
-// return true;
-// }
-
- //J Adds a vehicles section to Caravan forming UI.
- // RimWorld.CaravanUIUtility
- public static void AddPawnsSections_PostFix(TransferableOneWayWidget widget,
- List transferables)
- {
- var source = from x in transferables
- where x.ThingDef.category == ThingCategory.Pawn
- select x;
- widget.AddSection("CompVehicle_VehicleSection".Translate(), from x in source
- where ((Pawn) x.AnyThing).GetComp() != null &&
- ((Pawn) x.AnyThing).GetComp().MovementHandlerAvailable
- select x);
- }
-
- //J Movement handlers in vehicles are counted in caravan forming.
- // RimWorld.Planet.CaravanExitMapUtility
- public static void CanExit_PostFix(Pawn pawn, ref bool __result)
- {
- __result = pawn.Spawned && pawn.Map.exitMapGrid.MapUsesExitGrid &&
- (pawn.IsColonist ||
- pawn.GetComp() is CompVehicle compVehicle && compVehicle.CanMove ||
- CaravanExitMapUtility.FindCaravanToJoinFor(pawn) != null);
- }
-
- //J Changes the caravan capacity for the vehicle.
- // RimWorld.MassUtility
- public static void Capacity_PostFix(ref float __result, Pawn p)
- {
- if (p?.TryGetComp() is CompVehicle v)
- __result = __result != 0 ? (v?.Props?.cargoCapacity ?? p.BodySize * 35) : 0;
- }
-
- /* S Modifies caravan movement speed if vehicles are present
- S The math on this is sound, I just don't know what the game is doing to turn the result into tiny values
-
- Purpose: Modifies caravan speed if vehicles are present
- Logic: If a vehicle is present than the caravan should move faster, if there are multiple vehicles it should be an average,
- Improvements:Different algorithm for calculating world movement speed?
- Algorithm explanation:
- given 5 pawns with vehicle status denoted with V and their corresponding ticks per speed being:
- 100V, 150, 200V, 250, 300V
- The none modified ticks per move would be 190f * sigma(100,150,200,250,300)/5 aka the average (200) * 190f or 38,000
- Since 190f is a constant we can remove that number and our postfixed calculations will be modified from sigma(100,150,200,250,300)/5 aka 200
-
- Case 1: All vehicles are fueled and fueled vehicles travel twice as fast aka half the ticks needed or Speed Modifer of 2
- The original equation would now become sigma(50V,150,100V,250,150V)/5 or 140
- To prevent the recalculation of TicksPerMove we can rewrite that equation as
- sigma(100V,150,200V,250,300V)/5 - sigma(50V,0,100V,0,150V)/5 or 140
- which can be rewritten as __result/190 - sigma((SpeedModifier-1) * (originaTickSpeed)/SpeedModifier) for all pawns)/(number of pawns)
- I.e.__result/190 - ((2-1) * 100/2 + (1-1) * 150/1 + (2-1) * 200/2 + (1-1) * 250/1 + (2-1) * 300/2) or 140
-
- Case 2: Vehicle 1 is fueled(100V) but the other two vehicles aren't (200V and 300V)
- Fueled Vehicles travel twice as fast(speed modifier of 2) and nonfueled vehicles travel half as a fast(speed modifier of 0.5)
- The original equation would now become sigma(50V, 150, 400V, 250, 600V)/5 or 290
- As again to prevent the recalculation of TicksPerMove we can rewrite it as the following
- sigma(100V,150,200V,250,300V)/5 - sigma(50V,0,0V,0,0V)/5 + sigma(0V,0,200V,0,300V)/5 or 290
- this can be rewritten as __result/190 - (sigma function from case 1) + sigma((originalTickSpeed / speedModifier - originalTickSpeed for all pawns)/(number of pawns)
- or __result/190 - ((2-1) * 100/2 + 0 + 0 + 0 + 0)/5 + (0 + 0 + (200 / 0.5 - 200) + 0 + (300/0.5 - 300))/5 or 290
-
-
- The math on this is sound, the game is being weird though:
- Game function:
-
- public static int GetTicksPerMove(List pawns)
- {
- if (pawns.Any())
- {
- float num = 0f;
- for (int i = 0; i < pawns.Count; i++)
- {
- int num2 = (!pawns[i].Downed) ? pawns[i].TicksPerMoveCardinal : 450;
- num += (float)num2 / (float)pawns.Count;
- }
- num *= 190f;
- return Mathf.Max(Mathf.RoundToInt(num), 1);
- }
- return 2500;
- }
-
- Given the above ^^^ if there were two pawns who had the following TicksPerMoveCardinal value and were not downed
- Colonist: 18
- Wagon: 12
- the value returned should be 190(12/2 + 18/2) or 15*190 which is NOT equal to the value returned
- the error logging in the postfix(2.101948E-44). Even if it were, the Mathf.Max(Mathf.RoundToInt(num), 1);
- should have returned 1 as 1 > 2.101948E-44. Something is weird with the function, I can't catch what is happening,
- I believe that I'm not breaking any math/logic rules.
-
- Addendum by Jecrell
- I've modified this method to be based on another concept.
- No matter how much we "average" out vehicle speed, I believe it makes more sense, logically, to assume that the caravan
- will move at the speed of the slowest pawn.So therefore, we should check firstly to see if characters are outside
- the vehicles.If they are, do not apply vehicle bonus speed.If everyone is inside vehicles, then we should consider
- which vehicle is the slowest and then make caravan speed go at that rate.
-
- //RimWorld.Planet.CaravanTicksPerMoveUtility
- */
- public static void GetTicksPerMove_PostFix(List pawns, ref int __result)
- {
- //Only do this if a vehicle is present. Then make a list of vehicles.
- if (!pawns.NullOrEmpty() &&
- pawns.FindAll(x => x?.GetComp() != null && !x.Dead && !x.Downed) is List vehicles &&
- vehicles.Count > 0)
- {
- //Make a list of non-vehicle characters that are not inside vehicles.
- //This method is long and ugly, so bear with me...
- var pawnsOutsideVehicle = new List(pawns.FindAll(x => x?.GetComp() == null));
- if (pawnsOutsideVehicle != null && pawnsOutsideVehicle.Count > 0)
- if ((vehicles?.Count ?? 0) > 0)
- foreach (var vehicle in vehicles)
- {
- if ((vehicle?.GetComp().PawnsInVehicle?.Count ?? 0) > 0)
- foreach (var group in vehicle?.GetComp().PawnsInVehicle)
- {
- if ((group?.handlers?.Count ?? 0) > 0)
- foreach (var p in group.handlers)
- {
- if (pawnsOutsideVehicle.Count == 0) break;
- if (pawnsOutsideVehicle.Contains(p)) pawnsOutsideVehicle.Remove(p);
- }
- if (pawnsOutsideVehicle.Count == 0) break;
- }
- if (pawnsOutsideVehicle.Count == 0) break;
- }
-
- //Are there any characters not inside vehicles?
- //If so, make no changes to default speeds.
- //This will be similar to vehicles slowly coasing alongside walking characters.
- if ((pawnsOutsideVehicle?.Count ?? 0) > 0) return;
-
- ////Log.Message("2");
- var slowestLandSpeed = 999f;
- foreach (var vehicle in vehicles)
- slowestLandSpeed = Math.Min(vehicle.GetComp().Props.worldSpeedFactor,
- slowestLandSpeed);
- __result = (int) (__result / slowestLandSpeed);
- }
-
- //Previous code.
- //float speedModifier;
- //remove constant to make math easier, put it back later
- //__result = (int)(__result / 190f);
- //if (pawns.Any())
- //{
- //__result *= pawns.Count;
- //Log.Error(pawns.Count.ToString());
- //for (int i = 0; i < pawns.Count; i++)
- //{
- //Log.Error(pawns[i].def.defName);
- //Log.Error((pawns[i].TicksPerMoveCardinal.ToString()));
- //CompVehicle compVehicle = pawns[i].GetComp();
- //Movement magic only occurs if it's a vehicle
- //if (compVehicle != null)
- //{
-
- //if (pawns[i].GetComp() != null && !pawns[i].GetComp().HasFuel)
- //{
- //Vehicle has no fuel, add ticks
- //Log.Error(("no fuel"));
- //speedModifier = pawns[i].GetComp().Props.worldSpeedFactorNoFuel;
- //Log.Error(("result: " + __result.ToString()));
- //Log.Error(("TPMC: " + pawns[i].TicksPerMoveCardinal.ToString()));
- //Log.Error("smod: " + (speedModifier.ToString()));
- //Log.Error("math: " + ((pawns[i].TicksPerMoveCardinal / speedModifier) - pawns[i].TicksPerMoveCardinal).ToString());
- //__result += (int)(pawns[i].TicksPerMoveCardinal / speedModifier) - pawns[i].TicksPerMoveCardinal;
- //Log.Error(("result2: " + __result.ToString()));
- //}
- //else
- //{
- //Vehicle has fuel, subtract ticks
- ///Log.Error(("fuel"));
- //speedModifier = pawns[i].GetComp().Props.worldSpeedFactor;
- //Log.Error(("result: " + __result.ToString()));
- //Log.Error(("TPMC: " + pawns[i].TicksPerMoveCardinal.ToString()));
- //Log.Error("smod: " + (speedModifier.ToString()));
- //Log.Error("math: " + (((speedModifier - 1) * pawns[i].TicksPerMoveCardinal / speedModifier)));
-
- //__result -= (int)((speedModifier - 1) * pawns[i].TicksPerMoveCardinal / speedModifier);
- //Log.Error(("result2: " + __result.ToString()));
- //}
-
- //}
- //}
- //__result /= pawns.Count;
- //}
- //multiply by 190f (the constant)
- //Log.Error(("b" + __result.ToString()));
- //__result *= 190;
- }
-
- /*S Remove pawns from the vehicle when making a caravan
- Purpose: Remove pawns from the vehicle when making a caravan
- Logic: Pawns should be displayable while in the caravan, this allows needs to be calculated by the game instead of through ResolveNeeds()
- Improvements: Make pawn cards appear while in a vehicle but not in the caravan?
- Modify vehicle Needs card while not in caravan to display needs of pawns inside it?
-
-
- Addendum by Jecrell:
- Added WorldPawn considerations.
- */
- //RimWorld.Planet.CaravanMaker
- //public static void MakeCaravan_PostFix(IEnumerable pawns, bool addToWorldPawnsIfNotAlready, Caravan __result)
- //{
- // if (pawns != null && pawns.Count() > 0 && pawns.Any(x => x.GetComp() != null))
- // {
- // foreach (Pawn vpawn in pawns)
- // {
- // if (vpawn.GetComp() is CompVehicle vehicle)
- // {
- // if (!vehicle.handlers.NullOrEmpty())
- // {
- // //Store vehicle handler group structure in comp variable
- // vehicle.PawnsInVehicle = new List();
- // foreach (VehicleHandlerGroup group in vehicle.handlers)
- // {
- // vehicle.PawnsInVehicle.Add(new VehicleHandlerTemp(group));
- // for (int i = 0; i < group.handlers.Count; i++)
- // {
- // Pawn pawn = group.handlers[i];
-
- // //Remove the pawn from the vehicle and add it to the caravan
- // if (!__result.ContainsPawn(pawn))
- // {
- // if (pawn.holdingOwner != null) pawn.holdingOwner = null;
- // __result.AddPawn(pawn, addToWorldPawnsIfNotAlready);
- // if (addToWorldPawnsIfNotAlready && !pawn.IsWorldPawn())
- // {
- // if (pawn.Spawned)
- // {
- // pawn.DeSpawn();
- // }
- // if (!pawn.IsWorldPawn()) Find.WorldPawns.PassToWorld(pawn, PawnDiscardDecideMode.Decide);
- // }
- // }
- // group.handlers.Remove(pawn);
- // }
- // }
- // }
-
- // }
-
- // }
-
- // }
-
- //}
-
- //S Remove pawns from the vehicle when exiting the map in an already formed caravan
- //Purpose: Remove pawns from the vehicle when exiting the map in a already formed caravan
- //Logic: Pawns should be displayable while in the caravan, this vehicles to remove pawns and remember them for already made caravans
- //Improvements: Combine this with the previous patch method?
-
- //RimWorld.Planet.CaravanExitMapUtility
-
- //Bad code, needs transpiler cause i nuked vanilla code again
-// public static bool ExitMapAndJoinOrCreateCaravan_PreFix(Pawn pawn)
-// {
-// if (pawn.GetComp() is CompVehicle compVehicle)
-// {
-// //Vanilla code start
-// ////Log.Message("EMJOC_1");
-// var caravan = CaravanExitMapUtility.FindCaravanToJoinFor(pawn);
-// ////Log.Message("EMJOC_2");
-//
-// if (caravan != null)
-// {
-// ////Log.Message("EMJOC_3a");
-//
-// pawn.DeSpawn();
-// ////Log.Message("EMJOC_3b");
-//
-// caravan.AddPawn(pawn, true);
-// ////Log.Message("EMJOC_3c");
-//
-// pawn.ExitMap(false);
-// ////Log.Message("EMJOC_3d");
-// }
-// //Vanilla code edit transpiler here for if statement
-// ////Log.Message("EMJOC_4");
-//
-// var list = CaravanExitMapUtility.AvailableExitTilesAt(pawn.Map);
-// ////Log.Message("EMJOC_4a");
-//
-// var caravan2 = CaravanExitMapUtility.ExitMapAndCreateCaravan(Gen.YieldSingle(pawn), pawn.Faction,
-// pawn.Map.Tile, !list.Any() ? pawn.Map.Tile : list.RandomElement());
-// ////Log.Message("EMJOC_4b");
-//
-// caravan2.autoJoinable = true;
-// ////Log.Message("EMJOC_4c");
-//
-// if (pawn.Faction == Faction.OfPlayer)
-// Messages.Message("MessagePawnLeftMapAndCreatedCaravan".Translate(pawn.LabelShort).CapitalizeFirst(),
-// caravan2, MessageTypeDefOf.PositiveEvent);
-// ////Log.Message("EMJOC_4f");
-//
-// //Vanilla Code end
-//
-// //Apparently commenting out this code fixed the errors from JobDriver when
-// //leaving an invasion map
-// //caravan = CaravanExitMapUtility.FindCaravanToJoinFor(pawn);
-// //if (!compVehicle.AllOccupants.NullOrEmpty())
-// //{
-// // if (compVehicle.PawnsInVehicle == null)
-// // {
-// // compVehicle.PawnsInVehicle = new List();
-// // foreach (VehicleHandlerGroup group in compVehicle.handlers)
-// // {
-// // ////Log.Message("Adding group to " + compVehicle.Pawn.ToString());
-// // compVehicle.PawnsInVehicle.Add(new VehicleHandlerTemp(group));
-// // }
-// // }
-// //}
-// //if (vehicle.handlers != null && vehicle.handlers.Count > 0)
-// //{
-// // foreach (VehicleHandlerGroup group in vehicle.handlers)
-// // {
-// // for (int i = 0; i < group.handlers.Count; i++)
-// // {
-// // Pawn tpawn = group.handlers[i];
-// // //Store vehicle handler group structure in comp variable
-// // if (vehicle.AllOccupants.Count > 0)
-// // {
-// // //Add pawns to the comp variable for usage on reentering the map
-// // foreach (VehicleHandlerGroup vgroup in vehicle.PawnsInVehicle)
-// // {
-// // if (vgroup.role == group.role)
-// // {
-// // vgroup.handlers.Add(tpawn);
-// // }
-// // }
-// // }
-// // //Remove the pawn from the vehicle and add it to the caravan
-// // caravan.AddPawn(tpawn, true);
-// // group.handlers.Remove(tpawn);
-// // }
-// // }
-// //}
-// //Log.Message("EMJOC_6");
-//
-// return false;
-// }
-// return true;
-// }
-
- //S Add pawns back to the vehicle and remove them from the caravan when entering the map
- //S Converted to prefix which should fix map enter cloning (Cloning did occur previously but clones were removed via resolve ejection)
- //Purpose: Put pawns back into vehicles on entering the map
- //Logic: Pawns should remember which vehicle they were in when entering the map
- //Improvements: Have this function for incidents? Or leave pawns outside since incidents "catch the player (pawns by extension) off guard"
- //RimWorld.Planet.CaravanExitMapUtility
- //Converted to Prefix as the pawns weren't being removed since they were all being spawned before the postfix ran
- public static void Enter_PreFix(Caravan caravan)
- {
- var members = caravan.PawnsListForReading;
- //Log.Error(members.Count().ToString());
- //Log.Error();
- for (var i = 0; i < members.Count; i++)
- {
- var vehicle = members[i].GetComp();
- //Did the vehicle have pawns in it previously?
- if (vehicle != null && vehicle.PawnsInVehicle != null && vehicle.PawnsInVehicle.Count > 0)
- {
- for (var j = 0; j < members.Count; j++)
- for (var l = 0; l < vehicle.PawnsInVehicle.Count; l++)
- {
- var group = vehicle.PawnsInVehicle[l];
- for (var k = 0; k < group.handlers.Count; k++)
- {
- //Is the pawn still in the caravan?
- var pawn = group.handlers[k];
- if (pawn == members[j])
- foreach (var vgroup in vehicle.handlers)
- if (vgroup.role.label == group.role.label)
- {
- vgroup.handlers.TryAdd(pawn);
- caravan.RemovePawn(pawn);
- ////Log.Message("RemovedPawn " + pawn.LabelShort);
- ////Log.Message(caravan.PawnsListForReading.ToString());
- //if (pawn.IsWorldPawn()) Find.WorldPawns.RemovePawn(pawn);
- break;
- }
- }
- }
- //Clear the comp variable to allow an empty one to be created when forming a caravan/exiting map
- vehicle.PawnsInVehicle = null;
- }
- }
- //Log.Error(members.Count().ToString());
- }
-
- //S Modifies the caravan inspect string so fuel is shown
- //Purpose: Modifies the caravan inspect string so fuel is shown
- //Logic: Players should be able to see how much fuel their caravan is carrying
- //Improvements: None I can think of
- //7/3/17 Jec- Bugfix for end of line errors.
- //RimWorld.Planet.Caravan
- public static void GetInspectString_PostFix(Caravan __instance, ref string __result)
- {
- //Grab the original String
- var stringBuilder = new StringBuilder();
- stringBuilder.AppendLine(__result);
-
- //Check if Caravan is out of fuel
- if (AnythingOutOfFuel(__instance))
- {
- //Display No Fuel
- stringBuilder.AppendLine("CaravanOutOfFuel".Translate());
- }
- else
- {
- //Display how much fuel the caravan has left, over 1000 is infinite (game mechanic)
- if (AnythingNeedsFuel(__instance, out var needfuel))
- {
- //Call function that calculates the amount of fuel left
- var daysLeftOfFuel = ApproxDaysWorthOfFuel(needfuel, __instance.Goods);
- if (daysLeftOfFuel < 1000f)
- stringBuilder.AppendLine("DaysWorthOfFuelInfo".Translate(daysLeftOfFuel.ToString("0.#")));
- else
- stringBuilder.AppendLine("InfiniteDaysWorthOfFuelInfo".Translate());
- }
- else
- {
- //stringBuilder.AppendLine("InfiniteDaysWorthOfFuelInfo".Translate());
- }
- }
- __result = stringBuilder.ToString().TrimEndNewlines();
- }
-
- //S Modifies the Caravan Needs WITab to show vehicle fuel
- //Purpose: Modifies the Caravan Needs WITab to show vehicle fuel
- //Logic: Players should be able to see how much fuel each vehicle has
-// public static IEnumerable DoRow_Transpiler(IEnumerable instructions,
-// ILGenerator ilg)
-// {
-// var downedInfo = AccessTools.Property(typeof(Pawn), nameof(Pawn.Downed)).GetGetMethod();
-// var getCompInfo = AccessTools.Method(typeof(ThingWithComps), nameof(Pawn.GetComp))
-// .MakeGenericMethod(typeof(CompRefuelable));
-// var thisMethodInfo = AccessTools.Method(typeof(CaravanPeopleAndItemsTabUtility), "DoRow",
-// new[]
-// {
-// typeof(Rect), typeof(Thing), typeof(Caravan), typeof(Pawn).MakeByRefType(), typeof(bool),
-// typeof(bool)
-// });
-//
-//
-// var instructionList = instructions.ToList();
-//
-// for (var i = 0; i < instructionList.Count; i++)
-// {
-// var instruction = instructionList[i];
-//
-// if (instruction.operand == downedInfo)
-// {
-// yield return new CodeInstruction(OpCodes.Callvirt, getCompInfo);
-// yield return new CodeInstruction(OpCodes.Ldnull);
-// yield return new CodeInstruction(OpCodes.Cgt_Un);
-// var endLabel = ilg.DefineLabel();
-// yield return new CodeInstruction(OpCodes.Brfalse_S, endLabel);
-// yield return new CodeInstruction(OpCodes.Nop);
-// yield return new CodeInstruction(instructionList[i - 1]) {labels = new List()};
-// yield return new CodeInstruction(OpCodes.Callvirt, getCompInfo);
-// yield return new CodeInstruction(OpCodes.Ldc_R4, 135f);
-// yield return new CodeInstruction(OpCodes.Ldc_R4, 0.0f);
-// yield return new CodeInstruction(OpCodes.Ldc_R4, 100f);
-// yield return new CodeInstruction(OpCodes.Ldc_R4, 50f);
-// yield return new CodeInstruction(OpCodes.Newobj,
-// AccessTools.Constructor(typeof(Rect),
-// new[] {typeof(float), typeof(float), typeof(float), typeof(float)}));
-// yield return new CodeInstruction(OpCodes.Ldc_I4_1);
-// yield return new CodeInstruction(OpCodes.Ldc_I4_0);
-// yield return new CodeInstruction(OpCodes.Ldc_R4, 10f);
-// yield return new CodeInstruction(OpCodes.Ldc_I4_0);
-// yield return new CodeInstruction(OpCodes.Call,
-// AccessTools.Method(typeof(HarmonyCompVehicle), nameof(DrawOnGUI)));
-// yield return new CodeInstruction(OpCodes.Nop);
-// yield return new CodeInstruction(OpCodes.Nop);
-// yield return new CodeInstruction(instructionList[i - 1]) {labels = new List {endLabel}};
-// }
-// yield return instruction;
-// }
-// }
-
- //S Modifies the Caravan Contents Window when forming a caravan to show the fuel carried by the caravan
- // ---------- BAD CODE...... but...... it works---------
- //Purpose: Modifies the Caravan Contents Window when forming a caravan to show the fuel carried by the caravan
- //Modifies the food count to include pawns still inside a vehicle
- //Logic: Players should be able to see how much fuel the caravan is carrying when forming a caravan
- //Improvements: Transpiler? Brrainz said that copying the code is bad
- //Don't know how to do a transpiler and didn't have time to try
- //Variable needed to keep track of the tab last the player was last at for window refresh
- //__instance version of this was not working
- private static object tab;
-
-// public static bool DoWindowContents_PreFix(Rect inRect, Dialog_FormCaravan __instance)
-// {
-// var traverseobj = Traverse.Create(__instance);
-// var transferables = traverseobj.Field("transferables").GetValue>();
-// var vehicleTransferrable = transferables?.FirstOrDefault(x =>
-// x.HasAnyThing && x.AnyThing is Pawn p && p.GetComp() is CompVehicle vehicle);
-// if (vehicleTransferrable != null)
-// {
-// //Create a traverse object and grab private variables from the instance
-// var reform = traverseobj.Field("reform").GetValue();
-// var tabsList = traverseobj.Field("tabsList").GetValue>();
-// var MassUsage = traverseobj.Property("MassUsage").GetValue();
-// var MassCapacity = traverseobj.Property("MassCapacity").GetValue();
-// var lastMassFlashTime = traverseobj.Field("lastMassFlashTime").GetValue();
-// var map = traverseobj.Field("map").GetValue();
-// if (tab == null)
-// tab = traverseobj.Field("tab").GetValue();
-//
-// var EnvironmentAllowsEatingVirtualPlantsNow =
-// traverseobj.Property("EnvironmentAllowsEatingVirtualPlantsNow").GetValue();
-// var pawnsTransfer = traverseobj.Field("pawnsTransfer").GetValue();
-// var itemsTransfer = traverseobj.Field("itemsTransfer").GetValue();
-//
-//
-// var tmpThingCounts = new List();
-// var list = new List();
-// for (var i = 0; i < transferables.Count; i++)
-// {
-// var transferableOneWay = transferables[i];
-// if (transferableOneWay.HasAnyThing)
-// if (transferableOneWay.AnyThing is Pawn)
-// for (var l = 0; l < transferableOneWay.CountToTransfer; l++)
-// {
-// var pawn = (Pawn) transferableOneWay.things[l];
-// //Look at the contents of the vehicle and if it has any pawns in it, add it to the list
-// if (pawn.GetComp() != null &&
-// pawn.GetComp().AllOccupants != null)
-// for (var j = 0; j < pawn.GetComp().AllOccupants.Count; j++)
-// list.Add(pawn.GetComp().AllOccupants[j]);
-// }
-// else
-// tmpThingCounts.Add(new ThingCount(transferableOneWay.ThingDef,
-// transferableOneWay.CountToTransfer));
-// }
-//
-// //Calculate days worth of food using the list with pawns in vehicles
-// var DaysWorthOfFood = new Pair(
-// (float) AccessTools
-// .Method(typeof(DaysWorthOfFoodCalculator), "ApproxDaysWorthOfFood",
-// new[]
-// {
-// typeof(List), typeof(List), typeof(bool),
-// typeof(IgnorePawnsInventoryMode)
-// }).Invoke(__instance,
-// new object[]
-// {
-// list, tmpThingCounts, EnvironmentAllowsEatingVirtualPlantsNow,
-// IgnorePawnsInventoryMode.IgnoreIfAssignedToUnload
-// }),
-// DaysUntilRotCalculator.ApproxDaysUntilRot(transferables, map.Tile,
-// IgnorePawnsInventoryMode.IgnoreIfAssignedToUnload));
-//
-// //Calculate the days worth of fuel
-// var DaysWorthOfFuel =
-// ApproxDaysWorthOfFuel(transferables, IgnorePawnsInventoryMode.IgnoreIfAssignedToUnload);
-// var rect = new Rect(0f, 0f, inRect.width, 40f);
-// Text.Font = GameFont.Medium;
-// Text.Anchor = TextAnchor.MiddleCenter;
-// Widgets.Label(rect, (!reform ? "FormCaravan" : "ReformCaravan").Translate());
-// Text.Font = GameFont.Small;
-// Text.Anchor = TextAnchor.UpperLeft;
-// tabsList.Clear();
-// //Tabs: get the current tab
-// tabsList.Add(new TabRecord("PawnsTab".Translate(), delegate
-// {
-// Traverse.Create(tab).Field("value__").SetValue(0); //Since Tab.Pawns == 0
-// }, tab.ToString() == "Pawns"));
-// tabsList.Add(new TabRecord("ItemsTab".Translate(), delegate
-// {
-// Traverse.Create(tab).Field("value__").SetValue(1); //Since Tab.Items == 1
-// }, tab.ToString() == "Items"));
-// if (!reform)
-// tabsList.Add(new TabRecord("CaravanConfigTab".Translate(), delegate
-// {
-// Traverse.Create(tab).Field("value__").SetValue(2); //Since Tab.Pawns == 3
-// }, tab.ToString() == "Config"));
-// inRect.yMin += 72f;
-// Widgets.DrawMenuSection(inRect);
-// TabDrawer.DrawTabs(inRect, tabsList);
-// inRect = inRect.ContractedBy(17f);
-// GUI.BeginGroup(inRect);
-// var rect2 = inRect.AtZero();
-// //Show the info stuff if it's not the config tab
-// if (tab.ToString() != "Config")
-// {
-// var rect3 = rect2;
-// rect3.xMin += rect2.width - 515f;
-// rect3.y += 32f;
-// TransferableUIUtility.DrawMassInfo(rect3, MassUsage, MassCapacity,
-// "CaravanMassUsageTooltip".Translate(), lastMassFlashTime, true);
-// CaravanUIUtility.DrawDaysWorthOfFoodInfo(
-// new Rect(rect3.x, rect3.y + 19f, rect3.width, rect3.height), DaysWorthOfFood.First,
-// DaysWorthOfFood.Second, EnvironmentAllowsEatingVirtualPlantsNow, true, 3.40282347E+38f);
-// //Draw fuel info
-// DrawDaysWorthOfFuelInfo(new Rect(rect3.x, rect3.y + 38f, rect3.width, rect3.height),
-// DaysWorthOfFuel, true, 3.40282347E+38f);
-// }
-// DoBottomButtons(rect2, __instance, DaysWorthOfFood, traverseobj, reform, transferables, DaysWorthOfFuel,
-// StuffHasNoFuel(transferables, IgnorePawnsInventoryMode.IgnoreIfAssignedToUnload));
-// var inRect2 = rect2;
-// inRect2.yMax -= 59f;
-// var flag = false;
-// switch (tab.ToString())
-// {
-// case "Pawns":
-// pawnsTransfer.OnGUI(inRect2, out flag);
-// break;
-// case "Items":
-// itemsTransfer.OnGUI(inRect2, out flag);
-// break;
-// case "Config":
-// //There was an issue calling the private method DrawConfig, I forget why
-// AccessTools.Method(typeof(Dialog_FormCaravan), "DrawConfig")
-// .Invoke(__instance, new object[] {rect2});
-// break;
-// }
-// if (flag)
-// {
-// AccessTools.Method(typeof(Dialog_FormCaravan), "CountToTransferChanged")
-// .Invoke(__instance, new object[] { });
-// transferables = traverseobj.Field("transferables").GetValue>();
-// }
-// GUI.EndGroup();
-// return false;
-// }
-// return true;
-// }
-
- #endregion CaravanHandlingMethods
-
- #region TestMethods
-
- // RimWorld.Planet.CaravanMaker
- public static bool MakeCaravan_PreFix(ref Caravan __result, IEnumerable pawns, Faction faction,
- int startingTile, bool addToWorldPawnsIfNotAlready)
- {
- ////Log.Message("MC1");
- if (startingTile < 0 && addToWorldPawnsIfNotAlready)
- Log.Warning(
- "Tried to create a caravan but chose not to spawn a caravan but pass pawns to world. This can cause bugs because pawns can be discarded.");
-
- ////Log.Message("MC2");
-
- var tmpPawns = (List) AccessTools.Field(typeof(CaravanMaker), "tmpPawns").GetValue(null);
-
- tmpPawns.Clear();
- tmpPawns.AddRange(pawns);
- ////Log.Message("MC3");
-
- var caravan = (Caravan) WorldObjectMaker.MakeWorldObject(WorldObjectDefOf.Caravan);
- ////Log.Message("MC4");
-
- if (startingTile >= 0)
- {
- ////Log.Message("MC5a");
-
- caravan.Tile = startingTile;
- ////Log.Message("MC5b");
- }
- ////Log.Message("MC6");
-
- caravan.SetFaction(faction);
- ////Log.Message("MC7");
-
- caravan.Name = CaravanNameGenerator.GenerateCaravanName(caravan);
- ////Log.Message("MC8");
-
- if (startingTile >= 0)
- {
- ////Log.Message("MC9a");
-
- Find.WorldObjects.Add(caravan);
- ////Log.Message("MC9b");
- }
- for (var i = 0; i < tmpPawns.Count; i++)
- {
- ////Log.Message("MC10a");
-
- var pawn = tmpPawns[i];
- if (pawn.Spawned)
- {
- //Log.Message("MC11a");
-
- pawn.DeSpawn();
- //Log.Message("MC11b");
- }
- if (pawn.Dead)
- {
- Log.Warning("Tried to form a caravan with a dead pawn " + pawn);
- }
- else
- {
- //Log.Message("MC12a");
-
- caravan.AddPawn(pawn, addToWorldPawnsIfNotAlready);
- //Log.Message("MC12b");
-
- if (addToWorldPawnsIfNotAlready && !pawn.IsWorldPawn())
- {
- //Log.Message("MC13a");
-
- if (pawn.Spawned)
- pawn.DeSpawn();
- Find.WorldPawns.PassToWorld(pawn, PawnDiscardDecideMode.Decide);
- //Log.Message("MC13b");
- }
- //Log.Message("MC12c");
- }
- }
- __result = caravan;
- return false;
- }
-
-// // RimWorld.Planet.CaravanExitMapUtility
-// public static bool ExitMapAndCreateCaravan_Test(ref Caravan __result, IEnumerable pawns, Faction faction,
-// int startingTile)
-// {
-// //Log.Message("EMACC1");
-// if (!GenWorldClosest.TryFindClosestPassableTile(startingTile, out startingTile))
-// {
-// Log.Error("Could not find any passable tile for a new caravan.");
-// __result = null;
-// return false;
-// }
-// //Log.Message("EMACC2");
-//
-// var tmpPawns = (List) AccessTools.Field(typeof(CaravanExitMapUtility), "tmpPawns").GetValue(null);
-// //Log.Message("EMACC3");
-//
-// tmpPawns.Clear();
-// tmpPawns.AddRange(pawns);
-// //Log.Message("EMACC4");
-//
-// Map map = null;
-// for (var i = 0; i < tmpPawns.Count; i++)
-// {
-// map = tmpPawns[i].MapHeld;
-// if (map != null)
-// break;
-// }
-// //Log.Message("EMACC5");
-//
-// var caravan = CaravanMaker.MakeCaravan(tmpPawns, faction, startingTile, false);
-// //Log.Message("EMACC6");
-//
-// for (var j = 0; j < tmpPawns.Count; j++)
-// {
-// //Log.Message("EMACC7");
-//
-// tmpPawns[j].ExitMap(false);
-// //Log.Message("EMACC7b");
-// }
-// //Log.Message("EMACC8");
-//
-// var pawnsListForReading = caravan.PawnsListForReading;
-// //Log.Message("EMACC9");
-//
-// for (var k = 0; k < pawnsListForReading.Count; k++)
-// {
-// //Log.Message("EMACC10a");
-//
-// if (!pawnsListForReading[k].IsWorldPawn())
-// {
-// //Log.Message("EMACC10b");
-//
-// Find.WorldPawns.PassToWorld(pawnsListForReading[k], PawnDiscardDecideMode.Decide);
-// //Log.Message("EMACC10c");
-// }
-// }
-// if (map != null)
-// {
-// //Log.Message("EMACC11");
-//
-// map.info.parent.Notify_CaravanFormed(caravan);
-// //Log.Message("EMACC11b");
-// }
-// //Log.Message("EMACC12");
-//
-// __result = caravan;
-// return false;
-// }
-
-// // Verse.Pawn
-// public static bool ExitMap_Test(Pawn __instance, bool allowedToJoinOrCreateCaravan)
-// {
-// if (__instance?.GetComp() is CompVehicle compVehicle)
-// {
-// //Log.Message("ExitMap1");
-// if (__instance.IsWorldPawn())
-// {
-// Log.Warning("Called ExitMap() on world pawn " + __instance);
-// return false;
-// }
-// if (allowedToJoinOrCreateCaravan &&
-// CaravanExitMapUtility.CanExitMapAndJoinOrCreateCaravanNow(__instance))
-// {
-// //Log.Message("ExitMap2");
-//
-// CaravanExitMapUtility.ExitMapAndJoinOrCreateCaravan(__instance);
-// //Log.Message("ExitMap2b");
-//
-// return false;
-// }
-// var lord = __instance.GetLord();
-// //Log.Message("ExitMap3");
-//
-// if (lord != null)
-// {
-// //Log.Message("ExitMap3a");
-//
-// lord.Notify_PawnLost(__instance, PawnLostCondition.ExitedMap);
-// //Log.Message("ExitMap3b");
-// }
-// if (__instance.carryTracker != null && __instance.carryTracker.CarriedThing != null)
-// {
-// //Log.Message("ExitMap4");
-//
-// var carriedThing = __instance?.carryTracker?.CarriedThing;
-// //Log.Message("ExitMap4a");
-//
-// if (carriedThing is Pawn pawn)
-// {
-// //Log.Message("ExitMap4b");
-//
-// if (__instance.Faction != null && __instance.Faction != pawn.Faction)
-// {
-// //Log.Message("ExitMap4c");
-//
-// __instance.Faction.kidnapped.KidnapPawn(pawn, __instance);
-// //Log.Message("ExitMap4d");
-// }
-// else
-// {
-// //Log.Message("ExitMap4e");
-//
-// __instance.carryTracker.innerContainer.Remove(pawn);
-// //Log.Message("ExitMap4f");
-//
-// pawn.ExitMap(false);
-// //Log.Message("ExitMap4g");
-// }
-// }
-// else
-// {
-// //Log.Message("ExitMap4h");
-//
-// __instance.carryTracker.CarriedThing.Destroy(DestroyMode.Vanish);
-// }
-// //Log.Message("ExitMap4i");
-//
-// __instance.carryTracker.innerContainer.Clear();
-// }
-// //Log.Message("ExitMap5");
-//
-// var flag = !__instance.IsCaravanMember() &&
-// !PawnUtility.IsTravelingInTransportPodWorldObject(__instance);
-// //Log.Message("ExitMap5a");
-//
-// if (flag && __instance.HostFaction != null && __instance.guest != null &&
-// (__instance.guest.Released || !__instance.IsPrisoner) && !__instance.InMentalState &&
-// __instance.health.hediffSet.BleedRateTotal < 0.001f && __instance.Faction.def.appreciative &&
-// !__instance.Faction.def.hidden)
-// {
-// //Log.Message("ExitMap6");
-//
-// var num = 15f;
-// if (PawnUtility.IsFactionLeader(__instance))
-// num += 50f;
-// Messages.Message(
-// "MessagePawnExitMapRelationsGain".Translate(__instance.LabelShort, __instance.Faction.Name,
-// num.ToString("F0")), MessageTypeDefOf.PositiveEvent);
-// __instance.Faction.AffectGoodwillWith(__instance.HostFaction, num);
-// }
-// if (__instance.ownership != null)
-// {
-// //Log.Message("ExitMap7");
-//
-// __instance.ownership.UnclaimAll();
-// //Log.Message("ExitMap7b");
-// }
-// if (__instance.guest != null && flag)
-// {
-// //Log.Message("ExitMap8a");
-//
-// __instance.guest.SetGuestStatus(null, false);
-// //Log.Message("ExitMap8b");
-// }
-// if (__instance.Spawned)
-// {
-// //Log.Message("ExitMap9a");
-//
-// __instance.DeSpawn();
-// //Log.Message("ExitMap9b");
-// }
-// __instance.inventory.UnloadEverything = false;
-// //Log.Message("ExitMap10");
-//
-// __instance.ClearMind(false);
-// //Log.Message("ExitMap11");
-//
-// __instance.ClearAllReservations(true);
-// //Log.Message("ExitMap12");
-//
-// Find.WorldPawns.PassToWorld(__instance, PawnDiscardDecideMode.Decide);
-// //Log.Message("ExitMap13");
-//
-// return false;
-// }
-// return true;
-// }
- public static bool GetVerbsCommands_PreFix(VerbTracker __instance, ref IEnumerable __result,
- KeyCode hotKey = 0)
- {
- __result = GetVerbsCommands(__instance);
- return false;
- }
-
- public static IEnumerable GetVerbsCommands(VerbTracker __instance)
- {
- if (__instance.directOwner is CompEquippable ce)
- {
- Thing ownerThing = ce.parent;
- if (ownerThing?.def != null)
- {
- List verbs = __instance.AllVerbs;
- foreach (Verb verb in verbs)
- {
- if (verb != null && verb.verbProps.hasStandardCommand && verb.CasterPawn != null &&
- (!verb.CasterIsPawn || verb.CasterPawn.story != null))
- {
- yield return (Verse.Command) AccessTools
- .Method(typeof(VerbTracker), "CreateVerbTargetCommand")
- .Invoke(__instance, new object[] {ownerThing, verb});
- }
- }
-
- var meleeAttack = verbs.FirstOrDefault(x => x.verbProps.IsMeleeAttack);
- if (!__instance.directOwner.Tools.NullOrEmpty() && ce.parent.def.IsMeleeWeapon
- && meleeAttack?.CasterPawn != null && (!meleeAttack.CasterIsPawn || meleeAttack.CasterPawn.story != null))
- {
- yield return (Verse.Command)AccessTools
- .Method(typeof(VerbTracker), "CreateVerbTargetCommand")
- .Invoke(__instance, new object[] { ownerThing, meleeAttack });
- }
- }
- }
- }
-
- #endregion TestMethods
-
- // RimWorld.RestUtility
- //public static bool DrawMedOperationsTab(Rect leftRect, Pawn pawn, Thing thingForMedBills, float curY, ref float __result)
- //{
- // curY += 2f;
- // Func> recipeOptionsMaker = delegate
- // {
- // List list = new List();
- // foreach (RecipeDef current in thingForMedBills.def.AllRecipes)
- // {
- // if (current.AvailableNow)
- // {
- // IEnumerable enumerable = current.PotentiallyMissingIngredients(null, thingForMedBills.Map);
- // if (!enumerable.Any((ThingDef x) => x.isBodyPartOrImplant))
- // {
- // if (!enumerable.Any((ThingDef x) => x.IsDrug))
- // {
- // if (current.targetsBodyPart)
- // {
- // foreach (BodyPartRecord current2 in current.Worker.GetPartsToApplyOn(pawn, current))
- // {
- // list.Add((FloatMenuOption)AccessTools.Method(typeof(HealthCardUtility), "GenerateSurgeryOption").Invoke(null, new object[] { pawn, thingForMedBills, current, enumerable, current2 }));
- // }
- // }
- // else
- // {
- // list.Add((FloatMenuOption)AccessTools.Method(typeof(HealthCardUtility), "GenerateSurgeryOption").Invoke(null, new object[] { pawn, thingForMedBills, current, enumerable, null }));
- // }
- // }
- // }
- // }
- // }
- // return list;
- // };
- // Rect rect = new Rect(leftRect.x - 9f, curY, leftRect.width, leftRect.height - curY - 20f);
- // ((IBillGiver)thingForMedBills).BillStack.DoListing(rect, recipeOptionsMaker, ref HealthCardUtility.billsScrollPosition, ref HealthCardUtility.billsScrollHeight);
- // return curY;
- //}
-
- #region SwenzisPrivateMethods
-
- // ------- Additions Made By Swenzi --------
- // ------- Private Methods --------
-
-
- private static int CalculatedCostAt(IntVec3 c, bool perceivedStatic, IntVec3 prevCell,
- Pawn_PathFollower __instance, VehicleType type, Pawn pawn)
- {
- int num = 0;
- TerrainDef terrainDef = pawn.Map.terrainGrid.TerrainAt(c);
- if (type == VehicleType.Sea || type == VehicleType.SeaSubmarine)
- {
- if (terrainDef == null || !terrainDef.defName.Contains("Water"))
- {
- num = 10000;
- }
- else
- {
- num += 1;
- }
- }
- else if (type == VehicleType.Amphibious)
- {
- if (terrainDef == null || (terrainDef.passability == Traversability.Impassable &&
- !terrainDef.defName.Contains("Water")))
- {
- num = 10000;
- }
- else
- {
- num += 1;
- }
- }
- else
- {
- if (terrainDef == null || terrainDef.passability == Traversability.Impassable)
- {
- num = 10000;
- }
- else
- {
- num += terrainDef.pathCost;
- }
- }
-
-
- int num2 = SnowUtility.MovementTicksAddOn(pawn.Map.snowGrid.GetCategory(c));
- num += num2;
- List list = pawn.Map.thingGrid.ThingsListAt(c);
- for (int i = 0; i < list.Count; i++)
- {
- Thing thing = list[i];
- if (thing.def.passability == Traversability.Impassable)
- {
- return 10000;
- }
- if (!IsPathCostIgnoreRepeater(thing.def) || !prevCell.IsValid ||
- !ContainsPathCostIgnoreRepeater(prevCell, pawn))
- {
- num += thing.def.pathCost;
- }
- if (prevCell.IsValid && thing is Building_Door)
- {
- Building edifice = prevCell.GetEdifice(pawn.Map);
- if (edifice != null && edifice is Building_Door)
- {
- num += 45;
- }
- }
- }
- if (perceivedStatic)
- {
- for (int j = 0; j < 9; j++)
- {
- IntVec3 b = GenAdj.AdjacentCellsAndInside[j];
- IntVec3 c2 = c + b;
- if (c2.InBounds(pawn.Map))
- {
- Fire fire = null;
- list = pawn.Map.thingGrid.ThingsListAtFast(c2);
- for (int k = 0; k < list.Count; k++)
- {
- fire = (list[k] as Fire);
- if (fire != null)
- {
- break;
- }
- }
- if (fire != null && fire.parent == null)
- {
- if (b.x == 0 && b.z == 0)
- {
- num += 1000;
- }
- else
- {
- num += 150;
- }
- }
- }
- }
- }
- return num;
- }
-
- private static bool IsPathCostIgnoreRepeater(ThingDef def)
- {
- return def.pathCost >= 25 && def.pathCostIgnoreRepeat;
- }
-
- private static bool ContainsPathCostIgnoreRepeater(IntVec3 c, Pawn pawn)
- {
- List list = pawn.Map.thingGrid.ThingsListAt(c);
- for (int i = 0; i < list.Count; i++)
- {
- if (IsPathCostIgnoreRepeater(list[i].def))
- {
- return true;
- }
- }
- return false;
- }
-
- //Purpose: Find fuel for the vehicle
- //Corresponding Patch Class: RimWorld.Planet.CaravanPawnsNeedsUtility
- //Corresponding Patch Method: TrySatisfyPawnNeeds_PreFix
- //Improvements: None I can think of
- private static bool TryGetFuel(Caravan caravan, Pawn forPawn, CompRefuelable refuelable, out Thing fuel,
- out Pawn owner)
- {
- //Find fuel for the vehicle by looking through all items
- var list = CaravanInventoryUtility.AllInventoryItems(caravan);
-
- //Get acceptable fuel items
- var filter = refuelable.Props.fuelFilter;
- for (var i = 0; i < list.Count; i++)
- {
- //If the thing found is an acceptable fuel source
- var thing2 = list[i];
- if (filter.Allows(thing2))
- {
- fuel = thing2;
- owner = CaravanInventoryUtility.GetOwnerOf(caravan, thing2);
- //Reset the spammer preventer since the vehicle now has fuel
- forPawn.GetComp().WarnedOnNoFuel = false;
- return true;
- }
- }
- fuel = null;
- owner = null;
- //Couldn't find a fuel source, check if vehicle is out of fuel
- if (!forPawn.GetComp().HasFuel)
- if (forPawn.GetComp().WarnedOnNoFuel == false)
- {
- //Notify player that caravan is out of fuel
- Messages.Message("MessageCaravanRunOutOfFuel".Translate(caravan.LabelCap, forPawn.Label), caravan,
- MessageTypeDefOf.ThreatBig);
- //No more spam
- forPawn.GetComp().WarnedOnNoFuel = true;
- }
- return false;
- }
-
- //Purpose: Check if anything in the caravan is out of fuel
- //Corresponding Patch Class: RimWorld.Planet.CaravanPawnsNeedsUtility
- //Corresponding Patch Method: TrySatisfyPawnNeeds_PreFix
- private static bool AnythingOutOfFuel(Caravan caravan)
- {
- if (AnythingNeedsFuel(caravan, out var needfuel))
- if (needfuel != null)
- for (var i = 0; i < needfuel.Count; i++)
- if (!needfuel[i].GetComp().HasFuel)
- return true;
- return false;
- }
-
- //Purpose: Check if anything in the caravan needs fuel and adds to a list
- //Corresponding Patch Class: RimWorld.Planet.CaravanPawnsNeedsUtility
- //Corresponding Patch Method: TrySatisfyPawnNeeds_PreFix
- private static bool AnythingNeedsFuel(Caravan caravan, out List needfuel)
- {
- var pawns = caravan.PawnsListForReading;
- needfuel = new List();
- if (pawns != null)
- for (var i = 0; i < pawns.Count; i++)
- if (pawns[i].GetComp() != null)
- needfuel.Add(pawns[i]);
- if (needfuel.Count > 0)
- return true;
- return false;
- }
-
- //Purpose: Calculate the amount of fuel left in the caravan
- //Corresponding Patch Class: RimWorld.Planet.Caravan
- //Corresponding Patch Method: GetInspectString_PostFix
- //Algorithm Explanation:
- //Assemble a list of ThingDefs that are acceptable fuel sources
- //Assemble the total fuel usage of all things in the caravan
- //Iterate through the caravan's items to find acceptable fuel sources
- //Grab the stack count of acceptable fuel items
- //Divide stack count by fuel usage
- //Improvements: Better ratios instead of 1 to 1 for fuel source refuel?
- private static float ApproxDaysWorthOfFuel(List pawns, IEnumerable goods)
- {
- var supplies = 0f;
- float totalFuelUse = 0;
- var allowed = new List();
- for (var i = 0; i < pawns.Count; i++)
- {
- var refuel = pawns[i].GetComp