Begin work on auto pricer

This commit is contained in:
2024-08-23 09:19:37 +02:00
parent 762a1707af
commit 72c9b4baa3
2 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using HarmonyLib;
namespace DavesPhatStore {
[HarmonyPatch]
public class AutoPricer {
[HarmonyTranspiler]
[HarmonyPatch(typeof(PlayerNetwork), "Update")]
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) {
var codes = new List<CodeInstruction>(instructions);
for (int i = 0; i < codes.Count; i++) {
var codeInstruction = codes[i];
if (codeInstruction.operand != null) {
Console.WriteLine(
$"'{codeInstruction.opcode}': '{codeInstruction.operand}'/'{codeInstruction.operand.GetType()}'");
}
}
return codes.AsEnumerable();
}
}
}

View File

@@ -35,6 +35,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AutoPricer.cs" />
<Compile Include="Class1.cs"/> <Compile Include="Class1.cs"/>
<Compile Include="EmployeeBuffs.cs" /> <Compile Include="EmployeeBuffs.cs" />
<Compile Include="PlayerFaking.cs" /> <Compile Include="PlayerFaking.cs" />