Decompiled source of DiscordCreatedMod v1.0.2
DiscordCreatedMod.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using DiscordCreatedMod; using DiscordCreatedMod.MonoBehaviours; using DiscordCreatedMod.Patches; using HarmonyLib; using Sandbox; using TMPro; using ULTRAKILL.Cheats; using UnityEngine; using UnityEngine.AI; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.InputSystem; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.SceneManagement; using UnityEngine.UI; using plog.Models; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("DiscordCreatedMod")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DiscordCreatedMod")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("f6513499-291a-4411-9f5a-fce939db566a")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] public class BlackjackGame : MonoBehaviour { public TextMeshProUGUI playerHandText; public TextMeshProUGUI dealerHandText; public TextMeshProUGUI resultText; private Deck deck; private Hand playerHand; private Hand dealerHand; public GameObject target; public Vector3 force; public Vector3 hitPoint; public float multiplier; public bool tryForExplode; public float critMultiplier = 0f; public GameObject sourceWeapon = null; public bool ignoreTotalDamageTakenMultiplier = false; public bool fromExplosion = false; private void Start() { DiscordCreatedModPlugin.PlayingJackblack = true; StartGame(); } public void StartGame() { deck = new Deck(); playerHand = new Hand(); dealerHand = new Hand(); playerHand.AddCard(deck.DrawCard()); playerHand.AddCard(deck.DrawCard()); dealerHand.AddCard(deck.DrawCard()); dealerHand.AddCard(deck.DrawCard()); UpdateUI(); CheckPlayerBlackjack(); } public void PlayerHit() { if (DiscordCreatedModPlugin.PlayingJackblack) { playerHand.AddCard(deck.DrawCard()); UpdateUI(); if (playerHand.GetScore() > 21) { EndGame("Player busts. Dealer wins."); } } } public void PlayerStand() { if (DiscordCreatedModPlugin.PlayingJackblack) { DealerTurn(); } } private void DealerTurn() { while (dealerHand.GetScore() < 17) { dealerHand.AddCard(deck.DrawCard()); } UpdateUI(); CheckWinner(); } private void CheckPlayerBlackjack() { if (playerHand.GetScore() == 21) { EndGame("Player has Blackjack! Player wins!"); } } private void CheckWinner() { int score = playerHand.GetScore(); int score2 = dealerHand.GetScore(); if (score2 > 21) { EndGame("Dealer busts. Player wins!"); } else if (score > score2) { EndGame("Player wins!"); } else if (score < score2) { EndGame("Dealer wins."); } else { EndGame("It's a tie."); } } private void EndGame(string result) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) ((TMP_Text)resultText).text = result; if ((Object)(object)DiscordCreatedModPlugin.PlayingEnemyJackblack == (Object)null) { DiscordCreatedModPlugin.PlayingJackblack = false; Object.Destroy((Object)(object)((Component)this).gameObject, 0.15f); return; } if (!(result == "Player wins!")) { if (result == "Dealer busts. Player wins!") { NoUnpauseingJackBlack.OnWin(target, force, hitPoint, multiplier, tryForExplode, critMultiplier, sourceWeapon, ignoreTotalDamageTakenMultiplier, fromExplosion); } else { NoUnpauseingJackBlack.OnLoss(); } } else { NoUnpauseingJackBlack.OnWin(target, force, hitPoint, multiplier, tryForExplode, critMultiplier, sourceWeapon, ignoreTotalDamageTakenMultiplier, fromExplosion); } DiscordCreatedModPlugin.PlayingJackblack = false; Object.Destroy((Object)(object)((Component)this).gameObject, 0.15f); } private void UpdateUI() { ((TMP_Text)playerHandText).text = "Player Hand: " + playerHand.ToString() + " (" + playerHand.GetScore() + ")"; ((TMP_Text)dealerHandText).text = "Dealer Hand: " + dealerHand.ToString() + " (" + dealerHand.GetScore() + ")"; } } public class Card { public string Suit { get; private set; } public int Value { get; private set; } public Card(string suit, int value) { Suit = suit; Value = value; } public override string ToString() { return $"{Value} of {Suit}"; } } public class Deck { private List<Card> cards; public Deck() { cards = new List<Card>(); string[] array = new string[4] { "Hearts", "Diamonds", "Clubs", "Spades" }; for (int i = 1; i <= 13; i++) { string[] array2 = array; foreach (string suit in array2) { cards.Add(new Card(suit, i)); } } Shuffle(); } public void Shuffle() { cards = cards.OrderBy((Card card) => Random.value).ToList(); } public Card DrawCard() { if (cards.Count > 0) { Card result = cards[0]; cards.RemoveAt(0); return result; } return null; } } public class Hand { public List<Card> Cards { get; private set; } public Hand() { Cards = new List<Card>(); } public void AddCard(Card card) { Cards.Add(card); } public int GetScore() { int num = 0; int num2 = 0; foreach (Card card in Cards) { if (card.Value > 10) { num += 10; } else if (card.Value == 1) { num2++; num += 11; } else { num += card.Value; } } while (num > 21 && num2 > 0) { num -= 10; num2--; } return num; } public override string ToString() { string text = ""; foreach (Card card in Cards) { text = text + card.ToString() + ", "; } return text.TrimEnd(',', ' '); } } namespace DiscordCreatedMod { [BepInPlugin("com.banana.DiscordCreatedMod", "DiscordCreatedMod", "1.0.0")] public class DiscordCreatedModPlugin : BaseUnityPlugin { private const string MyGUID = "com.banana.DiscordCreatedMod"; private const string PluginName = "DiscordCreatedMod"; private const string VersionString = "1.0.0"; private static readonly Harmony Harmony = new Harmony("com.banana.DiscordCreatedMod"); public static ManualLogSource Log = new ManualLogSource("DiscordCreatedMod"); public static GameObject RevolverBulet; public static GameObject RevolverBuletSuper; public static GameObject RevolverBeam; public static GameObject RailcannonProj; public static GameObject KITR; public static GameObject KITRLauncher; public static GameObject KITRLauncherWeapon; public static GameObject VirtueBeam; public static GameObject DroneHelper; public static GameObject DroneWeapon; public static GameObject TheDroneWeapon; public static GameObject CancerousRodent; public static GameObject CancerousRodentProjectiles; public static GameObject CancerBeam; public static GameObject Hakita; public static GameObject Banana; public static AudioClip GetBanana; public static AudioClip Stop; public static AudioClip Potassium; public static GameObject blackjack; public static GameObject ContinousReflect; public static bool PlayingJackblack; public static EnemyIdentifier PlayingEnemyJackblack; public static bool PlayingEnemyFromKaboomJackblack; private GameObject bigdoor; private GameObject gamblinggun; private GameObject gamblinggunWeapon; private GameObject slasherWeapon; private GameObject slasher; private GameObject nukeWeapon; private GameObject nuke; public static GameObject WalkingTerminal; public static GameObject CurrentWalkingTerminal; public Vector3 mapMinBounds = new Vector3(-1000f, 0f, -1000f); public Vector3 mapMaxBounds = new Vector3(1000f, 0f, 1000f); private IEnumerator LoadAddressable(string path, Action<GameObject> onSuccess) { AsyncOperationHandle<GameObject> handle = Addressables.LoadAssetAsync<GameObject>((object)path); yield return handle; handle.Completed += Handle_Completed; if ((int)handle.Status == 1) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("Successfully loaded " + path)); onSuccess?.Invoke(handle.Result); } else { ((BaseUnityPlugin)this).Logger.LogError((object)("Failed to load " + path)); } } private void Handle_Completed(AsyncOperationHandle<GameObject> obj) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Addressables.Release<GameObject>(obj); } private Object loadbundle(string name) { Assembly executingAssembly = Assembly.GetExecutingAssembly(); AssetBundle val = AssetBundle.LoadFromStream(executingAssembly.GetManifestResourceStream("DiscordCreatedMod.Bundles." + name)); return val.LoadAllAssets()[0]; } private void Awake() { Assembly executingAssembly = Assembly.GetExecutingAssembly(); Object obj = loadbundle("kitrlauncher"); KITRLauncher = (GameObject)(object)((obj is GameObject) ? obj : null); ref GameObject reference = ref gamblinggun; Object obj2 = loadbundle("letsgogambling"); reference = (GameObject)(object)((obj2 is GameObject) ? obj2 : null); Object obj3 = loadbundle("railcannonproj"); RailcannonProj = (GameObject)(object)((obj3 is GameObject) ? obj3 : null); ref GameObject reference2 = ref bigdoor; Object obj4 = loadbundle("bigdoor"); reference2 = (GameObject)(object)((obj4 is GameObject) ? obj4 : null); Object obj5 = loadbundle("dronehelper"); DroneHelper = (GameObject)(object)((obj5 is GameObject) ? obj5 : null); Object obj6 = loadbundle("drone"); DroneWeapon = (GameObject)(object)((obj6 is GameObject) ? obj6 : null); Object obj7 = loadbundle("cancerbeam"); CancerBeam = (GameObject)(object)((obj7 is GameObject) ? obj7 : null); Object obj8 = loadbundle("banana"); Banana = (GameObject)(object)((obj8 is GameObject) ? obj8 : null); Object obj9 = loadbundle("stopeverythin"); Stop = (AudioClip)(object)((obj9 is AudioClip) ? obj9 : null); Object obj10 = loadbundle("getbanana"); GetBanana = (AudioClip)(object)((obj10 is AudioClip) ? obj10 : null); Object obj11 = loadbundle("potassium"); Potassium = (AudioClip)(object)((obj11 is AudioClip) ? obj11 : null); Object obj12 = loadbundle("blackjack"); blackjack = (GameObject)(object)((obj12 is GameObject) ? obj12 : null); Object obj13 = loadbundle("walkingterminal"); WalkingTerminal = (GameObject)(object)((obj13 is GameObject) ? obj13 : null); Object obj14 = loadbundle("continousbeamreflect"); ContinousReflect = (GameObject)(object)((obj14 is GameObject) ? obj14 : null); ref GameObject reference3 = ref slasher; Object obj15 = loadbundle("slasher"); reference3 = (GameObject)(object)((obj15 is GameObject) ? obj15 : null); ref GameObject reference4 = ref nuke; Object obj16 = loadbundle("rocketnuke"); reference4 = (GameObject)(object)((obj16 is GameObject) ? obj16 : null); ((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: DiscordCreatedMod, VersionString: 1.0.0 is loading..."); Harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: DiscordCreatedMod, VersionString: 1.0.0 is loaded."); Log = ((BaseUnityPlugin)this).Logger; SceneManager.sceneLoaded += SceneManager_sceneLoaded; } public bool isLevelScene(string scene) { return scene != "Main Menu" && scene != "Intro" && scene != "Bootstrap"; } private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) ((BaseUnityPlugin)this).Logger.LogInfo((object)SceneHelper.CurrentScene); if (SceneHelper.CurrentScene == "CreditsMuseum2") { GameObject val = GameObject.Find("__Big door"); Object.Instantiate<GameObject>(bigdoor, val.transform.position, val.transform.rotation); Object.Destroy((Object)(object)val); } if (isLevelScene(SceneHelper.CurrentScene)) { SpawnRandomBanana(); } } private void OnDestroy() { Harmony harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } AssetBundle.UnloadAllAssetBundles(true); } private void SpawnRandomBanana() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0010: 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) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NavMeshTriangulation val = NavMesh.CalculateTriangulation(); if (val.vertices.Length == 0 || val.indices.Length == 0) { Debug.LogError((object)"No NavMesh found in the scene. Cannot spawn bananas."); return; } Vector3 randomPointInBounds = GetRandomPointInBounds(mapMinBounds, mapMaxBounds); NavMeshHit val2 = default(NavMeshHit); if (NavMesh.SamplePosition(randomPointInBounds, ref val2, 100f, -1)) { Object.Instantiate<GameObject>(Banana, ((NavMeshHit)(ref val2)).position + new Vector3(0f, 2f, 0f), Quaternion.identity).AddComponent<BananaPotassium>(); } else { SpawnRandomBanana(); } } private void Update() { if ((Object)(object)KITRLauncherWeapon == (Object)null) { KITRLauncherWeapon = MakeGun(5, KITRLauncher); } if ((Object)(object)TheDroneWeapon == (Object)null) { TheDroneWeapon = MakeGun(5, DroneWeapon); } if ((Object)(object)gamblinggunWeapon == (Object)null) { gamblinggunWeapon = MakeGun(5, gamblinggun); } if ((Object)(object)slasherWeapon == (Object)null) { slasherWeapon = MakeGun(5, slasher); } if ((Object)(object)nukeWeapon == (Object)null) { nukeWeapon = MakeGun(4, nuke); } } private Vector3 GetRandomPointInBounds(Vector3 minBounds, Vector3 maxBounds) { //IL_0001: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0031: 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) float num = Random.Range(minBounds.x, maxBounds.x); float num2 = Random.Range(minBounds.z, maxBounds.z); return new Vector3(num, 0f, num2); } public static GameObject MakeGun(int var, GameObject original) { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)MonoSingleton<GunControl>.Instance == (Object)null || (Object)(object)MonoSingleton<StyleHUD>.Instance == (Object)null) { return null; } if (!((Behaviour)MonoSingleton<GunControl>.Instance).enabled || !((Behaviour)MonoSingleton<StyleHUD>.Instance).enabled) { return null; } GameObject val = Object.Instantiate<GameObject>(original); if ((Object)(object)val == (Object)null) { return null; } val.transform.parent = ((Component)MonoSingleton<GunControl>.Instance).transform; val.transform.position = ((Component)MonoSingleton<GunControl>.Instance).transform.position; val.transform.localRotation = Quaternion.Euler(0f, 0f, 0f); MonoSingleton<GunControl>.Instance.slots[var].Add(val); MonoSingleton<GunControl>.Instance.allWeapons.Add(val); MonoSingleton<GunControl>.Instance.slotDict.Add(val, var); MonoSingleton<StyleHUD>.Instance.weaponFreshness.Add(val, 10f); val.SetActive(false); MonoSingleton<GunControl>.Instance.noWeapons = false; MonoSingleton<GunControl>.Instance.YesWeapon(); for (int i = 0; i < ((Component)MonoSingleton<GunControl>.Instance).transform.childCount; i++) { ((Component)((Component)MonoSingleton<GunControl>.Instance).transform.GetChild(i)).gameObject.SetActive(false); } return val; } private void Start() { ((MonoBehaviour)this).StartCoroutine(ShaderManager.LoadShadersAsync()); ((MonoBehaviour)this).StartCoroutine(LoadAddressable("Assets/Prefabs/Attacks and Projectiles/RevolverBulletSuper.prefab", delegate(GameObject go) { RevolverBuletSuper = go; })); ((MonoBehaviour)this).StartCoroutine(LoadAddressable("Assets/Prefabs/Attacks and Projectiles/RevolverBullet.prefab", delegate(GameObject go) { RevolverBulet = go; })); ((MonoBehaviour)this).StartCoroutine(LoadAddressable("Assets/Prefabs/Attacks and Projectiles/Hitscan Beams/Revolver Beam.prefab", delegate(GameObject go) { RevolverBeam = go; })); ((MonoBehaviour)this).StartCoroutine(LoadAddressable("Assets/Prefabs/Items/KITR.prefab", delegate(GameObject go) { KITR = go; })); ((MonoBehaviour)this).StartCoroutine(LoadAddressable("Virtue Insignia", delegate(GameObject go) { VirtueBeam = go; })); ((MonoBehaviour)this).StartCoroutine(LoadAddressable("Assets/Prefabs/Enemies/Cancerous Rodent.prefab", delegate(GameObject go) { CancerousRodent = go; })); ((MonoBehaviour)this).StartCoroutine(LoadAddressable("Assets/Prefabs/Attacks and Projectiles/Projectile Homing Explosive.prefab", delegate(GameObject go) { CancerousRodentProjectiles = go; })); ((MonoBehaviour)this).StartCoroutine(LoadAddressable("Assets/Prefabs/Items/DevPlushies/DevPlushie (Hakita).prefab", delegate(GameObject go) { Hakita = go; })); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(KITRLauncher)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(RailcannonProj)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(DroneHelper)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(DroneWeapon)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(bigdoor)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(CancerBeam)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(Banana)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(gamblinggun)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(blackjack)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(WalkingTerminal)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(slasher)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(nuke)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(nuke.GetComponent<RocketLauncher>().rocket)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(((Component)nuke.GetComponent<RocketLauncher>().cannonBall).gameObject)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(nuke.GetComponent<RocketLauncher>().rocket.GetComponent<Grenade>().explosion)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(nuke.GetComponent<RocketLauncher>().rocket.GetComponent<Grenade>().harmlessExplosion)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(nuke.GetComponent<RocketLauncher>().rocket.GetComponent<Grenade>().superExplosion)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(((Component)nuke.GetComponent<RocketLauncher>().cannonBall).gameObject.GetComponent<Grenade>().superExplosion)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(((Component)nuke.GetComponent<RocketLauncher>().cannonBall).gameObject.GetComponent<Grenade>().superExplosion)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(((Component)nuke.GetComponent<RocketLauncher>().cannonBall).gameObject.GetComponent<Grenade>().superExplosion)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(slasher)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(gamblinggun.GetComponent<LETSGOGAMBLING>().GamblingBeam)); } } [HarmonyPatch(typeof(GameStateManager))] [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class dontsubmit { public static bool Prefix(ref bool __result) { __result = false; return false; } } public static class ShaderManager { public class ShaderInfo { public string Name { get; set; } } private static bool LoadedShaders = false; public static Dictionary<string, Shader> shaderDictionary = new Dictionary<string, Shader>(); private static HashSet<Material> modifiedMaterials = new HashSet<Material>(); public static IEnumerator LoadShadersAsync() { AsyncOperationHandle<IResourceLocator> handle = Addressables.InitializeAsync(); while (!handle.IsDone) { yield return null; } if ((int)handle.Status == 1) { IResourceLocator result = handle.Result; foreach (object obj in ((ResourceLocationMap)result).Keys) { string text = (string)obj; if (!text.EndsWith(".shader")) { continue; } AsyncOperationHandle<Shader> shaderHandle = Addressables.LoadAssetAsync<Shader>((object)text); while (!shaderHandle.IsDone) { yield return null; } if ((int)shaderHandle.Status == 1) { Shader result2 = shaderHandle.Result; if ((Object)(object)result2 != (Object)null && ((Object)result2).name != "ULTRAKILL/PostProcessV2" && !shaderDictionary.ContainsKey(((Object)result2).name)) { shaderDictionary[((Object)result2).name] = result2; } } else { string str = "Failed to load shader: "; Debug.LogError((object)(str + shaderHandle.OperationException)); } } LoadedShaders = true; } else { string str2 = "Addressables initialization failed: "; Debug.LogError((object)(str2 + handle.OperationException)); } } public static string ModPath() { return Assembly.GetExecutingAssembly().Location.Substring(0, Assembly.GetExecutingAssembly().Location.LastIndexOf(Path.DirectorySeparatorChar)); } public static IEnumerator ApplyShadersAsync(GameObject[] allGameObjects) { yield return (object)new WaitUntil((Func<bool>)(() => LoadedShaders)); if (allGameObjects == null) { yield break; } foreach (GameObject gameObject in allGameObjects) { if ((Object)(object)gameObject == (Object)null) { continue; } Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>(true); foreach (Renderer renderer in componentsInChildren) { if ((Object)(object)renderer == (Object)null) { continue; } Material[] array2 = (Material[])(object)new Material[renderer.sharedMaterials.Length]; for (int i = 0; i < renderer.sharedMaterials.Length; i++) { Material material = (array2[i] = renderer.sharedMaterials[i]); Shader shader = null; if (!((Object)(object)material == (Object)null) && !((Object)(object)material.shader == (Object)null) && !modifiedMaterials.Contains(material) && !(((Object)material.shader).name == "ULTRAKILL/PostProcessV2") && shaderDictionary.TryGetValue(((Object)material.shader).name, out shader)) { array2[i].shader = shader; modifiedMaterials.Add(material); } } renderer.materials = array2; } yield return null; } } public static IEnumerator ApplyShaderToGameObject(GameObject gameObject) { yield return (object)new WaitUntil((Func<bool>)(() => LoadedShaders)); if ((Object)(object)gameObject == (Object)null) { yield break; } Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>(true); foreach (Renderer renderer in componentsInChildren) { if ((Object)(object)renderer == (Object)null) { continue; } Material[] array2 = (Material[])(object)new Material[renderer.sharedMaterials.Length]; for (int i = 0; i < renderer.sharedMaterials.Length; i++) { Material material = (array2[i] = renderer.sharedMaterials[i]); Shader shader = null; if (!((Object)(object)material == (Object)null) && !((Object)(object)material.shader == (Object)null) && !modifiedMaterials.Contains(material) && !(((Object)material.shader).name == "ULTRAKILL/PostProcessV2") && shaderDictionary.TryGetValue(((Object)material.shader).name, out shader)) { array2[i].shader = shader; modifiedMaterials.Add(material); } } renderer.materials = array2; } yield return null; } } } namespace DiscordCreatedMod.Utils { internal static class ModUtils { public static Transform GetPlayerTransform() { return MonoSingleton<PlayerTracker>.Instance.GetPlayer(); } } } namespace DiscordCreatedMod.Patches { [HarmonyPatch] internal class CentaurBeamChargeBack { [HarmonyPatch(typeof(ScaleNFade), "Start")] public static bool Prefix(ScaleNFade __instance) { //IL_0024: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) if (((Object)((Component)__instance).gameObject).name.Contains("CentaurBeam")) { RaycastHit[] array = Physics.SphereCastAll(((Component)__instance).transform.position, 5000f, -((Component)__instance).transform.forward, float.PositiveInfinity); if (array.Length != 0) { RaycastHit[] array2 = array; Coin val2 = default(Coin); for (int i = 0; i < array2.Length; i++) { RaycastHit val = array2[i]; DiscordCreatedModPlugin.Log.LogInfo((object)((Object)((Component)((RaycastHit)(ref val)).collider).gameObject).name); Transform transform = ((RaycastHit)(ref val)).transform; if (!((Component)transform).TryGetComponent<Coin>(ref val2)) { continue; } DiscordCreatedModPlugin.Log.LogInfo((object)"I hit a coin"); val2.DelayedReflectRevolver(((RaycastHit)(ref val)).point, (GameObject)null); ((Component)__instance).transform.forward = -((Component)__instance).transform.forward; ((Component)__instance).transform.parent = null; foreach (EnemyIdentifier currentEnemy in MonoSingleton<EnemyTracker>.Instance.GetCurrentEnemies()) { currentEnemy.InstaKill(); } return true; } } } return true; } } [HarmonyPatch(typeof(SpiderBody), "GetHurt")] internal class ControlWhereBeamsGoOnParryMaurice { public static bool Prefix(SpiderBody __instance, GameObject target, Vector3 force, Vector3 hitPoint, float multiplier, GameObject sourceWeapon = null) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Unknown result type (might be due to invalid IL or missing references) bool flag = false; float health = __instance.health; if (hitPoint == Vector3.zero) { hitPoint = target.transform.position; } bool goreOn = MonoSingleton<BloodsplatterManager>.Instance.goreOn; if ((Object)(object)__instance.eid == (Object)null) { __instance.eid = ((Component)__instance).GetComponent<EnemyIdentifier>(); } if (__instance.eid.hitter != "fire") { if (!__instance.eid.sandified && !__instance.eid.blessed) { GameObject val = Object.Instantiate<GameObject>(MonoSingleton<BloodsplatterManager>.Instance.GetGore((GoreType)3, __instance.eid, false), hitPoint, Quaternion.identity); if (Object.op_Implicit((Object)(object)val)) { val.transform.SetParent(__instance.gz.goreZone, true); if (__instance.eid.hitter == "drill") { Transform transform = val.transform; transform.localScale *= 2f; } if (__instance.health > 0f) { val.GetComponent<Bloodsplatter>().GetReady(); } if (multiplier >= 1f) { val.GetComponent<Bloodsplatter>().hpAmount = 30; } if (goreOn) { val.GetComponent<ParticleSystem>().Play(); } } if (__instance.eid.hitter != "shotgun" && __instance.eid.hitter != "drill" && ((Component)__instance).gameObject.activeInHierarchy) { if ((Object)(object)__instance.dripBlood != (Object)null) { __instance.currentDrip = Object.Instantiate<GameObject>(__instance.dripBlood, hitPoint, Quaternion.identity); } if (Object.op_Implicit((Object)(object)__instance.currentDrip)) { __instance.currentDrip.transform.parent = ((Component)__instance).transform; __instance.currentDrip.transform.LookAt(((Component)__instance).transform); __instance.currentDrip.transform.Rotate(180f, 180f, 180f); if (goreOn) { __instance.currentDrip.GetComponent<ParticleSystem>().Play(); } } } } else { Object.Instantiate<GameObject>(MonoSingleton<BloodsplatterManager>.Instance.GetGore((GoreType)3, __instance.eid, false), hitPoint, Quaternion.identity); } } if (!__instance.eid.dead) { if (!__instance.eid.blessed && !InvincibleEnemies.Enabled) { __instance.health -= 1f * multiplier; } if ((Object)(object)__instance.scalc == (Object)null) { __instance.scalc = MonoSingleton<StyleCalculator>.Instance; } if (__instance.health <= 0f) { flag = true; } if (((__instance.eid.hitter == "shotgunzone" || __instance.eid.hitter == "hammerzone") && __instance.parryable) || __instance.eid.hitter == "punch") { if (__instance.parryable) { __instance.parryable = false; MonoSingleton<FistControl>.Instance.currentPunch.Parry(false, __instance.eid, ""); __instance.currentExplosion = Object.Instantiate<GameObject>(AddressablesExtensions.ToAsset(__instance.beamExplosion), ((Component)__instance).transform.position, Quaternion.identity); if (!InvincibleEnemies.Enabled && !__instance.eid.blessed) { __instance.health -= (float)((__instance.parryFramesLeft > 0) ? 4 : 5) / __instance.eid.totalHealthModifier; } Explosion[] componentsInChildren = __instance.currentExplosion.GetComponentsInChildren<Explosion>(); foreach (Explosion val2 in componentsInChildren) { val2.speed *= __instance.eid.totalDamageModifier; val2.maxSize *= 1.75f * __instance.eid.totalDamageModifier; val2.damage = Mathf.RoundToInt(50f * __instance.eid.totalDamageModifier); val2.canHit = (AffectedSubjects)2; val2.friendlyFire = true; } __instance.predictedRot = ((Component)MonoSingleton<CameraController>.instance).transform.rotation; __instance.parryFramesLeft = 0; } else { __instance.parryFramesLeft = MonoSingleton<FistControl>.Instance.currentPunch.activeFrames; } } if (multiplier != 0f) { __instance.scalc.HitCalculator(__instance.eid.hitter, "spider", "", flag, __instance.eid, sourceWeapon); } if (health >= __instance.maxHealth / 2f && __instance.health < __instance.maxHealth / 2f) { if (__instance.ensims == null || __instance.ensims.Length == 0) { __instance.ensims = ((Component)__instance).GetComponentsInChildren<EnemySimplifier>(); } Object.Instantiate<GameObject>(__instance.woundedParticle, ((Component)__instance).transform.position, Quaternion.identity); if (!__instance.eid.puppet) { EnemySimplifier[] ensims = __instance.ensims; foreach (EnemySimplifier val3 in ensims) { if (!val3.ignoreCustomColor) { val3.ChangeMaterialNew((MaterialState)0, __instance.woundedMaterial); val3.ChangeMaterialNew((MaterialState)2, __instance.woundedEnrageMaterial); } } } } if (Object.op_Implicit((Object)(object)__instance.hurtSound) && health > 0f) { OneShotAudioExtension.PlayClipAtPoint(__instance.hurtSound, MonoSingleton<AudioMixerController>.Instance.goreGroup, ((Component)__instance).transform.position, 12, 1f, 0.75f, Random.Range(0.85f, 1.35f), (AudioRolloffMode)1, 1f, 100f); } if (__instance.health <= 0f && !__instance.eid.dead) { __instance.Die(); return false; } } else if (__instance.eid.hitter == "ground slam") { __instance.BreakCorpse(); } return false; } } [HarmonyPatch] internal class GrenadeHasVirtueBeam { [HarmonyPatch(typeof(Grenade), "Explode")] public static bool Prefix(Grenade __instance, bool big = false, bool harmless = false, bool super = false, float sizeMultiplier = 1f, bool ultrabooster = false, GameObject exploderWeapon = null, bool fup = false) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown if (__instance.rocket) { return true; } if (!__instance.exploded) { __instance.exploded = true; if (MonoSingleton<StainVoxelManager>.Instance.TryIgniteAt(((Component)__instance).transform.position, 3)) { harmless = false; } GameObject val = (harmless ? Object.Instantiate<GameObject>(DiscordCreatedModPlugin.VirtueBeam, ((Component)__instance).transform.position, Quaternion.identity) : ((!super) ? Object.Instantiate<GameObject>(DiscordCreatedModPlugin.VirtueBeam, ((Component)__instance).transform.position, Quaternion.identity) : Object.Instantiate<GameObject>(DiscordCreatedModPlugin.VirtueBeam, ((Component)__instance).transform.position, Quaternion.identity))); Transform transform = val.transform; transform.localScale *= sizeMultiplier; VirtueInsignia val2 = default(VirtueInsignia); if (val.TryGetComponent<VirtueInsignia>(ref val2)) { val2.predictive = false; val2.windUpSpeedMultiplier = 666666f; val2.noTracking = true; val2.activating = true; EnemyTarget val3 = new EnemyTarget(((Component)val2).transform); ((Object)val).name = ((Object)val).name + "CoreEjectExplosion"; } Object.Destroy((Object)(object)((Component)__instance).gameObject); return false; } return false; } [HarmonyPatch(typeof(VirtueInsignia), "OnTriggerEnter")] [HarmonyPrefix] public static bool kilThem(VirtueInsignia __instance, Collider other) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Invalid comparison between Unknown and I4 //IL_0076: 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) if (!((Object)((Component)__instance).gameObject).name.Contains("CoreEjectExplosion")) { return true; } __instance.hasHitTarget = true; if (((Component)other).gameObject.CompareTag("Player")) { if ((int)MonoSingleton<PlayerTracker>.Instance.playerType == 1) { MonoSingleton<PlatformerMovement>.Instance.Burn(false); } else { MonoSingleton<NewMovement>.Instance.LaunchFromPoint(((Component)MonoSingleton<NewMovement>.Instance).transform.position, 200f, 5f); MonoSingleton<NewMovement>.Instance.GetHurt(__instance.damage, true, 1f, false, false, 0.35f, false); } } EnemyIdentifier val = ((Component)other).GetComponent<EnemyIdentifier>(); if ((Object)(object)val == (Object)null) { EnemyIdentifierIdentifier component = ((Component)other).GetComponent<EnemyIdentifierIdentifier>(); if ((Object)(object)component != (Object)null) { val = component.eid; } } Rigidbody val2 = default(Rigidbody); if ((Object)(object)val != (Object)null && ((Component)other).TryGetComponent<Rigidbody>(ref val2)) { __instance.hasHitTarget = true; val2.AddExplosionForce(1000f, ((Component)__instance).transform.position, 10f); val.SimpleDamage((float)__instance.damage); } Flammable component2 = ((Component)other).GetComponent<Flammable>(); if (Object.op_Implicit((Object)(object)component2) && !component2.playerOnly) { component2.Burn(10f, false); } return false; } } [HarmonyPatch(typeof(Gutterman), "FixedUpdate")] internal class GuttermanShootsCancerthings { public static bool Prefix(Gutterman __instance) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) if (__instance.dead) { return false; } if (__instance.inAction) { __instance.rb.isKinematic = !__instance.moveForward; if (__instance.moveForward) { RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)__instance).transform.position + Vector3.up + ((Component)__instance).transform.forward, Vector3.down, ref val, (__instance.eid.target == null) ? 22f : Mathf.Max(22f, ((Component)__instance).transform.position.y - __instance.eid.target.position.y + 2.5f), LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1)), (QueryTriggerInteraction)1)) { __instance.rb.velocity = ((Component)__instance).transform.forward * (float)(__instance.hasShield ? 25 : 45) * __instance.anim.speed * __instance.eid.totalSpeedModifier; } else { __instance.rb.velocity = Vector3.zero; } } } if (__instance.firing) { if (__instance.bulletCooldown == 0f) { Vector3 val2 = __instance.shootPoint.position + __instance.shootPoint.right * Random.Range(-0.2f, 0.2f) + __instance.shootPoint.up * Random.Range(-0.2f, 0.2f); if (Physics.Raycast(__instance.shootPoint.position - __instance.shootPoint.forward * 4f, __instance.shootPoint.forward, 4f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)5)))) { val2 = __instance.shootPoint.position - __instance.shootPoint.forward * 4f; } GameObject val3 = Object.Instantiate<GameObject>(chooseWhatToShoot(), val2, __instance.shootPoint.rotation); val3.transform.Rotate(new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f))); Rigidbody val4 = default(Rigidbody); if (val3.TryGetComponent<Rigidbody>(ref val4)) { val4.AddForce(__instance.shootPoint.forward * 2f, (ForceMode)2); } Projectile val5 = default(Projectile); if (val3.TryGetComponent<Projectile>(ref val5)) { val5.target = __instance.eid.target; Projectile obj = val5; obj.damage *= __instance.eid.totalDamageModifier; Transform transform = val3.transform; transform.position += val3.transform.forward * 3f; } RevolverBeam val6 = default(RevolverBeam); if (val3.TryGetComponent<RevolverBeam>(ref val6)) { val6.target = __instance.eid.target; RevolverBeam obj2 = val6; obj2.damage *= __instance.eid.totalDamageModifier; val3.AddComponent<CancerGiver>(); } __instance.bulletCooldown = 0.05f / __instance.windup; return false; } __instance.bulletCooldown = Mathf.MoveTowards(__instance.bulletCooldown, 0f, Time.fixedDeltaTime); } return false; } private static GameObject chooseWhatToShoot() { return (GameObject)(Random.Range(0, 4) switch { 0 => DiscordCreatedModPlugin.CancerousRodent, 1 => DiscordCreatedModPlugin.CancerousRodentProjectiles, 2 => DiscordCreatedModPlugin.CancerBeam, 3 => DiscordCreatedModPlugin.Hakita, _ => null, }); } } [HarmonyPatch(typeof(Nailgun))] internal class HitscanNailgun { private static GameObject nailthing; [HarmonyPatch("Shoot")] public static bool Prefix(Nailgun __instance) { //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04e5: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) nailthing = __instance.nail; __instance.UpdateAnimationWeight(); __instance.fireCooldown = __instance.currentFireRate; __instance.shotSuccesfully = true; if (__instance.variation == 1 && (!Object.op_Implicit((Object)(object)__instance.wid) || __instance.wid.delay == 0f)) { if (__instance.altVersion) { WeaponCharges wc = __instance.wc; wc.naiSaws -= 1f; } else { WeaponCharges wc2 = __instance.wc; wc2.naiAmmo -= 1f; } } __instance.anim.SetTrigger("Shoot"); __instance.barrelNum++; if (__instance.barrelNum >= __instance.shootPoints.Length) { __instance.barrelNum = 0; } GameObject val = ((!__instance.burnOut) ? Object.Instantiate<GameObject>(__instance.muzzleFlash, __instance.shootPoints[__instance.barrelNum].transform) : Object.Instantiate<GameObject>(__instance.muzzleFlash2, __instance.shootPoints[__instance.barrelNum].transform)); if (!__instance.altVersion) { AudioSource component = val.GetComponent<AudioSource>(); if (__instance.burnOut) { component.volume = 0.65f - __instance.wid.delay * 2f; if (component.volume < 0f) { component.volume = 0f; } component.pitch = 2f; __instance.currentSpread = __instance.spread * 2f; } else { if (__instance.heatSinks < 1f) { component.pitch = 0.75f; component.volume = 0.25f - __instance.wid.delay * 2f; if (component.volume < 0f) { component.volume = 0f; } } else { component.volume = 0.65f - __instance.wid.delay * 2f; if (component.volume < 0f) { component.volume = 0f; } } __instance.currentSpread = __instance.spread; } } else if (__instance.burnOut) { __instance.currentSpread = 45f; } else if (__instance.altVersion && __instance.variation == 0) { if (__instance.heatSinks < 1f) { __instance.currentSpread = 45f; } else { __instance.currentSpread = Mathf.Lerp(0f, 45f, Mathf.Max(0f, __instance.heatUp - 0.25f)); } } else { __instance.currentSpread = 0f; } GameObject val2 = ((!__instance.burnOut) ? Object.Instantiate<GameObject>(DiscordCreatedModPlugin.RevolverBeam, ((Component)__instance.cc).transform.position + ((Component)__instance.cc).transform.forward, ((Component)__instance).transform.rotation) : Object.Instantiate<GameObject>(DiscordCreatedModPlugin.RevolverBeam, ((Component)__instance.cc).transform.position + ((Component)__instance.cc).transform.forward, ((Component)__instance).transform.rotation)); if (__instance.altVersion && __instance.variation == 0 && __instance.heatSinks >= 1f) { __instance.heatUp = Mathf.MoveTowards(__instance.heatUp, 1f, 0.125f); } val2.transform.forward = ((Component)__instance.cc).transform.forward; if (Physics.Raycast(((Component)__instance.cc).transform.position, ((Component)__instance.cc).transform.forward, 1f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1)))) { val2.transform.position = ((Component)__instance.cc).transform.position; } if (Object.op_Implicit((Object)(object)__instance.targeter.CurrentTarget) && __instance.targeter.IsAutoAimed) { Transform transform = val2.transform; Vector3 position = ((Component)__instance.cc).transform.position; Bounds bounds = __instance.targeter.CurrentTarget.bounds; Vector3 val3 = ((Bounds)(ref bounds)).center - ((Component)__instance.cc).transform.position; transform.position = position + ((Vector3)(ref val3)).normalized; Transform transform2 = val2.transform; bounds = __instance.targeter.CurrentTarget.bounds; transform2.LookAt(((Bounds)(ref bounds)).center); } val2.transform.Rotate(Random.Range((0f - __instance.currentSpread) / 3f, __instance.currentSpread / 3f), Random.Range((0f - __instance.currentSpread) / 3f, __instance.currentSpread / 3f), Random.Range((0f - __instance.currentSpread) / 3f, __instance.currentSpread / 3f)); Rigidbody val4 = default(Rigidbody); if (val2.TryGetComponent<Rigidbody>(ref val4)) { val4.velocity = val2.transform.forward * 200f; } RevolverBeam val5 = default(RevolverBeam); if (val2.TryGetComponent<RevolverBeam>(ref val5)) { val5.sourceWeapon = __instance.gc.currentWeapon; val5.damage = __instance.nail.GetComponent<Nail>().damage; if (__instance.altVersion && __instance.variation != 1) { if (__instance.heatSinks >= 1f && __instance.variation != 2) { val5.hitAmount = (int)Mathf.Lerp(3f, 1f, __instance.heatUp); } else { val5.hitAmount = 1; } } if (__instance.altVersion) { RevolverBeam obj = val5; obj.hitAmount += 3; } } if (!__instance.burnOut) { __instance.cc.CameraShake(0.1f); } else { __instance.cc.CameraShake(0.35f); } if (__instance.altVersion) { MonoSingleton<RumbleManager>.Instance.SetVibration(RumbleProperties.Sawblade); } return false; } [HarmonyPatch("SuperSaw")] [HarmonyPrefix] public static bool SuperSaw(Nailgun __instance) { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_0100: 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_011b: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) __instance.fireCooldown = __instance.currentFireRate; __instance.shotSuccesfully = true; __instance.anim.SetLayerWeight(1, 0f); __instance.anim.SetTrigger("SuperShoot"); MonoSingleton<RumbleManager>.Instance.SetVibration(RumbleProperties.SuperSaw); __instance.barrelNum++; if (__instance.barrelNum >= __instance.shootPoints.Length) { __instance.barrelNum = 0; } Object.Instantiate<GameObject>(__instance.muzzleFlash2, __instance.shootPoints[__instance.barrelNum].transform); __instance.currentSpread = 0f; GameObject val = Object.Instantiate<GameObject>(DiscordCreatedModPlugin.RevolverBeam, ((Component)__instance.cc).transform.position + ((Component)__instance.cc).transform.forward, ((Component)__instance).transform.rotation); val.transform.forward = ((Component)__instance.cc).transform.forward; if (Physics.Raycast(((Component)__instance.cc).transform.position, ((Component)__instance.cc).transform.forward, 1f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1)))) { val.transform.position = ((Component)__instance.cc).transform.position; } if (Object.op_Implicit((Object)(object)__instance.targeter.CurrentTarget) && __instance.targeter.IsAutoAimed) { Transform transform = val.transform; Vector3 position = ((Component)__instance.cc).transform.position; Bounds bounds = __instance.targeter.CurrentTarget.bounds; Vector3 val2 = ((Bounds)(ref bounds)).center - ((Component)__instance.cc).transform.position; transform.position = position + ((Vector3)(ref val2)).normalized; Transform transform2 = val.transform; bounds = __instance.targeter.CurrentTarget.bounds; transform2.LookAt(((Bounds)(ref bounds)).center); } Rigidbody val3 = default(Rigidbody); if (val.TryGetComponent<Rigidbody>(ref val3)) { val3.velocity = val.transform.forward * 200f; } RevolverBeam val4 = default(RevolverBeam); if (val.TryGetComponent<RevolverBeam>(ref val4)) { val4.damage = __instance.heatedNail.GetComponent<Nail>().damage; val4.hitAmount = Mathf.RoundToInt(__instance.heatUp * 3f); val4.sourceWeapon = __instance.gc.currentWeapon; } __instance.heatSinks -= 1f; __instance.heatUp = 0f; __instance.cc.CameraShake(0.5f); return false; } [HarmonyPatch(typeof(RevolverBeam), "ExecuteHits")] [HarmonyPrefix] public static bool CheckIfEnemyAndAttachNail(RevolverBeam __instance, RaycastHit currentHit) { //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) Collider collider = ((RaycastHit)(ref currentHit)).collider; if ((Object)(object)collider == (Object)null) { return true; } if ((((Component)collider).gameObject.layer == 10 || ((Component)collider).gameObject.layer == 11) && (((Component)collider).gameObject.CompareTag("Head") || ((Component)collider).gameObject.CompareTag("Body") || ((Component)collider).gameObject.CompareTag("Limb") || ((Component)collider).gameObject.CompareTag("EndLimb") || ((Component)collider).gameObject.CompareTag("Enemy"))) { if ((Object)(object)__instance.sourceWeapon == (Object)null) { return true; } if ((Object)(object)__instance.sourceWeapon.GetComponent<Nailgun>() != (Object)null && (Object)(object)nailthing != (Object)null) { GameObject val = Object.Instantiate<GameObject>(nailthing, ((RaycastHit)(ref currentHit)).point, Quaternion.identity); Nail component = val.GetComponent<Nail>(); component.TouchEnemy(((Component)collider).gameObject.transform); if (component.sawblade) { Object.Destroy((Object)(object)val); } } } return true; } } [HarmonyPatch(typeof(Shotgun))] internal class HitscanShotgun { [HarmonyPatch("Shoot")] public static bool Prefix(Shotgun __instance) { //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05e5: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_0644: Unknown result type (might be due to invalid IL or missing references) //IL_060a: Unknown result type (might be due to invalid IL or missing references) //IL_061a: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Unknown result type (might be due to invalid IL or missing references) //IL_0629: Unknown result type (might be due to invalid IL or missing references) //IL_062e: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0689: Unknown result type (might be due to invalid IL or missing references) //IL_068e: Unknown result type (might be due to invalid IL or missing references) //IL_0692: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_07d9: Unknown result type (might be due to invalid IL or missing references) //IL_07e5: Unknown result type (might be due to invalid IL or missing references) //IL_0829: Unknown result type (might be due to invalid IL or missing references) __instance.gunReady = false; int num = 12; if (__instance.variation == 1) { switch (__instance.primaryCharge) { case 0: num = 10; __instance.gunAud.pitch = Random.Range(1.15f, 1.25f); break; case 1: num = 16; __instance.gunAud.pitch = Random.Range(0.95f, 1.05f); break; case 2: num = 24; __instance.gunAud.pitch = Random.Range(0.75f, 0.85f); break; case 3: num = 0; __instance.gunAud.pitch = Random.Range(0.75f, 0.85f); break; } } MonoSingleton<CameraController>.Instance.StopShake(); Vector3 val = __instance.cam.transform.forward; Bounds bounds; Vector3 val2; if (Object.op_Implicit((Object)(object)__instance.targeter.CurrentTarget) && __instance.targeter.IsAutoAimed) { bounds = __instance.targeter.CurrentTarget.bounds; val2 = ((Bounds)(ref bounds)).center - MonoSingleton<CameraController>.Instance.GetDefaultPos(); val = ((Vector3)(ref val2)).normalized; } __instance.rhits = Physics.RaycastAll(__instance.cam.transform.position, val, 4f, LayerMask.op_Implicit(__instance.shotgunZoneLayerMask)); if (__instance.rhits.Length != 0) { RaycastHit[] rhits = __instance.rhits; for (int i = 0; i < rhits.Length; i++) { RaycastHit val3 = rhits[i]; if (!((Component)((RaycastHit)(ref val3)).collider).gameObject.CompareTag("Body")) { continue; } EnemyIdentifierIdentifier componentInParent = ((Component)((RaycastHit)(ref val3)).collider).GetComponentInParent<EnemyIdentifierIdentifier>(); if (!Object.op_Implicit((Object)(object)componentInParent) || !Object.op_Implicit((Object)(object)componentInParent.eid)) { continue; } EnemyIdentifier eid = componentInParent.eid; if (!eid.dead && !eid.blessed) { AnimatorStateInfo currentAnimatorStateInfo = __instance.anim.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Equip")) { MonoSingleton<StyleHUD>.Instance.AddPoints(50, "ultrakill.quickdraw", __instance.gc.currentWeapon, eid, -1, "", ""); } } eid.hitter = "shotgunzone"; if (!eid.hitterWeapons.Contains("shotgun" + __instance.variation)) { eid.hitterWeapons.Add("shotgun" + __instance.variation); } GameObject gameObject = ((Component)((RaycastHit)(ref val3)).collider).gameObject; val2 = ((Component)eid).transform.position - ((Component)__instance).transform.position; eid.DeliverDamage(gameObject, ((Vector3)(ref val2)).normalized * 10000f, ((RaycastHit)(ref val3)).point, 4f, false, 0f, ((Component)__instance).gameObject, false, false); } } MonoSingleton<RumbleManager>.Instance.SetVibrationTracked(RumbleProperties.GunFireProjectiles, ((Component)__instance).gameObject); if (__instance.variation != 1 || __instance.primaryCharge != 3) { for (int j = 0; j < num; j++) { GameObject val4 = Object.Instantiate<GameObject>(DiscordCreatedModPlugin.RevolverBeam, __instance.cam.transform.position, __instance.cam.transform.rotation); RevolverBeam component = val4.GetComponent<RevolverBeam>(); component.sourceWeapon = __instance.gc.currentWeapon; if (Object.op_Implicit((Object)(object)__instance.targeter.CurrentTarget) && __instance.targeter.IsAutoAimed) { Transform transform = val4.transform; bounds = __instance.targeter.CurrentTarget.bounds; transform.LookAt(((Bounds)(ref bounds)).center); } if (__instance.variation == 1) { switch (__instance.primaryCharge) { case 0: val4.transform.Rotate(Random.Range((0f - __instance.spread) / 1.5f, __instance.spread / 1.5f), Random.Range((0f - __instance.spread) / 1.5f, __instance.spread / 1.5f), Random.Range((0f - __instance.spread) / 1.5f, __instance.spread / 1.5f)); break; case 1: val4.transform.Rotate(Random.Range(0f - __instance.spread, __instance.spread), Random.Range(0f - __instance.spread, __instance.spread), Random.Range(0f - __instance.spread, __instance.spread)); break; case 2: val4.transform.Rotate(Random.Range((0f - __instance.spread) * 2f, __instance.spread * 2f), Random.Range((0f - __instance.spread) * 2f, __instance.spread * 2f), Random.Range((0f - __instance.spread) * 2f, __instance.spread * 2f)); break; } } else { val4.transform.Rotate(Random.Range(0f - __instance.spread, __instance.spread), Random.Range(0f - __instance.spread, __instance.spread), Random.Range(0f - __instance.spread, __instance.spread)); } } } else { Vector3 val5 = __instance.cam.transform.position + __instance.cam.transform.forward; RaycastHit val6 = default(RaycastHit); if (Physics.Raycast(__instance.cam.transform.position, __instance.cam.transform.forward, ref val6, 1f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1)))) { val5 = ((RaycastHit)(ref val6)).point - __instance.cam.transform.forward * 0.1f; } GameObject val7 = Object.Instantiate<GameObject>(__instance.explosion, val5, __instance.cam.transform.rotation); if (Object.op_Implicit((Object)(object)__instance.targeter.CurrentTarget) && __instance.targeter.IsAutoAimed) { Transform transform2 = val7.transform; bounds = __instance.targeter.CurrentTarget.bounds; transform2.LookAt(((Bounds)(ref bounds)).center); } Explosion[] componentsInChildren = val7.GetComponentsInChildren<Explosion>(); foreach (Explosion val8 in componentsInChildren) { val8.sourceWeapon = __instance.gc.currentWeapon; val8.enemyDamageMultiplier = 1f; val8.maxSize *= 1.5f; val8.damage = 50; } } if (__instance.variation != 1) { __instance.gunAud.pitch = Random.Range(0.95f, 1.05f); } __instance.gunAud.clip = __instance.shootSound; __instance.gunAud.volume = 0.45f; __instance.gunAud.panStereo = 0f; __instance.gunAud.Play(); __instance.cc.CameraShake(1f); if (__instance.variation == 1) { __instance.anim.SetTrigger("PumpFire"); } else { __instance.anim.SetTrigger("Fire"); } Transform[] shootPoints = __instance.shootPoints; foreach (Transform val9 in shootPoints) { Object.Instantiate<GameObject>(__instance.muzzleFlash, ((Component)val9).transform.position, ((Component)val9).transform.rotation); } __instance.releasingHeat = false; __instance.tempColor.a = 1f; ((Renderer)__instance.heatSinkSMR).sharedMaterials[3].SetColor("_TintColor", __instance.tempColor); if (__instance.variation == 1) { __instance.primaryCharge = 0; } return false; } } [HarmonyPatch("Shoot")] internal class JETPACKJOYRIDE { [HarmonyPatch(typeof(RocketLauncher), "Shoot")] [HarmonyPatch(typeof(Railcannon), "Shoot")] [HarmonyPatch(typeof(Nailgun), "Shoot")] [HarmonyPatch(typeof(Shotgun), "Shoot")] [HarmonyPatch(typeof(Revolver), "Shoot")] [HarmonyPostfix] public static void Postfix() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) MonoSingleton<NewMovement>.instance.rb.AddForce(Vector3.ClampMagnitude(-((Component)MonoSingleton<CameraController>.instance).transform.forward, 1000f) * 36666f, (ForceMode)0); } } [HarmonyPatch] internal class NoUnpauseingJackBlack { [HarmonyPatch(typeof(OptionsMenuToManager), "UnPause")] public static bool Prefix() { return DiscordCreatedModPlugin.PlayingJackblack; } [HarmonyPatch(typeof(EnemyIdentifier), "DeliverDamage")] public static bool Prefix(EnemyIdentifier __instance, GameObject target, Vector3 force, Vector3 hitPoint, float multiplier, bool tryForExplode, float critMultiplier = 0f, GameObject sourceWeapon = null, bool ignoreTotalDamageTakenMultiplier = false, bool fromExplosion = false) { //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) if (__instance.dead) { return true; } float num = multiplier; if (!ignoreTotalDamageTakenMultiplier) { num *= __instance.totalDamageTakenMultiplier; } num /= __instance.totalHealthModifier; if (__instance.isBoss && __instance.difficulty >= 4) { num = ((__instance.difficulty != 5) ? (num / 1.5f) : (num / 2f)); } if (__instance.weaknesses.Length != 0) { for (int i = 0; i < __instance.weaknesses.Length; i++) { if (__instance.hitter == __instance.weaknesses[i] || (__instance.hitterAttributes.Contains((HitterAttribute)2) && __instance.weaknesses[i] == "electricity")) { num *= __instance.weaknessMultipliers[i]; } } } if (__instance.getFireDamageMultiplier && __instance.burners.Count > 0 && __instance.hitter != "fire" && __instance.hitter != "explosion" && __instance.hitter != "ffexplosion") { num *= 1.5f; } if (!__instance.beingZapped && __instance.hitterAttributes.Contains((HitterAttribute)2) && __instance.hitter != "aftershock" && (__instance.nailsAmount > 0 || __instance.stuckMagnets.Count > 0 || __instance.touchingWaters.Count > 0) && __instance.hitter == "zapper" && num > __instance.health) { num = __instance.health - 0.001f; } if (__instance.health - num <= 0f && Random.value <= 0.01f) { if (DiscordCreatedModPlugin.PlayingJackblack) { return false; } DiscordCreatedModPlugin.PlayingJackblack = true; DiscordCreatedModPlugin.PlayingEnemyJackblack = __instance; __instance.ForceGetHealth(); MonoSingleton<OptionsMenuToManager>.instance.Pause(); BlackjackGame component = Object.Instantiate<GameObject>(DiscordCreatedModPlugin.blackjack).GetComponent<BlackjackGame>(); component.target = target; component.force = force; component.hitPoint = hitPoint; component.multiplier = multiplier; component.tryForExplode = tryForExplode; component.critMultiplier = critMultiplier; component.sourceWeapon = sourceWeapon; component.ignoreTotalDamageTakenMultiplier = ignoreTotalDamageTakenMultiplier; component.fromExplosion = fromExplosion; return false; } return true; } [HarmonyPatch(typeof(EnemyIdentifier), "Awake")] [HarmonyPostfix] public static void setHealthRememberer(EnemyIdentifier __instance) { ((Component)__instance).gameObject.AddComponent<HealthRememberer>().health = __instance.health; } public static void OnLoss() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Invalid comparison between Unknown and I4 //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Invalid comparison between Unknown and I4 //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected I4, but got Unknown EnemyIdentifier playingEnemyJackblack = DiscordCreatedModPlugin.PlayingEnemyJackblack; float health = ((Component)playingEnemyJackblack).gameObject.GetComponent<HealthRememberer>().health; if ((int)playingEnemyJackblack.enemyType == 1 || (int)playingEnemyJackblack.enemyType == 9) { if (!Object.op_Implicit((Object)(object)playingEnemyJackblack.drone)) { playingEnemyJackblack.drone = ((Component)playingEnemyJackblack).GetComponent<Drone>(); } if (Object.op_Implicit((Object)(object)playingEnemyJackblack.drone)) { playingEnemyJackblack.drone.health = health; return; } } else if ((int)playingEnemyJackblack.enemyType == 4) { if (!Object.op_Implicit((Object)(object)playingEnemyJackblack.spider)) { playingEnemyJackblack.spider = ((Component)playingEnemyJackblack).GetComponent<SpiderBody>(); } if (Object.op_Implicit((Object)(object)playingEnemyJackblack.spider)) { playingEnemyJackblack.spider.health = health; return; } } else { EnemyClass enemyClass = playingEnemyJackblack.enemyClass; EnemyClass val = enemyClass; switch ((int)val) { default: return; case 0: if (!Object.op_Implicit((Object)(object)playingEnemyJackblack.zombie)) { playingEnemyJackblack.zombie = ((Component)playingEnemyJackblack).GetComponent<Zombie>(); } if (Object.op_Implicit((Object)(object)playingEnemyJackblack.zombie)) { playingEnemyJackblack.zombie.health = health; return; } break; case 1: if (!Object.op_Implicit((Object)(object)playingEnemyJackblack.machine)) { playingEnemyJackblack.machine = ((Component)playingEnemyJackblack).GetComponent<Machine>(); } if (Object.op_Implicit((Object)(object)playingEnemyJackblack.machine)) { playingEnemyJackblack.machine.health = health; } break; case 2: if (!Object.op_Implicit((Object)(object)playingEnemyJackblack.statue)) { playingEnemyJackblack.statue = ((Component)playingEnemyJackblack).GetComponent<Statue>(); } if (Object.op_Implicit((Object)(object)playingEnemyJackblack.statue)) { playingEnemyJackblack.statue.health = health; return; } break; } } DiscordCreatedModPlugin.PlayingEnemyJackblack.ForceGetHealth(); } public static void OnWin(GameObject target, Vector3 force, Vector3 hitPoint, float multiplier, bool tryForExplode, float critMultiplier = 0f, GameObject sourceWeapon = null, bool ignoreTotalDamageTakenMultiplier = false, bool fromExplosion = false) { //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Invalid comparison between Unknown and I4 //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_0503: Invalid comparison between Unknown and I4 //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Invalid comparison between Unknown and I4 //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Invalid comparison between Unknown and I4 //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Invalid comparison between Unknown and I4 //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Invalid comparison between Unknown and I4 //IL_0661: Unknown result type (might be due to invalid IL or missing references) //IL_06af: Unknown result type (might be due to invalid IL or missing references) //IL_06b4: Unknown result type (might be due to invalid IL or missing references) //IL_06b6: Unknown result type (might be due to invalid IL or missing references) //IL_06b8: Unknown result type (might be due to invalid IL or missing references) //IL_06ba: Unknown result type (might be due to invalid IL or missing references) //IL_06cd: Expected I4, but got Unknown //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_07cb: Unknown result type (might be due to invalid IL or missing references) //IL_08ec: Unknown result type (might be due to invalid IL or missing references) //IL_08f0: Unknown result type (might be due to invalid IL or missing references) EnemyIdentifier playingEnemyJackblack = DiscordCreatedModPlugin.PlayingEnemyJackblack; if (EnemyIdentifierDebug.Active) { EnemyIdentifier.Log.Fine("Delivering damage to: " + ((Object)((Component)playingEnemyJackblack).gameObject).name + ", Damage:" + multiplier, Array.Empty<Tag>()); } if ((Object)(object)target == (Object)(object)((Component)playingEnemyJackblack).gameObject) { EnemyIdentifierIdentifier componentInChildren = ((Component)playingEnemyJackblack).GetComponentInChildren<EnemyIdentifierIdentifier>(); if ((Object)(object)componentInChildren != (Object)null) { target = ((Component)componentInChildren).gameObject; } } if ((Object)(object)sourceWeapon != (Object)null) { if (playingEnemyJackblack.prioritizeEnemiesUnlessAttacked) { playingEnemyJackblack.prioritizeEnemiesUnlessAttacked = false; } if (!playingEnemyJackblack.IgnorePlayer && ((playingEnemyJackblack.target != null && !playingEnemyJackblack.target.isPlayer) || playingEnemyJackblack.target == null)) { playingEnemyJackblack.target = EnemyTarget.TrackPlayer(); playingEnemyJackblack.HandleTargetCheats(); } } if (!ignoreTotalDamageTakenMultiplier) { multiplier *= playingEnemyJackblack.totalDamageTakenMultiplier; } multiplier /= playingEnemyJackblack.totalHealthModifier; if (playingEnemyJackblack.isBoss && playingEnemyJackblack.difficulty >= 4) { multiplier = ((playingEnemyJackblack.difficulty != 5) ? (multiplier / 1.5f) : (multiplier / 2f)); } if (playingEnemyJackblack.weaknesses.Length != 0) { for (int i = 0; i < playingEnemyJackblack.weaknesses.Length; i++) { if (playingEnemyJackblack.hitter == playingEnemyJackblack.weaknesses[i] || (playingEnemyJackblack.hitterAttributes.Contains((HitterAttribute)2) && playingEnemyJackblack.weaknesses[i] == "electricity")) { multiplier *= playingEnemyJackblack.weaknessMultipliers[i]; } } } if (playingEnemyJackblack.getFireDamageMultiplier && playingEnemyJackblack.burners.Count > 0 && playingEnemyJackblack.hitter != "fire" && playingEnemyJackblack.hitter != "explosion" && playingEnemyJackblack.hitter != "ffexplosion") { multiplier *= 1.5f; } if (playingEnemyJackblack.nails.Count > 10) { for (int j = 0; j < playingEnemyJackblack.nails.Count - 10; j++) { if ((Object)(object)playingEnemyJackblack.nails[j] != (Object)null) { Object.Destroy((Object)(object)((Component)playingEnemyJackblack.nails[j]).gameObject); } playingEnemyJackblack.nails.RemoveAt(j); } } if (!playingEnemyJackblack.beingZapped && playingEnemyJackblack.hitterAttributes.Contains((HitterAttribute)2) && playingEnemyJackblack.hitter != "aftershock" && (playingEnemyJackblack.nailsAmount > 0 || playingEnemyJackblack.stuckMagnets.Count > 0 || playingEnemyJackblack.touchingWaters.Count > 0)) { playingEnemyJackblack.beingZapped = true; foreach (Nail nail in playingEnemyJackblack.nails) { if ((Object)(object)nail != (Object)null) { nail.Zap(); } } if (playingEnemyJackblack.hitter == "zapper" && multiplier > playingEnemyJackblack.health) { multiplier = playingEnemyJackblack.health - 0.001f; } playingEnemyJackblack.afterShockSourceWeapon = sourceWeapon; playingEnemyJackblack.waterOnlyAftershock = playingEnemyJackblack.nailsAmount == 0 && playingEnemyJackblack.stuckMagnets.Count == 0; ((MonoBehaviour)playingEnemyJackblack).Invoke("AfterShock", 0.5f); } if (playingEnemyJackblack.pulledByMagnet && playingEnemyJackblack.hitter != "deathzone") { playingEnemyJackblack.pulledByMagnet = false; } bool flag = false; EnemyType enemyType = playingEnemyJackblack.enemyType; if ((int)enemyType <= 4) { if ((int)enemyType == 1) { goto IL_0623; } if ((int)enemyType == 4) { if ((Object)(object)playingEnemyJackblack.spider == (Object)null) { playingEnemyJackblack.spider = ((Component)playingEnemyJackblack).GetComponent<SpiderBody>(); } if ((Object)(object)playingEnemyJackblack.spider == (Object)null) { return; } if ((playingEnemyJackblack.hitter != "explosion" && playingEnemyJackblack.hitter != "ffexplosion") || playingEnemyJackblack.isGasolined) { playingEnemyJackblack.spider.GetHurt(target, force, hitPoint, multiplier, sourceWeapon); } if (playingEnemyJackblack.spider.health <= 0f) { playingEnemyJackblack.Death(); } playingEnemyJackblack.health = playingEnemyJackblack.spider.health; flag = true; } } else { if ((int)enemyType == 9) { goto IL_0623; } if ((int)enemyType != 10) { if ((int)enemyType == 21) { playingEnemyJackblack.idol = (Object.op_Implicit((Object)(object)playingEnemyJackblack.idol) ? playingEnemyJackblack.idol : ((Component)playingEnemyJackblack).GetComponent<Idol>()); if (playingEnemyJackblack.hitter == "punch" || playingEnemyJackblack.hitter == "heavypunch" || playingEnemyJackblack.hitter == "ground slam" || playingEnemyJackblack.hitter == "hammer") { Idol idol = playingEnemyJackblack.idol; if (!((Object)(object)idol == (Object)null)) { idol.Death(); } } } } else { if ((Object)(object)playingEnemyJackblack.wicked == (Object)null) { playingEnemyJackblack.wicked = ((Component)playingEnemyJackblack).GetComponent<Wicked>(); } if ((Object)(object)playingEnemyJackblack.wicked == (Object)null) { return; } playingEnemyJackblack.wicked.GetHit(); flag = true; } } goto IL_069f; IL_0623: if ((Object)(object)playingEnemyJackblack.drone == (Object)null) { playingEnemyJackblack.drone = ((Component)playingEnemyJackblack).GetComponent<Drone>(); } if ((Object)(object)playingEnemyJackblack.drone == (Object)null) { return; } playingEnemyJackblack.drone.GetHurt(force, multiplier, sourceWeapon, fromExplosion); playingEnemyJackblack.health = playingEnemyJackblack.drone.health; if (playingEnemyJackblack.health <= 0f) { playingEnemyJackblack.Death(); } flag = true; goto IL_069f; IL_069f: if (!flag) { EnemyClass enemyClass = playingEnemyJackblack.enemyClass; EnemyClass val = enemyClass; switch ((int)val) { case 0: if ((Object)(object)playingEnemyJackblack.zombie == (Object)null) { playingEnemyJackblack.zombie = ((Component)playingEnemyJackblack).GetComponent<Zombie>(); } if ((Object)(object)playingEnemyJackblack.zombie == (Object)null) { return; } playingEnemyJackblack.zombie.GetHurt(target, force, multiplier, critMultiplier, sourceWeapon, fromExplosion); if (tryForExplode && playingEnemyJackblack.zombie.health <= 0f && !playingEnemyJackblack.exploded) { playingEnemyJackblack.Explode(fromExplosion); } if (playingEnemyJackblack.zombie.health <= 0f) { playingEnemyJackblack.Death(); } playingEnemyJackblack.health = playingEnemyJackblack.zombie.health; break; case 1: if ((Object)(object)playingEnemyJackblack.machine == (Object)null) { playingEnemyJackblack.machine = ((Component)playingEnemyJackblack).GetComponent<Machine>(); } if ((Object)(object)playingEnemyJackblack.machine == (Object)null) { return; } playingEnemyJackblack.machine.GetHurt(target, force, multiplier, critMultiplier, sourceWeapon, fromExplosion); if (tryForExplode && playingEnemyJackblack.machine.health <= 0f && ((Object)(object)playingEnemyJackblack.machine.symbiote == (Object)null || playingEnemyJackblack.machine.symbiote.health <= 0f) && !playingEnemyJackblack.machine.dontDie && !playingEnemyJackblack.exploded) { playingEnemyJackblack.Explode(fromExplosion); } if (playingEnemyJackblack.machine.health <= 0f && ((Object)(object)playingEnemyJackblack.machine.symbiote == (Object)null || playingEnemyJackblack.machine.symbiote.health <= 0f)) { playingEnemyJackblack.Death(); } playingEnemyJackblack.health = playingEnemyJackblack.machine.health; break; case 2: if ((Object)(object)playingEnemyJackblack.statue == (Object)null) { playingEnemyJackblack.statue = ((Component)playingEnemyJackblack).GetComponent<Statue>(); } if ((Object)(object)playingEnemyJackblack.statue == (Object)null) { return; } playingEnemyJackblack.statue.GetHurt(target, force, multiplier, critMultiplier, hitPoint, sourceWeapon, fromExplosion); if (tryForExplode && playingEnemyJackblack.statue.health <= 0f && !playingEnemyJackblack.exploded) { playingEnemyJackblack.Explode(fromExplosion); } if (playingEnemyJackblack.statue.health <= 0f) { playingEnemyJackblack.Death(); } playingEnemyJackblack.health = playingEnemyJackblack.statue.health; break; } } playingEnemyJackblack.hitterAttributes.Clear(); } } [HarmonyPatch(typeof(CameraController), "Start")] internal class NoYRestriction { public static bool Prefix(CameraController __instance) { __instance.maximumX = float.PositiveInfinity; __instance.minimumY = -5000000f; return true; } } [HarmonyPatch] internal class NukeRocketPatch { [HarmonyPatch(typeof(RocketLauncher), "Update")] public static bool Prefix(RocketLauncher __instance) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_0b4b: Unknown result type (might be due to invalid IL or missing references) //IL_0b51: Unknown result type (might be due to invalid IL or missing references) //IL_0b57: Unknown result type (might be due to invalid IL or missing references) //IL_0b68: Unknown result type (might be due to invalid IL or missing references) //IL_07cb: Unknown result type (might be due to invalid IL or missing references) //IL_07d5: Unknown result type (might be due to invalid IL or missing references) //IL_0911: Unknown result type (might be due to invalid IL or missing references) //IL_0916: Unknown result type (might be due to invalid IL or missing references) //IL_0936: Unknown result type (might be due to invalid IL or missing references) //IL_093b: Unknown result type (might be due to invalid IL or missing references) //IL_094b: Unknown result type (might be due to invalid IL or missing references) //IL_0992: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0a6e: Unknown result type (might be due to invalid IL or missing references) //IL_0a73: Unknown result type (might be due to invalid IL or missing references) if (__instance.variation != 3) { return true; } if (!Object.op_Implicit((Object)(object)MonoSingleton<ColorBlindSettings>.Instance)) { return false; } Color val = MonoSingleton<ColorBlindSettings>.Instance.variationColors[__instance.variation]; float num = 1f; if (MonoSingleton<WeaponCharges>.Instance.rocketset && __instance.lookingForValue) { MonoSingleton<WeaponCharges>.Instance.rocketset = false; __instance.lookingForValue = false; if (MonoSingleton<WeaponCharges>.Instance.rocketcharge < 0.25f) { __instance.cooldown = 0.25f; } else { __instance.cooldown = MonoSingleton<WeaponCharges>.Instance.rocketcharge; } } if (__instance.variation == 3) { if (MonoSingleton<GunControl>.Instance.activated && !GameStateManager.Instance.PlayerInputLocked) { if (Object.op_Implicit((Object)(object)__instance.timerArm)) { ((Transform)__instance.timerArm).localRotation = Quaternion.Euler(0f, 0f, Mathf.Lerp(360f, 0f, MonoSingleton<WeaponCharges>.Instance.rocketCannonballCharge)); } if (Object.op_Implicit((Object)(object)__instance.timerMeter)) { __instance.timerMeter.fillAmount = MonoSingleton<WeaponCharges>.Instance.rocketCannonballCharge; } if (__instance.lastKnownTimerAmount != MonoSingleton<WeaponCharges>.Instance.rocketCannonballCharge && (!Object.op_Implicit((Object)(object)__instance.wid) || __instance.wid.delay == 0f)) { for (float num2 = 4f; num2 > 0f; num2 -= 1f) { if (MonoSingleton<WeaponCharges>.Instance.rocketCannonballCharge >= num2 / 4f && __instance.lastKnownTimerAmount < num2 / 4f) { AudioSource val2 = Object.Instantiate<AudioSource>(__instance.timerWindupSound); val2.pitch = 1.6f + num2 * 0.1f; if (MonoSingleton<WeaponCharges>.Instance.rocketCannonballCharge < 1f) { val2.volume /= 2f; } break; } } __instance.lastKnownTimerAmount = MonoSingleton<WeaponCharges>.Instance.rocketCannonballCharge; } if (MonoSingleton<InputManager>.Instance.InputSource.Fire2.IsPressed && !MonoSingleton<InputManager>.Instance.InputSource.Fire1.WasPerformedThisFrame && MonoSingleton<WeaponCharges>.Instance.rocketCannonballCharge >= 1f) { if (!Object.op_Implicit((Object)(object)__instance.wid) || __instance.wid.delay == 0f) { if (!__instance.chargeSound.isPlaying) { __instance.chargeSound.Play(); } __instance.chargeSound.pitch = __instance.cbCharge + 0.5f; } __instance.cbCharge = Mathf.MoveTowards(__instance.cbCharge, 1f, Time.deltaTime); ((Component)__instance).transform.localPosition = new Vector3(__instance.wpos.currentDefault.x + Random.Range(__instance.cbCharge / 100f * -1f, __instance.cbCharge / 100f), __instance.wpos.currentDefault.y + Random.Range(__instance.cbCharge / 100f * -1f, __instance.cbCharge / 100f), __instance.wpos.currentDefault.z + Random.Range(__instance.cbCharge / 100f * -1f, __instance.cbCharge / 100f)); if (Object.op_Implicit((Object)(object)__instance.timerArm)) { ((Transform)__instance.timerArm).localRotation = Quaternion.Euler(0f, 0f, Mathf.Lerp(360f, 0f, __instance.cbCharge)); } if (Object.op_Implicit((Object)(object)__instance.timerMeter)) { __instance.timerMeter.fillAmount = __instance.cbCharge; } } else if (__instance.cbCharge > 0f && !__instance.firingCannonball) { __instance.chargeSound.Stop(); if (!Object.op_Implicit((Object)(object)__instance.wid) || __instance.wid.delay == 0f) { shootNuke(__instance); } else { shootNuke(__instance); __instance.firingCannonball = true; } MonoSingleton<WeaponCharges>.Instance.rocketCannonballCharge = 0f; } } if (__instance.cbCharge > 0f) { val = Color.Lerp(MonoSingleton<ColorBlindSettings>.Instance.variationColors[__instance.variation], Color.red, __instance.cbCharge); } else if (MonoSingleton<WeaponCharges>.Instance.rocketCannonballCharge < 1f) { num = 0.5f; } } else if (__instance.variation == 0) { if (MonoSingleton<WeaponCharges>.Instance.rocketFreezeTime > 0f && MonoSingleton<InputManager>.Instance.InputSource.Fire2.WasPerformedThisFrame && !GameStateManager.Instance.PlayerInputLocked && (!Object.op_Implicit((Object)(object)__instance.wid) || !__instance.wid.duplicate)) { if (MonoSingleton<WeaponCharges>.Instance.rocketFrozen) { __instance.UnfreezeRockets(); } else { __instance.FreezeRockets(); } } if (Object.op_Implicit((Object)(object)__instance.timerArm)) { ((Transform)__instance.timerArm).localRotation = Quaternion.Euler(0f, 0f, Mathf.Lerp(360f, 0f, MonoSingleton<WeaponCharges>.Instance.rocketFreezeTime / 5f)); } if (Object.op_Implicit((Object)(object)__instance.timerMeter)) { __instance.timerMeter.fillAmount = MonoSingleton<WeaponCharges>.Instance.rocketFreezeTime / 5f; } if (__instance.lastKnownTimerAmount != MonoSingleton<WeaponCharges>.Instance.rocketFreezeTime && (!Object.op_Implicit((Object)(object)__instance.wid) || __instance.wid.delay == 0f)) { for (float num3 = 4f; num3 > 0f; num3 -= 1f) { if (MonoSingleton<WeaponCharges>.Instance.rocketFreezeTime / 5f >= num3 / 4f && __instance.lastKnownTimerAmount / 5f < num3 / 4f) { Object.Instantiate<AudioSource>(__instance.timerWindupSound).pitch = 0.6f + num3 * 0.1f; break; } } __instance.lastKnownTimerAmount = MonoSingleton<WeaponCharges>.Instance.rocketFreezeTime; } } else if (__instance.variation == 2) { if (!MonoSingleton<InputManager>.Instance.PerformingCheatMenuCombo() && !GameStateManager.Instance.PlayerInputLocked && MonoSingleton<InputManager>.Instance.InputSource.Fire2.IsPressed && !MonoSingleton<InputManager>.Instance.InputSource.Fire1.WasPerformedThisFrame && MonoSingleton<WeaponCharges>.Instance.rocketNapalmFuel > 0f && (__instance.firingNapalm || MonoSingleton<WeaponCharges>.Instance.rocketNapalmFuel >= 0.25f)) { if (__instance.cooldown < 0.5f) { if (!__instance.firingNapalm) { __instance.napalmMuzzleFlashTransform.localScale = Vector3.one * 3f; __instance.napalmMuzzleFlashParticles.Play(); AudioSource[] napalmMuzzleFlashSounds = __instance.napalmMuzzleFlashSounds; foreach (AudioSource val3 in napalmMuzzleFlashSounds) { val3.pitch = Random.Range(0.9f, 1.1f); val3.Play(); } } __instance.firingNapalm = true; } } else if (__instance.firingNapalm) { __instance.firingNapalm = false; __instance.napalmMuzzleFlashParticles.Stop(); AudioSource[] napalmMuzzleFlashSounds2 = __instance.napalmMuzzleFlashSounds; foreach (AudioSource val4 in napalmMuzzleFlashSounds2) { if (val4.loop) { val4.Stop(); } } __instance.napalmStopSound.pitch = Random.Range(0.9f, 1.1f); __instance.napalmStopSound.Play(); } else if (MonoSingleton<InputManager>.Instance.InputSource.Fire2.WasPerformedThisFrame && MonoSingleton<WeaponCharges>.Instance.rocketNapalmFuel < 0.25f) { __instance.napalmNoAmmoSound.Play(); } if (!__instance.firingNapalm && __instance.napalmMuzzleFlashTransform.localScale != Vector3.zero) { __instance.napalmMuzzleFlashTransform.localScale = Vector3.MoveTowards(__instance.napalmMuzzleFlashTransform.localScale, Vector3.zero, Time.deltaTime * 9f); } if (Object.op_Implicit((Object)(object)__instance.timerArm)) { ((Transform)__instance.timerArm).localRotation = Quaternion.Euler(0f, 0f, Mathf.Lerp(360f, 0f, MonoSingleton<WeaponCharges>.Instance.rocketNapalmFuel)); } if (Object.op_Implicit((Object)(object)__instance.timerMeter)) { __instance.timerMeter.fillAmount = MonoSingleton<WeaponCharges>.Instance.rocketNapalmFuel; } if (__instance.lastKnownTimerAmount != MonoSingleton<WeaponCharges>.Instance.rocketNapalmFuel && (!Object.op_Implicit((Object)(object)__instance.wid) || __instance.wid.delay == 0f)) { if (MonoSingleton<WeaponCharges>.Instance.rocketNapalmFuel >= 0.25f && __instance.lastKnownTimerAmount < 0.25f) { Object.Instantiate<AudioSource>(__instance.timerWindupSound); } __instance.lastKnownTimerAmount = MonoSingleton<WeaponCharges>.Instance.rocketNapalmFuel; } if (!__instance.firingNapalm && MonoSingleton<WeaponCharges>.Instance.rocketNapalmFuel < 0.25f) { val = Color.grey; } } if (__instance.cooldown > 0f) { __instance.cooldown = Mathf.MoveTowards(__instance.cooldown, 0f, Time.deltaTime); } else if (MonoSingleton<InputManager>.Instance.InputSource.Fire1.IsPressed && MonoSingleton<GunControl>.Instance.activated && !GameStateManager.Instance.PlayerInputLocked) { if (!Object.op_Implicit((Object)(object)__instance.wid) || __instance.wid