This commit is contained in:
2024-08-22 08:46:27 +02:00
parent c204838602
commit 5b89b2af0b
73 changed files with 3480 additions and 3480 deletions

View File

@@ -1,16 +1,16 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgainstTheStorm", "AgainstTheStorm\AgainstTheStorm.csproj", "{DA9D274E-486F-4F82-84FF-CD9388CB0B09}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgainstTheStorm", "AgainstTheStorm\AgainstTheStorm.csproj", "{DA9D274E-486F-4F82-84FF-CD9388CB0B09}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Debug|Any CPU.Build.0 = Debug|Any CPU {DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.ActiveCfg = Release|Any CPU {DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.Build.0 = Release|Any CPU {DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -1,82 +1,82 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DA9D274E-486F-4F82-84FF-CD9388CB0B09}</ProjectGuid> <ProjectGuid>{DA9D274E-486F-4F82-84FF-CD9388CB0B09}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AgainstTheStorm</RootNamespace> <RootNamespace>AgainstTheStorm</RootNamespace>
<AssemblyName>AgainstTheStorm</AssemblyName> <AssemblyName>AgainstTheStorm</AssemblyName>
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="0Harmony"> <Reference Include="0Harmony">
<HintPath>libs\0Harmony.dll</HintPath> <HintPath>libs\0Harmony.dll</HintPath>
</Reference> </Reference>
<Reference Include="Assembly-CSharp"> <Reference Include="Assembly-CSharp">
<HintPath>libs\Assembly-CSharp.dll</HintPath> <HintPath>libs\Assembly-CSharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="BepInEx"> <Reference Include="BepInEx">
<HintPath>libs\BepInEx.dll</HintPath> <HintPath>libs\BepInEx.dll</HintPath>
</Reference> </Reference>
<Reference Include="ConfigurationManager"> <Reference Include="ConfigurationManager">
<HintPath>libs\ConfigurationManager.dll</HintPath> <HintPath>libs\ConfigurationManager.dll</HintPath>
</Reference> </Reference>
<Reference Include="MainAssembly"> <Reference Include="MainAssembly">
<HintPath>libs\MainAssembly.dll</HintPath> <HintPath>libs\MainAssembly.dll</HintPath>
</Reference> </Reference>
<Reference Include="Sirenix.Serialization"> <Reference Include="Sirenix.Serialization">
<HintPath>libs\Sirenix.Serialization.dll</HintPath> <HintPath>libs\Sirenix.Serialization.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="UnityEngine"> <Reference Include="UnityEngine">
<HintPath>libs\UnityEngine.dll</HintPath> <HintPath>libs\UnityEngine.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.CoreModule"> <Reference Include="UnityEngine.CoreModule">
<HintPath>libs\UnityEngine.CoreModule.dll</HintPath> <HintPath>libs\UnityEngine.CoreModule.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Class1.cs" /> <Compile Include="Class1.cs" />
<Compile Include="Patches.cs" /> <Compile Include="Patches.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Transpiler.cs" /> <Compile Include="Transpiler.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="deploy.sh" /> <Content Include="deploy.sh" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@@ -1,35 +1,35 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("Regiments")] [assembly: AssemblyTitle("Regiments")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Regiments")] [assembly: AssemblyProduct("Regiments")]
[assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible // 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 // to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM // The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("DA9D274E-486F-4F82-84FF-CD9388CB0B09")] [assembly: Guid("DA9D274E-486F-4F82-84FF-CD9388CB0B09")]
// Version information for an assembly consists of the following four values: // Version information for an assembly consists of the following four values:
// //
// Major Version // Major Version
// Minor Version // Minor Version
// Build Number // Build Number
// Revision // Revision
// //
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,274 +1,274 @@
// using System; // using System;
// using System.Collections.Generic; // using System.Collections.Generic;
// using System.Linq; // using System.Linq;
// using System.Reflection.Emit; // using System.Reflection.Emit;
// using BepInEx; // using BepInEx;
// using BepInEx.Configuration; // using BepInEx.Configuration;
// using HarmonyLib; // using HarmonyLib;
// using HarmonyLib.Tools; // using HarmonyLib.Tools;
// //
// namespace Regiments { // namespace Regiments {
// [BepInPlugin(pluginGuid, pluginName, pluginVersion)] // [BepInPlugin(pluginGuid, pluginName, pluginVersion)]
// public class Main : BaseUnityPlugin { // public class Main : BaseUnityPlugin {
// private const string pluginGuid = "CykaMod"; // private const string pluginGuid = "CykaMod";
// private const string pluginName = "CykaMod"; // private const string pluginName = "CykaMod";
// private const string pluginVersion = "1.0.0"; // private const string pluginVersion = "1.0.0";
// //
// public static ConfigEntry<float> skillCap; // public static ConfigEntry<float> skillCap;
// public static ConfigEntry<float> workSpeed; // public static ConfigEntry<float> workSpeed;
// public static ConfigEntry<float> workResult; // public static ConfigEntry<float> workResult;
// public static ConfigEntry<bool> alwaysCritical; // public static ConfigEntry<bool> alwaysCritical;
// public static ConfigEntry<float> gameSpeed; // public static ConfigEntry<float> gameSpeed;
// public static ConfigEntry<int> fans; // public static ConfigEntry<int> fans;
// public static ConfigEntry<long> money; // public static ConfigEntry<long> money;
// //
// // // //
// // private void Awake() // // private void Awake()
// // { // // {
// // configGreeting = Config.Bind("General", // The section under which the option is shown // // configGreeting = Config.Bind("General", // The section under which the option is shown
// // "GreetingText", // The key of the configuration option in the configuration file // // "GreetingText", // The key of the configuration option in the configuration file
// // "Hello, world!", // The default value // // "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 // // "A greeting text to show when the game is launched"); // Description of the option to show in the config file
// // // //
// //
// public void Awake() { // public void Awake() {
// skillCap = Config.Bind("General", "Skill Cap", 100f); // skillCap = Config.Bind("General", "Skill Cap", 100f);
// workSpeed = Config.Bind("General", "Work Speed Multiplier", 4f); // workSpeed = Config.Bind("General", "Work Speed Multiplier", 4f);
// workResult = Config.Bind("General", "Work Result Multiplier", 4f); // workResult = Config.Bind("General", "Work Result Multiplier", 4f);
// alwaysCritical = Config.Bind("General", "Work Always Critical", false); // alwaysCritical = Config.Bind("General", "Work Always Critical", false);
// gameSpeed = Config.Bind("General", "Game Speed Multiplier", 3f); // gameSpeed = Config.Bind("General", "Game Speed Multiplier", 3f);
// fans = Config.Bind("General", "Fans Multiplier", 2); // fans = Config.Bind("General", "Fans Multiplier", 2);
// money = Config.Bind("General", "Money Multiplier", 2L); // money = Config.Bind("General", "Money Multiplier", 2L);
// //
// Logger.LogInfo("Cyka mod loaded"); // Logger.LogInfo("Cyka mod loaded");
// HarmonyFileLog.Enabled = true; // HarmonyFileLog.Enabled = true;
// Harmony harmony = new Harmony(pluginGuid); // Harmony harmony = new Harmony(pluginGuid);
// harmony.PatchAll(); // harmony.PatchAll();
// var originalMethods = harmony.GetPatchedMethods(); // var originalMethods = harmony.GetPatchedMethods();
// Logger.LogInfo("Patched " + originalMethods.Count() + " methods"); // Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
// } // }
// //
// public static bool IsMatch(List<CodeInstruction> codes, int index, List<CodeInstruction> matcher) { // public static bool IsMatch(List<CodeInstruction> codes, int index, List<CodeInstruction> matcher) {
// for (var i = 0; i < matcher.Count; i++) { // for (var i = 0; i < matcher.Count; i++) {
// if (codes[index + i].opcode != matcher[i].opcode) { // if (codes[index + i].opcode != matcher[i].opcode) {
// return false; // return false;
// } // }
// } // }
// return true; // return true;
// } // }
// //
// public static void InsertAt(List<CodeInstruction> codes, int index, List<CodeInstruction> toInsert) { // public static void InsertAt(List<CodeInstruction> codes, int index, List<CodeInstruction> toInsert) {
// for (var i = 0; i < toInsert.Count; i++) { // for (var i = 0; i < toInsert.Count; i++) {
// codes.Insert(index + i, toInsert[i]); // codes.Insert(index + i, toInsert[i]);
// } // }
// } // }
// } // }
// //
// [HarmonyPatch(typeof(characterScript), "GetSkillCap")] // [HarmonyPatch(typeof(characterScript), "GetSkillCap")]
// public class SkillCapPatch { // public class SkillCapPatch {
// static void Postfix(ref float __result) { // static void Postfix(ref float __result) {
// // Console.WriteLine("GetSkillCap Postfix! Result is " + __result); // // Console.WriteLine("GetSkillCap Postfix! Result is " + __result);
// __result = Main.skillCap.Value; // __result = Main.skillCap.Value;
// } // }
// } // }
// //
// [HarmonyPatch(typeof(characterScript), "GetSkillCap_Skill")] // [HarmonyPatch(typeof(characterScript), "GetSkillCap_Skill")]
// public class SkillCapSkillPatch { // public class SkillCapSkillPatch {
// static void Postfix(ref float __result) { // static void Postfix(ref float __result) {
// // Console.WriteLine("GetSkillCap_Skill Postfix! Result is " + __result); // // Console.WriteLine("GetSkillCap_Skill Postfix! Result is " + __result);
// __result = Main.skillCap.Value; // __result = Main.skillCap.Value;
// } // }
// } // }
// //
// [HarmonyPatch(typeof(characterScript), "GetWorkSpeed")] // [HarmonyPatch(typeof(characterScript), "GetWorkSpeed")]
// public class GetWorkSpeedPatch { // public class GetWorkSpeedPatch {
// static void Postfix(ref float __result) { // static void Postfix(ref float __result) {
// // Console.WriteLine("GetWorkSpeed Postfix! Result is " + __result); // // Console.WriteLine("GetWorkSpeed Postfix! Result is " + __result);
// __result *= Main.workSpeed.Value; // __result *= Main.workSpeed.Value;
// } // }
// } // }
// //
// [HarmonyPatch(typeof(characterScript), "GetWorkResult")] // [HarmonyPatch(typeof(characterScript), "GetWorkResult")]
// public class GetWorkResultPatch { // public class GetWorkResultPatch {
// static void Prefix(ref float f) { // static void Prefix(ref float f) {
// // Console.WriteLine("GetWorkResult Postfix! f is " + f); // // Console.WriteLine("GetWorkResult Postfix! f is " + f);
// f *= Main.workResult.Value; // f *= Main.workResult.Value;
// } // }
// } // }
// //
// [HarmonyPatch(typeof(characterScript), "GetCritic")] // [HarmonyPatch(typeof(characterScript), "GetCritic")]
// public class GetCriticPatch { // public class GetCriticPatch {
// static void Postfix(ref bool __result) { // static void Postfix(ref bool __result) {
// // Console.WriteLine("GetWorkResult Postfix! f is " + f); // // Console.WriteLine("GetWorkResult Postfix! f is " + f);
// if (Main.alwaysCritical.Value) { // if (Main.alwaysCritical.Value) {
// __result = true; // __result = true;
// } // }
// } // }
// } // }
// //
// [HarmonyPatch(typeof(mainScript), "SetGameSpeed")] // [HarmonyPatch(typeof(mainScript), "SetGameSpeed")]
// public class GameSpeedPatch { // public class GameSpeedPatch {
// static void Prefix(ref float f) { // static void Prefix(ref float f) {
// // Console.WriteLine("SetGameSpeed Prefix! Argument is " + f); // // Console.WriteLine("SetGameSpeed Prefix! Argument is " + f);
// if (f > 1) { // if (f > 1) {
// f *= Main.gameSpeed.Value; // f *= Main.gameSpeed.Value;
// // Console.WriteLine("Argument modified to " + f); // // Console.WriteLine("Argument modified to " + f);
// } // }
// } // }
// } // }
// //
// [HarmonyPatch(typeof(characterScript), "Learn")] // [HarmonyPatch(typeof(characterScript), "Learn")]
// public static class LearnManyPatch { // public static class LearnManyPatch {
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { // static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
// var codes = new List<CodeInstruction>(instructions); // var codes = new List<CodeInstruction>(instructions);
// //
// for (var i = 0; i < 5; i++) { // for (var i = 0; i < 5; i++) {
// if (codes[i].opcode == OpCodes.Ldc_R4) { // if (codes[i].opcode == OpCodes.Ldc_R4) {
// Console.WriteLine("Changing " + codes[i]); // Console.WriteLine("Changing " + codes[i]);
// codes[i].operand = (float)codes[i].operand * 64; // codes[i].operand = (float)codes[i].operand * 64;
// Console.WriteLine("Changed " + codes[i]); // Console.WriteLine("Changed " + codes[i]);
// } // }
// } // }
// //
// return codes.AsEnumerable(); // return codes.AsEnumerable();
// } // }
// } // }
// //
// [HarmonyPatch(typeof(arbeitsmarkt), "ArbeitsmarktUpdaten")] // [HarmonyPatch(typeof(arbeitsmarkt), "ArbeitsmarktUpdaten")]
// public static class ManyEmployeesPatch { // public static class ManyEmployeesPatch {
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { // static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
// var codes = new List<CodeInstruction>(instructions); // var codes = new List<CodeInstruction>(instructions);
// //
// for (var i = codes.Count - 1; i > 0; i--) { // for (var i = codes.Count - 1; i > 0; i--) {
// if (codes[i].opcode == OpCodes.Ldc_I4_3) { // if (codes[i].opcode == OpCodes.Ldc_I4_3) {
// Console.WriteLine("Changing " + codes[i]); // Console.WriteLine("Changing " + codes[i]);
// codes[i] = new CodeInstruction(OpCodes.Ldc_I4, 64); // codes[i] = new CodeInstruction(OpCodes.Ldc_I4, 64);
// Console.WriteLine("Changed " + codes[i]); // Console.WriteLine("Changed " + codes[i]);
// break; // break;
// } // }
// } // }
// //
// return codes.AsEnumerable(); // return codes.AsEnumerable();
// } // }
// } // }
// //
// // [HarmonyPatch(typeof(AILerp), "MovementUpdate")] // // [HarmonyPatch(typeof(AILerp), "MovementUpdate")]
// public class MovementSpeedPatch { // public class MovementSpeedPatch {
// static void Prefix(ref float deltaTime) { // static void Prefix(ref float deltaTime) {
// Console.WriteLine("MovementUpdate Prefix! deltaTime is " + deltaTime); // Console.WriteLine("MovementUpdate Prefix! deltaTime is " + deltaTime);
// deltaTime *= 16f; // deltaTime *= 16f;
// } // }
// } // }
// //
// // [HarmonyPatch(typeof(movementScript), "Move")] // // [HarmonyPatch(typeof(movementScript), "Move")]
// public static class EmployeeMovementSpeedPatch { // public static class EmployeeMovementSpeedPatch {
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { // static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
// var codes = new List<CodeInstruction>(instructions); // var codes = new List<CodeInstruction>(instructions);
// //
// List<CodeInstruction> matcher = new List<CodeInstruction>(); // List<CodeInstruction> matcher = new List<CodeInstruction>();
// 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.Ldfld, null));
// 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.Ldfld, null));
// matcher.Add(new CodeInstruction(OpCodes.Mul, null)); // matcher.Add(new CodeInstruction(OpCodes.Mul, null));
// //
// List<CodeInstruction> patch = new List<CodeInstruction>(); // List<CodeInstruction> patch = new List<CodeInstruction>();
// patch.Add(new CodeInstruction(OpCodes.Ldc_R4, 8)); // patch.Add(new CodeInstruction(OpCodes.Ldc_R4, 8));
// patch.Add(new CodeInstruction(OpCodes.Mul, null)); // patch.Add(new CodeInstruction(OpCodes.Mul, null));
// //
// for (var i = codes.Count - 1; i > 0; i--) { // for (var i = codes.Count - 1; i > 0; i--) {
// if (Main.IsMatch(codes, i, matcher)) { // if (Main.IsMatch(codes, i, matcher)) {
// Main.InsertAt(codes, i + 5, patch); // Main.InsertAt(codes, i + 5, patch);
// Console.WriteLine("Movement speed patched"); // Console.WriteLine("Movement speed patched");
// for (var j = 0; j < 15; j++) { // for (var j = 0; j < 15; j++) {
// Console.WriteLine(codes[i + j]); // Console.WriteLine(codes[i + j]);
// } // }
// break; // break;
// } // }
// } // }
// Console.WriteLine("Return"); // Console.WriteLine("Return");
// return codes.AsEnumerable(); // return codes.AsEnumerable();
// } // }
// } // }
// //
// [HarmonyPatch(typeof(mainScript), "WochenUpdates")] // [HarmonyPatch(typeof(mainScript), "WochenUpdates")]
// public static class ContractWorkAmount { // public static class ContractWorkAmount {
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { // static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
// var codes = new List<CodeInstruction>(instructions); // var codes = new List<CodeInstruction>(instructions);
// int methodIndex = -1; // int methodIndex = -1;
// List<CodeInstruction> pattern = new List<CodeInstruction>(); // List<CodeInstruction> pattern = new List<CodeInstruction>();
// //
// List<CodeInstruction> matcher = new List<CodeInstruction>(); // List<CodeInstruction> matcher = new List<CodeInstruction>();
// 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.Ldfld, null));
// matcher.Add(new CodeInstruction(OpCodes.Ldc_I4_0, null)); // matcher.Add(new CodeInstruction(OpCodes.Ldc_I4_0, null));
// matcher.Add(new CodeInstruction(OpCodes.Callvirt, null)); // matcher.Add(new CodeInstruction(OpCodes.Callvirt, null));
// //
// for (var i = 0; i < codes.Count; i++) { // for (var i = 0; i < codes.Count; i++) {
// if (codes[i].operand != null) { // if (codes[i].operand != null) {
// if (codes[i].operand.ToString().Contains("UpdateContractWork")) { // if (codes[i].operand.ToString().Contains("UpdateContractWork")) {
// methodIndex = i; // methodIndex = i;
// pattern.Add(codes[i - 3]); // pattern.Add(codes[i - 3]);
// pattern.Add(codes[i - 2]); // pattern.Add(codes[i - 2]);
// pattern.Add(codes[i - 1]); // pattern.Add(codes[i - 1]);
// pattern.Add(codes[i]); // pattern.Add(codes[i]);
// break; // break;
// } // }
// } // }
// } // }
// pattern[2].opcode = OpCodes.Ldc_I4_1; // pattern[2].opcode = OpCodes.Ldc_I4_1;
// //
// for (int i = 0; i < 16; i++) { // for (int i = 0; i < 16; i++) {
// for (int j = 0; j < pattern.Count; j++) { // for (int j = 0; j < pattern.Count; j++) {
// codes.Insert(methodIndex + i + j, pattern[j]); // codes.Insert(methodIndex + i + j, pattern[j]);
// } // }
// } // }
// //
// return codes.AsEnumerable(); // return codes.AsEnumerable();
// } // }
// } // }
// //
// [HarmonyPatch(typeof(platformScript), "SellPlayer")] // [HarmonyPatch(typeof(platformScript), "SellPlayer")]
// public static class ConsoleProductionReductionPatch { // public static class ConsoleProductionReductionPatch {
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { // static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
// var codes = new List<CodeInstruction>(instructions); // var codes = new List<CodeInstruction>(instructions);
// //
// List<CodeInstruction> matcher = new List<CodeInstruction>(); // List<CodeInstruction> matcher = new List<CodeInstruction>();
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null)); // matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
// 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.Ldfld, null));
// matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, null)); // matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, 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.Call, null));
// matcher.Add(new CodeInstruction(OpCodes.Add, null)); // matcher.Add(new CodeInstruction(OpCodes.Add, null));
// matcher.Add(new CodeInstruction(OpCodes.Stfld, null)); // matcher.Add(new CodeInstruction(OpCodes.Stfld, null));
// //
// for (var i = 0; i < codes.Count; i++) { // for (var i = 0; i < codes.Count; i++) {
// if (Main.IsMatch(codes, i, matcher)) { // if (Main.IsMatch(codes, i, matcher)) {
// codes[i + 3].operand = (float)codes[i + 3].operand * 8f; // codes[i + 3].operand = (float)codes[i + 3].operand * 8f;
// codes[i + 4].operand = (float)codes[i + 4].operand * 8f; // codes[i + 4].operand = (float)codes[i + 4].operand * 8f;
// Console.WriteLine("ConsoleProductionReductionPatch patched"); // Console.WriteLine("ConsoleProductionReductionPatch patched");
// break; // break;
// } // }
// } // }
// //
// return codes.AsEnumerable(); // return codes.AsEnumerable();
// } // }
// } // }
// //
// [HarmonyPatch(typeof(mainScript), "AddFans")] // [HarmonyPatch(typeof(mainScript), "AddFans")]
// public static class AddFansPatch { // public static class AddFansPatch {
// static void Prefix(ref int i) { // static void Prefix(ref int i) {
// // Console.WriteLine("GetWorkResult Postfix! f is " + f); // // Console.WriteLine("GetWorkResult Postfix! f is " + f);
// i *= Main.fans.Value; // i *= Main.fans.Value;
// } // }
// } // }
// //
// [HarmonyPatch(typeof(mainScript), "Earn")] // [HarmonyPatch(typeof(mainScript), "Earn")]
// public static class AddMoneyPatch { // public static class AddMoneyPatch {
// static void Prefix(ref long amount) { // static void Prefix(ref long amount) {
// // Console.WriteLine("GetWorkResult Postfix! f is " + f); // // Console.WriteLine("GetWorkResult Postfix! f is " + f);
// amount *= Main.money.Value; // amount *= Main.money.Value;
// } // }
// } // }
// } // }

View File

@@ -1 +1 @@
151279b84fdcbaafd9f0fcb1f7663654a57733b1df3836fc5634a1051692a2db 151279b84fdcbaafd9f0fcb1f7663654a57733b1df3836fc5634a1051692a2db

View File

@@ -1,14 +1,14 @@
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\AgainstTheStorm.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\AgainstTheStorm.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\AgainstTheStorm.pdb C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\AgainstTheStorm.pdb
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\0Harmony.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\0Harmony.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\Assembly-CSharp.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\Assembly-CSharp.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\BepInEx.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\BepInEx.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\ConfigurationManager.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\ConfigurationManager.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\Sirenix.Serialization.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\Sirenix.Serialization.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\UnityEngine.CoreModule.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\UnityEngine.CoreModule.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\UnityEngine.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\bin\Debug\UnityEngine.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.csproj.AssemblyReference.cache C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.csproj.AssemblyReference.cache
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.csproj.CoreCompileInputs.cache C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.csproj.CoreCompileInputs.cache
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.csproj.CopyComplete C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.csproj.CopyComplete
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.pdb C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.pdb

View File

@@ -1,16 +1,16 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainOfIndustry", "CaptainOfIndustry\CaptainOfIndustry.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainOfIndustry", "CaptainOfIndustry\CaptainOfIndustry.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {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}.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.ActiveCfg = Release|Any CPU
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU {EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -1,97 +1,97 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid> <ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CaptainOfIndustry</RootNamespace> <RootNamespace>CaptainOfIndustry</RootNamespace>
<AssemblyName>CaptainOfIndustry</AssemblyName> <AssemblyName>CaptainOfIndustry</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Class1.cs" /> <Compile Include="Class1.cs" />
<Compile Include="Patches.cs" /> <Compile Include="Patches.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="0Harmony"> <Reference Include="0Harmony">
<HintPath>..\libs\0Harmony.dll</HintPath> <HintPath>..\libs\0Harmony.dll</HintPath>
</Reference> </Reference>
<Reference Include="Assembly-CSharp"> <Reference Include="Assembly-CSharp">
<HintPath>..\libs\Assembly-CSharp.dll</HintPath> <HintPath>..\libs\Assembly-CSharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="BepInEx"> <Reference Include="BepInEx">
<HintPath>..\libs\BepInEx.dll</HintPath> <HintPath>..\libs\BepInEx.dll</HintPath>
</Reference> </Reference>
<Reference Include="ConfigurationManager"> <Reference Include="ConfigurationManager">
<HintPath>..\libs\ConfigurationManager.dll</HintPath> <HintPath>..\libs\ConfigurationManager.dll</HintPath>
</Reference> </Reference>
<Reference Include="Mafi"> <Reference Include="Mafi">
<HintPath>..\libs\Mafi.dll</HintPath> <HintPath>..\libs\Mafi.dll</HintPath>
</Reference> </Reference>
<Reference Include="Mafi.Base"> <Reference Include="Mafi.Base">
<HintPath>..\libs\Mafi.Base.dll</HintPath> <HintPath>..\libs\Mafi.Base.dll</HintPath>
</Reference> </Reference>
<Reference Include="Mafi.Core"> <Reference Include="Mafi.Core">
<HintPath>..\libs\Mafi.Core.dll</HintPath> <HintPath>..\libs\Mafi.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="Mafi.ModsAuthoringSupport"> <Reference Include="Mafi.ModsAuthoringSupport">
<HintPath>..\libs\Mafi.ModsAuthoringSupport.dll</HintPath> <HintPath>..\libs\Mafi.ModsAuthoringSupport.dll</HintPath>
</Reference> </Reference>
<Reference Include="Mafi.Unity"> <Reference Include="Mafi.Unity">
<HintPath>..\libs\Mafi.Unity.dll</HintPath> <HintPath>..\libs\Mafi.Unity.dll</HintPath>
</Reference> </Reference>
<Reference Include="Sirenix.OdinInspector.Attributes"> <Reference Include="Sirenix.OdinInspector.Attributes">
<HintPath>..\libs\Sirenix.OdinInspector.Attributes.dll</HintPath> <HintPath>..\libs\Sirenix.OdinInspector.Attributes.dll</HintPath>
</Reference> </Reference>
<Reference Include="Sirenix.OdinInspector.CompatibilityLayer"> <Reference Include="Sirenix.OdinInspector.CompatibilityLayer">
<HintPath>..\libs\Sirenix.OdinInspector.CompatibilityLayer.dll</HintPath> <HintPath>..\libs\Sirenix.OdinInspector.CompatibilityLayer.dll</HintPath>
</Reference> </Reference>
<Reference Include="Sirenix.Serialization"> <Reference Include="Sirenix.Serialization">
<HintPath>..\libs\Sirenix.Serialization.dll</HintPath> <HintPath>..\libs\Sirenix.Serialization.dll</HintPath>
</Reference> </Reference>
<Reference Include="Sirenix.Serialization.Config"> <Reference Include="Sirenix.Serialization.Config">
<HintPath>..\libs\Sirenix.Serialization.Config.dll</HintPath> <HintPath>..\libs\Sirenix.Serialization.Config.dll</HintPath>
</Reference> </Reference>
<Reference Include="Sirenix.Utilities"> <Reference Include="Sirenix.Utilities">
<HintPath>..\libs\Sirenix.Utilities.dll</HintPath> <HintPath>..\libs\Sirenix.Utilities.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine"> <Reference Include="UnityEngine">
<HintPath>..\libs\UnityEngine.dll</HintPath> <HintPath>..\libs\UnityEngine.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.CoreModule"> <Reference Include="UnityEngine.CoreModule">
<HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath> <HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@@ -1,35 +1,35 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("CaptainOfIndustry")] [assembly: AssemblyTitle("CaptainOfIndustry")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CaptainOfIndustry")] [assembly: AssemblyProduct("CaptainOfIndustry")]
[assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible // 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 // to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM // The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")] [assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")]
// Version information for an assembly consists of the following four values: // Version information for an assembly consists of the following four values:
// //
// Major Version // Major Version
// Minor Version // Minor Version
// Build Number // Build Number
// Revision // Revision
// //
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,16 +1,16 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Escapists2", "Escapists2\Escapists2.csproj", "{20F983A2-1743-4E96-BFDB-CF5A4F134D2D}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Escapists2", "Escapists2\Escapists2.csproj", "{20F983A2-1743-4E96-BFDB-CF5A4F134D2D}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{20F983A2-1743-4E96-BFDB-CF5A4F134D2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {20F983A2-1743-4E96-BFDB-CF5A4F134D2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20F983A2-1743-4E96-BFDB-CF5A4F134D2D}.Debug|Any CPU.Build.0 = Debug|Any CPU {20F983A2-1743-4E96-BFDB-CF5A4F134D2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20F983A2-1743-4E96-BFDB-CF5A4F134D2D}.Release|Any CPU.ActiveCfg = Release|Any CPU {20F983A2-1743-4E96-BFDB-CF5A4F134D2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20F983A2-1743-4E96-BFDB-CF5A4F134D2D}.Release|Any CPU.Build.0 = Release|Any CPU {20F983A2-1743-4E96-BFDB-CF5A4F134D2D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -1,95 +1,95 @@
using System.Linq; using System.Linq;
using BepInEx; using BepInEx;
using BepInEx.Configuration; using BepInEx.Configuration;
using HarmonyLib; using HarmonyLib;
using HarmonyLib.Tools; using HarmonyLib.Tools;
namespace Escapists2 { namespace Escapists2 {
[BepInPlugin(pluginGuid, pluginName, pluginVersion)] [BepInPlugin(pluginGuid, pluginName, pluginVersion)]
public class Main : BaseUnityPlugin { public class Main : BaseUnityPlugin {
private const string pluginGuid = "CykaMod"; private const string pluginGuid = "CykaMod";
private const string pluginName = "CykaMod"; private const string pluginName = "CykaMod";
private const string pluginVersion = "1.0.0"; private const string pluginVersion = "1.0.0";
public static ConfigEntry<float> xpMultiplier; public static ConfigEntry<float> xpMultiplier;
public void Awake() { public void Awake() {
xpMultiplier = Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 32f))); xpMultiplier = Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 32f)));
// moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f, // moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f,
// new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f)));
// energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f, // energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f,
// new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f))); // new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f)));
// heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f, // heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f,
// new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f))); // new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f)));
// //
// shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f, // shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f,
// new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f))); // new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f)));
// muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f, // muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f,
// new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); // new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
// seekingProjectileVisionConeAngleMultiplier = Config.Bind("Weapons", "Seeking Projectile Cone Vision Angle Multiplier", 1f, // seekingProjectileVisionConeAngleMultiplier = Config.Bind("Weapons", "Seeking Projectile Cone Vision Angle Multiplier", 1f,
// new ConfigDescription("Seeking Projectile Cone Vision Angle Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); // new ConfigDescription("Seeking Projectile Cone Vision Angle Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
// seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f, // seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f,
// new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); // new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
// seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f, // seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f,
// new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); // new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
// //
// magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f, // magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f,
// new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f))); // new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
// magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f, // magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f,
// new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f))); // new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
// beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f, // beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f,
// new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f))); // new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
// beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f, // beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f,
// new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f))); // new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
// //
// wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f, // wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f,
// new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f))); // new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f)));
// wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f, // wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f,
// new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f))); // new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f)));
// wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f, // wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f,
// new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f))); // new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f)));
// //
// fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f, // fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f,
// new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f)));
// fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f, // fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f,
// new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f)));
// wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f, // wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f,
// new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f)));
// wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f, // wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f,
// new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f)));
// jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f, // jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f,
// new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f)));
// //
// minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f, // minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f,
// new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f)));
// minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f, // minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f,
// new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f)));
// //
// allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false); // allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false);
// shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch(); // shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch();
// energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch(); // energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch();
// magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch(); // magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
// magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch(); // magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
// beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch(); // beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
// beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch(); // beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
// fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch(); // fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
// fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch(); // fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
// wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch(); // wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
// wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch(); // wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
// jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch(); // jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch();
// minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch(); // minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
// minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch(); // minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
// wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); // wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
// wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); // wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
// wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); // wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
Logger.LogInfo("Cyka mod loaded"); Logger.LogInfo("Cyka mod loaded");
HarmonyFileLog.Enabled = true; HarmonyFileLog.Enabled = true;
Harmony harmony = new Harmony(pluginGuid); Harmony harmony = new Harmony(pluginGuid);
harmony.PatchAll(); harmony.PatchAll();
var originalMethods = harmony.GetPatchedMethods(); var originalMethods = harmony.GetPatchedMethods();
Logger.LogInfo("Patched " + originalMethods.Count() + " methods"); Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
} }
} }
} }

View File

@@ -1,69 +1,69 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{20F983A2-1743-4E96-BFDB-CF5A4F134D2D}</ProjectGuid> <ProjectGuid>{20F983A2-1743-4E96-BFDB-CF5A4F134D2D}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Escapists2</RootNamespace> <RootNamespace>Escapists2</RootNamespace>
<AssemblyName>Escapists2</AssemblyName> <AssemblyName>Escapists2</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="0Harmony"> <Reference Include="0Harmony">
<HintPath>libs\0Harmony.dll</HintPath> <HintPath>libs\0Harmony.dll</HintPath>
</Reference> </Reference>
<Reference Include="Assembly-CSharp"> <Reference Include="Assembly-CSharp">
<HintPath>libs\Assembly-CSharp.dll</HintPath> <HintPath>libs\Assembly-CSharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="BepInEx"> <Reference Include="BepInEx">
<HintPath>libs\BepInEx.dll</HintPath> <HintPath>libs\BepInEx.dll</HintPath>
</Reference> </Reference>
<Reference Include="ConfigurationManager"> <Reference Include="ConfigurationManager">
<HintPath>libs\ConfigurationManager.dll</HintPath> <HintPath>libs\ConfigurationManager.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="UnityEngine"> <Reference Include="UnityEngine">
<HintPath>libs\UnityEngine.dll</HintPath> <HintPath>libs\UnityEngine.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Class1.cs" /> <Compile Include="Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="XPPatch.cs" /> <Compile Include="XPPatch.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@@ -1,35 +1,35 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("Escapists2")] [assembly: AssemblyTitle("Escapists2")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Escapists2")] [assembly: AssemblyProduct("Escapists2")]
[assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible // 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 // to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM // The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("20F983A2-1743-4E96-BFDB-CF5A4F134D2D")] [assembly: Guid("20F983A2-1743-4E96-BFDB-CF5A4F134D2D")]
// Version information for an assembly consists of the following four values: // Version information for an assembly consists of the following four values:
// //
// Major Version // Major Version
// Minor Version // Minor Version
// Build Number // Build Number
// Revision // Revision
// //
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,12 +1,12 @@
using HarmonyLib; using HarmonyLib;
namespace Escapists2 { namespace Escapists2 {
[HarmonyPatch] [HarmonyPatch]
public class XPPatch { public class XPPatch {
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(CharacterStats), "ModifyStat_Internal")] [HarmonyPatch(typeof(CharacterStats), "ModifyStat_Internal")]
static void XPMulti(ref float change, ref HiddenFloat stat, ref float max) { static void XPMulti(ref float change, ref HiddenFloat stat, ref float max) {
change *= Main.xpMultiplier.Value; change *= Main.xpMultiplier.Value;
} }
} }
} }

