Decompiled source of LethalMDK v1.2.0

LethalMDK.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using GameNetcodeStuff;
using HarmonyLib;
using Unity.Netcode;
using UnityEngine;
using UnityMDK;
using UnityMDK.Injection;
using UnityMDK.Logging;
using UnityMDK.Reflection;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalMDK")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LethalMDK")]
[assembly: AssemblyTitle("LethalMDK")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace LethalMDK
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Saradora.LethalMDK", "Lethal MDK", "1.2.0")]
	public class PluginInitializer : BaseUnityPlugin
	{
		private readonly Harmony _harmonyInstance = new Harmony("Saradora.LethalMDK");

		private void Awake()
		{
			_harmonyInstance.PatchAll();
		}
	}
	public static class LethalMDK
	{
		public const string ModGuid = "Saradora.LethalMDK";

		public const string ModVersion = "1.2.0";

		public const string ModName = "Lethal MDK";
	}
	public class LayerMasks
	{
		public static readonly int Default = 1 << Layers.Default;

		public static readonly int InteractableObject = 1 << Layers.InteractableObject;

		public static readonly int Room = 1 << Layers.Room;

		public static readonly int ScanNode = 1 << Layers.ScanNode;
	}
	public static class Layers
	{
		public static readonly int Default = LayerMask.NameToLayer("Default");

		public static readonly int TransparentFX = LayerMask.NameToLayer("TransparentFX");

		public static readonly int IgnoreRaycast = LayerMask.NameToLayer("Ignore Raycast");

		public static readonly int Player = LayerMask.NameToLayer("Player");

		public static readonly int Water = LayerMask.NameToLayer("Water");

		public static readonly int UI = LayerMask.NameToLayer("UI");

		public static readonly int Props = LayerMask.NameToLayer("Props");

		public static readonly int HelmetVisor = LayerMask.NameToLayer("HelmetVisor");

		public static readonly int Room = LayerMask.NameToLayer("Room");

		public static readonly int InteractableObject = LayerMask.NameToLayer("InteractableObject");

		public static readonly int Foliage = LayerMask.NameToLayer("Foliage");

		public static readonly int Colliders = LayerMask.NameToLayer("Colliders");

		public static readonly int PhysicsObject = LayerMask.NameToLayer("PhysicsObject");

		public static readonly int Triggers = LayerMask.NameToLayer("Triggers");

		public static readonly int MapRadar = LayerMask.NameToLayer("MapRadar");

		public static readonly int NavigationSurface = LayerMask.NameToLayer("NavigationSurface");

		public static readonly int RoomLight = LayerMask.NameToLayer("RoomLight");

		public static readonly int Anomaly = LayerMask.NameToLayer("Anomaly");

		public static readonly int LineOfSight = LayerMask.NameToLayer("LineOfSight");

		public static readonly int Enemies = LayerMask.NameToLayer("Enemies");

		public static readonly int PlayerRagdoll = LayerMask.NameToLayer("PlayerRagdoll");

		public static readonly int MapHazards = LayerMask.NameToLayer("MapHazards");

		public static readonly int ScanNode = LayerMask.NameToLayer("ScanNode");

		public static readonly int EnemiesNotRendered = LayerMask.NameToLayer("EnemiesNotRendered");

		public static readonly int MiscLevelGeometry = LayerMask.NameToLayer("MiscLevelGeometry");

		public static readonly int Terrain = LayerMask.NameToLayer("Terrain");

		public static readonly int PlaceableShipObjects = LayerMask.NameToLayer("PlaceableShipObjects");

		public static readonly int PlacementBlocker = LayerMask.NameToLayer("PlacementBlocker");

		public static readonly int Railing = LayerMask.NameToLayer("Railing");

		public static readonly int DecalStickableSurface = LayerMask.NameToLayer("DecalStickableSurface");
	}
	public class Tags
	{
		public static readonly string InteractTrigger = "InteractTrigger";
	}
	public class Player
	{
		public static PlayerControllerB LocalPlayer
		{
			get
			{
				if (!Object.op_Implicit((Object)(object)GameNetworkManager.Instance))
				{
					return null;
				}
				return GameNetworkManager.Instance.localPlayerController;
			}
		}
	}
	[SceneConstructor]
	public class Prefabs
	{
		public const string P4x4BigStairTile = "4x4BigStairTile";

		public const string P4x4ServerRoomTile = "4x4ServerRoomTile";

		public const string PAirhorn = "Airhorn";

		public const string PBaboonHawkEnemy = "BaboonHawkEnemy";

		public const string PBBFlashlight = "BBFlashlight";

		public const string PBeeHatContainer = "BeeHatContainer";

		public const string PBigBolt = "BigBolt";

		public const string PBigDoor = "BigDoor";

		public const string PBigDoorSpawn = "BigDoorSpawn";

		public const string PBinFullOfBottles = "BinFullOfBottles";

		public const string PBinoculars = "Binoculars";

		public const string PBlob = "Blob";

		public const string PBloodDecal = "BloodDecal";

		public const string PBodyScanDisplay = "BodyScanDisplay";

		public const string PBoombox = "Boombox";

		public const string PBreakerBox = "BreakerBox";

		public const string PBrickDoorBlockerForkTile = "BrickDoorBlockerForkTile";

		public const string PBunnyHatContainer = "BunnyHatContainer";

		public const string PBunnyTailContainer = "BunnyTailContainer";

		public const string PButlerBees = "ButlerBees";

		public const string PButlerEnemy = "ButlerEnemy";

		public const string PCandy = "Candy";

		public const string PCashRegisterItem = "CashRegisterItem";

		public const string PCatwalkTile2x1 = "CatwalkTile2x1";

		public const string PCatwalkTile2x1Split = "CatwalkTile2x1Split";

		public const string PCementDarkDoorBlocker = "CementDarkDoorBlocker";

		public const string PCentipede = "Centipede";

		public const string PChallengeLeaderboardSlotItem = "ChallengeLeaderboardSlotItem";

		public const string PChangableSuit = "ChangableSuit";

		public const string PChemicalJug = "ChemicalJug";

		public const string PClipboardManual = "ClipboardManual";

		public const string PCloverTile = "CloverTile";

		public const string PCloverTileLampSpawn = "CloverTileLampSpawn";

		public const string PCloverTileLampSpawnBVariant = "CloverTileLampSpawnB Variant";

		public const string PCloverTileLampSpawnCVariant = "CloverTileLampSpawnC Variant";

		public const string PCloverTileShelfSpawn = "CloverTileShelfSpawn";

		public const string PCloverTileShelfSpawnBVariant = "CloverTileShelfSpawnB Variant";

		public const string PCloverTileShelfSpawnDVariant = "CloverTileShelfSpawnD Variant";

		public const string PClownhorn = "Clownhorn";

		public const string PCog = "Cog";

		public const string PComedyMask = "ComedyMask";

		public const string PCookieMoldPan = "CookieMoldPan";

		public const string PCrawler = "Crawler";

		public const string PDefaultHDAdditionalLightData = "Default HDAdditionalLightData";

		public const string PDefaultVolume = "Default Volume";

		public const string PDentures = "Dentures";

		public const string PDiagonal1Tile = "Diagonal1Tile";

		public const string PDiscoBallContainer = "DiscoBallContainer";

		public const string PDiyFlashbang = "DiyFlashbang";

		public const string PDocileLocustBees = "DocileLocustBees";

		public const string PDoorCodeUIObject = "DoorCodeUIObject";

		public const string PDoubleDoorRoom = "DoubleDoorRoom";

		public const string PDoublewingedBird = "DoublewingedBird";

		public const string PDressGirl = "DressGirl";

		public const string PDustpan = "Dustpan";

		public const string PEasterEgg = "EasterEgg";

		public const string PEasterEggExplosionParticle = "EasterEggExplosionParticle";

		public const string PEggBeater = "EggBeater";

		public const string PElevatorConnector = "ElevatorConnector";

		public const string PEnginePart = "EnginePart";

		public const string PEntranceTeleportA = "EntranceTeleportA";

		public const string PEntranceTeleportB = "EntranceTeleportB";

		public const string PExplosionEffect = "ExplosionEffect";

		public const string PExtensionLadderItem = "ExtensionLadderItem";

		public const string PFancyDoorBlockerMedHallway2 = "FancyDoorBlockerMedHallway2";

		public const string PFancyDoorFrameMapSpawn = "FancyDoorFrameMapSpawn";

		public const string PFancyDoorMapModel = "FancyDoorMapModel";

		public const string PFancyDoorMapSpawn = "FancyDoorMapSpawn";

		public const string PFancyGlass = "FancyGlass";

		public const string PFancyLamp = "FancyLamp";

		public const string PFancyRing = "FancyRing";

		public const string PFancyWall2PillarDoorBlocker = "FancyWall2PillarDoorBlocker";

		public const string PFancyWall3PillarDoorBlockerVariant = "FancyWall3PillarDoorBlocker Variant";

		public const string PFancyWall4DoorBlocker = "FancyWall4DoorBlocker";

		public const string PFishBowlContainer = "FishBowlContainer";

		public const string PFishTestProp = "FishTestProp";

		public const string PFlashBangParticle = "FlashBangParticle";

		public const string PFlashlightItem = "FlashlightItem";

		public const string PFlask = "Flask";

		public const string PFlowerman = "Flowerman";

		public const string PFlowerSnakeEnemy = "FlowerSnakeEnemy";

		public const string PFootprintDecal = "FootprintDecal";

		public const string PForestGiant = "ForestGiant";

		public const string PGiantPumpkin = "GiantPumpkin";

		public const string PGiftBox = "GiftBox";

		public const string PGoldBar = "GoldBar";

		public const string PGreyRockGrouping2 = "GreyRockGrouping2";

		public const string PGreyRockGrouping4 = "GreyRockGrouping4";

		public const string PHairbrush = "Hairbrush";

		public const string PHairdryer = "Hairdryer";

		public const string PHallwayBlocker = "HallwayBlocker";

		public const string PHallwayBlockerNoOffset = "HallwayBlockerNoOffset";

		public const string PHallwayBlockerNoOffsetCementDark = "HallwayBlockerNoOffsetCementDark";

		public const string PHallwayCloverIntersection = "HallwayCloverIntersection";

		public const string PHallwayCloverInverse = "HallwayCloverInverse";

		public const string PHallwayCorner = "HallwayCorner";

		public const string PHallwayTileTypeA = "HallwayTileTypeA";

		public const string PHallwayTileTypeB = "HallwayTileTypeB";

		public const string PHallwayTileTypeC = "HallwayTileTypeC";

		public const string PHallwayTileTypeD = "HallwayTileTypeD";

		public const string PHallwayWideOpeningConnector = "HallwayWideOpeningConnector";

		public const string PHandBell = "HandBell";

		public const string PHeadMask = "HeadMask";

		public const string PHoarderBug = "HoarderBug";

		public const string PInternalIdentityTransform = "InternalIdentityTransform";

		public const string PInverseTeleporter = "InverseTeleporter";

		public const string PJesterEnemy = "JesterEnemy";

		public const string PJetpackItem = "JetpackItem";

		public const string PKey = "Key";

		public const string PKeybindsSectionText = "KeybindsSectionText";

		public const string PKitchenTile = "KitchenTile";

		public const string PKnifeItem = "KnifeItem";

		public const string PLandmine = "Landmine";

		public const string PLargeExplosionDecal = "LargeExplosionDecal";

		public const string PLargeExplosionEffect = "LargeExplosionEffect";

		public const string PLargeForkTileB = "LargeForkTileB";

		public const string PLargeHallwayOpeningTile = "LargeHallwayOpeningTile";

		public const string PLargeRock1 = "LargeRock1";

		public const string PLargeRock2 = "LargeRock2";

		public const string PLargeRock3 = "LargeRock3";

		public const string PLargeRock4 = "LargeRock4";

		public const string PLaserPointer = "LaserPointer";

		public const string PLassoMan = "LassoMan";

		public const string PLevel2StartRoomConnector = "Level2StartRoomConnector";

		public const string PLibraryTile = "LibraryTile";

		public const string PLivingRoomTile = "LivingRoomTile";

		public const string PLobbyListItem = "LobbyListItem";

		public const string PLobbyListItemChallenge = "LobbyListItemChallenge";

		public const string PLockPickerItem = "LockPickerItem";

		public const string PLRADAudio = "LRADAudio";

		public const string PLRADAudio2 = "LRADAudio2";

		public const string PLungApparatus = "LungApparatus";

		public const string PLungApparatusTurnedOff = "LungApparatusTurnedOff";

		public const string PMagic7Ball = "Magic7Ball";

		public const string PMagnifyingGlass = "MagnifyingGlass";

		public const string PManorStairTile = "ManorStairTile";

		public const string PManorStartRoom = "ManorStartRoom";

		public const string PMappingDevice = "MappingDevice";

		public const string PMarbleWallDoorBlocker = "MarbleWallDoorBlocker";

		public const string PMaskedPlayerEnemy = "MaskedPlayerEnemy";

		public const string PMediumRoomHallway1B = "MediumRoomHallway1B";

		public const string PMetalSheet = "MetalSheet";

		public const string PMetalWallDoorBlocker = "MetalWallDoorBlocker";

		public const string PMissileProjectile = "MissileProjectile";

		public const string PMoon1 = "Moon1";

		public const string PMoon2 = "Moon2";

		public const string PMoon3 = "Moon3";

		public const string PMouthDog = "MouthDog";

		public const string PMug = "Mug";

		public const string PNormalDoor = "NormalDoor";

		public const string PNormalDoorBlocker = "NormalDoorBlocker";

		public const string PNormalDoorBlockerBigTex = "NormalDoorBlockerBigTex";

		public const string PNormalDoorBlockerWhiteCement = "NormalDoorBlockerWhiteCement";

		public const string PNormalDoorBlockerWhiteCementNoExitDoor = "NormalDoorBlockerWhiteCementNoExitDoor";

		public const string PNormalDoorBlockerWhiteWallpaper = "NormalDoorBlockerWhiteWallpaper";

		public const string PNormalTableContainer = "NormalTableContainer";

		public const string PNutcrackerEnemy = "NutcrackerEnemy";

		public const string POfficeDoor = "OfficeDoor";

		public const string POldPhone = "OldPhone";

		public const string PPainting = "Painting";

		public const string PPatcherGunItem = "PatcherGunItem";

		public const string PPerfumeBottle = "PerfumeBottle";

		public const string PPickleJar = "PickleJar";

		public const string PPillBottle = "PillBottle";

		public const string PPlaybackPrefab = "PlaybackPrefab";

		public const string PPlayer = "Player";

		public const string PPlayerRagdoll = "PlayerRagdoll";

		public const string PPlayerRagdollBurntVariant = "PlayerRagdollBurnt Variant";

		public const string PPlayerRagdollElectrocutedVariant = "PlayerRagdollElectrocuted Variant";

		public const string PPlayerRagdollHeadBurstVariant = "PlayerRagdollHeadBurst Variant";

		public const string PPlayerRagdollSpringVariant = "PlayerRagdollSpring Variant";

		public const string PPlayerRagdollWithComedyMaskVariant = "PlayerRagdollWithComedyMask Variant";

		public const string PPlayerRagdollWithTragedyMaskVariant = "PlayerRagdollWithTragedyMask Variant";

		public const string PPlayerSpectateBox = "PlayerSpectateBox";

		public const string PPlushiePJManContainer = "PlushiePJManContainer";

		public const string PPufferEnemy = "PufferEnemy";

		public const string PPufferEnemySmokeContainer = "PufferEnemySmokeContainer";

		public const string PPumpkinUnlockableContainer = "PumpkinUnlockableContainer";

		public const string PQuicksandContainer = "QuicksandContainer";

		public const string PRadarBoosterDevice = "RadarBoosterDevice";

		public const string PRadMechEnemy = "RadMechEnemy";

		public const string PRadMechNestSpawnObject = "RadMechNestSpawnObject";

		public const string PRagdollGrabbableObject = "RagdollGrabbableObject";

		public const string PRecordPlayerContainer = "RecordPlayerContainer";

		public const string PRedLocustBees = "RedLocustBees";

		public const string PRedLocustHive = "RedLocustHive";

		public const string PRedSodaCan = "RedSodaCan";

		public const string PRemapKeySlot = "RemapKeySlot";

		public const string PRemote = "Remote";

		public const string PRobotToy = "RobotToy";

		public const string PRomanticTableContainer = "RomanticTableContainer";

		public const string PRubberDucky = "RubberDucky";

		public const string PSandSpider = "SandSpider";

		public const string PSandWorm = "SandWorm";

		public const string PScrapIconMap = "ScrapIconMap";

		public const string PShipCozyLights = "ShipCozyLights";

		public const string PShipHorn = "ShipHorn";

		public const string PShotgunItem = "ShotgunItem";

		public const string PShotgunShell = "ShotgunShell";

		public const string PShovelItem = "ShovelItem";

		public const string PShower = "Shower";

		public const string PSignalTranslator = "SignalTranslator";

		public const string PSmallLRoom = "SmallLRoom";

		public const string PSmallPillarRoom = "SmallPillarRoom";

		public const string PSmallRoom2 = "SmallRoom2";

		public const string PSmallStairTile = "SmallStairTile";

		public const string PSpatializedPlaybackPrefabModified = "SpatializedPlaybackPrefabModified";

		public const string PSpikeRoofTrapHazard = "SpikeRoofTrapHazard";

		public const string PSpikeSlamBodyStickyPoint = "SpikeSlamBodyStickyPoint";

		public const string PSprayDecal = "SprayDecal";

		public const string PSprayPaintItem = "SprayPaintItem";

		public const string PSpringMan = "SpringMan";

		public const string PStartRoom = "StartRoom";

		public const string PSteamValve = "SteamValve";

		public const string PSteelDoor = "SteelDoor";

		public const string PSteelDoorFrameMapSpawn = "SteelDoorFrameMapSpawn";

		public const string PSteelDoorMapModel = "SteelDoorMapModel";

		public const string PSteelDoorMapSpawn = "SteelDoorMapSpawn";

		public const string PSteeringWheel = "SteeringWheel";

		public const string PStickyNoteItem = "StickyNoteItem";

		public const string PStopSign = "StopSign";

		public const string PStorageShelfContainer = "StorageShelfContainer";

		public const string PStretchyWeb = "StretchyWeb";

		public const string PStunGrenade = "StunGrenade";

		public const string PTeaKettle = "TeaKettle";

		public const string PTeleporter = "Teleporter";

		public const string PTelevisionContainer = "TelevisionContainer";

		public const string PTestAnomaly = "TestAnomaly";

		public const string PTestCapsuleEnemy = "TestCapsuleEnemy";

		public const string PTestRoom = "TestRoom";

		public const string PTHallwayIntersectionB = "THallwayIntersectionB";

		public const string PToilet = "Toilet";

		public const string PToothpaste = "Toothpaste";

		public const string PToyCube = "ToyCube";

		public const string PTragedyMask = "TragedyMask";

		public const string PTree = "tree";

		public const string PTreeLeafless002LOD0 = "treeLeafless.002_LOD0";

		public const string PTreeLeafless003LOD0 = "treeLeafless.003_LOD0";

		public const string PTreeLeaflessBrown001Variant = "treeLeaflessBrown.001 Variant";

		public const string PTurretContainer = "TurretContainer";

		public const string PTZPChemical = "TZPChemical";

		public const string PVentEntrance = "VentEntrance";

		public const string PWalkieTalkie = "WalkieTalkie";

		public const string PWebHangerPhysics = "WebHangerPhysics";

		public const string PWelcomeMatContainer = "WelcomeMatContainer";

		public const string PWhoopieCushion = "WhoopieCushion";

		public const string PWideHallwayOpeningBlocker1 = "WideHallwayOpeningBlocker (1)";

		public const string PWideHallwayOpeningBlocker3 = "WideHallwayOpeningBlocker3";

		public const string PWideHallwayOpeningBlockerB = "WideHallwayOpeningBlockerB";

		public const string PWideHallwayOpeningBlockerBOffset2cVariant = "WideHallwayOpeningBlockerBOffset2c Variant";

		public const string PWideHallwayOpeningBlockerCVariant = "WideHallwayOpeningBlockerC Variant";

		public const string PWideHallwayOpeningBlockerGreenPillarsVariant = "WideHallwayOpeningBlockerGreenPillars Variant";

		public const string PWindowTile = "WindowTile";

		public const string PWoodPikesContainer = "WoodPikesContainer";

		public const string PYieldSign = "YieldSign";
	}
}
namespace LethalMDK.World
{
	public static class ScanNodes
	{
		public enum EType
		{
			Utility,
			Creature,
			Scrap
		}
	}
}
namespace LethalMDK.Network
{
	public static class NetworkPrefabs
	{
		public static GameObject GetEmptyPrefab(string name)
		{
			GameObject emptyPrefab = PrefabUtils.GetEmptyPrefab(name);
			NetworkObject obj = emptyPrefab.AddComponent<NetworkObject>();
			byte[] value = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(Assembly.GetCallingAssembly().GetName().Name + name));
			ReflectionUtility.SetField<uint>((object)obj, "GlobalObjectIdHash", BitConverter.ToUInt32(value, 0));
			RegisterNetworkPrefab(emptyPrefab);
			return emptyPrefab;
		}

		public static void RegisterNetworkPrefab(GameObject prefab)
		{
			if (!Object.op_Implicit((Object)(object)NetworkManager.Singleton))
			{
				Log.Error((object)"Network manager isn't ready");
			}
			else
			{
				NetworkManager.Singleton.AddNetworkPrefab(prefab);
			}
		}
	}
}