Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of KenzouPlush v10.10.10
MyName.Piouu.dll
Decompiled a year agousing System; using System.Collections; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Modules; using Microsoft.CodeAnalysis; using MiniZou.Behaviours; using UnityEngine; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("MyName.Piouu")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("MiniZou")] [assembly: AssemblyTitle("MyName.Piouu")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace MiniZou { [BepInPlugin("MyName.Piouu", "MiniZou", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class MiniZou : BaseUnityPlugin { public static MiniZou Instance { get; private set; } internal static ManualLogSource Logger { get; private set; } internal static Harmony? Harmony { get; set; } private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; Instance = this; Patch(); Instance = this; string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "KenzouPlush"); AssetBundle val = AssetBundle.LoadFromFile(text); int num = 30; Item val2 = val.LoadAsset<Item>("Assets/Letsgoo/MiniZou.asset"); AudioClip teleportClip = val.LoadAsset<AudioClip>("Assets/Letsgoo/KenzMus.mp3"); AudioClip po = val.LoadAsset<AudioClip>("Assets/Letsgoo/Pouet.ogg"); Material val3 = val.LoadAsset<Material>("Assets/Letsgoo/AluminumTank.mat"); TeleportationItem teleportationItem = val2.spawnPrefab.AddComponent<TeleportationItem>(); ((GrabbableObject)teleportationItem).grabbable = true; ((GrabbableObject)teleportationItem).grabbableToEnemies = true; ((GrabbableObject)teleportationItem).itemProperties = val2; teleportationItem.teleportClip = teleportClip; teleportationItem.po = po; teleportationItem.itemToSpawn = val2; Utilities.FixMixerGroups(val2.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab); Items.RegisterScrap(val2, num, (LevelTypes)(-1)); Logger.LogInfo((object)"\n\n @@@@@@@@@@@ %@@@@@@@@@@ \n @@@%%%%%%%%%%%%%@# @@%%%%%%%%%%%%@@@% \n *@@@%%%%%%%%%%%%%%%%@@ #@%%%%%%%%%%%%%%%%%@@@ \n +@@%%%%%%%%%%%%%%%%@@@@ #@@%%%%%%%%%%%%%%%%%@@ \n @@%%%%%%%%%%%%%%@@@@ *@@@%%%%%%%%%%%%%%%@% \n %@@@@@@@@@@@@## #%@@@@@@@@@@@@% \n \n \n +@@@@@@@@@@# #@@@@@@@@@@ \n %@@@@+-@@@@@@@@@@@@% %@@@@@@@@@@@@-:#@@@ \n %@@=*@@@@@@@@+:. .:*@@@ #@@@=:. :-+@@@@@@@-.%@@ \n @@@.@@@@@@@@@@@@@@@@@. .% #. .@@@@@@@@@@@%@@@@@.*@@ \n @@#@@@@@@@@@@@@@@@@@@@@@: .. . .@@@@@@@@@@@@@@@-@@@@@.@@ \n #@#@@@@@#@@@@@@@@@@@@@@@@@%. . .. @@@@@@@@@@@@@@@@%@@@@@@ %@ \n @@@@@@@*@@@@@@@%*%@@@@@@@@@* .. . @@@@@@@@@%*%@@@@@@%@#@@@@-@@ \n @@%@@@@+@@@@@@@. ..@@@@@@@@ . . =@@@@@@@*. :@@@@@@@#@@@@:@# \n @@@@@@@%@@@@@@ ..@@@@@@@% .. . @@@@@@@% .@@@@@@-@@@@@@% \n @@@@@@=@@@@@@+ . #@@@@@@@-.. . *@@@@@@@: .@@@@@@%-@@@@@@ \n @@@@@@.%@@@@@%. . -@@@@@@@% . . %@@@@@@@. . .@@@@@@@.@@@@@% \n #@@@@@ #@@@@@@. .%@@@@@@@% . . @@@@@@@@*.. :@@@@@@@.@@@@@# \n @@@@@@@@@ #@@@@@@@ *@@@@@@@@# . . %@@@@@@@@- .:@@@@@@*@.@@@@@@@@@ \n * @@@@ @.@@@@@@@@%#%@@@@@@@@@@+. #@@@@@@@@@@%#@@@@@@@@@.*.@@@@ @@ \n #@@@@ * @@@@@@@@@@@@@@@@@@@@.. . @@@@@@@@@@@@@@@@@@@@.% .@@@@ \n @@@@@% .@.@@@@@@@@@@@@@@@@@@.. @@@@@@@@@@@@@@@@@%.% .@@@@@* \n @@@@% . -#.@@@@@@@@@@@@@@- . .+@@@@@@@@@@@@@%:%: . %@@@ \n + .*@=-%@@@@@@* . . .#@@@@@@%=*@+. +. \n %@@@%@. .#% @- .*@%@@@* \n #%@#+===+*%%@% #@@#+===+*%%%* \n @@@@@@@@@ \n \n \n %%#%@@@@@@@@@@@@%#@% \n %: *% \n @= @# \n % @ \n @ -% \n * @ \n %. *# \n @. #% \n ## .% \n %% :%* \n #%@@@@ \n\n"); } internal static void Patch() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (Harmony == null) { Harmony = new Harmony("MyName.Piouu"); } Logger.LogDebug((object)"Patching..."); Harmony.PatchAll(); Logger.LogDebug((object)"Finished patching!"); } internal static void Unpatch() { Logger.LogDebug((object)"Unpatching..."); Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } Logger.LogDebug((object)"Finished unpatching!"); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "MyName.Piouu"; public const string PLUGIN_NAME = "MiniZou"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace MiniZou.Patches { [HarmonyPatch(typeof(TVScript))] public class ExampleTVPatch { [HarmonyPatch("SwitchTVLocalClient")] [HarmonyPrefix] private static void SwitchTVPrefix(TVScript __instance) { StartOfRound.Instance.shipRoomLights.SetShipLightsBoolean(__instance.tvOn); } } } namespace MiniZou.Behaviours { internal class TeleportationItem : PhysicsProp { public AudioClip teleportClip; public AudioClip po; public Material Chambre; public Vector3 darkRoomOffset = new Vector3(1000f, 1000f, 1000f); public Item itemToSpawn; public bool Cd = true; private Vector3 originalPosition; private Quaternion originalRotation; private Random noisemakerRandom; private Color originalAmbientLight; private static MeshRenderer _scanRenderer; private PlayerControllerB previousOwner; private static bool HasScanMaterial => ScanRenderer != null && ((Renderer)ScanRenderer).material != null; public static MeshRenderer ScanRenderer { get { if (_scanRenderer == null || ((Renderer)_scanRenderer).material == null) { if (HUDManager.Instance == null || HUDManager.Instance.scanEffectAnimator == null) { return null; } if (!((Component)HUDManager.Instance.scanEffectAnimator).TryGetComponent<MeshRenderer>(ref _scanRenderer)) { return null; } } return _scanRenderer; } } public override void Start() { ((GrabbableObject)this).Start(); noisemakerRandom = new Random(StartOfRound.Instance.randomMapSeed + 85); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!buttonDown || !((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) || !Cd) { return; } Cd = false; ((MonoBehaviour)this).StartCoroutine(Cooldown(1.5f)); AudioSource val = ((Component)((GrabbableObject)this).playerHeldBy).GetComponent<AudioSource>(); if ((Object)(object)val == (Object)null) { val = ((Component)((GrabbableObject)this).playerHeldBy).gameObject.AddComponent<AudioSource>(); } if (Random.Range(0, 10) != 0 || (((GrabbableObject)this).playerHeldBy.isInElevator && StartOfRound.Instance.inShipPhase)) { if ((Object)(object)teleportClip != (Object)null) { float pitch = (float)noisemakerRandom.Next(100, 200) / 100f; val.pitch = pitch; val.PlayOneShot(po); } return; } previousOwner = ((GrabbableObject)this).playerHeldBy; previousOwner.disableMoveInput = true; originalPosition = ((Component)((GrabbableObject)this).playerHeldBy).transform.position; originalRotation = ((Component)((GrabbableObject)this).playerHeldBy).transform.rotation; originalAmbientLight = RenderSettings.ambientLight; RenderSettings.fog = false; RenderSettings.reflectionIntensity = 0f; RenderSettings.ambientLight = Color.black; SetScanColorAlpha(0f); Vector3 darkRoomSpawnPosition = GetDarkRoomSpawnPosition(); ((Component)previousOwner).transform.position = darkRoomSpawnPosition; ((Component)previousOwner).transform.rotation = Quaternion.identity; ((GrabbableObject)this).DestroyObjectInHand(previousOwner); Vector3 val2 = ((Component)previousOwner).transform.position + ((Component)previousOwner).transform.forward * 2f + Vector3.up * 0.5f; GameObject val3 = Object.Instantiate<GameObject>(itemToSpawn.spawnPrefab, val2, Quaternion.identity); ScanNodeProperties componentInChildren = val3.GetComponentInChildren<ScanNodeProperties>(); componentInChildren.nodeType = 1; componentInChildren.headerText = "Kenzou"; componentInChildren.creatureScanID = 0; previousOwner.Crouch(true); Rigidbody component = val3.GetComponent<Rigidbody>(); if ((Object)(object)component != (Object)null) { component.AddForce(((Component)previousOwner).transform.forward * 5f, (ForceMode)1); } if ((Object)(object)teleportClip != (Object)null) { val.clip = teleportClip; val.pitch = 1f; val.Play(); float length = teleportClip.length; ((MonoBehaviour)this).StartCoroutine(ReturnAfterDelay(length)); } else { ((MonoBehaviour)this).StartCoroutine(ReturnAfterDelay(5f)); } } private IEnumerator ReturnAfterDelay(float delay) { yield return (object)new WaitForSeconds(delay); if ((Object)(object)previousOwner != (Object)null) { SetScanColorAlpha(0.2f); previousOwner.disableMoveInput = false; ((Component)previousOwner).transform.position = originalPosition; ((Component)previousOwner).transform.rotation = originalRotation; } RenderSettings.ambientLight = originalAmbientLight; } private IEnumerator Cooldown(float delay) { yield return (object)new WaitForSeconds(delay); Cd = true; } private IEnumerator LumaDel(float delay, Light light) { yield return (object)new WaitForSeconds(delay); light.intensity = 200f; } private Vector3 GetDarkRoomSpawnPosition() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.Find("DarkRoom"); if ((Object)(object)val == (Object)null) { val = CreateDarkRoom(); } return val.transform.position + new Vector3(0f, 1f, 0f); } private Vector3 GetDarkRoomCenter() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)previousOwner != (Object)null) { return ((Component)previousOwner).transform.position + darkRoomOffset; } return darkRoomOffset; } private GameObject CreateDarkRoom() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Expected O, but got Unknown //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) Vector3 darkRoomCenter = GetDarkRoomCenter(); GameObject val = new GameObject("DarkRoom"); val.transform.position = darkRoomCenter; float num = 100f; float num2 = 100f; float num3 = 10f; float num4 = 2f; CreateWall(val, "Floor", new Vector3(1f, 0f, 0f), new Vector3(num, num4, num2)); CreateWall(val, "NorthWall", new Vector3(0f, num3 / 2f, num2 / 2f), new Vector3(num, num3, num4)); CreateWall(val, "SouthWall", new Vector3(0f, num3 / 2f, (0f - num2) / 2f), new Vector3(num, num3, num4)); CreateWall(val, "EastWall", new Vector3(num / 2f, num3 / 2f, 0f), new Vector3(num4, num3, num2)); CreateWall(val, "WestWall", new Vector3((0f - num) / 2f, num3 / 2f, 0f), new Vector3(num4, num3, num2)); CreateWall(val, "Ceiling", new Vector3(1f, num3, 0f), new Vector3(num, num4, num2)); GameObject val2 = new GameObject("RoomLight"); val2.transform.SetParent(val.transform); val2.transform.localPosition = new Vector3(0f, num3 - 2f, 0f); Light val3 = val2.AddComponent<Light>(); val3.type = (LightType)2; val3.intensity = 0f; val3.range = 100f; val3.color = Color.red; ((MonoBehaviour)this).StartCoroutine(LumaDel(1f, val3)); return val; } private void CreateWall(GameObject parent, string name, Vector3 localPosition, Vector3 localScale) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)val).name = name; val.transform.SetParent(parent.transform); val.transform.localPosition = localPosition; val.transform.localRotation = Quaternion.identity; val.transform.localScale = localScale; int layer = LayerMask.NameToLayer("Room"); val.layer = layer; Renderer component = val.GetComponent<Renderer>(); if ((Object)(object)component != (Object)null) { Material val2 = new Material(Shader.Find("HDRP/Lit")); val2.SetFloat("_SurfaceType", 0f); val2.SetFloat("_CullMode", 2f); val2.SetFloat("_AlphaCutoffEnable", 0f); val2.renderQueue = 2000; val2.SetColor("_BaseColor", Color.black); component.material = val2; component.shadowCastingMode = (ShadowCastingMode)1; component.receiveShadows = true; } } public static void SetScanColorAlpha(float alpha) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (HasScanMaterial) { Color color = ((Renderer)ScanRenderer).material.color; color.a = alpha; ((Renderer)ScanRenderer).material.color = color; } } } }