View File

@@ -1,4 +1,4 @@
// <autogenerated /> // <autogenerated />
using System; using System;
using System.Reflection; using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")] [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]

View File

@@ -1 +1 @@
09ea03cdb969439a4f3eb3dedfa28a8d8654a867 09ea03cdb969439a4f3eb3dedfa28a8d8654a867

View File

@@ -1,12 +1,12 @@
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\bin\Debug\Escapists2.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\bin\Debug\Escapists2.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\bin\Debug\Escapists2.pdb C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\bin\Debug\Escapists2.pdb
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\obj\Debug\Escapists2.csproj.AssemblyReference.cache C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\obj\Debug\Escapists2.csproj.AssemblyReference.cache
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\obj\Debug\Escapists2.csproj.CoreCompileInputs.cache C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\obj\Debug\Escapists2.csproj.CoreCompileInputs.cache
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\obj\Debug\Escapists2.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\obj\Debug\Escapists2.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\obj\Debug\Escapists2.pdb C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\obj\Debug\Escapists2.pdb
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\bin\Debug\0Harmony.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\bin\Debug\0Harmony.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\bin\Debug\Assembly-CSharp.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\bin\Debug\Assembly-CSharp.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\bin\Debug\BepInEx.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\bin\Debug\BepInEx.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\bin\Debug\ConfigurationManager.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\bin\Debug\ConfigurationManager.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\bin\Debug\UnityEngine.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\bin\Debug\UnityEngine.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\obj\Debug\Escapists2.csproj.CopyComplete C:\Users\Administrator\RiderProjects\Bepinex\Projects\Escapists2\Escapists2\obj\Debug\Escapists2.csproj.CopyComplete

View File

@@ -1,16 +1,16 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HouseFlipper", "HouseFlipper\HouseFlipper.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HouseFlipper", "HouseFlipper\HouseFlipper.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {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}.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.ActiveCfg = Release|Any CPU
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU {EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -1,79 +1,79 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class BeamPropertiesManager { public class BeamPropertiesManager {
private static Dictionary<ModuleItemHolderBeam, float> strenghts = new Dictionary<ModuleItemHolderBeam, float>(); private static Dictionary<ModuleItemHolderBeam, float> strenghts = new Dictionary<ModuleItemHolderBeam, float>();
private static Dictionary<ModuleItemHolderBeam, float> radii = new Dictionary<ModuleItemHolderBeam, float>(); private static Dictionary<ModuleItemHolderBeam, float> radii = new Dictionary<ModuleItemHolderBeam, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleItemHolderBeam), "OnAttached")] [HarmonyPatch(typeof(ModuleItemHolderBeam), "OnAttached")]
static void PostfixCreate(ModuleItemHolderBeam __instance) { static void PostfixCreate(ModuleItemHolderBeam __instance) {
// Console.WriteLine("ModuleItemHolderBeam.OnAttached"); // Console.WriteLine("ModuleItemHolderBeam.OnAttached");
if (!strenghts.ContainsKey(__instance)) { if (!strenghts.ContainsKey(__instance)) {
strenghts.Add(__instance, GetStrength(__instance)); strenghts.Add(__instance, GetStrength(__instance));
radii.Add(__instance, GetRadius(__instance)); radii.Add(__instance, GetRadius(__instance));
// Console.WriteLine("Patching {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Patching {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Patched {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleItemHolderBeam), "OnDetaching")] [HarmonyPatch(typeof(ModuleItemHolderBeam), "OnDetaching")]
static void PostfixDestroy(ModuleItemHolderBeam __instance) { static void PostfixDestroy(ModuleItemHolderBeam __instance) {
// Console.WriteLine("ModuleItemHolderBeam.OnDetaching"); // Console.WriteLine("ModuleItemHolderBeam.OnDetaching");
// Console.WriteLine("Restoring {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Restoring {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Restored {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
strenghts.Remove(__instance); strenghts.Remove(__instance);
radii.Remove(__instance); radii.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleItemHolderBeam", strenghts.Count); // Console.WriteLine("Modifying {0} ModuleItemHolderBeam", strenghts.Count);
foreach (KeyValuePair<ModuleItemHolderBeam, float> keyValuePair in strenghts) { foreach (KeyValuePair<ModuleItemHolderBeam, float> keyValuePair in strenghts) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleItemHolderBeam moduleItemHolderBeam) { static void DoPatchSingle(ModuleItemHolderBeam moduleItemHolderBeam) {
SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam] * Main.beamStrenghtMultiplier.Value); SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam] * Main.beamStrenghtMultiplier.Value);
SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam] * Main.beamRadiusMultiplier.Value); SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam] * Main.beamRadiusMultiplier.Value);
} }
static void DoRestoreSingle(ModuleItemHolderBeam moduleItemHolderBeam) { static void DoRestoreSingle(ModuleItemHolderBeam moduleItemHolderBeam) {
if (strenghts.ContainsKey(moduleItemHolderBeam)) { if (strenghts.ContainsKey(moduleItemHolderBeam)) {
SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam]); SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam]);
SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam]); SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam]);
} }
} }
private static float GetStrength(ModuleItemHolderBeam moduleItemHolderBeam) { private static float GetStrength(ModuleItemHolderBeam moduleItemHolderBeam) {
return Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").GetValue() as float? ?? 0f; return Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").GetValue() as float? ?? 0f;
} }
private static void SetStrength(ModuleItemHolderBeam moduleItemHolderBeam, float value) { private static void SetStrength(ModuleItemHolderBeam moduleItemHolderBeam, float value) {
Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").SetValue(value); Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").SetValue(value);
} }
private static float GetRadius(ModuleItemHolderBeam moduleItemHolderBeam) { private static float GetRadius(ModuleItemHolderBeam moduleItemHolderBeam) {
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup; ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup;
if (moduleItemPickup) { if (moduleItemPickup) {
float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f; float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f;
return radius; return radius;
} }
return 0f; return 0f;
} }
private static void SetRadius(ModuleItemHolderBeam moduleItemHolderBeam, float value) { private static void SetRadius(ModuleItemHolderBeam moduleItemHolderBeam, float value) {
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup; ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup;
if (moduleItemPickup) { if (moduleItemPickup) {
Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value); Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value);
} }
} }
} }
} }

View File

