Add bepinex
This commit is contained in:
BIN
BepInEx_win_x64_5.4.23.2.zip
Normal file
BIN
BepInEx_win_x64_5.4.23.2.zip
Normal file
Binary file not shown.
BIN
BepInEx_win_x86_5.4.23.2.zip
Normal file
BIN
BepInEx_win_x86_5.4.23.2.zip
Normal file
Binary file not shown.
@@ -0,0 +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>DustlandDelivery</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,63 +0,0 @@
|
|||||||
<?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>{06AA059A-C853-42AD-BBF8-122CFB2EEA29}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>CykaMod</RootNamespace>
|
|
||||||
<AssemblyName>CykaMod</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>
|
|
||||||
<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="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,274 +1,274 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection.Emit;
|
using System.Reflection.Emit;
|
||||||
using BepInEx;
|
using BepInEx;
|
||||||
using BepInEx.Configuration;
|
using BepInEx.Configuration;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using HarmonyLib.Tools;
|
using HarmonyLib.Tools;
|
||||||
|
|
||||||
namespace CykaMod {
|
namespace CykaMod {
|
||||||
[BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
[BepInPlugin(pluginGuid, pluginName, pluginVersion)]
|
||||||
public class Main : BaseUnityPlugin {
|
public class Main : BaseUnityPlugin {
|
||||||
private const string pluginGuid = "CykaMod";
|
private const string pluginGuid = "CykaMod";
|
||||||
private const string pluginName = "CykaMod";
|
private const string pluginName = "CykaMod";
|
||||||
private const string pluginVersion = "1.0.0";
|
private const string pluginVersion = "1.0.0";
|
||||||
|
|
||||||
public static ConfigEntry<float> skillCap;
|
public static ConfigEntry<float> skillCap;
|
||||||
public static ConfigEntry<float> workSpeed;
|
public static ConfigEntry<float> workSpeed;
|
||||||
public static ConfigEntry<float> workResult;
|
public static ConfigEntry<float> workResult;
|
||||||
public static ConfigEntry<bool> alwaysCritical;
|
public static ConfigEntry<bool> alwaysCritical;
|
||||||
public static ConfigEntry<float> gameSpeed;
|
public static ConfigEntry<float> gameSpeed;
|
||||||
public static ConfigEntry<int> fans;
|
public static ConfigEntry<int> fans;
|
||||||
public static ConfigEntry<long> money;
|
public static ConfigEntry<long> money;
|
||||||
|
|
||||||
//
|
//
|
||||||
// private void Awake()
|
// private void Awake()
|
||||||
// {
|
// {
|
||||||
// configGreeting = Config.Bind("General", // The section under which the option is shown
|
// configGreeting = Config.Bind("General", // The section under which the option is shown
|
||||||
// "GreetingText", // The key of the configuration option in the configuration file
|
// "GreetingText", // The key of the configuration option in the configuration file
|
||||||
// "Hello, world!", // The default value
|
// "Hello, world!", // The default value
|
||||||
// "A greeting text to show when the game is launched"); // Description of the option to show in the config file
|
// "A greeting text to show when the game is launched"); // Description of the option to show in the config file
|
||||||
//
|
//
|
||||||
|
|
||||||
public void Awake() {
|
public void Awake() {
|
||||||
skillCap = Config.Bind("General", "Skill Cap", 100f);
|
skillCap = Config.Bind("General", "Skill Cap", 100f);
|
||||||
workSpeed = Config.Bind("General", "Work Speed Multiplier", 4f);
|
workSpeed = Config.Bind("General", "Work Speed Multiplier", 4f);
|
||||||
workResult = Config.Bind("General", "Work Result Multiplier", 4f);
|
workResult = Config.Bind("General", "Work Result Multiplier", 4f);
|
||||||
alwaysCritical = Config.Bind("General", "Work Always Critical", false);
|
alwaysCritical = Config.Bind("General", "Work Always Critical", false);
|
||||||
gameSpeed = Config.Bind("General", "Game Speed Multiplier", 3f);
|
gameSpeed = Config.Bind("General", "Game Speed Multiplier", 3f);
|
||||||
fans = Config.Bind("General", "Fans Multiplier", 2);
|
fans = Config.Bind("General", "Fans Multiplier", 2);
|
||||||
money = Config.Bind("General", "Money Multiplier", 2L);
|
money = Config.Bind("General", "Money Multiplier", 2L);
|
||||||
|
|
||||||
Logger.LogInfo("Cyka mod loaded");
|
Logger.LogInfo("Cyka mod loaded");
|
||||||
HarmonyFileLog.Enabled = true;
|
HarmonyFileLog.Enabled = true;
|
||||||
Harmony harmony = new Harmony(pluginGuid);
|
Harmony harmony = new Harmony(pluginGuid);
|
||||||
harmony.PatchAll();
|
harmony.PatchAll();
|
||||||
var originalMethods = harmony.GetPatchedMethods();
|
var originalMethods = harmony.GetPatchedMethods();
|
||||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsMatch(List<CodeInstruction> codes, int index, List<CodeInstruction> matcher) {
|
public static bool IsMatch(List<CodeInstruction> codes, int index, List<CodeInstruction> matcher) {
|
||||||
for (var i = 0; i < matcher.Count; i++) {
|
for (var i = 0; i < matcher.Count; i++) {
|
||||||
if (codes[index + i].opcode != matcher[i].opcode) {
|
if (codes[index + i].opcode != matcher[i].opcode) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void InsertAt(List<CodeInstruction> codes, int index, List<CodeInstruction> toInsert) {
|
public static void InsertAt(List<CodeInstruction> codes, int index, List<CodeInstruction> toInsert) {
|
||||||
for (var i = 0; i < toInsert.Count; i++) {
|
for (var i = 0; i < toInsert.Count; i++) {
|
||||||
codes.Insert(index + i, toInsert[i]);
|
codes.Insert(index + i, toInsert[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(characterScript), "GetSkillCap")]
|
[HarmonyPatch(typeof(characterScript), "GetSkillCap")]
|
||||||
public class SkillCapPatch {
|
public class SkillCapPatch {
|
||||||
static void Postfix(ref float __result) {
|
static void Postfix(ref float __result) {
|
||||||
// Console.WriteLine("GetSkillCap Postfix! Result is " + __result);
|
// Console.WriteLine("GetSkillCap Postfix! Result is " + __result);
|
||||||
__result = Main.skillCap.Value;
|
__result = Main.skillCap.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(characterScript), "GetSkillCap_Skill")]
|
[HarmonyPatch(typeof(characterScript), "GetSkillCap_Skill")]
|
||||||
public class SkillCapSkillPatch {
|
public class SkillCapSkillPatch {
|
||||||
static void Postfix(ref float __result) {
|
static void Postfix(ref float __result) {
|
||||||
// Console.WriteLine("GetSkillCap_Skill Postfix! Result is " + __result);
|
// Console.WriteLine("GetSkillCap_Skill Postfix! Result is " + __result);
|
||||||
__result = Main.skillCap.Value;
|
__result = Main.skillCap.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(characterScript), "GetWorkSpeed")]
|
[HarmonyPatch(typeof(characterScript), "GetWorkSpeed")]
|
||||||
public class GetWorkSpeedPatch {
|
public class GetWorkSpeedPatch {
|
||||||
static void Postfix(ref float __result) {
|
static void Postfix(ref float __result) {
|
||||||
// Console.WriteLine("GetWorkSpeed Postfix! Result is " + __result);
|
// Console.WriteLine("GetWorkSpeed Postfix! Result is " + __result);
|
||||||
__result *= Main.workSpeed.Value;
|
__result *= Main.workSpeed.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(characterScript), "GetWorkResult")]
|
[HarmonyPatch(typeof(characterScript), "GetWorkResult")]
|
||||||
public class GetWorkResultPatch {
|
public class GetWorkResultPatch {
|
||||||
static void Prefix(ref float f) {
|
static void Prefix(ref float f) {
|
||||||
// Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
// Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||||
f *= Main.workResult.Value;
|
f *= Main.workResult.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(characterScript), "GetCritic")]
|
[HarmonyPatch(typeof(characterScript), "GetCritic")]
|
||||||
public class GetCriticPatch {
|
public class GetCriticPatch {
|
||||||
static void Postfix(ref bool __result) {
|
static void Postfix(ref bool __result) {
|
||||||
// Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
// Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||||
if (Main.alwaysCritical.Value) {
|
if (Main.alwaysCritical.Value) {
|
||||||
__result = true;
|
__result = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(mainScript), "SetGameSpeed")]
|
[HarmonyPatch(typeof(mainScript), "SetGameSpeed")]
|
||||||
public class GameSpeedPatch {
|
public class GameSpeedPatch {
|
||||||
static void Prefix(ref float f) {
|
static void Prefix(ref float f) {
|
||||||
// Console.WriteLine("SetGameSpeed Prefix! Argument is " + f);
|
// Console.WriteLine("SetGameSpeed Prefix! Argument is " + f);
|
||||||
if (f > 1) {
|
if (f > 1) {
|
||||||
f *= Main.gameSpeed.Value;
|
f *= Main.gameSpeed.Value;
|
||||||
// Console.WriteLine("Argument modified to " + f);
|
// Console.WriteLine("Argument modified to " + f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(characterScript), "Learn")]
|
[HarmonyPatch(typeof(characterScript), "Learn")]
|
||||||
public static class LearnManyPatch {
|
public static class LearnManyPatch {
|
||||||
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||||
var codes = new List<CodeInstruction>(instructions);
|
var codes = new List<CodeInstruction>(instructions);
|
||||||
|
|
||||||
for (var i = 0; i < 5; i++) {
|
for (var i = 0; i < 5; i++) {
|
||||||
if (codes[i].opcode == OpCodes.Ldc_R4) {
|
if (codes[i].opcode == OpCodes.Ldc_R4) {
|
||||||
Console.WriteLine("Changing " + codes[i]);
|
Console.WriteLine("Changing " + codes[i]);
|
||||||
codes[i].operand = (float)codes[i].operand * 64;
|
codes[i].operand = (float)codes[i].operand * 64;
|
||||||
Console.WriteLine("Changed " + codes[i]);
|
Console.WriteLine("Changed " + codes[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return codes.AsEnumerable();
|
return codes.AsEnumerable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(arbeitsmarkt), "ArbeitsmarktUpdaten")]
|
[HarmonyPatch(typeof(arbeitsmarkt), "ArbeitsmarktUpdaten")]
|
||||||
public static class ManyEmployeesPatch {
|
public static class ManyEmployeesPatch {
|
||||||
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||||
var codes = new List<CodeInstruction>(instructions);
|
var codes = new List<CodeInstruction>(instructions);
|
||||||
|
|
||||||
for (var i = codes.Count - 1; i > 0; i--) {
|
for (var i = codes.Count - 1; i > 0; i--) {
|
||||||
if (codes[i].opcode == OpCodes.Ldc_I4_3) {
|
if (codes[i].opcode == OpCodes.Ldc_I4_3) {
|
||||||
Console.WriteLine("Changing " + codes[i]);
|
Console.WriteLine("Changing " + codes[i]);
|
||||||
codes[i] = new CodeInstruction(OpCodes.Ldc_I4, 64);
|
codes[i] = new CodeInstruction(OpCodes.Ldc_I4, 64);
|
||||||
Console.WriteLine("Changed " + codes[i]);
|
Console.WriteLine("Changed " + codes[i]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return codes.AsEnumerable();
|
return codes.AsEnumerable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// [HarmonyPatch(typeof(AILerp), "MovementUpdate")]
|
// [HarmonyPatch(typeof(AILerp), "MovementUpdate")]
|
||||||
public class MovementSpeedPatch {
|
public class MovementSpeedPatch {
|
||||||
static void Prefix(ref float deltaTime) {
|
static void Prefix(ref float deltaTime) {
|
||||||
Console.WriteLine("MovementUpdate Prefix! deltaTime is " + deltaTime);
|
Console.WriteLine("MovementUpdate Prefix! deltaTime is " + deltaTime);
|
||||||
deltaTime *= 16f;
|
deltaTime *= 16f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// [HarmonyPatch(typeof(movementScript), "Move")]
|
// [HarmonyPatch(typeof(movementScript), "Move")]
|
||||||
public static class EmployeeMovementSpeedPatch {
|
public static class EmployeeMovementSpeedPatch {
|
||||||
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||||
var codes = new List<CodeInstruction>(instructions);
|
var codes = new List<CodeInstruction>(instructions);
|
||||||
|
|
||||||
List<CodeInstruction> matcher = new List<CodeInstruction>();
|
List<CodeInstruction> matcher = new List<CodeInstruction>();
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Mul, null));
|
matcher.Add(new CodeInstruction(OpCodes.Mul, null));
|
||||||
|
|
||||||
List<CodeInstruction> patch = new List<CodeInstruction>();
|
List<CodeInstruction> patch = new List<CodeInstruction>();
|
||||||
patch.Add(new CodeInstruction(OpCodes.Ldc_R4, 8));
|
patch.Add(new CodeInstruction(OpCodes.Ldc_R4, 8));
|
||||||
patch.Add(new CodeInstruction(OpCodes.Mul, null));
|
patch.Add(new CodeInstruction(OpCodes.Mul, null));
|
||||||
|
|
||||||
for (var i = codes.Count - 1; i > 0; i--) {
|
for (var i = codes.Count - 1; i > 0; i--) {
|
||||||
if (Main.IsMatch(codes, i, matcher)) {
|
if (Main.IsMatch(codes, i, matcher)) {
|
||||||
Main.InsertAt(codes, i + 5, patch);
|
Main.InsertAt(codes, i + 5, patch);
|
||||||
Console.WriteLine("Movement speed patched");
|
Console.WriteLine("Movement speed patched");
|
||||||
for (var j = 0; j < 15; j++) {
|
for (var j = 0; j < 15; j++) {
|
||||||
Console.WriteLine(codes[i + j]);
|
Console.WriteLine(codes[i + j]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Console.WriteLine("Return");
|
Console.WriteLine("Return");
|
||||||
return codes.AsEnumerable();
|
return codes.AsEnumerable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(mainScript), "WochenUpdates")]
|
[HarmonyPatch(typeof(mainScript), "WochenUpdates")]
|
||||||
public static class ContractWorkAmount {
|
public static class ContractWorkAmount {
|
||||||
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||||
var codes = new List<CodeInstruction>(instructions);
|
var codes = new List<CodeInstruction>(instructions);
|
||||||
int methodIndex = -1;
|
int methodIndex = -1;
|
||||||
List<CodeInstruction> pattern = new List<CodeInstruction>();
|
List<CodeInstruction> pattern = new List<CodeInstruction>();
|
||||||
|
|
||||||
List<CodeInstruction> matcher = new List<CodeInstruction>();
|
List<CodeInstruction> matcher = new List<CodeInstruction>();
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Ldc_I4_0, null));
|
matcher.Add(new CodeInstruction(OpCodes.Ldc_I4_0, null));
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Callvirt, null));
|
matcher.Add(new CodeInstruction(OpCodes.Callvirt, null));
|
||||||
|
|
||||||
for (var i = 0; i < codes.Count; i++) {
|
for (var i = 0; i < codes.Count; i++) {
|
||||||
if (codes[i].operand != null) {
|
if (codes[i].operand != null) {
|
||||||
if (codes[i].operand.ToString().Contains("UpdateContractWork")) {
|
if (codes[i].operand.ToString().Contains("UpdateContractWork")) {
|
||||||
methodIndex = i;
|
methodIndex = i;
|
||||||
pattern.Add(codes[i - 3]);
|
pattern.Add(codes[i - 3]);
|
||||||
pattern.Add(codes[i - 2]);
|
pattern.Add(codes[i - 2]);
|
||||||
pattern.Add(codes[i - 1]);
|
pattern.Add(codes[i - 1]);
|
||||||
pattern.Add(codes[i]);
|
pattern.Add(codes[i]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pattern[2].opcode = OpCodes.Ldc_I4_1;
|
pattern[2].opcode = OpCodes.Ldc_I4_1;
|
||||||
|
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
for (int j = 0; j < pattern.Count; j++) {
|
for (int j = 0; j < pattern.Count; j++) {
|
||||||
codes.Insert(methodIndex + i + j, pattern[j]);
|
codes.Insert(methodIndex + i + j, pattern[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return codes.AsEnumerable();
|
return codes.AsEnumerable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(platformScript), "SellPlayer")]
|
[HarmonyPatch(typeof(platformScript), "SellPlayer")]
|
||||||
public static class ConsoleProductionReductionPatch {
|
public static class ConsoleProductionReductionPatch {
|
||||||
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
|
||||||
var codes = new List<CodeInstruction>(instructions);
|
var codes = new List<CodeInstruction>(instructions);
|
||||||
|
|
||||||
List<CodeInstruction> matcher = new List<CodeInstruction>();
|
List<CodeInstruction> matcher = new List<CodeInstruction>();
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
matcher.Add(new CodeInstruction(OpCodes.Ldarg_0, null));
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
matcher.Add(new CodeInstruction(OpCodes.Ldfld, null));
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, null));
|
matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, null));
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, null));
|
matcher.Add(new CodeInstruction(OpCodes.Ldc_R4, null));
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Call, null));
|
matcher.Add(new CodeInstruction(OpCodes.Call, null));
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Add, null));
|
matcher.Add(new CodeInstruction(OpCodes.Add, null));
|
||||||
matcher.Add(new CodeInstruction(OpCodes.Stfld, null));
|
matcher.Add(new CodeInstruction(OpCodes.Stfld, null));
|
||||||
|
|
||||||
for (var i = 0; i < codes.Count; i++) {
|
for (var i = 0; i < codes.Count; i++) {
|
||||||
if (Main.IsMatch(codes, i, matcher)) {
|
if (Main.IsMatch(codes, i, matcher)) {
|
||||||
codes[i + 3].operand = (float)codes[i + 3].operand * 8f;
|
codes[i + 3].operand = (float)codes[i + 3].operand * 8f;
|
||||||
codes[i + 4].operand = (float)codes[i + 4].operand * 8f;
|
codes[i + 4].operand = (float)codes[i + 4].operand * 8f;
|
||||||
Console.WriteLine("ConsoleProductionReductionPatch patched");
|
Console.WriteLine("ConsoleProductionReductionPatch patched");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return codes.AsEnumerable();
|
return codes.AsEnumerable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(mainScript), "AddFans")]
|
[HarmonyPatch(typeof(mainScript), "AddFans")]
|
||||||
public static class AddFansPatch {
|
public static class AddFansPatch {
|
||||||
static void Prefix(ref int i) {
|
static void Prefix(ref int i) {
|
||||||
// Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
// Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||||
i *= Main.fans.Value;
|
i *= Main.fans.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(mainScript), "Earn")]
|
[HarmonyPatch(typeof(mainScript), "Earn")]
|
||||||
public static class AddMoneyPatch {
|
public static class AddMoneyPatch {
|
||||||
static void Prefix(ref long amount) {
|
static void Prefix(ref long amount) {
|
||||||
// Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
// Console.WriteLine("GetWorkResult Postfix! f is " + f);
|
||||||
amount *= Main.money.Value;
|
amount *= Main.money.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -0,0 +1,66 @@
|
|||||||
|
<?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>MadGamesTycoon2</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>
|
||||||
|
<Compile Include="Class1.cs" />
|
||||||
|
<Compile Include="Patches.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Transpiler.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="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.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
// associated with an assembly.
|
// associated with an assembly.
|
||||||
[assembly: AssemblyTitle("CykaMod")]
|
[assembly: AssemblyTitle("CykaMod")]
|
||||||
[assembly: AssemblyDescription("")]
|
[assembly: AssemblyDescription("")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("CykaMod")]
|
[assembly: AssemblyProduct("CykaMod")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
// to COM components. If you need to access a type in this assembly from
|
// to COM components. If you need to access a type in this assembly from
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
[assembly: Guid("06AA059A-C853-42AD-BBF8-122CFB2EEA29")]
|
[assembly: Guid("06AA059A-C853-42AD-BBF8-122CFB2EEA29")]
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
// Version information for an assembly consists of the following four values:
|
||||||
//
|
//
|
||||||
// Major Version
|
// Major Version
|
||||||
// Minor Version
|
// Minor Version
|
||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user