Decompiled source of Random traps size v1.0.0

huluobotrap.dll

Decompiled 6 months ago
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Unity.Netcode;
using UnityEngine;
using huluoboHazard;
using huluoboLandmine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace huluobohuluobotrap
{
	[BepInPlugin("hlb.huluobotrap", "huluobohuluobotrap", "1.0.0")]
	public class HuluoboClass : BaseUnityPlugin
	{
		private const string GUID = "hlb.huluobotrap";

		private const string Name = "huluobohuluobotrap";

		private const string Version = "1.0.0";

		private Harmony harmony;

		private void Awake()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			harmony = new Harmony("hlb.huluobotrap");
			harmony.PatchAll(typeof(HuluoboClass));
			harmony.PatchAll(typeof(Landmineran));
			harmony.PatchAll(typeof(Mine));
			harmony.PatchAll(typeof(Hazard));
		}
	}
}
namespace huluoboHazard
{
	[HarmonyPatch(typeof(SpikeRoofTrap))]
	internal class Hazard
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void Hazardx(ref SpikeRoofTrap __instance)
		{
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager;
			if (networkManager.IsServer)
			{
				float num = Random.Range(0.5f, 2.5f);
				float num2 = Random.Range(0.5f, 2.5f);
				GameObject gameObject = ((Component)((Component)__instance).transform.parent.parent.parent).gameObject;
				gameObject.transform.localScale = new Vector3(num, 1f, num2);
			}
		}
	}
}
namespace huluoboLandmine
{
	[HarmonyPatch(typeof(Landmine))]
	internal class Landmineran
	{
		[HarmonyPatch("Detonate")]
		[HarmonyPostfix]
		public static void IncreaseAudioVolume(Landmine __instance)
		{
			((MonoBehaviour)__instance).StartCoroutine(DelayedActions(__instance));
		}

		private static IEnumerator DelayedActions(Landmine __instance)
		{
			yield return (object)new WaitForSeconds(0.5f);
			float kill = Random.Range(5.5f, 10f);
			float nolethal = kill + 5.5f;
			int nolethaldamage = Random.Range(30, 70);
			Landmine.SpawnExplosion(((Component)__instance).transform.position + Vector3.up, true, kill, nolethal, nolethaldamage, 0f, (GameObject)null);
		}
	}
	[HarmonyPatch(typeof(Landmine))]
	internal class Mine
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void Landminemx(ref Landmine __instance)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)__instance).NetworkManager;
			if (networkManager.IsServer)
			{
				float num = Random.Range(0.15f, 1.2f);
				GameObject gameObject = ((Component)((Component)__instance).transform.parent).gameObject;
				gameObject.transform.localScale = new Vector3(num, num, num);
			}
		}
	}
}