@@ -1,121 +1,121 @@
using System.Linq; using System.Linq;
using BepInEx; using BepInEx;
using BepInEx.Configuration; using BepInEx.Configuration;
using HarmonyLib; using HarmonyLib;
using HarmonyLib.Tools; using HarmonyLib.Tools;
// TODO: Make shield and repair bigger // TODO: Make shield and repair bigger
// TODO: Maybe make props faster, thrusters work fine // TODO: Maybe make props faster, thrusters work fine
namespace HouseFlipper { namespace HouseFlipper {
[BepInPlugin(pluginGuid, pluginName, pluginVersion)] [BepInPlugin(pluginGuid, pluginName, pluginVersion)]
public class Main : BaseUnityPlugin { public class Main : BaseUnityPlugin {
private const string pluginGuid = "CykaMod"; private const string pluginGuid = "CykaMod";
private const string pluginName = "CykaMod"; private const string pluginName = "CykaMod";
private const string pluginVersion = "1.0.0"; private const string pluginVersion = "1.0.0";
public static ConfigEntry<float> xpMultiplier; public static ConfigEntry<float> xpMultiplier;
public static ConfigEntry<float> moneyMultiplier; public static ConfigEntry<float> moneyMultiplier;
public static ConfigEntry<float> energyGenMultiplier; public static ConfigEntry<float> energyGenMultiplier;
public static ConfigEntry<float> heartbeatIntervalMultiplier; public static ConfigEntry<float> heartbeatIntervalMultiplier;
public static ConfigEntry<float> shootingSpeedMultiplier; public static ConfigEntry<float> shootingSpeedMultiplier;
public static ConfigEntry<float> muzzleVelocityMultiplier; public static ConfigEntry<float> muzzleVelocityMultiplier;
public static ConfigEntry<bool> allProjectilesHoming; public static ConfigEntry<bool> allProjectilesHoming;
public static ConfigEntry<float> magnetStrenghtMultiplier; public static ConfigEntry<float> magnetStrenghtMultiplier;
public static ConfigEntry<float> magnetRadiusMultiplier; public static ConfigEntry<float> magnetRadiusMultiplier;
public static ConfigEntry<float> beamStrenghtMultiplier; public static ConfigEntry<float> beamStrenghtMultiplier;
public static ConfigEntry<float> beamRadiusMultiplier; public static ConfigEntry<float> beamRadiusMultiplier;
public static ConfigEntry<float> fuelTankRefillMultiplier; public static ConfigEntry<float> fuelTankRefillMultiplier;
public static ConfigEntry<float> fuelTankCapacityMultiplier; public static ConfigEntry<float> fuelTankCapacityMultiplier;
public static ConfigEntry<float> minerGroundArea; public static ConfigEntry<float> minerGroundArea;
public static ConfigEntry<float> minerMiningSpeed; public static ConfigEntry<float> minerMiningSpeed;
public static ConfigEntry<float> wheelTorqueMultiplier; public static ConfigEntry<float> wheelTorqueMultiplier;
public static ConfigEntry<float> wheelSpeedMultiplier; public static ConfigEntry<float> wheelSpeedMultiplier;
public static ConfigEntry<float> jetThrustMultiplier; public static ConfigEntry<float> jetThrustMultiplier;
public static ConfigEntry<float> seekingProjectileVisionConeAngleMultiplier; public static ConfigEntry<float> seekingProjectileVisionConeAngleMultiplier;
public static ConfigEntry<float> seekingProjectileVisionRangeMultiplier; public static ConfigEntry<float> seekingProjectileVisionRangeMultiplier;
public static ConfigEntry<float> seekingProjectileTurningSpeedMultiplier; public static ConfigEntry<float> seekingProjectileTurningSpeedMultiplier;
public static ConfigEntry<float> wirelessChargingRadiusMultiplier; public static ConfigEntry<float> wirelessChargingRadiusMultiplier;
public static ConfigEntry<float> wirelessChargingPowerPerArcMultiplier; public static ConfigEntry<float> wirelessChargingPowerPerArcMultiplier;
public static ConfigEntry<float> wirelessChargingArcFiringIntervalMultiplier; public static ConfigEntry<float> wirelessChargingArcFiringIntervalMultiplier;
public void Awake() { public void Awake() {
xpMultiplier = Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 32f))); xpMultiplier = Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 32f)));
moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f, moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f,
new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f)));
energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f, energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f,
new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f))); new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f)));
heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f, heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f,
new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f))); new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f)));
shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f, shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f,
new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f))); new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f)));
muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f, muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f,
new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
seekingProjectileVisionConeAngleMultiplier = Config.Bind("Weapons", "Seeking Projectile Cone Vision Angle Multiplier", 1f, seekingProjectileVisionConeAngleMultiplier = Config.Bind("Weapons", "Seeking Projectile Cone Vision Angle Multiplier", 1f,
new ConfigDescription("Seeking Projectile Cone Vision Angle Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); new ConfigDescription("Seeking Projectile Cone Vision Angle Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f, seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f,
new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f, seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f,
new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f, magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f,
new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f))); new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f, magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f,
new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f))); new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f, beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f,
new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f))); new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f, beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f,
new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f))); new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f, wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f,
new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f))); new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f)));
wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f, wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f,
new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f))); new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f)));
wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f, wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f,
new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f))); new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f)));
fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f, fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f,
new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f)));
fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f, fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f,
new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f)));
wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f, wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f,
new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f)));
wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f, wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f,
new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f)));
jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f, jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f,
new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f)));
minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f, minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f,
new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f)));
minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f, minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f,
new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f)));
allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false); allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false);
shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch(); shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch();
energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch(); energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch();
magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch(); magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch(); magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch(); beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch(); beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch(); fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch(); fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch(); wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch(); wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch(); jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch();
minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch(); minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch(); minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
Logger.LogInfo("Cyka mod loaded"); Logger.LogInfo("Cyka mod loaded");
HarmonyFileLog.Enabled = true; HarmonyFileLog.Enabled = true;
Harmony harmony = new Harmony(pluginGuid); Harmony harmony = new Harmony(pluginGuid);
harmony.PatchAll(); harmony.PatchAll();
var originalMethods = harmony.GetPatchedMethods(); var originalMethods = harmony.GetPatchedMethods();
Logger.LogInfo("Patched " + originalMethods.Count() + " methods"); Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
} }
} }
} }

View File

@@ -1,55 +1,55 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class FuelPropertiesManager { public class FuelPropertiesManager {
private static Dictionary<ModuleFuelTank, float> refillRate = new Dictionary<ModuleFuelTank, float>(); private static Dictionary<ModuleFuelTank, float> refillRate = new Dictionary<ModuleFuelTank, float>();
private static Dictionary<ModuleFuelTank, float> capacity = new Dictionary<ModuleFuelTank, float>(); private static Dictionary<ModuleFuelTank, float> capacity = new Dictionary<ModuleFuelTank, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleFuelTank), "OnAttached")] [HarmonyPatch(typeof(ModuleFuelTank), "OnAttached")]
static void PostfixCreate(ModuleFuelTank __instance) { static void PostfixCreate(ModuleFuelTank __instance) {
// Console.WriteLine("ModuleFuelTank.OnAttached"); // Console.WriteLine("ModuleFuelTank.OnAttached");
if (!refillRate.ContainsKey(__instance)) { if (!refillRate.ContainsKey(__instance)) {
refillRate.Add(__instance, __instance.m_RefillRate); refillRate.Add(__instance, __instance.m_RefillRate);
capacity.Add(__instance, __instance.m_Capacity); capacity.Add(__instance, __instance.m_Capacity);
// Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleFuelTank), "OnDetaching")] [HarmonyPatch(typeof(ModuleFuelTank), "OnDetaching")]
static void PostfixDestroy(ModuleFuelTank __instance) { static void PostfixDestroy(ModuleFuelTank __instance) {
// Console.WriteLine("ModuleFuelTank.OnAttached"); // Console.WriteLine("ModuleFuelTank.OnAttached");
// Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
refillRate.Remove(__instance); refillRate.Remove(__instance);
capacity.Remove(__instance); capacity.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleFuelTank", refillRate.Count); // Console.WriteLine("Modifying {0} ModuleFuelTank", refillRate.Count);
foreach (KeyValuePair<ModuleFuelTank, float> keyValuePair in refillRate) { foreach (KeyValuePair<ModuleFuelTank, float> keyValuePair in refillRate) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleFuelTank moduleFuelTank) { static void DoPatchSingle(ModuleFuelTank moduleFuelTank) {
moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank] * Main.fuelTankRefillMultiplier.Value; moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank] * Main.fuelTankRefillMultiplier.Value;
moduleFuelTank.m_Capacity = capacity[moduleFuelTank] * Main.fuelTankCapacityMultiplier.Value; moduleFuelTank.m_Capacity = capacity[moduleFuelTank] * Main.fuelTankCapacityMultiplier.Value;
} }
static void DoRestoreSingle(ModuleFuelTank moduleFuelTank) { static void DoRestoreSingle(ModuleFuelTank moduleFuelTank) {
if (refillRate.ContainsKey(moduleFuelTank)) { if (refillRate.ContainsKey(moduleFuelTank)) {
moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank]; moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank];
moduleFuelTank.m_Capacity = capacity[moduleFuelTank]; moduleFuelTank.m_Capacity = capacity[moduleFuelTank];
} }
} }
} }
} }

View File

@@ -1,58 +1,58 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class GeneratorPropertiesManager { public class GeneratorPropertiesManager {
private static Dictionary<ModuleEnergy, float> generators = new Dictionary<ModuleEnergy, float>(); private static Dictionary<ModuleEnergy, float> generators = new Dictionary<ModuleEnergy, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleEnergy), "OnAttached")] [HarmonyPatch(typeof(ModuleEnergy), "OnAttached")]
static void PostfixCreate(ModuleEnergy __instance) { static void PostfixCreate(ModuleEnergy __instance) {
// Console.WriteLine("ModuleEnergy.OnAttached"); // Console.WriteLine("ModuleEnergy.OnAttached");
if (!generators.ContainsKey(__instance)) { if (!generators.ContainsKey(__instance)) {
generators.Add(__instance, GetValue(__instance)); generators.Add(__instance, GetValue(__instance));
// Console.WriteLine("Patching {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance)); // Console.WriteLine("Patching {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance)); // Console.WriteLine("Patched {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleEnergy), "OnDetaching")] [HarmonyPatch(typeof(ModuleEnergy), "OnDetaching")]
static void PostfixDestroy(ModuleEnergy __instance) { static void PostfixDestroy(ModuleEnergy __instance) {
// Console.WriteLine("ModuleEnergy.OnDetaching"); // Console.WriteLine("ModuleEnergy.OnDetaching");
// Console.WriteLine("Restoring {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance)); // Console.WriteLine("Restoring {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance)); // Console.WriteLine("Restored {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
generators.Remove(__instance); generators.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleEnergy", generators.Count); // Console.WriteLine("Modifying {0} ModuleEnergy", generators.Count);
foreach (KeyValuePair<ModuleEnergy, float> keyValuePair in generators) { foreach (KeyValuePair<ModuleEnergy, float> keyValuePair in generators) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleEnergy moduleEnergy) { static void DoPatchSingle(ModuleEnergy moduleEnergy) {
SetValue(moduleEnergy, generators[moduleEnergy] * Main.energyGenMultiplier.Value); SetValue(moduleEnergy, generators[moduleEnergy] * Main.energyGenMultiplier.Value);
} }
static void DoRestoreSingle(ModuleEnergy moduleEnergy) { static void DoRestoreSingle(ModuleEnergy moduleEnergy) {
if (generators.ContainsKey(moduleEnergy)) { if (generators.ContainsKey(moduleEnergy)) {
SetValue(moduleEnergy, generators[moduleEnergy]); SetValue(moduleEnergy, generators[moduleEnergy]);
} }
} }
private static float GetValue(ModuleEnergy moduleEnergy) { private static float GetValue(ModuleEnergy moduleEnergy) {
return Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").GetValue() as float? ?? 0f; return Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").GetValue() as float? ?? 0f;
} }
private static void SetValue(ModuleEnergy moduleEnergy, float value) { private static void SetValue(ModuleEnergy moduleEnergy, float value) {
Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").SetValue(value); Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").SetValue(value);
} }
} }
} }

View File

@@ -1,22 +1,22 @@
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
using UnityEngine; using UnityEngine;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch(typeof(Projectile), "Fire")] [HarmonyPatch(typeof(Projectile), "Fire")]
public class HomingAndVelocityProjectilePatch { public class HomingAndVelocityProjectilePatch {
private static Dictionary<FireData, float> velocities = new Dictionary<FireData, float>(); private static Dictionary<FireData, float> velocities = new Dictionary<FireData, float>();
static void Prefix(Vector3 fireDirection, ref FireData fireData, ref ModuleWeaponGun weapon, Tank shooter, ref bool seekingRounds, bool replayRounds) { static void Prefix(Vector3 fireDirection, ref FireData fireData, ref ModuleWeaponGun weapon, Tank shooter, ref bool seekingRounds, bool replayRounds) {
if (Main.allProjectilesHoming.Value) { if (Main.allProjectilesHoming.Value) {
seekingRounds = true; seekingRounds = true;
} }
if (!velocities.ContainsKey(fireData)) { if (!velocities.ContainsKey(fireData)) {
velocities.Add(fireData, fireData.m_MuzzleVelocity); velocities.Add(fireData, fireData.m_MuzzleVelocity);
fireData.m_MuzzleVelocity *= Main.muzzleVelocityMultiplier.Value; fireData.m_MuzzleVelocity *= Main.muzzleVelocityMultiplier.Value;
} else if (velocities[fireData] != fireData.m_MuzzleVelocity * Main.muzzleVelocityMultiplier.Value) { } else if (velocities[fireData] != fireData.m_MuzzleVelocity * Main.muzzleVelocityMultiplier.Value) {
fireData.m_MuzzleVelocity = velocities[fireData] * Main.muzzleVelocityMultiplier.Value; fireData.m_MuzzleVelocity = velocities[fireData] * Main.muzzleVelocityMultiplier.Value;
} }
} }
} }
} }

View File

@@ -1,78 +1,78 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid> <ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TerraTech</RootNamespace> <RootNamespace>TerraTech</RootNamespace>
<AssemblyName>TerraTech</AssemblyName> <AssemblyName>TerraTech</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="BeamPropertiesManager.cs" /> <Compile Include="BeamPropertiesManager.cs" />
<Compile Include="Class1.cs" /> <Compile Include="Class1.cs" />
<Compile Include="FuelPropertiesManager.cs" /> <Compile Include="FuelPropertiesManager.cs" />
<Compile Include="GeneratorPropertiesManager.cs" /> <Compile Include="GeneratorPropertiesManager.cs" />
<Compile Include="HomingAndVelocityProjectilePatch.cs" /> <Compile Include="HomingAndVelocityProjectilePatch.cs" />
<Compile Include="MagnetPropertiesManager.cs" /> <Compile Include="MagnetPropertiesManager.cs" />
<Compile Include="MinerPropertiesManager.cs" /> <Compile Include="MinerPropertiesManager.cs" />
<Compile Include="Patches.cs" /> <Compile Include="Patches.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SeekingProjectileManager.cs" /> <Compile Include="SeekingProjectileManager.cs" />
<Compile Include="ThrusterPropertiesManager.cs" /> <Compile Include="ThrusterPropertiesManager.cs" />
<Compile Include="WeaponPropertiesManager.cs" /> <Compile Include="WeaponPropertiesManager.cs" />
<Compile Include="WheelPropertiesManager.cs" /> <Compile Include="WheelPropertiesManager.cs" />
<Compile Include="WirelessChargerPropertiesManager.cs" /> <Compile Include="WirelessChargerPropertiesManager.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="0Harmony"> <Reference Include="0Harmony">
<HintPath>..\libs\0Harmony.dll</HintPath> <HintPath>..\libs\0Harmony.dll</HintPath>
</Reference> </Reference>
<Reference Include="Assembly-CSharp"> <Reference Include="Assembly-CSharp">
<HintPath>..\libs\Assembly-CSharp.dll</HintPath> <HintPath>..\libs\Assembly-CSharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="BepInEx"> <Reference Include="BepInEx">
<HintPath>..\libs\BepInEx.dll</HintPath> <HintPath>..\libs\BepInEx.dll</HintPath>
</Reference> </Reference>
<Reference Include="ConfigurationManager"> <Reference Include="ConfigurationManager">
<HintPath>..\libs\ConfigurationManager.dll</HintPath> <HintPath>..\libs\ConfigurationManager.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine"> <Reference Include="UnityEngine">
<HintPath>..\libs\UnityEngine.dll</HintPath> <HintPath>..\libs\UnityEngine.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.CoreModule"> <Reference Include="UnityEngine.CoreModule">
<HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath> <HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@@ -1,81 +1,81 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class MagnetPropertiesManager { public class MagnetPropertiesManager {
private static Dictionary<ModuleItemHolderMagnet, float> strenghts = new Dictionary<ModuleItemHolderMagnet, float>(); private static Dictionary<ModuleItemHolderMagnet, float> strenghts = new Dictionary<ModuleItemHolderMagnet, float>();
private static Dictionary<ModuleItemHolderMagnet, float> radii = new Dictionary<ModuleItemHolderMagnet, float>(); private static Dictionary<ModuleItemHolderMagnet, float> radii = new Dictionary<ModuleItemHolderMagnet, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnAttached")] [HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnAttached")]
static void PostfixCreate(ModuleItemHolderMagnet __instance) { static void PostfixCreate(ModuleItemHolderMagnet __instance) {
// Console.WriteLine("ModuleItemHolderMagnet.OnAttached"); // Console.WriteLine("ModuleItemHolderMagnet.OnAttached");
if (!strenghts.ContainsKey(__instance)) { if (!strenghts.ContainsKey(__instance)) {
strenghts.Add(__instance, GetStrength(__instance)); strenghts.Add(__instance, GetStrength(__instance));
radii.Add(__instance, GetRadius(__instance)); radii.Add(__instance, GetRadius(__instance));
// Console.WriteLine("Patching {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Patching {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Patched {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnDetaching")] [HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnDetaching")]
static void PostfixDestroy(ModuleItemHolderMagnet __instance) { static void PostfixDestroy(ModuleItemHolderMagnet __instance) {
// Console.WriteLine("ModuleItemHolderMagnet.OnDetaching"); // Console.WriteLine("ModuleItemHolderMagnet.OnDetaching");
// Console.WriteLine("Restoring {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Restoring {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Restored {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
strenghts.Remove(__instance); strenghts.Remove(__instance);
radii.Remove(__instance); radii.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleItemHolderMagnet", strenghts.Count); // Console.WriteLine("Modifying {0} ModuleItemHolderMagnet", strenghts.Count);
foreach (KeyValuePair<ModuleItemHolderMagnet, float> keyValuePair in strenghts) { foreach (KeyValuePair<ModuleItemHolderMagnet, float> keyValuePair in strenghts) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) { static void DoPatchSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) {
SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet] * Main.magnetStrenghtMultiplier.Value); SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet] * Main.magnetStrenghtMultiplier.Value);
SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet] * Main.magnetRadiusMultiplier.Value); SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet] * Main.magnetRadiusMultiplier.Value);
} }
static void DoRestoreSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) { static void DoRestoreSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) {
if (strenghts.ContainsKey(moduleItemHolderMagnet)) { if (strenghts.ContainsKey(moduleItemHolderMagnet)) {
SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet]); SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet]);
} }
if (radii.ContainsKey(moduleItemHolderMagnet)) { if (radii.ContainsKey(moduleItemHolderMagnet)) {
SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet]); SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet]);
} }
} }
private static float GetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet) { private static float GetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet) {
return Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").GetValue() as float? ?? 0f; return Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").GetValue() as float? ?? 0f;
} }
private static void SetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) { private static void SetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) {
Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").SetValue(value); Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").SetValue(value);
} }
private static float GetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet) { private static float GetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet) {
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup; ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup;
if (moduleItemPickup) { if (moduleItemPickup) {
float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f; float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f;
return radius; return radius;
} }
return 0f; return 0f;
} }
private static void SetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) { private static void SetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) {
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup; ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup;
if (moduleItemPickup) { if (moduleItemPickup) {
Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value); Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value);
} }
} }
} }
} }

View File

@@ -1,86 +1,86 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class MinerPropertiesManager { public class MinerPropertiesManager {
private static Dictionary<ModuleItemProducer, float> area = new Dictionary<ModuleItemProducer, float>(); private static Dictionary<ModuleItemProducer, float> area = new Dictionary<ModuleItemProducer, float>();
private static Dictionary<ModuleItemProducer, float> speed = new Dictionary<ModuleItemProducer, float>(); private static Dictionary<ModuleItemProducer, float> speed = new Dictionary<ModuleItemProducer, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleItemProducer), "GetClosestResourceReservoirInRange")] [HarmonyPatch(typeof(ModuleItemProducer), "GetClosestResourceReservoirInRange")]
static void PostfixCreate(ModuleItemProducer __instance) { static void PostfixCreate(ModuleItemProducer __instance) {
// Console.WriteLine("ModuleItemProducer.GetClosestResourceReservoirInRange"); // Console.WriteLine("ModuleItemProducer.GetClosestResourceReservoirInRange");
if (!area.ContainsKey(__instance)) { if (!area.ContainsKey(__instance)) {
area.Add(__instance, GetArea(__instance)); area.Add(__instance, GetArea(__instance));
speed.Add(__instance, GetSpeed(__instance)); speed.Add(__instance, GetSpeed(__instance));
// Console.WriteLine("Patching {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance), // Console.WriteLine("Patching {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
// GetSpeed(__instance)); // GetSpeed(__instance));
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance), // Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
// GetSpeed(__instance)); // GetSpeed(__instance));
} else { } else {
if (GetArea(__instance) == area[__instance]) { if (GetArea(__instance) == area[__instance]) {
// Console.WriteLine("{0} area reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, // Console.WriteLine("{0} area reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name,
// GetArea(__instance), GetSpeed(__instance)); // GetArea(__instance), GetSpeed(__instance));
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance), // Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
// GetSpeed(__instance)); // GetSpeed(__instance));
} }
if (GetSpeed(__instance) == speed[__instance]) { if (GetSpeed(__instance) == speed[__instance]) {
// Console.WriteLine("{0} speed reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, // Console.WriteLine("{0} speed reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name,
// GetArea(__instance), GetSpeed(__instance)); // GetArea(__instance), GetSpeed(__instance));
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance), // Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
// GetSpeed(__instance)); // GetSpeed(__instance));
} }
} }
} }
[HarmonyPostfix] [HarmonyPostfix]
[HarmonyPatch(typeof(ModuleItemProducer), "OnDetaching")] [HarmonyPatch(typeof(ModuleItemProducer), "OnDetaching")]
static void PostfixDestroy(ModuleItemProducer __instance) { static void PostfixDestroy(ModuleItemProducer __instance) {
// Console.WriteLine("ModuleItemProducer.OnRecycle"); // Console.WriteLine("ModuleItemProducer.OnRecycle");
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
area.Remove(__instance); area.Remove(__instance);
speed.Remove(__instance); speed.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleItemProducer", area.Count); // Console.WriteLine("Modifying {0} ModuleItemProducer", area.Count);
foreach (KeyValuePair<ModuleItemProducer, float> keyValuePair in area) { foreach (KeyValuePair<ModuleItemProducer, float> keyValuePair in area) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleItemProducer moduleItemProducer) { static void DoPatchSingle(ModuleItemProducer moduleItemProducer) {
SetArea(moduleItemProducer, area[moduleItemProducer] * Main.minerGroundArea.Value); SetArea(moduleItemProducer, area[moduleItemProducer] * Main.minerGroundArea.Value);
SetSpeed(moduleItemProducer, speed[moduleItemProducer] / Main.minerMiningSpeed.Value); SetSpeed(moduleItemProducer, speed[moduleItemProducer] / Main.minerMiningSpeed.Value);
} }
static void DoRestoreSingle(ModuleItemProducer moduleItemProducer) { static void DoRestoreSingle(ModuleItemProducer moduleItemProducer) {
if (area.ContainsKey(moduleItemProducer)) { if (area.ContainsKey(moduleItemProducer)) {
SetArea(moduleItemProducer, area[moduleItemProducer]); SetArea(moduleItemProducer, area[moduleItemProducer]);
SetSpeed(moduleItemProducer, speed[moduleItemProducer]); SetSpeed(moduleItemProducer, speed[moduleItemProducer]);
} }
} }
private static float GetArea(ModuleItemProducer moduleItemProducer) { private static float GetArea(ModuleItemProducer moduleItemProducer) {
return Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").GetValue() as float? ?? 0f; return Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").GetValue() as float? ?? 0f;
} }
private static void SetArea(ModuleItemProducer moduleItemProducer, float value) { private static void SetArea(ModuleItemProducer moduleItemProducer, float value) {
Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").SetValue(value); Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").SetValue(value);
} }
private static float GetSpeed(ModuleItemProducer moduleItemProducer) { private static float GetSpeed(ModuleItemProducer moduleItemProducer) {
return Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").GetValue() as float? ?? 0f; return Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").GetValue() as float? ?? 0f;
} }
private static void SetSpeed(ModuleItemProducer moduleItemProducer, float value) { private static void SetSpeed(ModuleItemProducer moduleItemProducer, float value) {
Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").SetValue(value); Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").SetValue(value);
} }
} }
} }

