Decompiled source of BananaWeapons v2.1.3
NewBananaWeapons.dll
Decompiled 5 days 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.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Threading.Tasks; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using NewBananaWeapons; using TMPro; using ULTRAKILL.Cheats; using ULTRAKILL.Portal; using ULTRAKILL.Portal.Geometry; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.Events; using UnityEngine.Rendering; using UnityEngine.ResourceManagement.AsyncOperations; 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(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("NewBananaWeapons")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+2ca38007bf6436fdfbe310adc955dc84e9465eee")] [assembly: AssemblyProduct("NewBananaWeapons")] [assembly: AssemblyTitle("NewBananaWeapons")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] public abstract class BaseWeapon : MonoBehaviour { public virtual void SetupConfigs(string sectionName) { } public virtual string GetWeaponDescription() { return string.Empty; } } public class ConfigVar<T> { public ConfigEntry<T> entry; public T Value { get { return entry.Value; } set { entry.Value = value; } } public ConfigVar(string section, string name, T defaultValue, string description = "") { entry = Banana_WeaponsPlugin.File.Bind<T>(section, name, defaultValue, description); } } public class BenjaminLaserWeapon : BaseWeapon { public GameObject chargingLaser; public GameObject laser; private Animator anim; public static ConfigVar<float> damage; public override void SetupConfigs(string sectionName) { damage = new ConfigVar<float>(sectionName, "Damage", 125f); base.SetupConfigs(sectionName); } public override string GetWeaponDescription() { return "Fires a massive laser dealing 125 damage (changeable)"; } private void Awake() { anim = ((Component)this).GetComponent<Animator>(); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(laser)); } private void Update() { if (!MonoSingleton<GunControl>.Instance.activated) { return; } if (Banana_WeaponsPlugin.cooldowns.ContainsKey(((Component)this).gameObject)) { chargingLaser.SetActive(false); anim.SetBool("Activating", false); return; } chargingLaser.SetActive(true); if (MonoSingleton<InputManager>.instance.InputSource.Fire1.WasPerformedThisFrame) { anim.SetBool("Activating", true); } } public void FireLaser() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_0071: 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) //IL_00a0: 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) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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) //IL_00dc: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Invalid comparison between Unknown and I4 //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)MonoSingleton<CameraController>.Instance).transform; Object.Instantiate<GameObject>(laser, ((Component)MonoSingleton<CameraController>.Instance).transform.position, ((Component)MonoSingleton<CameraController>.Instance).transform.rotation).transform.Rotate(90f, 0f, 0f); Banana_WeaponsPlugin.cooldowns.Add(((Component)this).gameObject, 120f); RaycastHit[] array = Physics.SphereCastAll(transform.position, 1317.042f, transform.forward, 100000f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)0))); List<EnemyIdentifier> list = new List<EnemyIdentifier>(); RaycastHit[] array2 = array; EnemyIdentifierIdentifier val2 = default(EnemyIdentifierIdentifier); for (int i = 0; i < array2.Length; i++) { RaycastHit val = array2[i]; if (!((Component)((RaycastHit)(ref val)).collider).gameObject.TryGetComponent<EnemyIdentifierIdentifier>(ref val2)) { continue; } Vector3 val3 = ((Component)val2).transform.position - transform.position; Vector3 normalized = ((Vector3)(ref val3)).normalized; if (Vector3.Dot(transform.forward, normalized) <= 0f) { continue; } if ((int)val2.eid.enemyType == 35 && SceneHelper.CurrentScene == "Level 7-4") { foreach (EnemyIdentifier currentEnemy in MonoSingleton<EnemyTracker>.Instance.GetCurrentEnemies()) { currentEnemy.InstaKill(); } break; } if (!list.Contains(val2.eid)) { val2.eid.hitter = "BenjaminBeam"; val2.eid.DeliverDamage(((Component)((RaycastHit)(ref val)).collider).gameObject, transform.forward * 2.1474836E+09f, ((RaycastHit)(ref val)).point, damage.Value, true, 0f, (GameObject)null, false, false); list.Add(val2.eid); } } } } public class CharlesWeapon : BaseWeapon { public GameObject helicopter; public static ConfigVar<float> helicopterDamage; public override void SetupConfigs(string sectionName) { helicopterDamage = new ConfigVar<float>(sectionName, "Damage", 70f); base.SetupConfigs(sectionName); } public override string GetWeaponDescription() { return "Click somewhere to spawn charles, charles will spawn 1350m high up in the air and fall down, will pierce through the ground dealing 70 damage to enemies, and instakilling the player."; } private void Start() { ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(helicopter)); } private void Update() { //IL_003c: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) if (MonoSingleton<GunControl>.Instance.activated) { Transform transform = ((Component)MonoSingleton<CameraController>.Instance).transform; RaycastHit val = default(RaycastHit); if (MonoSingleton<InputManager>.Instance.InputSource.Fire1.WasPerformedThisFrame && Physics.Raycast(transform.position, transform.forward, ref val, 1000f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1)))) { Object.Instantiate<GameObject>(helicopter, ((RaycastHit)(ref val)).point + new Vector3(0f, 1350f, 0f), helicopter.transform.rotation); } } } } public class DavidWeapon : BaseWeapon { public List<AudioClip> idleClips = new List<AudioClip>(); public AudioClip ThereIsACar; public AudioClip AndItIsGoingToHitMe; public GameObject davidThrown; public GameObject car; private float idleTimer = 0f; private float cooldownTimer = 0f; private AudioSource source; private GameObject thrownDavid; public static ConfigVar<float> carDamage; public override void SetupConfigs(string sectionName) { carDamage = new ConfigVar<float>(sectionName, "Damage", 25f); base.SetupConfigs(sectionName); } public override string GetWeaponDescription() { return "Left click to spawn david, once david is placed down. Press right click to spawn a car dealing 25 damage"; } private void Awake() { source = ((Component)this).GetComponent<AudioSource>(); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(car)); } private void Update() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) if (MonoSingleton<GunControl>.Instance.activated) { Transform transform = ((Component)MonoSingleton<CameraController>.Instance).transform; if ((Object)(object)thrownDavid == (Object)null) { idleTimer -= Time.deltaTime; } cooldownTimer -= Time.deltaTime; if (idleTimer < 0f) { source.PlayOneShot(idleClips[Random.Range(0, idleClips.Count)]); idleTimer = Random.Range(3, 10); } RaycastHit val = default(RaycastHit); if (MonoSingleton<InputManager>.Instance.InputSource.Fire1.WasPerformedThisFrame && (Object)(object)thrownDavid == (Object)null && cooldownTimer <= 0f && Physics.Raycast(transform.position, transform.forward, ref val, 1000f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1)))) { thrownDavid = Object.Instantiate<GameObject>(davidThrown, ((RaycastHit)(ref val)).point + new Vector3(0f, davidThrown.transform.localScale.y / 2f), davidThrown.transform.rotation); cooldownTimer = 2f; } if (MonoSingleton<InputManager>.Instance.InputSource.Fire2.WasPerformedThisFrame && (Object)(object)thrownDavid != (Object)null && cooldownTimer <= 0f) { source.PlayOneShot(ThereIsACar); Vector3 val2 = FindBestCarSpawnDirection(thrownDavid.transform); Vector3 val3 = thrownDavid.transform.position + val2 * 1000f; GameObject val4 = Object.Instantiate<GameObject>(car, val3, Quaternion.identity); val4.GetComponent<CarProjectile>().target = thrownDavid.transform; val4.GetComponent<CarProjectile>().sourceWeapon = ((Component)this).gameObject; cooldownTimer = 9f; } } } private Vector3 FindBestCarSpawnDirection(Transform thrownDavid, float hitRadius = 25f) { //IL_002d: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00b9: 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_00c0: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_011b: Unknown result type (might be due to invalid IL or missing references) List<EnemyIdentifier> currentEnemies = MonoSingleton<EnemyTracker>.Instance.GetCurrentEnemies(); if (currentEnemies == null || currentEnemies.Count == 0) { return Vector3.forward; } Vector3 result = Vector3.forward; int num = 0; Vector3 position = thrownDavid.position; foreach (EnemyIdentifier item in currentEnemies) { if ((Object)(object)item == (Object)null) { continue; } Vector3 val = ((Component)item).transform.position - position; Vector3 normalized = ((Vector3)(ref val)).normalized; int num2 = 0; foreach (EnemyIdentifier item2 in currentEnemies) { if (!((Object)(object)item2 == (Object)null)) { Vector3 val2 = ((Component)item2).transform.position - position; Vector3 val3 = Vector3.Project(val2, normalized); Vector3 val4 = val2 - val3; if (((Vector3)(ref val4)).magnitude <= hitRadius) { num2++; } } } if (num2 > num) { num = num2; result = normalized; } } return result; } private void OnEnable() { idleTimer = Random.Range(3, 10); } } public class FuckYouArm : BaseWeapon { private Animator anim; public override string GetWeaponDescription() { return "Express dissatisfaction..."; } private void Awake() { anim = ((Component)this).GetComponent<Animator>(); } public void Update() { if (MonoSingleton<GunControl>.Instance.activated) { anim.SetBool("Holding", MonoSingleton<InputManager>.Instance.InputSource.Punch.IsPressed); } } } public class GambleGun : BaseWeapon { [CompilerGenerated] private sealed class <Spin>d__23 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public GambleGun <>4__this; private float[] <speeds>5__1; private float <timer>5__2; private int <i>5__3; private int <i>5__4; private GameObject[] <>s__5; private int <>s__6; private GameObject <slot>5__7; private Transform <t>5__8; private float <snappedZ>5__9; private float <z>5__10; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Spin>d__23(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <speeds>5__1 = null; <>s__5 = null; <slot>5__7 = null; <t>5__8 = null; <>1__state = -2; } private bool MoveNext() { //IL_00e5: 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_021b: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <speeds>5__1 = new float[<>4__this.slots.Length]; <i>5__3 = 0; while (<i>5__3 < <speeds>5__1.Length) { <speeds>5__1[<i>5__3] = Random.Range(minSpinSpeed.Value, maxSpinSpeed.Value); <i>5__3++; } <timer>5__2 = 0f; break; case 1: <>1__state = -1; break; } if (<timer>5__2 < spinDuration.Value) { <i>5__4 = 0; while (<i>5__4 < <>4__this.slots.Length) { <>4__this.slots[<i>5__4].transform.Rotate(new Vector3(0f, 0f, 500f * <speeds>5__1[<i>5__4] * Time.deltaTime)); <i>5__4++; } <timer>5__2 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } <>s__5 = <>4__this.slots; for (<>s__6 = 0; <>s__6 < <>s__5.Length; <>s__6++) { <slot>5__7 = <>s__5[<>s__6]; <t>5__8 = <slot>5__7.transform; if (riggedModeConfig.Value) { <snappedZ>5__9 = (float)<>4__this.riggedResult * 72f % 360f; } else { <z>5__10 = <t>5__8.localEulerAngles.z; <snappedZ>5__9 = Mathf.Round(<z>5__10 / 72f) * 72f % 360f; } <t>5__8.localEulerAngles = new Vector3(<t>5__8.localEulerAngles.x, <t>5__8.localEulerAngles.y, <snappedZ>5__9); <t>5__8 = null; <slot>5__7 = null; } <>s__5 = null; <>4__this.spinning = false; <>4__this.Fire(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform firePoint; private Animator anim; public GameObject[] slots; public GameObject[] projectilesPerFireMode; public AudioClip lossClip; public AudioClip winClip; private AudioSource source; private bool spinning; private bool riggedMode = false; public int riggedResult = 2; private static ConfigVar<float> spinDuration; private static ConfigVar<float> minSpinSpeed; private static ConfigVar<float> maxSpinSpeed; private static ConfigVar<int> jackpotPoints; private static ConfigVar<float> kitrDamage; private static ConfigVar<int> filthEnemyDamage; private static ConfigVar<int> coinEnemyDamage; private static ConfigVar<bool> riggedModeConfig; public GameObject sevenChargeParticle; public override string GetWeaponDescription() { return "Left click to gamble, depending on the outcome. You get different damage"; } public override void SetupConfigs(string sectionName) { spinDuration = new ConfigVar<float>(sectionName, "Spin Duration", 0.5f, "How long the slot machine spins for (in seconds)"); minSpinSpeed = new ConfigVar<float>(sectionName, "Min Spin Speed", 1f, "Minimum speed multiplier for slot spinning"); maxSpinSpeed = new ConfigVar<float>(sectionName, "Max Spin Speed", 3f, "Maximum speed multiplier for slot spinning"); jackpotPoints = new ConfigVar<int>(sectionName, "Jackpot Style Points", 500, "Style points awarded for getting a jackpot"); kitrDamage = new ConfigVar<float>(sectionName, "Loss Damage", 0.5f, "Damage multiplier for loss result"); filthEnemyDamage = new ConfigVar<int>(sectionName, "Filth Damage", 15, "Direct enemy damage for Filth result"); coinEnemyDamage = new ConfigVar<int>(sectionName, "Coin Damage", 75, "Direct enemy damage for Coin result"); riggedModeConfig = new ConfigVar<bool>(sectionName, "Rigged Mode Enabled", defaultValue: false, "Enable rigged mode where you can control the outcome (Right click to change outcome)"); riggedMode = riggedModeConfig.Value; } private void Awake() { source = ((Component)this).GetComponent<AudioSource>(); anim = ((Component)this).GetComponent<Animator>(); } private void OnDisable() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_008b: Unknown result type (might be due to invalid IL or missing references) spinning = false; GameObject[] array = slots; foreach (GameObject val in array) { Transform transform = val.transform; float num; if (riggedMode) { num = (float)riggedResult * 72f % 360f; } else { float z = transform.localEulerAngles.z; num = Mathf.Round(z / 72f) * 72f % 360f; } transform.localEulerAngles = new Vector3(transform.localEulerAngles.x, transform.localEulerAngles.y, num); } ((MonoBehaviour)this).StopAllCoroutines(); } private void Update() { if (!MonoSingleton<GunControl>.Instance.activated) { return; } if (MonoSingleton<InputManager>.Instance.InputSource.Fire1.WasPerformedThisFrame && !spinning) { spinning = true; ((MonoBehaviour)this).StartCoroutine(Spin()); } if (MonoSingleton<InputManager>.Instance.InputSource.Fire2.WasPerformedThisFrame) { riggedResult++; if (riggedResult == 5) { riggedResult = 0; } } projectilesPerFireMode[3] = AddressableManager.mauriceBeam; projectilesPerFireMode[5] = AddressableManager.normalBeam; projectilesPerFireMode[1] = AddressableManager.normalBeam; projectilesPerFireMode[0] = AddressableManager.normalBeam; } [IteratorStateMachine(typeof(<Spin>d__23))] private IEnumerator Spin() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Spin>d__23(0) { <>4__this = this }; } public void FireSeven() { //IL_0014: 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_0039: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(projectilesPerFireMode[4], ((Component)firePoint).transform.position, ((Component)firePoint).transform.rotation); RaycastHit val2 = default(RaycastHit); Vector3 val3 = ((!Physics.Raycast(((Component)MonoSingleton<CameraController>.Instance).transform.position, ((Component)MonoSingleton<CameraController>.Instance).transform.forward, ref val2, 1000f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)3)))) ? (((Component)MonoSingleton<CameraController>.Instance).transform.position + ((Component)MonoSingleton<CameraController>.Instance).transform.forward * 1000f) : ((RaycastHit)(ref val2)).point); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(val)); val.transform.LookAt(val3, Vector3.up); Projectile val4 = default(Projectile); if (!val.TryGetComponent<Projectile>(ref val4)) { return; } if ((Object)(object)val4.explosionEffect != (Object)null) { ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(val4.explosionEffect)); if (Object.op_Implicit((Object)(object)val4.explosionEffect.GetComponentInChildren<Explosion>())) { ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(val4.explosionEffect.GetComponentInChildren<Explosion>().explosionChunk)); } } val4.playerBullet = true; val4.friendly = true; } private void Fire() { //IL_00ce: 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_00f3: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) int fireMode = getFireMode(); if (fireMode == 4) { Object.Instantiate<GameObject>(sevenChargeParticle, sevenChargeParticle.transform.parent).SetActive(true); return; } if ((Object)(object)anim != (Object)null) { anim.SetTrigger("Fire"); } if (fireMode == 0) { source.PlayOneShot(lossClip); } else { MonoSingleton<StyleHUD>.Instance.AddPoints(jackpotPoints.Value, "<color=#00ffffff>JACKPOT!</color>", ((Component)this).gameObject, (EnemyIdentifier)null, -1, "", ""); source.PlayOneShot(winClip); } GameObject val = Object.Instantiate<GameObject>(projectilesPerFireMode[fireMode], ((Component)firePoint).transform.position, ((Component)firePoint).transform.rotation); RaycastHit val2 = default(RaycastHit); Vector3 val3 = ((!Physics.Raycast(((Component)MonoSingleton<CameraController>.Instance).transform.position, ((Component)MonoSingleton<CameraController>.Instance).transform.forward, ref val2, 1000f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)3)))) ? (((Component)MonoSingleton<CameraController>.Instance).transform.position + ((Component)MonoSingleton<CameraController>.Instance).transform.forward * 1000f) : ((RaycastHit)(ref val2)).point); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(val)); val.transform.LookAt(val3, Vector3.up); RevolverBeam val4 = default(RevolverBeam); if (val.TryGetComponent<RevolverBeam>(ref val4)) { switch (fireMode) { case 5: val4.damage = 1f; val4.enemyDamageOverride = coinEnemyDamage.Value; break; case 0: val4.damage = kitrDamage.Value; break; case 1: val4.damage = 1f; val4.enemyDamageOverride = filthEnemyDamage.Value; break; } } Projectile val5 = default(Projectile); if (!val.TryGetComponent<Projectile>(ref val5)) { return; } if ((Object)(object)val5.explosionEffect != (Object)null) { ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(val5.explosionEffect)); if (Object.op_Implicit((Object)(object)val5.explosionEffect.GetComponentInChildren<Explosion>())) { ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(val5.explosionEffect.GetComponentInChildren<Explosion>().explosionChunk)); } } val5.playerBullet = true; val5.friendly = true; } private int getFireMode() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.FloorToInt(slots[0].transform.localEulerAngles.z); for (int i = 1; i < slots.Length; i++) { int num2 = Mathf.FloorToInt(slots[i].transform.localEulerAngles.z); if (num2 != num) { return 0; } } return (Mathf.RoundToInt((float)num / 72f) % 5) switch { 0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5, _ => 0, }; } } public class JujutsuKaisenTechniques : BaseWeapon { public Transform blueCharge; public Transform redCharge; public Transform purpleCharge; public GameObject blueProjectile; public GameObject redProjectile; public GameObject purpleProjectile; public float chargeTime = 1f; private bool chargingBlue; private bool chargingRed; private bool chargingPurple; private float blueTimer; private float redTimer; [Header("Charge Visuals")] public float maxChargeScale = 1.5f; private Vector3 blueStartScale; private Vector3 redStartScale; private Vector3 purpleStartScale; private Vector3 blueStartPos; private Vector3 redStartPos; private Vector3 purpleStartPos; private InputManager inman; private AudioSource source; public override string GetWeaponDescription() { return "Holding left click and then letting go fires blue, with right click you fire red. Holding both you fire purple"; } private void Awake() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_006b: 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) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00af: Unknown result type (might be due to invalid IL or missing references) inman = MonoSingleton<InputManager>.Instance; source = ((Component)this).GetComponent<AudioSource>(); ((Component)blueCharge).gameObject.SetActive(false); ((Component)redCharge).gameObject.SetActive(false); ((Component)purpleCharge).gameObject.SetActive(false); blueStartScale = blueCharge.localScale; redStartScale = redCharge.localScale; purpleStartScale = purpleCharge.localScale; blueStartPos = blueCharge.localPosition; redStartPos = redCharge.localPosition; purpleStartPos = purpleCharge.localPosition; } private void Update() { if (MonoSingleton<GunControl>.Instance.activated && !Banana_WeaponsPlugin.cooldowns.ContainsKey(((Component)this).gameObject)) { HandleCharging(); HandleRelease(); HandleVisuals(); } } private void HandleCharging() { if (inman.InputSource.Fire1.IsPressed && !chargingPurple) { blueTimer += Time.deltaTime; if (blueTimer >= chargeTime) { chargingBlue = true; } } if (inman.InputSource.Fire2.IsPressed && !chargingPurple) { redTimer += Time.deltaTime; if (redTimer >= chargeTime) { chargingRed = true; } } if (chargingBlue && chargingRed) { chargingPurple = true; } } private void HandleRelease() { //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) //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_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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_00a3: Unknown result type (might be due to invalid IL or missing references) if (inman.InputSource.Fire1.WasCanceledThisFrame || inman.InputSource.Fire2.WasCanceledThisFrame) { Vector3 position = ((Component)MonoSingleton<CameraController>.Instance).transform.position; Quaternion rotation = ((Component)MonoSingleton<CameraController>.Instance).transform.rotation; if (chargingPurple) { Object.Instantiate<GameObject>(purpleProjectile, position, rotation); } else if (chargingBlue) { Object.Instantiate<GameObject>(blueProjectile, position, rotation); } else if (chargingRed) { Object.Instantiate<GameObject>(redProjectile, position, rotation); } ResetAll(); } } private void HandleVisuals() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0198: 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_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) if (inman.InputSource.Fire1.IsPressed) { ((Component)blueCharge).gameObject.SetActive(true); float num = Mathf.Clamp01(blueTimer / chargeTime); blueCharge.localScale = Vector3.Lerp(blueStartScale, blueStartScale * maxChargeScale, num); } else { ((Component)blueCharge).gameObject.SetActive(false); blueCharge.localScale = blueStartScale; blueCharge.localPosition = blueStartPos; } if (inman.InputSource.Fire2.IsPressed) { ((Component)redCharge).gameObject.SetActive(true); float num2 = Mathf.Clamp01(redTimer / chargeTime); redCharge.localScale = Vector3.Lerp(redStartScale, redStartScale * maxChargeScale, num2); } else { ((Component)redCharge).gameObject.SetActive(false); redCharge.localScale = redStartScale; redCharge.localPosition = redStartPos; } if (chargingPurple) { ((Component)purpleCharge).gameObject.SetActive(true); purpleCharge.localScale = purpleStartScale * (maxChargeScale * 2.5f); blueCharge.position = Vector3.Lerp(blueCharge.position, purpleCharge.position, Time.deltaTime * 8f); redCharge.position = Vector3.Lerp(redCharge.position, purpleCharge.position, Time.deltaTime * 8f); } else { ((Component)purpleCharge).gameObject.SetActive(false); purpleCharge.localScale = purpleStartScale; purpleCharge.localPosition = purpleStartPos; } } private void ResetAll() { //IL_006b: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) chargingBlue = (chargingRed = (chargingPurple = false)); blueTimer = (redTimer = 0f); ((Component)blueCharge).gameObject.SetActive(false); ((Component)redCharge).gameObject.SetActive(false); ((Component)purpleCharge).gameObject.SetActive(false); blueCharge.localScale = blueStartScale; redCharge.localScale = redStartScale; purpleCharge.localScale = purpleStartScale; blueCharge.localPosition = blueStartPos; redCharge.localPosition = redStartPos; purpleCharge.localPosition = purpleStartPos; } } public class KeyboardWeapon : BaseWeapon { [CompilerGenerated] private sealed class <fireProjectile>d__22 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public string[] words; public KeyboardWeapon <>4__this; private HashSet<string> <pendingAdjectives>5__1; private float <sentenceMultiplier>5__2; private int <uniqueWords>5__3; private float <varietyBonus>5__4; private string[] <>s__5; private int <>s__6; private string <raw>5__7; private string <word>5__8; private HashSet<string>.Enumerator <>s__9; private string <adj>5__10; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <fireProjectile>d__22(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 2) { try { } finally { <>m__Finally1(); } } <pendingAdjectives>5__1 = null; <>s__5 = null; <raw>5__7 = null; <word>5__8 = null; <>s__9 = default(HashSet<string>.Enumerator); <adj>5__10 = null; <>1__state = -2; } private bool MoveNext() { //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Expected O, but got Unknown //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <pendingAdjectives>5__1 = new HashSet<string>(); <sentenceMultiplier>5__2 = Mathf.Clamp((float)words.Length * sentenceMultiplierScale.Value, 0f, 1f); <uniqueWords>5__3 = words.Distinct().Count(); <varietyBonus>5__4 = (float)<uniqueWords>5__3 / (float)words.Length; <>s__5 = words; <>s__6 = 0; goto IL_017b; case 1: <>1__state = -1; <word>5__8 = null; <raw>5__7 = null; goto IL_016d; case 2: { <>1__state = -3; <adj>5__10 = null; goto IL_022c; } IL_017b: if (<>s__6 < <>s__5.Length) { <raw>5__7 = <>s__5[<>s__6]; <word>5__8 = <raw>5__7.ToLowerInvariant(); if (<>4__this.IsAdjective(<word>5__8)) { <pendingAdjectives>5__1.Add(<word>5__8); goto IL_016d; } <>4__this.FireWord(<word>5__8, <pendingAdjectives>5__1.ToList(), <varietyBonus>5__4, <sentenceMultiplier>5__2); <pendingAdjectives>5__1.Clear(); <>2__current = (object)new WaitForSeconds(wordFireDelay.Value); <>1__state = 1; return true; } <>s__5 = null; if (<pendingAdjectives>5__1.Count <= 0) { break; } <>s__9 = <pendingAdjectives>5__1.GetEnumerator(); <>1__state = -3; goto IL_022c; IL_016d: <>s__6++; goto IL_017b; IL_022c: if (<>s__9.MoveNext()) { <adj>5__10 = <>s__9.Current; <>4__this.FireWord(<adj>5__10, new List<string>(), <varietyBonus>5__4, <sentenceMultiplier>5__2); <>2__current = (object)new WaitForSeconds(wordFireDelay.Value); <>1__state = 2; return true; } <>m__Finally1(); <>s__9 = default(HashSet<string>.Enumerator); break; } return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__9).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public GameObject projec; public TMP_Text writing; private StringBuilder builder = new StringBuilder(); private static ConfigVar<float> slowMotionMultiplier; private static ConfigVar<int> capitalizationPoints; private static ConfigVar<int> punctuationPoints; private static ConfigVar<int> fullSentencePoints; private static ConfigVar<int> multiSentencePointsPerSentence; private static ConfigVar<float> wordFireDelay; private static ConfigVar<float> varietyBonusMultiplier; private static ConfigVar<float> sentenceMultiplierScale; private static readonly HashSet<string> adjectiveDictionary = new HashSet<string> { "fast", "powerful", "slow", "big", "giant", "massive", "explosive", "piercing", "homing", "tiny", "heavy", "chaotic", "vampiric", "bouncing", "bouncy", "splitting", "growing", "shrinking", "spinning", "phasing", "ghostly", "chaining", "freezing", "frozen", "icy", "burning", "flaming", "fiery", "gravity", "reversing", "pulsating", "pulsing", "draining", "leeching", "multiplying", "cloning", "unstable", "ethereal", "toxic", "poison", "ancient", "swift", "divine", "cursed", "blessed", "wild" }; private bool Typing = false; public override string GetWeaponDescription() { return "Left click ot begin typing, certain words and adjectives give modifiers, and so does how long your sentence is and if theres captilization + punctuation. (read README for more info about modifiers)"; } public override void SetupConfigs(string sectionName) { slowMotionMultiplier = new ConfigVar<float>(sectionName, "Slow Motion Multiplier", 0.25f, "Time scale when typing (0.25 = 25% speed)"); capitalizationPoints = new ConfigVar<int>(sectionName, "Capitalization Points", 100, "Style points for capitalizing first letter"); punctuationPoints = new ConfigVar<int>(sectionName, "Punctuation Points", 200, "Style points for proper punctuation"); fullSentencePoints = new ConfigVar<int>(sectionName, "Full Sentence Points", 300, "Bonus points for both capitalization and punctuation"); multiSentencePointsPerSentence = new ConfigVar<int>(sectionName, "Multi Sentence Points", 150, "Points per sentence when typing multiple sentences"); wordFireDelay = new ConfigVar<float>(sectionName, "Word Fire Delay", 0.1f, "Delay between firing each word (in seconds)"); varietyBonusMultiplier = new ConfigVar<float>(sectionName, "Variety Bonus Multiplier", 0.5f, "Multiplier for word variety bonus"); sentenceMultiplierScale = new ConfigVar<float>(sectionName, "Sentence Multiplier Scale", 0.1f, "How much longer sentences increase damage (0.1 = 10% per word)"); } private void OnDisable() { EnableMovement(); builder.Clear(); } private void DisableMovement() { ((Behaviour)MonoSingleton<NewMovement>.Instance).enabled = false; ((Behaviour)MonoSingleton<GunControl>.Instance).enabled = false; MonoSingleton<PlayerUtilities>.Instance.NoFist(); MonoSingleton<TimeController>.Instance.timeScaleModifier = slowMotionMultiplier.Value; MonoSingleton<TimeController>.instance.RestoreTime(); } private void EnableMovement() { ((Behaviour)MonoSingleton<NewMovement>.Instance).enabled = true; ((Behaviour)MonoSingleton<GunControl>.Instance).enabled = true; MonoSingleton<PlayerUtilities>.Instance.YesFist(); MonoSingleton<TimeController>.Instance.timeScaleModifier = 1f; MonoSingleton<TimeController>.instance.RestoreTime(); } private void Update() { if (!MonoSingleton<GunControl>.Instance.activated) { return; } if (MonoSingleton<InputManager>.Instance.InputSource.Fire1.WasPerformedThisFrame) { DisableMovement(); Typing = true; } if (!Typing) { return; } string inputString = Input.inputString; if (!string.IsNullOrEmpty(inputString)) { string text = inputString; foreach (char c in text) { switch (c) { case '\b': if (builder.Length > 0) { builder.Length--; } break; default: if (c != '\r') { builder.Append(c); break; } goto case '\n'; case '\n': { MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage(builder.ToString(), "", "", 0, false, false, true); Banana_WeaponsPlugin.Log.LogInfo((object)builder.ToString()); CheckSpelling(builder.ToString()); builder.Replace(".", ""); builder.Replace(",", ""); builder.Replace("?", ""); builder.Replace("!", ""); builder.Replace(";", ""); string[] words = builder.ToString().Split(new char[1] { ' ' }, StringSplitOptions.RemoveEmptyEntries); ((MonoBehaviour)this).StartCoroutine(fireProjectile(words)); builder.Clear(); EnableMovement(); Typing = false; break; } } } } writing.text = builder.ToString() + "<color=#808080>Type to enter text, and hit Enter to fire..."; } private void CheckSpelling(string sentence) { if (!string.IsNullOrWhiteSpace(sentence)) { bool flag = char.IsUpper(sentence.TrimStart(Array.Empty<char>())[0]); bool flag2 = char.IsPunctuation(sentence.Trim().Last()); if (flag) { MonoSingleton<StyleHUD>.Instance.AddPoints(capitalizationPoints.Value, "<color=green>CAPITALIZATION</color>", ((Component)this).gameObject, (EnemyIdentifier)null, -1, "", ""); } if (flag2) { MonoSingleton<StyleHUD>.Instance.AddPoints(punctuationPoints.Value, "<color=#00ffffff>PUNCTUATION</color>", ((Component)this).gameObject, (EnemyIdentifier)null, -1, "", ""); } if (flag && flag2) { MonoSingleton<StyleHUD>.Instance.AddPoints(fullSentencePoints.Value, "<color=yellow>FULL SENTENCE</color>", ((Component)this).gameObject, (EnemyIdentifier)null, -1, "", ""); } int num = sentence.Count((char c) => c == '.' || c == '!' || c == '?'); if (num > 1) { MonoSingleton<StyleHUD>.Instance.AddPoints(num * multiSentencePointsPerSentence.Value, "<color=orange>MULTI SENTENCE</color>", ((Component)this).gameObject, (EnemyIdentifier)null, -1, "", ""); } } } public void FireWord(string word, List<string> adjectives, float varietyBonus, float sentenceMultiplier) { //IL_0011: 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) GameObject val = Object.Instantiate<GameObject>(projec, ((Component)MonoSingleton<CameraController>.Instance).transform.position, ((Component)MonoSingleton<CameraController>.Instance).transform.rotation); WordProjectile component = val.GetComponent<WordProjectile>(); component.Word = word; component.Adjectives.AddRange(adjectives); component.VarietyMultiplier = varietyBonus * varietyBonusMultiplier.Value; component.SentenceMultiplier = sentenceMultiplier; } private bool IsAdjective(string word) { return adjectiveDictionary.Contains(word.ToLower()); } [IteratorStateMachine(typeof(<fireProjectile>d__22))] private IEnumerator fireProjectile(string[] words) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <fireProjectile>d__22(0) { <>4__this = this, words = words }; } } public class LaserBeam : BaseWeapon { public GameObject chargeParticle; private float charging = 0f; private InputManager inman; private CameraController cam; private LineRenderer line; private float damageDelay; private static ConfigVar<float> chargeTime; private static ConfigVar<float> laserRadius; private static ConfigVar<float> laserRange; private static ConfigVar<float> damage; private static ConfigVar<float> damageTickRate; public override string GetWeaponDescription() { return "Charge up a laser... Thats kinda it."; } public override void SetupConfigs(string sectionName) { chargeTime = new ConfigVar<float>(sectionName, "Charge Time", 1f, "Time required to charge the laser before it fires (in seconds)"); laserRadius = new ConfigVar<float>(sectionName, "Laser Radius", 3f, "Radius of the laser beam spherecast"); laserRange = new ConfigVar<float>(sectionName, "Laser Range", 80f, "Maximum range of the laser beam"); damage = new ConfigVar<float>(sectionName, "Damage Per Tick", 0.5f, "Damage dealt per damage tick"); damageTickRate = new ConfigVar<float>(sectionName, "Damage Tick Rate", 0.1f, "Time between damage ticks (in seconds)"); } private void Awake() { inman = MonoSingleton<InputManager>.Instance; cam = MonoSingleton<CameraController>.Instance; line = ((Component)this).gameObject.GetComponent<LineRenderer>(); line.widthMultiplier = laserRadius.Value; } private void Update() { //IL_006f: 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_0099: 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_018b: 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_01b3: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) damageDelay -= Time.deltaTime; if (inman.InputSource.Fire1.IsPressed) { charging += Time.deltaTime; if (charging > chargeTime.Value) { chargeParticle.SetActive(false); PhysicsCastResult val = default(PhysicsCastResult); PortalTraversalV2[] array = default(PortalTraversalV2[]); Vector3 val2 = default(Vector3); if (PortalPhysicsV2.SphereCast(cam.GetDefaultPos(), ((Component)cam).transform.forward, laserRange.Value, laserRadius.Value, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)3)), ref val, ref array, ref val2, true, (QueryTriggerInteraction)0)) { EnemyIdentifierIdentifier val3 = default(EnemyIdentifierIdentifier); if (((Component)val.collider).TryGetComponent<EnemyIdentifierIdentifier>(ref val3) && damageDelay <= 0f) { val3.eid.hitter = "beam"; val3.eid.SimpleDamage(damage.Value); damageDelay = damageTickRate.Value; } line.positionCount = 2; line.SetPosition(0, cam.GetDefaultPos() + Vector3.down); line.SetPosition(1, val.point); } else { line.positionCount = 2; line.SetPosition(0, cam.GetDefaultPos() + Vector3.down); line.SetPosition(1, cam.GetDefaultPos() + ((Component)cam).transform.forward * 10f); } } else { chargeParticle.SetActive(true); line.positionCount = 0; } } else { chargeParticle.SetActive(false); line.positionCount = 0; charging = 0f; } } } public class LoaderArm : BaseWeapon { private static ConfigVar<float> cfgMaxChargeTime; private static ConfigVar<float> cfgMinDamageMultiplier; private static ConfigVar<float> cfgMaxDamageMultiplier; private static ConfigVar<float> cfgBaseDamage; private static ConfigVar<float> cfgVelocityDamagePerMPS; private static ConfigVar<float> cfgChargedPunchVelocity; private static ConfigVar<float> cfgPunchForce; private static ConfigVar<float> cfgHitRadius; private static ConfigVar<float> cfgHitDistance; private static ConfigVar<float> cfgPunchDuration; private static float maxChargeTime; private static float minDamageMultiplier; private static float maxDamageMultiplier; private static float baseDamage; private static float velocityDamagePerMPS; private static float chargedPunchVelocity; private static float punchForce; private static float hitRadius; private static float hitDistance; private static float punchDuration; private float chargeTime; private bool isCharging; private bool isHoldingCharge; private bool isPunching; private float punchTimer; private Vector3 punchDirection; private Animator anim; private readonly List<EnemyIdentifier> alreadyHitEnemies = new List<EnemyIdentifier>(); private readonly Dictionary<(int, int), bool> originalAllCollisionStates = new Dictionary<(int, int), bool>(); private bool hasStoredCollisions; public override void SetupConfigs(string sectionName) { cfgMaxChargeTime = new ConfigVar<float>(sectionName, "Max Charge Time", 2.5f); cfgMinDamageMultiplier = new ConfigVar<float>(sectionName, "Min Damage Multiplier", 6f); cfgMaxDamageMultiplier = new ConfigVar<float>(sectionName, "Max Damage Multiplier", 27f); cfgBaseDamage = new ConfigVar<float>(sectionName, "Base Damage", 1.5f); cfgVelocityDamagePerMPS = new ConfigVar<float>(sectionName, "Velocity Damage Per MPS", 0.15f); cfgChargedPunchVelocity = new ConfigVar<float>(sectionName, "Charged Punch Velocity", 180f); cfgPunchForce = new ConfigVar<float>(sectionName, "Punch Force", 10000f); cfgHitRadius = new ConfigVar<float>(sectionName, "Hit Radius", 5f); cfgHitDistance = new ConfigVar<float>(sectionName, "Hit Distance", 1f); cfgPunchDuration = new ConfigVar<float>(sectionName, "Punch Duration", 0.2f); ApplyConfigValues(); } public override string GetWeaponDescription() { return "Press punch to just punch, holding punch allows you to charge up a piercing punch, dealing damage based on charge time and velocity"; } private void ApplyConfigValues() { maxChargeTime = cfgMaxChargeTime.Value; minDamageMultiplier = cfgMinDamageMultiplier.Value; maxDamageMultiplier = cfgMaxDamageMultiplier.Value; baseDamage = cfgBaseDamage.Value; velocityDamagePerMPS = cfgVelocityDamagePerMPS.Value; chargedPunchVelocity = cfgChargedPunchVelocity.Value; punchForce = cfgPunchForce.Value; hitRadius = cfgHitRadius.Value; hitDistance = cfgHitDistance.Value; punchDuration = cfgPunchDuration.Value; } private void Awake() { anim = ((Component)this).GetComponent<Animator>(); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(((Component)this).GetComponent<Punch>().dustParticle)); } private void Update() { anim.SetBool("HoldingPunch", MonoSingleton<InputManager>.Instance.InputSource.Punch.IsPressed); ApplyConfigValues(); HandleCharging(); HandlePunching(); } public void ChargeGauntlet() { isCharging = true; chargeTime = 0f; } public void Release() { //IL_0046: 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_006f: Unknown result type (might be due to invalid IL or missing references) if (isCharging || isHoldingCharge) { isCharging = false; isHoldingCharge = false; isPunching = true; punchTimer = punchDuration; punchDirection = ((Component)MonoSingleton<CameraController>.Instance).transform.forward; alreadyHitEnemies.Clear(); float num = Mathf.Clamp01(chargeTime / maxChargeTime); Banana_WeaponsPlugin.LaunchPlayer(punchDirection, chargedPunchVelocity * num, ignoreMass: true); SaveAllCollisionStates(); hasStoredCollisions = true; } } private void HandleCharging() { //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) if (isCharging) { chargeTime += Time.deltaTime; if (chargeTime >= maxChargeTime) { chargeTime = maxChargeTime; isCharging = false; isHoldingCharge = true; Object.Instantiate<GameObject>(AddressableManager.blueFlash, ((Component)MonoSingleton<CameraController>.Instance).transform.position, Quaternion.identity); } } } private void HandlePunching() { //IL_0085: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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) if (!isPunching) { return; } DisablePlayerCollisionExceptEnvironment(); DisableEnemyLayerCollisions(); if (Object.op_Implicit((Object)(object)MonoSingleton<NewMovement>.Instance.gc)) { ((Behaviour)MonoSingleton<NewMovement>.Instance.gc).enabled = false; } if (Object.op_Implicit((Object)(object)MonoSingleton<NewMovement>.Instance.wc)) { ((Behaviour)MonoSingleton<NewMovement>.Instance.wc).enabled = false; } punchTimer -= Time.deltaTime; RaycastHit[] array = Physics.SphereCastAll(((Component)MonoSingleton<CameraController>.Instance).transform.position, hitRadius, punchDirection, hitDistance); RaycastHit[] array2 = array; EnemyIdentifierIdentifier val = default(EnemyIdentifierIdentifier); for (int i = 0; i < array2.Length; i++) { RaycastHit hit = array2[i]; if (((Component)((RaycastHit)(ref hit)).collider).TryGetComponent<EnemyIdentifierIdentifier>(ref val) && !alreadyHitEnemies.Contains(val.eid)) { DealDamage(val, hit); } } if (punchTimer <= 0f) { EndPunch(); } } private void DealDamage(EnemyIdentifierIdentifier enemy, RaycastHit hit) { //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_0070: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Clamp01(chargeTime / maxChargeTime); float num2 = Mathf.Lerp(minDamageMultiplier, maxDamageMultiplier, num); Vector3 velocity = MonoSingleton<NewMovement>.Instance.rb.velocity; float num3 = ((Vector3)(ref velocity)).magnitude * velocityDamagePerMPS; float num4 = baseDamage * (num2 + num3); enemy.eid.hitter = "riskofrain2loaderreference"; enemy.eid.DeliverDamage(((Component)((RaycastHit)(ref hit)).collider).gameObject, punchDirection * punchForce * num, ((RaycastHit)(ref hit)).point, num4, false, 0f, (GameObject)null, false, false); MonoSingleton<TimeController>.Instance.HitStop(0.05f); alreadyHitEnemies.Add(enemy.eid); } private void SaveAllCollisionStates() { originalAllCollisionStates.Clear(); for (int i = 0; i < 32; i++) { for (int j = i; j < 32; j++) { originalAllCollisionStates[(i, j)] = Physics.GetIgnoreLayerCollision(i, j); } } } private void RestoreAllCollisionStates() { if (!hasStoredCollisions) { return; } foreach (KeyValuePair<(int, int), bool> originalAllCollisionState in originalAllCollisionStates) { Physics.IgnoreLayerCollision(originalAllCollisionState.Key.Item1, originalAllCollisionState.Key.Item2, originalAllCollisionState.Value); } hasStoredCollisions = false; } private void DisablePlayerCollisionExceptEnvironment() { int layer = ((Component)MonoSingleton<NewMovement>.Instance).gameObject.layer; int num = LayerMask.NameToLayer("Environment"); int num2 = LayerMask.NameToLayer("Outdoors"); for (int i = 0; i < 32; i++) { if (i != num && i != num2) { Physics.IgnoreLayerCollision(layer, i, true); } } VerticalClippingBlocker component = ((Component)MonoSingleton<NewMovement>.Instance).GetComponent<VerticalClippingBlocker>(); if (Object.op_Implicit((Object)(object)component)) { ((Behaviour)component).enabled = false; } } private void DisableEnemyLayerCollisions() { int[] array = new int[3] { LayerMask.NameToLayer("GroundCheck"), LayerMask.NameToLayer("Ignore Raycast"), LayerMask.NameToLayer("Default") }; int[] array2 = new int[4] { LayerMask.NameToLayer("Limb"), LayerMask.NameToLayer("BigCorpse"), LayerMask.NameToLayer("EnemyTrigger"), LayerMask.NameToLayer("Gib") }; int[] array3 = array; foreach (int num in array3) { int[] array4 = array2; foreach (int num2 in array4) { Physics.IgnoreLayerCollision(num, num2, true); } } } private void EndPunch() { isPunching = false; chargeTime = 0f; RestoreAllCollisionStates(); NewMovement instance = MonoSingleton<NewMovement>.Instance; if (Object.op_Implicit((Object)(object)instance.gc)) { ((Behaviour)instance.gc).enabled = true; } if (Object.op_Implicit((Object)(object)instance.wc)) { ((Behaviour)instance.wc).enabled = true; } VerticalClippingBlocker component = ((Component)instance).GetComponent<VerticalClippingBlocker>(); if (Object.op_Implicit((Object)(object)component)) { ((Behaviour)component).enabled = true; } } private void OnDisable() { EndPunch(); } private void OnDestroy() { EndPunch(); } } public class MaxwellWeapon : BaseWeapon { public GameObject MaxwellPrefab; public GameObject MaxwellTrans; public AudioClip meowSound; public Material MaxwellEnraged; public Material MaxwellNormal; private AudioSource source; private GameObject maxwell; private int pets; private Animator anim; private GameObject rage; private static ConfigVar<float> petCooldown; private static ConfigVar<int> petsForEnrage; public static ConfigVar<float> catDamage; public override void SetupConfigs(string sectionName) { catDamage = new ConfigVar<float>(sectionName, "Damage", 0.2f); petCooldown = new ConfigVar<float>(sectionName, "Pet Cooldown", 1.35f, "Cooldown between petting Maxwell (in seconds)"); petsForEnrage = new ConfigVar<int>(sectionName, "Pets For Enrage", 5, "Number of pets required to enrage Maxwell"); } private void Awake() { anim = ((Component)this).GetComponent<Animator>(); source = ((Component)this).GetComponent<AudioSource>(); } private void Update() { //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) anim.SetBool("PetMax", false); anim.SetBool("ThrowMax", false); if (MonoSingleton<InputManager>.Instance.InputSource.Fire1.WasPerformedThisFrame && pets < petsForEnrage.Value && !Banana_WeaponsPlugin.cooldowns.ContainsKey(((Component)this).gameObject)) { anim.SetBool("PetMax", true); pets++; source.PlayOneShot(meowSound); Banana_WeaponsPlugin.cooldowns.Add(((Component)this).gameObject, petCooldown.Value); if (pets == petsForEnrage.Value) { rage = Object.Instantiate<GameObject>(AddressableManager.rageEffect, MaxwellTrans.transform); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(MaxwellTrans)); MaxwellTrans.GetComponent<Renderer>().material = MaxwellEnraged; rage.layer = ((Component)this).gameObject.layer; Transform transform = rage.transform; transform.localScale /= 4f; } } if (MonoSingleton<InputManager>.Instance.InputSource.Fire2.WasPerformedThisFrame && (Object)(object)maxwell == (Object)null && pets > 0) { anim.SetBool("ThrowMax", true); } } public void ThrowMax() { //IL_000d: 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_0020: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_0117: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)MonoSingleton<CameraController>.Instance).transform; RaycastHit val = default(RaycastHit); if (Physics.Raycast(transform.position, transform.forward, ref val, 45f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1)))) { maxwell = Object.Instantiate<GameObject>(MaxwellPrefab, ((RaycastHit)(ref val)).point, MaxwellPrefab.transform.rotation); Transform transform2 = maxwell.transform; transform2.localScale *= 3f; MaxwellProjectile component = maxwell.GetComponent<MaxwellProjectile>(); if (pets == petsForEnrage.Value) { maxwell.GetComponent<Renderer>().material = MaxwellEnraged; } component.pets = pets; component.orgPos = ((RaycastHit)(ref val)).point; rage.transform.parent = ((Component)component).transform; rage.transform.localPosition = Vector3.zero; Transform transform3 = rage.transform; transform3.localScale *= 2f; rage.layer = maxwell.layer; pets = 0; MaxwellTrans.GetComponent<Renderer>().material = MaxwellNormal; ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(MaxwellTrans)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(maxwell)); } } } public class MetalPipeWeapon : BaseWeapon { public GameObject metalPipeProjectile; public AudioClip slapClip; private GameObject pipe; private AudioSource source; private Animator anim; private bool isDamaging = false; private List<EnemyIdentifier> hitEnemies = new List<EnemyIdentifier>(); private static ConfigVar<float> slapRange; private static ConfigVar<float> slapDamage; private static ConfigVar<float> slapForce; public static ConfigVar<float> pipeProjectileMaxDamage; public static ConfigVar<float> pipeProjectileDefaultDamage; public override string GetWeaponDescription() { return "Left click to slap, right click to throw pipe. (Can be parried)"; } public override void SetupConfigs(string sectionName) { pipeProjectileMaxDamage = new ConfigVar<float>(sectionName, "Max Damage Projectile", 10f); pipeProjectileDefaultDamage = new ConfigVar<float>(sectionName, "Default Damage", 4.5f); slapRange = new ConfigVar<float>(sectionName, "Slap Range", 35f, "Range of the metal pipe slap attack"); slapDamage = new ConfigVar<float>(sectionName, "Slap Damage", 3f, "Damage dealt by charged slap attack"); slapForce = new ConfigVar<float>(sectionName, "Slap Force", 20f, "Knockback force applied by slap"); } private void Awake() { anim = ((Component)this).GetComponent<Animator>(); source = ((Component)this).GetComponent<AudioSource>(); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(metalPipeProjectile)); } private void Update() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) if (!MonoSingleton<GunControl>.Instance.activated) { return; } anim.SetBool("HoldingLeftClick", MonoSingleton<InputManager>.Instance.InputSource.Fire1.IsPressed); anim.SetBool("RightClick", false); anim.SetBool("HoldingPipe", (Object)(object)pipe == (Object)null); RaycastHit val = default(RaycastHit); EnemyIdentifierIdentifier val2 = default(EnemyIdentifierIdentifier); if (isDamaging && Physics.Raycast(((Component)MonoSingleton<CameraController>.Instance).transform.position, ((Component)MonoSingleton<CameraController>.Instance).transform.forward, ref val, slapRange.Value, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)0))) && ((Component)((RaycastHit)(ref val)).collider).gameObject.TryGetComponent<EnemyIdentifierIdentifier>(ref val2)) { if (hitEnemies.Contains(val2.eid)) { return; } val2.eid.hitter = "Metal"; val2.eid.DeliverDamage(((Component)((RaycastHit)(ref val)).collider).gameObject, ((Component)MonoSingleton<CameraController>.Instance).transform.forward * slapForce.Value, ((Component)val2).transform.position, slapDamage.Value, false, 0f, (GameObject)null, false, false); hitEnemies.Add(val2.eid); source.PlayOneShot(slapClip); } if (MonoSingleton<InputManager>.Instance.InputSource.Fire2.WasPerformedThisFrame && (Object)(object)pipe == (Object)null) { anim.SetBool("RightClick", true); } } public void ThrowPipe() { //IL_0012: 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) pipe = Object.Instantiate<GameObject>(metalPipeProjectile, ((Component)MonoSingleton<CameraController>.Instance).transform.position, ((Component)MonoSingleton<CameraController>.Instance).transform.rotation); pipe.GetComponent<PipeProjectile>().sourceWeapon = ((Component)this).gameObject; } public void EnableDamage() { //IL_000b: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); EnemyIdentifierIdentifier val2 = default(EnemyIdentifierIdentifier); if (Physics.Raycast(((Component)MonoSingleton<CameraController>.Instance).transform.position, ((Component)MonoSingleton<CameraController>.Instance).transform.forward, ref val, slapRange.Value, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)0))) && ((Component)((RaycastHit)(ref val)).collider).gameObject.TryGetComponent<EnemyIdentifierIdentifier>(ref val2)) { val2.eid.hitter = "Metal"; val2.eid.DeliverDamage(((Component)((RaycastHit)(ref val)).collider).gameObject, ((Component)MonoSingleton<CameraController>.Instance).transform.forward * slapForce.Value, ((Component)val2).transform.position, slapDamage.Value, false, 0f, ((Component)this).gameObject, false, false); source.PlayOneShot(slapClip); } } } public class MississipiQueen : BaseWeapon { [CompilerGenerated] private sealed class <FadeMaterial>d__15 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float from; public float to; public MississipiQueen <>4__this; private float <t>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FadeMaterial>d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if ((Object)(object)<>4__this.interiorMat == (Object)null) { return false; } <t>5__1 = 0f; break; case 1: <>1__state = -1; break; } if (<t>5__1 < <>4__this.fadeDuration) { <t>5__1 += Time.unscaledDeltaTime; <>4__this.interiorMat.material.SetFloat("_Opacity", Mathf.Lerp(from, to, <t>5__1 / <>4__this.fadeDuration)); <>2__current = null; <>1__state = 1; return true; } <>4__this.interiorMat.material.SetFloat("_Opacity", to); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Renderer interiorMat; private float fadeDuration = 1f; private float bulletRange = 100f; private static ConfigVar<float> bulletDamage; public Transform firePoint; private AudioSource missippiQueen; private Animator anim; private bool doingSequence = false; public override string GetWeaponDescription() { return "On fire, play a gun animation while playing mississipi queen"; } public override void SetupConfigs(string sectionName) { bulletDamage = new ConfigVar<float>(sectionName, "Bullet Damage", 10f); } private void Awake() { anim = ((Component)this).GetComponent<Animator>(); missippiQueen = ((Component)this).GetComponent<AudioSource>(); } private void Update() { if (doingSequence) { MonoSingleton<TimeController>.Instance.timeScaleModifier = 0f; } anim.SetBool("Fire", false); if (MonoSingleton<InputManager>.Instance.InputSource.Fire1.WasPerformedThisFrame && !doingSequence) { doingSequence = true; anim.SetBool("Fire", true); missippiQueen.Play(); MonoSingleton<TimeController>.Instance.timeScaleModifier = 0f; MonoSingleton<TimeController>.Instance.RestoreTime(); anim.speed = 0.15f; ((Behaviour)MonoSingleton<CameraController>.Instance).enabled = false; MonoSingleton<AudioMixerController>.Instance.SetMusicVolume(0f); } } private void OnDisable() { EndSequence(); } public void FadeInInterior() { ((MonoBehaviour)this).StartCoroutine(FadeMaterial(0f, 1f)); } public void FadeOutInterior() { ((MonoBehaviour)this).StartCoroutine(FadeMaterial(1f, 0f)); } [IteratorStateMachine(typeof(<FadeMaterial>d__15))] private IEnumerator FadeMaterial(float from, float to) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FadeMaterial>d__15(0) { <>4__this = this, from = from, to = to }; } public void FireBullet() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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) if ((Object)(object)firePoint == (Object)null) { firePoint = ((Component)MonoSingleton<CameraController>.Instance).transform; } Ray val = default(Ray); ((Ray)(ref val))..ctor(firePoint.position, firePoint.forward); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, bulletRange, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)0)))) { EnemyIdentifierIdentifier component = ((Component)((RaycastHit)(ref val2)).collider).GetComponent<EnemyIdentifierIdentifier>(); if ((Object)(object)component != (Object)null) { component.eid.SimpleDamage(bulletDamage.Value); } Debug.DrawLine(((Ray)(ref val)).origin, ((RaycastHit)(ref val2)).point, Color.red, 1f); } } public void EndSequence() { doingSequence = false; missippiQueen.Stop(); anim.speed = 1f; MonoSingleton<TimeController>.Instance.timeScaleModifier = 1f; MonoSingleton<TimeController>.Instance.RestoreTime(); MonoSingleton<AudioMixerController>.Instance.SetMusicVolume(MonoSingleton<AudioMixerController>.Instance.optionsMusicVolume); ((Behaviour)MonoSingleton<CameraController>.Instance).enabled = true; } } public class DeltaruneTextBox : MonoBehaviour { [CompilerGenerated] private sealed class <applyText>d__13 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public string text; public DeltaruneTextBox <>4__this; private int <i>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <applyText>d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <i>5__1 = 0; goto IL_00bd; case 1: { <>1__state = -1; TMP_Text tmpText = <>4__this.tmpText; tmpText.text += text[<i>5__1]; <>4__this.source.PlayOneShot(<>4__this.clipToUseOnCharacterType); <i>5__1++; goto IL_00bd; } case 2: { <>1__state = -1; <>4__this.textBox.SetActive(false); return false; } IL_00bd: if (<i>5__1 < text.Length) { <>2__current = (object)new WaitForSeconds(0.033f); <>1__state = 1; return true; } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [SerializeField] private TMP_Text tmpText; [SerializeField] private AudioClip clipToUseOnCharacterType; private CanvasGroup group; private AudioSource source; private GameObject textBox; public Transform target; public static DeltaruneTextBox Instance { get; private set; } private void Awake() { group = ((Component)this).GetComponent<CanvasGroup>(); textBox = ((Component)((Component)this).transform.GetChild(0)).gameObject; source = ((Component)this).GetComponent<AudioSource>(); Instance = this; textBox.SetActive(false); } private void Update() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)target == (Object)null)) { float num = Vector3.Distance(((Component)MonoSingleton<NewMovement>.Instance).transform.position, ((Component)target).transform.position); if (num <= 45f) { float num2 = 1f - num / 45f; group.alpha = num2; source.volume = num2; } else { group.alpha = 0f; source.volume = 0f; } } } public void TextboxText(string text, Transform textboxTarget) { textBox.SetActive(true); target = textboxTarget; tmpText.text = ""; ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).StartCoroutine(applyText(text)); } [IteratorStateMachine(typeof(<applyText>d__13))] private IEnumerator applyText(string text) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <applyText>d__13(0) { <>4__this = this, text = text }; } } public class PortalBeam : MonoBehaviour { private LineRenderer lr; private Vector3 shotHitPoint; private Vector3? lastForward; private Vector3 alternateStartPoint; public Color shootColor; private float t = 1f; private void Awake() { Object.Destroy((Object)(object)((Component)this).gameObject, 1f); lr = ((Component)this).GetComponent<LineRenderer>(); Shoot(); } private void Update() { t -= Time.deltaTime; lr.widthMultiplier = t; } private void UpdateForward(PortalTraversalV2[] portalTraversals, PhysicsCastResult latestHit) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) UpdateForward(portalTraversals, latestHit.point); } private void UpdateForward(PortalTraversalV2[] portalTraversals, Vector3 hitPos) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_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_003f: Unknown result type (might be due to invalid IL or missing references) if (portalTraversals.Length != 0) { PortalTraversalV2 val = portalTraversals[^1]; lastForward = hitPos - val.exitPoint; Vector3 value = lastForward.Value; lastForward = ((Vector3)(ref value)).normalized; } } private void Shoot() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_0018: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_0049: 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_0063: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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_0142: 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_0123: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: 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_01b2: 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_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: 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_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_0178: 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) //IL_015d: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: 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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_029d: 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_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_0270: 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_0276: 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_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; Vector3 forward = ((Component)this).transform.forward; float value = PortalGun.range.Value; LayerMask val = LayerMaskDefaults.Get((LMD)1); PhysicsCastResult val2 = default(PhysicsCastResult); PortalTraversalV2[] array = default(PortalTraversalV2[]); Vector3 val3 = default(Vector3); bool flag = PortalPhysicsV2.Raycast(position, forward, value, LayerMask.op_Implicit(val), ref val2, ref array, ref val3, (QueryTriggerInteraction)0); bool flag2 = false; Vector3 val4 = position; Vector3 val5 = forward; float num = 0f; for (int i = 0; i < array.Length; i++) { PortalTraversalV2 val6 = array[i]; Vector3 entrancePoint = val6.entrancePoint; num += Vector3.Distance(val4, entrancePoint); PortalHandle portalHandle = val6.portalHandle; if (!EnumExtensions.HasAllFlags<PortalTravellerFlags>(val6.portalObject.GetTravelFlags(portalHandle.side), (PortalTravellerFlags)4)) { shotHitPoint = entrancePoint; Array.Resize(ref array, i); flag2 = true; break; } val4 = val6.exitPoint; val5 = val6.exitDirection; } if (flag2) { flag = false; value = num - 0.01f; lastForward = ((Vector3)(ref val5)).normalized; } else if (flag) { value = val2.distance; shotHitPoint = val2.point; UpdateForward(array, val2); } else { Vector3 val7 = position; Vector3 val8 = forward; if (array.Length != 0) { PortalTraversalV2 val9 = array[^1]; val7 = val9.exitPoint; val8 = val9.exitDirection; } shotHitPoint = val7 + val8 * value; } Vector3 val10 = position; bool flag3 = false; Matrix4x4 val11 = PortalUtils.GetTravelMatrix(array); val11 = ((Matrix4x4)(ref val11)).inverse; Vector3 val12 = ((Matrix4x4)(ref val11)).MultiplyPoint3x4(shotHitPoint); Vector3 val13 = val12 - val10; if (alternateStartPoint != Vector3.zero) { PhysicsCastResult val14 = default(PhysicsCastResult); Vector3 val15 = default(Vector3); PortalTraversalV2[] array2 = default(PortalTraversalV2[]); PortalPhysicsV2.ProjectThroughPortals(((Component)this).transform.position, alternateStartPoint - ((Component)this).transform.position, LayerMask.op_Implicit(default(LayerMask)), ref val14, ref val15, ref array2); if (array2.Length != 0) { PortalTraversalV2 val16 = array2[0]; PortalHandle portalHandle2 = val16.portalHandle; if (!EnumExtensions.HasAllFlags<PortalTravellerFlags>(val16.portalObject.GetTravelFlags(portalHandle2.side), (PortalTravellerFlags)4)) { flag3 = true; } else if (PortalTraversalExtensions.AllHasFlag(array2, (PortalTravellerFlags)4)) { val10 = val15; val11 = PortalUtils.GetTravelMatrix(array2); val13 = ((Matrix4x4)(ref val11)).MultiplyPoint3x4(val12) - val10; } else { val10 = alternateStartPoint; val13 = val12 - val10; } } else { val10 = alternateStartPoint; val13 = val12 - val10; } } else { val13 = val12 - val10; } if (!flag3) { PhysicsCastResult val17 = default(PhysicsCastResult); PortalTraversalV2[] array3 = default(PortalTraversalV2[]); PortalPhysicsV2.Raycast(val10, ((Vector3)(ref val13)).normalized, ((Vector3)(ref val13)).magnitude - 0.01f, LayerMask.op_Implicit(default(LayerMask)), ref val17, ref array3, ref val3, (QueryTriggerInteraction)0); lr.SetPosition(0, val10); lr.SetPosition(1, shotHitPoint); if (array3 != null && array3.Length != 0) { PortalUtils.GenerateLineRendererSegments((MonoBehaviour)(object)this, lr, array3); } } } } public class PortalCollisionFixer : MonoBehaviour { [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class DontBeGroundedInPortales { public static bool Prefix(ref bool __result) { if (isInPortal) { __result = false; return false; } return true; } } [CompilerGenerated] private sealed class <WaitToReenable>d__37 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PortalCollisionFixer <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <WaitToReenable>d__37(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(<>4__this.reenableDelay); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.ApplyCollision(ignore: false); <>4__this.reenableRoutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private List<GameObject> targetWalls = new List<GameObject>(); private List<Collider> wallColliders = new List<Collider>(); public GameObject placedOnWall; private List<int> wallLayers = new List<int>(); private Collider playerCollider; public float ghostRadius = 2.5f; public float reenableDelay = 0.005f; public PortalCollisionFixer partner; private bool selfGhosting = false; private bool partnerForced = false; private Coroutine reenableRoutine; private List<Collider> ghostedPhysicsColliders = new List<Collider>(); private const float VisHalfWidth = 1.35f; private const float VisHalfTop = 1f; private const float VisHalfBottom = 1.7f; private const float LineWidthRect = 0.07f; private const float LineWidthDepth = 0.04f; private LineRenderer lrRect; private LineRenderer lrDepthBox; private static readonly Color ColIdle = new Color(0.2f, 0.8f, 1f, 0.6f); private static readonly Color ColGhost = new Color(0.1f, 1f, 0.3f, 0.9f); private static readonly Color ColFloor = new Color(1f, 0.7f, 0.1f, 0.8f); public static bool isInPortal; public bool isGhosting => selfGhosting || partnerForced; public bool isOnFloor => Vector3.Dot(((Component)this).transform.forward, Vector3.up) < -0.9f; private float ForwardDepth => isOnFloor ? 999f : ghostRadius; public void FixCols() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_002a: 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_0036: 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_0043: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.lo