diff --git a/Logistics/About/About.xml b/Logistics/About/About.xml deleted file mode 100644 index f67865c..0000000 --- a/Logistics/About/About.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - Logistics - Oblitus - 0.18.1722 - Configurable world map travel time factors. - https://ludeon.com/forums/index.php?topic=34628 - \ No newline at end of file diff --git a/Logistics/About/Preview.png b/Logistics/About/Preview.png deleted file mode 100644 index c7de83e..0000000 Binary files a/Logistics/About/Preview.png and /dev/null differ diff --git a/Logistics/About/PublishedFileId.txt b/Logistics/About/PublishedFileId.txt deleted file mode 100644 index 30c8d3d..0000000 --- a/Logistics/About/PublishedFileId.txt +++ /dev/null @@ -1 +0,0 @@ -1389234585 \ No newline at end of file diff --git a/Logistics/Assemblies/0Harmony.dll b/Logistics/Assemblies/0Harmony.dll deleted file mode 100644 index a95b6df..0000000 Binary files a/Logistics/Assemblies/0Harmony.dll and /dev/null differ diff --git a/Logistics/Assemblies/Logistics.dll b/Logistics/Assemblies/Logistics.dll deleted file mode 100644 index b28b33f..0000000 Binary files a/Logistics/Assemblies/Logistics.dll and /dev/null differ diff --git a/Logistics/Languages/English/Keyed/Interface.xml b/Logistics/Languages/English/Keyed/Interface.xml deleted file mode 100644 index 002e2e8..0000000 --- a/Logistics/Languages/English/Keyed/Interface.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - Logistics - Bypass terrain cost on friendly settlements - Settlement is considered friendly if you can visit it. Player-controlled settlements are always friendly. - Suppress winter penaly on tiles without snow - Winter penalty will be applied only for tiles with negative temperature. - Biome-added movement time factor. Current value: {0}. - Hillness-added movement time factor. Current value: {0}. - - diff --git a/Logistics/Languages/Russian/Keyed/Interface.xml b/Logistics/Languages/Russian/Keyed/Interface.xml deleted file mode 100644 index e8b4015..0000000 --- a/Logistics/Languages/Russian/Keyed/Interface.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - Логистика - Игнорировать штрафы в дружественных поселениях - Поселение считается дружественным если его можно посетить. Поселения игрока всегда дружественные. - Игнорировать штраф за зиму там, где нет снега - Штраф будет применяться только если на клетке отрицательная температура. - Модификатор штрафа за биом. Текущее значение: {0}. - Модификатор штрафа за рельеф. Текущее значение: {0}. - - diff --git a/Logistics/Source/Logistics.sln b/Logistics/Source/Logistics.sln deleted file mode 100644 index 58aaf6b..0000000 --- a/Logistics/Source/Logistics.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.6 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logistics", "Logistics\Logistics.csproj", "{674B538C-8A9D-4D0C-BE86-D3F5F79CCDCE}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {674B538C-8A9D-4D0C-BE86-D3F5F79CCDCE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {674B538C-8A9D-4D0C-BE86-D3F5F79CCDCE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {674B538C-8A9D-4D0C-BE86-D3F5F79CCDCE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {674B538C-8A9D-4D0C-BE86-D3F5F79CCDCE}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Logistics/Source/Logistics/Logistics.cs b/Logistics/Source/Logistics/Logistics.cs deleted file mode 100644 index 15a5f1c..0000000 --- a/Logistics/Source/Logistics/Logistics.cs +++ /dev/null @@ -1,126 +0,0 @@ -using Harmony; -using RimWorld; -using RimWorld.Planet; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Reflection.Emit; -using UnityEngine; -using Verse; - -namespace Logistics -{ - [StaticConstructorOnStartup] - class Logistics : Mod - { -#pragma warning disable 0649 - public static Settings Settings; -#pragma warning restore 0649 - - public Logistics(ModContentPack content) : base(content) - { - var harmony = HarmonyInstance.Create("net.quicksilverfox.rimworld.mod.logistics"); - harmony.PatchAll(Assembly.GetExecutingAssembly()); - base.GetSettings(); - } - - public void Save() - { - LoadedModManager.GetMod().GetSettings().Write(); - } - - public override string SettingsCategory() - { - return "Logistics".Translate(); - } - - public override void DoSettingsWindowContents(Rect inRect) - { - Settings.DoSettingsWindowContents(inRect); - } - } - - [HarmonyPatch(typeof(WorldPathGrid), "CalculatedCostAt", new Type[] { typeof(int), typeof(bool), typeof(float) })] - static class WorldPathGrid_CalculatedCostAt_Patch - { - static IEnumerable Transpiler(IEnumerable instructions) - { - var codes = new List(instructions); - - // injecting some code to store if yearPercent was -1 when passed to function, it is a dirty way to do so, but since game is single-threaded it would work - codes.InsertRange(0, new List() { - new CodeInstruction(OpCodes.Ldarg_2), // push original value of yearPercent to stack - new CodeInstruction(OpCodes.Call, typeof(WorldPathGrid_CalculatedCostAt_Patch).GetMethod(nameof(StoreOriginalYearPercent))), - }); - - // injecting actual code - MethodInfo CostFromTileHilliness = typeof(WorldPathGrid).GetMethod("CostFromTileHilliness", AccessTools.all); - for (int i = 0; i < codes.Count; i++) - { - // IL_00e1: call int32 RimWorld.Planet.WorldPathGrid::CostFromTileHilliness(valuetype RimWorld.Planet.Hilliness) - if (codes[i].opcode == OpCodes.Call && codes[i].operand == CostFromTileHilliness) - { - codes.RemoveAt(i + 1); // removes [add] - codes.InsertRange(i + 1, new List() { - // biomeCost already on stack - // hillnessCost already on stack - new CodeInstruction(OpCodes.Ldarg_0), // push tile id to stack - new CodeInstruction(OpCodes.Call, typeof(WorldPathGrid_CalculatedCostAt_Patch).GetMethod(nameof(CheckSnowAndSettlementMods))) - // now corrected value is on stack - }); - - break; - } - } - - return codes.AsEnumerable(); - } - - private static bool CurrentTime; - public static void StoreOriginalYearPercent(float yearPercent) - { - CurrentTime = yearPercent == -1f; - } - - public static int CheckSnowAndSettlementMods(int biomeCost, int hillnessCost, int tile) - { - // no snow - no seasonal penalty - if (CurrentTime && Settings.snow_mod && GenTemperature.GetTemperatureAtTile(tile) > 0) - biomeCost = Find.WorldGrid[tile].biome.pathCost_summer; - - biomeCost = (int)(biomeCost * Settings.biome_time_modifier); - hillnessCost = (int)(hillnessCost * Settings.hillness_time_modifier); - - // check settlement factor - if (Settings.settlement_mod) - return GetSettlementMoveModifier(tile, biomeCost + hillnessCost); - - return biomeCost + hillnessCost; - } - - // Even non-friendly settlement has some roads and you can use them. - public static int GetSettlementMoveModifier(int tile, int calculatedCost) - { - Settlement settlement = Find.WorldObjects.SettlementAt(tile); - - if (Faction.OfPlayerSilentFail == null) // map generation stage - no change - return calculatedCost; - - if (settlement != null && (settlement.Faction == Faction.OfPlayerSilentFail || settlement.Visitable)) - return 0; // Friendly or player-controlled settlements ignore all terrain costs. Home, sweet home! - - float mod = 1f; - - if (settlement != null) - mod = Math.Min(0.5f, mod); // hostile settlements have half cost - - // Due to how settlements are handled, this stuff is very CPU-heavy. Cut out for now. - //else if (Find.WorldObjects.AnySettlementAtOrAdjacent(tile)) - //{ - // mod = Math.Min(0.35f, mod); - //} - return (int)(calculatedCost * mod); - } - } -} diff --git a/Logistics/Source/Logistics/Logistics.csproj b/Logistics/Source/Logistics/Logistics.csproj deleted file mode 100644 index ddce6ee..0000000 --- a/Logistics/Source/Logistics/Logistics.csproj +++ /dev/null @@ -1,60 +0,0 @@ - - - - - Debug - AnyCPU - {674B538C-8A9D-4D0C-BE86-D3F5F79CCDCE} - Library - Properties - Logistics - Logistics - v3.5 - 512 - - - - false - none - false - ..\..\Assemblies\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\0Harmony.dll - - - ..\..\..\..\..\..\Games\SteamLibrary\steamapps\common\RimWorld\RimWorldWin_Data\Managed\Assembly-CSharp.dll - False - - - - - - - - - - - ..\..\..\..\..\..\Games\SteamLibrary\steamapps\common\RimWorld\RimWorldWin_Data\Managed\UnityEngine.dll - False - - - - - - - - - \ No newline at end of file diff --git a/Logistics/Source/Logistics/Properties/AssemblyInfo.cs b/Logistics/Source/Logistics/Properties/AssemblyInfo.cs deleted file mode 100644 index 5d5363e..0000000 --- a/Logistics/Source/Logistics/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -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("Logistics")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Quicksilver Fox")] -[assembly: AssemblyProduct("Logistics")] -[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("8291e735-b47a-40ea-ba33-dcf54e334090")] - -// 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.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Logistics/Source/Logistics/Settings.cs b/Logistics/Source/Logistics/Settings.cs deleted file mode 100644 index c76d720..0000000 --- a/Logistics/Source/Logistics/Settings.cs +++ /dev/null @@ -1,40 +0,0 @@ -using UnityEngine; -using Verse; -using System; - -namespace Logistics -{ - class Settings : ModSettings - { - public static bool settlement_mod = true; - public static bool snow_mod = true; - public static float biome_time_modifier = 1f; - public static float hillness_time_modifier = 1f; - - public static void DoSettingsWindowContents(Rect inRect) - { - Listing_Standard listing_Standard = new Listing_Standard(); - listing_Standard.Begin(inRect); - - listing_Standard.CheckboxLabeled("SettlementModLabel".Translate(), ref settlement_mod, "SettlementModTooltip".Translate()); - listing_Standard.CheckboxLabeled("WinterModLabel".Translate(), ref snow_mod, "WinterModTooltip".Translate()); - - listing_Standard.Label("BiomeModLabel".Translate(((float)Math.Round(biome_time_modifier, 2)).ToStringPercent())); - biome_time_modifier = listing_Standard.Slider((float)Math.Round(biome_time_modifier, 2), 0f, 2f); - - listing_Standard.Label("HillnessModLabel".Translate(((float)Math.Round(hillness_time_modifier, 2)).ToStringPercent())); - hillness_time_modifier = listing_Standard.Slider((float)Math.Round(hillness_time_modifier, 2), 0f, 2f); - - listing_Standard.End(); - } - - public override void ExposeData() - { - base.ExposeData(); - Scribe_Values.Look(ref settlement_mod, "settlement_mod", true, false); - Scribe_Values.Look(ref snow_mod, "snow_mod", true, false); - Scribe_Values.Look(ref biome_time_modifier, "biome_time_modifier", 1f, false); - Scribe_Values.Look(ref hillness_time_modifier, "hillness_time_modifier", 1f, false); - } - } -}