View File

@@ -1,24 +1,24 @@
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class Patches { public class Patches {
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ManLicenses), "AddXP")] [HarmonyPatch(typeof(ManLicenses), "AddXP")]
static void XPMulti(FactionSubTypes corporation, ref int xp, bool showUI = true) { static void XPMulti(FactionSubTypes corporation, ref int xp, bool showUI = true) {
xp = (int)(xp * Main.xpMultiplier.Value); xp = (int)(xp * Main.xpMultiplier.Value);
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ManPlayer), "AddMoney")] [HarmonyPatch(typeof(ManPlayer), "AddMoney")]
static void MoneyMulti(ref int amount) { static void MoneyMulti(ref int amount) {
amount = (int)(amount * Main.moneyMultiplier.Value); amount = (int)(amount * Main.moneyMultiplier.Value);
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(TechHolders), "SetHeartbeatInterval")] [HarmonyPatch(typeof(TechHolders), "SetHeartbeatInterval")]
static void HeartbeatMulti(ref float interval) { static void HeartbeatMulti(ref float interval) {
interval *= Main.heartbeatIntervalMultiplier.Value; interval *= Main.heartbeatIntervalMultiplier.Value;
} }
} }
} }

View File

@@ -1,35 +1,35 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("TerraTech")] [assembly: AssemblyTitle("TerraTech")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TerraTech")] [assembly: AssemblyProduct("TerraTech")]
[assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible // 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 // to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM // The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")] [assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")]
// Version information for an assembly consists of the following four values: // Version information for an assembly consists of the following four values:
// //
// Major Version // Major Version
// Minor Version // Minor Version
// Build Number // Build Number
// Revision // Revision
// //
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,24 +1,24 @@
using System; using System;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
public class SeekingProjectileManager { public class SeekingProjectileManager {
[HarmonyPatch(typeof(SeekingProjectile), "OnSpawn")] [HarmonyPatch(typeof(SeekingProjectile), "OnSpawn")]
class Patch { class Patch {
static void Postfix(SeekingProjectile __instance) { static void Postfix(SeekingProjectile __instance) {
Console.WriteLine("SeekingProjectile created"); Console.WriteLine("SeekingProjectile created");
SetField(__instance, "m_VisionConeAngle", Main.seekingProjectileVisionConeAngleMultiplier.Value * GetField(__instance, "m_VisionConeAngle")); SetField(__instance, "m_VisionConeAngle", Main.seekingProjectileVisionConeAngleMultiplier.Value * GetField(__instance, "m_VisionConeAngle"));
SetField(__instance, "m_VisionRange", Main.seekingProjectileVisionRangeMultiplier.Value * GetField(__instance, "m_VisionRange")); SetField(__instance, "m_VisionRange", Main.seekingProjectileVisionRangeMultiplier.Value * GetField(__instance, "m_VisionRange"));
SetField(__instance, "m_TurnSpeed", Main.seekingProjectileTurningSpeedMultiplier.Value * GetField(__instance, "m_TurnSpeed")); SetField(__instance, "m_TurnSpeed", Main.seekingProjectileTurningSpeedMultiplier.Value * GetField(__instance, "m_TurnSpeed"));
} }
} }
private static float GetField(SeekingProjectile seekingProjectile, string field) { private static float GetField(SeekingProjectile seekingProjectile, string field) {
return Traverse.Create(seekingProjectile).Field(field).GetValue() as float? ?? 0f; return Traverse.Create(seekingProjectile).Field(field).GetValue() as float? ?? 0f;
} }
private static void SetField(SeekingProjectile seekingProjectile, string field, float value) { private static void SetField(SeekingProjectile seekingProjectile, string field, float value) {
Traverse.Create(seekingProjectile).Field(field).SetValue(value); Traverse.Create(seekingProjectile).Field(field).SetValue(value);
} }
} }
} }

View File

@@ -1,89 +1,89 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class ThrusterPropertiesManager { public class ThrusterPropertiesManager {
private static Dictionary<ModuleBooster, Dictionary<BoosterJet, float>> boosters = new Dictionary<ModuleBooster, Dictionary<BoosterJet, float>>(); private static Dictionary<ModuleBooster, Dictionary<BoosterJet, float>> boosters = new Dictionary<ModuleBooster, Dictionary<BoosterJet, float>>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleBooster), "OnAttached")] [HarmonyPatch(typeof(ModuleBooster), "OnAttached")]
static void PostfixCreate(ModuleBooster __instance) { static void PostfixCreate(ModuleBooster __instance) {
// Console.WriteLine("ModuleBooster.OnAttached"); // Console.WriteLine("ModuleBooster.OnAttached");
if (!boosters.ContainsKey(__instance)) { if (!boosters.ContainsKey(__instance)) {
boosters.Add(__instance, Map(__instance)); boosters.Add(__instance, Map(__instance));
// Console.WriteLine("Patching {0}; force: {1}", __instance.name, GetForceAsString(__instance)); // Console.WriteLine("Patching {0}; force: {1}", __instance.name, GetForceAsString(__instance));
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; force: {1}", __instance.name, GetForceAsString(__instance)); // Console.WriteLine("Patched {0}; force: {1}", __instance.name, GetForceAsString(__instance));
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleBooster), "OnDetaching")] [HarmonyPatch(typeof(ModuleBooster), "OnDetaching")]
static void PostfixDestroy(ModuleBooster __instance) { static void PostfixDestroy(ModuleBooster __instance) {
// Console.WriteLine("ModuleBooster.OnDetaching"); // Console.WriteLine("ModuleBooster.OnDetaching");
// Console.WriteLine("Restoring {0}; force: {1}", __instance.name, GetForceAsString(__instance)); // Console.WriteLine("Restoring {0}; force: {1}", __instance.name, GetForceAsString(__instance));
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; force: {1}", __instance.name, GetForceAsString(__instance)); // Console.WriteLine("Restored {0}; force: {1}", __instance.name, GetForceAsString(__instance));
boosters.Remove(__instance); boosters.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleBooster", boosters.Count); // Console.WriteLine("Modifying {0} ModuleBooster", boosters.Count);
foreach (KeyValuePair<ModuleBooster, Dictionary<BoosterJet, float>> keyValuePair in boosters) { foreach (KeyValuePair<ModuleBooster, Dictionary<BoosterJet, float>> keyValuePair in boosters) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleBooster moduleBooster) { static void DoPatchSingle(ModuleBooster moduleBooster) {
List<BoosterJet> jets = GetValue(moduleBooster); List<BoosterJet> jets = GetValue(moduleBooster);
for (var i = 0; i < jets.Count; i++) { for (var i = 0; i < jets.Count; i++) {
boosters[moduleBooster][jets[i]] = GetValue(jets[i]); boosters[moduleBooster][jets[i]] = GetValue(jets[i]);
SetValue(jets[i], GetValue(jets[i]) * Main.jetThrustMultiplier.Value); SetValue(jets[i], GetValue(jets[i]) * Main.jetThrustMultiplier.Value);
} }
SetValue(moduleBooster, jets); SetValue(moduleBooster, jets);
} }
static void DoRestoreSingle(ModuleBooster moduleBooster) { static void DoRestoreSingle(ModuleBooster moduleBooster) {
if (boosters.ContainsKey(moduleBooster)) { if (boosters.ContainsKey(moduleBooster)) {
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) { foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
SetValue(boosterJet, boosters[moduleBooster][boosterJet]); SetValue(boosterJet, boosters[moduleBooster][boosterJet]);
} }
} }
} }
private static Dictionary<BoosterJet, float> Map(ModuleBooster moduleBooster) { private static Dictionary<BoosterJet, float> Map(ModuleBooster moduleBooster) {
Dictionary<BoosterJet, float> jets = new Dictionary<BoosterJet, float>(); Dictionary<BoosterJet, float> jets = new Dictionary<BoosterJet, float>();
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) { foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
jets.Add(boosterJet, GetValue(boosterJet)); jets.Add(boosterJet, GetValue(boosterJet));
} }
return jets; return jets;
} }
private static List<BoosterJet> GetValue(ModuleBooster moduleBooster) { private static List<BoosterJet> GetValue(ModuleBooster moduleBooster) {
return Traverse.Create(moduleBooster).Field("jets").GetValue() as List<BoosterJet>; return Traverse.Create(moduleBooster).Field("jets").GetValue() as List<BoosterJet>;
} }
private static void SetValue(ModuleBooster moduleBooster, List<BoosterJet> value) { private static void SetValue(ModuleBooster moduleBooster, List<BoosterJet> value) {
Traverse.Create(moduleBooster).Field("jets").SetValue(value); Traverse.Create(moduleBooster).Field("jets").SetValue(value);
} }
private static float GetValue(BoosterJet boosterJet) { private static float GetValue(BoosterJet boosterJet) {
return Traverse.Create(boosterJet).Field("m_Force").GetValue() as float? ?? 0f; return Traverse.Create(boosterJet).Field("m_Force").GetValue() as float? ?? 0f;
} }
private static void SetValue(BoosterJet boosterJet, float value) { private static void SetValue(BoosterJet boosterJet, float value) {
Traverse.Create(boosterJet).Field("m_Force").SetValue(value); Traverse.Create(boosterJet).Field("m_Force").SetValue(value);
} }
private static string GetForceAsString(ModuleBooster moduleBooster) { private static string GetForceAsString(ModuleBooster moduleBooster) {
string result = ""; string result = "";
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) { foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
result += GetValue(boosterJet) + ", "; result += GetValue(boosterJet) + ", ";
} }
return result; return result;
} }
} }
} }

View File

@@ -1,51 +1,51 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using BepInEx.Configuration; using BepInEx.Configuration;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class WeaponPropertiesManager { public class WeaponPropertiesManager {
private static Dictionary<ModuleWeaponGun, float> shotCooldown = new Dictionary<ModuleWeaponGun, float>(); private static Dictionary<ModuleWeaponGun, float> shotCooldown = new Dictionary<ModuleWeaponGun, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleWeaponGun), "OnAttached")] [HarmonyPatch(typeof(ModuleWeaponGun), "OnAttached")]
static void PostfixCreate(ModuleWeaponGun __instance) { static void PostfixCreate(ModuleWeaponGun __instance) {
// Console.WriteLine("ModuleWeaponGun.OnAttached"); // Console.WriteLine("ModuleWeaponGun.OnAttached");
if (!shotCooldown.ContainsKey(__instance)) { if (!shotCooldown.ContainsKey(__instance)) {
shotCooldown.Add(__instance, __instance.m_ShotCooldown); shotCooldown.Add(__instance, __instance.m_ShotCooldown);
// Console.WriteLine("Patching {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown); // Console.WriteLine("Patching {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown); // Console.WriteLine("Patched {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleWeaponGun), "OnDetaching")] [HarmonyPatch(typeof(ModuleWeaponGun), "OnDetaching")]
static void PostfixDestroy(ModuleWeaponGun __instance) { static void PostfixDestroy(ModuleWeaponGun __instance) {
// Console.WriteLine("ModuleWeaponGun.OnDetaching"); // Console.WriteLine("ModuleWeaponGun.OnDetaching");
// Console.WriteLine("Restoring {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown); // Console.WriteLine("Restoring {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown); // Console.WriteLine("Restored {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
shotCooldown.Remove(__instance); shotCooldown.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleWeaponGun", shotCooldown.Count); // Console.WriteLine("Modifying {0} ModuleWeaponGun", shotCooldown.Count);
foreach (KeyValuePair<ModuleWeaponGun, float> keyValuePair in shotCooldown) { foreach (KeyValuePair<ModuleWeaponGun, float> keyValuePair in shotCooldown) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleWeaponGun moduleWeaponGun) { static void DoPatchSingle(ModuleWeaponGun moduleWeaponGun) {
moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun] / Main.shootingSpeedMultiplier.Value; moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun] / Main.shootingSpeedMultiplier.Value;
} }
static void DoRestoreSingle(ModuleWeaponGun moduleWeaponGun) { static void DoRestoreSingle(ModuleWeaponGun moduleWeaponGun) {
if (shotCooldown.ContainsKey(moduleWeaponGun)) { if (shotCooldown.ContainsKey(moduleWeaponGun)) {
moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun]; moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun];
} }
} }
} }
} }

View File

@@ -1,63 +1,63 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class WheelPropertiesManager { public class WheelPropertiesManager {
private static Dictionary<ModuleWheels, float> torques = new Dictionary<ModuleWheels, float>(); private static Dictionary<ModuleWheels, float> torques = new Dictionary<ModuleWheels, float>();
private static Dictionary<ModuleWheels, float> maxRpm = new Dictionary<ModuleWheels, float>(); private static Dictionary<ModuleWheels, float> maxRpm = new Dictionary<ModuleWheels, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleWheels), "OnAttached")] [HarmonyPatch(typeof(ModuleWheels), "OnAttached")]
static void PostfixCreate(ModuleWheels __instance) { static void PostfixCreate(ModuleWheels __instance) {
// Console.WriteLine("ModuleWheels.OnAttached"); // Console.WriteLine("ModuleWheels.OnAttached");
if (!torques.ContainsKey(__instance)) { if (!torques.ContainsKey(__instance)) {
torques.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxTorque); torques.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxTorque);
maxRpm.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxRpm); maxRpm.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxRpm);
// Console.WriteLine("Patching {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name, // Console.WriteLine("Patching {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
// __instance.m_TorqueParams.torqueCurveMaxTorque, // __instance.m_TorqueParams.torqueCurveMaxTorque,
// __instance.m_TorqueParams.torqueCurveMaxRpm); // __instance.m_TorqueParams.torqueCurveMaxRpm);
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name, // Console.WriteLine("Patched {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
// __instance.m_TorqueParams.torqueCurveMaxTorque, // __instance.m_TorqueParams.torqueCurveMaxTorque,
// __instance.m_TorqueParams.torqueCurveMaxRpm); // __instance.m_TorqueParams.torqueCurveMaxRpm);
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleWheels), "OnDetaching")] [HarmonyPatch(typeof(ModuleWheels), "OnDetaching")]
static void PostfixDestroy(ModuleWheels __instance) { static void PostfixDestroy(ModuleWheels __instance) {
// Console.WriteLine("ModuleWheels.OnDetaching"); // Console.WriteLine("ModuleWheels.OnDetaching");
// Console.WriteLine("Restoring {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name, // Console.WriteLine("Restoring {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
// __instance.m_TorqueParams.torqueCurveMaxTorque, // __instance.m_TorqueParams.torqueCurveMaxTorque,
// __instance.m_TorqueParams.torqueCurveMaxRpm); // __instance.m_TorqueParams.torqueCurveMaxRpm);
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name, // Console.WriteLine("Restored {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
// __instance.m_TorqueParams.torqueCurveMaxTorque, // __instance.m_TorqueParams.torqueCurveMaxTorque,
// __instance.m_TorqueParams.torqueCurveMaxRpm); // __instance.m_TorqueParams.torqueCurveMaxRpm);
torques.Remove(__instance); torques.Remove(__instance);
maxRpm.Remove(__instance); maxRpm.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleWheels", torques.Count); // Console.WriteLine("Modifying {0} ModuleWheels", torques.Count);
foreach (KeyValuePair<ModuleWheels, float> keyValuePair in torques) { foreach (KeyValuePair<ModuleWheels, float> keyValuePair in torques) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleWheels moduleWheels) { static void DoPatchSingle(ModuleWheels moduleWheels) {
moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels] * Main.wheelSpeedMultiplier.Value; moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels] * Main.wheelSpeedMultiplier.Value;
moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels] * Main.wheelTorqueMultiplier.Value; moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels] * Main.wheelTorqueMultiplier.Value;
} }
static void DoRestoreSingle(ModuleWheels moduleWheels) { static void DoRestoreSingle(ModuleWheels moduleWheels) {
if (torques.ContainsKey(moduleWheels)) { if (torques.ContainsKey(moduleWheels)) {
moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels]; moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels];
moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels]; moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels];
} }
} }
} }
} }

View File

@@ -1,60 +1,60 @@
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
// TODO: Fix this, no workey // TODO: Fix this, no workey
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class WirelessChargerPropertiesManager { public class WirelessChargerPropertiesManager {
private static Dictionary<ModuleRemoteCharger, float> radius = new Dictionary<ModuleRemoteCharger, float>(); private static Dictionary<ModuleRemoteCharger, float> radius = new Dictionary<ModuleRemoteCharger, float>();
private static Dictionary<ModuleRemoteCharger, float> transferPerArc = new Dictionary<ModuleRemoteCharger, float>(); private static Dictionary<ModuleRemoteCharger, float> transferPerArc = new Dictionary<ModuleRemoteCharger, float>();
private static Dictionary<ModuleRemoteCharger, float> arcFiringInterval = new Dictionary<ModuleRemoteCharger, float>(); private static Dictionary<ModuleRemoteCharger, float> arcFiringInterval = new Dictionary<ModuleRemoteCharger, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleRemoteCharger), "OnAttached")] [HarmonyPatch(typeof(ModuleRemoteCharger), "OnAttached")]
static void PostfixCreate(ModuleRemoteCharger __instance) { static void PostfixCreate(ModuleRemoteCharger __instance) {
// Console.WriteLine("ModuleRemoteCharger.OnAttached"); // Console.WriteLine("ModuleRemoteCharger.OnAttached");
if (!radius.ContainsKey(__instance)) { if (!radius.ContainsKey(__instance)) {
radius.Add(__instance, __instance.m_ChargingRadius); radius.Add(__instance, __instance.m_ChargingRadius);
transferPerArc.Add(__instance, __instance.m_PowerTransferPerArc); transferPerArc.Add(__instance, __instance.m_PowerTransferPerArc);
arcFiringInterval.Add(__instance, __instance.m_ArcFiringInterval); arcFiringInterval.Add(__instance, __instance.m_ArcFiringInterval);
// Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleRemoteCharger), "OnDetaching")] [HarmonyPatch(typeof(ModuleRemoteCharger), "OnDetaching")]
static void PostfixDestroy(ModuleRemoteCharger __instance) { static void PostfixDestroy(ModuleRemoteCharger __instance) {
// Console.WriteLine("ModuleRemoteCharger.OnAttached"); // Console.WriteLine("ModuleRemoteCharger.OnAttached");
// Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
radius.Remove(__instance); radius.Remove(__instance);
transferPerArc.Remove(__instance); transferPerArc.Remove(__instance);
arcFiringInterval.Remove(__instance); arcFiringInterval.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleRemoteCharger", radius.Count); // Console.WriteLine("Modifying {0} ModuleRemoteCharger", radius.Count);
foreach (KeyValuePair<ModuleRemoteCharger, float> keyValuePair in radius) { foreach (KeyValuePair<ModuleRemoteCharger, float> keyValuePair in radius) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleRemoteCharger moduleRemoteCharger) { static void DoPatchSingle(ModuleRemoteCharger moduleRemoteCharger) {
moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger] * Main.wirelessChargingRadiusMultiplier.Value; moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger] * Main.wirelessChargingRadiusMultiplier.Value;
moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger] * Main.wirelessChargingPowerPerArcMultiplier.Value; moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger] * Main.wirelessChargingPowerPerArcMultiplier.Value;
moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger] * Main.wirelessChargingArcFiringIntervalMultiplier.Value; moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger] * Main.wirelessChargingArcFiringIntervalMultiplier.Value;
} }
static void DoRestoreSingle(ModuleRemoteCharger moduleRemoteCharger) { static void DoRestoreSingle(ModuleRemoteCharger moduleRemoteCharger) {
if (radius.ContainsKey(moduleRemoteCharger)) { if (radius.ContainsKey(moduleRemoteCharger)) {
moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger]; moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger];
moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger]; moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger];
moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger]; moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger];
} }
} }
} }
} }

View File

@@ -1,4 +1,4 @@
// <autogenerated /> // <autogenerated />
using System; using System;
using System.Reflection; using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

View File

@@ -1,11 +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.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\TerraTech.pdb 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\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\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\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.CoreModule.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\UnityEngine.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.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.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.pdb C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.pdb
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\ConfigurationManager.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\ConfigurationManager.dll

View File

@@ -1,16 +1,16 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Regiments", "Regiments\Regiments.csproj", "{DA9D274E-486F-4F82-84FF-CD9388CB0B09}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Regiments", "Regiments\Regiments.csproj", "{DA9D274E-486F-4F82-84FF-CD9388CB0B09}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Debug|Any CPU.Build.0 = Debug|Any CPU {DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.ActiveCfg = Release|Any CPU {DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.Build.0 = Release|Any CPU {DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -56,7 +56,7 @@ namespace Regiments {
Console.WriteLine("Base range is 0, assigning new: {0}", baseHqValue); Console.WriteLine("Base range is 0, assigning new: {0}", baseHqValue);
} }
var hqRadius = Traverse.Create(__instance).Field("platoon").Field("parameters").Field("HQRadius"); var hqRadius = Traverse.Create(__instance.platoon.parameters).Field("HQRadius");
hqRadius.SetValue(baseHqValue * Main.HQAOEMultiplier.Value); hqRadius.SetValue(baseHqValue * Main.HQAOEMultiplier.Value);
Console.WriteLine("HQ radius patched to: {0}", __instance.platoon.parameters.HQRadius); Console.WriteLine("HQ radius patched to: {0}", __instance.platoon.parameters.HQRadius);
} }

View File

