diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e63424a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +**.idea diff --git a/Projects/MadGamesTycoon2/.gitignore b/Projects/MadGamesTycoon2/.gitignore new file mode 100644 index 0000000..add57be --- /dev/null +++ b/Projects/MadGamesTycoon2/.gitignore @@ -0,0 +1,5 @@ +bin/ +obj/ +/packages/ +riderModule.iml +/_ReSharper.Caches/ \ No newline at end of file diff --git a/Projects/MadGamesTycoon2/CykaMod/Class1.cs b/Projects/MadGamesTycoon2/CykaMod/Class1.cs new file mode 100644 index 0000000..97494a5 --- /dev/null +++ b/Projects/MadGamesTycoon2/CykaMod/Class1.cs @@ -0,0 +1,275 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection.Emit; +using BepInEx; +using BepInEx.Configuration; +using HarmonyLib; +using HarmonyLib.Tools; +using Pathfinding; + +namespace CykaMod { + [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 skillCap; + public static ConfigEntry workSpeed; + public static ConfigEntry workResult; + public static ConfigEntry alwaysCritical; + public static ConfigEntry gameSpeed; + public static ConfigEntry fans; + public static ConfigEntry money; + + // + // private void Awake() + // { + // configGreeting = Config.Bind("General", // The section under which the option is shown + // "GreetingText", // The key of the configuration option in the configuration file + // "Hello, world!", // The default value + // "A greeting text to show when the game is launched"); // Description of the option to show in the config file + // + + public void Awake() { + skillCap = Config.Bind("General", "Skill Cap", 100f); + workSpeed = Config.Bind("General", "Work Speed Multiplier", 4f); + workResult = Config.Bind("General", "Work Result Multiplier", 4f); + alwaysCritical = Config.Bind("General", "Work Always Critical", false); + gameSpeed = Config.Bind("General", "Game Speed Multiplier", 3f); + fans = Config.Bind("General", "Fans Multiplier", 2); + money = Config.Bind("General", "Money Multiplier", 2L); + + 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"); + } + + public static bool IsMatch(List codes, int index, List matcher) { + for (var i = 0; i < matcher.Count; i++) { + if (codes[index + i].opcode != matcher[i].opcode) { + return false; + } + } + return true; + } + + public static void InsertAt(List codes, int index, List toInsert) { + for (var i = 0; i < toInsert.Count; i++) { + codes.Insert(index + i, toInsert[i]); + } + } + } + + [HarmonyPatch(typeof(characterScript), "GetSkillCap")] + public class SkillCapPatch { + static void Postfix(ref float __result) { + // Console.WriteLine("GetSkillCap Postfix! Result is " + __result); + __result = Main.skillCap.Value; + } + } + + [HarmonyPatch(typeof(characterScript), "GetSkillCap_Skill")] + public class SkillCapSkillPatch { + static void Postfix(ref float __result) { + // Console.WriteLine("GetSkillCap_Skill Postfix! Result is " + __result); + __result = Main.skillCap.Value; + } + } + + [HarmonyPatch(typeof(characterScript), "GetWorkSpeed")] + public class GetWorkSpeedPatch { + static void Postfix(ref float __result) { + // Console.WriteLine("GetWorkSpeed Postfix! Result is " + __result); + __result *= Main.workSpeed.Value; + } + } + + [HarmonyPatch(typeof(characterScript), "GetWorkResult")] + public class GetWorkResultPatch { + static void Prefix(ref float f) { + // Console.WriteLine("GetWorkResult Postfix! f is " + f); + f *= Main.workResult.Value; + } + } + + [HarmonyPatch(typeof(characterScript), "GetCritic")] + public class GetCriticPatch { + static void Postfix(ref bool __result) { + // Console.WriteLine("GetWorkResult Postfix! f is " + f); + if (Main.alwaysCritical.Value) { + __result = true; + } + } + } + + [HarmonyPatch(typeof(mainScript), "SetGameSpeed")] + public class GameSpeedPatch { + static void Prefix(ref float f) { + // Console.WriteLine("SetGameSpeed Prefix! Argument is " + f); + if (f > 1) { + f *= Main.gameSpeed.Value; + // Console.WriteLine("Argument modified to " + f); + } + } + } + + [HarmonyPatch(typeof(characterScript), "Learn")] + public static class LearnManyPatch { + static IEnumerable Transpiler(IEnumerable instructions) { + var codes = new List(instructions); + + for (var i = 0; i < 5; i++) { + if (codes[i].opcode == OpCodes.Ldc_R4) { + Console.WriteLine("Changing " + codes[i]); + codes[i].operand = (float)codes[i].operand * 64; + Console.WriteLine("Changed " + codes[i]); + } + } + + return codes.AsEnumerable(); + } + } + + [HarmonyPatch(typeof(arbeitsmarkt), "ArbeitsmarktUpdaten")] + public static class ManyEmployeesPatch { + static IEnumerable Transpiler(IEnumerable instructions) { + var codes = new List(instructions); + + for (var i = codes.Count - 1; i > 0; i--) { + if (codes[i].opcode == OpCodes.Ldc_I4_3) { + Console.WriteLine("Changing " + codes[i]); + codes[i] = new CodeInstruction(OpCodes.Ldc_I4, 64); + Console.WriteLine("Changed " + codes[i]); + break; + } + } + + return codes.AsEnumerable(); + } + } + + // [HarmonyPatch(typeof(AILerp), "MovementUpdate")] + public class MovementSpeedPatch { + static void Prefix(ref float deltaTime) { + Console.WriteLine("MovementUpdate Prefix! deltaTime is " + deltaTime); + deltaTime *= 16f; + } + } + + // [HarmonyPatch(typeof(movementScript), "Move")] + public static class EmployeeMovementSpeedPatch { + static IEnumerable Transpiler(IEnumerable instructions) { + var codes = new List(instructions); + + List matcher = new List(); + matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null)); + matcher.Add(new CodeInstruction(OpCodes.Ldfld, null)); + matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null)); + matcher.Add(new CodeInstruction(OpCodes.Ldfld, null)); + matcher.Add(new CodeInstruction(OpCodes.Mul, null)); + + List patch = new List(); + patch.Add(new CodeInstruction(OpCodes.Ldc_R4, 8)); + patch.Add(new CodeInstruction(OpCodes.Mul, null)); + + for (var i = codes.Count - 1; i > 0; i--) { + if (Main.IsMatch(codes, i, matcher)) { + Main.InsertAt(codes, i + 5, patch); + Console.WriteLine("Movement speed patched"); + for (var j = 0; j < 15; j++) { + Console.WriteLine(codes[i + j]); + } + break; + } + } + Console.WriteLine("Return"); + return codes.AsEnumerable(); + } + } + + [HarmonyPatch(typeof(mainScript), "WochenUpdates")] + public static class ContractWorkAmount { + static IEnumerable Transpiler(IEnumerable instructions) { + var codes = new List(instructions); + int methodIndex = -1; + List pattern = new List(); + + List matcher = new List(); + matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null)); + matcher.Add(new CodeInstruction(OpCodes.Ldfld, null)); + matcher.Add(new CodeInstruction(OpCodes.Ldc_I4_0, null)); + matcher.Add(new CodeInstruction(OpCodes.Callvirt, null)); + + for (var i = 0; i < codes.Count; i++) { + if (codes[i].operand != null) { + if (codes[i].operand.ToString().Contains("UpdateContractWork")) { + methodIndex = i; + pattern.Add(codes[i - 3]); + pattern.Add(codes[i - 2]); + pattern.Add(codes[i - 1]); + pattern.Add(codes[i]); + break; + } + } + } + pattern[2].opcode = OpCodes.Ldc_I4_1; + + for (int i = 0; i < 16; i++) { + for (int j = 0; j < pattern.Count; j++) { + codes.Insert(methodIndex + i + j, pattern[j]); + } + } + + return codes.AsEnumerable(); + } + } + + [HarmonyPatch(typeof(platformScript), "SellPlayer")] + public static class ConsoleProductionReductionPatch { + static IEnumerable Transpiler(IEnumerable instructions) { + var codes = new List(instructions); + + List matcher = new List(); + matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null)); + matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null)); + matcher.Add(new CodeInstruction(OpCodes.Ldfld, null)); + matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, null)); + matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, null)); + matcher.Add(new CodeInstruction(OpCodes.Call, null)); + matcher.Add(new CodeInstruction(OpCodes.Add, null)); + matcher.Add(new CodeInstruction(OpCodes.Stfld, null)); + + for (var i = 0; i < codes.Count; i++) { + if (Main.IsMatch(codes, i, matcher)) { + codes[i + 3].operand = (float)codes[i + 3].operand * 8f; + codes[i + 4].operand = (float)codes[i + 4].operand * 8f; + Console.WriteLine("ConsoleProductionReductionPatch patched"); + break; + } + } + + return codes.AsEnumerable(); + } + } + + [HarmonyPatch(typeof(mainScript), "AddFans")] + public static class AddFansPatch { + static void Prefix(ref int i) { + // Console.WriteLine("GetWorkResult Postfix! f is " + f); + i *= Main.fans.Value; + } + } + + [HarmonyPatch(typeof(mainScript), "Earn")] + public static class AddMoneyPatch { + static void Prefix(ref long amount) { + // Console.WriteLine("GetWorkResult Postfix! f is " + f); + amount *= Main.money.Value; + } + } +} \ No newline at end of file diff --git a/Projects/MadGamesTycoon2/CykaMod/CykaMod.csproj b/Projects/MadGamesTycoon2/CykaMod/CykaMod.csproj new file mode 100644 index 0000000..6d2bb1c --- /dev/null +++ b/Projects/MadGamesTycoon2/CykaMod/CykaMod.csproj @@ -0,0 +1,71 @@ + + + + + Debug + AnyCPU + {06AA059A-C853-42AD-BBF8-122CFB2EEA29} + Library + Properties + CykaMod + CykaMod + v4.0 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + Libraries\0Harmony.dll + + + Libraries\Assembly-CSharp.dll + + + Libraries\AstarPathfindingProject.dll + + + Libraries\BepInEx.dll + + + + + + + Libraries\UnityEngine.dll + + + Libraries\UnityEngine.CoreModule.dll + + + + + + + + + + diff --git a/Projects/MadGamesTycoon2/CykaMod/Libraries/0Harmony.dll b/Projects/MadGamesTycoon2/CykaMod/Libraries/0Harmony.dll new file mode 100644 index 0000000..99daef7 Binary files /dev/null and b/Projects/MadGamesTycoon2/CykaMod/Libraries/0Harmony.dll differ diff --git a/Projects/MadGamesTycoon2/CykaMod/Libraries/Assembly-CSharp.dll b/Projects/MadGamesTycoon2/CykaMod/Libraries/Assembly-CSharp.dll new file mode 100644 index 0000000..f96e27f Binary files /dev/null and b/Projects/MadGamesTycoon2/CykaMod/Libraries/Assembly-CSharp.dll differ diff --git a/Projects/MadGamesTycoon2/CykaMod/Libraries/AstarPathfindingProject.dll b/Projects/MadGamesTycoon2/CykaMod/Libraries/AstarPathfindingProject.dll new file mode 100644 index 0000000..fca069b Binary files /dev/null and b/Projects/MadGamesTycoon2/CykaMod/Libraries/AstarPathfindingProject.dll differ diff --git a/Projects/MadGamesTycoon2/CykaMod/Libraries/BepInEx.dll b/Projects/MadGamesTycoon2/CykaMod/Libraries/BepInEx.dll new file mode 100644 index 0000000..2fb6c0d Binary files /dev/null and b/Projects/MadGamesTycoon2/CykaMod/Libraries/BepInEx.dll differ diff --git a/Projects/MadGamesTycoon2/CykaMod/Libraries/UnityEngine.CoreModule.dll b/Projects/MadGamesTycoon2/CykaMod/Libraries/UnityEngine.CoreModule.dll new file mode 100644 index 0000000..cbda706 Binary files /dev/null and b/Projects/MadGamesTycoon2/CykaMod/Libraries/UnityEngine.CoreModule.dll differ diff --git a/Projects/MadGamesTycoon2/CykaMod/Libraries/UnityEngine.dll b/Projects/MadGamesTycoon2/CykaMod/Libraries/UnityEngine.dll new file mode 100644 index 0000000..60edd3a Binary files /dev/null and b/Projects/MadGamesTycoon2/CykaMod/Libraries/UnityEngine.dll differ diff --git a/Projects/MadGamesTycoon2/CykaMod/Properties/AssemblyInfo.cs b/Projects/MadGamesTycoon2/CykaMod/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5f07107 --- /dev/null +++ b/Projects/MadGamesTycoon2/CykaMod/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("CykaMod")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CykaMod")] +[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("06AA059A-C853-42AD-BBF8-122CFB2EEA29")] + +// 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")] \ No newline at end of file diff --git a/Projects/MadGamesTycoon2/MadGamesTycoon2.sln b/Projects/MadGamesTycoon2/MadGamesTycoon2.sln new file mode 100644 index 0000000..3187337 --- /dev/null +++ b/Projects/MadGamesTycoon2/MadGamesTycoon2.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CykaMod", "CykaMod\CykaMod.csproj", "{06AA059A-C853-42AD-BBF8-122CFB2EEA29}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {06AA059A-C853-42AD-BBF8-122CFB2EEA29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {06AA059A-C853-42AD-BBF8-122CFB2EEA29}.Debug|Any CPU.Build.0 = Debug|Any CPU + {06AA059A-C853-42AD-BBF8-122CFB2EEA29}.Release|Any CPU.ActiveCfg = Release|Any CPU + {06AA059A-C853-42AD-BBF8-122CFB2EEA29}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Projects/MadGamesTycoon2/MadGamesTycoon2.sln.DotSettings.user b/Projects/MadGamesTycoon2/MadGamesTycoon2.sln.DotSettings.user new file mode 100644 index 0000000..f443295 --- /dev/null +++ b/Projects/MadGamesTycoon2/MadGamesTycoon2.sln.DotSettings.user @@ -0,0 +1,10 @@ + + True + True + True + True + True + True + <AssemblyExplorer> + <Assembly Path="C:\Users\Administrator\RiderProjects\Bepinex\Projects\MadGamesTycoon2\CykaMod\Libraries\Assembly-CSharp.dll" /> +</AssemblyExplorer> \ No newline at end of file diff --git a/Projects/TerraTech/TerraTech.sln b/Projects/TerraTech/TerraTech.sln new file mode 100644 index 0000000..e788d9f --- /dev/null +++ b/Projects/TerraTech/TerraTech.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TerraTech", "TerraTech\TerraTech.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/TerraTech/TerraTech.sln.DotSettings.user b/Projects/TerraTech/TerraTech.sln.DotSettings.user new file mode 100644 index 0000000..bad6624 --- /dev/null +++ b/Projects/TerraTech/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/TerraTech/TerraTech/Class1.cs b/Projects/TerraTech/TerraTech/Class1.cs new file mode 100644 index 0000000..4578fc3 --- /dev/null +++ b/Projects/TerraTech/TerraTech/Class1.cs @@ -0,0 +1,143 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using BepInEx; +using BepInEx.Configuration; +using HarmonyLib; +using HarmonyLib.Tools; +using UnityEngine; + +// TODO: Make magnet better +// TODO: Make more energy generate +// TODO: Make attractor more range +// TODO: Make battery bigger + +namespace TerraTech { + [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 xpMultiplier; + public static ConfigEntry moneyMultiplier; + public static ConfigEntry energyGenMultiplier; + public static ConfigEntry allProjectilesHoming; + public static ConfigEntry shootingSpeedMultiplier; + public static ConfigEntry muzzleVelocityMultiplier; + + public void Awake() { + xpMultiplier = Config.Bind("General", "XP Multiplier", 1); + moneyMultiplier = Config.Bind("General", "Money Multiplier", 1); + energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f); + shootingSpeedMultiplier = Config.Bind("General", "Shooting Speed Multiplier", 1f); + muzzleVelocityMultiplier = Config.Bind("General", "Muzzle Velocity Multiplier", 1f); + allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false); + + shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch(); + WeaponPropertiesManager.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"); + } + } + + [HarmonyPatch(typeof(ManLicenses), "AddXP")] + public class XPMultiplierPatch { + static void Prefix(FactionSubTypes corporation, ref int xp, bool showUI = true) { + xp *= Main.xpMultiplier.Value; + } + } + + [HarmonyPatch(typeof(ManPlayer), "AddMoney")] + public class MoneyMultiplierPatch { + static void Prefix(ref int amount) { + amount *= Main.moneyMultiplier.Value; + } + } + + [HarmonyPatch(typeof(ModuleEnergy), "Supply")] + public class EnergyGenerationMultiplierPatch { + static void Prefix(EnergyRegulator.EnergyType type, ref float energyAmount) { + if (energyAmount > 0) { + energyAmount *= Main.energyGenMultiplier.Value; + } + } + } + + [HarmonyPatch(typeof(Projectile), "Fire")] + public class HomingProjectilePatch { + private static Dictionary patchedObjects = new Dictionary(); + + static void Prefix(Vector3 fireDirection, ref FireData fireData, ref ModuleWeaponGun weapon, Tank shooter, ref bool seekingRounds, bool replayRounds) { + if (Main.allProjectilesHoming.Value) { + seekingRounds = true; + } + if (Main.muzzleVelocityMultiplier.Value != -1f && !patchedObjects.ContainsKey(fireData)) { + fireData.m_MuzzleVelocity *= Main.muzzleVelocityMultiplier.Value; + patchedObjects.Add(fireData, true); + } + } + } + + [HarmonyPatch] + public class WeaponPropertiesManager { + private static Dictionary cooldowns = new Dictionary(); + + [HarmonyPostfix] + [HarmonyPatch(typeof(ModuleWeaponGun), "OnPool")] + static void Postfix1WeaponCreate(ModuleWeaponGun __instance) { + cooldowns.Add(__instance, __instance.m_ShotCooldown); + if (ShouldPatch()) { + DoPatchSingle(__instance); + } + } + + [HarmonyPostfix] + [HarmonyPatch(typeof(ModuleWeaponGun), "OnRecycle")] + static void Postfix1WeaponDestroy(ModuleWeaponGun __instance) { + cooldowns.Remove(__instance); + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(ModuleWeaponGun), "ProcessFiring")] + static void PrefixProcessFiring(ModuleWeaponGun __instance, ref bool firing) { + if (firing) { + if (!cooldowns.ContainsKey(__instance)) { + cooldowns.Add(__instance, __instance.m_ShotCooldown); + DoPatchSingle(__instance); + } + } + } + + public static void DoPatch() { + Console.WriteLine("Modifying " + cooldowns.Count + " weapons"); + Console.WriteLine("Should patch: " + ShouldPatch()); + foreach (KeyValuePair keyValuePair in cooldowns) { + if (ShouldPatch()) { + DoPatchSingle(keyValuePair.Key); + } else { + DoRestoreSingle(keyValuePair.Key); + } + } + } + + static void DoPatchSingle(ModuleWeaponGun weapon) { + weapon.m_ShotCooldown /= Main.shootingSpeedMultiplier.Value; + } + + static void DoRestoreSingle(ModuleWeaponGun weapon) { + if (cooldowns.ContainsKey(weapon)) { + weapon.m_ShotCooldown = cooldowns[weapon]; + } + } + + static bool ShouldPatch() { + return Math.Abs(Main.shootingSpeedMultiplier.Value - 1f) > 0.0001f; + } + } +} \ No newline at end of file diff --git a/Projects/TerraTech/TerraTech/Properties/AssemblyInfo.cs b/Projects/TerraTech/TerraTech/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ca6f22b --- /dev/null +++ b/Projects/TerraTech/TerraTech/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("TerraTech")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TerraTech")] +[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")] \ No newline at end of file diff --git a/Projects/TerraTech/TerraTech/TerraTech.csproj b/Projects/TerraTech/TerraTech/TerraTech.csproj new file mode 100644 index 0000000..7512c30 --- /dev/null +++ b/Projects/TerraTech/TerraTech/TerraTech.csproj @@ -0,0 +1,66 @@ + + + + + Debug + AnyCPU + {EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE} + Library + Properties + TerraTech + TerraTech + v4.8 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + ..\libs\0Harmony.dll + + + ..\libs\Assembly-CSharp.dll + + + ..\libs\BepInEx.dll + + + ..\libs\ConfigurationManager.dll + + + ..\libs\UnityEngine.dll + + + ..\libs\UnityEngine.CoreModule.dll + + + + + \ No newline at end of file diff --git a/Projects/TerraTech/TerraTech/bin/Debug/0Harmony.dll b/Projects/TerraTech/TerraTech/bin/Debug/0Harmony.dll new file mode 100644 index 0000000..99daef7 Binary files /dev/null and b/Projects/TerraTech/TerraTech/bin/Debug/0Harmony.dll differ diff --git a/Projects/TerraTech/TerraTech/bin/Debug/Assembly-CSharp.dll b/Projects/TerraTech/TerraTech/bin/Debug/Assembly-CSharp.dll new file mode 100644 index 0000000..7ee05db Binary files /dev/null and b/Projects/TerraTech/TerraTech/bin/Debug/Assembly-CSharp.dll differ diff --git a/Projects/TerraTech/TerraTech/bin/Debug/BepInEx.dll b/Projects/TerraTech/TerraTech/bin/Debug/BepInEx.dll new file mode 100644 index 0000000..2fb6c0d Binary files /dev/null and b/Projects/TerraTech/TerraTech/bin/Debug/BepInEx.dll differ diff --git a/Projects/TerraTech/TerraTech/bin/Debug/ConfigurationManager.dll b/Projects/TerraTech/TerraTech/bin/Debug/ConfigurationManager.dll new file mode 100644 index 0000000..3998c2b Binary files /dev/null and b/Projects/TerraTech/TerraTech/bin/Debug/ConfigurationManager.dll differ diff --git a/Projects/TerraTech/TerraTech/bin/Debug/TerraTech.dll b/Projects/TerraTech/TerraTech/bin/Debug/TerraTech.dll new file mode 100644 index 0000000..9be9c4f Binary files /dev/null and b/Projects/TerraTech/TerraTech/bin/Debug/TerraTech.dll differ diff --git a/Projects/TerraTech/TerraTech/bin/Debug/TerraTech.pdb b/Projects/TerraTech/TerraTech/bin/Debug/TerraTech.pdb new file mode 100644 index 0000000..f82d826 Binary files /dev/null and b/Projects/TerraTech/TerraTech/bin/Debug/TerraTech.pdb differ diff --git a/Projects/TerraTech/TerraTech/bin/Debug/UnityEngine.CoreModule.dll b/Projects/TerraTech/TerraTech/bin/Debug/UnityEngine.CoreModule.dll new file mode 100644 index 0000000..ac13d57 Binary files /dev/null and b/Projects/TerraTech/TerraTech/bin/Debug/UnityEngine.CoreModule.dll differ diff --git a/Projects/TerraTech/TerraTech/bin/Debug/UnityEngine.dll b/Projects/TerraTech/TerraTech/bin/Debug/UnityEngine.dll new file mode 100644 index 0000000..19ea58a Binary files /dev/null and b/Projects/TerraTech/TerraTech/bin/Debug/UnityEngine.dll differ diff --git a/Projects/TerraTech/TerraTech/bin/Release/0Harmony.dll b/Projects/TerraTech/TerraTech/bin/Release/0Harmony.dll new file mode 100644 index 0000000..99daef7 Binary files /dev/null and b/Projects/TerraTech/TerraTech/bin/Release/0Harmony.dll differ diff --git a/Projects/TerraTech/TerraTech/bin/Release/Assembly-CSharp.dll b/Projects/TerraTech/TerraTech/bin/Release/Assembly-CSharp.dll new file mode 100644 index 0000000..7ee05db Binary files /dev/null and b/Projects/TerraTech/TerraTech/bin/Release/Assembly-CSharp.dll differ diff --git a/Projects/TerraTech/TerraTech/bin/Release/BepInEx.dll b/Projects/TerraTech/TerraTech/bin/Release/BepInEx.dll new file mode 100644 index 0000000..2fb6c0d Binary files /dev/null and b/Projects/TerraTech/TerraTech/bin/Release/BepInEx.dll differ diff --git a/Projects/TerraTech/TerraTech/bin/Release/TerraTech.dll b/Projects/TerraTech/TerraTech/bin/Release/TerraTech.dll new file mode 100644 index 0000000..c1e0eff Binary files /dev/null and b/Projects/TerraTech/TerraTech/bin/Release/TerraTech.dll differ diff --git a/Projects/TerraTech/TerraTech/bin/Release/TerraTech.pdb b/Projects/TerraTech/TerraTech/bin/Release/TerraTech.pdb new file mode 100644 index 0000000..09ba880 Binary files /dev/null and b/Projects/TerraTech/TerraTech/bin/Release/TerraTech.pdb differ diff --git a/Projects/TerraTech/TerraTech/bin/Release/UnityEngine.CoreModule.dll b/Projects/TerraTech/TerraTech/bin/Release/UnityEngine.CoreModule.dll new file mode 100644 index 0000000..ac13d57 Binary files /dev/null and b/Projects/TerraTech/TerraTech/bin/Release/UnityEngine.CoreModule.dll differ diff --git a/Projects/TerraTech/TerraTech/bin/Release/UnityEngine.dll b/Projects/TerraTech/TerraTech/bin/Release/UnityEngine.dll new file mode 100644 index 0000000..19ea58a Binary files /dev/null and b/Projects/TerraTech/TerraTech/bin/Release/UnityEngine.dll differ diff --git a/Projects/TerraTech/TerraTech/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/Projects/TerraTech/TerraTech/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs new file mode 100644 index 0000000..e69de29 diff --git a/Projects/TerraTech/TerraTech/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/Projects/TerraTech/TerraTech/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs new file mode 100644 index 0000000..e69de29 diff --git a/Projects/TerraTech/TerraTech/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/Projects/TerraTech/TerraTech/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs new file mode 100644 index 0000000..e69de29 diff --git a/Projects/TerraTech/TerraTech/obj/Debug/TerraTech.csproj.FileListAbsolute.txt b/Projects/TerraTech/TerraTech/obj/Debug/TerraTech.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..8de8814 --- /dev/null +++ b/Projects/TerraTech/TerraTech/obj/Debug/TerraTech.csproj.FileListAbsolute.txt @@ -0,0 +1,11 @@ +C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\TerraTech.dll +C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\TerraTech.pdb +C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\0Harmony.dll +C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\Assembly-CSharp.dll +C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\BepInEx.dll +C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\UnityEngine.CoreModule.dll +C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\UnityEngine.dll +C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.csprojResolveAssemblyReference.cache +C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.dll +C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.pdb +C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\ConfigurationManager.dll diff --git a/Projects/TerraTech/TerraTech/obj/Debug/TerraTech.csprojResolveAssemblyReference.cache b/Projects/TerraTech/TerraTech/obj/Debug/TerraTech.csprojResolveAssemblyReference.cache new file mode 100644 index 0000000..3a99c1f Binary files /dev/null and b/Projects/TerraTech/TerraTech/obj/Debug/TerraTech.csprojResolveAssemblyReference.cache differ diff --git a/Projects/TerraTech/TerraTech/obj/Debug/TerraTech.dll b/Projects/TerraTech/TerraTech/obj/Debug/TerraTech.dll new file mode 100644 index 0000000..9be9c4f Binary files /dev/null and b/Projects/TerraTech/TerraTech/obj/Debug/TerraTech.dll differ diff --git a/Projects/TerraTech/TerraTech/obj/Debug/TerraTech.pdb b/Projects/TerraTech/TerraTech/obj/Debug/TerraTech.pdb new file mode 100644 index 0000000..f82d826 Binary files /dev/null and b/Projects/TerraTech/TerraTech/obj/Debug/TerraTech.pdb differ diff --git a/Projects/TerraTech/libs/0Harmony.dll b/Projects/TerraTech/libs/0Harmony.dll new file mode 100644 index 0000000..99daef7 Binary files /dev/null and b/Projects/TerraTech/libs/0Harmony.dll differ diff --git a/Projects/TerraTech/libs/Assembly-CSharp.dll b/Projects/TerraTech/libs/Assembly-CSharp.dll new file mode 100644 index 0000000..7ee05db Binary files /dev/null and b/Projects/TerraTech/libs/Assembly-CSharp.dll differ diff --git a/Projects/TerraTech/libs/BepInEx.dll b/Projects/TerraTech/libs/BepInEx.dll new file mode 100644 index 0000000..2fb6c0d Binary files /dev/null and b/Projects/TerraTech/libs/BepInEx.dll differ diff --git a/Projects/TerraTech/libs/ConfigurationManager.dll b/Projects/TerraTech/libs/ConfigurationManager.dll new file mode 100644 index 0000000..3998c2b Binary files /dev/null and b/Projects/TerraTech/libs/ConfigurationManager.dll differ diff --git a/Projects/TerraTech/libs/UnityEngine.CoreModule.dll b/Projects/TerraTech/libs/UnityEngine.CoreModule.dll new file mode 100644 index 0000000..ac13d57 Binary files /dev/null and b/Projects/TerraTech/libs/UnityEngine.CoreModule.dll differ diff --git a/Projects/TerraTech/libs/UnityEngine.dll b/Projects/TerraTech/libs/UnityEngine.dll new file mode 100644 index 0000000..19ea58a Binary files /dev/null and b/Projects/TerraTech/libs/UnityEngine.dll differ