using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Threading.Tasks; using BepInEx; using BepInEx.Logging; using Configgy; using Configgy.UI; using GameConsole; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using ULTRAKILL.Cheats; using UltraFunGuns; using UltraFunGuns.Components; using UltraFunGuns.Components.Entity; using UltraFunGuns.CustomPlacedObjects; using UltraFunGuns.Datas; using UltraFunGuns.Logging; using UltraFunGuns.Patches; using UltraFunGuns.Properties; using UltraFunGuns.Util; using UnityEngine; using UnityEngine.AI; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.ResourceManagement.ResourceLocations; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Hydraxous")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("A mod with fun guns!")] [assembly: AssemblyFileVersion("1.3.6.0")] [assembly: AssemblyInformationalVersion("1.3.6+90ca98e83ff13ff2bfadfdbaf61eea9908a954aa")] [assembly: AssemblyProduct("UltraFunGuns")] [assembly: AssemblyTitle("UltraFunGuns")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.6.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } [UFGWeapon("RocketDagger", "Rocket Dagger", 2, false, WeaponIconColor.Red, false, false)] [WeaponAbility("Dagger", "Press Fire 1 to throw a dagger", 0, RichTextColors.aqua)] [WeaponAbility("Daggers", "Press Fire 2 to throw multiple daggers", 0, RichTextColors.aqua)] public class RocketDagger : UltraFunGunBase { [UFGAsset("RocketDaggerProjectile")] public static GameObject RocketDaggerProjectilePrefab; private ActionCooldown primaryFireCooldown = new ActionCooldown(0.15f); private ActionCooldown secondaryFireCooldown = new ActionCooldown(0.6f); public int PelletsPerSecond = 12; public float maxShotgunTime = 5f; private float shotgunTime = 0f; public override void GetInput() { if (MonoSingleton.Instance.InputSource.Fire1.IsPressed && primaryFireCooldown.CanFire() && !om.paused) { primaryFireCooldown.AddCooldown(); Fire(); } if (MonoSingleton.Instance.InputSource.Fire2.IsPressed) { if (secondaryFireCooldown.CanFire() && !om.paused) { shotgunTime += Time.deltaTime; shotgunTime = Mathf.Min(maxShotgunTime, shotgunTime); if (shotgunTime >= maxShotgunTime) { Shotgun(); } } } else if (shotgunTime > 0f) { Shotgun(); } } private void Fire() { //IL_0008: 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) FirePellet(mainCam.position, mainCam.forward); } private void Shotgun() { //IL_000e: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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) int pelletCount = GetPelletCount(); Vector3 position = mainCam.position; Quaternion rotation = mainCam.rotation; if (shotgunTime == maxShotgunTime) { } for (int i = 0; i < pelletCount; i++) { Vector3 val = Vector3.forward; if (i != 0) { val = MathTools.GetProjectileSpreadVector(shotgunTime / 20f); } GameObject val2 = FirePellet(position, rotation * val); if (val2.TryFindComponent(out var component)) { component.sourceWeapon = ((Component)this).gameObject; if (shotgunTime == maxShotgunTime) { component.damage *= 10f; component.ricochet = true; component.projectileSpeed *= 10f; } } val2.transform.Rotate(Vector3.forward, (float)Random.Range(0, 360), (Space)1); } secondaryFireCooldown.AddCooldown(shotgunTime / 2f); shotgunTime = 0f; } private GameObject FirePellet(Vector3 position, Vector3 direction) { //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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return Object.Instantiate(RocketDaggerProjectilePrefab, position, Quaternion.LookRotation(direction, Vector3.up)); } private int GetPelletCount() { float num = shotgunTime * (float)PelletsPerSecond; num = Mathf.CeilToInt(num); return (int)num; } } public class RayBasedProjectile : MonoBehaviour, ICleanable { public delegate void OnProjectileDeathHandler(ProjectileDeathEvent projectileDeathEvent); public float projectileSpeed; public float projectileSize; public float imortalTime = 0.001f; public bool affectedByGravity; public float gravityMultiplier = 1f; public bool ricochet; public bool hitTriggers; public LayerMask hitMask; public float damage; public float critMultiplier; public bool tryForExplode; public GameObject spawnAtImpact; public GameObject sourceWeapon; public string[] eventDataTags; private float imortalTimeRemaining; private bool dieNextFrame; private float distanceToSurface; public OnProjectileDeathHandler OnProjectileDeath; private ProjectileDeathEvent deathParamters = default(ProjectileDeathEvent); private RaycastHit hit; private void Start() { imortalTimeRemaining = imortalTime; } private void Update() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (dieNextFrame) { Impact(); } dieNextFrame = CheckImpact(); imortalTimeRemaining -= Time.deltaTime; Transform transform = ((Component)this).transform; transform.position += GetNextPositionStep(); } private Vector3 GetNextPositionStep() { //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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: 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_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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_0143: 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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; Vector3 val2 = ((Component)this).transform.forward; Vector3 val3 = ((Component)this).transform.position; if (affectedByGravity) { val += Physics.gravity * gravityMultiplier * Time.deltaTime; } bool flag = false; if ((Object)(object)((RaycastHit)(ref hit)).collider != (Object)null) { flag = ((Component)((RaycastHit)(ref hit)).collider).tag == "Armor"; } if ((ricochet || flag) && dieNextFrame) { float num = projectileSpeed * Time.deltaTime; RaycastHit val4 = default(RaycastHit); while (num > 0f && Physics.Raycast(val3, val2, ref val4, num, LayerMask.op_Implicit(hitMask))) { SurfaceHitInformation surfaceHitInformation = default(SurfaceHitInformation); surfaceHitInformation.hitCollider = ((RaycastHit)(ref val4)).collider; surfaceHitInformation.hittingObject = ((Component)this).gameObject; surfaceHitInformation.normal = ((RaycastHit)(ref val4)).normal; surfaceHitInformation.position = ((RaycastHit)(ref val4)).point; surfaceHitInformation.velocity = val2 * projectileSpeed; SurfaceHitInformation surfaceHitInformation2 = surfaceHitInformation; num -= ((RaycastHit)(ref val4)).distance; val3 = ((RaycastHit)(ref val4)).point; val2 = Vector3.Reflect(val2, ((RaycastHit)(ref val4)).normal); HitCollider(((RaycastHit)(ref hit)).collider); } if (num > 0f) { val3 += val2 * num; } ((Component)this).transform.forward = val2; val += val3 - ((Component)this).transform.position; dieNextFrame = false; } else { val += val2 * (dieNextFrame ? distanceToSurface : (projectileSpeed * Time.deltaTime)); } return val; } private bool CheckImpact() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.forward * projectileSpeed; if (affectedByGravity) { val += Physics.gravity * gravityMultiplier; } float num = ((Vector3)(ref val)).magnitude * Time.deltaTime; if (projectileSize > 0f) { if (!Physics.SphereCast(((Component)this).transform.position, projectileSize, ((Vector3)(ref val)).normalized, ref hit, num, LayerMask.op_Implicit(hitMask))) { return false; } } else if (!Physics.Raycast(((Component)this).transform.position, ((Vector3)(ref val)).normalized, ref hit, num, LayerMask.op_Implicit(hitMask))) { return false; } if (!hitTriggers && ((RaycastHit)(ref hit)).collider.isTrigger) { return false; } deathParamters.normal = ((RaycastHit)(ref hit)).normal; deathParamters.velocity = ((Component)this).transform.forward * projectileSpeed; if (imortalTimeRemaining < 0f) { Vector3 val2 = ((RaycastHit)(ref hit)).point - ((Component)this).transform.position; distanceToSurface = ((Vector3)(ref val2)).magnitude; return true; } return false; } private void Impact() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) SurfaceHitInformation surfaceHitInformation = default(SurfaceHitInformation); surfaceHitInformation.hitCollider = ((RaycastHit)(ref hit)).collider; surfaceHitInformation.normal = ((RaycastHit)(ref hit)).normal; surfaceHitInformation.position = ((RaycastHit)(ref hit)).point; surfaceHitInformation.hittingObject = ((Component)this).gameObject; surfaceHitInformation.velocity = ((Component)this).transform.forward * projectileSpeed; SurfaceHitInformation surfaceHitInformation2 = surfaceHitInformation; if (!HitCollider(((RaycastHit)(ref hit)).collider)) { ((Component)this).transform.forward = Vector3.Reflect(((Component)this).transform.forward, ((RaycastHit)(ref hit)).normal); return; } if ((Object)(object)spawnAtImpact != (Object)null && (Object)(object)((RaycastHit)(ref hit)).collider != (Object)null) { GameObject val = Object.Instantiate(spawnAtImpact, ((RaycastHit)(ref hit)).point + ((RaycastHit)(ref hit)).normal * 0.01f, Quaternion.LookRotation(((RaycastHit)(ref hit)).normal, Vector3.up)); } Object.Destroy((Object)(object)((Component)this).gameObject); } private bool HitCollider(Collider col) { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)col == (Object)null) { return false; } if (col.IsColliderEnemy(out var enemy) && enemy != null) { enemy.DeliverDamage(((Component)enemy).gameObject, ((Component)this).transform.forward * projectileSpeed, ((RaycastHit)(ref hit)).point, damage, tryForExplode, critMultiplier, sourceWeapon, false, false); } if (col.TryFindComponent(out var component)) { UFGInteractionEventData interaction = default(UFGInteractionEventData); interaction.power = damage; interaction.direction = ((Component)this).transform.forward; interaction.interactorPosition = ((Component)this).transform.position; interaction.tags = ((eventDataTags == null) ? new string[0] : eventDataTags); component.Interact(interaction); } return true; } private void OnDrawGizmosSelected() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = Color.red; Gizmos.DrawRay(((Component)this).transform.position, ((Component)this).transform.forward * projectileSpeed * (1f / 60f)); Gizmos.color = Color.green; Gizmos.DrawWireSphere(((Component)this).transform.position, projectileSize); } private void OnDestroy() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) deathParamters.direction = ((Component)this).transform.forward; deathParamters.position = ((Component)this).transform.position; OnProjectileDeath?.Invoke(deathParamters); } public void Cleanup() { Object.Destroy((Object)(object)((Component)this).gameObject); } } public struct SurfaceHitInformation { public Vector3 position; public Vector3 normal; public Vector3 velocity; public Collider hitCollider; public GameObject hittingObject; } public struct ProjectileDeathEvent { public Vector3 position; public Vector3 direction; public Vector3 normal; public Vector3 velocity; } public class RayProjectile : MonoBehaviour { public float StepDistance; public Action OnHit; public LayerMask Hitmask; private void Update() { MoveProjectile(); } private void MoveProjectile() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.forward * StepDistance * Time.deltaTime; if (!CheckStep(val, out var hit)) { Transform transform = ((Component)this).transform; transform.position += val; } else { OnHit(hit, this); } } private bool CheckStep(Vector3 travel, out RaycastHit hit) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) return Physics.Raycast(((Component)this).transform.position, ((Vector3)(ref travel)).normalized, ref hit, ((Vector3)(ref travel)).magnitude, LayerMask.op_Implicit(Hitmask)); } } namespace UltraFunGuns { public class AnimationAudioInterface : MonoBehaviour { [SerializeField] private AudioClip[] clips; public void PlayClip(int clipIndex) { if (clipIndex >= clips.Length || clipIndex < 0) { UltraFunGuns.Log.LogError($"Audio clip index ({clipIndex}) out of range on {((Object)((Component)this).gameObject).name}"); } else { PlayClip(clips[clipIndex]); } } public void PlayClip(string name) { if (clips != null) { AudioClip clip = clips.Where((AudioClip x) => ((Object)x).name == name).First(); PlayClip(clip); } } private void PlayClip(AudioClip clip) { if ((Object)(object)clip == (Object)null) { UltraFunGuns.Log.LogError("Warning audio clip attempted to be played on " + ((Object)((Component)this).gameObject).name + " through animation. The provided clip was null."); return; } Transform transform = ((Component)clip.PlayAudioClip(Random.Range(0.9f, 1.1f))).transform; transform.parent = ((Component)this).transform; } } public class AudioSourceRandomizer : MonoBehaviour { public float minPitch = 0.85f; public float maxPitch = 1.15f; public float minVolume = 1f; public float maxVolume = 1f; private AudioSource audioSrc; private void Awake() { audioSrc = ((Component)this).GetComponent(); if ((Object)(object)audioSrc == (Object)null) { Object.Destroy((Object)(object)this); } else { RandomizeAudio(); } } private void RandomizeAudio() { if (Object.op_Implicit((Object)(object)audioSrc)) { float pitch = Random.Range(minPitch, maxPitch); float volume = Random.Range(minVolume, maxVolume); audioSrc.pitch = pitch; audioSrc.volume = volume; } } } public class BehaviourRelay : MonoBehaviour { public Action OnAwake; public Action OnStart; public Action OnUpdate; public Action OnLateUpdate; public Action OnFixedUpdate; public Action OnOnEnable; public Action OnOnDisable; public Action OnOnDestroy; private void Awake() { OnAwake?.Invoke(((Component)this).gameObject); } private void Start() { OnStart?.Invoke(((Component)this).gameObject); } private void Update() { OnUpdate?.Invoke(((Component)this).gameObject); } private void LateUpdate() { OnLateUpdate?.Invoke(((Component)this).gameObject); } private void FixedUpdate() { OnFixedUpdate?.Invoke(((Component)this).gameObject); } private void OnEnable() { OnOnEnable?.Invoke(((Component)this).gameObject); } private void OnDisable() { OnOnDisable?.Invoke(((Component)this).gameObject); } private void OnDestroy() { OnOnDestroy?.Invoke(((Component)this).gameObject); } } public class CoroutineRunner : MonoBehaviour { private bool coroutineStarted; private bool coroutineRunning; private void Update() { if (coroutineStarted && !coroutineRunning) { Object.Destroy((Object)(object)((Component)this).gameObject); } } public Coroutine RunCoroutine(IEnumerator coroutine) { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; return ((MonoBehaviour)this).StartCoroutine(RunExternalCoroutine(coroutine)); } private IEnumerator RunExternalCoroutine(IEnumerator coroutine) { coroutineStarted = true; coroutineRunning = true; yield return coroutine; coroutineRunning = false; } } public static class StaticCoroutine { public static Coroutine RunCoroutine(IEnumerator coroutine) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) CoroutineRunner coroutineRunner = new GameObject("New Rebinder").AddComponent(); return coroutineRunner.RunCoroutine(coroutine); } public static void DelayedExecute(Action action, float delayInSeconds) { RunCoroutine(DelayedExecution(action, delayInSeconds)); } private static IEnumerator DelayedExecution(Action action, float timeInSeconds) { yield return (object)new WaitForSecondsRealtime(timeInSeconds); action?.Invoke(); } } public class DebuggingDummy : MonoBehaviour { private void Awake() { } private void Update() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_00cd: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_0119: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) if (!UltraFunGuns.DebugMode) { return; } if (Input.GetKeyDown((KeyCode)256)) { Vector3 position = ((Component)MonoSingleton.Instance).transform.position; Vector3 position2 = ((Component)MonoSingleton.Instance).transform.position; Vector3 val = Vector3.zero; if (HydraUtils.SphereCastMacro(position2, 0.001f, ((Component)MonoSingleton.Instance).transform.forward, float.PositiveInfinity, out var hit)) { val = ((RaycastHit)(ref hit)).point; Visualizer.DrawSphere(val, 0.25f, 5f); Visualizer.DrawLine(5f, position2, val); } string obj = $"Player: {position.x}|{position.y}|{position.z}\n" + $"Camera: {position2.x}|{position2.y}|{position2.z}\n" + $"HitPos: {val.x}|{val.y}|{val.z}"; UltraFunGuns.Log.LogWarning(obj); } if (!Input.GetKeyDown((KeyCode)260)) { return; } List list = new List(); foreach (IResourceLocator resourceLocator in Addressables.ResourceLocators) { ResourceLocationMap val2 = (ResourceLocationMap)(object)((resourceLocator is ResourceLocationMap) ? resourceLocator : null); if (val2 == null) { continue; } foreach (IList value in val2.Locations.Values) { list.AddRange(value); } } string text = ""; foreach (IResourceLocation item in list) { text += FormatResourceLocation(item); } } private string FormatResourceLocation(IResourceLocation rlocation) { string text = "=================================\n"; text = text + "PKEY: " + rlocation.PrimaryKey + "\n"; text = text + "INTID: " + rlocation.InternalId + "\n"; return text + "RTYPE: " + rlocation.ResourceType.Name + "\n"; } } public class DebugLine : MonoBehaviour { private LineRenderer lr; private bool initialized; private void Awake() { lr = ((Component)this).GetComponent(); } public void SetLine(Vector3[] points) { if (!initialized) { initialized = true; lr.positionCount = points.Length; lr.SetPositions(points); } } } public class DebugTextPopup : MonoBehaviour { [SerializeField] private Text text; [SerializeField] private DestroyAfterTime destroyAfterTime; private void Awake() { if ((Object)(object)text == (Object)null) { text = ((Component)this).GetComponentInChildren(); } } public void SetText(string newText, Color color) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)text != (Object)null) { text.text = newText; ((Graphic)text).color = color; } } public void SetKillTime(float newTime) { if ((Object)(object)destroyAfterTime != (Object)null) { destroyAfterTime.TimeLeft = newTime; } } public void OnDestroy() { Visualizer.ClearDebugText(this); } } public class HLErrorNotifier : MonoBehaviour { private void Start() { UltraFunGuns.Log.LogError(((Object)((Component)this).gameObject).name + " was created, but it was not loaded properly from the assetbundle."); } } public class DeleteAfterTime : MonoBehaviour { public float TimeLeft = 10f; private void Update() { if (TimeLeft <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { TimeLeft -= Time.deltaTime; } } } public class DestroyAfterTime : MonoBehaviour, ICleanable { public float TimeLeft = 2f; private void Start() { CheckComponents(); } private void CheckComponents() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) AudioSource val = default(AudioSource); if (((Component)this).TryGetComponent(ref val)) { float maxTime = val.clip.length - val.time; SetMaxTime(maxTime); } TrailRenderer val2 = default(TrailRenderer); if (((Component)this).TryGetComponent(ref val2)) { SetMaxTime(val2.time); ((MonoBehaviour)this).StartCoroutine(FadeOutTrail(val2)); } ParticleSystem val3 = default(ParticleSystem); if (((Component)this).TryGetComponent(ref val3)) { EmissionModule emission = val3.emission; ((EmissionModule)(ref emission)).enabled = false; MinMaxCurve rateOverTime = ((EmissionModule)(ref emission)).rateOverTime; SetMaxTime(((MinMaxCurve)(ref rateOverTime)).constant); MainModule main = val3.main; SetMaxTime(((MainModule)(ref main)).duration); } } private IEnumerator FadeOutTrail(TrailRenderer trail) { float startTime = trail.time; float startWidth = trail.widthMultiplier; while (trail.time > 0f) { trail.time -= Time.deltaTime; trail.widthMultiplier = Mathf.Lerp(startWidth, 0f, Mathf.InverseLerp(startTime, 0f, trail.time)); yield return (object)new WaitForEndOfFrame(); } } public void SetMaxTime(float newMaxTime) { TimeLeft = Mathf.Max(TimeLeft, newMaxTime); } private void Update() { if (TimeLeft <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } TimeLeft -= Time.deltaTime; } public static void PreserveComponents(Transform transf) { AudioSource[] componentsInChildren = ((Component)transf).GetComponentsInChildren(); TrailRenderer[] componentsInChildren2 = ((Component)transf).GetComponentsInChildren(); ParticleSystem[] componentsInChildren3 = ((Component)transf).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { PreserveComponent(((Component)componentsInChildren[i]).transform); } for (int j = 0; j < componentsInChildren2.Length; j++) { PreserveComponent(((Component)componentsInChildren2[j]).transform); } for (int k = 0; k < componentsInChildren3.Length; k++) { PreserveComponent(((Component)componentsInChildren3[k]).transform); } } private static void PreserveComponent(Transform tf, bool changeParent = true) { if ((Object)(object)tf != (Object)null) { ((Component)tf).gameObject.AddComponent(); if (changeParent) { tf.parent = null; } } } public void Cleanup() { Object.Destroy((Object)(object)((Component)this).gameObject); } } public class EnemyOverride : MonoBehaviour { private NavMeshAgent navMeshAgent; private Animator animator; private Drone drone; private Zombie zombie; private Machine machine; private Statue statue; private SpiderBody spiderBody; private Rigidbody[] childRigidbodies; private Collider primaryCollider; private Rigidbody primaryRigidbody; private List> onCollisionEvents = new List>(); private List onDeathEvents = new List(); private Dictionary startMaterials = new Dictionary(); private Renderer[] renderers; private List styleEntries = new List(); private bool initialized; public EnemyIdentifier EnemyIdentifier { get; private set; } public bool RagdollEnabled { get; private set; } public bool Frozen { get; private set; } private void Awake() { if (!initialized) { ForceInitialize(); } } public void ForceInitialize() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown if (!initialized) { initialized = true; EnemyIdentifier = ((Component)this).GetComponent(); navMeshAgent = ((Component)this).GetComponent(); animator = ((Component)this).GetComponent(); drone = ((Component)this).GetComponent(); zombie = ((Component)this).GetComponent(); machine = ((Component)this).GetComponent(); spiderBody = ((Component)this).GetComponent(); statue = ((Component)this).GetComponent(); EnemyIdentifier.onDeath.AddListener(new UnityAction(ExecuteOnDeathEvents)); GetPhysicsComponents(); GetRenderComponents(); } } private void GetPhysicsComponents() { primaryCollider = ((Component)this).GetComponent(); childRigidbodies = ((Component)this).GetComponentsInChildren(); } private void GetRenderComponents() { renderers = ((Component)this).GetComponentsInChildren(true); Renderer[] array = renderers; foreach (Renderer val in array) { if (!startMaterials.ContainsKey(val)) { startMaterials.Add(val, val.materials); } } } public void ResetMaterials() { Renderer[] array = renderers; foreach (Renderer val in array) { if (!((Object)(object)val == (Object)null) && startMaterials.ContainsKey(val)) { val.materials = startMaterials[val]; } } } public void SetFrozen(bool frozen) { Frozen = frozen; SetComponents(!frozen); if (RagdollEnabled && frozen) { SetKinematic(frozen); } } public void SetAllMaterials(Material[] newMaterials) { foreach (KeyValuePair startMaterial in startMaterials) { if (!((Object)(object)startMaterial.Key == (Object)null)) { startMaterial.Key.materials = newMaterials; } } } public void SetAllMaterial(Material material) { foreach (KeyValuePair startMaterial in startMaterials) { if (!((Object)(object)startMaterial.Key == (Object)null)) { startMaterial.Key.material = material; } } } public void Knockback(Vector3 force) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (!RagdollEnabled) { return; } Rigidbody[] array = childRigidbodies; foreach (Rigidbody val in array) { if ((Object)(object)val != (Object)null) { val.velocity = force; } } } public void AddStyleEntryOnDeath(StyleEntry entry, bool allowMultiple = false) { if ((Object)(object)EnemyIdentifier != (Object)null) { entry.EnemyIdentifier = EnemyIdentifier; } if (!allowMultiple && styleEntries.Where((StyleEntry x) => x.Key == entry.Key).ToList().Count > 0) { styleEntries[0].LifeTime += entry.LifeTime; } else { styleEntries.Add(entry); } } private void ExecuteStyleEntries() { styleEntries = styleEntries.Where((StyleEntry x) => x.valid).ToList(); foreach (StyleEntry entry in styleEntries) { if (entry.AlreadyCounted) { continue; } List list = styleEntries.Where((StyleEntry x) => x.Key == entry.Key && x != entry).ToList(); for (int i = 0; i < list.Count; i++) { if (list[i] != entry) { entry.Points += list[i].Points; int num = ((list[i].Count < 1) ? 1 : list[i].Count); entry.Count = ((entry.Count >= 1) ? (entry.Count + num) : (1 + num)); list[i].AlreadyCounted = true; } } if (list.Count > 0) { UltraFunGuns.Log.LogWarning("Combined similar entries"); } WeaponManager.AddStyle(entry); } } public void AddDeathCallback(Action action) { if (!onDeathEvents.Contains(action)) { onDeathEvents.Add(action); } } private void ExecuteOnDeathEvents() { foreach (Action onDeathEvent in onDeathEvents) { onDeathEvent?.Invoke(); } ExecuteStyleEntries(); } public void EnableKnockback() { } public void DisableKnockback() { } public void SetRagdoll(bool active) { RagdollEnabled = active; SetComponents(!active); SetKinematic(!active); } public void SetComponents(bool active) { if (!((Object)(object)EnemyIdentifier == (Object)null) && !EnemyIdentifier.dead) { if ((Object)(object)navMeshAgent != (Object)null) { ((Behaviour)navMeshAgent).enabled = active; } if ((Object)(object)drone != (Object)null) { ((Behaviour)drone).enabled = active; } if ((Object)(object)machine != (Object)null) { ((Behaviour)machine).enabled = active; } if ((Object)(object)spiderBody != (Object)null) { ((Behaviour)spiderBody).enabled = active; } if ((Object)(object)statue != (Object)null) { ((Behaviour)statue).enabled = active; } if ((Object)(object)zombie != (Object)null) { ((Behaviour)zombie).enabled = active; } if ((Object)(object)animator != (Object)null) { ((Behaviour)animator).enabled = active; } } } public void SetKinematic(bool active) { if ((Object)(object)primaryCollider != (Object)null) { primaryCollider.enabled = active; } Rigidbody[] array = childRigidbodies; foreach (Rigidbody val in array) { if ((Object)(object)val != (Object)null) { val.isKinematic = active; val.useGravity = !active; } } } public bool AddCollisionEvent(Action collisionCallback) { if (collisionCallback == null || onCollisionEvents.Contains(collisionCallback)) { return false; } onCollisionEvents.Add(collisionCallback); return true; } private void OnCollisionEnter(Collision col) { foreach (Action onCollisionEvent in onCollisionEvents) { onCollisionEvent?.Invoke(col); } } public float GetHealth() { Enemy val = default(Enemy); if (((Component)this).TryGetComponent(ref val)) { return val.health; } if ((Object)(object)spiderBody != (Object)null) { return spiderBody.health; } if ((Object)(object)zombie != (Object)null) { return ((Enemy)zombie).health; } if ((Object)(object)machine != (Object)null) { return ((Enemy)machine).health; } if ((Object)(object)statue != (Object)null) { return ((Enemy)statue).health; } return EnemyIdentifier.health; } } public static class EnemyUtil { public static EnemyOverride Override(this EnemyIdentifier eid) { EnemyOverride enemyOverride = ((Component)eid).gameObject.EnsureComponent(); enemyOverride.ForceInitialize(); return enemyOverride; } } public class StyleEntry { public string Key; public string Prefix; public string Postfix; public int Points; public float LifeTime; public GameObject SourceWeapon; public EnemyIdentifier EnemyIdentifier; public int Count; public bool AlreadyCounted; private float timeCreated; public bool valid => Time.time - timeCreated < LifeTime; public StyleEntry(int points, string key, float lifeTime = 5f, GameObject sourceWeapon = null, EnemyIdentifier eid = null, int count = -1, string prefix = "", string postfix = "") { Key = key; Points = points; LifeTime = lifeTime; timeCreated = Time.time; Count = count; SourceWeapon = sourceWeapon; EnemyIdentifier = eid; Count = count; Prefix = prefix; Postfix = postfix; } public StyleEntry() { timeCreated = Time.time; } } public class EntityStatusEffectHolder : MonoBehaviour, IStatusEffectReceiver { private List currentEffects = new List(); public GameObject GetAffectedObject() { return ((Component)this).gameObject; } public void AddStatusEffect(IStatusEffect effect) { currentEffects.Add(effect); } public IEnumerable GetStatusEffects() { return currentEffects; } public void RemoveStatusEffect(IStatusEffect effect) { currentEffects.Remove(effect); } } public class HydraPlushie : MonoBehaviour { [SerializeField] private MeshRenderer screen; [SerializeField] private Texture2D blueScreenTex; [SerializeField] private Texture2D blueScreenFaceMask; [SerializeField] private AudioClip blueScreenClip; [SerializeField] private AudioSource toChange; [SerializeField] private GameObject breakFX; private bool damaged; private void WaterDamage() { if (!((Object)(object)screen == (Object)null) && !((Object)(object)blueScreenTex == (Object)null) && !((Object)(object)blueScreenFaceMask == (Object)null) && !damaged) { damaged = true; if (((Renderer)screen).material.HasProperty("_MainTex")) { ((Renderer)screen).material.SetTexture("_MainTex", (Texture)(object)blueScreenTex); } if (((Renderer)screen).material.HasProperty("_FaceMask")) { ((Renderer)screen).material.SetTexture("_FaceMask", (Texture)(object)blueScreenFaceMask); } if ((Object)(object)toChange != (Object)null) { toChange.clip = blueScreenClip; } AudioSource[] componentsInChildren = ((Component)((Component)this).transform).GetComponentsInChildren(); foreach (AudioSource val in componentsInChildren) { val.pitch -= val.pitch * 0.23f; } if ((Object)(object)breakFX != (Object)null) { Object.Instantiate(breakFX, ((Component)this).transform); } WeaponManager.SetWeaponUnlocked("FizzyGun", unlocked: true); WeaponManager.SetWeaponUnlocked("GrabbityGun", unlocked: true); WeaponManager.SetWeaponUnlocked("PlushieCannon", unlocked: true); } } private void OnTriggerEnter(Collider col) { Water val = default(Water); if (((Component)col).gameObject.layer == 4 || ((Component)col).tag.ToLower().Contains("water") || ((Component)col).gameObject.TryGetComponent(ref val)) { WaterDamage(); } } private void OnDestroy() { WaterDamage(); } } public interface IStatusEffect { void OnEffectStart(); void OnEffectUpdate(); void OnEffectStop(); } public interface IStatusEffectReceiver { void AddStatusEffect(IStatusEffect effect); void RemoveStatusEffect(IStatusEffect effect); IEnumerable GetStatusEffects(); GameObject GetAffectedObject(); } public class TrainingBot : MonoBehaviour { } public class Explodable : MonoBehaviour, IExplodable { public Action OnExplode; public UnityEvent OnExploded; public void Explode(Explosion explosion) { ExplodeCore(explosion); } protected virtual void ExplodeCore(Explosion explosion) { OnExplode?.Invoke(explosion); OnExploded?.Invoke(explosion); } } public interface ICleanable { void Cleanup(); } public class InventoryControllerDeployer : MonoBehaviour { private RectTransform canvas; private Transform configHelpMessage; private Transform versionHelpMessage; private OptionsManager om; private InventoryController invController; private Button invControllerButton; private Button configHelpButton; private GameObject pauseMenu; public bool inventoryManagerOpen = false; [Configgable("Binds", "Open UFG Inventory", 0, null)] public static ConfigKeybind inventoryKey = new ConfigKeybind((KeyCode)105); private static bool sentVersionMessage = false; private bool displayingHelpMessage = false; [UFGAsset("UFGInventoryUI")] private static GameObject UFGInventoryUI; [UFGAsset("UFGInventoryButton")] private static GameObject UFGInventoryButton; [UFGAsset("UFGKeybindsMenu")] private static GameObject UFGKeybindsUI; [Configgable("Advanced", "Show Update Notifications", 0, null)] private static ConfigToggle showUpdateNotifications = new ConfigToggle(true); private static bool showedUpdateNotification; [UFGAsset("WMUINode")] public static GameObject UFGInventoryNode { get; private set; } private void Awake() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Expected O, but got Unknown om = MonoSingleton.Instance; canvas = ((Component)this).GetComponent(); pauseMenu = ((Component)((Component)this).transform.Find("PauseMenu")).gameObject; invControllerButton = Object.Instantiate(UFGInventoryButton, (Transform)(object)canvas).GetComponent