@@ -1,35 +1,35 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("Regiments")] [assembly: AssemblyTitle("Regiments")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Regiments")] [assembly: AssemblyProduct("Regiments")]
[assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible // 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 // to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM // The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("DA9D274E-486F-4F82-84FF-CD9388CB0B09")] [assembly: Guid("DA9D274E-486F-4F82-84FF-CD9388CB0B09")]
// Version information for an assembly consists of the following four values: // Version information for an assembly consists of the following four values:
// //
// Major Version // Major Version
// Minor Version // Minor Version
// Build Number // Build Number
// Revision // Revision
// //
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,274 +1,274 @@
// using System; // using System;
// using System.Collections.Generic; // using System.Collections.Generic;
// using System.Linq; // using System.Linq;
// using System.Reflection.Emit; // using System.Reflection.Emit;
// using BepInEx; // using BepInEx;
// using BepInEx.Configuration; // using BepInEx.Configuration;
// using HarmonyLib; // using HarmonyLib;
// using HarmonyLib.Tools; // using HarmonyLib.Tools;
// //
// namespace Regiments { // namespace Regiments {
// [BepInPlugin(pluginGuid, pluginName, pluginVersion)] // [BepInPlugin(pluginGuid, pluginName, pluginVersion)]
// public class Main : BaseUnityPlugin { // public class Main : BaseUnityPlugin {
// private const string pluginGuid = "CykaMod"; // private const string pluginGuid = "CykaMod";
// private const string pluginName = "CykaMod"; // private const string pluginName = "CykaMod";
// private const string pluginVersion = "1.0.0"; // private const string pluginVersion = "1.0.0";
// //
// public static ConfigEntry<float> skillCap; // public static ConfigEntry<float> skillCap;
// public static ConfigEntry<float> workSpeed; // public static ConfigEntry<float> workSpeed;
// public static ConfigEntry<float> workResult; // public static ConfigEntry<float> workResult;
// public static ConfigEntry<bool> alwaysCritical; // public static ConfigEntry<bool> alwaysCritical;
// public static ConfigEntry<float> gameSpeed; // public static ConfigEntry<float> gameSpeed;
// public static ConfigEntry<int> fans; // public static ConfigEntry<int> fans;
// public static ConfigEntry<long> money; // public static ConfigEntry<long> money;
// //
// // // //
// // private void Awake() // // private void Awake()
// // { // // {
// // configGreeting = Config.Bind("General", // The section under which the option is shown // // configGreeting = Config.Bind("General", // The section under which the option is shown
// // "GreetingText", // The key of the configuration option in the configuration file // // "GreetingText", // The key of the configuration option in the configuration file
// // "Hello, world!", // The default value // // "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 // // "A greeting text to show when the game is launched"); // Description of the option to show in the config file
// // // //
// //
// public void Awake() { // public void Awake() {
// skillCap = Config.Bind("General", "Skill Cap", 100f); // skillCap = Config.Bind("General", "Skill Cap", 100f);
// workSpeed = Config.Bind("General", "Work Speed Multiplier", 4f); // workSpeed = Config.Bind("General", "Work Speed Multiplier", 4f);
// workResult = Config.Bind("General", "Work Result Multiplier", 4f); // workResult = Config.Bind("General", "Work Result Multiplier", 4f);
// alwaysCritical = Config.Bind("General", "Work Always Critical", false); // alwaysCritical = Config.Bind("General", "Work Always Critical", false);
// gameSpeed = Config.Bind("General", "Game Speed Multiplier", 3f); // gameSpeed = Config.Bind("General", "Game Speed Multiplier", 3f);
// fans = Config.Bind("General", "Fans Multiplier", 2); // fans = Config.Bind("General", "Fans Multiplier", 2);
// money = Config.Bind("General", "Money Multiplier", 2L); // money = Config.Bind("General", "Money Multiplier", 2L);
// //
// Logger.LogInfo("Cyka mod loaded"); // Logger.LogInfo("Cyka mod loaded");
// HarmonyFileLog.Enabled = true; // HarmonyFileLog.Enabled = true;
// Harmony harmony = new Harmony(pluginGuid); // Harmony harmony = new Harmony(pluginGuid);
// harmony.PatchAll(); // harmony.PatchAll();
// var originalMethods = harmony.GetPatchedMethods(); // var originalMethods = harmony.GetPatchedMethods();
// Logger.LogInfo("Patched " + originalMethods.Count() + " methods"); // Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
// } // }
// //
// public static bool IsMatch(List<CodeInstruction> codes, int index, List<CodeInstruction> matcher) { // public static bool IsMatch(List<CodeInstruction> codes, int index, List<CodeInstruction> matcher) {
// for (var i = 0; i < matcher.Count; i++) { // for (var i = 0; i < matcher.Count; i++) {
// if (codes[index + i].opcode != matcher[i].opcode) { // if (codes[index + i].opcode != matcher[i].opcode) {
// return false; // return false;
// } // }
// } // }
// return true; // return true;
// } // }
// //
// public static void InsertAt(List<CodeInstruction> codes, int index, List<CodeInstruction> toInsert) { // public static void InsertAt(List<CodeInstruction> codes, int index, List<CodeInstruction> toInsert) {
// for (var i = 0; i < toInsert.Count; i++) { // for (var i = 0; i < toInsert.Count; i++) {
// codes.Insert(index + i, toInsert[i]); // codes.Insert(index + i, toInsert[i]);
// } // }
// } // }
// } // }
// //
// [HarmonyPatch(typeof(characterScript), "GetSkillCap")] // [HarmonyPatch(typeof(characterScript), "GetSkillCap")]
// public class SkillCapPatch { // public class SkillCapPatch {
// static void Postfix(ref float __result) { // static void Postfix(ref float __result) {
// // Console.WriteLine("GetSkillCap Postfix! Result is " + __result); // // Console.WriteLine("GetSkillCap Postfix! Result is " + __result);
// __result = Main.skillCap.Value; // __result = Main.skillCap.Value;
// } // }
// } // }
// //
// [HarmonyPatch(typeof(characterScript), "GetSkillCap_Skill")] // [HarmonyPatch(typeof(characterScript), "GetSkillCap_Skill")]
// public class SkillCapSkillPatch { // public class SkillCapSkillPatch {
// static void Postfix(ref float __result) { // static void Postfix(ref float __result) {
// // Console.WriteLine("GetSkillCap_Skill Postfix! Result is " + __result); // // Console.WriteLine("GetSkillCap_Skill Postfix! Result is " + __result);
// __result = Main.skillCap.Value; // __result = Main.skillCap.Value;
// } // }
// } // }
// //
// [HarmonyPatch(typeof(characterScript), "GetWorkSpeed")] // [HarmonyPatch(typeof(characterScript), "GetWorkSpeed")]
// public class GetWorkSpeedPatch { // public class GetWorkSpeedPatch {
// static void Postfix(ref float __result) { // static void Postfix(ref float __result) {
// // Console.WriteLine("GetWorkSpeed Postfix! Result is " + __result); // // Console.WriteLine("GetWorkSpeed Postfix! Result is " + __result);
// __result *= Main.workSpeed.Value; // __result *= Main.workSpeed.Value;
// } // }
// } // }
// //
// [HarmonyPatch(typeof(characterScript), "GetWorkResult")] // [HarmonyPatch(typeof(characterScript), "GetWorkResult")]
// public class GetWorkResultPatch { // public class GetWorkResultPatch {
// static void Prefix(ref float f) { // static void Prefix(ref float f) {
// // Console.WriteLine("GetWorkResult Postfix! f is " + f); // // Console.WriteLine("GetWorkResult Postfix! f is " + f);
// f *= Main.workResult.Value; // f *= Main.workResult.Value;
// } // }
// } // }
// //
// [HarmonyPatch(typeof(characterScript), "GetCritic")] // [HarmonyPatch(typeof(characterScript), "GetCritic")]
// public class GetCriticPatch { // public class GetCriticPatch {
// static void Postfix(ref bool __result) { // static void Postfix(ref bool __result) {
// // Console.WriteLine("GetWorkResult Postfix! f is " + f); // // Console.WriteLine("GetWorkResult Postfix! f is " + f);
// if (Main.alwaysCritical.Value) { // if (Main.alwaysCritical.Value) {
// __result = true; // __result = true;
// } // }
// } // }
// } // }
// //
// [HarmonyPatch(typeof(mainScript), "SetGameSpeed")] // [HarmonyPatch(typeof(mainScript), "SetGameSpeed")]
// public class GameSpeedPatch { // public class GameSpeedPatch {
// static void Prefix(ref float f) { // static void Prefix(ref float f) {
// // Console.WriteLine("SetGameSpeed Prefix! Argument is " + f); // // Console.WriteLine("SetGameSpeed Prefix! Argument is " + f);
// if (f > 1) { // if (f > 1) {
// f *= Main.gameSpeed.Value; // f *= Main.gameSpeed.Value;
// // Console.WriteLine("Argument modified to " + f); // // Console.WriteLine("Argument modified to " + f);
// } // }
// } // }
// } // }
// //
// [HarmonyPatch(typeof(characterScript), "Learn")] // [HarmonyPatch(typeof(characterScript), "Learn")]
// public static class LearnManyPatch { // public static class LearnManyPatch {
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { // static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
// var codes = new List<CodeInstruction>(instructions); // var codes = new List<CodeInstruction>(instructions);
// //
// for (var i = 0; i < 5; i++) { // for (var i = 0; i < 5; i++) {
// if (codes[i].opcode == OpCodes.Ldc_R4) { // if (codes[i].opcode == OpCodes.Ldc_R4) {
// Console.WriteLine("Changing " + codes[i]); // Console.WriteLine("Changing " + codes[i]);
// codes[i].operand = (float)codes[i].operand * 64; // codes[i].operand = (float)codes[i].operand * 64;
// Console.WriteLine("Changed " + codes[i]); // Console.WriteLine("Changed " + codes[i]);
// } // }
// } // }
// //
// return codes.AsEnumerable(); // return codes.AsEnumerable();
// } // }
// } // }
// //
// [HarmonyPatch(typeof(arbeitsmarkt), "ArbeitsmarktUpdaten")] // [HarmonyPatch(typeof(arbeitsmarkt), "ArbeitsmarktUpdaten")]
// public static class ManyEmployeesPatch { // public static class ManyEmployeesPatch {
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { // static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
// var codes = new List<CodeInstruction>(instructions); // var codes = new List<CodeInstruction>(instructions);
// //
// for (var i = codes.Count - 1; i > 0; i--) { // for (var i = codes.Count - 1; i > 0; i--) {
// if (codes[i].opcode == OpCodes.Ldc_I4_3) { // if (codes[i].opcode == OpCodes.Ldc_I4_3) {
// Console.WriteLine("Changing " + codes[i]); // Console.WriteLine("Changing " + codes[i]);
// codes[i] = new CodeInstruction(OpCodes.Ldc_I4, 64); // codes[i] = new CodeInstruction(OpCodes.Ldc_I4, 64);
// Console.WriteLine("Changed " + codes[i]); // Console.WriteLine("Changed " + codes[i]);
// break; // break;
// } // }
// } // }
// //
// return codes.AsEnumerable(); // return codes.AsEnumerable();
// } // }
// } // }
// //
// // [HarmonyPatch(typeof(AILerp), "MovementUpdate")] // // [HarmonyPatch(typeof(AILerp), "MovementUpdate")]
// public class MovementSpeedPatch { // public class MovementSpeedPatch {
// static void Prefix(ref float deltaTime) { // static void Prefix(ref float deltaTime) {
// Console.WriteLine("MovementUpdate Prefix! deltaTime is " + deltaTime); // Console.WriteLine("MovementUpdate Prefix! deltaTime is " + deltaTime);
// deltaTime *= 16f; // deltaTime *= 16f;
// } // }
// } // }
// //
// // [HarmonyPatch(typeof(movementScript), "Move")] // // [HarmonyPatch(typeof(movementScript), "Move")]
// public static class EmployeeMovementSpeedPatch { // public static class EmployeeMovementSpeedPatch {
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { // static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
// var codes = new List<CodeInstruction>(instructions); // var codes = new List<CodeInstruction>(instructions);
// //
// List<CodeInstruction> matcher = new List<CodeInstruction>(); // List<CodeInstruction> matcher = new List<CodeInstruction>();
// 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.Ldfld, null));
// 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.Ldfld, null));
// matcher.Add(new CodeInstruction(OpCodes.Mul, null)); // matcher.Add(new CodeInstruction(OpCodes.Mul, null));
// //
// List<CodeInstruction> patch = new List<CodeInstruction>(); // List<CodeInstruction> patch = new List<CodeInstruction>();
// patch.Add(new CodeInstruction(OpCodes.Ldc_R4, 8)); // patch.Add(new CodeInstruction(OpCodes.Ldc_R4, 8));
// patch.Add(new CodeInstruction(OpCodes.Mul, null)); // patch.Add(new CodeInstruction(OpCodes.Mul, null));
// //
// for (var i = codes.Count - 1; i > 0; i--) { // for (var i = codes.Count - 1; i > 0; i--) {
// if (Main.IsMatch(codes, i, matcher)) { // if (Main.IsMatch(codes, i, matcher)) {
// Main.InsertAt(codes, i + 5, patch); // Main.InsertAt(codes, i + 5, patch);
// Console.WriteLine("Movement speed patched"); // Console.WriteLine("Movement speed patched");
// for (var j = 0; j < 15; j++) { // for (var j = 0; j < 15; j++) {
// Console.WriteLine(codes[i + j]); // Console.WriteLine(codes[i + j]);
// } // }
// break; // break;
// } // }
// } // }
// Console.WriteLine("Return"); // Console.WriteLine("Return");
// return codes.AsEnumerable(); // return codes.AsEnumerable();
// } // }
// } // }
// //
// [HarmonyPatch(typeof(mainScript), "WochenUpdates")] // [HarmonyPatch(typeof(mainScript), "WochenUpdates")]
// public static class ContractWorkAmount { // public static class ContractWorkAmount {
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { // static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
// var codes = new List<CodeInstruction>(instructions); // var codes = new List<CodeInstruction>(instructions);
// int methodIndex = -1; // int methodIndex = -1;
// List<CodeInstruction> pattern = new List<CodeInstruction>(); // List<CodeInstruction> pattern = new List<CodeInstruction>();
// //
// List<CodeInstruction> matcher = new List<CodeInstruction>(); // List<CodeInstruction> matcher = new List<CodeInstruction>();
// 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.Ldfld, null));
// matcher.Add(new CodeInstruction(OpCodes.Ldc_I4_0, null)); // matcher.Add(new CodeInstruction(OpCodes.Ldc_I4_0, null));
// matcher.Add(new CodeInstruction(OpCodes.Callvirt, null)); // matcher.Add(new CodeInstruction(OpCodes.Callvirt, null));
// //
// for (var i = 0; i < codes.Count; i++) { // for (var i = 0; i < codes.Count; i++) {
// if (codes[i].operand != null) { // if (codes[i].operand != null) {
// if (codes[i].operand.ToString().Contains("UpdateContractWork")) { // if (codes[i].operand.ToString().Contains("UpdateContractWork")) {
// methodIndex = i; // methodIndex = i;
// pattern.Add(codes[i - 3]); // pattern.Add(codes[i - 3]);
// pattern.Add(codes[i - 2]); // pattern.Add(codes[i - 2]);
// pattern.Add(codes[i - 1]); // pattern.Add(codes[i - 1]);
// pattern.Add(codes[i]); // pattern.Add(codes[i]);
// break; // break;
// } // }
// } // }
// } // }
// pattern[2].opcode = OpCodes.Ldc_I4_1; // pattern[2].opcode = OpCodes.Ldc_I4_1;
// //
// for (int i = 0; i < 16; i++) { // for (int i = 0; i < 16; i++) {
// for (int j = 0; j < pattern.Count; j++) { // for (int j = 0; j < pattern.Count; j++) {
// codes.Insert(methodIndex + i + j, pattern[j]); // codes.Insert(methodIndex + i + j, pattern[j]);
// } // }
// } // }
// //
// return codes.AsEnumerable(); // return codes.AsEnumerable();
// } // }
// } // }
// //
// [HarmonyPatch(typeof(platformScript), "SellPlayer")] // [HarmonyPatch(typeof(platformScript), "SellPlayer")]
// public static class ConsoleProductionReductionPatch { // public static class ConsoleProductionReductionPatch {
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { // static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
// var codes = new List<CodeInstruction>(instructions); // var codes = new List<CodeInstruction>(instructions);
// //
// List<CodeInstruction> matcher = new List<CodeInstruction>(); // List<CodeInstruction> matcher = new List<CodeInstruction>();
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null)); // matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
// 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.Ldfld, null));
// matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, null)); // matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, 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.Call, null));
// matcher.Add(new CodeInstruction(OpCodes.Add, null)); // matcher.Add(new CodeInstruction(OpCodes.Add, null));
// matcher.Add(new CodeInstruction(OpCodes.Stfld, null)); // matcher.Add(new CodeInstruction(OpCodes.Stfld, null));
// //
// for (var i = 0; i < codes.Count; i++) { // for (var i = 0; i < codes.Count; i++) {
// if (Main.IsMatch(codes, i, matcher)) { // if (Main.IsMatch(codes, i, matcher)) {
// codes[i + 3].operand = (float)codes[i + 3].operand * 8f; // codes[i + 3].operand = (float)codes[i + 3].operand * 8f;
// codes[i + 4].operand = (float)codes[i + 4].operand * 8f; // codes[i + 4].operand = (float)codes[i + 4].operand * 8f;
// Console.WriteLine("ConsoleProductionReductionPatch patched"); // Console.WriteLine("ConsoleProductionReductionPatch patched");
// break; // break;
// } // }
// } // }
// //
// return codes.AsEnumerable(); // return codes.AsEnumerable();
// } // }
// } // }
// //
// [HarmonyPatch(typeof(mainScript), "AddFans")] // [HarmonyPatch(typeof(mainScript), "AddFans")]
// public static class AddFansPatch { // public static class AddFansPatch {
// static void Prefix(ref int i) { // static void Prefix(ref int i) {
// // Console.WriteLine("GetWorkResult Postfix! f is " + f); // // Console.WriteLine("GetWorkResult Postfix! f is " + f);
// i *= Main.fans.Value; // i *= Main.fans.Value;
// } // }
// } // }
// //
// [HarmonyPatch(typeof(mainScript), "Earn")] // [HarmonyPatch(typeof(mainScript), "Earn")]
// public static class AddMoneyPatch { // public static class AddMoneyPatch {
// static void Prefix(ref long amount) { // static void Prefix(ref long amount) {
// // Console.WriteLine("GetWorkResult Postfix! f is " + f); // // Console.WriteLine("GetWorkResult Postfix! f is " + f);
// amount *= Main.money.Value; // amount *= Main.money.Value;
// } // }
// } // }
// } // }

View File

@@ -1,4 +1,4 @@
// <autogenerated /> // <autogenerated />
using System; using System;
using System.Reflection; using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")] [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]

View File

@@ -1 +1 @@
609c169d30d10d3da64fccb9258a6c7730d0c5b3 609c169d30d10d3da64fccb9258a6c7730d0c5b3

View File

@@ -1,26 +1,26 @@
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.csproj.AssemblyReference.cache C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.csproj.AssemblyReference.cache
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.csproj.CoreCompileInputs.cache C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.csproj.CoreCompileInputs.cache
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\Regiments.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\Regiments.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\Regiments.pdb C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\Regiments.pdb
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\0Harmony.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\0Harmony.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\Assembly-CSharp.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\Assembly-CSharp.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\BepInEx.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\BepInEx.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\MainAssembly.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\MainAssembly.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\UnityEngine.CoreModule.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\UnityEngine.CoreModule.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\UnityEngine.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\UnityEngine.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.csproj.CopyComplete C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.csproj.CopyComplete
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.pdb C:\Users\Administrator\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.pdb
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\Regiments.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\Regiments.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\Regiments.pdb C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\Regiments.pdb
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\0Harmony.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\0Harmony.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\Assembly-CSharp.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\Assembly-CSharp.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\BepInEx.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\BepInEx.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\ConfigurationManager.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\ConfigurationManager.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\UnityEngine.CoreModule.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\UnityEngine.CoreModule.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\UnityEngine.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\bin\Debug\UnityEngine.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.csproj.AssemblyReference.cache C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.csproj.AssemblyReference.cache
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.csproj.CoreCompileInputs.cache C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.csproj.CoreCompileInputs.cache
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.csproj.CopyComplete C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.csproj.CopyComplete
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.dll C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.pdb C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.pdb

View File

@@ -1,5 +1,5 @@
bin/ bin/
obj/ obj/
/packages/ /packages/
riderModule.iml riderModule.iml
/_ReSharper.Caches/ /_ReSharper.Caches/

View File

@@ -1,16 +1,16 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SevenDaysToDie", "SevenDaysToDie\SevenDaysToDie.csproj", "{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SevenDaysToDie", "SevenDaysToDie\SevenDaysToDie.csproj", "{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Debug|Any CPU.Build.0 = Debug|Any CPU {1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Release|Any CPU.ActiveCfg = Release|Any CPU {1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Release|Any CPU.Build.0 = Release|Any CPU {1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -1,8 +1,8 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005C0Harmony_002Edll/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005C0Harmony_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CAssembly_002DCSharp_002Edll/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CAssembly_002DCSharp_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CBepInEx_002Edll/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CBepInEx_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CConfigurationManager_002Edll/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CConfigurationManager_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CMelonLoader_002Edll/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CMelonLoader_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CUnityEngine_002ECoreModule_002Edll/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CUnityEngine_002ECoreModule_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CUnityEngine_002Edll/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CSevenDaysToDie_005CSevenDaysToDie_005Clibs_005CUnityEngine_002Edll/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@@ -1,114 +1,114 @@
using BepInEx.Configuration; using BepInEx.Configuration;
using HarmonyLib.Tools; using HarmonyLib.Tools;
using MelonLoader; using MelonLoader;
namespace SevenDaysToDie { namespace SevenDaysToDie {
[assembly: MelonInfo(typeof(Main), "CykaMod", "1", "Cyka")] [assembly: MelonInfo(typeof(Main), "CykaMod", "1", "Cyka")]
public class Main : MelonMod { public class Main : MelonMod {
private const string pluginGuid = "CykaMod"; private const string pluginGuid = "CykaMod";
public static ConfigEntry<float> xpMultiplier; public static ConfigEntry<float> xpMultiplier;
public static ConfigEntry<float> moneyMultiplier; public static ConfigEntry<float> moneyMultiplier;
public static ConfigEntry<float> energyGenMultiplier; public static ConfigEntry<float> energyGenMultiplier;
public static ConfigEntry<float> heartbeatIntervalMultiplier; public static ConfigEntry<float> heartbeatIntervalMultiplier;
public static ConfigEntry<float> shootingSpeedMultiplier; public static ConfigEntry<float> shootingSpeedMultiplier;
public static ConfigEntry<float> muzzleVelocityMultiplier; public static ConfigEntry<float> muzzleVelocityMultiplier;
public static ConfigEntry<bool> allProjectilesHoming; public static ConfigEntry<bool> allProjectilesHoming;
public static ConfigEntry<float> magnetStrenghtMultiplier; public static ConfigEntry<float> magnetStrenghtMultiplier;
public static ConfigEntry<float> magnetRadiusMultiplier; public static ConfigEntry<float> magnetRadiusMultiplier;
public static ConfigEntry<float> beamStrenghtMultiplier; public static ConfigEntry<float> beamStrenghtMultiplier;
public static ConfigEntry<float> beamRadiusMultiplier; public static ConfigEntry<float> beamRadiusMultiplier;
public static ConfigEntry<float> fuelTankRefillMultiplier; public static ConfigEntry<float> fuelTankRefillMultiplier;
public static ConfigEntry<float> fuelTankCapacityMultiplier; public static ConfigEntry<float> fuelTankCapacityMultiplier;
public static ConfigEntry<float> minerGroundArea; public static ConfigEntry<float> minerGroundArea;
public static ConfigEntry<float> minerMiningSpeed; public static ConfigEntry<float> minerMiningSpeed;
public static ConfigEntry<float> wheelTorqueMultiplier; public static ConfigEntry<float> wheelTorqueMultiplier;
public static ConfigEntry<float> wheelSpeedMultiplier; public static ConfigEntry<float> wheelSpeedMultiplier;
public static ConfigEntry<float> jetThrustMultiplier; public static ConfigEntry<float> jetThrustMultiplier;
public static ConfigEntry<float> seekingProjectileVisionConeAngleMultiplier; public static ConfigEntry<float> seekingProjectileVisionConeAngleMultiplier;
public static ConfigEntry<float> seekingProjectileVisionRangeMultiplier; public static ConfigEntry<float> seekingProjectileVisionRangeMultiplier;
public static ConfigEntry<float> seekingProjectileTurningSpeedMultiplier; public static ConfigEntry<float> seekingProjectileTurningSpeedMultiplier;
public static ConfigEntry<float> wirelessChargingRadiusMultiplier; public static ConfigEntry<float> wirelessChargingRadiusMultiplier;
public static ConfigEntry<float> wirelessChargingPowerPerArcMultiplier; public static ConfigEntry<float> wirelessChargingPowerPerArcMultiplier;
public static ConfigEntry<float> wirelessChargingArcFiringIntervalMultiplier; public static ConfigEntry<float> wirelessChargingArcFiringIntervalMultiplier;
public void OnInitializeMelon() { public void OnInitializeMelon() {
xpMultiplier = UnityDistantTerrain.Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 512f))); xpMultiplier = UnityDistantTerrain.Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 512f)));
// moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f, // moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f,
// new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f)));
// energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f, // energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f,
// new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f))); // new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f)));
// heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f, // heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f,
// new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f))); // new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f)));
// //
// shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f, // shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f,
// new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f))); // new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f)));
// muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f, // muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f,
// new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); // new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
// seekingProjectileVisionConeAngleMultiplier = Config.Bind("Weapons", "Seeking Projectile Cone Vision Angle Multiplier", 1f, // seekingProjectileVisionConeAngleMultiplier = Config.Bind("Weapons", "Seeking Projectile Cone Vision Angle Multiplier", 1f,
// new ConfigDescription("Seeking Projectile Cone Vision Angle Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); // new ConfigDescription("Seeking Projectile Cone Vision Angle Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
// seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f, // seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f,
// new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); // new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
// seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f, // seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f,
// new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); // new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
// //
// magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f, // magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f,
// new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f))); // new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
// magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f, // magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f,
// new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f))); // new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
// beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f, // beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f,
// new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f))); // new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
// beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f, // beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f,
// new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f))); // new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
// //
// wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f, // wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f,
// new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f))); // new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f)));
// wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f, // wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f,
// new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f))); // new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f)));
// wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f, // wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f,
// new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f))); // new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f)));
// //
// fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f, // fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f,
// new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f)));
// fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f, // fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f,
// new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f)));
// wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f, // wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f,
// new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f)));
// wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f, // wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f,
// new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f)));
// jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f, // jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f,
// new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f)));
// //
// minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f, // minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f,
// new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f)));
// minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f, // minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f,
// new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f))); // new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f)));
// //
// allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false); // allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false);
// shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch(); // shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch();
// energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch(); // energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch();
// magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch(); // magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
// magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch(); // magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
// beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch(); // beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
// beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch(); // beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
// fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch(); // fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
// fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch(); // fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
// wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch(); // wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
// wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch(); // wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
// jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch(); // jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch();
// minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch(); // minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
// minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch(); // minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
// wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); // wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
// wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); // wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
// wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); // wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
Logger.LogInfo("Cyka mod loaded"); Logger.LogInfo("Cyka mod loaded");
HarmonyFileLog.Enabled = true; HarmonyFileLog.Enabled = true;
Harmony harmony = new Harmony(pluginGuid); Harmony harmony = new Harmony(pluginGuid);
harmony.PatchAll(); harmony.PatchAll();
var originalMethods = harmony.GetPatchedMethods(); var originalMethods = harmony.GetPatchedMethods();
Logger.LogInfo("Patched " + originalMethods.Count() + " methods"); Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
} }
} }
} }

View File

@@ -1,35 +1,35 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("SevenDaysToDie")] [assembly: AssemblyTitle("SevenDaysToDie")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SevenDaysToDie")] [assembly: AssemblyProduct("SevenDaysToDie")]
[assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible // 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 // to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM // The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5")] [assembly: Guid("1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5")]
// Version information for an assembly consists of the following four values: // Version information for an assembly consists of the following four values:
// //
// Major Version // Major Version
// Minor Version // Minor Version
// Build Number // Build Number
// Revision // Revision
// //
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,75 +1,75 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}</ProjectGuid> <ProjectGuid>{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SevenDaysToDie</RootNamespace> <RootNamespace>SevenDaysToDie</RootNamespace>
<AssemblyName>SevenDaysToDie</AssemblyName> <AssemblyName>SevenDaysToDie</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="0Harmony"> <Reference Include="0Harmony">
<HintPath>libs\0Harmony.dll</HintPath> <HintPath>libs\0Harmony.dll</HintPath>
</Reference> </Reference>
<Reference Include="Assembly-CSharp"> <Reference Include="Assembly-CSharp">
<HintPath>libs\Assembly-CSharp.dll</HintPath> <HintPath>libs\Assembly-CSharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="BepInEx"> <Reference Include="BepInEx">
<HintPath>libs\BepInEx.dll</HintPath> <HintPath>libs\BepInEx.dll</HintPath>
</Reference> </Reference>
<Reference Include="ConfigurationManager"> <Reference Include="ConfigurationManager">
<HintPath>libs\ConfigurationManager.dll</HintPath> <HintPath>libs\ConfigurationManager.dll</HintPath>
</Reference> </Reference>
<Reference Include="MelonLoader"> <Reference Include="MelonLoader">
<HintPath>libs\MelonLoader.dll</HintPath> <HintPath>libs\MelonLoader.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="UnityEngine"> <Reference Include="UnityEngine">
<HintPath>libs\UnityEngine.dll</HintPath> <HintPath>libs\UnityEngine.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.CoreModule"> <Reference Include="UnityEngine.CoreModule">
<HintPath>libs\UnityEngine.CoreModule.dll</HintPath> <HintPath>libs\UnityEngine.CoreModule.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Class1.cs" /> <Compile Include="Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="XPPatch.cs" /> <Compile Include="XPPatch.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@@ -1,12 +1,12 @@
using HarmonyLib; using HarmonyLib;
namespace SevenDaysToDie { namespace SevenDaysToDie {
[HarmonyPatch] [HarmonyPatch]
public class Patches { public class Patches {
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(Progression), "AddLevelExp")] [HarmonyPatch(typeof(Progression), "AddLevelExp")]
static void XPMulti(ref int _exp) { static void XPMulti(ref int _exp) {
_exp = (int)(_exp * Main.xpMultiplier.Value); _exp = (int)(_exp * Main.xpMultiplier.Value);
} }
} }
} }

View File

@@ -1,16 +1,16 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TerraTech", "TerraTech\TerraTech.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TerraTech", "TerraTech\TerraTech.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {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}.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.ActiveCfg = Release|Any CPU
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU {EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -1,79 +1,79 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class BeamPropertiesManager { public class BeamPropertiesManager {
private static Dictionary<ModuleItemHolderBeam, float> strenghts = new Dictionary<ModuleItemHolderBeam, float>(); private static Dictionary<ModuleItemHolderBeam, float> strenghts = new Dictionary<ModuleItemHolderBeam, float>();
private static Dictionary<ModuleItemHolderBeam, float> radii = new Dictionary<ModuleItemHolderBeam, float>(); private static Dictionary<ModuleItemHolderBeam, float> radii = new Dictionary<ModuleItemHolderBeam, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleItemHolderBeam), "OnAttached")] [HarmonyPatch(typeof(ModuleItemHolderBeam), "OnAttached")]
static void PostfixCreate(ModuleItemHolderBeam __instance) { static void PostfixCreate(ModuleItemHolderBeam __instance) {
// Console.WriteLine("ModuleItemHolderBeam.OnAttached"); // Console.WriteLine("ModuleItemHolderBeam.OnAttached");
if (!strenghts.ContainsKey(__instance)) { if (!strenghts.ContainsKey(__instance)) {
strenghts.Add(__instance, GetStrength(__instance)); strenghts.Add(__instance, GetStrength(__instance));
radii.Add(__instance, GetRadius(__instance)); radii.Add(__instance, GetRadius(__instance));
// Console.WriteLine("Patching {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Patching {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Patched {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleItemHolderBeam), "OnDetaching")] [HarmonyPatch(typeof(ModuleItemHolderBeam), "OnDetaching")]
static void PostfixDestroy(ModuleItemHolderBeam __instance) { static void PostfixDestroy(ModuleItemHolderBeam __instance) {
// Console.WriteLine("ModuleItemHolderBeam.OnDetaching"); // Console.WriteLine("ModuleItemHolderBeam.OnDetaching");
// Console.WriteLine("Restoring {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Restoring {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Restored {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
strenghts.Remove(__instance); strenghts.Remove(__instance);
radii.Remove(__instance); radii.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleItemHolderBeam", strenghts.Count); // Console.WriteLine("Modifying {0} ModuleItemHolderBeam", strenghts.Count);
foreach (KeyValuePair<ModuleItemHolderBeam, float> keyValuePair in strenghts) { foreach (KeyValuePair<ModuleItemHolderBeam, float> keyValuePair in strenghts) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleItemHolderBeam moduleItemHolderBeam) { static void DoPatchSingle(ModuleItemHolderBeam moduleItemHolderBeam) {
SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam] * Main.beamStrenghtMultiplier.Value); SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam] * Main.beamStrenghtMultiplier.Value);
SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam] * Main.beamRadiusMultiplier.Value); SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam] * Main.beamRadiusMultiplier.Value);
} }
static void DoRestoreSingle(ModuleItemHolderBeam moduleItemHolderBeam) { static void DoRestoreSingle(ModuleItemHolderBeam moduleItemHolderBeam) {
if (strenghts.ContainsKey(moduleItemHolderBeam)) { if (strenghts.ContainsKey(moduleItemHolderBeam)) {
SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam]); SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam]);
SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam]); SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam]);
} }
} }
private static float GetStrength(ModuleItemHolderBeam moduleItemHolderBeam) { private static float GetStrength(ModuleItemHolderBeam moduleItemHolderBeam) {
return Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").GetValue() as float? ?? 0f; return Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").GetValue() as float? ?? 0f;
} }
private static void SetStrength(ModuleItemHolderBeam moduleItemHolderBeam, float value) { private static void SetStrength(ModuleItemHolderBeam moduleItemHolderBeam, float value) {
Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").SetValue(value); Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").SetValue(value);
} }
private static float GetRadius(ModuleItemHolderBeam moduleItemHolderBeam) { private static float GetRadius(ModuleItemHolderBeam moduleItemHolderBeam) {
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup; ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup;
if (moduleItemPickup) { if (moduleItemPickup) {
float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f; float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f;
return radius; return radius;
} }
return 0f; return 0f;
} }
private static void SetRadius(ModuleItemHolderBeam moduleItemHolderBeam, float value) { private static void SetRadius(ModuleItemHolderBeam moduleItemHolderBeam, float value) {
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup; ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup;
if (moduleItemPickup) { if (moduleItemPickup) {
Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value); Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value);
} }
} }
} }
} }

