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 Invalid Gateway Pack v0.2.1
Sai_Inval.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Modules; using Microsoft.CodeAnalysis; using ModelReplacement; using MoreCompany.Utils; using UnityEngine; using UnityEngine.AI; [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 = "")] [assembly: AssemblyCompany("Sai_Inval")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("Sai_Inval")] [assembly: AssemblyTitle("Sai_Inval")] [assembly: AssemblyVersion("1.0.0.0")] 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; } } } namespace Sai_Inval { [HarmonyPatch] internal class BrackenPatch { [HarmonyPatch(typeof(FlowermanAI), "Start")] [HarmonyPostfix] public static void addController(FlowermanAI __instance) { ((Component)__instance).gameObject.AddComponent<GothController>(); } } [HarmonyPatch] internal class BugPatch { [HarmonyPatch(typeof(HoarderBugAI), "Start")] [HarmonyPostfix] public static void addController(HoarderBugAI __instance) { ((Component)__instance).gameObject.AddComponent<CatController>(); } } public class SwokidReplacement : BodyReplacementBase { protected override GameObject LoadAssetsAndReturnModel() { string text = "Swokid"; GameObject result = Plugin.PlayerModelObjects[0].GetBundle().LoadAsset<GameObject>(text); int currentSuitID = ((Component)this).GetComponent<PlayerControllerB>().currentSuitID; string text2 = StartOfRound.Instance.unlockablesList.unlockables[currentSuitID].unlockableName.ToLower().Replace(" ", ""); return result; } } internal class CatController : MonoBehaviour { private HoarderBugAI BugAI; private Animator animator; private bool IsDead; private Vector3 prevPosition; private static GameObject CatModel; private void HideBug() { try { Renderer[] componentsInChildren = ((Component)((Component)BugAI).transform.Find("HoarderBugModel")).GetComponentsInChildren<Renderer>(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } } catch (Exception) { for (int j = 0; j < ((Component)BugAI).transform.childCount - 1; j++) { } } } private void ShowNewModel() { try { MeshRenderer[] componentsInChildren = CatModel.GetComponentsInChildren<MeshRenderer>(); for (int i = 0; i < componentsInChildren.Length; i++) { ((Renderer)componentsInChildren[i]).enabled = true; } } catch (Exception) { } } private void Start() { //IL_001d: 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) BugAI = ((Component)this).GetComponent<HoarderBugAI>(); CatModel = Object.Instantiate<GameObject>(Plugin.Cat, ((Component)BugAI).transform.position, Quaternion.identity, ((Component)BugAI).transform); animator = CatModel.GetComponent<Animator>(); HideBug(); ShowNewModel(); } private void Update() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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) animator.SetBool("Hostile", ((EnemyAI)BugAI).movingTowardsTargetPlayer); animator.SetBool("Moving", prevPosition != ((Component)this).transform.position); prevPosition = ((Component)this).transform.position; if (((EnemyAI)BugAI).isEnemyDead && !IsDead) { Die(); } } private void Die() { animator.SetBool("Dead", true); IsDead = true; } } internal class GothController : MonoBehaviour { private FlowermanAI FlowerAI; private Animator animator; private bool IsDead; private Vector3 prevPosition; private static GameObject GothModel; private NavMeshAgent Agent; private void HideBug() { try { Renderer[] componentsInChildren = ((Component)((Component)FlowerAI).transform.Find("FlowermanModel")).GetComponentsInChildren<Renderer>(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } } catch (Exception) { for (int j = 0; j < ((Component)FlowerAI).transform.childCount - 1; j++) { } } } private void ShowNewModel() { try { MeshRenderer[] componentsInChildren = GothModel.GetComponentsInChildren<MeshRenderer>(); for (int i = 0; i < componentsInChildren.Length; i++) { ((Renderer)componentsInChildren[i]).enabled = true; } } catch (Exception) { } } private void Start() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) FlowerAI = ((Component)this).GetComponent<FlowermanAI>(); Agent = ((Component)FlowerAI).GetComponent<NavMeshAgent>(); GothModel = Object.Instantiate<GameObject>(Plugin.Goth, ((Component)FlowerAI).transform.position, ((Component)FlowerAI).transform.rotation, ((Component)FlowerAI).transform); animator = GothModel.GetComponent<Animator>(); HideBug(); ShowNewModel(); } private void Update() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) animator.SetFloat("VelocityX", Agent.velocity.x); animator.SetFloat("VelocityZ", Agent.velocity.z); if (((EnemyAI)FlowerAI).isEnemyDead && !IsDead) { Die(); } if (FlowerAI.inKillAnimation) { Kill(); } else { NotKill(); } } private void NotKill() { animator.SetBool("Kill", false); } private void Kill() { animator.SetBool("Kill", true); } private void Die() { animator.SetBool("Dead", true); IsDead = true; } } [BepInPlugin("Sai.Inval", "Invalid Gateway Pack", "0.1.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public class ScrapObject { public string name; public int rarity; public LevelTypes levels; public int Special; private AssetBundle? bundle; public ScrapObject(string MyName, int MyRarity, LevelTypes MyLevels) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) name = MyName; rarity = MyRarity; levels = MyLevels; Special = 0; bundle = null; } public ScrapObject(string MyName, int MyRarity, LevelTypes MyLevels, int MySpecial) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) name = MyName; rarity = MyRarity; levels = MyLevels; Special = MySpecial; bundle = null; } public void SetBundle(AssetBundle MyBundle) { bundle = MyBundle; } public AssetBundle GetBundle() { return bundle; } } public class PlayerModelObject { public string name; private AssetBundle? bundle = null; public PlayerModelObject(string MyName) { name = MyName; } public void SetBundle(AssetBundle MyBundle) { bundle = MyBundle; } public AssetBundle GetBundle() { return bundle; } } private static Plugin _instance; private static Harmony _harmony; public static ManualLogSource log; private bool _initialized; private List<ScrapObject> ScrapObjects; public static List<PlayerModelObject> PlayerModelObjects = new List<PlayerModelObject>(); public static GameObject Cat; public static GameObject Goth; public static ConfigFile config; internal static Plugin Instance { get { return _instance; } set { if ((Object)(object)_instance == (Object)null) { _instance = value; } else { Object.Destroy((Object)(object)value); } } } public static ConfigEntry<bool> EnableCustomScrap { get; private set; } public static ConfigEntry<bool> EnableSparky { get; private set; } public static ConfigEntry<bool> EnableSwolecat { get; private set; } private static void InitConfig() { } private void Awake() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown config = ((BaseUnityPlugin)this).Config; InitConfig(); _instance = this; if (_harmony == null) { _harmony = new Harmony("Sai.Inval"); } _harmony.PatchAll(typeof(BugPatch)); _harmony.PatchAll(typeof(BrackenPatch)); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Sai_Inval is loaded!"); ScrapObjects = new List<ScrapObject>(); ScrapObjects.Add(new ScrapObject("sparky", 30, (LevelTypes)(-1))); ScrapObjects.Add(new ScrapObject("swolekid", 30, (LevelTypes)(-1))); PlayerModelObjects.Add(new PlayerModelObject("Swokid")); LoadAssets(); } private void LoadAssets() { Assembly executingAssembly = Assembly.GetExecutingAssembly(); if (executingAssembly == null) { ((BaseUnityPlugin)this).Logger.LogError((object)"Failed to get assembly."); } ((BaseUnityPlugin)this).Logger.LogInfo((object)$"Scrap 1 name is {ScrapObjects[0].name} Rarity is {ScrapObjects.ElementAt(0).rarity}"); for (int i = 0; i < ScrapObjects.Count; i++) { ScrapObjects[i].SetBundle(BundleUtilities.LoadBundleFromInternalAssembly("Sai_Inval.Bundles.Scrap." + ScrapObjects[i].name, executingAssembly)); } for (int j = 0; j < ScrapObjects.Count; j++) { LoadScrap(ScrapObjects[j]); } for (int k = 0; k < PlayerModelObjects.Count; k++) { PlayerModelObjects[k].SetBundle(BundleUtilities.LoadBundleFromInternalAssembly("Sai_Inval.Bundles.PlayerModels." + PlayerModelObjects[k].name, executingAssembly)); } ((BaseUnityPlugin)this).Logger.LogInfo((object)PlayerModelObjects[0].name); bool flag = ((!((Object)(object)PlayerModelObjects[0].GetBundle() == (Object)null)) ? true : false); ((BaseUnityPlugin)this).Logger.LogInfo((object)flag); LoadPlayerModels(); LoadEnemies(executingAssembly); } private void LoadScrap(ScrapObject MyScrap) { Item val = MyScrap.GetBundle().LoadAsset<Item>("Assets/CustomScrap/ScriptableObjects/" + MyScrap.name + "Stats.asset"); if ((Object)(object)val == (Object)null) { ((BaseUnityPlugin)this).Logger.LogError((object)("Failed to load " + MyScrap.name + " from " + ((Object)MyScrap.GetBundle()).name)); return; } ((BaseUnityPlugin)this).Logger.LogInfo((object)(MyScrap.name + " successfully loaded!")); NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab); Items.RegisterScrap(val, MyScrap.rarity, (LevelTypes)(-1)); } private void LoadEnemies(Assembly assembly) { AssetBundle val = BundleUtilities.LoadBundleFromInternalAssembly("Sai_Inval.Bundles.Enemies.cat", assembly); Cat = val.LoadAsset<GameObject>("Cat.prefab"); if ((Object)(object)Cat != (Object)null) { ((BaseUnityPlugin)this).Logger.LogInfo((object)"Cat Exists"); } val = BundleUtilities.LoadBundleFromInternalAssembly("Sai_Inval.Bundles.Enemies.goth", assembly); Goth = val.LoadAsset<GameObject>("Goth.prefab"); if ((Object)(object)Goth != (Object)null) { ((BaseUnityPlugin)this).Logger.LogInfo((object)"Goth Exists"); } } private void LoadCosmetics(AssetBundle Bundle, int SpecialCase = 0) { } private void LoadPlayerModels() { ModelReplacementAPI.RegisterSuitModelReplacement("Swokid", typeof(SwokidReplacement)); } } public static class PluginInfo { public const string PLUGIN_ID = "Sai_Inval"; public const string PLUGIN_NAME = "Invalid Gateway Pack"; public const string PLUGIN_VERSION = "0.1.2"; public const string PLUGIN_GUID = "Sai.Inval"; } }