Decompiled source of BananaWeapons v2.0.0
NewBananaWeapons.dll
Decompiled 2 weeks 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 UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; 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+a3e31276a8ad2988e5a358887818dd3b776efd6f")] [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, ConfigFile Config) { } } public class BenjaminLaserWeapon : MonoBehaviour { public GameObject chargingLaser; public GameObject laser; private Animator anim; 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, 125f, true, 0f, (GameObject)null, false, false); list.Add(val2.eid); } } } } public class CharlesWeapon : MonoBehaviour { public GameObject helicopter; 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 : MonoBehaviour { 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; 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 : MonoBehaviour { private Animator anim; 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__22 : 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__22(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 ConfigEntry<float> spinDuration; private static ConfigEntry<float> minSpinSpeed; private static ConfigEntry<float> maxSpinSpeed; private static ConfigEntry<int> jackpotPoints; private static ConfigEntry<float> kitrDamage; private static ConfigEntry<int> filthEnemyDamage; private static ConfigEntry<int> coinEnemyDamage; private static ConfigEntry<bool> riggedModeConfig; public GameObject sevenChargeParticle; public override void SetupConfigs(string sectionName, ConfigFile Config) { spinDuration = Config.Bind<float>(sectionName, "Spin Duration", 0.5f, "How long the slot machine spins for (in seconds)"); minSpinSpeed = Config.Bind<float>(sectionName, "Min Spin Speed", 1f, "Minimum speed multiplier for slot spinning"); maxSpinSpeed = Config.Bind<float>(sectionName, "Max Spin Speed", 3f, "Maximum speed multiplier for slot spinning"); jackpotPoints = Config.Bind<int>(sectionName, "Jackpot Style Points", 500, "Style points awarded for getting a jackpot"); kitrDamage = Config.Bind<float>(sectionName, "Loss Damage", 0.5f, "Damage multiplier for loss result"); filthEnemyDamage = Config.Bind<int>(sectionName, "Filth Damage", 15, "Direct enemy damage for Filth result"); coinEnemyDamage = Config.Bind<int>(sectionName, "Coin Damage", 75, "Direct enemy damage for Coin result"); riggedModeConfig = Config.Bind<bool>(sectionName, "Rigged Mode Enabled", 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__22))] private IEnumerator Spin() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Spin>d__22(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 : MonoBehaviour { 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; 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__21 : 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__21(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 ConfigEntry<float> slowMotionMultiplier; private static ConfigEntry<int> capitalizationPoints; private static ConfigEntry<int> punctuationPoints; private static ConfigEntry<int> fullSentencePoints; private static ConfigEntry<int> multiSentencePointsPerSentence; private static ConfigEntry<float> wordFireDelay; private static ConfigEntry<float> varietyBonusMultiplier; private static ConfigEntry<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 void SetupConfigs(string sectionName, ConfigFile Config) { slowMotionMultiplier = Config.Bind<float>(sectionName, "Slow Motion Multiplier", 0.25f, "Time scale when typing (0.25 = 25% speed)"); capitalizationPoints = Config.Bind<int>(sectionName, "Capitalization Points", 100, "Style points for capitalizing first letter"); punctuationPoints = Config.Bind<int>(sectionName, "Punctuation Points", 200, "Style points for proper punctuation"); fullSentencePoints = Config.Bind<int>(sectionName, "Full Sentence Points", 300, "Bonus points for both capitalization and punctuation"); multiSentencePointsPerSentence = Config.Bind<int>(sectionName, "Multi Sentence Points", 150, "Points per sentence when typing multiple sentences"); wordFireDelay = Config.Bind<float>(sectionName, "Word Fire Delay", 0.1f, "Delay between firing each word (in seconds)"); varietyBonusMultiplier = Config.Bind<float>(sectionName, "Variety Bonus Multiplier", 0.5f, "Multiplier for word variety bonus"); sentenceMultiplierScale = Config.Bind<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() { //IL_0029: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) ((Behaviour)MonoSingleton<NewMovement>.Instance).enabled = false; ((Behaviour)MonoSingleton<GunControl>.Instance).enabled = false; MonoSingleton<PlayerUtilities>.Instance.NoFist(); MonoSingleton<NewMovement>.Instance.movementDirection = Vector3.zero; MonoSingleton<NewMovement>.Instance.movementDirection2 = Vector3.zero; 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__21))] private IEnumerator fireProjectile(string[] words) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <fireProjectile>d__21(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 ConfigEntry<float> chargeTime; private static ConfigEntry<float> laserRadius; private static ConfigEntry<float> laserRange; private static ConfigEntry<float> damage; private static ConfigEntry<float> damageTickRate; public override void SetupConfigs(string sectionName, ConfigFile Config) { chargeTime = Config.Bind<float>(sectionName, "Charge Time", 1f, "Time required to charge the laser before it fires (in seconds)"); laserRadius = Config.Bind<float>(sectionName, "Laser Radius", 3f, "Radius of the laser beam spherecast"); laserRange = Config.Bind<float>(sectionName, "Laser Range", 80f, "Maximum range of the laser beam"); damage = Config.Bind<float>(sectionName, "Damage Per Tick", 0.5f, "Damage dealt per damage tick"); damageTickRate = Config.Bind<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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: 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_0137: 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_0150: 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); RaycastHit val = default(RaycastHit); if (Physics.SphereCast(cam.GetDefaultPos(), laserRadius.Value, ((Component)cam).transform.forward, ref val, laserRange.Value, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)3)))) { EnemyIdentifierIdentifier val2 = default(EnemyIdentifierIdentifier); if (((Component)((RaycastHit)(ref val)).collider).TryGetComponent<EnemyIdentifierIdentifier>(ref val2) && damageDelay <= 0f) { val2.eid.hitter = "beam"; val2.eid.SimpleDamage(damage.Value); damageDelay = damageTickRate.Value; } line.positionCount = 2; line.SetPosition(0, cam.GetDefaultPos() + Vector3.down); line.SetPosition(1, ((RaycastHit)(ref 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 ConfigEntry<float> cfgMaxChargeTime; private static ConfigEntry<float> cfgMinDamageMultiplier; private static ConfigEntry<float> cfgMaxDamageMultiplier; private static ConfigEntry<float> cfgBaseDamage; private static ConfigEntry<float> cfgVelocityDamagePerMPS; private static ConfigEntry<float> cfgChargedPunchVelocity; private static ConfigEntry<float> cfgPunchForce; private static ConfigEntry<float> cfgHitRadius; private static ConfigEntry<float> cfgHitDistance; private static ConfigEntry<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, ConfigFile config) { cfgMaxChargeTime = config.Bind<float>(sectionName, "Max Charge Time", 2.5f, (ConfigDescription)null); cfgMinDamageMultiplier = config.Bind<float>(sectionName, "Min Damage Multiplier", 6f, (ConfigDescription)null); cfgMaxDamageMultiplier = config.Bind<float>(sectionName, "Max Damage Multiplier", 27f, (ConfigDescription)null); cfgBaseDamage = config.Bind<float>(sectionName, "Base Damage", 1.5f, (ConfigDescription)null); cfgVelocityDamagePerMPS = config.Bind<float>(sectionName, "Velocity Damage Per MPS", 0.15f, (ConfigDescription)null); cfgChargedPunchVelocity = config.Bind<float>(sectionName, "Charged Punch Velocity", 180f, (ConfigDescription)null); cfgPunchForce = config.Bind<float>(sectionName, "Punch Force", 10000f, (ConfigDescription)null); cfgHitRadius = config.Bind<float>(sectionName, "Hit Radius", 5f, (ConfigDescription)null); cfgHitDistance = config.Bind<float>(sectionName, "Hit Distance", 1f, (ConfigDescription)null); cfgPunchDuration = config.Bind<float>(sectionName, "Punch Duration", 0.2f, (ConfigDescription)null); ApplyConfigValues(); } 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); 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 ConfigEntry<float> petCooldown; private static ConfigEntry<int> petsForEnrage; public override void SetupConfigs(string sectionName, ConfigFile Config) { petCooldown = Config.Bind<float>(sectionName, "Pet Cooldown", 1.35f, "Cooldown between petting Maxwell (in seconds)"); petsForEnrage = Config.Bind<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 ConfigEntry<float> slapRange; private static ConfigEntry<float> slapDamage; private static ConfigEntry<float> slapForce; public override void SetupConfigs(string sectionName, ConfigFile Config) { slapRange = Config.Bind<float>(sectionName, "Slap Range", 35f, "Range of the metal pipe slap attack"); slapDamage = Config.Bind<float>(sectionName, "Slap Damage", 3f, "Damage dealt by charged slap attack"); slapForce = Config.Bind<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 : MonoBehaviour { [CompilerGenerated] private sealed class <FadeMaterial>d__13 : 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__13(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 float bulletDamage = 10f; public Transform firePoint; private AudioSource missippiQueen; private Animator anim; private bool doingSequence = false; 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; 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__13))] private IEnumerator FadeMaterial(float from, float to) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FadeMaterial>d__13(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_008f: 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_009b: 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); } 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); } } 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 NukeWeapon : MonoBehaviour { public GameObject explosion; private void Update() { ((Component)this).GetComponent<Animator>().SetBool("Kaboom", false); if (MonoSingleton<InputManager>.Instance.InputSource.Fire1.WasPerformedThisFrame) { ((Component)this).GetComponent<Animator>().SetBool("Kaboom", true); } } public void Explode() { //IL_000c: 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) GameObject val = Object.Instantiate<GameObject>(AddressableManager.explosion, ((Component)this).transform.position, Quaternion.identity); Explosion[] componentsInChildren = val.GetComponentsInChildren<Explosion>(); foreach (Explosion val2 in componentsInChildren) { val2.maxSize *= 1000f; val2.damage *= 100000; val2.speed *= 25f; } } } public class OarWeapon : BaseWeapon { [SerializeField] private AudioClip swingOne; [SerializeField] private AudioClip swingTwo; private AudioSource source; private bool damageActive = false; private Animator anim; private float charge = 0f; private float cooldown = 0f; private EnemyIdentifier targetedEID; private GameObject lightningBoltWindUp = null; private List<EnemyIdentifier> hitEnemies = new List<EnemyIdentifier>(); private static ConfigEntry<float> attackRadius; private static ConfigEntry<float> forceEnemy; private static ConfigEntry<float> forcePlayer; private static ConfigEntry<float> damage; private static ConfigEntry<float> maxCharge; private static ConfigEntry<float> lightningDamageMultiplier; private static ConfigEntry<float> cooldownMultiplier; public override void SetupConfigs(string sectionName, ConfigFile Config) { attackRadius = Config.Bind<float>(sectionName, "Attack Radius", 3.5f, "Radius of the oar swing attack"); forceEnemy = Config.Bind<float>(sectionName, "Enemy Knockback Force", 5000f, "Knockback force applied to enemies"); forcePlayer = Config.Bind<float>(sectionName, "Player Launch Force", 72f, "Forward launch force applied to player on swing"); damage = Config.Bind<float>(sectionName, "Swing Damage", 2.5f, "Damage dealt by oar swing"); maxCharge = Config.Bind<float>(sectionName, "Max Lightning Charge Time", 8.5f, "Time to fully charge lightning strike (in seconds)"); lightningDamageMultiplier = Config.Bind<float>(sectionName, "Lightning Damage Multiplier", 1.5f, "Damage multiplier for lightning strike based on charge"); cooldownMultiplier = Config.Bind<float>(sectionName, "Lightning Cooldown Multiplier", 3f, "Cooldown after lightning strike = charge ratio * this value"); } private void Awake() { anim = ((Component)this).GetComponent<Animator>(); source = ((Component)this).GetComponent<AudioSource>(); } public void AttackForward() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) MonoSingleton<NewMovement>.Instance.Launch(((Component)MonoSingleton<CameraController>.Instance).transform.forward, forcePlayer.Value, true); } private void Update() { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: 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_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) if (!MonoSingleton<GunControl>.Instance.activated) { return; } anim.SetBool("Holding", MonoSingleton<InputManager>.Instance.InputSource.Fire1.IsPressed); if (cooldown <= 0f) { anim.SetBool("Rightclick", MonoSingleton<InputManager>.Instance.InputSource.Fire2.IsPressed); } if (damageActive) { Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, attackRadius.Value); if (array.Length != 0) { Collider[] array2 = array; EnemyIdentifierIdentifier val2 = default(EnemyIdentifierIdentifier); foreach (Collider val in array2) { if (((Component)val).gameObject.TryGetComponent<EnemyIdentifierIdentifier>(ref val2) && !hitEnemies.Contains(val2.eid)) { val2.eid.hitter = "oar"; val2.eid.DeliverDamage(((Component)val).gameObject, ((Component)MonoSingleton<CameraController>.Instance).transform.forward * forceEnemy.Value * 20f, ((Component)val2).transform.position, damage.Value, false, 0f, (GameObject)null, false, false); hitEnemies.Add(val2.eid); } } } } if (cooldown > 0f) { cooldown -= Time.deltaTime; } if (MonoSingleton<InputManager>.Instance.InputSource.Fire2.WasPerformedThisFrame && cooldown <= 0f) { if ((Object)(object)targetedEID == (Object)null) { List<EnemyIdentifier> currentEnemies = MonoSingleton<EnemyTracker>.Instance.GetCurrentEnemies(); targetedEID = currentEnemies[Random.Range(0, currentEnemies.Count)]; } } else if (MonoSingleton<InputManager>.Instance.InputSource.Fire2.WasCanceledThisFrame && (Object)(object)lightningBoltWindUp != (Object)null && (Object)(object)targetedEID != (Object)null) { StopCharge(); } if (!((Object)(object)targetedEID != (Object)null)) { return; } if (targetedEID.dead) { targetedEID = null; Object.Destroy((Object)(object)lightningBoltWindUp); charge = 0f; return; } charge += Time.deltaTime; if (charge >= maxCharge.Value) { charge = maxCharge.Value; anim.SetBool("Rightclick", false); StopCharge(); return; } if ((Object)(object)lightningBoltWindUp == (Object)null) { lightningBoltWindUp = Object.Instantiate<GameObject>(AddressableManager.lightningBoltWindup, ((Component)targetedEID).transform.position, Quaternion.identity); } Follow[] components = lightningBoltWindUp.GetComponents<Follow>(); for (int j = 0; j < components.Length; j++) { components[j].target = ((Component)targetedEID).transform; } } private void StopCharge() { //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) GameObject val = Object.Instantiate<GameObject>(AddressableManager.lightningBolt, lightningBoltWindUp.transform.position, Quaternion.identity); val.GetComponent<LightningStrikeExplosive>().damageMultiplier = charge * lightningDamageMultiplier.Value / maxCharge.Value; Object.Destroy((Object)(object)lightningBoltWindUp); targetedEID = null; cooldown = charge / maxCharge.Value * cooldownMultiplier.Value; charge = 0f; } public void activateDamage() { damageActive = true; hitEnemies.Clear(); } public void deactivateDamage() { damageActive = false; } public void PlaySwing1Audio() { source.PlayOneShot(swingOne); } public void PlaySwing2Audio() { source.PlayOneShot(swingTwo); } private void OnEnable() { deactivateDamage(); } } public class PotassiumWeapon : MonoBehaviour { public GameObject carPrefab; public GameObject bananaPrefab; private List<Transform> wayPoints = new List<Transform>(); private LineRenderer line; private float curveThreshold = 8f; private int curveSubdivisions = 5; private float curveStrength = 4f; private void Awake() { ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(carPrefab)); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(bananaPrefab)); } 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_0068: 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_00df: 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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: 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, 100f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1)))) { CreateWaypoint(((RaycastHit)(ref val)).point); } if (MonoSingleton<InputManager>.Instance.InputSource.Fire2.WasPerformedThisFrame && wayPoints.Count != 0) { GameObject val2 = Object.Instantiate<GameObject>(carPrefab); val2.transform.position = wayPoints[0].position; Transform transform2 = val2.transform; transform2.position -= new Vector3(0f, 0f, 35f); DeltaruneTextBox.Instance.TextboxText("Kris, get the bananas", val2.transform); CarPathFollower component = val2.GetComponent<CarPathFollower>(); Transform transform3 = ((Component)component).transform; transform3.localScale *= 2f; component.SetPath(wayPoints); wayPoints = new List<Transform>(); } } } private void CreateWaypoint(Vector3 pos) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(bananaPrefab); val.transform.position = pos; wayPoints.Add(val.transform); } private void UpdateLine() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)line == (Object)null) { CreateLine(); } if (wayPoints.Count == 0) { line.positionCount = 0; return; } line.positionCount = wayPoints.Count; for (int i = 0; i < wayPoints.Count; i++) { line.SetPosition(i, wayPoints[i].position); } } private void CreateLine() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown GameObject val = new GameObject("Pathway"); line = val.AddComponent<LineRenderer>(); } } public class Bomb : MonoBehaviour { public AudioClip tickSound; public GameObject explosion; private float timeBeforeExplosion = 3f; private float timeBeforeNextColorSwitch; private AudioSource source; private Material bombMat; private void Start() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((Renderer)((Component)this).GetComponentInChildren<MeshRenderer>()).material = new Material(((Renderer)((Component)this).GetComponentInChildren<MeshRenderer>()).material); bombMat = ((Renderer)((Component)this).GetComponentInChildren<MeshRenderer>()).material; timeBeforeNextColorSwitch = timeBeforeExplosion / 4f; source = ((Component)this).GetComponent<AudioSource>(); ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(explosion)); Explosion[] componentsInChildren = explosion.GetComponentsInChildren<Explosion>(); foreach (Explosion val in componentsInChildren) { ((MonoBehaviour)this).StartCoroutine(ShaderManager.ApplyShaderToGameObject(val.explosionChunk)); } } private void Update() { //IL_006a: 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) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) timeBeforeExplosion -= Time.deltaTime; timeBeforeNextColorSwitch -= Time.deltaTime; if (timeBeforeNextColorSwitch <= 0f) { source.PlayOneShot(tickSound); timeBeforeNextColorSwitch = timeBeforeExplosion / 4f; bombMat.color = ((bombMat.color == Color.black) ? Color.red : Color.black); } if (timeBeforeExplosion <= 0f) { Object.Instantiate<GameObject>(explosion, ((Component)this).transform.position, Quaternion.identity); Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class CarPathFollower : MonoBehaviour { [CompilerGenerated] private sealed class <KillEnemy>d__12 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public EnemyIdentifier eid; public CarPathFollower <>4__this; private GameObject <knocked>5__1; private Rigidbody <rb>5__2; private Component[] <>s__3; private int <>s__4; private Component <comp>5__5; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <KillEnemy>d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <knocked>5__1 = null; <rb>5__2 = null; <>s__3 = null; <comp>5__5 = null; <>1__state = -2; } private bool MoveNext() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Expected O, but got Unknown //IL_0163: 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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <knocked>5__1 = Object.Instantiate<GameObject>(((Component)eid).gameObject, ((Component)eid).transform.position, ((Component)eid).transform.rotation); <knocked>5__1.SetActive(false); <>s__3 = <knocked>5__1.GetComponentsInChildren<Component>(true); for (<>s__4 = 0; <>s__4 < <>s__3.Length; <>s__4++) { <comp>5__5 = <>s__3[<>s__4]; if (!(<comp>5__5 is Transform) && !(<comp>5__5 is Renderer)) { Object.DestroyImmediate((Object)(object)<comp>5__5); <comp>5__5 = null; } } <>s__3 = null; <rb>5__2 = <knocked>5__1.AddComponent<Rigidbody>(); <knocked>5__1.transform.Rotate(0f, 0f, 180f); <knocked>5__1.SetActive(true); <>2__current = (object)new WaitForFixedUpdate(); <>1__state = 1; return true; case 1: <>1__state = -1; <rb>5__2.isKinematic = false; <rb>5__2.AddForce(Vector3.up * 50f, (ForceMode)2); eid.InstaKill(); Object.Destroy((Object)(object)((Component)eid).gameObject); if ((Object)(object)<>4__this.source != (Object)null) { <>4__this.source.PlayOneShot(<>4__this.enemyHit); } 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<Transform> wayPoints; private int currentWaypointTarget; private bool active; public float moveSpeed = 25f; public AudioClip enemyHit; private AudioSource source; private void Awake() { source = ((Component)((Component)this).transform.Find("CarYelp")).GetComponent<AudioSource>(); } public void SetPath(List<Transform> newPath) { wayPoints = newPath; currentWaypointTarget = 0; active = true; } private void Update() { if (active && wayPoints != null && wayPoints.Count != 0) { UpdateCarPosition(); CheckForEnemies(); } } private void UpdateCarPosition() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_006c: 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) Vector3 position = wayPoints[currentWaypointTarget].position; Vector3 val = position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; ((Component)this).transform.forward = normalized; Transform transform = ((Component)this).transform; transform.position += normalized * moveSpeed * Time.deltaTime; if (Vector3.Distance(position, ((Component)this).transform.position) <= 0.5f) { currentWaypointTarget++; if ((Object)(object)DeltaruneTextBox.Instance != (Object)null) { DeltaruneTextBox.Instance.TextboxText("Potassium", ((Component)this).transform); } if (currentWaypointTarget >= wayPoints.Count) { CleanupPath(); Object.Destroy((Object)(object)((Component)this).gameObject); } } } private void CleanupPath() { foreach (Transform wayPoint in wayPoints) { if ((Object)(object)wayPoint != (Object)null) { Object.Destroy((Object)(object)((Component)wayPoint).gameObject); } } } private void CheckForEnemies() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 5f); Collider[] array2 = array; EnemyIdentifierIdentifier val2 = default(EnemyIdentifierIdentifier); foreach (Collider val in array2) { if (((Component)val).TryGetComponent<EnemyIdentifierIdentifier>(ref val2)) { ((MonoBehaviour)this).StartCoroutine(KillEnemy(val2.eid)); } } } [IteratorStateMachine(typeof(<KillEnemy>d__12))] private IEnumerator KillEnemy(EnemyIdentifier eid) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <KillEnemy>d__12(0) { <>4__this = this, eid = eid }; } } public class CarProjectile : MonoBehaviour { [HideInInspector] public Transform target; [HideInInspector] public float timeBeforeHittingDavid = 3.5f; [HideInInspector] public GameObject sourceWeapon = null; private List<EnemyIdentifier> alreadyHitEnemies = new List<EnemyIdentifier>(); private Vector3 direction; private float speed; private float timer; private float timeBeforeDeletion = 10f; private void Start() { //IL_002f: 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_003b: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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) if ((Object)(object)target == (Object)null) { Debug.LogError((object)"CarProjectile has no target!"); ((Behaviour)this).enabled = false; return; } Vector3 position = ((Component)this).transform.position; Vector3 position2 = target.position; Vector3 val = position2 - position; float magnitude = ((Vector3)(ref val)).magnitude; direction = ((Vector3)(ref val)).normalized; speed = magnitude / timeBeforeHittingDavid; ((Component)this).transform.rotation = Quaternion.LookRotation(direction) * Quaternion.Euler(0f, 90f, 0f); } private void Update() { //IL_001a: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missin