View File

@@ -1,121 +1,121 @@
using System.Linq; using System.Linq;
using BepInEx; using BepInEx;
using BepInEx.Configuration; using BepInEx.Configuration;
using HarmonyLib; using HarmonyLib;
using HarmonyLib.Tools; using HarmonyLib.Tools;
// TODO: Make shield and repair bigger // TODO: Make shield and repair bigger
// TODO: Maybe make props faster, thrusters work fine // TODO: Maybe make props faster, thrusters work fine
namespace TerraTech { namespace TerraTech {
[BepInPlugin(pluginGuid, pluginName, pluginVersion)] [BepInPlugin(pluginGuid, pluginName, pluginVersion)]
public class Main : BaseUnityPlugin { public class Main : BaseUnityPlugin {
private const string pluginGuid = "CykaMod"; private const string pluginGuid = "CykaMod";
private const string pluginName = "CykaMod"; private const string pluginName = "CykaMod";
private const string pluginVersion = "1.0.0"; private const string pluginVersion = "1.0.0";
public static ConfigEntry<float> xpMultiplier; public static ConfigEntry<float> xpMultiplier;
public static ConfigEntry<float> moneyMultiplier; public static ConfigEntry<float> moneyMultiplier;
public static ConfigEntry<float> energyGenMultiplier; public static ConfigEntry<float> energyGenMultiplier;
public static ConfigEntry<float> heartbeatIntervalMultiplier; public static ConfigEntry<float> heartbeatIntervalMultiplier;
public static ConfigEntry<float> shootingSpeedMultiplier; public static ConfigEntry<float> shootingSpeedMultiplier;
public static ConfigEntry<float> muzzleVelocityMultiplier; public static ConfigEntry<float> muzzleVelocityMultiplier;
public static ConfigEntry<bool> allProjectilesHoming; public static ConfigEntry<bool> allProjectilesHoming;
public static ConfigEntry<float> magnetStrenghtMultiplier; public static ConfigEntry<float> magnetStrenghtMultiplier;
public static ConfigEntry<float> magnetRadiusMultiplier; public static ConfigEntry<float> magnetRadiusMultiplier;
public static ConfigEntry<float> beamStrenghtMultiplier; public static ConfigEntry<float> beamStrenghtMultiplier;
public static ConfigEntry<float> beamRadiusMultiplier; public static ConfigEntry<float> beamRadiusMultiplier;
public static ConfigEntry<float> fuelTankRefillMultiplier; public static ConfigEntry<float> fuelTankRefillMultiplier;
public static ConfigEntry<float> fuelTankCapacityMultiplier; public static ConfigEntry<float> fuelTankCapacityMultiplier;
public static ConfigEntry<float> minerGroundArea; public static ConfigEntry<float> minerGroundArea;
public static ConfigEntry<float> minerMiningSpeed; public static ConfigEntry<float> minerMiningSpeed;
public static ConfigEntry<float> wheelTorqueMultiplier; public static ConfigEntry<float> wheelTorqueMultiplier;
public static ConfigEntry<float> wheelSpeedMultiplier; public static ConfigEntry<float> wheelSpeedMultiplier;
public static ConfigEntry<float> jetThrustMultiplier; public static ConfigEntry<float> jetThrustMultiplier;
public static ConfigEntry<float> seekingProjectileVisionConeAngleMultiplier; public static ConfigEntry<float> seekingProjectileVisionConeAngleMultiplier;
public static ConfigEntry<float> seekingProjectileVisionRangeMultiplier; public static ConfigEntry<float> seekingProjectileVisionRangeMultiplier;
public static ConfigEntry<float> seekingProjectileTurningSpeedMultiplier; public static ConfigEntry<float> seekingProjectileTurningSpeedMultiplier;
public static ConfigEntry<float> wirelessChargingRadiusMultiplier; public static ConfigEntry<float> wirelessChargingRadiusMultiplier;
public static ConfigEntry<float> wirelessChargingPowerPerArcMultiplier; public static ConfigEntry<float> wirelessChargingPowerPerArcMultiplier;
public static ConfigEntry<float> wirelessChargingArcFiringIntervalMultiplier; public static ConfigEntry<float> wirelessChargingArcFiringIntervalMultiplier;
public void Awake() { public void Awake() {
xpMultiplier = Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 32f))); xpMultiplier = Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 32f)));
moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f, moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f,
new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f)));
energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f, energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f,
new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f))); new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f)));
heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f, heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f,
new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f))); new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f)));
shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f, shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f,
new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f))); new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f)));
muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f, muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f,
new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
seekingProjectileVisionConeAngleMultiplier = Config.Bind("Weapons", "Seeking Projectile Cone Vision Angle Multiplier", 1f, seekingProjectileVisionConeAngleMultiplier = Config.Bind("Weapons", "Seeking Projectile Cone Vision Angle Multiplier", 1f,
new ConfigDescription("Seeking Projectile Cone Vision Angle Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); new ConfigDescription("Seeking Projectile Cone Vision Angle Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f, seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f,
new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f, seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f,
new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f))); new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f, magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f,
new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f))); new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f, magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f,
new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f))); new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f, beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f,
new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f))); new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f, beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f,
new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f))); new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f, wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f,
new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f))); new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f)));
wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f, wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f,
new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f))); new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f)));
wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f, wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f,
new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f))); new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f)));
fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f, fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f,
new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f)));
fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f, fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f,
new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f)));
wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f, wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f,
new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f)));
wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f, wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f,
new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f)));
jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f, jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f,
new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f)));
minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f, minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f,
new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f)));
minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f, minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f,
new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f))); new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f)));
allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false); allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false);
shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch(); shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch();
energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch(); energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch();
magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch(); magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch(); magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch(); beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch(); beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch(); fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch(); fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch(); wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch(); wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch(); jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch();
minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch(); minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch(); minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch(); wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
Logger.LogInfo("Cyka mod loaded"); Logger.LogInfo("Cyka mod loaded");
HarmonyFileLog.Enabled = true; HarmonyFileLog.Enabled = true;
Harmony harmony = new Harmony(pluginGuid); Harmony harmony = new Harmony(pluginGuid);
harmony.PatchAll(); harmony.PatchAll();
var originalMethods = harmony.GetPatchedMethods(); var originalMethods = harmony.GetPatchedMethods();
Logger.LogInfo("Patched " + originalMethods.Count() + " methods"); Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
} }
} }
} }

View File

@@ -1,55 +1,55 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class FuelPropertiesManager { public class FuelPropertiesManager {
private static Dictionary<ModuleFuelTank, float> refillRate = new Dictionary<ModuleFuelTank, float>(); private static Dictionary<ModuleFuelTank, float> refillRate = new Dictionary<ModuleFuelTank, float>();
private static Dictionary<ModuleFuelTank, float> capacity = new Dictionary<ModuleFuelTank, float>(); private static Dictionary<ModuleFuelTank, float> capacity = new Dictionary<ModuleFuelTank, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleFuelTank), "OnAttached")] [HarmonyPatch(typeof(ModuleFuelTank), "OnAttached")]
static void PostfixCreate(ModuleFuelTank __instance) { static void PostfixCreate(ModuleFuelTank __instance) {
// Console.WriteLine("ModuleFuelTank.OnAttached"); // Console.WriteLine("ModuleFuelTank.OnAttached");
if (!refillRate.ContainsKey(__instance)) { if (!refillRate.ContainsKey(__instance)) {
refillRate.Add(__instance, __instance.m_RefillRate); refillRate.Add(__instance, __instance.m_RefillRate);
capacity.Add(__instance, __instance.m_Capacity); capacity.Add(__instance, __instance.m_Capacity);
// Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleFuelTank), "OnDetaching")] [HarmonyPatch(typeof(ModuleFuelTank), "OnDetaching")]
static void PostfixDestroy(ModuleFuelTank __instance) { static void PostfixDestroy(ModuleFuelTank __instance) {
// Console.WriteLine("ModuleFuelTank.OnAttached"); // Console.WriteLine("ModuleFuelTank.OnAttached");
// Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
refillRate.Remove(__instance); refillRate.Remove(__instance);
capacity.Remove(__instance); capacity.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleFuelTank", refillRate.Count); // Console.WriteLine("Modifying {0} ModuleFuelTank", refillRate.Count);
foreach (KeyValuePair<ModuleFuelTank, float> keyValuePair in refillRate) { foreach (KeyValuePair<ModuleFuelTank, float> keyValuePair in refillRate) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleFuelTank moduleFuelTank) { static void DoPatchSingle(ModuleFuelTank moduleFuelTank) {
moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank] * Main.fuelTankRefillMultiplier.Value; moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank] * Main.fuelTankRefillMultiplier.Value;
moduleFuelTank.m_Capacity = capacity[moduleFuelTank] * Main.fuelTankCapacityMultiplier.Value; moduleFuelTank.m_Capacity = capacity[moduleFuelTank] * Main.fuelTankCapacityMultiplier.Value;
} }
static void DoRestoreSingle(ModuleFuelTank moduleFuelTank) { static void DoRestoreSingle(ModuleFuelTank moduleFuelTank) {
if (refillRate.ContainsKey(moduleFuelTank)) { if (refillRate.ContainsKey(moduleFuelTank)) {
moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank]; moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank];
moduleFuelTank.m_Capacity = capacity[moduleFuelTank]; moduleFuelTank.m_Capacity = capacity[moduleFuelTank];
} }
} }
} }
} }

View File

