Update
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgainstTheStorm", "AgainstTheStorm\AgainstTheStorm.csproj", "{DA9D274E-486F-4F82-84FF-CD9388CB0B09}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{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}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AgainstTheStorm", "AgainstTheStorm\AgainstTheStorm.csproj", "{DA9D274E-486F-4F82-84FF-CD9388CB0B09}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{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}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@@ -1,82 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{DA9D274E-486F-4F82-84FF-CD9388CB0B09}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AgainstTheStorm</RootNamespace>
|
||||
<AssemblyName>AgainstTheStorm</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>libs\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MainAssembly">
|
||||
<HintPath>libs\MainAssembly.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sirenix.Serialization">
|
||||
<HintPath>libs\Sirenix.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>libs\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>libs\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Patches.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Transpiler.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="deploy.sh" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
|
||||
</Project>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{DA9D274E-486F-4F82-84FF-CD9388CB0B09}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>AgainstTheStorm</RootNamespace>
|
||||
<AssemblyName>AgainstTheStorm</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>libs\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MainAssembly">
|
||||
<HintPath>libs\MainAssembly.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sirenix.Serialization">
|
||||
<HintPath>libs\Sirenix.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>libs\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>libs\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Patches.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Transpiler.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="deploy.sh" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
|
||||
</Project>
|
||||
|
@@ -1,35 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Regiments")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Regiments")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("DA9D274E-486F-4F82-84FF-CD9388CB0B09")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Regiments")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Regiments")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("DA9D274E-486F-4F82-84FF-CD9388CB0B09")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
@@ -1,274 +1,274 @@
|
||||
// using System;
|
||||
// using System.Collections.Generic;
|
||||
// using System.Linq;
|
||||
// using System.Reflection.Emit;
|
||||
// using BepInEx;
|
||||
// using BepInEx.Configuration;
|
||||
// using HarmonyLib;
|
||||
// using HarmonyLib.Tools;
|
||||
//
|
||||
// namespace Regiments {
|
||||
// [BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
// public class Main : BaseUnityPlugin {
|
||||
// private const string pluginGuid = "CykaMod";
|
||||
// private const string pluginName = "CykaMod";
|
||||
// private const string pluginVersion = "1.0.0";
|
||||
//
|
||||
// public static ConfigEntry<float> skillCap;
|
||||
// public static ConfigEntry<float> workSpeed;
|
||||
// public static ConfigEntry<float> workResult;
|
||||
// public static ConfigEntry<bool> alwaysCritical;
|
||||
// public static ConfigEntry<float> gameSpeed;
|
||||
// public static ConfigEntry<int> fans;
|
||||
// public static ConfigEntry<long> money;
|
||||
//
|
||||
// //
|
||||
// // private void Awake()
|
||||
// // {
|
||||
// // configGreeting = Config.Bind("General", // The section under which the option is shown
|
||||
// // "GreetingText", // The key of the configuration option in the configuration file
|
||||
// // "Hello, world!", // The default value
|
||||
// // "A greeting text to show when the game is launched"); // Description of the option to show in the config file
|
||||
// //
|
||||
//
|
||||
// public void Awake() {
|
||||
// skillCap = Config.Bind("General", "Skill Cap", 100f);
|
||||
// workSpeed = Config.Bind("General", "Work Speed Multiplier", 4f);
|
||||
// workResult = Config.Bind("General", "Work Result Multiplier", 4f);
|
||||
// alwaysCritical = Config.Bind("General", "Work Always Critical", false);
|
||||
// gameSpeed = Config.Bind("General", "Game Speed Multiplier", 3f);
|
||||
// fans = Config.Bind("General", "Fans Multiplier", 2);
|
||||
// money = Config.Bind("General", "Money Multiplier", 2L);
|
||||
//
|
||||
// Logger.LogInfo("Cyka mod loaded");
|
||||
// HarmonyFileLog.Enabled = true;
|
||||
// Harmony harmony = new Harmony(pluginGuid);
|
||||
// harmony.PatchAll();
|
||||
// var originalMethods = harmony.GetPatchedMethods();
|
||||
// Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
// }
|
||||
//
|
||||
// public static bool IsMatch(List<CodeInstruction> codes, int index, List<CodeInstruction> matcher) {
|
||||
// for (var i = 0; i < matcher.Count; i++) {
|
||||
// if (codes[index + i].opcode != matcher[i].opcode) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// public static void InsertAt(List<CodeInstruction> codes, int index, List<CodeInstruction> toInsert) {
|
||||
// for (var i = 0; i < toInsert.Count; i++) {
|
||||
// codes.Insert(index + i, toInsert[i]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetSkillCap")]
|
||||
// public class SkillCapPatch {
|
||||
// static void Postfix(ref float __result) {
|
||||
// // Console.WriteLine("GetSkillCap Postfix! Result is " + __result);
|
||||
// __result = Main.skillCap.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetSkillCap_Skill")]
|
||||
// public class SkillCapSkillPatch {
|
||||
// static void Postfix(ref float __result) {
|
||||
// // Console.WriteLine("GetSkillCap_Skill Postfix! Result is " + __result);
|
||||
// __result = Main.skillCap.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetWorkSpeed")]
|
||||
// public class GetWorkSpeedPatch {
|
||||
// static void Postfix(ref float __result) {
|
||||
// // Console.WriteLine("GetWorkSpeed Postfix! Result is " + __result);
|
||||
// __result *= Main.workSpeed.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetWorkResult")]
|
||||
// public class GetWorkResultPatch {
|
||||
// static void Prefix(ref float f) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// f *= Main.workResult.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetCritic")]
|
||||
// public class GetCriticPatch {
|
||||
// static void Postfix(ref bool __result) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// if (Main.alwaysCritical.Value) {
|
||||
// __result = true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "SetGameSpeed")]
|
||||
// public class GameSpeedPatch {
|
||||
// static void Prefix(ref float f) {
|
||||
// // Console.WriteLine("SetGameSpeed Prefix! Argument is " + f);
|
||||
// if (f > 1) {
|
||||
// f *= Main.gameSpeed.Value;
|
||||
// // Console.WriteLine("Argument modified to " + f);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "Learn")]
|
||||
// public static class LearnManyPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// for (var i = 0; i < 5; i++) {
|
||||
// if (codes[i].opcode == OpCodes.Ldc_R4) {
|
||||
// Console.WriteLine("Changing " + codes[i]);
|
||||
// codes[i].operand = (float)codes[i].operand * 64;
|
||||
// Console.WriteLine("Changed " + codes[i]);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(arbeitsmarkt), "ArbeitsmarktUpdaten")]
|
||||
// public static class ManyEmployeesPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// for (var i = codes.Count - 1; i > 0; i--) {
|
||||
// if (codes[i].opcode == OpCodes.Ldc_I4_3) {
|
||||
// Console.WriteLine("Changing " + codes[i]);
|
||||
// codes[i] = new CodeInstruction(OpCodes.Ldc_I4, 64);
|
||||
// Console.WriteLine("Changed " + codes[i]);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // [HarmonyPatch(typeof(AILerp), "MovementUpdate")]
|
||||
// public class MovementSpeedPatch {
|
||||
// static void Prefix(ref float deltaTime) {
|
||||
// Console.WriteLine("MovementUpdate Prefix! deltaTime is " + deltaTime);
|
||||
// deltaTime *= 16f;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // [HarmonyPatch(typeof(movementScript), "Move")]
|
||||
// public static class EmployeeMovementSpeedPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// List<CodeInstruction> matcher = new List<CodeInstruction>();
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Mul, null));
|
||||
//
|
||||
// List<CodeInstruction> patch = new List<CodeInstruction>();
|
||||
// patch.Add(new CodeInstruction(OpCodes.Ldc_R4, 8));
|
||||
// patch.Add(new CodeInstruction(OpCodes.Mul, null));
|
||||
//
|
||||
// for (var i = codes.Count - 1; i > 0; i--) {
|
||||
// if (Main.IsMatch(codes, i, matcher)) {
|
||||
// Main.InsertAt(codes, i + 5, patch);
|
||||
// Console.WriteLine("Movement speed patched");
|
||||
// for (var j = 0; j < 15; j++) {
|
||||
// Console.WriteLine(codes[i + j]);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// Console.WriteLine("Return");
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "WochenUpdates")]
|
||||
// public static class ContractWorkAmount {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
// int methodIndex = -1;
|
||||
// List<CodeInstruction> pattern = new List<CodeInstruction>();
|
||||
//
|
||||
// List<CodeInstruction> matcher = new List<CodeInstruction>();
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldc_I4_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Callvirt, null));
|
||||
//
|
||||
// for (var i = 0; i < codes.Count; i++) {
|
||||
// if (codes[i].operand != null) {
|
||||
// if (codes[i].operand.ToString().Contains("UpdateContractWork")) {
|
||||
// methodIndex = i;
|
||||
// pattern.Add(codes[i - 3]);
|
||||
// pattern.Add(codes[i - 2]);
|
||||
// pattern.Add(codes[i - 1]);
|
||||
// pattern.Add(codes[i]);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// pattern[2].opcode = OpCodes.Ldc_I4_1;
|
||||
//
|
||||
// for (int i = 0; i < 16; i++) {
|
||||
// for (int j = 0; j < pattern.Count; j++) {
|
||||
// codes.Insert(methodIndex + i + j, pattern[j]);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(platformScript), "SellPlayer")]
|
||||
// public static class ConsoleProductionReductionPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// 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.Ldc_R4, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Call, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Add, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Stfld, null));
|
||||
//
|
||||
// for (var i = 0; i < codes.Count; i++) {
|
||||
// if (Main.IsMatch(codes, i, matcher)) {
|
||||
// codes[i + 3].operand = (float)codes[i + 3].operand * 8f;
|
||||
// codes[i + 4].operand = (float)codes[i + 4].operand * 8f;
|
||||
// Console.WriteLine("ConsoleProductionReductionPatch patched");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "AddFans")]
|
||||
// public static class AddFansPatch {
|
||||
// static void Prefix(ref int i) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// i *= Main.fans.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "Earn")]
|
||||
// public static class AddMoneyPatch {
|
||||
// static void Prefix(ref long amount) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// amount *= Main.money.Value;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// using System;
|
||||
// using System.Collections.Generic;
|
||||
// using System.Linq;
|
||||
// using System.Reflection.Emit;
|
||||
// using BepInEx;
|
||||
// using BepInEx.Configuration;
|
||||
// using HarmonyLib;
|
||||
// using HarmonyLib.Tools;
|
||||
//
|
||||
// namespace Regiments {
|
||||
// [BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
// public class Main : BaseUnityPlugin {
|
||||
// private const string pluginGuid = "CykaMod";
|
||||
// private const string pluginName = "CykaMod";
|
||||
// private const string pluginVersion = "1.0.0";
|
||||
//
|
||||
// public static ConfigEntry<float> skillCap;
|
||||
// public static ConfigEntry<float> workSpeed;
|
||||
// public static ConfigEntry<float> workResult;
|
||||
// public static ConfigEntry<bool> alwaysCritical;
|
||||
// public static ConfigEntry<float> gameSpeed;
|
||||
// public static ConfigEntry<int> fans;
|
||||
// public static ConfigEntry<long> money;
|
||||
//
|
||||
// //
|
||||
// // private void Awake()
|
||||
// // {
|
||||
// // configGreeting = Config.Bind("General", // The section under which the option is shown
|
||||
// // "GreetingText", // The key of the configuration option in the configuration file
|
||||
// // "Hello, world!", // The default value
|
||||
// // "A greeting text to show when the game is launched"); // Description of the option to show in the config file
|
||||
// //
|
||||
//
|
||||
// public void Awake() {
|
||||
// skillCap = Config.Bind("General", "Skill Cap", 100f);
|
||||
// workSpeed = Config.Bind("General", "Work Speed Multiplier", 4f);
|
||||
// workResult = Config.Bind("General", "Work Result Multiplier", 4f);
|
||||
// alwaysCritical = Config.Bind("General", "Work Always Critical", false);
|
||||
// gameSpeed = Config.Bind("General", "Game Speed Multiplier", 3f);
|
||||
// fans = Config.Bind("General", "Fans Multiplier", 2);
|
||||
// money = Config.Bind("General", "Money Multiplier", 2L);
|
||||
//
|
||||
// Logger.LogInfo("Cyka mod loaded");
|
||||
// HarmonyFileLog.Enabled = true;
|
||||
// Harmony harmony = new Harmony(pluginGuid);
|
||||
// harmony.PatchAll();
|
||||
// var originalMethods = harmony.GetPatchedMethods();
|
||||
// Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
// }
|
||||
//
|
||||
// public static bool IsMatch(List<CodeInstruction> codes, int index, List<CodeInstruction> matcher) {
|
||||
// for (var i = 0; i < matcher.Count; i++) {
|
||||
// if (codes[index + i].opcode != matcher[i].opcode) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// public static void InsertAt(List<CodeInstruction> codes, int index, List<CodeInstruction> toInsert) {
|
||||
// for (var i = 0; i < toInsert.Count; i++) {
|
||||
// codes.Insert(index + i, toInsert[i]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetSkillCap")]
|
||||
// public class SkillCapPatch {
|
||||
// static void Postfix(ref float __result) {
|
||||
// // Console.WriteLine("GetSkillCap Postfix! Result is " + __result);
|
||||
// __result = Main.skillCap.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetSkillCap_Skill")]
|
||||
// public class SkillCapSkillPatch {
|
||||
// static void Postfix(ref float __result) {
|
||||
// // Console.WriteLine("GetSkillCap_Skill Postfix! Result is " + __result);
|
||||
// __result = Main.skillCap.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetWorkSpeed")]
|
||||
// public class GetWorkSpeedPatch {
|
||||
// static void Postfix(ref float __result) {
|
||||
// // Console.WriteLine("GetWorkSpeed Postfix! Result is " + __result);
|
||||
// __result *= Main.workSpeed.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetWorkResult")]
|
||||
// public class GetWorkResultPatch {
|
||||
// static void Prefix(ref float f) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// f *= Main.workResult.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetCritic")]
|
||||
// public class GetCriticPatch {
|
||||
// static void Postfix(ref bool __result) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// if (Main.alwaysCritical.Value) {
|
||||
// __result = true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "SetGameSpeed")]
|
||||
// public class GameSpeedPatch {
|
||||
// static void Prefix(ref float f) {
|
||||
// // Console.WriteLine("SetGameSpeed Prefix! Argument is " + f);
|
||||
// if (f > 1) {
|
||||
// f *= Main.gameSpeed.Value;
|
||||
// // Console.WriteLine("Argument modified to " + f);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "Learn")]
|
||||
// public static class LearnManyPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// for (var i = 0; i < 5; i++) {
|
||||
// if (codes[i].opcode == OpCodes.Ldc_R4) {
|
||||
// Console.WriteLine("Changing " + codes[i]);
|
||||
// codes[i].operand = (float)codes[i].operand * 64;
|
||||
// Console.WriteLine("Changed " + codes[i]);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(arbeitsmarkt), "ArbeitsmarktUpdaten")]
|
||||
// public static class ManyEmployeesPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// for (var i = codes.Count - 1; i > 0; i--) {
|
||||
// if (codes[i].opcode == OpCodes.Ldc_I4_3) {
|
||||
// Console.WriteLine("Changing " + codes[i]);
|
||||
// codes[i] = new CodeInstruction(OpCodes.Ldc_I4, 64);
|
||||
// Console.WriteLine("Changed " + codes[i]);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // [HarmonyPatch(typeof(AILerp), "MovementUpdate")]
|
||||
// public class MovementSpeedPatch {
|
||||
// static void Prefix(ref float deltaTime) {
|
||||
// Console.WriteLine("MovementUpdate Prefix! deltaTime is " + deltaTime);
|
||||
// deltaTime *= 16f;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // [HarmonyPatch(typeof(movementScript), "Move")]
|
||||
// public static class EmployeeMovementSpeedPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// List<CodeInstruction> matcher = new List<CodeInstruction>();
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Mul, null));
|
||||
//
|
||||
// List<CodeInstruction> patch = new List<CodeInstruction>();
|
||||
// patch.Add(new CodeInstruction(OpCodes.Ldc_R4, 8));
|
||||
// patch.Add(new CodeInstruction(OpCodes.Mul, null));
|
||||
//
|
||||
// for (var i = codes.Count - 1; i > 0; i--) {
|
||||
// if (Main.IsMatch(codes, i, matcher)) {
|
||||
// Main.InsertAt(codes, i + 5, patch);
|
||||
// Console.WriteLine("Movement speed patched");
|
||||
// for (var j = 0; j < 15; j++) {
|
||||
// Console.WriteLine(codes[i + j]);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// Console.WriteLine("Return");
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "WochenUpdates")]
|
||||
// public static class ContractWorkAmount {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
// int methodIndex = -1;
|
||||
// List<CodeInstruction> pattern = new List<CodeInstruction>();
|
||||
//
|
||||
// List<CodeInstruction> matcher = new List<CodeInstruction>();
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldc_I4_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Callvirt, null));
|
||||
//
|
||||
// for (var i = 0; i < codes.Count; i++) {
|
||||
// if (codes[i].operand != null) {
|
||||
// if (codes[i].operand.ToString().Contains("UpdateContractWork")) {
|
||||
// methodIndex = i;
|
||||
// pattern.Add(codes[i - 3]);
|
||||
// pattern.Add(codes[i - 2]);
|
||||
// pattern.Add(codes[i - 1]);
|
||||
// pattern.Add(codes[i]);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// pattern[2].opcode = OpCodes.Ldc_I4_1;
|
||||
//
|
||||
// for (int i = 0; i < 16; i++) {
|
||||
// for (int j = 0; j < pattern.Count; j++) {
|
||||
// codes.Insert(methodIndex + i + j, pattern[j]);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(platformScript), "SellPlayer")]
|
||||
// public static class ConsoleProductionReductionPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// 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.Ldc_R4, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Call, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Add, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Stfld, null));
|
||||
//
|
||||
// for (var i = 0; i < codes.Count; i++) {
|
||||
// if (Main.IsMatch(codes, i, matcher)) {
|
||||
// codes[i + 3].operand = (float)codes[i + 3].operand * 8f;
|
||||
// codes[i + 4].operand = (float)codes[i + 4].operand * 8f;
|
||||
// Console.WriteLine("ConsoleProductionReductionPatch patched");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "AddFans")]
|
||||
// public static class AddFansPatch {
|
||||
// static void Prefix(ref int i) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// i *= Main.fans.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "Earn")]
|
||||
// public static class AddMoneyPatch {
|
||||
// static void Prefix(ref long amount) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// amount *= Main.money.Value;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
@@ -1 +1 @@
|
||||
151279b84fdcbaafd9f0fcb1f7663654a57733b1df3836fc5634a1051692a2db
|
||||
151279b84fdcbaafd9f0fcb1f7663654a57733b1df3836fc5634a1051692a2db
|
||||
|
@@ -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.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\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\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\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\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.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.pdb
|
||||
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\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\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\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.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.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.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\AgainstTheStorm\AgainstTheStorm\obj\Debug\AgainstTheStorm.pdb
|
||||
|
@@ -1,16 +1,16 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainOfIndustry", "CaptainOfIndustry\CaptainOfIndustry.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaptainOfIndustry", "CaptainOfIndustry\CaptainOfIndustry.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@@ -1,97 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CaptainOfIndustry</RootNamespace>
|
||||
<AssemblyName>CaptainOfIndustry</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Patches.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>..\libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>..\libs\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>..\libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mafi">
|
||||
<HintPath>..\libs\Mafi.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mafi.Base">
|
||||
<HintPath>..\libs\Mafi.Base.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mafi.Core">
|
||||
<HintPath>..\libs\Mafi.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mafi.ModsAuthoringSupport">
|
||||
<HintPath>..\libs\Mafi.ModsAuthoringSupport.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mafi.Unity">
|
||||
<HintPath>..\libs\Mafi.Unity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sirenix.OdinInspector.Attributes">
|
||||
<HintPath>..\libs\Sirenix.OdinInspector.Attributes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sirenix.OdinInspector.CompatibilityLayer">
|
||||
<HintPath>..\libs\Sirenix.OdinInspector.CompatibilityLayer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sirenix.Serialization">
|
||||
<HintPath>..\libs\Sirenix.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sirenix.Serialization.Config">
|
||||
<HintPath>..\libs\Sirenix.Serialization.Config.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sirenix.Utilities">
|
||||
<HintPath>..\libs\Sirenix.Utilities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>..\libs\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CaptainOfIndustry</RootNamespace>
|
||||
<AssemblyName>CaptainOfIndustry</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Patches.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>..\libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>..\libs\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>..\libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mafi">
|
||||
<HintPath>..\libs\Mafi.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mafi.Base">
|
||||
<HintPath>..\libs\Mafi.Base.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mafi.Core">
|
||||
<HintPath>..\libs\Mafi.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mafi.ModsAuthoringSupport">
|
||||
<HintPath>..\libs\Mafi.ModsAuthoringSupport.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mafi.Unity">
|
||||
<HintPath>..\libs\Mafi.Unity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sirenix.OdinInspector.Attributes">
|
||||
<HintPath>..\libs\Sirenix.OdinInspector.Attributes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sirenix.OdinInspector.CompatibilityLayer">
|
||||
<HintPath>..\libs\Sirenix.OdinInspector.CompatibilityLayer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sirenix.Serialization">
|
||||
<HintPath>..\libs\Sirenix.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sirenix.Serialization.Config">
|
||||
<HintPath>..\libs\Sirenix.Serialization.Config.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Sirenix.Utilities">
|
||||
<HintPath>..\libs\Sirenix.Utilities.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>..\libs\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
@@ -1,35 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("CaptainOfIndustry")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CaptainOfIndustry")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("CaptainOfIndustry")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CaptainOfIndustry")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
@@ -1,16 +1,16 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Escapists2", "Escapists2\Escapists2.csproj", "{20F983A2-1743-4E96-BFDB-CF5A4F134D2D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{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}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{20F983A2-1743-4E96-BFDB-CF5A4F134D2D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Escapists2", "Escapists2\Escapists2.csproj", "{20F983A2-1743-4E96-BFDB-CF5A4F134D2D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{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}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{20F983A2-1743-4E96-BFDB-CF5A4F134D2D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@@ -1,95 +1,95 @@
|
||||
using System.Linq;
|
||||
using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
using HarmonyLib.Tools;
|
||||
|
||||
namespace Escapists2 {
|
||||
[BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
public class Main : BaseUnityPlugin {
|
||||
private const string pluginGuid = "CykaMod";
|
||||
private const string pluginName = "CykaMod";
|
||||
private const string pluginVersion = "1.0.0";
|
||||
|
||||
public static ConfigEntry<float> xpMultiplier;
|
||||
|
||||
public void Awake() {
|
||||
xpMultiplier = Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f,
|
||||
// new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f,
|
||||
// new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f)));
|
||||
// heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f,
|
||||
// new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f)));
|
||||
//
|
||||
// shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f,
|
||||
// new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f)));
|
||||
// muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f,
|
||||
// new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
// 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)));
|
||||
// seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f,
|
||||
// new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
// seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f,
|
||||
// new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
//
|
||||
// magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f,
|
||||
// new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
// magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f,
|
||||
// new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
// beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f,
|
||||
// new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
// beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f,
|
||||
// new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
//
|
||||
// wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f,
|
||||
// new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
// wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f,
|
||||
// new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f)));
|
||||
// wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f,
|
||||
// new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
//
|
||||
// fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f,
|
||||
// new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f,
|
||||
// new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f,
|
||||
// new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f,
|
||||
// new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f,
|
||||
// new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
//
|
||||
// minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f,
|
||||
// new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f,
|
||||
// new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f)));
|
||||
//
|
||||
// allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false);
|
||||
|
||||
// shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch();
|
||||
// energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch();
|
||||
// magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
// magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
// beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
// beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
// fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
// fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
// wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
// wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
// jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch();
|
||||
// minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
// minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
// wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
// wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
// wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
|
||||
Logger.LogInfo("Cyka mod loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
Harmony harmony = new Harmony(pluginGuid);
|
||||
harmony.PatchAll();
|
||||
var originalMethods = harmony.GetPatchedMethods();
|
||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
}
|
||||
}
|
||||
using System.Linq;
|
||||
using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
using HarmonyLib.Tools;
|
||||
|
||||
namespace Escapists2 {
|
||||
[BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
public class Main : BaseUnityPlugin {
|
||||
private const string pluginGuid = "CykaMod";
|
||||
private const string pluginName = "CykaMod";
|
||||
private const string pluginVersion = "1.0.0";
|
||||
|
||||
public static ConfigEntry<float> xpMultiplier;
|
||||
|
||||
public void Awake() {
|
||||
xpMultiplier = Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f,
|
||||
// new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f,
|
||||
// new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f)));
|
||||
// heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f,
|
||||
// new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f)));
|
||||
//
|
||||
// shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f,
|
||||
// new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f)));
|
||||
// muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f,
|
||||
// new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
// 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)));
|
||||
// seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f,
|
||||
// new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
// seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f,
|
||||
// new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
//
|
||||
// magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f,
|
||||
// new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
// magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f,
|
||||
// new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
// beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f,
|
||||
// new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
// beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f,
|
||||
// new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
//
|
||||
// wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f,
|
||||
// new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
// wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f,
|
||||
// new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f)));
|
||||
// wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f,
|
||||
// new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
//
|
||||
// fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f,
|
||||
// new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f,
|
||||
// new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f,
|
||||
// new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f,
|
||||
// new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f,
|
||||
// new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
//
|
||||
// minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f,
|
||||
// new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f,
|
||||
// new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f)));
|
||||
//
|
||||
// allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false);
|
||||
|
||||
// shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch();
|
||||
// energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch();
|
||||
// magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
// magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
// beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
// beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
// fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
// fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
// wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
// wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
// jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch();
|
||||
// minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
// minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
// wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
// wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
// wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
|
||||
Logger.LogInfo("Cyka mod loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
Harmony harmony = new Harmony(pluginGuid);
|
||||
harmony.PatchAll();
|
||||
var originalMethods = harmony.GetPatchedMethods();
|
||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,69 +1,69 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{20F983A2-1743-4E96-BFDB-CF5A4F134D2D}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Escapists2</RootNamespace>
|
||||
<AssemblyName>Escapists2</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>libs\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>libs\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="XPPatch.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
|
||||
</Project>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{20F983A2-1743-4E96-BFDB-CF5A4F134D2D}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Escapists2</RootNamespace>
|
||||
<AssemblyName>Escapists2</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>libs\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>libs\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="XPPatch.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
|
||||
</Project>
|
||||
|
@@ -1,35 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Escapists2")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Escapists2")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("20F983A2-1743-4E96-BFDB-CF5A4F134D2D")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Escapists2")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Escapists2")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("20F983A2-1743-4E96-BFDB-CF5A4F134D2D")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
@@ -1,12 +1,12 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace Escapists2 {
|
||||
[HarmonyPatch]
|
||||
public class XPPatch {
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(CharacterStats), "ModifyStat_Internal")]
|
||||
static void XPMulti(ref float change, ref HiddenFloat stat, ref float max) {
|
||||
change *= Main.xpMultiplier.Value;
|
||||
}
|
||||
}
|
||||
using HarmonyLib;
|
||||
|
||||
namespace Escapists2 {
|
||||
[HarmonyPatch]
|
||||
public class XPPatch {
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(CharacterStats), "ModifyStat_Internal")]
|
||||
static void XPMulti(ref float change, ref HiddenFloat stat, ref float max) {
|
||||
change *= Main.xpMultiplier.Value;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]
|
||||
|
Binary file not shown.
@@ -1 +1 @@
|
||||
09ea03cdb969439a4f3eb3dedfa28a8d8654a867
|
||||
09ea03cdb969439a4f3eb3dedfa28a8d8654a867
|
||||
|
@@ -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.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.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.pdb
|
||||
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\BepInEx.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\obj\Debug\Escapists2.csproj.CopyComplete
|
||||
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\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.dll
|
||||
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\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\ConfigurationManager.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
|
||||
|
@@ -1,16 +1,16 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HouseFlipper", "HouseFlipper\HouseFlipper.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HouseFlipper", "HouseFlipper\HouseFlipper.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@@ -1,79 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class BeamPropertiesManager {
|
||||
private static Dictionary<ModuleItemHolderBeam, float> strenghts = new Dictionary<ModuleItemHolderBeam, float>();
|
||||
private static Dictionary<ModuleItemHolderBeam, float> radii = new Dictionary<ModuleItemHolderBeam, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderBeam), "OnAttached")]
|
||||
static void PostfixCreate(ModuleItemHolderBeam __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderBeam.OnAttached");
|
||||
if (!strenghts.ContainsKey(__instance)) {
|
||||
strenghts.Add(__instance, GetStrength(__instance));
|
||||
radii.Add(__instance, GetRadius(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderBeam), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleItemHolderBeam __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderBeam.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
strenghts.Remove(__instance);
|
||||
radii.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleItemHolderBeam", strenghts.Count);
|
||||
foreach (KeyValuePair<ModuleItemHolderBeam, float> keyValuePair in strenghts) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam] * Main.beamStrenghtMultiplier.Value);
|
||||
SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam] * Main.beamRadiusMultiplier.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
if (strenghts.ContainsKey(moduleItemHolderBeam)) {
|
||||
SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam]);
|
||||
SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetStrength(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
return Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetStrength(ModuleItemHolderBeam moduleItemHolderBeam, float value) {
|
||||
Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetRadius(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f;
|
||||
return radius;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
private static void SetRadius(ModuleItemHolderBeam moduleItemHolderBeam, float value) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class BeamPropertiesManager {
|
||||
private static Dictionary<ModuleItemHolderBeam, float> strenghts = new Dictionary<ModuleItemHolderBeam, float>();
|
||||
private static Dictionary<ModuleItemHolderBeam, float> radii = new Dictionary<ModuleItemHolderBeam, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderBeam), "OnAttached")]
|
||||
static void PostfixCreate(ModuleItemHolderBeam __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderBeam.OnAttached");
|
||||
if (!strenghts.ContainsKey(__instance)) {
|
||||
strenghts.Add(__instance, GetStrength(__instance));
|
||||
radii.Add(__instance, GetRadius(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderBeam), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleItemHolderBeam __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderBeam.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
strenghts.Remove(__instance);
|
||||
radii.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleItemHolderBeam", strenghts.Count);
|
||||
foreach (KeyValuePair<ModuleItemHolderBeam, float> keyValuePair in strenghts) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam] * Main.beamStrenghtMultiplier.Value);
|
||||
SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam] * Main.beamRadiusMultiplier.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
if (strenghts.ContainsKey(moduleItemHolderBeam)) {
|
||||
SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam]);
|
||||
SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetStrength(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
return Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetStrength(ModuleItemHolderBeam moduleItemHolderBeam, float value) {
|
||||
Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetRadius(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f;
|
||||
return radius;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
private static void SetRadius(ModuleItemHolderBeam moduleItemHolderBeam, float value) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,121 +1,121 @@
|
||||
using System.Linq;
|
||||
using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
using HarmonyLib.Tools;
|
||||
|
||||
// TODO: Make shield and repair bigger
|
||||
// TODO: Maybe make props faster, thrusters work fine
|
||||
|
||||
namespace HouseFlipper {
|
||||
[BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
public class Main : BaseUnityPlugin {
|
||||
private const string pluginGuid = "CykaMod";
|
||||
private const string pluginName = "CykaMod";
|
||||
private const string pluginVersion = "1.0.0";
|
||||
|
||||
public static ConfigEntry<float> xpMultiplier;
|
||||
public static ConfigEntry<float> moneyMultiplier;
|
||||
public static ConfigEntry<float> energyGenMultiplier;
|
||||
public static ConfigEntry<float> heartbeatIntervalMultiplier;
|
||||
public static ConfigEntry<float> shootingSpeedMultiplier;
|
||||
public static ConfigEntry<float> muzzleVelocityMultiplier;
|
||||
public static ConfigEntry<bool> allProjectilesHoming;
|
||||
public static ConfigEntry<float> magnetStrenghtMultiplier;
|
||||
public static ConfigEntry<float> magnetRadiusMultiplier;
|
||||
public static ConfigEntry<float> beamStrenghtMultiplier;
|
||||
public static ConfigEntry<float> beamRadiusMultiplier;
|
||||
public static ConfigEntry<float> fuelTankRefillMultiplier;
|
||||
public static ConfigEntry<float> fuelTankCapacityMultiplier;
|
||||
public static ConfigEntry<float> minerGroundArea;
|
||||
public static ConfigEntry<float> minerMiningSpeed;
|
||||
public static ConfigEntry<float> wheelTorqueMultiplier;
|
||||
public static ConfigEntry<float> wheelSpeedMultiplier;
|
||||
public static ConfigEntry<float> jetThrustMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileVisionConeAngleMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileVisionRangeMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileTurningSpeedMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingRadiusMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingPowerPerArcMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingArcFiringIntervalMultiplier;
|
||||
|
||||
public void Awake() {
|
||||
xpMultiplier = Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f,
|
||||
new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f,
|
||||
new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f)));
|
||||
heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f,
|
||||
new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f)));
|
||||
|
||||
shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f,
|
||||
new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f)));
|
||||
muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f,
|
||||
new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
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)));
|
||||
seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f,
|
||||
new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f,
|
||||
new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
|
||||
magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f,
|
||||
new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f,
|
||||
new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f,
|
||||
new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f,
|
||||
new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
|
||||
wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f,
|
||||
new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f,
|
||||
new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f)));
|
||||
wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f,
|
||||
new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
|
||||
fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f,
|
||||
new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f,
|
||||
new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f,
|
||||
new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f,
|
||||
new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f,
|
||||
new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
|
||||
minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f,
|
||||
new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f)));
|
||||
minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f,
|
||||
new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f)));
|
||||
|
||||
allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false);
|
||||
|
||||
shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch();
|
||||
energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch();
|
||||
magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch();
|
||||
minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
|
||||
Logger.LogInfo("Cyka mod loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
Harmony harmony = new Harmony(pluginGuid);
|
||||
harmony.PatchAll();
|
||||
var originalMethods = harmony.GetPatchedMethods();
|
||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
}
|
||||
}
|
||||
using System.Linq;
|
||||
using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
using HarmonyLib.Tools;
|
||||
|
||||
// TODO: Make shield and repair bigger
|
||||
// TODO: Maybe make props faster, thrusters work fine
|
||||
|
||||
namespace HouseFlipper {
|
||||
[BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
public class Main : BaseUnityPlugin {
|
||||
private const string pluginGuid = "CykaMod";
|
||||
private const string pluginName = "CykaMod";
|
||||
private const string pluginVersion = "1.0.0";
|
||||
|
||||
public static ConfigEntry<float> xpMultiplier;
|
||||
public static ConfigEntry<float> moneyMultiplier;
|
||||
public static ConfigEntry<float> energyGenMultiplier;
|
||||
public static ConfigEntry<float> heartbeatIntervalMultiplier;
|
||||
public static ConfigEntry<float> shootingSpeedMultiplier;
|
||||
public static ConfigEntry<float> muzzleVelocityMultiplier;
|
||||
public static ConfigEntry<bool> allProjectilesHoming;
|
||||
public static ConfigEntry<float> magnetStrenghtMultiplier;
|
||||
public static ConfigEntry<float> magnetRadiusMultiplier;
|
||||
public static ConfigEntry<float> beamStrenghtMultiplier;
|
||||
public static ConfigEntry<float> beamRadiusMultiplier;
|
||||
public static ConfigEntry<float> fuelTankRefillMultiplier;
|
||||
public static ConfigEntry<float> fuelTankCapacityMultiplier;
|
||||
public static ConfigEntry<float> minerGroundArea;
|
||||
public static ConfigEntry<float> minerMiningSpeed;
|
||||
public static ConfigEntry<float> wheelTorqueMultiplier;
|
||||
public static ConfigEntry<float> wheelSpeedMultiplier;
|
||||
public static ConfigEntry<float> jetThrustMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileVisionConeAngleMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileVisionRangeMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileTurningSpeedMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingRadiusMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingPowerPerArcMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingArcFiringIntervalMultiplier;
|
||||
|
||||
public void Awake() {
|
||||
xpMultiplier = Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f,
|
||||
new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f,
|
||||
new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f)));
|
||||
heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f,
|
||||
new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f)));
|
||||
|
||||
shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f,
|
||||
new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f)));
|
||||
muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f,
|
||||
new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
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)));
|
||||
seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f,
|
||||
new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f,
|
||||
new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
|
||||
magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f,
|
||||
new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f,
|
||||
new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f,
|
||||
new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f,
|
||||
new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
|
||||
wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f,
|
||||
new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f,
|
||||
new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f)));
|
||||
wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f,
|
||||
new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
|
||||
fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f,
|
||||
new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f,
|
||||
new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f,
|
||||
new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f,
|
||||
new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f,
|
||||
new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
|
||||
minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f,
|
||||
new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f)));
|
||||
minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f,
|
||||
new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f)));
|
||||
|
||||
allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false);
|
||||
|
||||
shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch();
|
||||
energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch();
|
||||
magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch();
|
||||
minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
|
||||
Logger.LogInfo("Cyka mod loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
Harmony harmony = new Harmony(pluginGuid);
|
||||
harmony.PatchAll();
|
||||
var originalMethods = harmony.GetPatchedMethods();
|
||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,55 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class FuelPropertiesManager {
|
||||
private static Dictionary<ModuleFuelTank, float> refillRate = new Dictionary<ModuleFuelTank, float>();
|
||||
private static Dictionary<ModuleFuelTank, float> capacity = new Dictionary<ModuleFuelTank, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleFuelTank), "OnAttached")]
|
||||
static void PostfixCreate(ModuleFuelTank __instance) {
|
||||
// Console.WriteLine("ModuleFuelTank.OnAttached");
|
||||
if (!refillRate.ContainsKey(__instance)) {
|
||||
refillRate.Add(__instance, __instance.m_RefillRate);
|
||||
capacity.Add(__instance, __instance.m_Capacity);
|
||||
// Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleFuelTank), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleFuelTank __instance) {
|
||||
// Console.WriteLine("ModuleFuelTank.OnAttached");
|
||||
// Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
refillRate.Remove(__instance);
|
||||
capacity.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleFuelTank", refillRate.Count);
|
||||
foreach (KeyValuePair<ModuleFuelTank, float> keyValuePair in refillRate) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleFuelTank moduleFuelTank) {
|
||||
moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank] * Main.fuelTankRefillMultiplier.Value;
|
||||
moduleFuelTank.m_Capacity = capacity[moduleFuelTank] * Main.fuelTankCapacityMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleFuelTank moduleFuelTank) {
|
||||
if (refillRate.ContainsKey(moduleFuelTank)) {
|
||||
moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank];
|
||||
moduleFuelTank.m_Capacity = capacity[moduleFuelTank];
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class FuelPropertiesManager {
|
||||
private static Dictionary<ModuleFuelTank, float> refillRate = new Dictionary<ModuleFuelTank, float>();
|
||||
private static Dictionary<ModuleFuelTank, float> capacity = new Dictionary<ModuleFuelTank, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleFuelTank), "OnAttached")]
|
||||
static void PostfixCreate(ModuleFuelTank __instance) {
|
||||
// Console.WriteLine("ModuleFuelTank.OnAttached");
|
||||
if (!refillRate.ContainsKey(__instance)) {
|
||||
refillRate.Add(__instance, __instance.m_RefillRate);
|
||||
capacity.Add(__instance, __instance.m_Capacity);
|
||||
// Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleFuelTank), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleFuelTank __instance) {
|
||||
// Console.WriteLine("ModuleFuelTank.OnAttached");
|
||||
// Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
refillRate.Remove(__instance);
|
||||
capacity.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleFuelTank", refillRate.Count);
|
||||
foreach (KeyValuePair<ModuleFuelTank, float> keyValuePair in refillRate) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleFuelTank moduleFuelTank) {
|
||||
moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank] * Main.fuelTankRefillMultiplier.Value;
|
||||
moduleFuelTank.m_Capacity = capacity[moduleFuelTank] * Main.fuelTankCapacityMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleFuelTank moduleFuelTank) {
|
||||
if (refillRate.ContainsKey(moduleFuelTank)) {
|
||||
moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank];
|
||||
moduleFuelTank.m_Capacity = capacity[moduleFuelTank];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,58 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class GeneratorPropertiesManager {
|
||||
private static Dictionary<ModuleEnergy, float> generators = new Dictionary<ModuleEnergy, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleEnergy), "OnAttached")]
|
||||
static void PostfixCreate(ModuleEnergy __instance) {
|
||||
// Console.WriteLine("ModuleEnergy.OnAttached");
|
||||
if (!generators.ContainsKey(__instance)) {
|
||||
generators.Add(__instance, GetValue(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleEnergy), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleEnergy __instance) {
|
||||
// Console.WriteLine("ModuleEnergy.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
generators.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleEnergy", generators.Count);
|
||||
foreach (KeyValuePair<ModuleEnergy, float> keyValuePair in generators) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleEnergy moduleEnergy) {
|
||||
SetValue(moduleEnergy, generators[moduleEnergy] * Main.energyGenMultiplier.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleEnergy moduleEnergy) {
|
||||
if (generators.ContainsKey(moduleEnergy)) {
|
||||
SetValue(moduleEnergy, generators[moduleEnergy]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetValue(ModuleEnergy moduleEnergy) {
|
||||
return Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetValue(ModuleEnergy moduleEnergy, float value) {
|
||||
Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").SetValue(value);
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class GeneratorPropertiesManager {
|
||||
private static Dictionary<ModuleEnergy, float> generators = new Dictionary<ModuleEnergy, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleEnergy), "OnAttached")]
|
||||
static void PostfixCreate(ModuleEnergy __instance) {
|
||||
// Console.WriteLine("ModuleEnergy.OnAttached");
|
||||
if (!generators.ContainsKey(__instance)) {
|
||||
generators.Add(__instance, GetValue(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleEnergy), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleEnergy __instance) {
|
||||
// Console.WriteLine("ModuleEnergy.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
generators.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleEnergy", generators.Count);
|
||||
foreach (KeyValuePair<ModuleEnergy, float> keyValuePair in generators) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleEnergy moduleEnergy) {
|
||||
SetValue(moduleEnergy, generators[moduleEnergy] * Main.energyGenMultiplier.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleEnergy moduleEnergy) {
|
||||
if (generators.ContainsKey(moduleEnergy)) {
|
||||
SetValue(moduleEnergy, generators[moduleEnergy]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetValue(ModuleEnergy moduleEnergy) {
|
||||
return Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetValue(ModuleEnergy moduleEnergy, float value) {
|
||||
Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,22 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch(typeof(Projectile), "Fire")]
|
||||
public class HomingAndVelocityProjectilePatch {
|
||||
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) {
|
||||
if (Main.allProjectilesHoming.Value) {
|
||||
seekingRounds = true;
|
||||
}
|
||||
if (!velocities.ContainsKey(fireData)) {
|
||||
velocities.Add(fireData, fireData.m_MuzzleVelocity);
|
||||
fireData.m_MuzzleVelocity *= Main.muzzleVelocityMultiplier.Value;
|
||||
} else if (velocities[fireData] != fireData.m_MuzzleVelocity * Main.muzzleVelocityMultiplier.Value) {
|
||||
fireData.m_MuzzleVelocity = velocities[fireData] * Main.muzzleVelocityMultiplier.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch(typeof(Projectile), "Fire")]
|
||||
public class HomingAndVelocityProjectilePatch {
|
||||
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) {
|
||||
if (Main.allProjectilesHoming.Value) {
|
||||
seekingRounds = true;
|
||||
}
|
||||
if (!velocities.ContainsKey(fireData)) {
|
||||
velocities.Add(fireData, fireData.m_MuzzleVelocity);
|
||||
fireData.m_MuzzleVelocity *= Main.muzzleVelocityMultiplier.Value;
|
||||
} else if (velocities[fireData] != fireData.m_MuzzleVelocity * Main.muzzleVelocityMultiplier.Value) {
|
||||
fireData.m_MuzzleVelocity = velocities[fireData] * Main.muzzleVelocityMultiplier.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,78 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>TerraTech</RootNamespace>
|
||||
<AssemblyName>TerraTech</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BeamPropertiesManager.cs" />
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="FuelPropertiesManager.cs" />
|
||||
<Compile Include="GeneratorPropertiesManager.cs" />
|
||||
<Compile Include="HomingAndVelocityProjectilePatch.cs" />
|
||||
<Compile Include="MagnetPropertiesManager.cs" />
|
||||
<Compile Include="MinerPropertiesManager.cs" />
|
||||
<Compile Include="Patches.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SeekingProjectileManager.cs" />
|
||||
<Compile Include="ThrusterPropertiesManager.cs" />
|
||||
<Compile Include="WeaponPropertiesManager.cs" />
|
||||
<Compile Include="WheelPropertiesManager.cs" />
|
||||
<Compile Include="WirelessChargerPropertiesManager.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>..\libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>..\libs\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>..\libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>..\libs\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>TerraTech</RootNamespace>
|
||||
<AssemblyName>TerraTech</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BeamPropertiesManager.cs" />
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="FuelPropertiesManager.cs" />
|
||||
<Compile Include="GeneratorPropertiesManager.cs" />
|
||||
<Compile Include="HomingAndVelocityProjectilePatch.cs" />
|
||||
<Compile Include="MagnetPropertiesManager.cs" />
|
||||
<Compile Include="MinerPropertiesManager.cs" />
|
||||
<Compile Include="Patches.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SeekingProjectileManager.cs" />
|
||||
<Compile Include="ThrusterPropertiesManager.cs" />
|
||||
<Compile Include="WeaponPropertiesManager.cs" />
|
||||
<Compile Include="WheelPropertiesManager.cs" />
|
||||
<Compile Include="WirelessChargerPropertiesManager.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>..\libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>..\libs\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>..\libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>..\libs\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
@@ -1,81 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class MagnetPropertiesManager {
|
||||
private static Dictionary<ModuleItemHolderMagnet, float> strenghts = new Dictionary<ModuleItemHolderMagnet, float>();
|
||||
private static Dictionary<ModuleItemHolderMagnet, float> radii = new Dictionary<ModuleItemHolderMagnet, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnAttached")]
|
||||
static void PostfixCreate(ModuleItemHolderMagnet __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderMagnet.OnAttached");
|
||||
if (!strenghts.ContainsKey(__instance)) {
|
||||
strenghts.Add(__instance, GetStrength(__instance));
|
||||
radii.Add(__instance, GetRadius(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleItemHolderMagnet __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderMagnet.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
strenghts.Remove(__instance);
|
||||
radii.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleItemHolderMagnet", strenghts.Count);
|
||||
foreach (KeyValuePair<ModuleItemHolderMagnet, float> keyValuePair in strenghts) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet] * Main.magnetStrenghtMultiplier.Value);
|
||||
SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet] * Main.magnetRadiusMultiplier.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
if (strenghts.ContainsKey(moduleItemHolderMagnet)) {
|
||||
SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet]);
|
||||
}
|
||||
if (radii.ContainsKey(moduleItemHolderMagnet)) {
|
||||
SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
return Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) {
|
||||
Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f;
|
||||
return radius;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
private static void SetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class MagnetPropertiesManager {
|
||||
private static Dictionary<ModuleItemHolderMagnet, float> strenghts = new Dictionary<ModuleItemHolderMagnet, float>();
|
||||
private static Dictionary<ModuleItemHolderMagnet, float> radii = new Dictionary<ModuleItemHolderMagnet, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnAttached")]
|
||||
static void PostfixCreate(ModuleItemHolderMagnet __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderMagnet.OnAttached");
|
||||
if (!strenghts.ContainsKey(__instance)) {
|
||||
strenghts.Add(__instance, GetStrength(__instance));
|
||||
radii.Add(__instance, GetRadius(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleItemHolderMagnet __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderMagnet.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
strenghts.Remove(__instance);
|
||||
radii.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleItemHolderMagnet", strenghts.Count);
|
||||
foreach (KeyValuePair<ModuleItemHolderMagnet, float> keyValuePair in strenghts) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet] * Main.magnetStrenghtMultiplier.Value);
|
||||
SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet] * Main.magnetRadiusMultiplier.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
if (strenghts.ContainsKey(moduleItemHolderMagnet)) {
|
||||
SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet]);
|
||||
}
|
||||
if (radii.ContainsKey(moduleItemHolderMagnet)) {
|
||||
SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
return Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) {
|
||||
Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f;
|
||||
return radius;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
private static void SetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,86 +1,86 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class MinerPropertiesManager {
|
||||
private static Dictionary<ModuleItemProducer, float> area = new Dictionary<ModuleItemProducer, float>();
|
||||
private static Dictionary<ModuleItemProducer, float> speed = new Dictionary<ModuleItemProducer, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemProducer), "GetClosestResourceReservoirInRange")]
|
||||
static void PostfixCreate(ModuleItemProducer __instance) {
|
||||
// Console.WriteLine("ModuleItemProducer.GetClosestResourceReservoirInRange");
|
||||
if (!area.ContainsKey(__instance)) {
|
||||
area.Add(__instance, GetArea(__instance));
|
||||
speed.Add(__instance, GetSpeed(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
} else {
|
||||
if (GetArea(__instance) == area[__instance]) {
|
||||
// Console.WriteLine("{0} area reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name,
|
||||
// GetArea(__instance), GetSpeed(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
}
|
||||
if (GetSpeed(__instance) == speed[__instance]) {
|
||||
// Console.WriteLine("{0} speed reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name,
|
||||
// GetArea(__instance), GetSpeed(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(ModuleItemProducer), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleItemProducer __instance) {
|
||||
// Console.WriteLine("ModuleItemProducer.OnRecycle");
|
||||
DoRestoreSingle(__instance);
|
||||
area.Remove(__instance);
|
||||
speed.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleItemProducer", area.Count);
|
||||
foreach (KeyValuePair<ModuleItemProducer, float> keyValuePair in area) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleItemProducer moduleItemProducer) {
|
||||
SetArea(moduleItemProducer, area[moduleItemProducer] * Main.minerGroundArea.Value);
|
||||
SetSpeed(moduleItemProducer, speed[moduleItemProducer] / Main.minerMiningSpeed.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleItemProducer moduleItemProducer) {
|
||||
if (area.ContainsKey(moduleItemProducer)) {
|
||||
SetArea(moduleItemProducer, area[moduleItemProducer]);
|
||||
SetSpeed(moduleItemProducer, speed[moduleItemProducer]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetArea(ModuleItemProducer moduleItemProducer) {
|
||||
return Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetArea(ModuleItemProducer moduleItemProducer, float value) {
|
||||
Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetSpeed(ModuleItemProducer moduleItemProducer) {
|
||||
return Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetSpeed(ModuleItemProducer moduleItemProducer, float value) {
|
||||
Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").SetValue(value);
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class MinerPropertiesManager {
|
||||
private static Dictionary<ModuleItemProducer, float> area = new Dictionary<ModuleItemProducer, float>();
|
||||
private static Dictionary<ModuleItemProducer, float> speed = new Dictionary<ModuleItemProducer, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemProducer), "GetClosestResourceReservoirInRange")]
|
||||
static void PostfixCreate(ModuleItemProducer __instance) {
|
||||
// Console.WriteLine("ModuleItemProducer.GetClosestResourceReservoirInRange");
|
||||
if (!area.ContainsKey(__instance)) {
|
||||
area.Add(__instance, GetArea(__instance));
|
||||
speed.Add(__instance, GetSpeed(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
} else {
|
||||
if (GetArea(__instance) == area[__instance]) {
|
||||
// Console.WriteLine("{0} area reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name,
|
||||
// GetArea(__instance), GetSpeed(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
}
|
||||
if (GetSpeed(__instance) == speed[__instance]) {
|
||||
// Console.WriteLine("{0} speed reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name,
|
||||
// GetArea(__instance), GetSpeed(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(ModuleItemProducer), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleItemProducer __instance) {
|
||||
// Console.WriteLine("ModuleItemProducer.OnRecycle");
|
||||
DoRestoreSingle(__instance);
|
||||
area.Remove(__instance);
|
||||
speed.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleItemProducer", area.Count);
|
||||
foreach (KeyValuePair<ModuleItemProducer, float> keyValuePair in area) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleItemProducer moduleItemProducer) {
|
||||
SetArea(moduleItemProducer, area[moduleItemProducer] * Main.minerGroundArea.Value);
|
||||
SetSpeed(moduleItemProducer, speed[moduleItemProducer] / Main.minerMiningSpeed.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleItemProducer moduleItemProducer) {
|
||||
if (area.ContainsKey(moduleItemProducer)) {
|
||||
SetArea(moduleItemProducer, area[moduleItemProducer]);
|
||||
SetSpeed(moduleItemProducer, speed[moduleItemProducer]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetArea(ModuleItemProducer moduleItemProducer) {
|
||||
return Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetArea(ModuleItemProducer moduleItemProducer, float value) {
|
||||
Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetSpeed(ModuleItemProducer moduleItemProducer) {
|
||||
return Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetSpeed(ModuleItemProducer moduleItemProducer, float value) {
|
||||
Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,24 +1,24 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class Patches {
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ManLicenses), "AddXP")]
|
||||
static void XPMulti(FactionSubTypes corporation, ref int xp, bool showUI = true) {
|
||||
xp = (int)(xp * Main.xpMultiplier.Value);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ManPlayer), "AddMoney")]
|
||||
static void MoneyMulti(ref int amount) {
|
||||
amount = (int)(amount * Main.moneyMultiplier.Value);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TechHolders), "SetHeartbeatInterval")]
|
||||
static void HeartbeatMulti(ref float interval) {
|
||||
interval *= Main.heartbeatIntervalMultiplier.Value;
|
||||
}
|
||||
}
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class Patches {
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ManLicenses), "AddXP")]
|
||||
static void XPMulti(FactionSubTypes corporation, ref int xp, bool showUI = true) {
|
||||
xp = (int)(xp * Main.xpMultiplier.Value);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ManPlayer), "AddMoney")]
|
||||
static void MoneyMulti(ref int amount) {
|
||||
amount = (int)(amount * Main.moneyMultiplier.Value);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TechHolders), "SetHeartbeatInterval")]
|
||||
static void HeartbeatMulti(ref float interval) {
|
||||
interval *= Main.heartbeatIntervalMultiplier.Value;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,35 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("TerraTech")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("TerraTech")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("TerraTech")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("TerraTech")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
@@ -1,24 +1,24 @@
|
||||
using System;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
public class SeekingProjectileManager {
|
||||
[HarmonyPatch(typeof(SeekingProjectile), "OnSpawn")]
|
||||
class Patch {
|
||||
static void Postfix(SeekingProjectile __instance) {
|
||||
Console.WriteLine("SeekingProjectile created");
|
||||
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_TurnSpeed", Main.seekingProjectileTurningSpeedMultiplier.Value * GetField(__instance, "m_TurnSpeed"));
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetField(SeekingProjectile seekingProjectile, string field) {
|
||||
return Traverse.Create(seekingProjectile).Field(field).GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetField(SeekingProjectile seekingProjectile, string field, float value) {
|
||||
Traverse.Create(seekingProjectile).Field(field).SetValue(value);
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
public class SeekingProjectileManager {
|
||||
[HarmonyPatch(typeof(SeekingProjectile), "OnSpawn")]
|
||||
class Patch {
|
||||
static void Postfix(SeekingProjectile __instance) {
|
||||
Console.WriteLine("SeekingProjectile created");
|
||||
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_TurnSpeed", Main.seekingProjectileTurningSpeedMultiplier.Value * GetField(__instance, "m_TurnSpeed"));
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetField(SeekingProjectile seekingProjectile, string field) {
|
||||
return Traverse.Create(seekingProjectile).Field(field).GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetField(SeekingProjectile seekingProjectile, string field, float value) {
|
||||
Traverse.Create(seekingProjectile).Field(field).SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,89 +1,89 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class ThrusterPropertiesManager {
|
||||
private static Dictionary<ModuleBooster, Dictionary<BoosterJet, float>> boosters = new Dictionary<ModuleBooster, Dictionary<BoosterJet, float>>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleBooster), "OnAttached")]
|
||||
static void PostfixCreate(ModuleBooster __instance) {
|
||||
// Console.WriteLine("ModuleBooster.OnAttached");
|
||||
if (!boosters.ContainsKey(__instance)) {
|
||||
boosters.Add(__instance, Map(__instance));
|
||||
// Console.WriteLine("Patching {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleBooster), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleBooster __instance) {
|
||||
// Console.WriteLine("ModuleBooster.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
boosters.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleBooster", boosters.Count);
|
||||
foreach (KeyValuePair<ModuleBooster, Dictionary<BoosterJet, float>> keyValuePair in boosters) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleBooster moduleBooster) {
|
||||
List<BoosterJet> jets = GetValue(moduleBooster);
|
||||
for (var i = 0; i < jets.Count; i++) {
|
||||
boosters[moduleBooster][jets[i]] = GetValue(jets[i]);
|
||||
SetValue(jets[i], GetValue(jets[i]) * Main.jetThrustMultiplier.Value);
|
||||
}
|
||||
SetValue(moduleBooster, jets);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleBooster moduleBooster) {
|
||||
if (boosters.ContainsKey(moduleBooster)) {
|
||||
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
|
||||
SetValue(boosterJet, boosters[moduleBooster][boosterJet]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Dictionary<BoosterJet, float> Map(ModuleBooster moduleBooster) {
|
||||
Dictionary<BoosterJet, float> jets = new Dictionary<BoosterJet, float>();
|
||||
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
|
||||
jets.Add(boosterJet, GetValue(boosterJet));
|
||||
}
|
||||
return jets;
|
||||
}
|
||||
|
||||
private static List<BoosterJet> GetValue(ModuleBooster moduleBooster) {
|
||||
return Traverse.Create(moduleBooster).Field("jets").GetValue() as List<BoosterJet>;
|
||||
}
|
||||
|
||||
private static void SetValue(ModuleBooster moduleBooster, List<BoosterJet> value) {
|
||||
Traverse.Create(moduleBooster).Field("jets").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetValue(BoosterJet boosterJet) {
|
||||
return Traverse.Create(boosterJet).Field("m_Force").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetValue(BoosterJet boosterJet, float value) {
|
||||
Traverse.Create(boosterJet).Field("m_Force").SetValue(value);
|
||||
}
|
||||
|
||||
private static string GetForceAsString(ModuleBooster moduleBooster) {
|
||||
string result = "";
|
||||
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
|
||||
result += GetValue(boosterJet) + ", ";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class ThrusterPropertiesManager {
|
||||
private static Dictionary<ModuleBooster, Dictionary<BoosterJet, float>> boosters = new Dictionary<ModuleBooster, Dictionary<BoosterJet, float>>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleBooster), "OnAttached")]
|
||||
static void PostfixCreate(ModuleBooster __instance) {
|
||||
// Console.WriteLine("ModuleBooster.OnAttached");
|
||||
if (!boosters.ContainsKey(__instance)) {
|
||||
boosters.Add(__instance, Map(__instance));
|
||||
// Console.WriteLine("Patching {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleBooster), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleBooster __instance) {
|
||||
// Console.WriteLine("ModuleBooster.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
boosters.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleBooster", boosters.Count);
|
||||
foreach (KeyValuePair<ModuleBooster, Dictionary<BoosterJet, float>> keyValuePair in boosters) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleBooster moduleBooster) {
|
||||
List<BoosterJet> jets = GetValue(moduleBooster);
|
||||
for (var i = 0; i < jets.Count; i++) {
|
||||
boosters[moduleBooster][jets[i]] = GetValue(jets[i]);
|
||||
SetValue(jets[i], GetValue(jets[i]) * Main.jetThrustMultiplier.Value);
|
||||
}
|
||||
SetValue(moduleBooster, jets);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleBooster moduleBooster) {
|
||||
if (boosters.ContainsKey(moduleBooster)) {
|
||||
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
|
||||
SetValue(boosterJet, boosters[moduleBooster][boosterJet]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Dictionary<BoosterJet, float> Map(ModuleBooster moduleBooster) {
|
||||
Dictionary<BoosterJet, float> jets = new Dictionary<BoosterJet, float>();
|
||||
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
|
||||
jets.Add(boosterJet, GetValue(boosterJet));
|
||||
}
|
||||
return jets;
|
||||
}
|
||||
|
||||
private static List<BoosterJet> GetValue(ModuleBooster moduleBooster) {
|
||||
return Traverse.Create(moduleBooster).Field("jets").GetValue() as List<BoosterJet>;
|
||||
}
|
||||
|
||||
private static void SetValue(ModuleBooster moduleBooster, List<BoosterJet> value) {
|
||||
Traverse.Create(moduleBooster).Field("jets").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetValue(BoosterJet boosterJet) {
|
||||
return Traverse.Create(boosterJet).Field("m_Force").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetValue(BoosterJet boosterJet, float value) {
|
||||
Traverse.Create(boosterJet).Field("m_Force").SetValue(value);
|
||||
}
|
||||
|
||||
private static string GetForceAsString(ModuleBooster moduleBooster) {
|
||||
string result = "";
|
||||
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
|
||||
result += GetValue(boosterJet) + ", ";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,51 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class WeaponPropertiesManager {
|
||||
private static Dictionary<ModuleWeaponGun, float> shotCooldown = new Dictionary<ModuleWeaponGun, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWeaponGun), "OnAttached")]
|
||||
static void PostfixCreate(ModuleWeaponGun __instance) {
|
||||
// Console.WriteLine("ModuleWeaponGun.OnAttached");
|
||||
if (!shotCooldown.ContainsKey(__instance)) {
|
||||
shotCooldown.Add(__instance, __instance.m_ShotCooldown);
|
||||
// Console.WriteLine("Patching {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWeaponGun), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleWeaponGun __instance) {
|
||||
// Console.WriteLine("ModuleWeaponGun.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
shotCooldown.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleWeaponGun", shotCooldown.Count);
|
||||
foreach (KeyValuePair<ModuleWeaponGun, float> keyValuePair in shotCooldown) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleWeaponGun moduleWeaponGun) {
|
||||
moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun] / Main.shootingSpeedMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleWeaponGun moduleWeaponGun) {
|
||||
if (shotCooldown.ContainsKey(moduleWeaponGun)) {
|
||||
moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun];
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class WeaponPropertiesManager {
|
||||
private static Dictionary<ModuleWeaponGun, float> shotCooldown = new Dictionary<ModuleWeaponGun, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWeaponGun), "OnAttached")]
|
||||
static void PostfixCreate(ModuleWeaponGun __instance) {
|
||||
// Console.WriteLine("ModuleWeaponGun.OnAttached");
|
||||
if (!shotCooldown.ContainsKey(__instance)) {
|
||||
shotCooldown.Add(__instance, __instance.m_ShotCooldown);
|
||||
// Console.WriteLine("Patching {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWeaponGun), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleWeaponGun __instance) {
|
||||
// Console.WriteLine("ModuleWeaponGun.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
shotCooldown.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleWeaponGun", shotCooldown.Count);
|
||||
foreach (KeyValuePair<ModuleWeaponGun, float> keyValuePair in shotCooldown) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleWeaponGun moduleWeaponGun) {
|
||||
moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun] / Main.shootingSpeedMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleWeaponGun moduleWeaponGun) {
|
||||
if (shotCooldown.ContainsKey(moduleWeaponGun)) {
|
||||
moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,63 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class WheelPropertiesManager {
|
||||
private static Dictionary<ModuleWheels, float> torques = new Dictionary<ModuleWheels, float>();
|
||||
private static Dictionary<ModuleWheels, float> maxRpm = new Dictionary<ModuleWheels, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWheels), "OnAttached")]
|
||||
static void PostfixCreate(ModuleWheels __instance) {
|
||||
// Console.WriteLine("ModuleWheels.OnAttached");
|
||||
if (!torques.ContainsKey(__instance)) {
|
||||
torques.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxTorque);
|
||||
maxRpm.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
// Console.WriteLine("Patching {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWheels), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleWheels __instance) {
|
||||
// Console.WriteLine("ModuleWheels.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
torques.Remove(__instance);
|
||||
maxRpm.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleWheels", torques.Count);
|
||||
foreach (KeyValuePair<ModuleWheels, float> keyValuePair in torques) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleWheels moduleWheels) {
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels] * Main.wheelSpeedMultiplier.Value;
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels] * Main.wheelTorqueMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleWheels moduleWheels) {
|
||||
if (torques.ContainsKey(moduleWheels)) {
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels];
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels];
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class WheelPropertiesManager {
|
||||
private static Dictionary<ModuleWheels, float> torques = new Dictionary<ModuleWheels, float>();
|
||||
private static Dictionary<ModuleWheels, float> maxRpm = new Dictionary<ModuleWheels, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWheels), "OnAttached")]
|
||||
static void PostfixCreate(ModuleWheels __instance) {
|
||||
// Console.WriteLine("ModuleWheels.OnAttached");
|
||||
if (!torques.ContainsKey(__instance)) {
|
||||
torques.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxTorque);
|
||||
maxRpm.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
// Console.WriteLine("Patching {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWheels), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleWheels __instance) {
|
||||
// Console.WriteLine("ModuleWheels.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
torques.Remove(__instance);
|
||||
maxRpm.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleWheels", torques.Count);
|
||||
foreach (KeyValuePair<ModuleWheels, float> keyValuePair in torques) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleWheels moduleWheels) {
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels] * Main.wheelSpeedMultiplier.Value;
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels] * Main.wheelTorqueMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleWheels moduleWheels) {
|
||||
if (torques.ContainsKey(moduleWheels)) {
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels];
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,60 +1,60 @@
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
// TODO: Fix this, no workey
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class WirelessChargerPropertiesManager {
|
||||
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> arcFiringInterval = new Dictionary<ModuleRemoteCharger, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleRemoteCharger), "OnAttached")]
|
||||
static void PostfixCreate(ModuleRemoteCharger __instance) {
|
||||
// Console.WriteLine("ModuleRemoteCharger.OnAttached");
|
||||
if (!radius.ContainsKey(__instance)) {
|
||||
radius.Add(__instance, __instance.m_ChargingRadius);
|
||||
transferPerArc.Add(__instance, __instance.m_PowerTransferPerArc);
|
||||
arcFiringInterval.Add(__instance, __instance.m_ArcFiringInterval);
|
||||
// Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleRemoteCharger), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleRemoteCharger __instance) {
|
||||
// Console.WriteLine("ModuleRemoteCharger.OnAttached");
|
||||
// Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
radius.Remove(__instance);
|
||||
transferPerArc.Remove(__instance);
|
||||
arcFiringInterval.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleRemoteCharger", radius.Count);
|
||||
foreach (KeyValuePair<ModuleRemoteCharger, float> keyValuePair in radius) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleRemoteCharger moduleRemoteCharger) {
|
||||
moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger] * Main.wirelessChargingRadiusMultiplier.Value;
|
||||
moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger] * Main.wirelessChargingPowerPerArcMultiplier.Value;
|
||||
moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger] * Main.wirelessChargingArcFiringIntervalMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleRemoteCharger moduleRemoteCharger) {
|
||||
if (radius.ContainsKey(moduleRemoteCharger)) {
|
||||
moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger];
|
||||
moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger];
|
||||
moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger];
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
// TODO: Fix this, no workey
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class WirelessChargerPropertiesManager {
|
||||
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> arcFiringInterval = new Dictionary<ModuleRemoteCharger, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleRemoteCharger), "OnAttached")]
|
||||
static void PostfixCreate(ModuleRemoteCharger __instance) {
|
||||
// Console.WriteLine("ModuleRemoteCharger.OnAttached");
|
||||
if (!radius.ContainsKey(__instance)) {
|
||||
radius.Add(__instance, __instance.m_ChargingRadius);
|
||||
transferPerArc.Add(__instance, __instance.m_PowerTransferPerArc);
|
||||
arcFiringInterval.Add(__instance, __instance.m_ArcFiringInterval);
|
||||
// Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleRemoteCharger), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleRemoteCharger __instance) {
|
||||
// Console.WriteLine("ModuleRemoteCharger.OnAttached");
|
||||
// Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
radius.Remove(__instance);
|
||||
transferPerArc.Remove(__instance);
|
||||
arcFiringInterval.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleRemoteCharger", radius.Count);
|
||||
foreach (KeyValuePair<ModuleRemoteCharger, float> keyValuePair in radius) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleRemoteCharger moduleRemoteCharger) {
|
||||
moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger] * Main.wirelessChargingRadiusMultiplier.Value;
|
||||
moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger] * Main.wirelessChargingPowerPerArcMultiplier.Value;
|
||||
moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger] * Main.wirelessChargingArcFiringIntervalMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleRemoteCharger moduleRemoteCharger) {
|
||||
if (radius.ContainsKey(moduleRemoteCharger)) {
|
||||
moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger];
|
||||
moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger];
|
||||
moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
|
||||
|
Binary file not shown.
@@ -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.pdb
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\0Harmony.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\Assembly-CSharp.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\BepInEx.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\UnityEngine.CoreModule.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\UnityEngine.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.csprojResolveAssemblyReference.cache
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.pdb
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\ConfigurationManager.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\TerraTech.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\TerraTech.pdb
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\0Harmony.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\Assembly-CSharp.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\BepInEx.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\UnityEngine.CoreModule.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\UnityEngine.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.csprojResolveAssemblyReference.cache
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.pdb
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\ConfigurationManager.dll
|
||||
|
@@ -1,16 +1,16 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Regiments", "Regiments\Regiments.csproj", "{DA9D274E-486F-4F82-84FF-CD9388CB0B09}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{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}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Regiments", "Regiments\Regiments.csproj", "{DA9D274E-486F-4F82-84FF-CD9388CB0B09}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{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}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DA9D274E-486F-4F82-84FF-CD9388CB0B09}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@@ -56,7 +56,7 @@ namespace Regiments {
|
||||
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);
|
||||
Console.WriteLine("HQ radius patched to: {0}", __instance.platoon.parameters.HQRadius);
|
||||
}
|
||||
|
@@ -1,35 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Regiments")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Regiments")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("DA9D274E-486F-4F82-84FF-CD9388CB0B09")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Regiments")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Regiments")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("DA9D274E-486F-4F82-84FF-CD9388CB0B09")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
@@ -1,274 +1,274 @@
|
||||
// using System;
|
||||
// using System.Collections.Generic;
|
||||
// using System.Linq;
|
||||
// using System.Reflection.Emit;
|
||||
// using BepInEx;
|
||||
// using BepInEx.Configuration;
|
||||
// using HarmonyLib;
|
||||
// using HarmonyLib.Tools;
|
||||
//
|
||||
// namespace Regiments {
|
||||
// [BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
// public class Main : BaseUnityPlugin {
|
||||
// private const string pluginGuid = "CykaMod";
|
||||
// private const string pluginName = "CykaMod";
|
||||
// private const string pluginVersion = "1.0.0";
|
||||
//
|
||||
// public static ConfigEntry<float> skillCap;
|
||||
// public static ConfigEntry<float> workSpeed;
|
||||
// public static ConfigEntry<float> workResult;
|
||||
// public static ConfigEntry<bool> alwaysCritical;
|
||||
// public static ConfigEntry<float> gameSpeed;
|
||||
// public static ConfigEntry<int> fans;
|
||||
// public static ConfigEntry<long> money;
|
||||
//
|
||||
// //
|
||||
// // private void Awake()
|
||||
// // {
|
||||
// // configGreeting = Config.Bind("General", // The section under which the option is shown
|
||||
// // "GreetingText", // The key of the configuration option in the configuration file
|
||||
// // "Hello, world!", // The default value
|
||||
// // "A greeting text to show when the game is launched"); // Description of the option to show in the config file
|
||||
// //
|
||||
//
|
||||
// public void Awake() {
|
||||
// skillCap = Config.Bind("General", "Skill Cap", 100f);
|
||||
// workSpeed = Config.Bind("General", "Work Speed Multiplier", 4f);
|
||||
// workResult = Config.Bind("General", "Work Result Multiplier", 4f);
|
||||
// alwaysCritical = Config.Bind("General", "Work Always Critical", false);
|
||||
// gameSpeed = Config.Bind("General", "Game Speed Multiplier", 3f);
|
||||
// fans = Config.Bind("General", "Fans Multiplier", 2);
|
||||
// money = Config.Bind("General", "Money Multiplier", 2L);
|
||||
//
|
||||
// Logger.LogInfo("Cyka mod loaded");
|
||||
// HarmonyFileLog.Enabled = true;
|
||||
// Harmony harmony = new Harmony(pluginGuid);
|
||||
// harmony.PatchAll();
|
||||
// var originalMethods = harmony.GetPatchedMethods();
|
||||
// Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
// }
|
||||
//
|
||||
// public static bool IsMatch(List<CodeInstruction> codes, int index, List<CodeInstruction> matcher) {
|
||||
// for (var i = 0; i < matcher.Count; i++) {
|
||||
// if (codes[index + i].opcode != matcher[i].opcode) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// public static void InsertAt(List<CodeInstruction> codes, int index, List<CodeInstruction> toInsert) {
|
||||
// for (var i = 0; i < toInsert.Count; i++) {
|
||||
// codes.Insert(index + i, toInsert[i]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetSkillCap")]
|
||||
// public class SkillCapPatch {
|
||||
// static void Postfix(ref float __result) {
|
||||
// // Console.WriteLine("GetSkillCap Postfix! Result is " + __result);
|
||||
// __result = Main.skillCap.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetSkillCap_Skill")]
|
||||
// public class SkillCapSkillPatch {
|
||||
// static void Postfix(ref float __result) {
|
||||
// // Console.WriteLine("GetSkillCap_Skill Postfix! Result is " + __result);
|
||||
// __result = Main.skillCap.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetWorkSpeed")]
|
||||
// public class GetWorkSpeedPatch {
|
||||
// static void Postfix(ref float __result) {
|
||||
// // Console.WriteLine("GetWorkSpeed Postfix! Result is " + __result);
|
||||
// __result *= Main.workSpeed.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetWorkResult")]
|
||||
// public class GetWorkResultPatch {
|
||||
// static void Prefix(ref float f) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// f *= Main.workResult.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetCritic")]
|
||||
// public class GetCriticPatch {
|
||||
// static void Postfix(ref bool __result) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// if (Main.alwaysCritical.Value) {
|
||||
// __result = true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "SetGameSpeed")]
|
||||
// public class GameSpeedPatch {
|
||||
// static void Prefix(ref float f) {
|
||||
// // Console.WriteLine("SetGameSpeed Prefix! Argument is " + f);
|
||||
// if (f > 1) {
|
||||
// f *= Main.gameSpeed.Value;
|
||||
// // Console.WriteLine("Argument modified to " + f);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "Learn")]
|
||||
// public static class LearnManyPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// for (var i = 0; i < 5; i++) {
|
||||
// if (codes[i].opcode == OpCodes.Ldc_R4) {
|
||||
// Console.WriteLine("Changing " + codes[i]);
|
||||
// codes[i].operand = (float)codes[i].operand * 64;
|
||||
// Console.WriteLine("Changed " + codes[i]);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(arbeitsmarkt), "ArbeitsmarktUpdaten")]
|
||||
// public static class ManyEmployeesPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// for (var i = codes.Count - 1; i > 0; i--) {
|
||||
// if (codes[i].opcode == OpCodes.Ldc_I4_3) {
|
||||
// Console.WriteLine("Changing " + codes[i]);
|
||||
// codes[i] = new CodeInstruction(OpCodes.Ldc_I4, 64);
|
||||
// Console.WriteLine("Changed " + codes[i]);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // [HarmonyPatch(typeof(AILerp), "MovementUpdate")]
|
||||
// public class MovementSpeedPatch {
|
||||
// static void Prefix(ref float deltaTime) {
|
||||
// Console.WriteLine("MovementUpdate Prefix! deltaTime is " + deltaTime);
|
||||
// deltaTime *= 16f;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // [HarmonyPatch(typeof(movementScript), "Move")]
|
||||
// public static class EmployeeMovementSpeedPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// List<CodeInstruction> matcher = new List<CodeInstruction>();
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Mul, null));
|
||||
//
|
||||
// List<CodeInstruction> patch = new List<CodeInstruction>();
|
||||
// patch.Add(new CodeInstruction(OpCodes.Ldc_R4, 8));
|
||||
// patch.Add(new CodeInstruction(OpCodes.Mul, null));
|
||||
//
|
||||
// for (var i = codes.Count - 1; i > 0; i--) {
|
||||
// if (Main.IsMatch(codes, i, matcher)) {
|
||||
// Main.InsertAt(codes, i + 5, patch);
|
||||
// Console.WriteLine("Movement speed patched");
|
||||
// for (var j = 0; j < 15; j++) {
|
||||
// Console.WriteLine(codes[i + j]);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// Console.WriteLine("Return");
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "WochenUpdates")]
|
||||
// public static class ContractWorkAmount {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
// int methodIndex = -1;
|
||||
// List<CodeInstruction> pattern = new List<CodeInstruction>();
|
||||
//
|
||||
// List<CodeInstruction> matcher = new List<CodeInstruction>();
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldc_I4_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Callvirt, null));
|
||||
//
|
||||
// for (var i = 0; i < codes.Count; i++) {
|
||||
// if (codes[i].operand != null) {
|
||||
// if (codes[i].operand.ToString().Contains("UpdateContractWork")) {
|
||||
// methodIndex = i;
|
||||
// pattern.Add(codes[i - 3]);
|
||||
// pattern.Add(codes[i - 2]);
|
||||
// pattern.Add(codes[i - 1]);
|
||||
// pattern.Add(codes[i]);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// pattern[2].opcode = OpCodes.Ldc_I4_1;
|
||||
//
|
||||
// for (int i = 0; i < 16; i++) {
|
||||
// for (int j = 0; j < pattern.Count; j++) {
|
||||
// codes.Insert(methodIndex + i + j, pattern[j]);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(platformScript), "SellPlayer")]
|
||||
// public static class ConsoleProductionReductionPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// 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.Ldc_R4, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Call, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Add, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Stfld, null));
|
||||
//
|
||||
// for (var i = 0; i < codes.Count; i++) {
|
||||
// if (Main.IsMatch(codes, i, matcher)) {
|
||||
// codes[i + 3].operand = (float)codes[i + 3].operand * 8f;
|
||||
// codes[i + 4].operand = (float)codes[i + 4].operand * 8f;
|
||||
// Console.WriteLine("ConsoleProductionReductionPatch patched");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "AddFans")]
|
||||
// public static class AddFansPatch {
|
||||
// static void Prefix(ref int i) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// i *= Main.fans.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "Earn")]
|
||||
// public static class AddMoneyPatch {
|
||||
// static void Prefix(ref long amount) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// amount *= Main.money.Value;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// using System;
|
||||
// using System.Collections.Generic;
|
||||
// using System.Linq;
|
||||
// using System.Reflection.Emit;
|
||||
// using BepInEx;
|
||||
// using BepInEx.Configuration;
|
||||
// using HarmonyLib;
|
||||
// using HarmonyLib.Tools;
|
||||
//
|
||||
// namespace Regiments {
|
||||
// [BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
// public class Main : BaseUnityPlugin {
|
||||
// private const string pluginGuid = "CykaMod";
|
||||
// private const string pluginName = "CykaMod";
|
||||
// private const string pluginVersion = "1.0.0";
|
||||
//
|
||||
// public static ConfigEntry<float> skillCap;
|
||||
// public static ConfigEntry<float> workSpeed;
|
||||
// public static ConfigEntry<float> workResult;
|
||||
// public static ConfigEntry<bool> alwaysCritical;
|
||||
// public static ConfigEntry<float> gameSpeed;
|
||||
// public static ConfigEntry<int> fans;
|
||||
// public static ConfigEntry<long> money;
|
||||
//
|
||||
// //
|
||||
// // private void Awake()
|
||||
// // {
|
||||
// // configGreeting = Config.Bind("General", // The section under which the option is shown
|
||||
// // "GreetingText", // The key of the configuration option in the configuration file
|
||||
// // "Hello, world!", // The default value
|
||||
// // "A greeting text to show when the game is launched"); // Description of the option to show in the config file
|
||||
// //
|
||||
//
|
||||
// public void Awake() {
|
||||
// skillCap = Config.Bind("General", "Skill Cap", 100f);
|
||||
// workSpeed = Config.Bind("General", "Work Speed Multiplier", 4f);
|
||||
// workResult = Config.Bind("General", "Work Result Multiplier", 4f);
|
||||
// alwaysCritical = Config.Bind("General", "Work Always Critical", false);
|
||||
// gameSpeed = Config.Bind("General", "Game Speed Multiplier", 3f);
|
||||
// fans = Config.Bind("General", "Fans Multiplier", 2);
|
||||
// money = Config.Bind("General", "Money Multiplier", 2L);
|
||||
//
|
||||
// Logger.LogInfo("Cyka mod loaded");
|
||||
// HarmonyFileLog.Enabled = true;
|
||||
// Harmony harmony = new Harmony(pluginGuid);
|
||||
// harmony.PatchAll();
|
||||
// var originalMethods = harmony.GetPatchedMethods();
|
||||
// Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
// }
|
||||
//
|
||||
// public static bool IsMatch(List<CodeInstruction> codes, int index, List<CodeInstruction> matcher) {
|
||||
// for (var i = 0; i < matcher.Count; i++) {
|
||||
// if (codes[index + i].opcode != matcher[i].opcode) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// public static void InsertAt(List<CodeInstruction> codes, int index, List<CodeInstruction> toInsert) {
|
||||
// for (var i = 0; i < toInsert.Count; i++) {
|
||||
// codes.Insert(index + i, toInsert[i]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetSkillCap")]
|
||||
// public class SkillCapPatch {
|
||||
// static void Postfix(ref float __result) {
|
||||
// // Console.WriteLine("GetSkillCap Postfix! Result is " + __result);
|
||||
// __result = Main.skillCap.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetSkillCap_Skill")]
|
||||
// public class SkillCapSkillPatch {
|
||||
// static void Postfix(ref float __result) {
|
||||
// // Console.WriteLine("GetSkillCap_Skill Postfix! Result is " + __result);
|
||||
// __result = Main.skillCap.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetWorkSpeed")]
|
||||
// public class GetWorkSpeedPatch {
|
||||
// static void Postfix(ref float __result) {
|
||||
// // Console.WriteLine("GetWorkSpeed Postfix! Result is " + __result);
|
||||
// __result *= Main.workSpeed.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetWorkResult")]
|
||||
// public class GetWorkResultPatch {
|
||||
// static void Prefix(ref float f) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// f *= Main.workResult.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "GetCritic")]
|
||||
// public class GetCriticPatch {
|
||||
// static void Postfix(ref bool __result) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// if (Main.alwaysCritical.Value) {
|
||||
// __result = true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "SetGameSpeed")]
|
||||
// public class GameSpeedPatch {
|
||||
// static void Prefix(ref float f) {
|
||||
// // Console.WriteLine("SetGameSpeed Prefix! Argument is " + f);
|
||||
// if (f > 1) {
|
||||
// f *= Main.gameSpeed.Value;
|
||||
// // Console.WriteLine("Argument modified to " + f);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(characterScript), "Learn")]
|
||||
// public static class LearnManyPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// for (var i = 0; i < 5; i++) {
|
||||
// if (codes[i].opcode == OpCodes.Ldc_R4) {
|
||||
// Console.WriteLine("Changing " + codes[i]);
|
||||
// codes[i].operand = (float)codes[i].operand * 64;
|
||||
// Console.WriteLine("Changed " + codes[i]);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(arbeitsmarkt), "ArbeitsmarktUpdaten")]
|
||||
// public static class ManyEmployeesPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// for (var i = codes.Count - 1; i > 0; i--) {
|
||||
// if (codes[i].opcode == OpCodes.Ldc_I4_3) {
|
||||
// Console.WriteLine("Changing " + codes[i]);
|
||||
// codes[i] = new CodeInstruction(OpCodes.Ldc_I4, 64);
|
||||
// Console.WriteLine("Changed " + codes[i]);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // [HarmonyPatch(typeof(AILerp), "MovementUpdate")]
|
||||
// public class MovementSpeedPatch {
|
||||
// static void Prefix(ref float deltaTime) {
|
||||
// Console.WriteLine("MovementUpdate Prefix! deltaTime is " + deltaTime);
|
||||
// deltaTime *= 16f;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // [HarmonyPatch(typeof(movementScript), "Move")]
|
||||
// public static class EmployeeMovementSpeedPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// List<CodeInstruction> matcher = new List<CodeInstruction>();
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Mul, null));
|
||||
//
|
||||
// List<CodeInstruction> patch = new List<CodeInstruction>();
|
||||
// patch.Add(new CodeInstruction(OpCodes.Ldc_R4, 8));
|
||||
// patch.Add(new CodeInstruction(OpCodes.Mul, null));
|
||||
//
|
||||
// for (var i = codes.Count - 1; i > 0; i--) {
|
||||
// if (Main.IsMatch(codes, i, matcher)) {
|
||||
// Main.InsertAt(codes, i + 5, patch);
|
||||
// Console.WriteLine("Movement speed patched");
|
||||
// for (var j = 0; j < 15; j++) {
|
||||
// Console.WriteLine(codes[i + j]);
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// Console.WriteLine("Return");
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "WochenUpdates")]
|
||||
// public static class ContractWorkAmount {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
// int methodIndex = -1;
|
||||
// List<CodeInstruction> pattern = new List<CodeInstruction>();
|
||||
//
|
||||
// List<CodeInstruction> matcher = new List<CodeInstruction>();
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldc_I4_0, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Callvirt, null));
|
||||
//
|
||||
// for (var i = 0; i < codes.Count; i++) {
|
||||
// if (codes[i].operand != null) {
|
||||
// if (codes[i].operand.ToString().Contains("UpdateContractWork")) {
|
||||
// methodIndex = i;
|
||||
// pattern.Add(codes[i - 3]);
|
||||
// pattern.Add(codes[i - 2]);
|
||||
// pattern.Add(codes[i - 1]);
|
||||
// pattern.Add(codes[i]);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// pattern[2].opcode = OpCodes.Ldc_I4_1;
|
||||
//
|
||||
// for (int i = 0; i < 16; i++) {
|
||||
// for (int j = 0; j < pattern.Count; j++) {
|
||||
// codes.Insert(methodIndex + i + j, pattern[j]);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(platformScript), "SellPlayer")]
|
||||
// public static class ConsoleProductionReductionPatch {
|
||||
// static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||
// var codes = new List<CodeInstruction>(instructions);
|
||||
//
|
||||
// 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.Ldc_R4, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Call, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Add, null));
|
||||
// matcher.Add(new CodeInstruction(OpCodes.Stfld, null));
|
||||
//
|
||||
// for (var i = 0; i < codes.Count; i++) {
|
||||
// if (Main.IsMatch(codes, i, matcher)) {
|
||||
// codes[i + 3].operand = (float)codes[i + 3].operand * 8f;
|
||||
// codes[i + 4].operand = (float)codes[i + 4].operand * 8f;
|
||||
// Console.WriteLine("ConsoleProductionReductionPatch patched");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return codes.AsEnumerable();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "AddFans")]
|
||||
// public static class AddFansPatch {
|
||||
// static void Prefix(ref int i) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// i *= Main.fans.Value;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// [HarmonyPatch(typeof(mainScript), "Earn")]
|
||||
// public static class AddMoneyPatch {
|
||||
// static void Prefix(ref long amount) {
|
||||
// // Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||
// amount *= Main.money.Value;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]
|
||||
|
@@ -1 +1 @@
|
||||
609c169d30d10d3da64fccb9258a6c7730d0c5b3
|
||||
609c169d30d10d3da64fccb9258a6c7730d0c5b3
|
||||
|
@@ -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.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.pdb
|
||||
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\BepInEx.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.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.dll
|
||||
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.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\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\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.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.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.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.pdb
|
||||
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\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\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\BepInEx.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.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.dll
|
||||
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.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\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\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.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.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.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\Regiments\Regiments\obj\Debug\Regiments.pdb
|
||||
|
8
Projects/SevenDaysToDie/.gitignore
vendored
8
Projects/SevenDaysToDie/.gitignore
vendored
@@ -1,5 +1,5 @@
|
||||
bin/
|
||||
obj/
|
||||
/packages/
|
||||
riderModule.iml
|
||||
bin/
|
||||
obj/
|
||||
/packages/
|
||||
riderModule.iml
|
||||
/_ReSharper.Caches/
|
@@ -1,16 +1,16 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SevenDaysToDie", "SevenDaysToDie\SevenDaysToDie.csproj", "{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{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}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SevenDaysToDie", "SevenDaysToDie\SevenDaysToDie.csproj", "{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{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}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@@ -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">
|
||||
<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_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_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>
|
||||
<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_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_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_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>
|
@@ -1,114 +1,114 @@
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib.Tools;
|
||||
using MelonLoader;
|
||||
|
||||
namespace SevenDaysToDie {
|
||||
[assembly: MelonInfo(typeof(Main), "CykaMod", "1", "Cyka")]
|
||||
public class Main : MelonMod {
|
||||
private const string pluginGuid = "CykaMod";
|
||||
|
||||
public static ConfigEntry<float> xpMultiplier;
|
||||
public static ConfigEntry<float> moneyMultiplier;
|
||||
public static ConfigEntry<float> energyGenMultiplier;
|
||||
public static ConfigEntry<float> heartbeatIntervalMultiplier;
|
||||
public static ConfigEntry<float> shootingSpeedMultiplier;
|
||||
public static ConfigEntry<float> muzzleVelocityMultiplier;
|
||||
public static ConfigEntry<bool> allProjectilesHoming;
|
||||
public static ConfigEntry<float> magnetStrenghtMultiplier;
|
||||
public static ConfigEntry<float> magnetRadiusMultiplier;
|
||||
public static ConfigEntry<float> beamStrenghtMultiplier;
|
||||
public static ConfigEntry<float> beamRadiusMultiplier;
|
||||
public static ConfigEntry<float> fuelTankRefillMultiplier;
|
||||
public static ConfigEntry<float> fuelTankCapacityMultiplier;
|
||||
public static ConfigEntry<float> minerGroundArea;
|
||||
public static ConfigEntry<float> minerMiningSpeed;
|
||||
public static ConfigEntry<float> wheelTorqueMultiplier;
|
||||
public static ConfigEntry<float> wheelSpeedMultiplier;
|
||||
public static ConfigEntry<float> jetThrustMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileVisionConeAngleMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileVisionRangeMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileTurningSpeedMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingRadiusMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingPowerPerArcMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingArcFiringIntervalMultiplier;
|
||||
|
||||
public void OnInitializeMelon() {
|
||||
xpMultiplier = UnityDistantTerrain.Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 512f)));
|
||||
// moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f,
|
||||
// new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f,
|
||||
// new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f)));
|
||||
// heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f,
|
||||
// new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f)));
|
||||
//
|
||||
// shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f,
|
||||
// new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f)));
|
||||
// muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f,
|
||||
// new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
// 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)));
|
||||
// seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f,
|
||||
// new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
// seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f,
|
||||
// new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
//
|
||||
// magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f,
|
||||
// new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
// magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f,
|
||||
// new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
// beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f,
|
||||
// new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
// beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f,
|
||||
// new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
//
|
||||
// wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f,
|
||||
// new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
// wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f,
|
||||
// new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f)));
|
||||
// wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f,
|
||||
// new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
//
|
||||
// fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f,
|
||||
// new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f,
|
||||
// new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f,
|
||||
// new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f,
|
||||
// new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f,
|
||||
// new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
//
|
||||
// minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f,
|
||||
// new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f,
|
||||
// new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f)));
|
||||
//
|
||||
// allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false);
|
||||
|
||||
// shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch();
|
||||
// energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch();
|
||||
// magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
// magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
// beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
// beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
// fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
// fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
// wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
// wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
// jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch();
|
||||
// minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
// minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
// wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
// wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
// wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
|
||||
Logger.LogInfo("Cyka mod loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
Harmony harmony = new Harmony(pluginGuid);
|
||||
harmony.PatchAll();
|
||||
var originalMethods = harmony.GetPatchedMethods();
|
||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
}
|
||||
}
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib.Tools;
|
||||
using MelonLoader;
|
||||
|
||||
namespace SevenDaysToDie {
|
||||
[assembly: MelonInfo(typeof(Main), "CykaMod", "1", "Cyka")]
|
||||
public class Main : MelonMod {
|
||||
private const string pluginGuid = "CykaMod";
|
||||
|
||||
public static ConfigEntry<float> xpMultiplier;
|
||||
public static ConfigEntry<float> moneyMultiplier;
|
||||
public static ConfigEntry<float> energyGenMultiplier;
|
||||
public static ConfigEntry<float> heartbeatIntervalMultiplier;
|
||||
public static ConfigEntry<float> shootingSpeedMultiplier;
|
||||
public static ConfigEntry<float> muzzleVelocityMultiplier;
|
||||
public static ConfigEntry<bool> allProjectilesHoming;
|
||||
public static ConfigEntry<float> magnetStrenghtMultiplier;
|
||||
public static ConfigEntry<float> magnetRadiusMultiplier;
|
||||
public static ConfigEntry<float> beamStrenghtMultiplier;
|
||||
public static ConfigEntry<float> beamRadiusMultiplier;
|
||||
public static ConfigEntry<float> fuelTankRefillMultiplier;
|
||||
public static ConfigEntry<float> fuelTankCapacityMultiplier;
|
||||
public static ConfigEntry<float> minerGroundArea;
|
||||
public static ConfigEntry<float> minerMiningSpeed;
|
||||
public static ConfigEntry<float> wheelTorqueMultiplier;
|
||||
public static ConfigEntry<float> wheelSpeedMultiplier;
|
||||
public static ConfigEntry<float> jetThrustMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileVisionConeAngleMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileVisionRangeMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileTurningSpeedMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingRadiusMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingPowerPerArcMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingArcFiringIntervalMultiplier;
|
||||
|
||||
public void OnInitializeMelon() {
|
||||
xpMultiplier = UnityDistantTerrain.Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 512f)));
|
||||
// moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f,
|
||||
// new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f,
|
||||
// new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f)));
|
||||
// heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f,
|
||||
// new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f)));
|
||||
//
|
||||
// shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f,
|
||||
// new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f)));
|
||||
// muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f,
|
||||
// new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
// 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)));
|
||||
// seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f,
|
||||
// new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
// seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f,
|
||||
// new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
//
|
||||
// magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f,
|
||||
// new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
// magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f,
|
||||
// new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
// beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f,
|
||||
// new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
// beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f,
|
||||
// new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
//
|
||||
// wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f,
|
||||
// new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
// wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f,
|
||||
// new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f)));
|
||||
// wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f,
|
||||
// new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
//
|
||||
// fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f,
|
||||
// new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f,
|
||||
// new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f,
|
||||
// new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f,
|
||||
// new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f,
|
||||
// new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
//
|
||||
// minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f,
|
||||
// new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f)));
|
||||
// minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f,
|
||||
// new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f)));
|
||||
//
|
||||
// allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false);
|
||||
|
||||
// shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch();
|
||||
// energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch();
|
||||
// magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
// magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
// beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
// beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
// fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
// fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
// wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
// wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
// jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch();
|
||||
// minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
// minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
// wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
// wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
// wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
|
||||
Logger.LogInfo("Cyka mod loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
Harmony harmony = new Harmony(pluginGuid);
|
||||
harmony.PatchAll();
|
||||
var originalMethods = harmony.GetPatchedMethods();
|
||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,35 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("SevenDaysToDie")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("SevenDaysToDie")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("SevenDaysToDie")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("SevenDaysToDie")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
@@ -1,75 +1,75 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SevenDaysToDie</RootNamespace>
|
||||
<AssemblyName>SevenDaysToDie</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>libs\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MelonLoader">
|
||||
<HintPath>libs\MelonLoader.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>libs\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>libs\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="XPPatch.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
|
||||
</Project>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{1DDE7D09-633A-48E5-A548-4BD4BC4CB8D5}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>SevenDaysToDie</RootNamespace>
|
||||
<AssemblyName>SevenDaysToDie</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>libs\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MelonLoader">
|
||||
<HintPath>libs\MelonLoader.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>libs\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>libs\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="XPPatch.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
|
||||
</Project>
|
||||
|
@@ -1,12 +1,12 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace SevenDaysToDie {
|
||||
[HarmonyPatch]
|
||||
public class Patches {
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(Progression), "AddLevelExp")]
|
||||
static void XPMulti(ref int _exp) {
|
||||
_exp = (int)(_exp * Main.xpMultiplier.Value);
|
||||
}
|
||||
}
|
||||
using HarmonyLib;
|
||||
|
||||
namespace SevenDaysToDie {
|
||||
[HarmonyPatch]
|
||||
public class Patches {
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(Progression), "AddLevelExp")]
|
||||
static void XPMulti(ref int _exp) {
|
||||
_exp = (int)(_exp * Main.xpMultiplier.Value);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,16 +1,16 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TerraTech", "TerraTech\TerraTech.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TerraTech", "TerraTech\TerraTech.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@@ -1,79 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class BeamPropertiesManager {
|
||||
private static Dictionary<ModuleItemHolderBeam, float> strenghts = new Dictionary<ModuleItemHolderBeam, float>();
|
||||
private static Dictionary<ModuleItemHolderBeam, float> radii = new Dictionary<ModuleItemHolderBeam, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderBeam), "OnAttached")]
|
||||
static void PostfixCreate(ModuleItemHolderBeam __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderBeam.OnAttached");
|
||||
if (!strenghts.ContainsKey(__instance)) {
|
||||
strenghts.Add(__instance, GetStrength(__instance));
|
||||
radii.Add(__instance, GetRadius(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderBeam), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleItemHolderBeam __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderBeam.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
strenghts.Remove(__instance);
|
||||
radii.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleItemHolderBeam", strenghts.Count);
|
||||
foreach (KeyValuePair<ModuleItemHolderBeam, float> keyValuePair in strenghts) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam] * Main.beamStrenghtMultiplier.Value);
|
||||
SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam] * Main.beamRadiusMultiplier.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
if (strenghts.ContainsKey(moduleItemHolderBeam)) {
|
||||
SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam]);
|
||||
SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetStrength(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
return Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetStrength(ModuleItemHolderBeam moduleItemHolderBeam, float value) {
|
||||
Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetRadius(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f;
|
||||
return radius;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
private static void SetRadius(ModuleItemHolderBeam moduleItemHolderBeam, float value) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class BeamPropertiesManager {
|
||||
private static Dictionary<ModuleItemHolderBeam, float> strenghts = new Dictionary<ModuleItemHolderBeam, float>();
|
||||
private static Dictionary<ModuleItemHolderBeam, float> radii = new Dictionary<ModuleItemHolderBeam, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderBeam), "OnAttached")]
|
||||
static void PostfixCreate(ModuleItemHolderBeam __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderBeam.OnAttached");
|
||||
if (!strenghts.ContainsKey(__instance)) {
|
||||
strenghts.Add(__instance, GetStrength(__instance));
|
||||
radii.Add(__instance, GetRadius(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderBeam), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleItemHolderBeam __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderBeam.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_BeamStrength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
strenghts.Remove(__instance);
|
||||
radii.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleItemHolderBeam", strenghts.Count);
|
||||
foreach (KeyValuePair<ModuleItemHolderBeam, float> keyValuePair in strenghts) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam] * Main.beamStrenghtMultiplier.Value);
|
||||
SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam] * Main.beamRadiusMultiplier.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
if (strenghts.ContainsKey(moduleItemHolderBeam)) {
|
||||
SetStrength(moduleItemHolderBeam, strenghts[moduleItemHolderBeam]);
|
||||
SetRadius(moduleItemHolderBeam, radii[moduleItemHolderBeam]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetStrength(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
return Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetStrength(ModuleItemHolderBeam moduleItemHolderBeam, float value) {
|
||||
Traverse.Create(moduleItemHolderBeam).Field("m_BeamStrength").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetRadius(ModuleItemHolderBeam moduleItemHolderBeam) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f;
|
||||
return radius;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
private static void SetRadius(ModuleItemHolderBeam moduleItemHolderBeam, float value) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderBeam).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,121 +1,121 @@
|
||||
using System.Linq;
|
||||
using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
using HarmonyLib.Tools;
|
||||
|
||||
// TODO: Make shield and repair bigger
|
||||
// TODO: Maybe make props faster, thrusters work fine
|
||||
|
||||
namespace TerraTech {
|
||||
[BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
public class Main : BaseUnityPlugin {
|
||||
private const string pluginGuid = "CykaMod";
|
||||
private const string pluginName = "CykaMod";
|
||||
private const string pluginVersion = "1.0.0";
|
||||
|
||||
public static ConfigEntry<float> xpMultiplier;
|
||||
public static ConfigEntry<float> moneyMultiplier;
|
||||
public static ConfigEntry<float> energyGenMultiplier;
|
||||
public static ConfigEntry<float> heartbeatIntervalMultiplier;
|
||||
public static ConfigEntry<float> shootingSpeedMultiplier;
|
||||
public static ConfigEntry<float> muzzleVelocityMultiplier;
|
||||
public static ConfigEntry<bool> allProjectilesHoming;
|
||||
public static ConfigEntry<float> magnetStrenghtMultiplier;
|
||||
public static ConfigEntry<float> magnetRadiusMultiplier;
|
||||
public static ConfigEntry<float> beamStrenghtMultiplier;
|
||||
public static ConfigEntry<float> beamRadiusMultiplier;
|
||||
public static ConfigEntry<float> fuelTankRefillMultiplier;
|
||||
public static ConfigEntry<float> fuelTankCapacityMultiplier;
|
||||
public static ConfigEntry<float> minerGroundArea;
|
||||
public static ConfigEntry<float> minerMiningSpeed;
|
||||
public static ConfigEntry<float> wheelTorqueMultiplier;
|
||||
public static ConfigEntry<float> wheelSpeedMultiplier;
|
||||
public static ConfigEntry<float> jetThrustMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileVisionConeAngleMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileVisionRangeMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileTurningSpeedMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingRadiusMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingPowerPerArcMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingArcFiringIntervalMultiplier;
|
||||
|
||||
public void Awake() {
|
||||
xpMultiplier = Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f,
|
||||
new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f,
|
||||
new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f)));
|
||||
heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f,
|
||||
new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f)));
|
||||
|
||||
shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f,
|
||||
new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f)));
|
||||
muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f,
|
||||
new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
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)));
|
||||
seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f,
|
||||
new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f,
|
||||
new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
|
||||
magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f,
|
||||
new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f,
|
||||
new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f,
|
||||
new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f,
|
||||
new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
|
||||
wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f,
|
||||
new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f,
|
||||
new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f)));
|
||||
wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f,
|
||||
new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
|
||||
fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f,
|
||||
new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f,
|
||||
new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f,
|
||||
new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f,
|
||||
new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f,
|
||||
new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
|
||||
minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f,
|
||||
new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f)));
|
||||
minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f,
|
||||
new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f)));
|
||||
|
||||
allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false);
|
||||
|
||||
shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch();
|
||||
energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch();
|
||||
magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch();
|
||||
minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
|
||||
Logger.LogInfo("Cyka mod loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
Harmony harmony = new Harmony(pluginGuid);
|
||||
harmony.PatchAll();
|
||||
var originalMethods = harmony.GetPatchedMethods();
|
||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
}
|
||||
}
|
||||
using System.Linq;
|
||||
using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
using HarmonyLib.Tools;
|
||||
|
||||
// TODO: Make shield and repair bigger
|
||||
// TODO: Maybe make props faster, thrusters work fine
|
||||
|
||||
namespace TerraTech {
|
||||
[BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
public class Main : BaseUnityPlugin {
|
||||
private const string pluginGuid = "CykaMod";
|
||||
private const string pluginName = "CykaMod";
|
||||
private const string pluginVersion = "1.0.0";
|
||||
|
||||
public static ConfigEntry<float> xpMultiplier;
|
||||
public static ConfigEntry<float> moneyMultiplier;
|
||||
public static ConfigEntry<float> energyGenMultiplier;
|
||||
public static ConfigEntry<float> heartbeatIntervalMultiplier;
|
||||
public static ConfigEntry<float> shootingSpeedMultiplier;
|
||||
public static ConfigEntry<float> muzzleVelocityMultiplier;
|
||||
public static ConfigEntry<bool> allProjectilesHoming;
|
||||
public static ConfigEntry<float> magnetStrenghtMultiplier;
|
||||
public static ConfigEntry<float> magnetRadiusMultiplier;
|
||||
public static ConfigEntry<float> beamStrenghtMultiplier;
|
||||
public static ConfigEntry<float> beamRadiusMultiplier;
|
||||
public static ConfigEntry<float> fuelTankRefillMultiplier;
|
||||
public static ConfigEntry<float> fuelTankCapacityMultiplier;
|
||||
public static ConfigEntry<float> minerGroundArea;
|
||||
public static ConfigEntry<float> minerMiningSpeed;
|
||||
public static ConfigEntry<float> wheelTorqueMultiplier;
|
||||
public static ConfigEntry<float> wheelSpeedMultiplier;
|
||||
public static ConfigEntry<float> jetThrustMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileVisionConeAngleMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileVisionRangeMultiplier;
|
||||
public static ConfigEntry<float> seekingProjectileTurningSpeedMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingRadiusMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingPowerPerArcMultiplier;
|
||||
public static ConfigEntry<float> wirelessChargingArcFiringIntervalMultiplier;
|
||||
|
||||
public void Awake() {
|
||||
xpMultiplier = Config.Bind("General", "XP Multiplier", 1f, new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
moneyMultiplier = Config.Bind("General", "Money Multiplier", 1f,
|
||||
new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
energyGenMultiplier = Config.Bind("General", "Energy Generation Multiplier", 1f,
|
||||
new ConfigDescription("Energy Generation Multiplier", new AcceptableValueRange<float>(1f, 64f)));
|
||||
heartbeatIntervalMultiplier = Config.Bind("General", "Heartbeat Interval Multiplier", 1f,
|
||||
new ConfigDescription("Heartbeat Interval Multiplier", new AcceptableValueRange<float>(0.1f, 2f)));
|
||||
|
||||
shootingSpeedMultiplier = Config.Bind("Weapons", "Shooting Speed Multiplier", 1f,
|
||||
new ConfigDescription("Shooting Speed Multiplier", new AcceptableValueRange<float>(0.2f, 8f)));
|
||||
muzzleVelocityMultiplier = Config.Bind("Weapons", "Muzzle Velocity Multiplier", 1f,
|
||||
new ConfigDescription("Muzzle Velocity Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
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)));
|
||||
seekingProjectileVisionRangeMultiplier = Config.Bind("Weapons", "Seeking Projectile Vision Range Multiplier", 1f,
|
||||
new ConfigDescription("Seeking Projectile Vision Range Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
seekingProjectileTurningSpeedMultiplier = Config.Bind("Weapons", "Seeking Projectile Turn Speed Multiplier", 1f,
|
||||
new ConfigDescription("Seeking Projectile Turn Speed Multiplier", new AcceptableValueRange<float>(0.2f, 32f)));
|
||||
|
||||
magnetStrenghtMultiplier = Config.Bind("Attractors", "Magnet Strength Multiplier", 1f,
|
||||
new ConfigDescription("Magnet Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
magnetRadiusMultiplier = Config.Bind("Attractors", "Magnet Radius Multiplier", 1f,
|
||||
new ConfigDescription("Magnet Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
beamStrenghtMultiplier = Config.Bind("Attractors", "Beam Strength Multiplier", 1f,
|
||||
new ConfigDescription("Beam Strength Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
beamRadiusMultiplier = Config.Bind("Attractors", "Beam Radius Multiplier", 1f,
|
||||
new ConfigDescription("Beam Radius Multiplier", new AcceptableValueRange<float>(1f, 16f)));
|
||||
|
||||
wirelessChargingRadiusMultiplier = Config.Bind("Power", "Wireless Charger Radius Multiplier", 1f,
|
||||
new ConfigDescription("Wireless Charger Radius Multiplier", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
wirelessChargingArcFiringIntervalMultiplier = Config.Bind("Power", "Wireless Charger Arc Firing Interval", 1f,
|
||||
new ConfigDescription("Wireless Charger Arc Firing Interval", new AcceptableValueRange<float>(0.02f, 16f)));
|
||||
wirelessChargingPowerPerArcMultiplier = Config.Bind("Power", "Wireless Charger Power Per Arc", 1f,
|
||||
new ConfigDescription("Wireless Charger Power Per Arc", new AcceptableValueRange<float>(0.2f, 16f)));
|
||||
|
||||
fuelTankRefillMultiplier = Config.Bind("Propulsion", "Fuel Tank Refill Rate Multiplier", 1f,
|
||||
new ConfigDescription("Fuel Tank Refill Rate Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
fuelTankCapacityMultiplier = Config.Bind("Propulsion", "Fuel Tank Capacity Multiplier", 1f,
|
||||
new ConfigDescription("Fuel Tank Capacity Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
wheelTorqueMultiplier = Config.Bind("Propulsion", "Wheel Torque Multiplier", 1f,
|
||||
new ConfigDescription("Wheel Torque Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
wheelSpeedMultiplier = Config.Bind("Propulsion", "Wheel Max RPM Multiplier", 1f,
|
||||
new ConfigDescription("Wheel Max RPM Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
jetThrustMultiplier = Config.Bind("Propulsion", "Jet Thrust Multiplier", 1f,
|
||||
new ConfigDescription("Jet Thrust Multiplier", new AcceptableValueRange<float>(1f, 32f)));
|
||||
|
||||
minerGroundArea = Config.Bind("Production", "Miner Ground Deposit Scan Area", 1f,
|
||||
new ConfigDescription("Miner Ground Deposit Scan Area", new AcceptableValueRange<float>(1f, 32f)));
|
||||
minerMiningSpeed = Config.Bind("Production", "Miner Mining Speed", 1f,
|
||||
new ConfigDescription("Miner Mining Speed", new AcceptableValueRange<float>(1f, 32f)));
|
||||
|
||||
allProjectilesHoming = Config.Bind("General", "Make All Projectiles Home", false);
|
||||
|
||||
shootingSpeedMultiplier.SettingChanged += (sender, args) => WeaponPropertiesManager.DoPatch();
|
||||
energyGenMultiplier.SettingChanged += (sender, args) => GeneratorPropertiesManager.DoPatch();
|
||||
magnetStrenghtMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
magnetRadiusMultiplier.SettingChanged += (sender, args) => MagnetPropertiesManager.DoPatch();
|
||||
beamStrenghtMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
beamRadiusMultiplier.SettingChanged += (sender, args) => BeamPropertiesManager.DoPatch();
|
||||
fuelTankRefillMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
fuelTankCapacityMultiplier.SettingChanged += (sender, args) => FuelPropertiesManager.DoPatch();
|
||||
wheelTorqueMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
wheelSpeedMultiplier.SettingChanged += (sender, args) => WheelPropertiesManager.DoPatch();
|
||||
jetThrustMultiplier.SettingChanged += (sender, args) => ThrusterPropertiesManager.DoPatch();
|
||||
minerGroundArea.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
minerMiningSpeed.SettingChanged += (sender, args) => MinerPropertiesManager.DoPatch();
|
||||
wirelessChargingPowerPerArcMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
wirelessChargingArcFiringIntervalMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
wirelessChargingRadiusMultiplier.SettingChanged += (sender, args) => WirelessChargerPropertiesManager.DoPatch();
|
||||
|
||||
Logger.LogInfo("Cyka mod loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
Harmony harmony = new Harmony(pluginGuid);
|
||||
harmony.PatchAll();
|
||||
var originalMethods = harmony.GetPatchedMethods();
|
||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,55 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class FuelPropertiesManager {
|
||||
private static Dictionary<ModuleFuelTank, float> refillRate = new Dictionary<ModuleFuelTank, float>();
|
||||
private static Dictionary<ModuleFuelTank, float> capacity = new Dictionary<ModuleFuelTank, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleFuelTank), "OnAttached")]
|
||||
static void PostfixCreate(ModuleFuelTank __instance) {
|
||||
// Console.WriteLine("ModuleFuelTank.OnAttached");
|
||||
if (!refillRate.ContainsKey(__instance)) {
|
||||
refillRate.Add(__instance, __instance.m_RefillRate);
|
||||
capacity.Add(__instance, __instance.m_Capacity);
|
||||
// Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleFuelTank), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleFuelTank __instance) {
|
||||
// Console.WriteLine("ModuleFuelTank.OnAttached");
|
||||
// Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
refillRate.Remove(__instance);
|
||||
capacity.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleFuelTank", refillRate.Count);
|
||||
foreach (KeyValuePair<ModuleFuelTank, float> keyValuePair in refillRate) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleFuelTank moduleFuelTank) {
|
||||
moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank] * Main.fuelTankRefillMultiplier.Value;
|
||||
moduleFuelTank.m_Capacity = capacity[moduleFuelTank] * Main.fuelTankCapacityMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleFuelTank moduleFuelTank) {
|
||||
if (refillRate.ContainsKey(moduleFuelTank)) {
|
||||
moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank];
|
||||
moduleFuelTank.m_Capacity = capacity[moduleFuelTank];
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class FuelPropertiesManager {
|
||||
private static Dictionary<ModuleFuelTank, float> refillRate = new Dictionary<ModuleFuelTank, float>();
|
||||
private static Dictionary<ModuleFuelTank, float> capacity = new Dictionary<ModuleFuelTank, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleFuelTank), "OnAttached")]
|
||||
static void PostfixCreate(ModuleFuelTank __instance) {
|
||||
// Console.WriteLine("ModuleFuelTank.OnAttached");
|
||||
if (!refillRate.ContainsKey(__instance)) {
|
||||
refillRate.Add(__instance, __instance.m_RefillRate);
|
||||
capacity.Add(__instance, __instance.m_Capacity);
|
||||
// Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleFuelTank), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleFuelTank __instance) {
|
||||
// Console.WriteLine("ModuleFuelTank.OnAttached");
|
||||
// Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
refillRate.Remove(__instance);
|
||||
capacity.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleFuelTank", refillRate.Count);
|
||||
foreach (KeyValuePair<ModuleFuelTank, float> keyValuePair in refillRate) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleFuelTank moduleFuelTank) {
|
||||
moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank] * Main.fuelTankRefillMultiplier.Value;
|
||||
moduleFuelTank.m_Capacity = capacity[moduleFuelTank] * Main.fuelTankCapacityMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleFuelTank moduleFuelTank) {
|
||||
if (refillRate.ContainsKey(moduleFuelTank)) {
|
||||
moduleFuelTank.m_RefillRate = refillRate[moduleFuelTank];
|
||||
moduleFuelTank.m_Capacity = capacity[moduleFuelTank];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,58 +1,58 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class GeneratorPropertiesManager {
|
||||
private static Dictionary<ModuleEnergy, float> generators = new Dictionary<ModuleEnergy, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleEnergy), "OnAttached")]
|
||||
static void PostfixCreate(ModuleEnergy __instance) {
|
||||
// Console.WriteLine("ModuleEnergy.OnAttached");
|
||||
if (!generators.ContainsKey(__instance)) {
|
||||
generators.Add(__instance, GetValue(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleEnergy), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleEnergy __instance) {
|
||||
// Console.WriteLine("ModuleEnergy.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
generators.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleEnergy", generators.Count);
|
||||
foreach (KeyValuePair<ModuleEnergy, float> keyValuePair in generators) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleEnergy moduleEnergy) {
|
||||
SetValue(moduleEnergy, generators[moduleEnergy] * Main.energyGenMultiplier.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleEnergy moduleEnergy) {
|
||||
if (generators.ContainsKey(moduleEnergy)) {
|
||||
SetValue(moduleEnergy, generators[moduleEnergy]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetValue(ModuleEnergy moduleEnergy) {
|
||||
return Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetValue(ModuleEnergy moduleEnergy, float value) {
|
||||
Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").SetValue(value);
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class GeneratorPropertiesManager {
|
||||
private static Dictionary<ModuleEnergy, float> generators = new Dictionary<ModuleEnergy, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleEnergy), "OnAttached")]
|
||||
static void PostfixCreate(ModuleEnergy __instance) {
|
||||
// Console.WriteLine("ModuleEnergy.OnAttached");
|
||||
if (!generators.ContainsKey(__instance)) {
|
||||
generators.Add(__instance, GetValue(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleEnergy), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleEnergy __instance) {
|
||||
// Console.WriteLine("ModuleEnergy.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_OutputPerSecond: {1}", __instance.name, GetValue(__instance));
|
||||
generators.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleEnergy", generators.Count);
|
||||
foreach (KeyValuePair<ModuleEnergy, float> keyValuePair in generators) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleEnergy moduleEnergy) {
|
||||
SetValue(moduleEnergy, generators[moduleEnergy] * Main.energyGenMultiplier.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleEnergy moduleEnergy) {
|
||||
if (generators.ContainsKey(moduleEnergy)) {
|
||||
SetValue(moduleEnergy, generators[moduleEnergy]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetValue(ModuleEnergy moduleEnergy) {
|
||||
return Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetValue(ModuleEnergy moduleEnergy, float value) {
|
||||
Traverse.Create(moduleEnergy).Field("m_OutputPerSecond").SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,22 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch(typeof(Projectile), "Fire")]
|
||||
public class HomingAndVelocityProjectilePatch {
|
||||
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) {
|
||||
if (Main.allProjectilesHoming.Value) {
|
||||
seekingRounds = true;
|
||||
}
|
||||
if (!velocities.ContainsKey(fireData)) {
|
||||
velocities.Add(fireData, fireData.m_MuzzleVelocity);
|
||||
fireData.m_MuzzleVelocity *= Main.muzzleVelocityMultiplier.Value;
|
||||
} else if (velocities[fireData] != fireData.m_MuzzleVelocity * Main.muzzleVelocityMultiplier.Value) {
|
||||
fireData.m_MuzzleVelocity = velocities[fireData] * Main.muzzleVelocityMultiplier.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch(typeof(Projectile), "Fire")]
|
||||
public class HomingAndVelocityProjectilePatch {
|
||||
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) {
|
||||
if (Main.allProjectilesHoming.Value) {
|
||||
seekingRounds = true;
|
||||
}
|
||||
if (!velocities.ContainsKey(fireData)) {
|
||||
velocities.Add(fireData, fireData.m_MuzzleVelocity);
|
||||
fireData.m_MuzzleVelocity *= Main.muzzleVelocityMultiplier.Value;
|
||||
} else if (velocities[fireData] != fireData.m_MuzzleVelocity * Main.muzzleVelocityMultiplier.Value) {
|
||||
fireData.m_MuzzleVelocity = velocities[fireData] * Main.muzzleVelocityMultiplier.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,81 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class MagnetPropertiesManager {
|
||||
private static Dictionary<ModuleItemHolderMagnet, float> strenghts = new Dictionary<ModuleItemHolderMagnet, float>();
|
||||
private static Dictionary<ModuleItemHolderMagnet, float> radii = new Dictionary<ModuleItemHolderMagnet, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnAttached")]
|
||||
static void PostfixCreate(ModuleItemHolderMagnet __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderMagnet.OnAttached");
|
||||
if (!strenghts.ContainsKey(__instance)) {
|
||||
strenghts.Add(__instance, GetStrength(__instance));
|
||||
radii.Add(__instance, GetRadius(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleItemHolderMagnet __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderMagnet.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
strenghts.Remove(__instance);
|
||||
radii.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleItemHolderMagnet", strenghts.Count);
|
||||
foreach (KeyValuePair<ModuleItemHolderMagnet, float> keyValuePair in strenghts) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet] * Main.magnetStrenghtMultiplier.Value);
|
||||
SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet] * Main.magnetRadiusMultiplier.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
if (strenghts.ContainsKey(moduleItemHolderMagnet)) {
|
||||
SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet]);
|
||||
}
|
||||
if (radii.ContainsKey(moduleItemHolderMagnet)) {
|
||||
SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
return Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) {
|
||||
Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f;
|
||||
return radius;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
private static void SetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class MagnetPropertiesManager {
|
||||
private static Dictionary<ModuleItemHolderMagnet, float> strenghts = new Dictionary<ModuleItemHolderMagnet, float>();
|
||||
private static Dictionary<ModuleItemHolderMagnet, float> radii = new Dictionary<ModuleItemHolderMagnet, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnAttached")]
|
||||
static void PostfixCreate(ModuleItemHolderMagnet __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderMagnet.OnAttached");
|
||||
if (!strenghts.ContainsKey(__instance)) {
|
||||
strenghts.Add(__instance, GetStrength(__instance));
|
||||
radii.Add(__instance, GetRadius(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemHolderMagnet), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleItemHolderMagnet __instance) {
|
||||
// Console.WriteLine("ModuleItemHolderMagnet.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_Strength: {1}; m_Pickup.m_PickupRange: {2}", __instance.name, GetStrength(__instance), GetRadius(__instance));
|
||||
strenghts.Remove(__instance);
|
||||
radii.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleItemHolderMagnet", strenghts.Count);
|
||||
foreach (KeyValuePair<ModuleItemHolderMagnet, float> keyValuePair in strenghts) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet] * Main.magnetStrenghtMultiplier.Value);
|
||||
SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet] * Main.magnetRadiusMultiplier.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
if (strenghts.ContainsKey(moduleItemHolderMagnet)) {
|
||||
SetStrength(moduleItemHolderMagnet, strenghts[moduleItemHolderMagnet]);
|
||||
}
|
||||
if (radii.ContainsKey(moduleItemHolderMagnet)) {
|
||||
SetRadius(moduleItemHolderMagnet, radii[moduleItemHolderMagnet]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
return Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetStrength(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) {
|
||||
Traverse.Create(moduleItemHolderMagnet).Field("m_Strength").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
float radius = Traverse.Create(moduleItemPickup).Field("m_PickupRange").GetValue() as float? ?? 0f;
|
||||
return radius;
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
private static void SetRadius(ModuleItemHolderMagnet moduleItemHolderMagnet, float value) {
|
||||
ModuleItemPickup moduleItemPickup = Traverse.Create(moduleItemHolderMagnet).Field("m_Pickup").GetValue() as ModuleItemPickup;
|
||||
if (moduleItemPickup) {
|
||||
Traverse.Create(moduleItemPickup).Field("m_PickupRange").SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,86 +1,86 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class MinerPropertiesManager {
|
||||
private static Dictionary<ModuleItemProducer, float> area = new Dictionary<ModuleItemProducer, float>();
|
||||
private static Dictionary<ModuleItemProducer, float> speed = new Dictionary<ModuleItemProducer, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemProducer), "GetClosestResourceReservoirInRange")]
|
||||
static void PostfixCreate(ModuleItemProducer __instance) {
|
||||
// Console.WriteLine("ModuleItemProducer.GetClosestResourceReservoirInRange");
|
||||
if (!area.ContainsKey(__instance)) {
|
||||
area.Add(__instance, GetArea(__instance));
|
||||
speed.Add(__instance, GetSpeed(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
} else {
|
||||
if (GetArea(__instance) == area[__instance]) {
|
||||
// Console.WriteLine("{0} area reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name,
|
||||
// GetArea(__instance), GetSpeed(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
}
|
||||
if (GetSpeed(__instance) == speed[__instance]) {
|
||||
// Console.WriteLine("{0} speed reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name,
|
||||
// GetArea(__instance), GetSpeed(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(ModuleItemProducer), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleItemProducer __instance) {
|
||||
// Console.WriteLine("ModuleItemProducer.OnRecycle");
|
||||
DoRestoreSingle(__instance);
|
||||
area.Remove(__instance);
|
||||
speed.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleItemProducer", area.Count);
|
||||
foreach (KeyValuePair<ModuleItemProducer, float> keyValuePair in area) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleItemProducer moduleItemProducer) {
|
||||
SetArea(moduleItemProducer, area[moduleItemProducer] * Main.minerGroundArea.Value);
|
||||
SetSpeed(moduleItemProducer, speed[moduleItemProducer] / Main.minerMiningSpeed.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleItemProducer moduleItemProducer) {
|
||||
if (area.ContainsKey(moduleItemProducer)) {
|
||||
SetArea(moduleItemProducer, area[moduleItemProducer]);
|
||||
SetSpeed(moduleItemProducer, speed[moduleItemProducer]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetArea(ModuleItemProducer moduleItemProducer) {
|
||||
return Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetArea(ModuleItemProducer moduleItemProducer, float value) {
|
||||
Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetSpeed(ModuleItemProducer moduleItemProducer) {
|
||||
return Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetSpeed(ModuleItemProducer moduleItemProducer, float value) {
|
||||
Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").SetValue(value);
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class MinerPropertiesManager {
|
||||
private static Dictionary<ModuleItemProducer, float> area = new Dictionary<ModuleItemProducer, float>();
|
||||
private static Dictionary<ModuleItemProducer, float> speed = new Dictionary<ModuleItemProducer, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleItemProducer), "GetClosestResourceReservoirInRange")]
|
||||
static void PostfixCreate(ModuleItemProducer __instance) {
|
||||
// Console.WriteLine("ModuleItemProducer.GetClosestResourceReservoirInRange");
|
||||
if (!area.ContainsKey(__instance)) {
|
||||
area.Add(__instance, GetArea(__instance));
|
||||
speed.Add(__instance, GetSpeed(__instance));
|
||||
// Console.WriteLine("Patching {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
} else {
|
||||
if (GetArea(__instance) == area[__instance]) {
|
||||
// Console.WriteLine("{0} area reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name,
|
||||
// GetArea(__instance), GetSpeed(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
}
|
||||
if (GetSpeed(__instance) == speed[__instance]) {
|
||||
// Console.WriteLine("{0} speed reset, patching again... m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name,
|
||||
// GetArea(__instance), GetSpeed(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ResourceGroundRadius: {1}; m_SecPerItemProduced: {2}", __instance.name, GetArea(__instance),
|
||||
// GetSpeed(__instance));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(ModuleItemProducer), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleItemProducer __instance) {
|
||||
// Console.WriteLine("ModuleItemProducer.OnRecycle");
|
||||
DoRestoreSingle(__instance);
|
||||
area.Remove(__instance);
|
||||
speed.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleItemProducer", area.Count);
|
||||
foreach (KeyValuePair<ModuleItemProducer, float> keyValuePair in area) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleItemProducer moduleItemProducer) {
|
||||
SetArea(moduleItemProducer, area[moduleItemProducer] * Main.minerGroundArea.Value);
|
||||
SetSpeed(moduleItemProducer, speed[moduleItemProducer] / Main.minerMiningSpeed.Value);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleItemProducer moduleItemProducer) {
|
||||
if (area.ContainsKey(moduleItemProducer)) {
|
||||
SetArea(moduleItemProducer, area[moduleItemProducer]);
|
||||
SetSpeed(moduleItemProducer, speed[moduleItemProducer]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetArea(ModuleItemProducer moduleItemProducer) {
|
||||
return Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetArea(ModuleItemProducer moduleItemProducer, float value) {
|
||||
Traverse.Create(moduleItemProducer).Field("m_ResourceGroundRadius").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetSpeed(ModuleItemProducer moduleItemProducer) {
|
||||
return Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetSpeed(ModuleItemProducer moduleItemProducer, float value) {
|
||||
Traverse.Create(moduleItemProducer).Field("m_SecPerItemProduced").SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,24 +1,24 @@
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class Patches {
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ManLicenses), "AddXP")]
|
||||
static void XPMulti(FactionSubTypes corporation, ref int xp, bool showUI = true) {
|
||||
xp = (int)(xp * Main.xpMultiplier.Value);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ManPlayer), "AddMoney")]
|
||||
static void MoneyMulti(ref int amount) {
|
||||
amount = (int)(amount * Main.moneyMultiplier.Value);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TechHolders), "SetHeartbeatInterval")]
|
||||
static void HeartbeatMulti(ref float interval) {
|
||||
interval *= Main.heartbeatIntervalMultiplier.Value;
|
||||
}
|
||||
}
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class Patches {
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ManLicenses), "AddXP")]
|
||||
static void XPMulti(FactionSubTypes corporation, ref int xp, bool showUI = true) {
|
||||
xp = (int)(xp * Main.xpMultiplier.Value);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ManPlayer), "AddMoney")]
|
||||
static void MoneyMulti(ref int amount) {
|
||||
amount = (int)(amount * Main.moneyMultiplier.Value);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(TechHolders), "SetHeartbeatInterval")]
|
||||
static void HeartbeatMulti(ref float interval) {
|
||||
interval *= Main.heartbeatIntervalMultiplier.Value;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,35 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("TerraTech")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("TerraTech")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("TerraTech")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("TerraTech")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
@@ -1,24 +1,24 @@
|
||||
using System;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
public class SeekingProjectileManager {
|
||||
[HarmonyPatch(typeof(SeekingProjectile), "OnSpawn")]
|
||||
class Patch {
|
||||
static void Postfix(SeekingProjectile __instance) {
|
||||
Console.WriteLine("SeekingProjectile created");
|
||||
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_TurnSpeed", Main.seekingProjectileTurningSpeedMultiplier.Value * GetField(__instance, "m_TurnSpeed"));
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetField(SeekingProjectile seekingProjectile, string field) {
|
||||
return Traverse.Create(seekingProjectile).Field(field).GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetField(SeekingProjectile seekingProjectile, string field, float value) {
|
||||
Traverse.Create(seekingProjectile).Field(field).SetValue(value);
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
public class SeekingProjectileManager {
|
||||
[HarmonyPatch(typeof(SeekingProjectile), "OnSpawn")]
|
||||
class Patch {
|
||||
static void Postfix(SeekingProjectile __instance) {
|
||||
Console.WriteLine("SeekingProjectile created");
|
||||
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_TurnSpeed", Main.seekingProjectileTurningSpeedMultiplier.Value * GetField(__instance, "m_TurnSpeed"));
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetField(SeekingProjectile seekingProjectile, string field) {
|
||||
return Traverse.Create(seekingProjectile).Field(field).GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetField(SeekingProjectile seekingProjectile, string field, float value) {
|
||||
Traverse.Create(seekingProjectile).Field(field).SetValue(value);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,78 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>TerraTech</RootNamespace>
|
||||
<AssemblyName>TerraTech</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BeamPropertiesManager.cs" />
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="FuelPropertiesManager.cs" />
|
||||
<Compile Include="GeneratorPropertiesManager.cs" />
|
||||
<Compile Include="HomingAndVelocityProjectilePatch.cs" />
|
||||
<Compile Include="MagnetPropertiesManager.cs" />
|
||||
<Compile Include="MinerPropertiesManager.cs" />
|
||||
<Compile Include="Patches.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SeekingProjectileManager.cs" />
|
||||
<Compile Include="ThrusterPropertiesManager.cs" />
|
||||
<Compile Include="WeaponPropertiesManager.cs" />
|
||||
<Compile Include="WheelPropertiesManager.cs" />
|
||||
<Compile Include="WirelessChargerPropertiesManager.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>..\libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>..\libs\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>..\libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>..\libs\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>TerraTech</RootNamespace>
|
||||
<AssemblyName>TerraTech</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BeamPropertiesManager.cs" />
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="FuelPropertiesManager.cs" />
|
||||
<Compile Include="GeneratorPropertiesManager.cs" />
|
||||
<Compile Include="HomingAndVelocityProjectilePatch.cs" />
|
||||
<Compile Include="MagnetPropertiesManager.cs" />
|
||||
<Compile Include="MinerPropertiesManager.cs" />
|
||||
<Compile Include="Patches.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SeekingProjectileManager.cs" />
|
||||
<Compile Include="ThrusterPropertiesManager.cs" />
|
||||
<Compile Include="WeaponPropertiesManager.cs" />
|
||||
<Compile Include="WheelPropertiesManager.cs" />
|
||||
<Compile Include="WirelessChargerPropertiesManager.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>..\libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>..\libs\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>..\libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>..\libs\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
@@ -1,89 +1,89 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class ThrusterPropertiesManager {
|
||||
private static Dictionary<ModuleBooster, Dictionary<BoosterJet, float>> boosters = new Dictionary<ModuleBooster, Dictionary<BoosterJet, float>>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleBooster), "OnAttached")]
|
||||
static void PostfixCreate(ModuleBooster __instance) {
|
||||
// Console.WriteLine("ModuleBooster.OnAttached");
|
||||
if (!boosters.ContainsKey(__instance)) {
|
||||
boosters.Add(__instance, Map(__instance));
|
||||
// Console.WriteLine("Patching {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleBooster), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleBooster __instance) {
|
||||
// Console.WriteLine("ModuleBooster.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
boosters.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleBooster", boosters.Count);
|
||||
foreach (KeyValuePair<ModuleBooster, Dictionary<BoosterJet, float>> keyValuePair in boosters) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleBooster moduleBooster) {
|
||||
List<BoosterJet> jets = GetValue(moduleBooster);
|
||||
for (var i = 0; i < jets.Count; i++) {
|
||||
boosters[moduleBooster][jets[i]] = GetValue(jets[i]);
|
||||
SetValue(jets[i], GetValue(jets[i]) * Main.jetThrustMultiplier.Value);
|
||||
}
|
||||
SetValue(moduleBooster, jets);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleBooster moduleBooster) {
|
||||
if (boosters.ContainsKey(moduleBooster)) {
|
||||
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
|
||||
SetValue(boosterJet, boosters[moduleBooster][boosterJet]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Dictionary<BoosterJet, float> Map(ModuleBooster moduleBooster) {
|
||||
Dictionary<BoosterJet, float> jets = new Dictionary<BoosterJet, float>();
|
||||
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
|
||||
jets.Add(boosterJet, GetValue(boosterJet));
|
||||
}
|
||||
return jets;
|
||||
}
|
||||
|
||||
private static List<BoosterJet> GetValue(ModuleBooster moduleBooster) {
|
||||
return Traverse.Create(moduleBooster).Field("jets").GetValue() as List<BoosterJet>;
|
||||
}
|
||||
|
||||
private static void SetValue(ModuleBooster moduleBooster, List<BoosterJet> value) {
|
||||
Traverse.Create(moduleBooster).Field("jets").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetValue(BoosterJet boosterJet) {
|
||||
return Traverse.Create(boosterJet).Field("m_Force").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetValue(BoosterJet boosterJet, float value) {
|
||||
Traverse.Create(boosterJet).Field("m_Force").SetValue(value);
|
||||
}
|
||||
|
||||
private static string GetForceAsString(ModuleBooster moduleBooster) {
|
||||
string result = "";
|
||||
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
|
||||
result += GetValue(boosterJet) + ", ";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class ThrusterPropertiesManager {
|
||||
private static Dictionary<ModuleBooster, Dictionary<BoosterJet, float>> boosters = new Dictionary<ModuleBooster, Dictionary<BoosterJet, float>>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleBooster), "OnAttached")]
|
||||
static void PostfixCreate(ModuleBooster __instance) {
|
||||
// Console.WriteLine("ModuleBooster.OnAttached");
|
||||
if (!boosters.ContainsKey(__instance)) {
|
||||
boosters.Add(__instance, Map(__instance));
|
||||
// Console.WriteLine("Patching {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleBooster), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleBooster __instance) {
|
||||
// Console.WriteLine("ModuleBooster.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; force: {1}", __instance.name, GetForceAsString(__instance));
|
||||
boosters.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleBooster", boosters.Count);
|
||||
foreach (KeyValuePair<ModuleBooster, Dictionary<BoosterJet, float>> keyValuePair in boosters) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleBooster moduleBooster) {
|
||||
List<BoosterJet> jets = GetValue(moduleBooster);
|
||||
for (var i = 0; i < jets.Count; i++) {
|
||||
boosters[moduleBooster][jets[i]] = GetValue(jets[i]);
|
||||
SetValue(jets[i], GetValue(jets[i]) * Main.jetThrustMultiplier.Value);
|
||||
}
|
||||
SetValue(moduleBooster, jets);
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleBooster moduleBooster) {
|
||||
if (boosters.ContainsKey(moduleBooster)) {
|
||||
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
|
||||
SetValue(boosterJet, boosters[moduleBooster][boosterJet]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Dictionary<BoosterJet, float> Map(ModuleBooster moduleBooster) {
|
||||
Dictionary<BoosterJet, float> jets = new Dictionary<BoosterJet, float>();
|
||||
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
|
||||
jets.Add(boosterJet, GetValue(boosterJet));
|
||||
}
|
||||
return jets;
|
||||
}
|
||||
|
||||
private static List<BoosterJet> GetValue(ModuleBooster moduleBooster) {
|
||||
return Traverse.Create(moduleBooster).Field("jets").GetValue() as List<BoosterJet>;
|
||||
}
|
||||
|
||||
private static void SetValue(ModuleBooster moduleBooster, List<BoosterJet> value) {
|
||||
Traverse.Create(moduleBooster).Field("jets").SetValue(value);
|
||||
}
|
||||
|
||||
private static float GetValue(BoosterJet boosterJet) {
|
||||
return Traverse.Create(boosterJet).Field("m_Force").GetValue() as float? ?? 0f;
|
||||
}
|
||||
|
||||
private static void SetValue(BoosterJet boosterJet, float value) {
|
||||
Traverse.Create(boosterJet).Field("m_Force").SetValue(value);
|
||||
}
|
||||
|
||||
private static string GetForceAsString(ModuleBooster moduleBooster) {
|
||||
string result = "";
|
||||
foreach (BoosterJet boosterJet in GetValue(moduleBooster)) {
|
||||
result += GetValue(boosterJet) + ", ";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,51 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class WeaponPropertiesManager {
|
||||
private static Dictionary<ModuleWeaponGun, float> shotCooldown = new Dictionary<ModuleWeaponGun, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWeaponGun), "OnAttached")]
|
||||
static void PostfixCreate(ModuleWeaponGun __instance) {
|
||||
// Console.WriteLine("ModuleWeaponGun.OnAttached");
|
||||
if (!shotCooldown.ContainsKey(__instance)) {
|
||||
shotCooldown.Add(__instance, __instance.m_ShotCooldown);
|
||||
// Console.WriteLine("Patching {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWeaponGun), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleWeaponGun __instance) {
|
||||
// Console.WriteLine("ModuleWeaponGun.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
shotCooldown.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleWeaponGun", shotCooldown.Count);
|
||||
foreach (KeyValuePair<ModuleWeaponGun, float> keyValuePair in shotCooldown) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleWeaponGun moduleWeaponGun) {
|
||||
moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun] / Main.shootingSpeedMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleWeaponGun moduleWeaponGun) {
|
||||
if (shotCooldown.ContainsKey(moduleWeaponGun)) {
|
||||
moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun];
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class WeaponPropertiesManager {
|
||||
private static Dictionary<ModuleWeaponGun, float> shotCooldown = new Dictionary<ModuleWeaponGun, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWeaponGun), "OnAttached")]
|
||||
static void PostfixCreate(ModuleWeaponGun __instance) {
|
||||
// Console.WriteLine("ModuleWeaponGun.OnAttached");
|
||||
if (!shotCooldown.ContainsKey(__instance)) {
|
||||
shotCooldown.Add(__instance, __instance.m_ShotCooldown);
|
||||
// Console.WriteLine("Patching {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWeaponGun), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleWeaponGun __instance) {
|
||||
// Console.WriteLine("ModuleWeaponGun.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_ShotCooldown: {1}", __instance.name, __instance.m_ShotCooldown);
|
||||
shotCooldown.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleWeaponGun", shotCooldown.Count);
|
||||
foreach (KeyValuePair<ModuleWeaponGun, float> keyValuePair in shotCooldown) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleWeaponGun moduleWeaponGun) {
|
||||
moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun] / Main.shootingSpeedMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleWeaponGun moduleWeaponGun) {
|
||||
if (shotCooldown.ContainsKey(moduleWeaponGun)) {
|
||||
moduleWeaponGun.m_ShotCooldown = shotCooldown[moduleWeaponGun];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,63 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class WheelPropertiesManager {
|
||||
private static Dictionary<ModuleWheels, float> torques = new Dictionary<ModuleWheels, float>();
|
||||
private static Dictionary<ModuleWheels, float> maxRpm = new Dictionary<ModuleWheels, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWheels), "OnAttached")]
|
||||
static void PostfixCreate(ModuleWheels __instance) {
|
||||
// Console.WriteLine("ModuleWheels.OnAttached");
|
||||
if (!torques.ContainsKey(__instance)) {
|
||||
torques.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxTorque);
|
||||
maxRpm.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
// Console.WriteLine("Patching {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWheels), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleWheels __instance) {
|
||||
// Console.WriteLine("ModuleWheels.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
torques.Remove(__instance);
|
||||
maxRpm.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleWheels", torques.Count);
|
||||
foreach (KeyValuePair<ModuleWheels, float> keyValuePair in torques) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleWheels moduleWheels) {
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels] * Main.wheelSpeedMultiplier.Value;
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels] * Main.wheelTorqueMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleWheels moduleWheels) {
|
||||
if (torques.ContainsKey(moduleWheels)) {
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels];
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels];
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class WheelPropertiesManager {
|
||||
private static Dictionary<ModuleWheels, float> torques = new Dictionary<ModuleWheels, float>();
|
||||
private static Dictionary<ModuleWheels, float> maxRpm = new Dictionary<ModuleWheels, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWheels), "OnAttached")]
|
||||
static void PostfixCreate(ModuleWheels __instance) {
|
||||
// Console.WriteLine("ModuleWheels.OnAttached");
|
||||
if (!torques.ContainsKey(__instance)) {
|
||||
torques.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxTorque);
|
||||
maxRpm.Add(__instance, __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
// Console.WriteLine("Patching {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleWheels), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleWheels __instance) {
|
||||
// Console.WriteLine("ModuleWheels.OnDetaching");
|
||||
// Console.WriteLine("Restoring {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_TorqueParams.torqueCurveMaxTorque: {1}; m_TorqueParams.torqueCurveMaxRpm: {2}", __instance.name,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxTorque,
|
||||
// __instance.m_TorqueParams.torqueCurveMaxRpm);
|
||||
torques.Remove(__instance);
|
||||
maxRpm.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleWheels", torques.Count);
|
||||
foreach (KeyValuePair<ModuleWheels, float> keyValuePair in torques) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleWheels moduleWheels) {
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels] * Main.wheelSpeedMultiplier.Value;
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels] * Main.wheelTorqueMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleWheels moduleWheels) {
|
||||
if (torques.ContainsKey(moduleWheels)) {
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxTorque = torques[moduleWheels];
|
||||
moduleWheels.m_TorqueParams.torqueCurveMaxRpm = maxRpm[moduleWheels];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,60 +1,60 @@
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
// TODO: Fix this, no workey
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class WirelessChargerPropertiesManager {
|
||||
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> arcFiringInterval = new Dictionary<ModuleRemoteCharger, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleRemoteCharger), "OnAttached")]
|
||||
static void PostfixCreate(ModuleRemoteCharger __instance) {
|
||||
// Console.WriteLine("ModuleRemoteCharger.OnAttached");
|
||||
if (!radius.ContainsKey(__instance)) {
|
||||
radius.Add(__instance, __instance.m_ChargingRadius);
|
||||
transferPerArc.Add(__instance, __instance.m_PowerTransferPerArc);
|
||||
arcFiringInterval.Add(__instance, __instance.m_ArcFiringInterval);
|
||||
// Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleRemoteCharger), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleRemoteCharger __instance) {
|
||||
// Console.WriteLine("ModuleRemoteCharger.OnAttached");
|
||||
// Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
radius.Remove(__instance);
|
||||
transferPerArc.Remove(__instance);
|
||||
arcFiringInterval.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleRemoteCharger", radius.Count);
|
||||
foreach (KeyValuePair<ModuleRemoteCharger, float> keyValuePair in radius) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleRemoteCharger moduleRemoteCharger) {
|
||||
moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger] * Main.wirelessChargingRadiusMultiplier.Value;
|
||||
moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger] * Main.wirelessChargingPowerPerArcMultiplier.Value;
|
||||
moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger] * Main.wirelessChargingArcFiringIntervalMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleRemoteCharger moduleRemoteCharger) {
|
||||
if (radius.ContainsKey(moduleRemoteCharger)) {
|
||||
moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger];
|
||||
moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger];
|
||||
moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger];
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using HarmonyLib;
|
||||
|
||||
// TODO: Fix this, no workey
|
||||
namespace TerraTech {
|
||||
[HarmonyPatch]
|
||||
public class WirelessChargerPropertiesManager {
|
||||
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> arcFiringInterval = new Dictionary<ModuleRemoteCharger, float>();
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleRemoteCharger), "OnAttached")]
|
||||
static void PostfixCreate(ModuleRemoteCharger __instance) {
|
||||
// Console.WriteLine("ModuleRemoteCharger.OnAttached");
|
||||
if (!radius.ContainsKey(__instance)) {
|
||||
radius.Add(__instance, __instance.m_ChargingRadius);
|
||||
transferPerArc.Add(__instance, __instance.m_PowerTransferPerArc);
|
||||
arcFiringInterval.Add(__instance, __instance.m_ArcFiringInterval);
|
||||
// Console.WriteLine("Patching {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoPatchSingle(__instance);
|
||||
// Console.WriteLine("Patched {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ModuleRemoteCharger), "OnDetaching")]
|
||||
static void PostfixDestroy(ModuleRemoteCharger __instance) {
|
||||
// Console.WriteLine("ModuleRemoteCharger.OnAttached");
|
||||
// Console.WriteLine("Restoring {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
DoRestoreSingle(__instance);
|
||||
// Console.WriteLine("Restored {0}; m_RefillRate: {1}; m_Capacity: {2}", __instance.name, __instance.m_RefillRate, __instance.m_Capacity);
|
||||
radius.Remove(__instance);
|
||||
transferPerArc.Remove(__instance);
|
||||
arcFiringInterval.Remove(__instance);
|
||||
}
|
||||
|
||||
public static void DoPatch() {
|
||||
// Console.WriteLine("Modifying {0} ModuleRemoteCharger", radius.Count);
|
||||
foreach (KeyValuePair<ModuleRemoteCharger, float> keyValuePair in radius) {
|
||||
DoRestoreSingle(keyValuePair.Key);
|
||||
DoPatchSingle(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
|
||||
static void DoPatchSingle(ModuleRemoteCharger moduleRemoteCharger) {
|
||||
moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger] * Main.wirelessChargingRadiusMultiplier.Value;
|
||||
moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger] * Main.wirelessChargingPowerPerArcMultiplier.Value;
|
||||
moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger] * Main.wirelessChargingArcFiringIntervalMultiplier.Value;
|
||||
}
|
||||
|
||||
static void DoRestoreSingle(ModuleRemoteCharger moduleRemoteCharger) {
|
||||
if (radius.ContainsKey(moduleRemoteCharger)) {
|
||||
moduleRemoteCharger.m_ChargingRadius = radius[moduleRemoteCharger];
|
||||
moduleRemoteCharger.m_PowerTransferPerArc = radius[moduleRemoteCharger];
|
||||
moduleRemoteCharger.m_ArcFiringInterval = radius[moduleRemoteCharger];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -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.pdb
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\0Harmony.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\Assembly-CSharp.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\BepInEx.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\UnityEngine.CoreModule.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\UnityEngine.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.csprojResolveAssemblyReference.cache
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.pdb
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\ConfigurationManager.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.csprojResolveAssemblyReference.cache
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\TerraTech.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\TerraTech.pdb
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\0Harmony.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\Assembly-CSharp.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\BepInEx.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\UnityEngine.CoreModule.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\UnityEngine.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.csprojResolveAssemblyReference.cache
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.dll
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.pdb
|
||||
C:\Users\Administrator\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\bin\Debug\ConfigurationManager.dll
|
||||
C:\Users\Administrator\Seafile\Jetbrains\RiderProjects\Bepinex\Projects\TerraTech\TerraTech\obj\Debug\TerraTech.csprojResolveAssemblyReference.cache
|
||||
|
@@ -1,16 +1,16 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeedShop", "WeedShop\WeedShop.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeedShop", "WeedShop\WeedShop.csproj", "{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@@ -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">
|
||||
<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_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_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>
|
||||
<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_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_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_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>
|
@@ -1,50 +1,50 @@
|
||||
using System.Linq;
|
||||
using almost;
|
||||
using almost.WF;
|
||||
using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using com.ootii.Messages;
|
||||
using HarmonyLib;
|
||||
using HarmonyLib.Tools;
|
||||
using MeshCombineStudio;
|
||||
|
||||
namespace WeedShop {
|
||||
[BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
public class Main : BaseUnityPlugin {
|
||||
private const string pluginGuid = "CykaMod";
|
||||
private const string pluginName = "CykaMod";
|
||||
private const string pluginVersion = "1.0.0";
|
||||
|
||||
public static ConfigEntry<float> moneyMultiplier;
|
||||
public static ConfigEntry<float> weedQuantityMultiplier;
|
||||
public static ConfigEntry<float> weedQualityMultiplier;
|
||||
|
||||
public void Awake() {
|
||||
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)));
|
||||
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");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
Harmony harmony = new Harmony(pluginGuid);
|
||||
harmony.PatchAll();
|
||||
var originalMethods = harmony.GetPatchedMethods();
|
||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(WeedFactory), "OnMakeMoney")]
|
||||
private void OnMakeMoney(ref IMessage message) {
|
||||
Console.Log("OnMakeMoney " + message.Data);
|
||||
message.Data = (long)message.Data * moneyMultiplier.Value;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ShopInventory), "AddWeed")]
|
||||
public virtual void AddWeed(BI item, ref float rawQuality, ref int quantity) {
|
||||
Console.Log("AddWeed " + item + " " + rawQuality + " " + quantity);
|
||||
quantity = (int)(quantity * weedQuantityMultiplier.Value);
|
||||
rawQuality *= weedQualityMultiplier.Value;
|
||||
}
|
||||
}
|
||||
using System.Linq;
|
||||
using almost;
|
||||
using almost.WF;
|
||||
using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using com.ootii.Messages;
|
||||
using HarmonyLib;
|
||||
using HarmonyLib.Tools;
|
||||
using MeshCombineStudio;
|
||||
|
||||
namespace WeedShop {
|
||||
[BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||
public class Main : BaseUnityPlugin {
|
||||
private const string pluginGuid = "CykaMod";
|
||||
private const string pluginName = "CykaMod";
|
||||
private const string pluginVersion = "1.0.0";
|
||||
|
||||
public static ConfigEntry<float> moneyMultiplier;
|
||||
public static ConfigEntry<float> weedQuantityMultiplier;
|
||||
public static ConfigEntry<float> weedQualityMultiplier;
|
||||
|
||||
public void Awake() {
|
||||
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)));
|
||||
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");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
Harmony harmony = new Harmony(pluginGuid);
|
||||
harmony.PatchAll();
|
||||
var originalMethods = harmony.GetPatchedMethods();
|
||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(WeedFactory), "OnMakeMoney")]
|
||||
private void OnMakeMoney(ref IMessage message) {
|
||||
Console.Log("OnMakeMoney " + message.Data);
|
||||
message.Data = (long)message.Data * moneyMultiplier.Value;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ShopInventory), "AddWeed")]
|
||||
public virtual void AddWeed(BI item, ref float rawQuality, ref int quantity) {
|
||||
Console.Log("AddWeed " + item + " " + rawQuality + " " + quantity);
|
||||
quantity = (int)(quantity * weedQuantityMultiplier.Value);
|
||||
rawQuality *= weedQualityMultiplier.Value;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,35 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("TerraTech")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("TerraTech")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("TerraTech")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("TerraTech")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
@@ -1,69 +1,69 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>TerraTech</RootNamespace>
|
||||
<AssemblyName>TerraTech</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>..\libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>..\libs\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>..\libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ootii">
|
||||
<HintPath>..\libs\ootii.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>..\libs\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EE5EFB7F-A4DC-44F0-967B-F71ECA2D46AE}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>TerraTech</RootNamespace>
|
||||
<AssemblyName>TerraTech</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>..\libs\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\libs\Assembly-CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BepInEx">
|
||||
<HintPath>..\libs\BepInEx.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ConfigurationManager">
|
||||
<HintPath>..\libs\ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ootii">
|
||||
<HintPath>..\libs\ootii.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>..\libs\UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\libs\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- 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.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
Reference in New Issue
Block a user