Decompiled source of LethalLethalizer v2.0.3

LethalLethalizer.dll

Decompiled 8 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLethalizer.Patches;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: AssemblyTitle("GrannysCompanyRevised")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GrannysCompanyRevised")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]
[assembly: TargetFramework(".NETCore,Version=v5.0", FrameworkDisplayName = ".NET for Windows Universal")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace LethalLethalizer
{
	[BepInPlugin("Lethallethalizer", "LethalLethalizer", "2.0.3.0")]
	public class Base : BaseUnityPlugin
	{
		private const string modGUID = "Lethallethalizer";

		private const string modName = "LethalLethalizer";

		private const string modVersion = "2.0.3.0";

		private readonly Harmony harmony = new Harmony("Lethallethalizer");

		internal static Base Instance;

		internal static ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Lethallethalizer");
			mls.LogInfo((object)"Successfully lethalized");
			harmony.PatchAll(typeof(Base));
			harmony.PatchAll(typeof(RoundManagerPatch));
			harmony.PatchAll(typeof(MobSomethingPatch));
			harmony.PatchAll(typeof(CrawlerPatch));
			harmony.PatchAll(typeof(HoarderBugPatch));
			harmony.PatchAll(typeof(FlowermanPatch));
			harmony.PatchAll(typeof(SandSpiderPatch));
			harmony.PatchAll(typeof(PufferPatch));
			harmony.PatchAll(typeof(BaboonBirdPatch));
			harmony.PatchAll(typeof(BlobPatch));
			harmony.PatchAll(typeof(PlayerControllerBPatche));
			harmony.PatchAll(typeof(MouthDogPatch));
			harmony.PatchAll(typeof(HangarShipDoorPatch));
			harmony.PatchAll(typeof(CentipedePatch));
			harmony.PatchAll(typeof(Turretwow));
			harmony.PatchAll(typeof(ForestGiantPatch));
		}
	}
}
namespace LethalLethalizer.Patches
{
	[HarmonyPatch(typeof(ForestGiantAI))]
	internal class ForestGiantPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Postfix(ref float ___velX, ref float ___velZ, ref float ___scrutiny)
		{
			___velX = 36f;
			___velZ = 36f;
			___scrutiny = 20f;
		}
	}
	[HarmonyPatch(typeof(Turret))]
	internal class Turretwow
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Postfix(ref float ___rotationRange)
		{
			___rotationRange = 360f;
		}
	}
	[HarmonyPatch(typeof(MouthDogAI))]
	internal class MouthDogPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Postfix(ref float ___noiseApproximation)
		{
			___noiseApproximation = 100f;
		}
	}
	[HarmonyPatch(typeof(BaboonBirdAI))]
	internal class BaboonBirdPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Postfix(ref float ___velX, ref float ___velZ, ref float ___visionDistance)
		{
			___velX = 36f;
			___velZ = 36f;
			___visionDistance = 120f;
		}
	}
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatche
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Postfix(ref float ___targetFOV, ref float ___grabDistance, ref float ___climbSpeed)
		{
			___targetFOV = 50f;
			___grabDistance = 3f;
			___climbSpeed = 2.25f;
		}
	}
	[HarmonyPatch(typeof(BlobAI))]
	internal class BlobPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Postfix(ref float ___slimeRange)
		{
			___slimeRange = 36f;
		}
	}
	[HarmonyPatch(typeof(CentipedeAI))]
	internal class CentipedePatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Postfix(ref float ___damagePlayerInterval)
		{
			___damagePlayerInterval = 10f;
		}
	}
	[HarmonyPatch(typeof(PufferAI))]
	internal class PufferPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Postfix(ref float ___velX, ref float ___velZ)
		{
			___velX = 100f;
			___velZ = 100f;
		}
	}
	[HarmonyPatch(typeof(HangarShipDoor))]
	internal class HangarShipDoorPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Postfix(ref bool ___hydraulicsScreenDisplayed, ref float ___doorPowerDuration)
		{
			___hydraulicsScreenDisplayed = false;
			___doorPowerDuration = 5f;
		}
	}
	[HarmonyPatch(typeof(CrawlerAI))]
	internal class CrawlerPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Postfix(ref float ___maxSearchAndRoamRadius, ref float ___BaseAcceleration, ref float ___SpeedAccelerationEffect)
		{
			___maxSearchAndRoamRadius = 200f;
			___BaseAcceleration = 100f;
			___SpeedAccelerationEffect = 7f;
		}
	}
	[HarmonyPatch(typeof(FlowermanAI))]
	internal class FlowermanPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Postfix(ref float ___velX, ref float ___velZ, ref float ___angerMeter)
		{
			___velX = 65f;
			___velZ = 65f;
			___angerMeter = 20f;
		}
	}
	[HarmonyPatch(typeof(EnemyAI))]
	internal class MobSomethingPatch
	{
		internal static ManualLogSource mls;

		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void Postfix(EnemyAI __instance)
		{
			__instance.enemyType.MaxCount = 6;
			__instance.enemyType.canDie = true;
			__instance.enemyType.doorSpeedMultiplier = 3f;
			__instance.enemyType.PowerLevel = 1f;
			__instance.enemyType.canBeStunned = false;
			__instance.enemyType.spawningDisabled = false;
			__instance.enemyHP = 8;
			if (((Object)__instance).name == "DressGirl")
			{
				__instance.enemyType.MaxCount = 2;
				__instance.enemyType.canDie = false;
			}
			if (((Object)__instance).name == "PufferEnemy")
			{
				__instance.enemyType.MaxCount = 2;
				__instance.enemyType.canDie = false;
			}
			if (((Object)__instance).name == "Blob")
			{
				__instance.enemyType.MaxCount = 4;
				__instance.enemyType.canDie = false;
			}
			if (((Object)__instance).name == "SpringMan")
			{
				__instance.enemyType.MaxCount = 3;
				__instance.enemyType.canDie = false;
			}
			if (((Object)__instance).name == "NutcrackerEnemy")
			{
				__instance.enemyType.MaxCount = 4;
			}
			if (((Object)__instance).name == "Flowerman")
			{
				__instance.enemyType.MaxCount = 3;
				__instance.enemyHP = 15;
			}
			if (((Object)__instance).name == "MouthDog")
			{
				__instance.enemyType.MaxCount = 10;
				__instance.enemyHP = 50;
			}
			if (((Object)__instance).name == "ForestGiant")
			{
				__instance.enemyType.MaxCount = 4;
				__instance.enemyType.canDie = false;
			}
			if (((Object)__instance).name == "SandWorm")
			{
				__instance.enemyType.MaxCount = 1;
				__instance.enemyType.canDie = false;
			}
			mls = Logger.CreateLogSource("GrannyshouseIdontwanttosaty");
			mls.LogInfo((object)((Object)__instance).name);
		}
	}
	[HarmonyPatch(typeof(HoarderBugAI))]
	internal class HoarderBugPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Postfix(ref float ___angryTimer, ref float ___velX, ref float ___velZ)
		{
			___angryTimer = 10f;
			___velX = 50f;
			___velZ = 50f;
		}
	}
	[HarmonyPatch(typeof(SandSpiderAI))]
	internal class SandSpiderPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void Postfix(ref float ___spiderSpeed, ref float ___chaseTimer)
		{
			___spiderSpeed = 4f;
			___chaseTimer = 99f;
		}
	}
	[HarmonyPatch(typeof(RoundManager))]
	internal class RoundManagerPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void Postfix(ref float ___scrapValueMultiplier, ref float ___scrapAmountMultiplier, ref float ___mapSizeMultiplier, ref int ___hourTimeBetweenEnemySpawnBatches)
		{
			___scrapValueMultiplier = 0.9f;
			___scrapAmountMultiplier = 0.45f;
			___hourTimeBetweenEnemySpawnBatches = 1;
		}
	}
}