@@ -1,58 +1,58 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class GeneratorPropertiesManager { public class GeneratorPropertiesManager {
private static Dictionary<ModuleEnergy, float> generators = new Dictionary<ModuleEnergy, float>(); private static Dictionary<ModuleEnergy, float> generators = new Dictionary<ModuleEnergy, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleEnergy), "OnAttached")] [HarmonyPatch(typeof(ModuleEnergy), "OnAttached")]
static void PostfixCreate(ModuleEnergy __instance) { static void PostfixCreate(ModuleEnergy __instance) {
// Console.WriteLine("ModuleEnergy.OnAttached"); // Console.WriteLine("ModuleEnergy.OnAttached");
if (!generators.ContainsKey(__instance)) { if (!generators.ContainsKey(__instance)) {
generators.Add(__instance, GetValue(__instance)); generators.Add(__instance, GetValue(__instance));
// Console.WriteLine("Patching {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance)); // Console.WriteLine("Patching {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance)); // Console.WriteLine("Patched {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleEnergy), "OnDetaching")] [HarmonyPatch(typeof(ModuleEnergy), "OnDetaching")]
static void PostfixDestroy(ModuleEnergy __instance) { static void PostfixDestroy(ModuleEnergy __instance) {
// Console.WriteLine("ModuleEnergy.OnDetaching"); // Console.WriteLine("ModuleEnergy.OnDetaching");
// Console.WriteLine("Restoring {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance)); // Console.WriteLine("Restoring {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance)); // Console.WriteLine("Restored {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
generators.Remove(__instance); generators.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleEnergy", generators.Count); // Console.WriteLine("Modifying {0} ModuleEnergy", generators.Count);
foreach (KeyValuePair<ModuleEnergy, float> keyValuePair in generators) { foreach (KeyValuePair<ModuleEnergy, float> keyValuePair in generators) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleEnergy moduleEnergy) { static void DoPatchSingle(ModuleEnergy moduleEnergy) {
SetValue(moduleEnergy, generators[moduleEnergy] * Main.energyGenMultiplier.Value); SetValue(moduleEnergy, generators[moduleEnergy] * Main.energyGenMultiplier.Value);
} }
static void DoRestoreSingle(ModuleEnergy moduleEnergy) { static void DoRestoreSingle(ModuleEnergy moduleEnergy) {
if (generators.ContainsKey(moduleEnergy)) { if (generators.ContainsKey(moduleEnergy)) {
SetValue(moduleEnergy, generators[moduleEnergy]); SetValue(moduleEnergy, generators[moduleEnergy]);
} }
} }
private static float GetValue(ModuleEnergy moduleEnergy) { private static float GetValue(ModuleEnergy moduleEnergy) {
return Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").GetValue() as float? ?? 0f; return Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").GetValue() as float? ?? 0f;
} }
private static void SetValue(ModuleEnergy moduleEnergy, float value) { private static void SetValue(ModuleEnergy moduleEnergy, float value) {
Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").SetValue(value); Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").SetValue(value);
} }
} }
} }

View File

@@ -1,22 +1,22 @@
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
using UnityEngine; using UnityEngine;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch(typeof(Projectile), "Fire")] [HarmonyPatch(typeof(Projectile), "Fire")]
public class HomingAndVelocityProjectilePatch { public class HomingAndVelocityProjectilePatch {
private static Dictionary<FireData, float> velocities = new Dictionary<FireData, float>(); private static Dictionary<FireData, float> velocities = new Dictionary<FireData, float>();
static void Prefix(Vector3 fireDirection, ref FireData fireData, ref ModuleWeaponGun weapon, Tank shooter, ref bool seekingRounds, bool replayRounds) { static void Prefix(Vector3 fireDirection, ref FireData fireData, ref ModuleWeaponGun weapon, Tank shooter, ref bool seekingRounds, bool replayRounds) {
if (Main.allProjectilesHoming.Value) { if (Main.allProjectilesHoming.Value) {
seekingRounds = true; seekingRounds = true;
} }
if (!velocities.ContainsKey(fireData)) { if (!velocities.ContainsKey(fireData)) {
velocities.Add(fireData, fireData.m_MuzzleVelocity); velocities.Add(fireData, fireData.m_MuzzleVelocity);
fireData.m_MuzzleVelocity *= Main.muzzleVelocityMultiplier.Value; fireData.m_MuzzleVelocity *= Main.muzzleVelocityMultiplier.Value;
} else if (velocities[fireData] != fireData.m_MuzzleVelocity * Main.muzzleVelocityMultiplier.Value) { } else if (velocities[fireData] != fireData.m_MuzzleVelocity * Main.muzzleVelocityMultiplier.Value) {
fireData.m_MuzzleVelocity = velocities[fireData] * Main.muzzleVelocityMultiplier.Value; fireData.m_MuzzleVelocity = velocities[fireData] * Main.muzzleVelocityMultiplier.Value;
} }
} }
} }
} }

View File

@@ -1,81 +1,81 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class MagnetPropertiesManager { public class MagnetPropertiesManager {
private static Dictionary<ModuleItemHolderMagnet, float> strenghts = new Dictionary<ModuleItemHolderMagnet, float>(); private static Dictionary<ModuleItemHolderMagnet, float> strenghts = new Dictionary<ModuleItemHolderMagnet, float>();
private static Dictionary<ModuleItemHolderMagnet, float> radii = new Dictionary<ModuleItemHolderMagnet, float>(); private static Dictionary<ModuleItemHolderMagnet, float> radii = new Dictionary<ModuleItemHolderMagnet, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnAttached")] [HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnAttached")]
static void PostfixCreate(ModuleItemHolderMagnet __instance) { static void PostfixCreate(ModuleItemHolderMagnet __instance) {
// Console.WriteLine("ModuleItemHolderMagnet.OnAttached"); // Console.WriteLine("ModuleItemHolderMagnet.OnAttached");
if (!strenghts.ContainsKey(__instance)) { if (!strenghts.ContainsKey(__instance)) {
strenghts.Add(__instance, GetStrength(__instance)); strenghts.Add(__instance, GetStrength(__instance));
radii.Add(__instance, GetRadius(__instance)); radii.Add(__instance, GetRadius(__instance));
// Console.WriteLine("Patching {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Patching {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Patched {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnDetaching")] [HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnDetaching")]
static void PostfixDestroy(ModuleItemHolderMagnet __instance) { static void PostfixDestroy(ModuleItemHolderMagnet __instance) {
// Console.WriteLine("ModuleItemHolderMagnet.OnDetaching"); // Console.WriteLine("ModuleItemHolderMagnet.OnDetaching");
// Console.WriteLine("Restoring {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Restoring {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance)); // Console.WriteLine("Restored {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
strenghts.Remove(__instance); strenghts.Remove(__instance);
radii.Remove(__instance); radii.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleItemHolderMagnet", strenghts.Count); // Console.WriteLine("Modifying {0} ModuleItemHolderMagnet", strenghts.Count);
foreach (KeyValuePair<ModuleItemHolderMagnet, float> keyValuePair in strenghts) { foreach (KeyValuePair<ModuleItemHolderMagnet, float> keyValuePair in strenghts) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) { static void DoPatchSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) {
SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet] * Main.magnetStrenghtMultiplier.Value); SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet] * Main.magnetStrenghtMultiplier.Value);
SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet] * Main.magnetRadiusMultiplier.Value); SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet] * Main.magnetRadiusMultiplier.Value);
} }
static void DoRestoreSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) { static void DoRestoreSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) {
if (strenghts.ContainsKey(moduleItemHolderMagnet)) { if (strenghts.ContainsKey(moduleItemHolderMagnet)) {
SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet]); SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet]);
} }
if (radii.ContainsKey(moduleItemHolderMagnet)) { if (radii.ContainsKey(moduleItemHolderMagnet)) {
SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet]); SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet]);
} }
} }
private static float GetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet) { private static float GetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet) {
return Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").GetValue() as float? ?? 0f; return Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").GetValue() as float? ?? 0f;
} }
private static void SetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) { private static void SetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) {
Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").SetValue(value); Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").SetValue(value);
} }
private static float GetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet) { private static float GetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet) {
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup; ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup;
if (moduleItemPickup) { if (moduleItemPickup) {
float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f; float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f;
return radius; return radius;
} }
return 0f; return 0f;
} }
private static void SetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) { private static void SetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) {
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup; ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup;
if (moduleItemPickup) { if (moduleItemPickup) {
Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value); Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value);
} }
} }
} }
} }

View File

@@ -1,86 +1,86 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class MinerPropertiesManager { public class MinerPropertiesManager {
private static Dictionary<ModuleItemProducer, float> area = new Dictionary<ModuleItemProducer, float>(); private static Dictionary<ModuleItemProducer, float> area = new Dictionary<ModuleItemProducer, float>();
private static Dictionary<ModuleItemProducer, float> speed = new Dictionary<ModuleItemProducer, float>(); private static Dictionary<ModuleItemProducer, float> speed = new Dictionary<ModuleItemProducer, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleItemProducer), "GetClosestResourceReservoirInRange")] [HarmonyPatch(typeof(ModuleItemProducer), "GetClosestResourceReservoirInRange")]
static void PostfixCreate(ModuleItemProducer __instance) { static void PostfixCreate(ModuleItemProducer __instance) {
// Console.WriteLine("ModuleItemProducer.GetClosestResourceReservoirInRange"); // Console.WriteLine("ModuleItemProducer.GetClosestResourceReservoirInRange");
if (!area.ContainsKey(__instance)) { if (!area.ContainsKey(__instance)) {
area.Add(__instance, GetArea(__instance)); area.Add(__instance, GetArea(__instance));
speed.Add(__instance, GetSpeed(__instance)); speed.Add(__instance, GetSpeed(__instance));
// Console.WriteLine("Patching {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance), // Console.WriteLine("Patching {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
// GetSpeed(__instance)); // GetSpeed(__instance));
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance), // Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
// GetSpeed(__instance)); // GetSpeed(__instance));
} else { } else {
if (GetArea(__instance) == area[__instance]) { if (GetArea(__instance) == area[__instance]) {
// Console.WriteLine("{0} area reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, // Console.WriteLine("{0} area reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name,
// GetArea(__instance), GetSpeed(__instance)); // GetArea(__instance), GetSpeed(__instance));
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance), // Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
// GetSpeed(__instance)); // GetSpeed(__instance));
} }
if (GetSpeed(__instance) == speed[__instance]) { if (GetSpeed(__instance) == speed[__instance]) {
// Console.WriteLine("{0} speed reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, // Console.WriteLine("{0} speed reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name,
// GetArea(__instance), GetSpeed(__instance)); // GetArea(__instance), GetSpeed(__instance));
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance), // Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
// GetSpeed(__instance)); // GetSpeed(__instance));
} }
} }
} }
[HarmonyPostfix] [HarmonyPostfix]
[HarmonyPatch(typeof(ModuleItemProducer), "OnDetaching")] [HarmonyPatch(typeof(ModuleItemProducer), "OnDetaching")]
static void PostfixDestroy(ModuleItemProducer __instance) { static void PostfixDestroy(ModuleItemProducer __instance) {
// Console.WriteLine("ModuleItemProducer.OnRecycle"); // Console.WriteLine("ModuleItemProducer.OnRecycle");
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
area.Remove(__instance); area.Remove(__instance);
speed.Remove(__instance); speed.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleItemProducer", area.Count); // Console.WriteLine("Modifying {0} ModuleItemProducer", area.Count);
foreach (KeyValuePair<ModuleItemProducer, float> keyValuePair in area) { foreach (KeyValuePair<ModuleItemProducer, float> keyValuePair in area) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleItemProducer moduleItemProducer) { static void DoPatchSingle(ModuleItemProducer moduleItemProducer) {
SetArea(moduleItemProducer, area[moduleItemProducer] * Main.minerGroundArea.Value); SetArea(moduleItemProducer, area[moduleItemProducer] * Main.minerGroundArea.Value);
SetSpeed(moduleItemProducer, speed[moduleItemProducer] / Main.minerMiningSpeed.Value); SetSpeed(moduleItemProducer, speed[moduleItemProducer] / Main.minerMiningSpeed.Value);
} }
static void DoRestoreSingle(ModuleItemProducer moduleItemProducer) { static void DoRestoreSingle(ModuleItemProducer moduleItemProducer) {
if (area.ContainsKey(moduleItemProducer)) { if (area.ContainsKey(moduleItemProducer)) {
SetArea(moduleItemProducer, area[moduleItemProducer]); SetArea(moduleItemProducer, area[moduleItemProducer]);
SetSpeed(moduleItemProducer, speed[moduleItemProducer]); SetSpeed(moduleItemProducer, speed[moduleItemProducer]);
} }
} }
private static float GetArea(ModuleItemProducer moduleItemProducer) { private static float GetArea(ModuleItemProducer moduleItemProducer) {
return Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").GetValue() as float? ?? 0f; return Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").GetValue() as float? ?? 0f;
} }
private static void SetArea(ModuleItemProducer moduleItemProducer, float value) { private static void SetArea(ModuleItemProducer moduleItemProducer, float value) {
Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").SetValue(value); Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").SetValue(value);
} }
private static float GetSpeed(ModuleItemProducer moduleItemProducer) { private static float GetSpeed(ModuleItemProducer moduleItemProducer) {
return Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").GetValue() as float? ?? 0f; return Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").GetValue() as float? ?? 0f;
} }
private static void SetSpeed(ModuleItemProducer moduleItemProducer, float value) { private static void SetSpeed(ModuleItemProducer moduleItemProducer, float value) {
Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").SetValue(value); Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").SetValue(value);
} }
} }
} }

View File

@@ -1,24 +1,24 @@
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class Patches { public class Patches {
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ManLicenses), "AddXP")] [HarmonyPatch(typeof(ManLicenses), "AddXP")]
static void XPMulti(FactionSubTypes corporation, ref int xp, bool showUI = true) { static void XPMulti(FactionSubTypes corporation, ref int xp, bool showUI = true) {
xp = (int)(xp * Main.xpMultiplier.Value); xp = (int)(xp * Main.xpMultiplier.Value);
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ManPlayer), "AddMoney")] [HarmonyPatch(typeof(ManPlayer), "AddMoney")]
static void MoneyMulti(ref int amount) { static void MoneyMulti(ref int amount) {
amount = (int)(amount * Main.moneyMultiplier.Value); amount = (int)(amount * Main.moneyMultiplier.Value);
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(TechHolders), "SetHeartbeatInterval")] [HarmonyPatch(typeof(TechHolders), "SetHeartbeatInterval")]
static void HeartbeatMulti(ref float interval) { static void HeartbeatMulti(ref float interval) {
interval *= Main.heartbeatIntervalMultiplier.Value; interval *= Main.heartbeatIntervalMultiplier.Value;
} }
} }
} }

View File

@@ -1,35 +1,35 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("TerraTech")] [assembly: AssemblyTitle("TerraTech")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TerraTech")] [assembly: AssemblyProduct("TerraTech")]
[assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible // 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 // to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM // The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")] [assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")]
// Version information for an assembly consists of the following four values: // Version information for an assembly consists of the following four values:
// //
// Major Version // Major Version
// Minor Version // Minor Version
// Build Number // Build Number
// Revision // Revision
// //
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,24 +1,24 @@
using System; using System;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
public class SeekingProjectileManager { public class SeekingProjectileManager {
[HarmonyPatch(typeof(SeekingProjectile), "OnSpawn")] [HarmonyPatch(typeof(SeekingProjectile), "OnSpawn")]
class Patch { class Patch {
static void Postfix(SeekingProjectile __instance) { static void Postfix(SeekingProjectile __instance) {
Console.WriteLine("SeekingProjectile created"); Console.WriteLine("SeekingProjectile created");
SetField(__instance, "m_VisionConeAngle", Main.seekingProjectileVisionConeAngleMultiplier.Value * GetField(__instance, "m_VisionConeAngle")); SetField(__instance, "m_VisionConeAngle", Main.seekingProjectileVisionConeAngleMultiplier.Value * GetField(__instance, "m_VisionConeAngle"));
SetField(__instance, "m_VisionRange", Main.seekingProjectileVisionRangeMultiplier.Value * GetField(__instance, "m_VisionRange")); SetField(__instance, "m_VisionRange", Main.seekingProjectileVisionRangeMultiplier.Value * GetField(__instance, "m_VisionRange"));
SetField(__instance, "m_TurnSpeed", Main.seekingProjectileTurningSpeedMultiplier.Value * GetField(__instance, "m_TurnSpeed")); SetField(__instance, "m_TurnSpeed", Main.seekingProjectileTurningSpeedMultiplier.Value * GetField(__instance, "m_TurnSpeed"));
} }
} }
private static float GetField(SeekingProjectile seekingProjectile, string field) { private static float GetField(SeekingProjectile seekingProjectile, string field) {
return Traverse.Create(seekingProjectile).Field(field).GetValue() as float? ?? 0f; return Traverse.Create(seekingProjectile).Field(field).GetValue() as float? ?? 0f;
} }
private static void SetField(SeekingProjectile seekingProjectile, string field, float value) { private static void SetField(SeekingProjectile seekingProjectile, string field, float value) {
Traverse.Create(seekingProjectile).Field(field).SetValue(value); Traverse.Create(seekingProjectile).Field(field).SetValue(value);
} }
} }
} }

View File

@@ -1,78 +1,78 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid> <ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TerraTech</RootNamespace> <RootNamespace>TerraTech</RootNamespace>
<AssemblyName>TerraTech</AssemblyName> <AssemblyName>TerraTech</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="BeamPropertiesManager.cs" /> <Compile Include="BeamPropertiesManager.cs" />
<Compile Include="Class1.cs" /> <Compile Include="Class1.cs" />
<Compile Include="FuelPropertiesManager.cs" /> <Compile Include="FuelPropertiesManager.cs" />
<Compile Include="GeneratorPropertiesManager.cs" /> <Compile Include="GeneratorPropertiesManager.cs" />
<Compile Include="HomingAndVelocityProjectilePatch.cs" /> <Compile Include="HomingAndVelocityProjectilePatch.cs" />
<Compile Include="MagnetPropertiesManager.cs" /> <Compile Include="MagnetPropertiesManager.cs" />
<Compile Include="MinerPropertiesManager.cs" /> <Compile Include="MinerPropertiesManager.cs" />
<Compile Include="Patches.cs" /> <Compile Include="Patches.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SeekingProjectileManager.cs" /> <Compile Include="SeekingProjectileManager.cs" />
<Compile Include="ThrusterPropertiesManager.cs" /> <Compile Include="ThrusterPropertiesManager.cs" />
<Compile Include="WeaponPropertiesManager.cs" /> <Compile Include="WeaponPropertiesManager.cs" />
<Compile Include="WheelPropertiesManager.cs" /> <Compile Include="WheelPropertiesManager.cs" />
<Compile Include="WirelessChargerPropertiesManager.cs" /> <Compile Include="WirelessChargerPropertiesManager.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="0Harmony"> <Reference Include="0Harmony">
<HintPath>..\libs\0Harmony.dll</HintPath> <HintPath>..\libs\0Harmony.dll</HintPath>
</Reference> </Reference>
<Reference Include="Assembly-CSharp"> <Reference Include="Assembly-CSharp">
<HintPath>..\libs\Assembly-CSharp.dll</HintPath> <HintPath>..\libs\Assembly-CSharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="BepInEx"> <Reference Include="BepInEx">
<HintPath>..\libs\BepInEx.dll</HintPath> <HintPath>..\libs\BepInEx.dll</HintPath>
</Reference> </Reference>
<Reference Include="ConfigurationManager"> <Reference Include="ConfigurationManager">
<HintPath>..\libs\ConfigurationManager.dll</HintPath> <HintPath>..\libs\ConfigurationManager.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine"> <Reference Include="UnityEngine">
<HintPath>..\libs\UnityEngine.dll</HintPath> <HintPath>..\libs\UnityEngine.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.CoreModule"> <Reference Include="UnityEngine.CoreModule">
<HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath> <HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>

View File

