Upload from upload_mods.ps1

This commit is contained in:
Nathaniel Cosford
2025-06-04 16:13:32 +09:30
commit 7345f42201
470 changed files with 51966 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
using HarmonyLib;
using KFCommonUtilityLib.Scripts.Attributes;
using System.Collections.Generic;
using System.Reflection.Emit;
using UnityEngine;
[TypeTarget(typeof(ItemAction))]
public class ActionModuleTranspilerTest
{
[HarmonyPatch(typeof(ItemActionAttack), nameof(ItemAction.ExecuteAction)), MethodTargetTranspiler]
private static IEnumerable<CodeInstruction> Transpiler_InvalidTest(IEnumerable<CodeInstruction> instructions)
{
yield return new CodeInstruction(OpCodes.Ldstr, "Ranged!");
yield return CodeInstruction.Call(typeof(ActionModuleTranspilerTest), nameof(ActionModuleTranspilerTest.CallSomething));
foreach (var ins in instructions)
{
yield return ins;
}
}
[HarmonyPatch(typeof(ItemActionRanged), nameof(ItemAction.ExecuteAction)), MethodTargetTranspiler]
private static IEnumerable<CodeInstruction> Transpiler_RangedTest(IEnumerable<CodeInstruction> instructions)
{
yield return new CodeInstruction(OpCodes.Ldstr, "Ranged!");
yield return CodeInstruction.Call(typeof(ActionModuleTranspilerTest), nameof(ActionModuleTranspilerTest.CallSomething));
foreach (var ins in instructions)
{
yield return ins;
}
}
[HarmonyPatch(typeof(ItemActionCatapult), nameof(ItemAction.ExecuteAction)), MethodTargetTranspiler]
private static IEnumerable<CodeInstruction> Transpiler_CatapultTest(IEnumerable<CodeInstruction> instructions)
{
yield return new CodeInstruction(OpCodes.Ldstr, "Catapult!");
yield return CodeInstruction.Call(typeof(ActionModuleTranspilerTest), nameof(ActionModuleTranspilerTest.CallSomething));
foreach (var ins in instructions)
{
yield return ins;
}
}
private static void CallSomething(string str)
{
Log.Out($"Call something: {str}\n{StackTraceUtility.ExtractStackTrace()}");
}
}