diff --git a/BepInEx_x64_5.4.21.0/changelog.txt b/BepInEx_x64_5.4.21.0/changelog.txt deleted file mode 100644 index 36308c6..0000000 --- a/BepInEx_x64_5.4.21.0/changelog.txt +++ /dev/null @@ -1,7 +0,0 @@ -4 commits since v5.4.20 - -Changelog (excluding merges): -* (0d06996) [ghorsington] UnityInput: revert to null input in case of total failure -* (ea709e2) [ghorsington] Bump version -* (806d6d2) [ghorsington] UnityInput: remove hard dependency on Unity.InputManager (fixes #446) -* (a79d657) [ghorsington] UnityInput: Reformat, fix LegacyInputSystemAvailable not being static \ No newline at end of file diff --git a/BepInEx_x64_5.4.21.0/doorstop_config.ini b/BepInEx_x64_5.4.21.0/doorstop_config.ini deleted file mode 100644 index a68f30f..0000000 --- a/BepInEx_x64_5.4.21.0/doorstop_config.ini +++ /dev/null @@ -1,16 +0,0 @@ -[UnityDoorstop] -# Specifies whether assembly executing is enabled -enabled=true -# Specifies the path (absolute, or relative to the game's exe) to the DLL/EXE that should be executed by Doorstop -targetAssembly=BepInEx\core\BepInEx.Preloader.dll -# Specifies whether Unity's output log should be redirected to \output_log.txt -redirectOutputLog=false -# If enabled, DOORSTOP_DISABLE env var value is ignored -# USE THIS ONLY WHEN ASKED TO OR YOU KNOW WHAT THIS MEANS -ignoreDisableSwitch=false -# Overrides default Mono DLL search path -# Sometimes it is needed to instruct Mono to seek its assemblies from a different path -# (e.g. mscorlib is stripped in original game) -# This option causes Mono to seek mscorlib and core libraries from a different folder before Managed -# Original Managed folder is added as a secondary folder in the search path -dllSearchPathOverride= \ No newline at end of file diff --git a/BepInEx_x64_5.4.21.0/winhttp.dll b/BepInEx_x64_5.4.21.0/winhttp.dll deleted file mode 100644 index bdf9c79..0000000 Binary files a/BepInEx_x64_5.4.21.0/winhttp.dll and /dev/null differ diff --git a/Projects/CaptainOfIndustry/Bepinex b/Projects/CaptainOfIndustry/Bepinex new file mode 120000 index 0000000..71db3fe --- /dev/null +++ b/Projects/CaptainOfIndustry/Bepinex @@ -0,0 +1 @@ +C:/Program Files (x86)/Steam/steamapps/common/Captain of Industry/BepInex \ No newline at end of file diff --git a/Projects/CaptainOfIndustry/CaptainOfIndustry.sln b/Projects/CaptainOfIndustry/CaptainOfIndustry.sln new file mode 100644 index 0000000..850345b --- /dev/null +++ b/Projects/CaptainOfIndustry/CaptainOfIndustry.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainOfIndustry", "CaptainOfIndustry\CaptainOfIndustry.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Projects/CaptainOfIndustry/CaptainOfIndustry.sln.DotSettings.user b/Projects/CaptainOfIndustry/CaptainOfIndustry.sln.DotSettings.user new file mode 100644 index 0000000..85bd2d3 --- /dev/null +++ b/Projects/CaptainOfIndustry/CaptainOfIndustry.sln.DotSettings.user @@ -0,0 +1,21 @@ + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + <AssemblyExplorer /> + C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe + 262144 \ No newline at end of file diff --git a/Projects/CaptainOfIndustry/CaptainOfIndustry/CaptainOfIndustry.csproj b/Projects/CaptainOfIndustry/CaptainOfIndustry/CaptainOfIndustry.csproj index 0da504f..e3242b9 100644 --- a/Projects/CaptainOfIndustry/CaptainOfIndustry/CaptainOfIndustry.csproj +++ b/Projects/CaptainOfIndustry/CaptainOfIndustry/CaptainOfIndustry.csproj @@ -7,7 +7,7 @@ {EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE} Library Properties - TerraTech + CaptainOfIndustry CaptainOfIndustry v4.8 512 @@ -32,20 +32,9 @@ 4 - - - - - - - - - - - @@ -60,6 +49,21 @@ ..\libs\ConfigurationManager.dll + + ..\libs\Mafi.dll + + + ..\libs\Mafi.Base.dll + + + ..\libs\Mafi.Core.dll + + + ..\libs\Mafi.ModsAuthoringSupport.dll + + + ..\libs\Mafi.Unity.dll + ..\libs\UnityEngine.dll diff --git a/Projects/CaptainOfIndustry/CaptainOfIndustry/Class1.cs b/Projects/CaptainOfIndustry/CaptainOfIndustry/Class1.cs new file mode 100644 index 0000000..25b6756 --- /dev/null +++ b/Projects/CaptainOfIndustry/CaptainOfIndustry/Class1.cs @@ -0,0 +1,55 @@ +using System.Linq; +using BepInEx; +using BepInEx.Configuration; +using HarmonyLib; +using HarmonyLib.Tools; + +// TODO: Make shield and repair bigger +// TODO: Maybe make props faster, thrusters work fine + +namespace CaptainOfIndustry { + [BepInPlugin(pluginGuid, pluginName, pluginVersion)] + public class Main : BaseUnityPlugin { + private const string pluginGuid = "CykaMod"; + private const string pluginName = "CykaMod"; + private const string pluginVersion = "1.0.0"; + + public static ConfigEntry excavatorCapacityMultiplier; + public static ConfigEntry truckCapacityMultiplier; + public static ConfigEntry cargoShipCapacityMultiplier; + public static ConfigEntry excavatorMiningAreaMultiplier; + public static ConfigEntry vehicleSpeedMultiplier; + + public void Awake() { + excavatorCapacityMultiplier = Config.Bind("General", "Excavator Capacity Multiplier", 1, new ConfigDescription("Excavator Capacity Multiplier")); + truckCapacityMultiplier = Config.Bind("General", "Truck Capacity Multiplier", 1, new ConfigDescription("Truck Capacity Multiplier")); + cargoShipCapacityMultiplier = Config.Bind("General", "Cargo Ship Capacity Multiplier", 1, new ConfigDescription("Cargo Ship Capacity Multiplier")); + excavatorMiningAreaMultiplier = Config.Bind("General", "Excavator Mining Area Multiplier", 1f, new ConfigDescription("Excavator Mining Area Multiplier")); + vehicleSpeedMultiplier = Config.Bind("General", "Vehicle Speed Multiplier", 1f, new ConfigDescription("Vehicle Speed Multiplier")); + + // shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch(); + // energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch(); + // magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch(); + // magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch(); + // beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch(); + // beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch(); + // fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch(); + // fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch(); + // wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch(); + // wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch(); + // jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch(); + // minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch(); + // minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch(); + // wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); + // wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); + // wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); + + Logger.LogInfo("Cyka mod loaded"); + HarmonyFileLog.Enabled = true; + Harmony harmony = new Harmony(pluginGuid); + harmony.PatchAll(); + var originalMethods = harmony.GetPatchedMethods(); + // Logger.LogInfo("Patched " + originalMethods.Count() + " methods"); + } + } +} diff --git a/Projects/CaptainOfIndustry/CaptainOfIndustry/Patches.cs b/Projects/CaptainOfIndustry/CaptainOfIndustry/Patches.cs new file mode 100644 index 0000000..33736d5 --- /dev/null +++ b/Projects/CaptainOfIndustry/CaptainOfIndustry/Patches.cs @@ -0,0 +1,101 @@ +using System; +using System.Reflection; +using HarmonyLib; +using Mafi; +using Mafi.Core.Buildings.Cargo.Ships.Modules; +using Mafi.Core.Entities.Dynamic; +using Mafi.Core.Products; +using Mafi.Core.Prototypes; + +namespace CaptainOfIndustry { + [HarmonyPatch] + public class Patches { + private static Traverse maxForwardsSpeedField; + + [HarmonyPrefix] + [HarmonyPatch(typeof(ExcavatorProtoBuilder.ExcavatorProtoBuilderState), "SetCapacity")] + static void excavatorCapacityMultiplier(ref int quantity) { + Console.WriteLine("IndustrialCyka: Old excavator capacity: {0}", quantity); + quantity *= Main.excavatorCapacityMultiplier.Value; + Console.WriteLine("IndustrialCyka: Old excavator capacity: {0}", quantity); + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(TruckProtoBuilder.TruckProtoBuilderState), "SetCapacity")] + static void truckCapacityMultiplier(ref int quantity) { + Console.WriteLine("IndustrialCyka: Old truck capacity: {0}", quantity); + quantity *= Main.truckCapacityMultiplier.Value; + Console.WriteLine("IndustrialCyka: New truck capacity: {0}", quantity); + } + + [HarmonyPostfix] + [HarmonyPatch(typeof(CargoShipModuleProto), MethodType.Constructor, + new[] { + typeof(Proto.ID), typeof(Proto.Str), typeof(ProductType), typeof(Quantity), + typeof(CargoShipModuleProto.Gfx) + })] + static void cargoShipCapacityMultiplier(CargoShipModuleProto __instance) { + Console.WriteLine("IndustrialCyka: Old ship capacity: {0}", __instance.Capacity.Value); + __instance.Capacity = new Quantity(__instance.Capacity.Value * Main.cargoShipCapacityMultiplier.Value); + Console.WriteLine("IndustrialCyka: New ship capacity: {0}", __instance.Capacity.Value); + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(ExcavatorProtoBuilder.ExcavatorProtoBuilderState), "SetMinedThicknessByDistanceMeters")] + static void excavatorMiningAreaMultiplier(ref float[] thicknessMeters) { + for (int i = 0; i < thicknessMeters.Length; i++) { + Console.WriteLine("IndustrialCyka: Old mining area: {0}", thicknessMeters[i]); + thicknessMeters[i] *= Main.excavatorMiningAreaMultiplier.Value; + Console.WriteLine("IndustrialCyka: New mining area: {0}", thicknessMeters[i]); + } + } + + // No workey... idk how it's supposed to work, speed is always 1 or 100% + // [HarmonyPrefix] + // [HarmonyPatch(typeof(DrivingEntity), "SetSpeedFactor")] + // static void vehicleSpeedMultiplier(ref Percent speedFactor) { + // Console.WriteLine("IndustrialCyka: Old speed: {0}", speedFactor.ToString()); + // // typeof(Percent) + // // .GetField("RawValue",BindingFlags.Instance|BindingFlags.NonPublic) + // // .SetValue(speedFactor,speedFactor.ToFloat() / Main.vehicleSpeedMultiplier.Value); + // Percent newSpeedFactor = Percent.FromFloat(speedFactor.ToFloat() / Main.vehicleSpeedMultiplier.Value); + // speedFactor = newSpeedFactor; + // Console.WriteLine("IndustrialCyka: New speed: {1}", newSpeedFactor.RawValue.ToString()); + // } + + [HarmonyPostfix] + [HarmonyPatch(typeof(SmoothDriver), "SetSpeedFactor")] + static void vehicleSpeedMultiplier(SmoothDriver __instance) { + Fix32 speedMulti = Fix32.FromFloat(Main.vehicleSpeedMultiplier.Value); + + Traverse traverse = Traverse.Create(__instance); + Traverse maxForwardsSpeedField = traverse.Field("m_maxForwardsSpeed"); + Traverse maxBackwardsSpeedField = traverse.Field("m_maxBackwardsSpeed"); + Traverse maxAccelerationField = traverse.Field("m_maxAcceleration"); + + Console.WriteLine("IndustrialCyka: Old speeds: (F) {0}, (B) {1}, (A) {2}", maxForwardsSpeedField.GetValue(), maxBackwardsSpeedField.GetValue(), maxAccelerationField.GetValue()); + + maxForwardsSpeedField.SetValue((Fix32) maxForwardsSpeedField.GetValue() * speedMulti); + maxBackwardsSpeedField.SetValue((Fix32) maxBackwardsSpeedField.GetValue() * speedMulti); + maxAccelerationField.SetValue((Fix32) maxAccelerationField.GetValue() * speedMulti); + + Console.WriteLine("IndustrialCyka: New speeds: (F) {0}, (B) {1}, (A) {2}", maxForwardsSpeedField.GetValue(), maxBackwardsSpeedField.GetValue(), maxAccelerationField.GetValue()); + } + // this.m_maxForwardsSpeed = speedFactor.Apply(this.m_maxForwardsSpeedBase); + // this.m_maxBackwardsSpeed = speedFactor.Apply(this.m_maxBackwardsSpeedBase); + // this.m_maxAcceleration = speedFactor.Apply(this.m_maxAccelerationBase); + + + // [HarmonyPrefix] + // [HarmonyPatch(typeof(ManPlayer), "AddMoney")] + // static void MoneyMulti(ref int amount) { + // amount = (int)(amount * Main.moneyMultiplier.Value); + // } + // + // [HarmonyPrefix] + // [HarmonyPatch(typeof(TechHolders), "SetHeartbeatInterval")] + // static void HeartbeatMulti(ref float interval) { + // interval *= Main.heartbeatIntervalMultiplier.Value; + // } + } +} diff --git a/Projects/CaptainOfIndustry/CaptainOfIndustry/Properties/AssemblyInfo.cs b/Projects/CaptainOfIndustry/CaptainOfIndustry/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f966ba7 --- /dev/null +++ b/Projects/CaptainOfIndustry/CaptainOfIndustry/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +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("CaptainOfIndustry")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CaptainOfIndustry")] +[assembly: AssemblyCopyright("Copyright © 2023")] +[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("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")] + +// 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/Projects/CaptainOfIndustry/TerraTech.sln.DotSettings.user b/Projects/CaptainOfIndustry/TerraTech.sln.DotSettings.user new file mode 100644 index 0000000..bad6624 --- /dev/null +++ b/Projects/CaptainOfIndustry/TerraTech.sln.DotSettings.user @@ -0,0 +1,11 @@ + + True + True + True + True + True + True + <AssemblyExplorer /> + C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe + 262144 + \ No newline at end of file diff --git a/Projects/CaptainOfIndustry/deploy.sh b/Projects/CaptainOfIndustry/deploy.sh new file mode 100644 index 0000000..95fd4ba --- /dev/null +++ b/Projects/CaptainOfIndustry/deploy.sh @@ -0,0 +1 @@ +cp CaptainOfIndustry/bin/Release/CaptainOfIndustry.dll bepinex/plugins/CaptainOfIndustry.dll \ No newline at end of file diff --git a/Projects/CaptainOfIndustry/libs/0Harmony.dll b/Projects/CaptainOfIndustry/libs/0Harmony.dll new file mode 100644 index 0000000..99daef7 Binary files /dev/null and b/Projects/CaptainOfIndustry/libs/0Harmony.dll differ diff --git a/Projects/CaptainOfIndustry/libs/Assembly-CSharp.dll b/Projects/CaptainOfIndustry/libs/Assembly-CSharp.dll new file mode 100644 index 0000000..adac2c2 Binary files /dev/null and b/Projects/CaptainOfIndustry/libs/Assembly-CSharp.dll differ diff --git a/Projects/CaptainOfIndustry/libs/BepInEx.dll b/Projects/CaptainOfIndustry/libs/BepInEx.dll new file mode 100644 index 0000000..826b479 Binary files /dev/null and b/Projects/CaptainOfIndustry/libs/BepInEx.dll differ diff --git a/Projects/CaptainOfIndustry/libs/ConfigurationManager.dll b/Projects/CaptainOfIndustry/libs/ConfigurationManager.dll new file mode 100644 index 0000000..6845cbf Binary files /dev/null and b/Projects/CaptainOfIndustry/libs/ConfigurationManager.dll differ diff --git a/Projects/CaptainOfIndustry/libs/Mafi.Base.dll b/Projects/CaptainOfIndustry/libs/Mafi.Base.dll new file mode 100644 index 0000000..6911621 Binary files /dev/null and b/Projects/CaptainOfIndustry/libs/Mafi.Base.dll differ diff --git a/Projects/CaptainOfIndustry/libs/Mafi.Core.dll b/Projects/CaptainOfIndustry/libs/Mafi.Core.dll new file mode 100644 index 0000000..5b67093 Binary files /dev/null and b/Projects/CaptainOfIndustry/libs/Mafi.Core.dll differ diff --git a/Projects/CaptainOfIndustry/libs/Mafi.ModsAuthoringSupport.dll b/Projects/CaptainOfIndustry/libs/Mafi.ModsAuthoringSupport.dll new file mode 100644 index 0000000..cf90392 Binary files /dev/null and b/Projects/CaptainOfIndustry/libs/Mafi.ModsAuthoringSupport.dll differ diff --git a/Projects/CaptainOfIndustry/libs/Mafi.Unity.dll b/Projects/CaptainOfIndustry/libs/Mafi.Unity.dll new file mode 100644 index 0000000..9d436b2 Binary files /dev/null and b/Projects/CaptainOfIndustry/libs/Mafi.Unity.dll differ diff --git a/Projects/CaptainOfIndustry/libs/Mafi.dll b/Projects/CaptainOfIndustry/libs/Mafi.dll new file mode 100644 index 0000000..9b43e03 Binary files /dev/null and b/Projects/CaptainOfIndustry/libs/Mafi.dll differ diff --git a/Projects/CaptainOfIndustry/libs/UnityEngine.CoreModule.dll b/Projects/CaptainOfIndustry/libs/UnityEngine.CoreModule.dll new file mode 100644 index 0000000..22b4309 Binary files /dev/null and b/Projects/CaptainOfIndustry/libs/UnityEngine.CoreModule.dll differ diff --git a/Projects/CaptainOfIndustry/libs/UnityEngine.dll b/Projects/CaptainOfIndustry/libs/UnityEngine.dll new file mode 100644 index 0000000..ec505d8 Binary files /dev/null and b/Projects/CaptainOfIndustry/libs/UnityEngine.dll differ diff --git a/Projects/CaptainOfIndustry/libs/copyLibs.sh b/Projects/CaptainOfIndustry/libs/copyLibs.sh new file mode 100644 index 0000000..e828291 --- /dev/null +++ b/Projects/CaptainOfIndustry/libs/copyLibs.sh @@ -0,0 +1 @@ +for lib in $(cat libs.txt); do find 'C:\Games\Against.the.Storm.v1.0.2r' -name "$lib" | sed 's|\\|/|g' | xargs -I% -- cp '%' .; done diff --git a/Projects/CaptainOfIndustry/libs/libs.txt b/Projects/CaptainOfIndustry/libs/libs.txt new file mode 100644 index 0000000..5f48ba1 --- /dev/null +++ b/Projects/CaptainOfIndustry/libs/libs.txt @@ -0,0 +1,11 @@ +0Harmony.dll +Assembly-CSharp.dll +BepInEx.dll +ConfigurationManager.dll +UnityEngine.CoreModule.dll +UnityEngine.dll +Mafi.Base.dll +Mafi.Core.dll +Mafi.dll +Mafi.Unity.dll +Mafi.Security.dll