Decompiled source of sonicgun v1.3.4
SonicGun.dll
Decompiled a week 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.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using REPOLib.Modules; using SonicGun; using UnityEngine; using UnityEngine.Events; using UnityEngine.Serialization; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("slenered")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.3.3.0")] [assembly: AssemblyInformationalVersion("1.3.3+839ef4fa808e9a26125a5aca37e205ec06c2d13c")] [assembly: AssemblyProduct("SonicGun")] [assembly: AssemblyTitle("SonicGun")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.3.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class ItemGunSonicBullet : MonoBehaviour { [CompilerGenerated] private sealed class <BulletDestroy>d__21 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ItemGunSonicBullet <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <BulletDestroy>d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 1; return true; case 1: <>1__state = -1; break; case 2: <>1__state = -1; break; } if (<>4__this.particleSparks.isPlaying || <>4__this.particleSmoke.isPlaying || <>4__this.particleImpact.isPlaying || ((Behaviour)<>4__this.hitLight).enabled || ((Renderer)<>4__this.shootLine).enabled || (<>4__this.hasHurtCollider && Object.op_Implicit((Object)(object)<>4__this.sonicCollider) && ((Component)<>4__this.sonicCollider).gameObject.activeSelf) || (!<>4__this.hasHurtCollider && Object.op_Implicit((Object)(object)<>4__this.hitGameObject) && <>4__this.hitGameObject.activeSelf)) { <>2__current = null; <>1__state = 2; return true; } Object.Destroy((Object)(object)((Component)<>4__this).gameObject); 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 Transform hitEffectTransform; private ParticleSystem particleSparks; private ParticleSystem particleSmoke; private ParticleSystem particleImpact; private Light hitLight; private LineRenderer shootLine; public bool hasHurtCollider = false; public SonicCollider sonicCollider; public float investigateRadius = 15f; internal bool bulletHit; internal Vector3 hitPosition; internal bool hypersonic; public float hurtColliderTimer = 0.25f; private bool shootLineActive; private float shootLineLerp; internal AnimationCurve shootLineWidthCurve; public GameObject hitGameObject; public float hitGameObjectDestroyTime = 2f; public bool hasExtraParticles; public GameObject extraParticles; public void ActivateAll() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_00fd: 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: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: 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_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) ((Component)this).gameObject.SetActive(true); hitEffectTransform = ((Component)this).transform.Find("Hit Effect"); particleSparks = ((Component)hitEffectTransform.Find("Particle Sparks")).GetComponent<ParticleSystem>(); particleSmoke = ((Component)hitEffectTransform.Find("Particle Smoke")).GetComponent<ParticleSystem>(); particleImpact = ((Component)hitEffectTransform.Find("Particle Impact")).GetComponent<ParticleSystem>(); hitLight = ((Component)hitEffectTransform.Find("Hit Light")).GetComponent<Light>(); shootLine = ((Component)this).GetComponentInChildren<LineRenderer>(); Vector3 position = ((Component)this).transform.position; Vector3 val = hitPosition - position; ((Renderer)shootLine).enabled = true; shootLine.SetPosition(0, ((Component)this).transform.position); shootLine.SetPosition(1, ((Component)this).transform.position + ((Vector3)(ref val)).normalized * 0.5f); shootLine.SetPosition(2, hitPosition - ((Vector3)(ref val)).normalized * 0.5f); shootLine.SetPosition(3, hitPosition); shootLineActive = true; shootLineLerp = 0f; if (bulletHit) { ((Component)hitEffectTransform).gameObject.SetActive(true); ((Component)particleSparks).gameObject.SetActive(true); ((Component)particleSmoke).gameObject.SetActive(true); ((Component)particleImpact).gameObject.SetActive(true); ((Behaviour)hitLight).enabled = true; GameObject gameObject = hitGameObject; if (hasHurtCollider) { gameObject = ((Component)sonicCollider).gameObject; } gameObject.gameObject.SetActive(true); gameObject.GetComponent<ItemSoundwave>().hypersonic = hypersonic; Quaternion rotation = Quaternion.LookRotation(val); gameObject.transform.rotation = rotation; gameObject.transform.position = hitPosition; hitEffectTransform.position = hitPosition; hitEffectTransform.rotation = rotation; if (hasExtraParticles) { extraParticles.SetActive(true); extraParticles.transform.position = hitPosition; extraParticles.transform.rotation = rotation; } if (investigateRadius > 0f) { EnemyDirector.instance.SetInvestigate(gameObject.transform.position, hypersonic ? (investigateRadius * 10f) : investigateRadius, false); Collider[] array = Physics.OverlapSphere(gameObject.transform.position, hypersonic ? (investigateRadius * 10f) : investigateRadius, LayerMask.GetMask(new string[1] { "PhysGrabObject" }), (QueryTriggerInteraction)1); Collider[] array2 = array; foreach (Collider val2 in array2) { if (!Object.op_Implicit((Object)(object)val2.attachedRigidbody) || val2.isTrigger) { continue; } EnemyRigidbody component = ((Component)val2.attachedRigidbody).GetComponent<EnemyRigidbody>(); if (Object.op_Implicit((Object)(object)component)) { EnemyGnome component2 = ((Component)component.enemy).GetComponent<EnemyGnome>(); if (Object.op_Implicit((Object)(object)component2)) { component2.OnDeath(); } } } } } ((MonoBehaviour)this).StartCoroutine(BulletDestroy()); } [IteratorStateMachine(typeof(<BulletDestroy>d__21))] private IEnumerator BulletDestroy() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <BulletDestroy>d__21(0) { <>4__this = this }; } private void LineRendererLogic() { if (shootLineActive) { shootLine.widthMultiplier = shootLineWidthCurve.Evaluate(shootLineLerp); shootLineLerp += Time.deltaTime * 5f; if (shootLineLerp >= 1f) { ((Renderer)shootLine).enabled = false; ((Component)shootLine).gameObject.SetActive(false); shootLineActive = false; } } } private void Update() { LineRendererLogic(); if (!bulletHit) { return; } if (hasHurtCollider) { if (hurtColliderTimer > 0f) { hurtColliderTimer -= Time.deltaTime; if (Object.op_Implicit((Object)(object)sonicCollider)) { ((Component)sonicCollider).gameObject.SetActive(true); } } else if (Object.op_Implicit((Object)(object)sonicCollider)) { ((Component)sonicCollider).gameObject.SetActive(false); } } else { hitGameObjectDestroyTime -= Time.deltaTime; if (hitGameObjectDestroyTime <= 0f && Object.op_Implicit((Object)(object)hitGameObject)) { hitGameObject.SetActive(false); } } if (Object.op_Implicit((Object)(object)hitLight)) { hitLight.intensity = Mathf.Lerp(hitLight.intensity, 0f, Time.deltaTime * 10f); if (hitLight.intensity < 0.01f) { ((Behaviour)hitLight).enabled = false; } } } } public class ItemSonicGun : MonoBehaviour { public enum State { Idle, OutOfAmmo, Buildup, Shooting, Reloading } private PhysGrabObject physGrabObject; internal Color ChargeColor = new Color(118f, 118f, 118f, 1f); private bool itemHold; private bool itemHeld; private int charge; public int MaxCharges = 3; private int Charges; public Sound ChargeSound; public Sound OverChargeSound; private bool Overheated; private float stateRecharge = 0f; public float RechargeTime = 1f; private float RechargeTimeFlash; public bool hasOneShot = true; public float shootTime = 1f; public bool hasBuildUp; public float buildUpTime = 1f; private float stateCharge; public float ChargeUpTime = 0.75f; public float FinalChargeUpTime = 0.5f; private float FifthFinalChargeTime; public int FinalCharge = 3; public int numberOfBullets = 1; [Range(0f, 65f)] public float gunRandomSpread; public float gunRange = 50f; public float distanceKeep = 0.8f; public float gunRecoilForce = 1f; public float cameraShakeMultiplier = 1f; public float torqueMultiplier = 1f; public float grabStrengthMultiplier = 1f; public float shootCooldown = 1f; public float batteryDrain = 0.1f; public bool batteryDrainFullBar; public int batteryDrainFullBars = 1; [Range(0f, 100f)] public float misfirePercentageChange = 50f; public AnimationCurve shootLineWidthCurve; public float grabVerticalOffset = -0.2f; public float aimVerticalOffset = -5f; public float investigateRadius = 20f; private float investigateCooldown; public Transform gunMuzzle; public GameObject bulletPrefab; public GameObject muzzleFlashPrefab; public Transform gunTrigger; public RawImage ChargeBorder; public RawImage ChargeBar1; public RawImage ChargeBar2; public RawImage ChargeBar3; internal SonicCollider SonicCollider; public Sound soundShoot; public Sound soundShootGlobal; public Sound soundNoAmmoClick; public Sound soundHit; private ItemBattery itemBattery; private PhotonView photonView; private PhysGrabObjectImpactDetector impactDetector; private AnimationCurve triggerAnimationCurve; private float triggerAnimationEval; private bool triggerAnimationActive; public UnityEvent onStateIdleStart; public UnityEvent onStateIdleUpdate; public UnityEvent onStateIdleFixedUpdate; [Space(20f)] public UnityEvent onStateOutOfAmmoStart; public UnityEvent onStateOutOfAmmoUpdate; public UnityEvent onStateOutOfAmmoFixedUpdate; [Space(20f)] public UnityEvent onStateBuildupStart; public UnityEvent onStateBuildupUpdate; public UnityEvent onStateBuildupFixedUpdate; [Space(20f)] public UnityEvent onStateShootingStart; public UnityEvent onStateShootingUpdate; public UnityEvent onStateShootingFixedUpdate; [Space(20f)] public UnityEvent onStateReloadingStart; public UnityEvent onStateReloadingUpdate; public UnityEvent onStateReloadingFixedUpdate; private bool hasIdleUpdate = true; private bool hasIdleFixedUpdate = true; private bool hasOutOfAmmoUpdate = true; private bool hasOutOfAmmoFixedUpdate = true; private bool hasBuildupUpdate = true; private bool hasBuildupFixedUpdate = true; private bool hasShootingUpdate = true; private bool hasShootingFixedUpdate = true; private bool hasReloadingUpdate = true; private bool hasReloadingFixedUpdate = true; private RoomVolumeCheck roomVolumeCheck; internal float stateTimer; internal float stateTimeMax; internal State stateCurrent; private State statePrev; private bool stateStart; private ItemEquippable itemEquippable; private void Start() { FifthFinalChargeTime = FinalChargeUpTime / 5f; RechargeTimeFlash = RechargeTime / 6f; Charges = MaxCharges; roomVolumeCheck = ((Component)this).GetComponent<RoomVolumeCheck>(); itemEquippable = ((Component)this).GetComponent<ItemEquippable>(); physGrabObject = ((Component)this).GetComponent<PhysGrabObject>(); itemBattery = ((Component)this).GetComponent<ItemBattery>(); photonView = ((Component)this).GetComponent<PhotonView>(); impactDetector = ((Component)this).GetComponent<PhysGrabObjectImpactDetector>(); triggerAnimationCurve = AssetManager.instance.animationCurveClickInOut; if (onStateIdleUpdate == null) { hasIdleUpdate = false; } if (onStateIdleFixedUpdate == null) { hasIdleFixedUpdate = false; } if (onStateOutOfAmmoUpdate == null) { hasOutOfAmmoUpdate = false; } if (onStateOutOfAmmoFixedUpdate == null) { hasOutOfAmmoFixedUpdate = false; } if (onStateBuildupUpdate == null) { hasBuildupUpdate = false; } if (onStateBuildupFixedUpdate == null) { hasBuildupFixedUpdate = false; } if (onStateShootingUpdate == null) { hasShootingUpdate = false; } if (onStateShootingFixedUpdate == null) { hasShootingFixedUpdate = false; } if (onStateReloadingUpdate == null) { hasReloadingUpdate = false; } if (onStateReloadingFixedUpdate == null) { hasReloadingFixedUpdate = false; } } private void FixedUpdate() { StateMachine(_fixedUpdate: true); } private void Update() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0180: 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_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) StateMachine(_fixedUpdate: false); if (physGrabObject.grabbed && physGrabObject.grabbedLocal) { PhysGrabber.instance.OverrideGrabDistance(distanceKeep); } if (triggerAnimationActive) { float num = 45f; triggerAnimationEval += Time.deltaTime * 4f; gunTrigger.localRotation = Quaternion.Euler(num * triggerAnimationCurve.Evaluate(triggerAnimationEval), 0f, 0f); if (triggerAnimationEval >= 1f) { gunTrigger.localRotation = Quaternion.Euler(0f, 0f, 0f); triggerAnimationActive = false; triggerAnimationEval = 1f; } } ((Behaviour)ChargeBar1).enabled = Charges >= MaxCharges; ((Behaviour)ChargeBar2).enabled = Charges >= MaxCharges - 1; ((Behaviour)ChargeBar3).enabled = Charges >= MaxCharges - 2; ((Graphic)ChargeBar1).color = ((charge >= 1) ? Color.red : ChargeColor); ((Graphic)ChargeBar2).color = ((charge >= 2 - (MaxCharges - Charges)) ? Color.red : ChargeColor); ((Graphic)ChargeBar3).color = ((charge >= 3 - (MaxCharges - Charges)) ? Color.red : ChargeColor); if (itemHeld && charge == FinalCharge) { bool flag = FifthFinalChargeTime > stateCharge % (FifthFinalChargeTime * 2f); ((Graphic)ChargeBorder).color = (flag ? Color.red : Color.white); if (flag) { EnemyDirector.instance.SetInvestigate(((Component)this).transform.position, 5f, false); } } else { ((Graphic)ChargeBorder).color = (Overheated ? Color.black : Color.white); } if (Charges < MaxCharges || Overheated) { stateCharge += Time.deltaTime; RestoreCharges(stateCharge); } UpdateMaster(); } private void UpdateMaster() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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) if (!SemiFunc.IsMasterClientOrSingleplayer() || physGrabObject.playerGrabbing.Count <= 0) { return; } Quaternion val = Quaternion.Euler(aimVerticalOffset, 0f, 0f); Quaternion val2 = Quaternion.Euler(0f, 0f, 0f); Quaternion identity = Quaternion.identity; bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = true; foreach (PhysGrabber item in physGrabObject.playerGrabbing) { if (flag4) { if (item.playerAvatar.isCrouching) { flag2 = true; } if (item.playerAvatar.isCrawling) { flag3 = true; } flag4 = false; } if (item.isRotating) { flag = true; } } if (!flag) { physGrabObject.TurnXYZ(val, val2, identity); } float num = grabVerticalOffset; if (flag2) { num += 0.5f; } if (flag3) { num -= 0.5f; } physGrabObject.OverrideGrabVerticalPosition(num); if (!flag) { if (stateCurrent == State.OutOfAmmo) { physGrabObject.OverrideTorqueStrength(0.01f, 0.1f); physGrabObject.OverrideExtraTorqueStrengthDisable(0.1f); physGrabObject.OverrideExtraGrabStrengthDisable(0.1f); } else if (physGrabObject.grabbed) { physGrabObject.OverrideTorqueStrength(12f, 0.1f); physGrabObject.OverrideAngularDrag(20f, 0.1f); } } else { physGrabObject.OverrideTorqueStrength(2f, 0.1f); physGrabObject.OverrideAngularDrag(20f, 0.1f); } } public void Misfire() { if (!roomVolumeCheck.inTruck && !physGrabObject.grabbed && !physGrabObject.hasNeverBeenGrabbed && SemiFunc.IsMasterClientOrSingleplayer() && (float)Random.Range(0, 100) < misfirePercentageChange) { Shoot(); } } public void Shoot() { //IL_0034: 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) if (hasOneShot) { if (SemiFunc.IsMultiplayer()) { photonView.RPC("SonicShootRPC", (RpcTarget)0, Array.Empty<object>()); } else { SonicShootRPC(); } StateSet(State.Reloading); } else if (hasBuildUp) { StateSet(State.Buildup); } else { StateSet(State.Shooting); } } private void MuzzleFlash() { //IL_000d: 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) Object.Instantiate<GameObject>(muzzleFlashPrefab, gunMuzzle.position, gunMuzzle.rotation, gunMuzzle).GetComponent<ItemGunMuzzleFlash>().ActivateAllEffects(); } private void StartTriggerAnimation() { triggerAnimationActive = true; triggerAnimationEval = 0f; } [PunRPC] public void SonicShootRPC(PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: 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) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: 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_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.MasterOnlyRPC(_info)) { return; } bool flag = charge > FinalCharge && itemBattery.batteryLifeInt > 0; stateCharge = 0f; if (flag) { Charges = 0; charge = 0; } else { Charges = Math.Max(0, Charges - 1); charge = Math.Max(0, charge - 1); } float num = 3f * cameraShakeMultiplier; float num2 = 16f * cameraShakeMultiplier; SemiFunc.CameraShakeImpactDistance(gunMuzzle.position, 5f * cameraShakeMultiplier, 0.1f, num, num2); SemiFunc.CameraShakeDistance(gunMuzzle.position, 0.1f * cameraShakeMultiplier, 0.1f * cameraShakeMultiplier, num, num2); soundShoot.Play(gunMuzzle.position, 1f, 1f, 1f, 1f); soundShootGlobal.Play(gunMuzzle.position, 1f, 1f, 1f, 1f); MuzzleFlash(); StartTriggerAnimation(); if (SemiFunc.IsMasterClientOrSingleplayer()) { if (investigateRadius > 0f) { EnemyDirector.instance.SetInvestigate(((Component)this).transform.position, investigateRadius, false); } physGrabObject.rb.AddForceAtPosition(-gunMuzzle.forward * gunRecoilForce, gunMuzzle.position, (ForceMode)1); itemHold = false; itemHeld = false; if (flag) { itemBattery.RemoveFullBar(1); } Vector3 endPosition = gunMuzzle.position; bool hit = false; bool flag2 = false; Vector3 val = gunMuzzle.forward; if (gunRandomSpread > 0f) { float num3 = Random.Range(0f, gunRandomSpread / 2f); float num4 = Random.Range(0f, 360f); Vector3 val2 = Vector3.Cross(val, Random.onUnitSphere); Vector3 normalized = ((Vector3)(ref val2)).normalized; Quaternion val3 = Quaternion.AngleAxis(num3, normalized); val2 = Quaternion.AngleAxis(num4, val) * val3 * val; val = ((Vector3)(ref val2)).normalized; } RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(gunMuzzle.position, val, ref val4, gunRange, LayerMask.op_Implicit(SemiFunc.LayerMaskGetVisionObstruct()) + LayerMask.GetMask(new string[1] { "Enemy" }))) { endPosition = ((RaycastHit)(ref val4)).point; hit = true; } else { flag2 = true; } if (flag2) { endPosition = gunMuzzle.position + gunMuzzle.forward * gunRange; hit = true; } ShootBullet(endPosition, hit, flag); } } private void ShootBullet(Vector3 _endPosition, bool _hit, bool hypersonic) { //IL_004d: 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_0058: 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) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (SemiFunc.IsMultiplayer()) { photonView.RPC("SonicShootBulletRPC", (RpcTarget)0, new object[3] { _endPosition, _hit, hypersonic }); } else { SonicShootBulletRPC(_endPosition, _hit, hypersonic); } } } [PunRPC] public void SonicShootBulletRPC(Vector3 _endPosition, bool _hit, bool hypersonic, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { if (physGrabObject.playerGrabbing.Count > 1) { PlayerAvatar.instance.physGrabber.OverrideGrabRelease(photonView.ViewID, 0.5f); } ItemGunSonicBullet component = Object.Instantiate<GameObject>(bulletPrefab, gunMuzzle.position, gunMuzzle.rotation).GetComponent<ItemGunSonicBullet>(); component.hitPosition = _endPosition; component.bulletHit = _hit; component.hypersonic = hypersonic; SonicCollider = ((Component)component).GetComponentInChildren<SonicCollider>(); soundHit.Play(_endPosition, 1f, 1f, 1f, 1f); component.shootLineWidthCurve = shootLineWidthCurve; component.ActivateAll(); } } private void StateSet(State _state) { //IL_004f: 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) if (_state == stateCurrent) { return; } if (SemiFunc.IsMultiplayer()) { if (SemiFunc.IsMasterClient()) { photonView.RPC("SonicStateSetRPC", (RpcTarget)0, new object[1] { (int)_state }); } } else { SonicStateSetRPC((int)_state); } } private void ShootLogic() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: 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) //IL_027b: Unknown result type (might be due to invalid IL or missing references) if (physGrabObject.heldByLocalPlayer) { bool flag = SemiFunc.InputHold((InputKey)2); if (SemiFunc.IsMultiplayer()) { photonView.RPC("InputHoldRPC", (RpcTarget)0, new object[1] { flag }); } else { InputHoldRPC(flag); } } else if (physGrabObject.playerGrabbing.Count == 0) { itemHeld = false; itemHold = false; } if (Overheated || Charges <= 0) { itemHeld = itemHold; return; } if (SemiFunc.IsMasterClientOrSingleplayer()) { if (itemHold != itemHeld) { if (!itemHold && itemHeld) { ChargeSound.PlayLoop(false, 1f, 1f, 1f); ChargeSound.Source.volume = 0f; Shoot(); } } else if (itemHold) { float num = ChargeUpTime * (float)FinalCharge + FinalChargeUpTime; float num2 = (ChargeUpTime * (float)charge + stateCharge) / num; stateCharge += Time.deltaTime; ChargeSound.PlayLoop(true, 1f, 1f, 1f); ChargeSound.Source.volume = num2 * 2f; if (SemiFunc.IsMultiplayer()) { photonView.RPC("SonicStateRPC", (RpcTarget)0, new object[1] { stateCharge }); } else { SonicStateRPC(stateCharge); } if (stateCharge >= ChargeUpTime && charge < FinalCharge && Charges > charge) { stateCharge -= ChargeUpTime; Changecharge(1); if (charge >= FinalCharge) { OverChargeSound.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } } else if (stateCharge >= FinalChargeUpTime && charge == FinalCharge) { stateCharge = 0f; Changecharge(1); } else if (charge > FinalCharge) { ChargeSound.PlayLoop(false, 1f, 1f, 1f); ChargeSound.Source.volume = 0f; Shoot(); stateCharge = 0f; SetOverheat(c: true); } } } itemHeld = itemHold; } [PunRPC] private void InputHoldRPC(bool inputHold, PhotonMessageInfo _info = default(PhotonMessageInfo)) { itemHold = inputHold; } [PunRPC] private void SonicStateRPC(float stateCh, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_003c: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_006c: Unknown result type (might be due to invalid IL or missing references) stateCharge = stateCh; float num = ChargeUpTime * (float)FinalCharge + FinalChargeUpTime; float num2 = (ChargeUpTime * (float)charge + stateCh) / num; physGrabObject.rb.AddForceAtPosition(Random.insideUnitSphere * (num2 * 0.25f), physGrabObject.rb.position + Random.insideUnitSphere * 0.05f, (ForceMode)1); } private void Changecharge(int c) { //IL_0034: 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) if (SemiFunc.IsMultiplayer()) { photonView.RPC("ChangechargeRPC", (RpcTarget)0, new object[1] { c }); } else { ChangechargeRPC(c); } } [PunRPC] private void ChangechargeRPC(int c, PhotonMessageInfo _info = default(PhotonMessageInfo)) { charge = Math.Max(0, charge + c); } private void ChangeCharges(int c) { //IL_0034: 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) if (SemiFunc.IsMultiplayer()) { photonView.RPC("ChangeChargesRPC", (RpcTarget)0, new object[1] { c }); } else { ChangeChargesRPC(c); } } [PunRPC] private void ChangeChargesRPC(int c, PhotonMessageInfo _info = default(PhotonMessageInfo)) { Charges = Math.Max(0, Charges + c); } private void RestoreCharges(float c) { //IL_0034: 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) if (SemiFunc.IsMultiplayer()) { photonView.RPC("RestoreChargesRPC", (RpcTarget)0, new object[1] { c }); } else { RestoreChargesRPC(c); } } [PunRPC] private void RestoreChargesRPC(float c, PhotonMessageInfo _info = default(PhotonMessageInfo)) { if (stateCharge >= RechargeTime && Charges < MaxCharges) { stateCharge -= RechargeTime; Charges++; } else if (Overheated && Charges >= MaxCharges && stateCharge >= RechargeTime * 2f) { stateCharge = 0f; Overheated = false; } } private void SetOverheat(bool c) { //IL_0034: 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) if (SemiFunc.IsMultiplayer()) { photonView.RPC("SetOverheatRPC", (RpcTarget)0, new object[1] { c }); } else { SetOverheatRPC(c); } } [PunRPC] private void SetOverheatRPC(bool c, PhotonMessageInfo _info = default(PhotonMessageInfo)) { Overheated = c; } [PunRPC] private void SonicStateSetRPC(int state, PhotonMessageInfo _info = default(PhotonMessageInfo)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info)) { stateStart = true; statePrev = stateCurrent; stateCurrent = (State)state; } } private void StateMachine(bool _fixedUpdate) { switch (stateCurrent) { case State.Idle: StateIdle(_fixedUpdate); break; case State.OutOfAmmo: StateOutOfAmmo(_fixedUpdate); break; case State.Buildup: StateBuildup(_fixedUpdate); break; case State.Shooting: StateShooting(_fixedUpdate); break; case State.Reloading: StateReloading(_fixedUpdate); break; } } private void StateIdle(bool _fixedUpdate) { if (stateStart && !_fixedUpdate) { if (onStateIdleStart != null) { onStateIdleStart.Invoke(); } stateStart = false; } if (!_fixedUpdate) { ShootLogic(); if (hasIdleUpdate) { onStateIdleUpdate.Invoke(); } } if (_fixedUpdate && hasIdleFixedUpdate) { onStateIdleFixedUpdate.Invoke(); } } private void StateOutOfAmmo(bool _fixedUpdate) { if (stateStart && !_fixedUpdate) { if (onStateOutOfAmmoStart != null) { onStateOutOfAmmoStart.Invoke(); } stateStart = false; } if (!_fixedUpdate) { if (itemBattery.batteryLifeInt > 0) { StateSet(State.Idle); return; } ShootLogic(); if (hasOutOfAmmoUpdate) { onStateOutOfAmmoUpdate.Invoke(); } } if (_fixedUpdate && hasOutOfAmmoFixedUpdate) { onStateOutOfAmmoFixedUpdate.Invoke(); } } private void StateBuildup(bool _fixedUpdate) { if (stateStart && !_fixedUpdate) { if (onStateBuildupStart != null) { onStateBuildupStart.Invoke(); } stateTimer = 0f; stateTimeMax = buildUpTime; stateStart = false; } if (!_fixedUpdate) { if (hasBuildupUpdate) { onStateBuildupUpdate.Invoke(); } stateTimer += Time.deltaTime; if (Object.op_Implicit((Object)(object)itemEquippable) && itemEquippable.isEquipped) { StateSet(State.Idle); } if (stateTimer >= stateTimeMax && itemBattery.batteryLifeInt > 0) { StateSet(State.Shooting); } } if (_fixedUpdate && hasBuildupFixedUpdate) { onStateBuildupFixedUpdate.Invoke(); } } private void StateShooting(bool _fixedUpdate) { //IL_00e4: 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) if (stateStart && !_fixedUpdate) { stateStart = false; if (onStateShootingStart != null) { onStateShootingStart.Invoke(); } if (!hasOneShot) { stateTimeMax = shootTime; stateTimer = stateTimeMax; investigateCooldown = 0f; } else { stateTimer = 0.001f; } } if (_fixedUpdate) { return; } stateTimer += Time.deltaTime; if (stateTimer >= stateTimeMax) { stateTimer = 0f; if (SemiFunc.IsMultiplayer()) { photonView.RPC("SonicShootRPC", (RpcTarget)0, Array.Empty<object>()); } else { SonicShootRPC(); } if (charge <= 0) { StateSet(State.Reloading); } } } private void StateReloading(bool _fixedUpdate) { if (stateStart && !_fixedUpdate) { stateStart = false; if (onStateReloadingStart != null) { onStateReloadingStart.Invoke(); } stateTimeMax = shootCooldown; stateTimer = 0f; } if (!_fixedUpdate) { stateTimer += Time.deltaTime; if (stateTimer >= stateTimeMax) { StateSet(State.Idle); } if (hasReloadingUpdate) { onStateReloadingUpdate.Invoke(); } } if (_fixedUpdate && hasReloadingFixedUpdate) { onStateReloadingFixedUpdate.Invoke(); } } } public class ItemSoundwave : MonoBehaviour { public MeshRenderer meshRenderer; private float startScale = 1f; private bool finalScale; internal bool hypersonic = false; public ParticleSystem particleSystemWave; public ParticleSystem particleSystemSparks; public ParticleSystem particleSystemLightning; private SonicCollider _sonicCollider; [FormerlySerializedAs("soundExplosion")] public Sound soundSonic; public Sound soundHypersonic; public Sound soundExplosionGlobal; public AudioClip tinnitusSound; private void Start() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) EarSound.TinnitusSound = tinnitusSound; startScale = (hypersonic ? (((Component)this).transform.localScale.x * 6f) : ((Component)this).transform.localScale.x); _sonicCollider = ((Component)this).GetComponentInChildren<SonicCollider>(); ((Component)_sonicCollider).gameObject.SetActive(hypersonic); ((Renderer)meshRenderer).material.color = Color.white; ((Component)this).transform.localScale = Vector3.zero; if (!hypersonic) { soundSonic.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } else { soundHypersonic.Play(((Component)this).transform.position, 0.75f, 1f, 1f, 1f); soundExplosionGlobal.Play(((Component)this).transform.position, 1f, 1f, 1f, 1f); } particleSystemSparks.Play(); particleSystemLightning.Play(); GameDirector.instance.CameraShake.ShakeDistance(8f, 3f, 8f, ((Component)this).transform.position, 0.1f); GameDirector.instance.CameraImpact.ShakeDistance(20f, 3f, 8f, ((Component)this).transform.position, 0.1f); } private void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_0050: 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_005f: 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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_0155: 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_0090: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.Rotate(Vector3.up, 100f * Time.deltaTime); if (((Component)this).transform.localScale.x < startScale) { Transform transform = ((Component)this).transform; transform.localScale += Vector3.one * Time.deltaTime * 20f; return; } if (!finalScale) { ((Component)this).transform.localScale = Vector3.one * startScale; if (hypersonic) { ((Component)_sonicCollider).gameObject.SetActive(false); } finalScale = true; return; } float num = Mathf.Lerp(((Component)this).transform.localScale.x, startScale * 1.2f, Time.deltaTime * 2f); ((Component)this).transform.localScale = Vector3.one * num; float num2 = Mathf.InverseLerp(startScale, startScale * 1.2f, num); Color color = ((Renderer)meshRenderer).material.color; color.a = Mathf.Lerp(1f, 0f, num2); ((Renderer)meshRenderer).material.color = color; if (num2 > 0.998f) { if (Object.op_Implicit((Object)(object)particleSystemSparks)) { ((Component)particleSystemSparks).transform.parent = null; } Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class SonicCollider : MonoBehaviour { public enum BreakImpact { None, Light, Medium, Heavy } public enum TorqueAxis { up, down, left, right, forward, back } public enum HitType { Player, PhysObject, Enemy } public class Hit { public HitType hitType; public GameObject hitObject; public float cooldown; } [CompilerGenerated] private sealed class <ColliderCheck>d__72 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SonicCollider <>4__this; private Collider[] <array>5__1; private Vector3 <center>5__2; private Vector3 <vector>5__3; private Vector3 <center2>5__4; private float <radius>5__5; private Collider[] <array2>5__6; private Collider[] <>s__7; private int <>s__8; private Collider <collider>5__9; private PlayerAvatar <playerAvatar>5__10; private PlayerController <componentInParent>5__11; private PhysGrabObject <componentInParent2>5__12; private bool <flag>5__13; private PlayerTumble <componentInParent3>5__14; private EnemyRigidbody <enemyRigidbody>5__15; private bool <flag2>5__16; private PhysGrabObjectImpactDetector <componentInParent4>5__17; private PhysGrabHinge <component>5__18; private PhysGrabHinge <component2>5__19; private PhysGrabHinge <component3>5__20; private Enemy <componentInParent5>5__21; private EnemyParent <componentInParent6>5__22; private EnemyRigidbody <componentInChildren>5__23; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ColliderCheck>d__72(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <array>5__1 = null; <array2>5__6 = null; <>s__7 = null; <collider>5__9 = null; <playerAvatar>5__10 = null; <componentInParent>5__11 = null; <componentInParent2>5__12 = null; <componentInParent3>5__14 = null; <enemyRigidbody>5__15 = null; <componentInParent4>5__17 = null; <component>5__18 = null; <component2>5__19 = null; <component3>5__20 = null; <componentInParent5>5__21 = null; <componentInParent6>5__22 = null; <componentInChildren>5__23 = null; <>1__state = -2; } private bool MoveNext() { //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: 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_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_09b3: Unknown result type (might be due to invalid IL or missing references) //IL_09bd: Expected O, but got Unknown //IL_087f: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; goto IL_006f; case 2: <>1__state = -1; goto IL_006f; case 3: { <>1__state = -1; <array>5__1 = null; break; } IL_006f: if (!Object.op_Implicit((Object)(object)LevelGenerator.Instance) || !LevelGenerator.Instance.Generated) { <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; } break; } if (<>4__this.ColliderIsBox) { <center>5__2 = ((Component)<>4__this).transform.TransformPoint(<>4__this.BoxCollider.center); <vector>5__3 = new Vector3(((Component)<>4__this).transform.lossyScale.x * <>4__this.BoxCollider.size.x, ((Component)<>4__this).transform.lossyScale.y * <>4__this.BoxCollider.size.y, ((Component)<>4__this).transform.lossyScale.z * <>4__this.BoxCollider.size.z); <array>5__1 = Physics.OverlapBox(<center>5__2, <vector>5__3 * 0.5f, ((Component)<>4__this).transform.rotation, LayerMask.op_Implicit(<>4__this.LayerMask), (QueryTriggerInteraction)2); } else { Bounds bounds = <>4__this.Collider.bounds; <center2>5__4 = ((Bounds)(ref bounds)).center; <radius>5__5 = ((Component)<>4__this).transform.lossyScale.x * <>4__this.SphereCollider.radius; <array>5__1 = Physics.OverlapSphere(<center2>5__4, <radius>5__5, LayerMask.op_Implicit(<>4__this.LayerMask), (QueryTriggerInteraction)2); } if (<array>5__1.Length != 0) { <array2>5__6 = <array>5__1; <>s__7 = <array2>5__6; for (<>s__8 = 0; <>s__8 < <>s__7.Length; <>s__8++) { <collider>5__9 = <>s__7[<>s__8]; if (<>4__this.playerLogic && <>4__this.playerDamageCooldown > 0f && ((Component)<collider>5__9).gameObject.CompareTag("Player")) { <playerAvatar>5__10 = ((Component)<collider>5__9).gameObject.GetComponentInParent<PlayerAvatar>(); if (!Object.op_Implicit((Object)(object)<playerAvatar>5__10)) { <componentInParent>5__11 = ((Component)<collider>5__9).gameObject.GetComponentInParent<PlayerController>(); if (Object.op_Implicit((Object)(object)<componentInParent>5__11)) { <playerAvatar>5__10 = <componentInParent>5__11.playerAvatarScript; } <componentInParent>5__11 = null; } if (Object.op_Implicit((Object)(object)<playerAvatar>5__10)) { <>4__this.PlayerHurt(<playerAvatar>5__10); } <playerAvatar>5__10 = null; } if (!(<>4__this.enemyDamageCooldown > 0f) && !(<>4__this.physDamageCooldown > 0f) && !(<>4__this.playerDamageCooldown > 0f)) { continue; } if (((Component)<collider>5__9).gameObject.CompareTag("Phys Grab Object")) { <componentInParent2>5__12 = ((Component)<collider>5__9).gameObject.GetComponentInParent<PhysGrabObject>(); if (<>4__this.ignoreObjects.Contains(<componentInParent2>5__12) || !Object.op_Implicit((Object)(object)<componentInParent2>5__12) || (<componentInParent2>5__12.impactDetector.isCart && ((Object)((Component)((Component)<collider>5__9).transform.parent).gameObject).name != "Phys Object Collider")) { continue; } <flag>5__13 = false; <componentInParent3>5__14 = ((Component)<collider>5__9).gameObject.GetComponentInParent<PlayerTumble>(); if (Object.op_Implicit((Object)(object)<componentInParent3>5__14)) { <flag>5__13 = true; } if ((<>4__this.playerLogic && <>4__this.playerDamageCooldown > 0f) & <flag>5__13) { <>4__this.PlayerHurt(<componentInParent3>5__14.playerAvatar); } if (!SemiFunc.IsMasterClientOrSingleplayer()) { continue; } <enemyRigidbody>5__15 = null; if (<>4__this.enemyLogic && !<flag>5__13) { <enemyRigidbody>5__15 = ((Component)<collider>5__9).gameObject.GetComponentInParent<EnemyRigidbody>(); <>4__this.EnemyHurtRigidbody(<enemyRigidbody>5__15, <componentInParent2>5__12); } if (((!<>4__this.physLogic || Object.op_Implicit((Object)(object)<enemyRigidbody>5__15)) | <flag>5__13) || !(<>4__this.physDamageCooldown > 0f) || !<>4__this.CanHit(((Component)<componentInParent2>5__12).gameObject, <>4__this.physDamageCooldown, <>4__this.physRayCast, <componentInParent2>5__12.centerPoint, HitType.PhysObject)) { continue; } <flag2>5__16 = false; <componentInParent4>5__17 = ((Component)<collider>5__9).gameObject.GetComponentInParent<PhysGrabObjectImpactDetector>(); if (Object.op_Implicit((Object)(object)<componentInParent4>5__17)) { if (<>4__this.physHingeDestroy) { <component>5__18 = ((Component)<componentInParent2>5__12).GetComponent<PhysGrabHinge>(); if (Object.op_Implicit((Object)(object)<component>5__18)) { <component>5__18.DestroyHinge(); <flag2>5__16 = true; } <component>5__18 = null; } else if (<>4__this.physHingeBreak) { <component2>5__19 = ((Component)<componentInParent2>5__12).GetComponent<PhysGrabHinge>(); if (Object.op_Implicit((Object)(object)<component2>5__19) && Object.op_Implicit((Object)(object)<component2>5__19.joint)) { ((Joint)<component2>5__19.joint).breakForce = 0f; ((Joint)<component2>5__19.joint).breakTorque = 0f; <flag2>5__16 = true; } <component2>5__19 = null; } if (!<flag2>5__16) { if (<>4__this.physDestroy) { if (!<componentInParent4>5__17.destroyDisable) { <component3>5__20 = ((Component)<componentInParent2>5__12).GetComponent<PhysGrabHinge>(); if (Object.op_Implicit((Object)(object)<component3>5__20)) { <component3>5__20.DestroyHinge(); } else { <componentInParent4>5__17.DestroyObject(true); } <component3>5__20 = null; } else { <>4__this.PhysObjectHurt(<componentInParent2>5__12, BreakImpact.Heavy, 50f, 30f, apply: true, destroyLaunch: true); } <flag2>5__16 = true; } else if (Object.op_Implicit((Object)(object)<componentInParent2>5__12) && <>4__this.PhysObjectHurt(<componentInParent2>5__12, <>4__this.physImpact, <>4__this.physHitForce, <>4__this.physHitTorque, apply: true, destroyLaunch: false)) { <flag2>5__16 = true; } } } if (<flag2>5__16) { <>4__this.onImpactAny.Invoke(); <>4__this.onImpactPhysObject.Invoke(); } <componentInParent2>5__12 = null; <componentInParent3>5__14 = null; <enemyRigidbody>5__15 = null; <componentInParent4>5__17 = null; } else { if (!SemiFunc.IsMasterClientOrSingleplayer() || !<>4__this.enemyLogic) { continue; } <componentInParent5>5__21 = ((Component)<collider>5__9).gameObject.GetComponentInParent<Enemy>(); if (Object.op_Implicit((Object)(object)<componentInParent5>5__21) && !<componentInParent5>5__21.HasRigidbody && <>4__this.CanHit(((Component)<componentInParent5>5__21).gameObject, <>4__this.enemyDamageCooldown, <>4__this.enemyRayCast, ((Component)<componentInParent5>5__21).transform.position, HitType.Enemy) && <>4__this.EnemyHurt(<componentInParent5>5__21)) { <>4__this.onImpactAny.Invoke(); <>4__this.onImpactEnemyEnemy = <componentInParent5>5__21; <>4__this.onImpactEnemy.Invoke(); } if (!<>4__this.enemyHitTriggers) { continue; } <componentInParent6>5__22 = ((Component)<collider>5__9).gameObject.GetComponentInParent<EnemyParent>(); if (Object.op_Implicit((Object)(object)<componentInParent6>5__22)) { <componentInChildren>5__23 = ((Component)<componentInParent6>5__22).GetComponentInChildren<EnemyRigidbody>(); if (Object.op_Implicit((Object)(object)<componentInChildren>5__23)) { <>4__this.EnemyHurtRigidbody(<componentInChildren>5__23, <componentInChildren>5__23.physGrabObject); } <componentInChildren>5__23 = null; } <componentInParent5>5__21 = null; <componentInParent6>5__22 = null; } <collider>5__9 = null; } <>s__7 = null; <array2>5__6 = null; } <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 3; 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(); } } [CompilerGenerated] private sealed class <CooldownLogic>d__70 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SonicCollider <>4__this; private int <i>5__1; private Hit <hit>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CooldownLogic>d__70(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <hit>5__2 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (<>4__this.hits.Count > 0) { <i>5__1 = 0; while (<i>5__1 < <>4__this.hits.Count) { <hit>5__2 = <>4__this.hits[<i>5__1]; <hit>5__2.cooldown -= Time.deltaTime; if (<hit>5__2.cooldown <= 0f) { <>4__this.hits.RemoveAt(<i>5__1); <i>5__1--; } <hit>5__2 = null; <i>5__1++; } <>2__current = null; <>1__state = 1; return true; } <>4__this.cooldownLogicRunning = false; 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 bool playerLogic = true; [Space] private bool playerKill = false; private int playerDamage = 0; private float playerDamageCooldown = 0.25f; public float playerHitForce; public bool playerRayCast; public float playerTumbleForce; public float playerTumbleTorque; public TorqueAxis playerTumbleTorqueAxis = TorqueAxis.down; public float playerTumbleTime; public float playerTumbleImpactHurtTime; public int playerTumbleImpactHurtDamage; public bool physLogic = true; [Space] private bool physDestroy = false; private bool physHingeDestroy = false; private bool physHingeBreak = false; private BreakImpact physImpact = BreakImpact.None; private float physDamageCooldown = 0.25f; public float physHitForce; public float physHitTorque; public bool physRayCast; public bool enemyLogic = true; public Enemy enemyHost; [Space] [FormerlySerializedAs("enemyDespawn")] private bool enemyKill = false; public bool enemyStun = true; public float enemyStunTime = 2f; public EnemyType enemyStunType = (EnemyType)2; public float enemyFreezeTime = 0.1f; [Space] public BreakImpact enemyImpact = BreakImpact.Medium; private int enemyDamage = 0; private float enemyDamageCooldown = 0.25f; public float enemyHitForce; public float enemyHitTorque; public bool enemyRayCast; public bool enemyHitTriggers = true; public bool deathPit; [Range(0f, 180f)] public float hitSpread = 180f; public List<PhysGrabObject> ignoreObjects = new List<PhysGrabObject>(); internal bool ignoreLocalPlayer; public bool hasTimer; public float timer = 0.2f; public bool destroyOnTimerEnd; public bool hasCustomRaycastPosition; public Vector3 customRaycastPosition; private float timerOriginal; public UnityEvent onImpactAny; public UnityEvent onImpactPlayer; internal PlayerAvatar onImpactPlayerAvatar; public UnityEvent onImpactPhysObject; public UnityEvent onImpactEnemy; internal Enemy onImpactEnemyEnemy; private Collider Collider; private BoxCollider BoxCollider; private SphereCollider SphereCollider; private bool ColliderIsBox = true; private LayerMask LayerMask; private LayerMask RayMask; internal List<Hit> hits = new List<Hit>(); private bool colliderCheckRunning; private bool cooldownLogicRunning; private Vector3 applyForce; private Vector3 applyTorque; private void Awake() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) BoxCollider = ((Component)this).GetComponent<BoxCollider>(); if (!Object.op_Implicit((Object)(object)BoxCollider)) { SphereCollider = ((Component)this).GetComponent<SphereCollider>(); Collider = (Collider)(object)SphereCollider; ColliderIsBox = false; } else { Collider = (Collider)(object)BoxCollider; } Collider.isTrigger = true; timerOriginal = timer; LayerMask = LayerMask.op_Implicit(LayerMask.op_Implicit(SemiFunc.LayerMaskGetPhysGrabObject()) + LayerMask.GetMask(new string[1] { "Player" }) + LayerMask.GetMask(new string[1] { "Default" }) + LayerMask.GetMask(new string[1] { "Enemy" })); RayMask = LayerMask.op_Implicit(LayerMask.GetMask(new string[2] { "Default", "PhysGrabObjectHinge" })); } private void OnEnable() { if (!colliderCheckRunning) { colliderCheckRunning = true; ((MonoBehaviour)this).StartCoroutine(ColliderCheck()); } } private void OnDisable() { ((MonoBehaviour)this).StopAllCoroutines(); colliderCheckRunning = false; cooldownLogicRunning = false; hits.Clear(); } private void HasTimerLogic() { if (!hasTimer) { return; } if (timer <= 0f) { if (destroyOnTimerEnd) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { ((Component)this).gameObject.SetActive(false); timer = timerOriginal; } } if (timer > 0f) { timer -= Time.deltaTime; } } [IteratorStateMachine(typeof(<CooldownLogic>d__70))] private IEnumerator CooldownLogic() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CooldownLogic>d__70(0) { <>4__this = this }; } private bool CanHit(GameObject hitObject, float cooldown, bool raycast, Vector3 hitPosition, HitType hitType) { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_0124: Unknown result type (might be due to invalid IL or missing references) foreach (Hit hit2 in hits) { if ((Object)(object)hit2.hitObject == (Object)(object)hitObject) { return false; } } Hit hit = new Hit(); hit.hitObject = hitObject; hit.cooldown = cooldown; hit.hitType = hitType; hits.Add(hit); if (!cooldownLogicRunning) { ((MonoBehaviour)this).StartCoroutine(CooldownLogic()); cooldownLogicRunning = true; } if (raycast) { Bounds bounds = Collider.bounds; Vector3 val = ((Bounds)(ref bounds)).center; if (hasCustomRaycastPosition) { val = ((Component)this).transform.TransformPoint(customRaycastPosition); } Vector3 val2 = hitPosition - val; Vector3 normalized = ((Vector3)(ref val2)).normalized; float num = Vector3.Distance(hitPosition, val); RaycastHit[] array = Physics.RaycastAll(val, normalized, num, LayerMask.op_Implicit(RayMask), (QueryTriggerInteraction)2); for (int i = 0; i < array.Length; i++) { RaycastHit val3 = array[i]; if (((Component)((RaycastHit)(ref val3)).collider).gameObject.CompareTag("Wall")) { PhysGrabObject componentInParent = hitObject.GetComponentInParent<PhysGrabObject>(); PhysGrabObject componentInParent2 = ((Component)((RaycastHit)(ref val3)).collider).gameObject.GetComponentInParent<PhysGrabObject>(); if (!Object.op_Implicit((Object)(object)componentInParent) || (Object)(object)componentInParent != (Object)(object)componentInParent2) { return false; } } } } return true; } [IteratorStateMachine(typeof(<ColliderCheck>d__72))] private IEnumerator ColliderCheck() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ColliderCheck>d__72(0) { <>4__this = this }; } private void EnemyHurtRigidbody(EnemyRigidbody _enemyRigidbody, PhysGrabObject _physGrabObject) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (enemyDamageCooldown > 0f && Object.op_Implicit((Object)(object)_enemyRigidbody) && CanHit(((Component)_physGrabObject).gameObject, enemyDamageCooldown, enemyRayCast, _physGrabObject.centerPoint, HitType.Enemy) && EnemyHurt(_enemyRigidbody.enemy)) { onImpactAny.Invoke(); onImpactEnemyEnemy = _enemyRigidbody.enemy; onImpactEnemy.Invoke(); } } private bool EnemyHurt(Enemy _enemy) { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_enemy == (Object)(object)enemyHost) { return false; } if (!enemyLogic) { return false; } if (_enemy.HasStateInvestigate) { _enemy.StateInvestigate.rangeMultiplier = 0f; NewValues orCreate = ValueStorage.GetOrCreate((MonoBehaviour)(object)_enemy); if (_enemy.EnemyParent.enemyName == "Huntsman") { orCreate.InvestigateRangeMultiplier /= 4f; } else { orCreate.InvestigateRangeMultiplier /= 2f; } } if (enemyStun && _enemy.HasStateStunned && _enemy.Type <= enemyStunType) { _enemy.StateStunned.Set(enemyStunTime); } if (enemyFreezeTime > 0f) { _enemy.Freeze(enemyFreezeTime); } if (_enemy.HasRigidbody) { bool apply = !(enemyFreezeTime > 0f); PhysObjectHurt(_enemy.Rigidbody.physGrabObject, enemyImpact, enemyHitForce, enemyHitTorque, apply, destroyLaunch: false); if (enemyFreezeTime > 0f) { _enemy.Rigidbody.FreezeForces(applyForce, applyTorque); } } return true; } private void Update() { HasTimerLogic(); } private void tinnitus(PlayerAvatar _player) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer()) { MonoBehaviour.print((object)"Multiplayer"); global::SonicGun.SonicGun.TinnitusEvent.RaiseEvent((object)_player.photonView.ViewID, NetworkingEvents.RaiseAll, SendOptions.SendReliable); } else { MonoBehaviour.print((object)"singleplayer"); ((ConfigEntryBase)global::SonicGun.SonicGun.EnableTinnitus).ConfigFile.Reload(); ValueStorage.tinnitusVolume = 1f; } } private void PlayerHurt(PlayerAvatar _player) { //IL_00bc: 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_00fc: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) if (ignoreLocalPlayer && _player.isLocal) { ignoreLocalPlayer = false; } else { if (GameManager.Multiplayer() && !_player.photonView.IsMine) { return; } tinnitus(_player); int num = SemiFunc.EnemyGetIndex(enemyHost); if (playerKill) { onImpactAny.Invoke(); onImpactPlayer.Invoke(); _player.playerHealth.Hurt(_player.playerHealth.health, true, num); } else { if (!CanHit(((Component)_player).gameObject, playerDamageCooldown, playerRayCast, _player.PlayerVisionTarget.VisionTransform.position, HitType.Player)) { return; } _player.playerHealth.Hurt(playerDamage, true, num); bool flag = false; Bounds bounds = Collider.bounds; Vector3 center = ((Bounds)(ref bounds)).center; Vector3 val = _player.PlayerVisionTarget.VisionTransform.position - center; Vector3 normalized = ((Vector3)(ref val)).normalized; normalized = SemiFunc.ClampDirection(normalized, ((Component)this).transform.forward, hitSpread); bool flag2 = _player.tumble.isTumbling; if (playerTumbleTime > 0f && _player.playerHealth.health > 0) { _player.tumble.TumbleRequest(true, false); _player.tumble.TumbleOverrideTime(playerTumbleTime); if (playerTumbleImpactHurtTime > 0f) { _player.tumble.ImpactHurtSet(playerTumbleImpactHurtTime, playerTumbleImpactHurtDamage); } flag2 = true; flag = true; } if (flag2 && (playerTumbleForce > 0f || playerTumbleTorque > 0f)) { flag = true; if (playerTumbleForce > 0f) { _player.tumble.TumbleForce(normalized * playerTumbleForce); } if (playerTumbleTorque > 0f) { Vector3 val2 = Vector3.zero; if (playerTumbleTorqueAxis == TorqueAxis.up) { val2 = ((Component)_player).transform.up; } if (playerTumbleTorqueAxis == TorqueAxis.down) { val2 = -((Component)_player).transform.up; } if (playerTumbleTorqueAxis == TorqueAxis.right) { val2 = ((Component)_player).transform.right; } if (playerTumbleTorqueAxis == TorqueAxis.left) { val2 = -((Component)_player).transform.right; } if (playerTumbleTorqueAxis == TorqueAxis.forward) { val2 = ((Component)_player).transform.forward; } if (playerTumbleTorqueAxis == TorqueAxis.back) { val2 = -((Component)_player).transform.forward; } val = ((Component)_player.localCamera).transform.position - center; Vector3 val3 = Vector3.Cross(((Vector3)(ref val)).normalized, val2) * playerTumbleTorque; _player.tumble.TumbleTorque(val3); } } if (!flag2 && playerHitForce > 0f) { PlayerController.instance.ForceImpulse(normalized * playerHitForce); } if (playerHitForce > 0f || playerDamage > 0 || flag) { onImpactPlayerAvatar = _player; onImpactAny.Invoke(); onImpactPlayer.Invoke(); } } } } private bool PhysObjectHurt(PhysGrabObject physGrabObject, BreakImpact impact, float hitForce, float hitTorque, bool apply, bool destroyLaunch, Enemy enemy = null) { //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015a: 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_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: 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_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) bool result = false; switch (impact) { case BreakImpact.Light: physGrabObject.lightBreakImpulse = true; result = true; break; case BreakImpact.Medium: physGrabObject.mediumBreakImpulse = true; result = true; break; case BreakImpact.Heavy: physGrabObject.heavyBreakImpulse = true; result = true; break; } if (Object.op_Implicit((Object)(object)enemyHost) && impact != 0 && physGrabObject.playerGrabbing.Count <= 0 && !physGrabObject.impactDetector.isEnemy) { physGrabObject.impactDetector.enemyInteractionTimer = 2f; } if (hitForce > 0f) { if (hitForce >= 5f && physGrabObject.playerGrabbing.Count > 0 && !physGrabObject.overrideKnockOutOfGrabDisable) { foreach (PhysGrabber item in physGrabObject.playerGrabbing.ToList()) { if (!SemiFunc.IsMultiplayer()) { item.ReleaseObjectRPC(true, 2f, -1); continue; } item.photonView.RPC("ReleaseObjectRPC", (RpcTarget)0, new object[2] { false, 1f }); } } Bounds bounds = Collider.bounds; Vector3 center = ((Bounds)(ref bounds)).center; Vector3 val = physGrabObject.centerPoint - center; Vector3 normalized = ((Vector3)(ref val)).normalized; normalized = SemiFunc.ClampDirection(normalized, ((Component)this).transform.forward, hitSpread); applyForce = normalized * hitForce; val = physGrabObject.centerPoint - center; Vector3 normalized2 = ((Vector3)(ref val)).normalized; Vector3 val2 = -((Component)physGrabObject).transform.up; applyTorque = Vector3.Cross(normalized2, val2) * hitTorque; if (destroyLaunch && !physGrabObject.rb.isKinematic) { physGrabObject.rb.velocity = Vector3.zero; physGrabObject.rb.angularVelocity = Vector3.zero; PhysGrabObjectImpactDetector impactDetector = physGrabObject.impactDetector; impactDetector.destroyDisableLaunches++; physGrabObject.impactDetector.destroyDisableLaunchesTimer = 10f; float num = 20f; if (Object.op_Implicit((Object)(object)enemy)) { num = 3f; } val = Random.insideUnitSphere; Vector3 val3 = ((Vector3)(ref val)).normalized * 4f; if (physGrabObject.impactDetector.destroyDisableLaunches >= 3) { val3 *= num; physGrabObject.impactDetector.destroyDisableLaunches = 0; } val3.y = 0f; if (Object.op_Implicit((Object)(object)enemy)) { val3 *= 0.25f; } applyForce = (Vector3.up * num + val3) * physGrabObject.rb.mass; val = Random.insideUnitSphere; applyTorque = ((Vector3)(ref val)).normalized * 0.25f * physGrabObject.rb.mass; physGrabObject.DeathPitEffectCreate(); } if (apply) { physGrabObject.rb.AddForce(applyForce, (ForceMode)1); physGrabObject.rb.AddTorque(applyTorque, (ForceMode)1); result = true; } } return result; } private void OnDrawGizmos() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00df: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: 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_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) BoxCollider component = ((Component)this).GetComponent<BoxCollider>(); SphereCollider component2 = ((Component)this).GetComponent<SphereCollider>(); Vector3 val; if (Object.op_Implicit((Object)(object)component2) && (((Component)this).transform.localScale.z != ((Component)this).transform.localScale.x || ((Component)this).transform.localScale.z != ((Component)this).transform.localScale.y)) { val = ((Component)this).transform.localScale; Debug.LogError((object)("Sphere Collider must be uniform scale: " + ((object)(Vector3)(ref val)).ToString()), (Object)(object)((Component)((Component)this).transform).gameObject); } Gizmos.color = new Color(1f, 0f, 0.39f, 6f); Gizmos.matrix = ((Component)this).transform.localToWorldMatrix; if (Object.op_Implicit((Object)(object)component)) { Gizmos.DrawWireCube(component.center, component.size); } if (Object.op_Implicit((Object)(object)component2)) { Gizmos.DrawWireSphere(component2.center, component2.radius); } Gizmos.color = new Color(1f, 0f, 0.39f, 0.2f); if (Object.op_Implicit((Object)(object)component)) { Gizmos.DrawCube(component.center, component.size); } if (Object.op_Implicit((Object)(object)component2)) { Gizmos.DrawSphere(component2.center, component2.radius); } Gizmos.color = Color.white; Gizmos.matrix = Matrix4x4.identity; Vector3 val2 = Vector3.zero; Bounds bounds; if (Object.op_Implicit((Object)(object)component)) { bounds = ((Collider)component).bounds; val2 = ((Bounds)(ref bounds)).center; } if (Object.op_Implicit((Object)(object)component2)) { bounds = ((Collider)component2).bounds; val2 = ((Bounds)(ref bounds)).center; } Vector3 val3 = val2 + ((Component)this).transform.forward * 0.5f; Gizmos.DrawLine(val2, val3); Gizmos.DrawLine(val3, val3 + Vector3.LerpUnclamped(-((Component)this).transform.forward, -((Component)this).transform.right, 0.5f) * 0.25f); Gizmos.DrawLine(val3, val3 + Vector3.LerpUnclamped(-((Component)this).transform.forward, ((Component)this).transform.right, 0.5f) * 0.25f); if (hitSpread < 180f) { Gizmos.color = new Color(1f, 1f, 1f, 0.2f); val = Quaternion.AngleAxis(hitSpread, ((Component)this).transform.right) * ((Component)this).transform.forward; Vector3 val4 = ((Vector3)(ref val)).normalized * 1.5f; val = Quaternion.AngleAxis(0f - hitSpread, ((Component)this).transform.right) * ((Component)this).transform.forward; Vector3 val5 = ((Vector3)(ref val)).normalized * 1.5f; val = Quaternion.AngleAxis(hitSpread, ((Component)this).transform.up) * ((Component)this).transform.forward; Vector3 val6 = ((Vector3)(ref val)).normalized * 1.5f; val = Quaternion.AngleAxis(0f - hitSpread, ((Component)this).transform.up) * ((Component)this).transform.forward; Vector3 val7 = ((Vector3)(ref val)).normalized * 1.5f; Gizmos.DrawRay(val2, val4); Gizmos.DrawRay(val2, val5); Gizmos.DrawRay(val2, val6); Gizmos.DrawRay(val2, val7); } else if (hitSpread > 180f) { Debug.LogError((object)"Hit Spread cannot be greater than 180 degrees"); } if (hasCustomRaycastPosition) { Gizmos.color = Color.blue; Gizmos.DrawWireSphere(((Component)this).transform.TransformPoint(customRaycastPosition), 0.2f); } } } namespace SonicGun { public class EarSound { private static GameObject? _audioObject; private static AudioSource? _source; public static AudioClip TinnitusSound; public static AudioSource PrepareSound(AudioClip clip) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if ((Object)(object)_audioObject == (Object)null) { _audioObject = new GameObject("AudioSource"); Object.DontDestroyOnLoad((Object)(object)_audioObject); _source = _audioObject.AddComponent<AudioSource>(); _source.spatialBlend = 0f; _source.loop = false; _source.playOnAwake = false; _source.volume = 0f; } _source.clip = clip; return _source; } } public class NewValues { public float MaxInvestigateRangeMultiplier = 0f; public float InvestigateRangeMultiplier; public override string ToString() { return "MaxInvestigateRangeMultiplier=" + MaxInvestigateRangeMultiplier + " InvestigateRangeMultiplier=" + InvestigateRangeMultiplier; } } [BepInPlugin("slenered.SonicGun", "SonicGun", "1.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class SonicGun : BaseUnityPlugin { internal static class Patch { private static AudioSource _audio; [HarmonyPatch(typeof(GameDirector), "OutroStart")] [HarmonyPostfix] private static void PatchGameDirectorOutroStart(GameDirector __instance) { ValueStorage.tinnitusVolume = 0f; } [HarmonyPatch(typeof(PlayerAvatar), "PlayerDeath")] [HarmonyPostfix] private static void PatchPlayerDeath(PlayerAvatar __instance) { ValueStorage.tinnitusVolume = 0f; } [HarmonyPatch(typeof(AudioManager), "Update")] [HarmonyPrefix] private static bool PatchAudioManagerUpdate(AudioManager __instance) { if (EnableTinnitus.Value && ValueStorage.tinnitusVolume <= 0f) { if ((Object)(object)_audio != (Object)null && _audio.isPlaying) { _audio.Stop(); } return true; } ValueStorage.tinnitusVolume -= Time.deltaTime / 20f; if (EnableTinnitus.Value && (Object)(object)_audio == (Object)null) { _audio = EarSound.PrepareSound(EarSound.TinnitusSound); } if (EnableTinnitus.Value && !_audio.isPlaying) { _audio.Play(); } if (EnableTinnitus.Value) { _audio.volume = ValueStorage.tinnitusVolume * 0.4f; } float num = Mathf.Lerp(-80f, 0f, __instance.VolumeCurve.Evaluate((float)DataDirector.instance.SettingValueFetch((Setting)0) * 0.01f * (1.2f - ValueStorage.tinnitusVolume))); float num2 = Mathf.Lerp(-80f, 0f, __instance.VolumeCurve.Evaluate((float)DataDirector.instance.SettingValueFetch((Setting)1) * 0.01f * (1.2f - ValueStorage.tinnitusVolume))); float num3 = Mathf.Lerp(-80f, 0f, __instance.VolumeCurve.Evaluate((float)DataDirector.instance.SettingValueFetch((Setting)4) * 0.01f * (1.2f - ValueStorage.tinnitusVolume))); float num4 = Mathf.Lerp(-80f, 0f, __instance.VolumeCurve.Evaluate((float)DataDirector.instance.SettingValueFetch((Setting)8) * 0.01f * (1.2f - ValueStorage.tinnitusVolume))); __instance.MusicMasterGroup.audioMixer.SetFloat("MusicVolume", num); __instance.SoundMasterGroup.audioMixer.SetFloat("SoundVolume", num2); __instance.MicrophoneSoundGroup.audioMixer.SetFloat("MicrophoneVolume", num3); __instance.TTSSoundGroup.audioMixer.SetFloat("TTSVolume", num4); return false; } [HarmonyPatch(typeof(ReverbDirector), "Update")] [HarmonyPrefix] private static bool PatchReverbDirectorUpdate(ReverbDirector __instance) { if (ValueStorage.tinnitusVolume <= 0f) { return true; } if (PlayerController.instance.playerAvatarScript.RoomVolumeCheck.CurrentRooms.Count > 0) { ReverbPreset val = ScriptableObject.CreateInstance<ReverbPreset>(); ReverbPreset reverbPreset = PlayerController.instance.playerAvatarScript.RoomVolumeCheck.CurrentRooms[0].ReverbPreset; if (Object.op_Implicit((Object)(object)reverbPreset)) { val.dryLevel = Mathf.Lerp(reverbPreset.dryLevel, 0f, ValueStorage.tinnitusVolume); val.room = Mathf.Lerp(reverbPreset.room, -100f, ValueStorage.tinnitusVolume); val.roomHF = Mathf.Lerp(reverbPreset.roomHF, -1000f, ValueStorage.tinnitusVolume); val.decayTime = Mathf.Lerp(reverbPreset.decayTime, 1f, ValueStorage.tinnitusVolume); val.decayHFRatio = Mathf.Lerp(reverbPreset.decayHFRatio, 0.83f, ValueStorage.tinnitusVolume); val.reflections = Mathf.Lerp(reverbPreset.reflections, 1646f, ValueStorage.tinnitusVolume);