@@ -1,89 +1,89 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class ThrusterPropertiesManager { public class ThrusterPropertiesManager {
private static Dictionary<ModuleBooster, Dictionary<BoosterJet, float>> boosters = new Dictionary<ModuleBooster, Dictionary<BoosterJet, float>>(); private static Dictionary<ModuleBooster, Dictionary<BoosterJet, float>> boosters = new Dictionary<ModuleBooster, Dictionary<BoosterJet, float>>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleBooster), "OnAttached")] [HarmonyPatch(typeof(ModuleBooster), "OnAttached")]
static void PostfixCreate(ModuleBooster __instance) { static void PostfixCreate(ModuleBooster __instance) {
// Console.WriteLine("ModuleBooster.OnAttached"); // Console.WriteLine("ModuleBooster.OnAttached");
if (!boosters.ContainsKey(__instance)) { if (!boosters.ContainsKey(__instance)) {
boosters.Add(__instance, Map(__instance)); boosters.Add(__instance, Map(__instance));
// Console.WriteLine("Patching {0}; force: {1}", __instance.name, GetForceAsString(__instance)); // Console.WriteLine("Patching {0}; force: {1}", __instance.name, GetForceAsString(__instance));
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; force: {1}", __instance.name, GetForceAsString(__instance)); // Console.WriteLine("Patched {0}; force: {1}", __instance.name, GetForceAsString(__instance));
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleBooster), "OnDetaching")] [HarmonyPatch(typeof(ModuleBooster), "OnDetaching")]
static void PostfixDestroy(ModuleBooster __instance) { static void PostfixDestroy(ModuleBooster __instance) {
// Console.WriteLine("ModuleBooster.OnDetaching"); // Console.WriteLine("ModuleBooster.OnDetaching");
// Console.WriteLine("Restoring {0}; force: {1}", __instance.name, GetForceAsString(__instance)); // Console.WriteLine("Restoring {0}; force: {1}", __instance.name, GetForceAsString(__instance));
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; force: {1}", __instance.name, GetForceAsString(__instance)); // Console.WriteLine("Restored {0}; force: {1}", __instance.name, GetForceAsString(__instance));
boosters.Remove(__instance); boosters.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleBooster", boosters.Count); // Console.WriteLine("Modifying {0} ModuleBooster", boosters.Count);
foreach (KeyValuePair<ModuleBooster, Dictionary<BoosterJet, float>> keyValuePair in boosters) { foreach (KeyValuePair<ModuleBooster, Dictionary<BoosterJet, float>> keyValuePair in boosters) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleBooster moduleBooster) { static void DoPatchSingle(ModuleBooster moduleBooster) {
List<BoosterJet> jets = GetValue(moduleBooster); List<BoosterJet> jets = GetValue(moduleBooster);
for (var i = 0; i < jets.Count; i++) { for (var i = 0; i < jets.Count; i++) {
boosters[moduleBooster][jets[i]] = GetValue(jets[i]); boosters[moduleBooster][jets[i]] = GetValue(jets[i]);
SetValue(jets[i], GetValue(jets[i]) * Main.jetThrustMultiplier.Value); SetValue(jets[i], GetValue(jets[i]) * Main.jetThrustMultiplier.Value);
} }
SetValue(moduleBooster, jets); SetValue(moduleBooster, jets);
} }
static void DoRestoreSingle(ModuleBooster moduleBooster) { static void DoRestoreSingle(ModuleBooster moduleBooster) {
if (boosters.ContainsKey(moduleBooster)) { if (boosters.ContainsKey(moduleBooster)) {
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) { foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
SetValue(boosterJet, boosters[moduleBooster][boosterJet]); SetValue(boosterJet, boosters[moduleBooster][boosterJet]);
} }
} }
} }
private static Dictionary<BoosterJet, float> Map(ModuleBooster moduleBooster) { private static Dictionary<BoosterJet, float> Map(ModuleBooster moduleBooster) {
Dictionary<BoosterJet, float> jets = new Dictionary<BoosterJet, float>(); Dictionary<BoosterJet, float> jets = new Dictionary<BoosterJet, float>();
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) { foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
jets.Add(boosterJet, GetValue(boosterJet)); jets.Add(boosterJet, GetValue(boosterJet));
} }
return jets; return jets;
} }
private static List<BoosterJet> GetValue(ModuleBooster moduleBooster) { private static List<BoosterJet> GetValue(ModuleBooster moduleBooster) {
return Traverse.Create(moduleBooster).Field("jets").GetValue() as List<BoosterJet>; return Traverse.Create(moduleBooster).Field("jets").GetValue() as List<BoosterJet>;
} }
private static void SetValue(ModuleBooster moduleBooster, List<BoosterJet> value) { private static void SetValue(ModuleBooster moduleBooster, List<BoosterJet> value) {
Traverse.Create(moduleBooster).Field("jets").SetValue(value); Traverse.Create(moduleBooster).Field("jets").SetValue(value);
} }
private static float GetValue(BoosterJet boosterJet) { private static float GetValue(BoosterJet boosterJet) {
return Traverse.Create(boosterJet).Field("m_Force").GetValue() as float? ?? 0f; return Traverse.Create(boosterJet).Field("m_Force").GetValue() as float? ?? 0f;
} }
private static void SetValue(BoosterJet boosterJet, float value) { private static void SetValue(BoosterJet boosterJet, float value) {
Traverse.Create(boosterJet).Field("m_Force").SetValue(value); Traverse.Create(boosterJet).Field("m_Force").SetValue(value);
} }
private static string GetForceAsString(ModuleBooster moduleBooster) { private static string GetForceAsString(ModuleBooster moduleBooster) {
string result = ""; string result = "";
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) { foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
result += GetValue(boosterJet) + ", "; result += GetValue(boosterJet) + ", ";
} }
return result; return result;
} }
} }
} }

View File

@@ -1,51 +1,51 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using BepInEx.Configuration; using BepInEx.Configuration;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class WeaponPropertiesManager { public class WeaponPropertiesManager {
private static Dictionary<ModuleWeaponGun, float> shotCooldown = new Dictionary<ModuleWeaponGun, float>(); private static Dictionary<ModuleWeaponGun, float> shotCooldown = new Dictionary<ModuleWeaponGun, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleWeaponGun), "OnAttached")] [HarmonyPatch(typeof(ModuleWeaponGun), "OnAttached")]
static void PostfixCreate(ModuleWeaponGun __instance) { static void PostfixCreate(ModuleWeaponGun __instance) {
// Console.WriteLine("ModuleWeaponGun.OnAttached"); // Console.WriteLine("ModuleWeaponGun.OnAttached");
if (!shotCooldown.ContainsKey(__instance)) { if (!shotCooldown.ContainsKey(__instance)) {
shotCooldown.Add(__instance, __instance.m_ShotCooldown); shotCooldown.Add(__instance, __instance.m_ShotCooldown);
// Console.WriteLine("Patching {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown); // Console.WriteLine("Patching {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown); // Console.WriteLine("Patched {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleWeaponGun), "OnDetaching")] [HarmonyPatch(typeof(ModuleWeaponGun), "OnDetaching")]
static void PostfixDestroy(ModuleWeaponGun __instance) { static void PostfixDestroy(ModuleWeaponGun __instance) {
// Console.WriteLine("ModuleWeaponGun.OnDetaching"); // Console.WriteLine("ModuleWeaponGun.OnDetaching");
// Console.WriteLine("Restoring {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown); // Console.WriteLine("Restoring {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown); // Console.WriteLine("Restored {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
shotCooldown.Remove(__instance); shotCooldown.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleWeaponGun", shotCooldown.Count); // Console.WriteLine("Modifying {0} ModuleWeaponGun", shotCooldown.Count);
foreach (KeyValuePair<ModuleWeaponGun, float> keyValuePair in shotCooldown) { foreach (KeyValuePair<ModuleWeaponGun, float> keyValuePair in shotCooldown) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleWeaponGun moduleWeaponGun) { static void DoPatchSingle(ModuleWeaponGun moduleWeaponGun) {
moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun] / Main.shootingSpeedMultiplier.Value; moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun] / Main.shootingSpeedMultiplier.Value;
} }
static void DoRestoreSingle(ModuleWeaponGun moduleWeaponGun) { static void DoRestoreSingle(ModuleWeaponGun moduleWeaponGun) {
if (shotCooldown.ContainsKey(moduleWeaponGun)) { if (shotCooldown.ContainsKey(moduleWeaponGun)) {
moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun]; moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun];
} }
} }
} }
} }

View File

@@ -1,63 +1,63 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class WheelPropertiesManager { public class WheelPropertiesManager {
private static Dictionary<ModuleWheels, float> torques = new Dictionary<ModuleWheels, float>(); private static Dictionary<ModuleWheels, float> torques = new Dictionary<ModuleWheels, float>();
private static Dictionary<ModuleWheels, float> maxRpm = new Dictionary<ModuleWheels, float>(); private static Dictionary<ModuleWheels, float> maxRpm = new Dictionary<ModuleWheels, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleWheels), "OnAttached")] [HarmonyPatch(typeof(ModuleWheels), "OnAttached")]
static void PostfixCreate(ModuleWheels __instance) { static void PostfixCreate(ModuleWheels __instance) {
// Console.WriteLine("ModuleWheels.OnAttached"); // Console.WriteLine("ModuleWheels.OnAttached");
if (!torques.ContainsKey(__instance)) { if (!torques.ContainsKey(__instance)) {
torques.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxTorque); torques.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxTorque);
maxRpm.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxRpm); maxRpm.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxRpm);
// Console.WriteLine("Patching {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name, // Console.WriteLine("Patching {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
// __instance.m_TorqueParams.torqueCurveMaxTorque, // __instance.m_TorqueParams.torqueCurveMaxTorque,
// __instance.m_TorqueParams.torqueCurveMaxRpm); // __instance.m_TorqueParams.torqueCurveMaxRpm);
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name, // Console.WriteLine("Patched {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
// __instance.m_TorqueParams.torqueCurveMaxTorque, // __instance.m_TorqueParams.torqueCurveMaxTorque,
// __instance.m_TorqueParams.torqueCurveMaxRpm); // __instance.m_TorqueParams.torqueCurveMaxRpm);
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleWheels), "OnDetaching")] [HarmonyPatch(typeof(ModuleWheels), "OnDetaching")]
static void PostfixDestroy(ModuleWheels __instance) { static void PostfixDestroy(ModuleWheels __instance) {
// Console.WriteLine("ModuleWheels.OnDetaching"); // Console.WriteLine("ModuleWheels.OnDetaching");
// Console.WriteLine("Restoring {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name, // Console.WriteLine("Restoring {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
// __instance.m_TorqueParams.torqueCurveMaxTorque, // __instance.m_TorqueParams.torqueCurveMaxTorque,
// __instance.m_TorqueParams.torqueCurveMaxRpm); // __instance.m_TorqueParams.torqueCurveMaxRpm);
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name, // Console.WriteLine("Restored {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
// __instance.m_TorqueParams.torqueCurveMaxTorque, // __instance.m_TorqueParams.torqueCurveMaxTorque,
// __instance.m_TorqueParams.torqueCurveMaxRpm); // __instance.m_TorqueParams.torqueCurveMaxRpm);
torques.Remove(__instance); torques.Remove(__instance);
maxRpm.Remove(__instance); maxRpm.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleWheels", torques.Count); // Console.WriteLine("Modifying {0} ModuleWheels", torques.Count);
foreach (KeyValuePair<ModuleWheels, float> keyValuePair in torques) { foreach (KeyValuePair<ModuleWheels, float> keyValuePair in torques) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleWheels moduleWheels) { static void DoPatchSingle(ModuleWheels moduleWheels) {
moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels] * Main.wheelSpeedMultiplier.Value; moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels] * Main.wheelSpeedMultiplier.Value;
moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels] * Main.wheelTorqueMultiplier.Value; moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels] * Main.wheelTorqueMultiplier.Value;
} }
static void DoRestoreSingle(ModuleWheels moduleWheels) { static void DoRestoreSingle(ModuleWheels moduleWheels) {
if (torques.ContainsKey(moduleWheels)) { if (torques.ContainsKey(moduleWheels)) {
moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels]; moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels];
moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels]; moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels];
} }
} }
} }
} }

View File

@@ -1,60 +1,60 @@
using System.Collections.Generic; using System.Collections.Generic;
using HarmonyLib; using HarmonyLib;
// TODO: Fix this, no workey // TODO: Fix this, no workey
namespace TerraTech { namespace TerraTech {
[HarmonyPatch] [HarmonyPatch]
public class WirelessChargerPropertiesManager { public class WirelessChargerPropertiesManager {
private static Dictionary<ModuleRemoteCharger, float> radius = new Dictionary<ModuleRemoteCharger, float>(); private static Dictionary<ModuleRemoteCharger, float> radius = new Dictionary<ModuleRemoteCharger, float>();
private static Dictionary<ModuleRemoteCharger, float> transferPerArc = new Dictionary<ModuleRemoteCharger, float>(); private static Dictionary<ModuleRemoteCharger, float> transferPerArc = new Dictionary<ModuleRemoteCharger, float>();
private static Dictionary<ModuleRemoteCharger, float> arcFiringInterval = new Dictionary<ModuleRemoteCharger, float>(); private static Dictionary<ModuleRemoteCharger, float> arcFiringInterval = new Dictionary<ModuleRemoteCharger, float>();
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleRemoteCharger), "OnAttached")] [HarmonyPatch(typeof(ModuleRemoteCharger), "OnAttached")]
static void PostfixCreate(ModuleRemoteCharger __instance) { static void PostfixCreate(ModuleRemoteCharger __instance) {
// Console.WriteLine("ModuleRemoteCharger.OnAttached"); // Console.WriteLine("ModuleRemoteCharger.OnAttached");
if (!radius.ContainsKey(__instance)) { if (!radius.ContainsKey(__instance)) {
radius.Add(__instance, __instance.m_ChargingRadius); radius.Add(__instance, __instance.m_ChargingRadius);
transferPerArc.Add(__instance, __instance.m_PowerTransferPerArc); transferPerArc.Add(__instance, __instance.m_PowerTransferPerArc);
arcFiringInterval.Add(__instance, __instance.m_ArcFiringInterval); arcFiringInterval.Add(__instance, __instance.m_ArcFiringInterval);
// Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
DoPatchSingle(__instance); DoPatchSingle(__instance);
// Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
} }
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ModuleRemoteCharger), "OnDetaching")] [HarmonyPatch(typeof(ModuleRemoteCharger), "OnDetaching")]
static void PostfixDestroy(ModuleRemoteCharger __instance) { static void PostfixDestroy(ModuleRemoteCharger __instance) {
// Console.WriteLine("ModuleRemoteCharger.OnAttached"); // Console.WriteLine("ModuleRemoteCharger.OnAttached");
// Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
DoRestoreSingle(__instance); DoRestoreSingle(__instance);
// Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity); // Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
radius.Remove(__instance); radius.Remove(__instance);
transferPerArc.Remove(__instance); transferPerArc.Remove(__instance);
arcFiringInterval.Remove(__instance); arcFiringInterval.Remove(__instance);
} }
public static void DoPatch() { public static void DoPatch() {
// Console.WriteLine("Modifying {0} ModuleRemoteCharger", radius.Count); // Console.WriteLine("Modifying {0} ModuleRemoteCharger", radius.Count);
foreach (KeyValuePair<ModuleRemoteCharger, float> keyValuePair in radius) { foreach (KeyValuePair<ModuleRemoteCharger, float> keyValuePair in radius) {
DoRestoreSingle(keyValuePair.Key); DoRestoreSingle(keyValuePair.Key);
DoPatchSingle(keyValuePair.Key); DoPatchSingle(keyValuePair.Key);
} }
} }
static void DoPatchSingle(ModuleRemoteCharger moduleRemoteCharger) { static void DoPatchSingle(ModuleRemoteCharger moduleRemoteCharger) {
moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger] * Main.wirelessChargingRadiusMultiplier.Value; moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger] * Main.wirelessChargingRadiusMultiplier.Value;
moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger] * Main.wirelessChargingPowerPerArcMultiplier.Value; moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger] * Main.wirelessChargingPowerPerArcMultiplier.Value;
moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger] * Main.wirelessChargingArcFiringIntervalMultiplier.Value; moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger] * Main.wirelessChargingArcFiringIntervalMultiplier.Value;
} }
static void DoRestoreSingle(ModuleRemoteCharger moduleRemoteCharger) { static void DoRestoreSingle(ModuleRemoteCharger moduleRemoteCharger) {
if (radius.ContainsKey(moduleRemoteCharger)) { if (radius.ContainsKey(moduleRemoteCharger)) {
moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger]; moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger];
moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger]; moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger];
moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger]; moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger];
} }
} }
} }
} }

View File

@@ -1,12 +1,12 @@
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\TerraTech.dll 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\TerraTech.pdb
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\0Harmony.dll 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\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\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.CoreModule.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\UnityEngine.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.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.dll
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.pdb C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.pdb
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\ConfigurationManager.dll C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\ConfigurationManager.dll
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.csprojResolveAssemblyReference.cache C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.csprojResolveAssemblyReference.cache

View File

@@ -1,16 +1,16 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeedShop", "WeedShop\WeedShop.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeedShop", "WeedShop\WeedShop.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {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}.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.ActiveCfg = Release|Any CPU
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU {EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -1,8 +1,8 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CWeedShop3_005Clibs_005C0Harmony_002Edll/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CWeedShop3_005Clibs_005C0Harmony_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CWeedShop3_005Clibs_005CAssembly_002DCSharp_002Edll/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CWeedShop3_005Clibs_005CAssembly_002DCSharp_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CWeedShop3_005Clibs_005CBepInEx_002Edll/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CWeedShop3_005Clibs_005CBepInEx_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CWeedShop3_005Clibs_005CConfigurationManager_002Edll/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CWeedShop3_005Clibs_005CConfigurationManager_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CWeedShop3_005Clibs_005Cootii_002Edll/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CWeedShop3_005Clibs_005Cootii_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CWeedShop3_005Clibs_005CUnityEngine_002ECoreModule_002Edll/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CWeedShop3_005Clibs_005CUnityEngine_002ECoreModule_002Edll/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CWeedShop3_005Clibs_005CUnityEngine_002Edll/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> <s:Boolean x:Key="/Default/AddReferences/RecentPaths/=C_003A_005CUsers_005CAdministrator_005CRiderProjects_005CBepinex_005CProjects_005CWeedShop3_005Clibs_005CUnityEngine_002Edll/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@@ -1,50 +1,50 @@
using System.Linq; using System.Linq;
using almost; using almost;
using almost.WF; using almost.WF;
using BepInEx; using BepInEx;
using BepInEx.Configuration; using BepInEx.Configuration;
using com.ootii.Messages; using com.ootii.Messages;
using HarmonyLib; using HarmonyLib;
using HarmonyLib.Tools; using HarmonyLib.Tools;
using MeshCombineStudio; using MeshCombineStudio;
namespace WeedShop { namespace WeedShop {
[BepInPlugin(pluginGuid, pluginName, pluginVersion)] [BepInPlugin(pluginGuid, pluginName, pluginVersion)]
public class Main : BaseUnityPlugin { public class Main : BaseUnityPlugin {
private const string pluginGuid = "CykaMod"; private const string pluginGuid = "CykaMod";
private const string pluginName = "CykaMod"; private const string pluginName = "CykaMod";
private const string pluginVersion = "1.0.0"; private const string pluginVersion = "1.0.0";
public static ConfigEntry<float> moneyMultiplier; public static ConfigEntry<float> moneyMultiplier;
public static ConfigEntry<float> weedQuantityMultiplier; public static ConfigEntry<float> weedQuantityMultiplier;
public static ConfigEntry<float> weedQualityMultiplier; public static ConfigEntry<float> weedQualityMultiplier;
public void Awake() { public void Awake() {
moneyMultiplier = Config.Bind("General", "Money Multiplier", 2f, new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(2f, 32f))); moneyMultiplier = Config.Bind("General", "Money Multiplier", 2f, new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(2f, 32f)));
weedQuantityMultiplier = Config.Bind("General", "Weed Quantity Multiplier", 2f, new ConfigDescription("Weed Quantity Multiplier", new AcceptableValueRange<float>(2f, 8f))); weedQuantityMultiplier = Config.Bind("General", "Weed Quantity Multiplier", 2f, new ConfigDescription("Weed Quantity Multiplier", new AcceptableValueRange<float>(2f, 8f)));
weedQualityMultiplier = Config.Bind("General", "Weed Quality Multiplier", 1.5f, new ConfigDescription("Weed Quality Multiplier", new AcceptableValueRange<float>(1.5f, 8f))); weedQualityMultiplier = Config.Bind("General", "Weed Quality Multiplier", 1.5f, new ConfigDescription("Weed Quality Multiplier", new AcceptableValueRange<float>(1.5f, 8f)));
Logger.LogInfo("Cyka mod loaded"); Logger.LogInfo("Cyka mod loaded");
HarmonyFileLog.Enabled = true; HarmonyFileLog.Enabled = true;
Harmony harmony = new Harmony(pluginGuid); Harmony harmony = new Harmony(pluginGuid);
harmony.PatchAll(); harmony.PatchAll();
var originalMethods = harmony.GetPatchedMethods(); var originalMethods = harmony.GetPatchedMethods();
Logger.LogInfo("Patched " + originalMethods.Count() + " methods"); Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(WeedFactory), "OnMakeMoney")] [HarmonyPatch(typeof(WeedFactory), "OnMakeMoney")]
private void OnMakeMoney(ref IMessage message) { private void OnMakeMoney(ref IMessage message) {
Console.Log("OnMakeMoney " + message.Data); Console.Log("OnMakeMoney " + message.Data);
message.Data = (long)message.Data * moneyMultiplier.Value; message.Data = (long)message.Data * moneyMultiplier.Value;
} }
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(ShopInventory), "AddWeed")] [HarmonyPatch(typeof(ShopInventory), "AddWeed")]
public virtual void AddWeed(BI item, ref float rawQuality, ref int quantity) { public virtual void AddWeed(BI item, ref float rawQuality, ref int quantity) {
Console.Log("AddWeed " + item + " " + rawQuality + " " + quantity); Console.Log("AddWeed " + item + " " + rawQuality + " " + quantity);
quantity = (int)(quantity * weedQuantityMultiplier.Value); quantity = (int)(quantity * weedQuantityMultiplier.Value);
rawQuality *= weedQualityMultiplier.Value; rawQuality *= weedQualityMultiplier.Value;
} }
} }
} }

View File

@@ -1,35 +1,35 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("TerraTech")] [assembly: AssemblyTitle("TerraTech")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TerraTech")] [assembly: AssemblyProduct("TerraTech")]
[assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible // 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 // to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type. // COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM // The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")] [assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")]
// Version information for an assembly consists of the following four values: // Version information for an assembly consists of the following four values:
// //
// Major Version // Major Version
// Minor Version // Minor Version
// Build Number // Build Number
// Revision // Revision
// //
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -1,69 +1,69 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid> <ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TerraTech</RootNamespace> <RootNamespace>TerraTech</RootNamespace>
<AssemblyName>TerraTech</AssemblyName> <AssemblyName>TerraTech</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Class1.cs" /> <Compile Include="Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Reference Include="0Harmony"> <Reference Include="0Harmony">
<HintPath>..\libs\0Harmony.dll</HintPath> <HintPath>..\libs\0Harmony.dll</HintPath>
</Reference> </Reference>
<Reference Include="Assembly-CSharp"> <Reference Include="Assembly-CSharp">
<HintPath>..\libs\Assembly-CSharp.dll</HintPath> <HintPath>..\libs\Assembly-CSharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="BepInEx"> <Reference Include="BepInEx">
<HintPath>..\libs\BepInEx.dll</HintPath> <HintPath>..\libs\BepInEx.dll</HintPath>
</Reference> </Reference>
<Reference Include="ConfigurationManager"> <Reference Include="ConfigurationManager">
<HintPath>..\libs\ConfigurationManager.dll</HintPath> <HintPath>..\libs\ConfigurationManager.dll</HintPath>
</Reference> </Reference>
<Reference Include="ootii"> <Reference Include="ootii">
<HintPath>..\libs\ootii.dll</HintPath> <HintPath>..\libs\ootii.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine"> <Reference Include="UnityEngine">
<HintPath>..\libs\UnityEngine.dll</HintPath> <HintPath>..\libs\UnityEngine.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.CoreModule"> <Reference Include="UnityEngine.CoreModule">
<HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath> <HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">
</Target> </Target>
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
</Project> </Project>