using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using ACScripts.Managers; using ACScripts.Utils; using BepInEx; using BepInEx.Configuration; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using TMPro; using Unity.Netcode; using UnityEngine; 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: AssemblyVersion("0.0.0.0")] 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; } } } namespace ACScripts { public class DollItem : GrabbableObject { [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DollItem <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.isOnCooldown = true; <>4__this.CumShotParticle.Play(true); <>2__current = (object)new WaitForSeconds(3f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.CumShotParticle.Stop(true, (ParticleSystemStopBehavior)1); <>4__this.isOnCooldown = 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 ParticleSystem CumShotParticle; public AudioSource audioSource; public AudioClip clapSound; private float clapTimer = 0f; private float useTimer = 0f; private bool isUsing = false; private bool isOnCooldown = false; public override void EquipItem() { ((GrabbableObject)this).EquipItem(); base.playerHeldBy.equippedUsableItemQE = true; } public override void PocketItem() { StopUsing(); ((GrabbableObject)this).PocketItem(); } public override void DiscardItem() { StopUsing(); ((GrabbableObject)this).DiscardItem(); } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown) { isUsing = true; base.playerHeldBy.playerBodyAnimator.SetInteger("RockBaby", 1); } else { StopUsing(); } } public override void Update() { ((GrabbableObject)this).Update(); if (isUsing) { useTimer += Time.deltaTime; clapTimer += Time.deltaTime; if (clapTimer >= 0.5f) { audioSource.PlayOneShot(clapSound); clapTimer = 0f; } if (useTimer >= 10f && !isOnCooldown) { ((MonoBehaviour)this).StartCoroutine(CumShot()); useTimer = 0f; } } } private void StopUsing() { isUsing = false; useTimer = 0f; clapTimer = 0f; if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.playerBodyAnimator.SetInteger("RockBaby", 0); base.playerHeldBy.activatingItem = false; base.playerHeldBy.equippedUsableItemQE = false; } } [IteratorStateMachine(typeof(d__13))] private IEnumerator CumShot() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { <>4__this = this }; } } public class PenetratorItem : GrabbableObject { [CompilerGenerated] private sealed class d__41 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float effectSeverity; public PenetratorItem <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__41(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.6f); <>1__state = 1; return true; case 1: <>1__state = -1; SoundManager.Instance.earsRingingTimer = effectSeverity; 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(); } } [CompilerGenerated] private sealed class d__48 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PenetratorItem <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__48(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Expected O, but got Unknown //IL_01a5: 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_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Expected O, but got Unknown //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Expected O, but got Unknown //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.isReloading = true; if (<>4__this.shellsLoaded <= 0) { ((GrabbableObject)<>4__this).playerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun", true); ((Renderer)<>4__this.shotgunShellLeft).enabled = false; ((Renderer)<>4__this.shotgunShellRight).enabled = false; } else { ((GrabbableObject)<>4__this).playerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun2", true); ((Renderer)<>4__this.shotgunShellRight).enabled = false; } <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.gunAudio.PlayOneShot(<>4__this.gunReloadSFX); <>4__this.gunAnimator.SetBool("Reloading", true); <>4__this.ReloadGunEffectsServerRpc(); <>2__current = (object)new WaitForSeconds(0.95f); <>1__state = 2; return true; case 2: <>1__state = -1; ((Renderer)<>4__this.shotgunShellInHand).enabled = true; <>4__this.shotgunShellInHandTransform.SetParent(((GrabbableObject)<>4__this).playerHeldBy.leftHandItemTarget); <>4__this.shotgunShellInHandTransform.localPosition = new Vector3(-0.0555f, 0.1469f, -0.0655f); <>4__this.shotgunShellInHandTransform.localEulerAngles = new Vector3(-1.956f, 143.856f, -16.427f); <>2__current = (object)new WaitForSeconds(0.95f); <>1__state = 3; return true; case 3: <>1__state = -1; ((GrabbableObject)<>4__this).playerHeldBy.DestroyItemInSlotAndSync(<>4__this.ammoSlotToUse); <>4__this.ammoSlotToUse = -1; <>4__this.shellsLoaded = Mathf.Clamp(<>4__this.shellsLoaded + 1, 0, 2); ((Renderer)<>4__this.shotgunShellLeft).enabled = true; if (<>4__this.shellsLoaded == 2) { ((Renderer)<>4__this.shotgunShellRight).enabled = true; } ((Renderer)<>4__this.shotgunShellInHand).enabled = false; <>4__this.shotgunShellInHandTransform.SetParent(((Component)<>4__this).transform); <>2__current = (object)new WaitForSeconds(0.45f); <>1__state = 4; return true; case 4: <>1__state = -1; <>4__this.gunAudio.PlayOneShot(<>4__this.gunReloadFinishSFX); <>4__this.gunAnimator.SetBool("Reloading", false); ((GrabbableObject)<>4__this).playerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun", false); ((GrabbableObject)<>4__this).playerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun2", false); <>4__this.isReloading = false; <>4__this.ReloadGunEffectsServerRpc(start: 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 int gunCompatibleAmmoID = 69420; public bool isReloading; public int shellsLoaded = 2; public Animator gunAnimator; public AudioSource gunAudio; public AudioSource gunShootAudio; public AudioSource gunBulletsRicochetAudio; private Coroutine gunCoroutine; public AudioClip[] gunShootSFX; public AudioClip gunReloadSFX; public AudioClip gunReloadFinishSFX; public AudioClip noAmmoSFX; public AudioClip gunSafetySFX; public AudioClip switchSafetyOnSFX; public AudioClip switchSafetyOffSFX; public bool safetyOn; private float misfireTimer = 30f; private bool hasHitGroundWithSafetyOff = true; private int ammoSlotToUse = -1; private bool localClientSendingShootGunRPC; private PlayerControllerB previousPlayerHeldBy; public ParticleSystem gunShootParticle; public Transform shotgunRayPoint; public MeshRenderer shotgunShellLeft; public MeshRenderer shotgunShellRight; public MeshRenderer shotgunShellInHand; public Transform shotgunShellInHandTransform; private RaycastHit[] enemyColliders; private EnemyAI heldByEnemy; public override void Start() { ((GrabbableObject)this).Start(); misfireTimer = 30f; hasHitGroundWithSafetyOff = true; } public override int GetItemDataToSave() { ((GrabbableObject)this).GetItemDataToSave(); return shellsLoaded; } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); safetyOn = true; shellsLoaded = saveData; } public override void Update() { ((GrabbableObject)this).Update(); if (!((NetworkBehaviour)this).IsOwner || shellsLoaded <= 0 || isReloading || (Object)(object)heldByEnemy != (Object)null || base.isPocketed) { return; } if (base.hasHitGround && !safetyOn && !hasHitGroundWithSafetyOff && !base.isHeld) { if (Random.Range(0, 100) < 5) { ShootGunAndSync(heldByPlayer: false); } hasHitGroundWithSafetyOff = true; } else if (!safetyOn && misfireTimer <= 0f && !StartOfRound.Instance.inShipPhase) { if (Random.Range(0, 100) < 4) { ShootGunAndSync(base.isHeld); } if (Random.Range(0, 100) < 5) { misfireTimer = 2f; } else { misfireTimer = Random.Range(28f, 50f); } } else if (!safetyOn) { misfireTimer -= Time.deltaTime; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); previousPlayerHeldBy = base.playerHeldBy; previousPlayerHeldBy.equippedUsableItemQE = true; hasHitGroundWithSafetyOff = false; } public override void GrabItemFromEnemy(EnemyAI enemy) { ((GrabbableObject)this).GrabItemFromEnemy(enemy); heldByEnemy = enemy; hasHitGroundWithSafetyOff = false; } public override void DiscardItemFromEnemy() { ((GrabbableObject)this).DiscardItemFromEnemy(); heldByEnemy = null; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!isReloading) { if (shellsLoaded == 0) { StartReloadGun(); } else if (safetyOn) { gunAudio.PlayOneShot(gunSafetySFX); } else if (((NetworkBehaviour)this).IsOwner) { ShootGunAndSync(heldByPlayer: true); } } } public void ShootGunAndSync(bool heldByPlayer) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) Vector3 shotgunPosition; Vector3 forward; if (!heldByPlayer) { shotgunPosition = shotgunRayPoint.position; forward = shotgunRayPoint.forward; } else { shotgunPosition = ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.position - ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.up * 0.45f; forward = ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.forward; } Debug.Log((object)"Calling shoot gun...."); ShootGun(shotgunPosition, forward); Debug.Log((object)"Calling shoot gun and sync"); localClientSendingShootGunRPC = true; ShootGunServerRpc(shotgunPosition, forward); } [ServerRpc(RequireOwnership = false)] public void ShootGunServerRpc(Vector3 shotgunPosition, Vector3 shotgunForward) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) ShootGunClientRpc(shotgunPosition, shotgunForward); } [ClientRpc] public void ShootGunClientRpc(Vector3 shotgunPosition, Vector3 shotgunForward) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)"Shoot gun client rpc received"); if (localClientSendingShootGunRPC) { localClientSendingShootGunRPC = false; Debug.Log((object)"localClientSendingShootGunRPC was true"); } else { ShootGun(shotgunPosition, shotgunForward); } } public void ShootGun(Vector3 shotgunPosition, Vector3 shotgunForward) { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_024e: 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_0286: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: 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_02de: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) isReloading = false; bool flag = false; if (base.isHeld && (Object)(object)base.playerHeldBy != (Object)null && (Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { base.playerHeldBy.playerBodyAnimator.SetTrigger("ShootShotgun"); flag = true; } RoundManager.PlayRandomClip(gunShootAudio, gunShootSFX, true, 1f, 1840, 1000); WalkieTalkie.TransmitOneShotAudio(gunShootAudio, gunShootSFX[0], 1f); gunShootParticle.Play(true); shellsLoaded = Mathf.Clamp(shellsLoaded - 1, 0, 2); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { return; } float num = Vector3.Distance(((Component)localPlayerController).transform.position, ((Component)shotgunRayPoint).transform.position); bool flag2 = false; int num2 = 0; float num3 = 0f; Vector3 val = localPlayerController.playerCollider.ClosestPoint(shotgunPosition); if (!flag && !Physics.Linecast(shotgunPosition, val, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1) && Vector3.Angle(shotgunForward, val - shotgunPosition) < 30f) { flag2 = true; } if (num < 5f) { num3 = 0.8f; HUDManager.Instance.ShakeCamera((ScreenShakeType)1); num2 = 200; } if (num < 15f) { num3 = 0.5f; HUDManager.Instance.ShakeCamera((ScreenShakeType)1); num2 = 200; } else if (num < 23f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); num2 = 150; } else if (num < 30f) { num2 = 100; } if (num3 > 0f && SoundManager.Instance.timeSinceEarsStartedRinging > 16f) { ((MonoBehaviour)this).StartCoroutine(delayedEarsRinging(num3)); } Ray val2 = default(Ray); ((Ray)(ref val2))..ctor(shotgunPosition, shotgunForward); RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(val2, ref val3, 30f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { ((Component)gunBulletsRicochetAudio).transform.position = ((Ray)(ref val2)).GetPoint(((RaycastHit)(ref val3)).distance - 0.5f); gunBulletsRicochetAudio.Play(); } if (flag2) { localPlayerController.DamagePlayer(num2, true, true, (CauseOfDeath)7, 0, false, shotgunRayPoint.forward * 30f); } if (!((NetworkBehaviour)this).IsOwner) { return; } if (enemyColliders == null) { enemyColliders = (RaycastHit[])(object)new RaycastHit[10]; } ((Ray)(ref val2))..ctor(shotgunPosition - shotgunForward * 10f, shotgunForward); int num4 = Physics.SphereCastNonAlloc(val2, 5f, enemyColliders, 15f, 524288, (QueryTriggerInteraction)2); List list = new List(); IHittable val4 = default(IHittable); for (int i = 0; i < num4; i++) { if (!Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref enemyColliders[i])).transform).GetComponent())) { continue; } EnemyAI mainScript = ((Component)((RaycastHit)(ref enemyColliders[i])).transform).GetComponent().mainScript; if ((Object)(object)heldByEnemy != (Object)null && (Object)(object)heldByEnemy == (Object)(object)mainScript) { continue; } if (((RaycastHit)(ref enemyColliders[i])).distance == 0f) { Debug.Log((object)"Spherecast started inside enemy collider"); } else if (!Physics.Linecast(shotgunPosition, ((RaycastHit)(ref enemyColliders[i])).point, ref val3, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1) && ((Component)((RaycastHit)(ref enemyColliders[i])).transform).TryGetComponent(ref val4)) { float num5 = Vector3.Distance(shotgunPosition, ((RaycastHit)(ref enemyColliders[i])).point); int num6 = ((num5 < 3.7f) ? 10 : ((!(num5 < 6f)) ? 4 : 6)); EnemyAICollisionDetect component = ((Component)((RaycastHit)(ref enemyColliders[i])).collider).GetComponent(); if ((!((Object)(object)component != (Object)null) || (!((Object)(object)component.mainScript == (Object)null) && !list.Contains(component.mainScript))) && val4.Hit(num6, shotgunForward, base.playerHeldBy, true, -1) && (Object)(object)component != (Object)null) { list.Add(component.mainScript); } } } } [IteratorStateMachine(typeof(d__41))] private IEnumerator delayedEarsRinging(float effectSeverity) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__41(0) { <>4__this = this, effectSeverity = effectSeverity }; } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if ((Object)(object)base.playerHeldBy == (Object)null) { return; } Debug.Log((object)$"r/l activate: {right}"); if (!right) { if (safetyOn) { safetyOn = false; gunAudio.PlayOneShot(switchSafetyOffSFX); WalkieTalkie.TransmitOneShotAudio(gunAudio, switchSafetyOffSFX, 1f); SetSafetyControlTip(); } else { safetyOn = true; gunAudio.PlayOneShot(switchSafetyOnSFX); WalkieTalkie.TransmitOneShotAudio(gunAudio, switchSafetyOnSFX, 1f); SetSafetyControlTip(); } base.playerHeldBy.playerBodyAnimator.SetTrigger("SwitchGunSafety"); } else if (!isReloading && shellsLoaded < 2) { StartReloadGun(); } } public override void SetControlTipsForItem() { string[] toolTips = base.itemProperties.toolTips; if (toolTips.Length <= 2) { Debug.LogError((object)"Shotgun control tips array length is too short to set tips!"); return; } if (safetyOn) { toolTips[2] = "Turn safety off: [Q]"; } else { toolTips[2] = "Turn safety on: [Q]"; } HUDManager.Instance.ChangeControlTipMultiple(toolTips, true, base.itemProperties); } private void SetSafetyControlTip() { string text = ((!safetyOn) ? "Turn safety on: [Q]" : "Turn safety off: [Q]"); if (((NetworkBehaviour)this).IsOwner) { HUDManager.Instance.ChangeControlTip(3, text, false); } } private void StartReloadGun() { if (ReloadedGun()) { if (((NetworkBehaviour)this).IsOwner) { if (gunCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(gunCoroutine); } gunCoroutine = ((MonoBehaviour)this).StartCoroutine(reloadGunAnimation()); } } else { gunAudio.PlayOneShot(noAmmoSFX); } } [ServerRpc] public void ReloadGunEffectsServerRpc(bool start = true) { ReloadGunEffectsClientRpc(start); } [ClientRpc] public void ReloadGunEffectsClientRpc(bool start = true) { if (!((NetworkBehaviour)this).IsOwner) { if (start) { gunAudio.PlayOneShot(gunReloadSFX); WalkieTalkie.TransmitOneShotAudio(gunAudio, gunReloadSFX, 1f); gunAnimator.SetBool("Reloading", true); isReloading = true; } else { shellsLoaded = Mathf.Clamp(shellsLoaded + 1, 0, 2); gunAudio.PlayOneShot(gunReloadFinishSFX); gunAnimator.SetBool("Reloading", false); isReloading = false; } } } [IteratorStateMachine(typeof(d__48))] private IEnumerator reloadGunAnimation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__48(0) { <>4__this = this }; } private bool ReloadedGun() { int num = FindAmmoInInventory(); if (num == -1) { Debug.Log((object)"not reloading"); return false; } Debug.Log((object)"reloading!"); ammoSlotToUse = num; return true; } private int FindAmmoInInventory() { for (int i = 0; i < base.playerHeldBy.ItemSlots.Length; i++) { if (!((Object)(object)base.playerHeldBy.ItemSlots[i] == (Object)null)) { GrabbableObject obj = base.playerHeldBy.ItemSlots[i]; GunAmmo val = (GunAmmo)(object)((obj is GunAmmo) ? obj : null); Debug.Log((object)$"Ammo null in slot #{i}?: {(Object)(object)val == (Object)null}"); if ((Object)(object)val != (Object)null) { Debug.Log((object)$"Ammo in slot #{i} id: {val.ammoType}"); } if ((Object)(object)val != (Object)null && val.ammoType == gunCompatibleAmmoID) { return i; } } } return -1; } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); StopUsingGun(); } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); StopUsingGun(); } private void StopUsingGun() { previousPlayerHeldBy.equippedUsableItemQE = false; if (isReloading) { if (gunCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(gunCoroutine); } gunAnimator.SetBool("Reloading", false); gunAudio.Stop(); if ((Object)(object)previousPlayerHeldBy != (Object)null) { previousPlayerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun", false); previousPlayerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun2", false); } ((Renderer)shotgunShellInHand).enabled = false; shotgunShellInHandTransform.SetParent(((Component)this).transform); isReloading = false; } } } [BepInPlugin("WaterGun.AC", "Artem Company", "2.3.1")] public class Plugin : BaseUnityPlugin { [HarmonyPatch(typeof(MenuManager), "OnEnable")] internal class MenuManager_patch { [HarmonyPostfix] public static void MenuManagerInstance(MenuManager __instance) { ((MonoBehaviour)__instance).StartCoroutine(Instance.HandleMenuChanges(__instance)); } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRoundStart_patch { [HarmonyPostfix] [HarmonyPatch("Start")] public static void StartOfRoundInstance(StartOfRound __instance) { foreach (Item items in __instance.allItemsList.itemsList) { if (items.itemName == "Painting" && Instance.EnablePaintings.Value) { Material[] materials = ((Renderer)items.spawnPrefab.GetComponent()).materials; materials[0] = Instance.painting1; ((Renderer)items.spawnPrefab.GetComponent()).materials = materials; List list = new List(); list.Add(Instance.painting1); list.Add(Instance.painting2); list.Add(Instance.painting3); list.Add(Instance.painting4); list.Add(Instance.painting5); list.Add(Instance.painting6); list.Add(Instance.painting7); Material[] materialVariants = list.ToArray(); items.materialVariants = materialVariants; } } if (NetworkManager.Singleton.IsServer) { GameObject val = Object.Instantiate(Instance.NMAC); val.GetComponent().Spawn(false); } } } [HarmonyPatch(typeof(GameNetworkManager), "Start")] internal class GameNetworkManager_Start { [HarmonyPostfix] public static void Postfix() { foreach (GameObject item in NetworkPrefabs.prefabsToRegister) { if (!NetworkManager.Singleton.NetworkConfig.Prefabs.Contains(item)) { NetworkManager.Singleton.AddNetworkPrefab(item); } } } } [HarmonyPatch(typeof(Terminal), "Awake")] internal class Terminal_Awake { [HarmonyPrefix] public static void Prefix(Terminal __instance) { //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Expected O, but got Unknown foreach (KeyValuePair item in Instance.itemsToRegister) { if (StartOfRound.Instance.allItemsList.itemsList.Any((Item itemObject) => itemObject.itemName == item.Key.itemName)) { continue; } StartOfRound.Instance.allItemsList.itemsList.Add(item.Key); if (item.Value == 0) { continue; } SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val in levels) { if (!val.spawnableScrap.Any((SpawnableItemWithRarity scrap) => (Object)(object)scrap.spawnableItem == (Object)(object)item.Key)) { val.spawnableScrap.Add(new SpawnableItemWithRarity { rarity = item.Value, spawnableItem = item.Key }); } } } } } [HarmonyPatch(typeof(NutcrackerEnemyAI))] internal class nutcracker_patch { [HarmonyPatch("Start")] [HarmonyPrefix] public static void nutcrackersounds(NutcrackerEnemyAI __instance) { if (Instance.EnableNutcrackerSounds.Value) { Transform obj = ((Component)__instance).transform.Find("CreatureVoice"); AudioSource val = ((obj != null) ? ((Component)obj).GetComponent() : null); val.clip = Instance.nuttheme; ((EnemyAI)__instance).enemyType.deathSFX = Instance.nutdie; ((EnemyAI)__instance).enemyType.audioClips[2] = Instance.nutreload; ((EnemyAI)__instance).dieSFX = Instance.nutdie; ((EnemyAI)__instance).enemyType.audioClips[3] = null; if ((Object)(object)((EnemyAI)__instance).enemyType.audioClips[3] == (Object)null) { ((EnemyAI)__instance).enemyType.audioClips[3] = Instance.nutheadgoup; } __instance.aimSFX = Instance.nutaimsfxnew; } } } [HarmonyPatch(typeof(JesterAI))] internal class jester_patch { [HarmonyPatch("Start")] [HarmonyPrefix] public static void jestersounds(JesterAI __instance) { if (Instance.EnableJesterSounds.Value) { __instance.popUpSFX = Instance.jesterpop; __instance.screamingSFX = Instance.jesterscream; __instance.popGoesTheWeaselTheme = Instance.jestertheme; } } } [HarmonyPatch(typeof(Landmine))] internal class landmine_patch { [HarmonyPatch("Start")] [HarmonyPrefix] public static void landminesounds(Landmine __instance) { if (Instance.EnableLandMineSounds.Value) { __instance.mineDetonate = Instance.mineexplode; } } } [HarmonyPatch(typeof(HoarderBugAI))] internal class bug_patch { [HarmonyPatch("Start")] [HarmonyPrefix] public static void hoarderbugsounds(HoarderBugAI __instance) { if (Instance.EnableHoardingBugSounds.Value) { __instance.chitterSFX[0] = Instance.chitter; __instance.chitterSFX[1] = Instance.chitter; __instance.chitterSFX[2] = Instance.chitter; } } } [HarmonyPatch(typeof(RedLocustBees))] internal class bees_patch { [HarmonyPatch("Start")] [HarmonyPrefix] public static void beessounds(RedLocustBees __instance) { if (Instance.EnableCircuitBeesSounds.Value) { Transform obj = ((Component)__instance).transform.Find("AngrySFX"); AudioSource val = ((obj != null) ? ((Component)obj).GetComponent() : null); val.clip = Instance.angry; } } } [HarmonyPatch(typeof(ForestGiantAI))] internal class giant_patch { [HarmonyPatch("Start")] [HarmonyPostfix] public static void giantsounds(ForestGiantAI __instance) { if (Instance.EnableForestGiantSounds.Value) { Transform val = ((Component)__instance).transform.Find("FGiantModelContainer/AnimContainer"); PlayAudioAnimationEvent component = ((Component)val).GetComponent(); component.audioClip2 = Instance.eatplayeraudio; } } } [HarmonyPatch(typeof(MouthDogAI))] internal class dog_patch { [HarmonyPatch("Start")] [HarmonyPrefix] public static void dogsounds(MouthDogAI __instance) { if (Instance.EnableEyelessDogSounds.Value) { __instance.breathingSFX = Instance.breathe; } } } [HarmonyPatch(typeof(DressGirlAI))] internal class girl_patch { [HarmonyPatch("Start")] [HarmonyPrefix] public static void girlsounds(DressGirlAI __instance) { if (Instance.EnableDressGirlSounds.Value) { __instance.breathingSFX = Instance.spy; } } } [HarmonyPatch(typeof(VehicleController))] internal class cruiser_patch { [HarmonyPatch("Start")] [HarmonyPostfix] public static void cruiserprefab(VehicleController __instance) { if (Instance.EnableCruiserSkinPatch.Value) { Transform obj = ((Component)__instance).transform.Find("Meshes/MainBody"); MeshRenderer val = ((obj != null) ? ((Component)obj).GetComponent() : null); Transform obj2 = ((Component)__instance).transform.Find("Meshes/MainBody/MainBody (1)"); MeshRenderer val2 = ((obj2 != null) ? ((Component)obj2).GetComponent() : null); Transform obj3 = ((Component)__instance).transform.Find("Meshes/MainBody/MainBody (2)"); MeshRenderer val3 = ((obj3 != null) ? ((Component)obj3).GetComponent() : null); Transform obj4 = ((Component)__instance).transform.Find("Meshes/CarHoodContainer/CarHoodMesh"); MeshRenderer val4 = ((obj4 != null) ? ((Component)obj4).GetComponent() : null); Transform obj5 = ((Component)__instance).transform.Find("Meshes/DoorRightContainer/Door"); MeshRenderer val5 = ((obj5 != null) ? ((Component)obj5).GetComponent() : null); Transform obj6 = ((Component)__instance).transform.Find("Meshes/DoorLeftContainer/Door"); MeshRenderer val6 = ((obj6 != null) ? ((Component)obj6).GetComponent() : null); Transform obj7 = ((Component)__instance).transform.Find("Meshes/DriverSeatContainer/Seat/DriverSeat"); MeshRenderer val7 = ((obj7 != null) ? ((Component)obj7).GetComponent() : null); Transform obj8 = ((Component)__instance).transform.Find("Meshes/BackDoorContainer/BackDoor/BackDoorMesh"); SkinnedMeshRenderer val8 = ((obj8 != null) ? ((Component)obj8).GetComponent() : null); Material[] materials = ((Renderer)val).materials; Material[] materials2 = ((Renderer)val2).materials; Material[] materials3 = ((Renderer)val3).materials; Material[] materials4 = ((Renderer)val4).materials; Material[] materials5 = ((Renderer)val5).materials; Material[] materials6 = ((Renderer)val6).materials; Material[] materials7 = ((Renderer)val7).materials; Material[] materials8 = ((Renderer)val8).materials; materials[0] = Instance.cruisermat; materials2[0] = Instance.cruisermat; materials3[0] = Instance.cruisermat; materials4[0] = Instance.cruisermat; materials5[0] = Instance.cruisermat; materials6[0] = Instance.cruisermat; materials7[0] = Instance.cruisermat; materials8[0] = Instance.cruisermat; ((Renderer)val).materials = materials; ((Renderer)val2).materials = materials2; ((Renderer)val3).materials = materials3; ((Renderer)val4).materials = materials4; ((Renderer)val5).materials = materials5; ((Renderer)val6).materials = materials6; ((Renderer)val7).materials = materials7; ((Renderer)val8).materials = materials8; __instance.turboBoostSFX = Instance.jesterpop; Transform val9 = ((Component)__instance).transform.Find("Meshes/GearStickContainer/GearStick"); ((Renderer)((Component)val9).GetComponent()).enabled = false; GameObject val10 = Object.Instantiate(Instance.newgearstick, val9); } } } [HarmonyPatch(typeof(Turret))] internal class turret_patch { [HarmonyPatch("Start")] [HarmonyPrefix] public static void turretassets(Turret __instance) { Transform val = ((Component)__instance).transform.parent.Find("MeshContainer/Mount"); Transform val2 = ((Component)__instance.turretRod).transform.Find("Rod/GunBody"); GameObject val3 = Object.Instantiate(Instance.turretpatchcontainer, val2); Transform obj = ((Component)__instance.aimPoint).transform.Find("BulletParticle"); ParticleSystemRenderer val4 = ((obj != null) ? ((Component)obj).GetComponent() : null); Transform obj2 = ((Component)__instance.aimPoint).transform.Find("BulletParticle/BulletParticleFlare"); ParticleSystemRenderer val5 = ((obj2 != null) ? ((Component)obj2).GetComponent() : null); MeshRenderer component = ((Component)val).GetComponent(); MeshRenderer component2 = ((Component)val3.transform.Find("default")).GetComponent(); Material material = ((Renderer)component2).materials[0]; ((Renderer)((Component)val2).gameObject.GetComponent()).enabled = false; ((Renderer)((Component)((Component)val2).transform.Find("Magazine")).GetComponent()).enabled = false; val4.trailMaterial = Instance.TurretFlame; ((Renderer)val5).material = Instance.FlameTurret; ((Renderer)component).material = material; Transform obj3 = ((Component)val2).transform.Find("LightSphere/Point Light"); Light val6 = ((obj3 != null) ? ((Component)obj3).GetComponent() : null); val6.colorTemperature = 6307f; Transform obj4 = ((Component)val5).transform.Find("FlareLight"); Light val7 = ((obj4 != null) ? ((Component)obj4).GetComponent() : null); val7.colorTemperature = 6307f; Transform obj5 = ((Component)__instance.aimPoint).transform.Find("Spot Light"); Light val8 = ((obj5 != null) ? ((Component)obj5).GetComponent() : null); val8.colorTemperature = 6307f; } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRound_PatchOnSceneLoad { [HarmonyPatch("SceneManager_OnLoadComplete1")] [HarmonyPostfix] public static void StartOfRoundInstanceLoad(StartOfRound __instance) { if (Instance.EnableSexShop.Value && __instance.currentLevel.PlanetName == "71 Gordion" && __instance.currentLevel.levelID == 3 && NetworkManager.Singleton.IsServer && !__instance.inShipPhase) { NetworkManagerAC.Instance.SetupShop(); } } } [HarmonyPatch(typeof(StartOfRound))] internal class StartOfRound_PatchOnSceneUnload { [HarmonyPatch("SceneManager_OnUnloadComplete")] [HarmonyPostfix] public static void StartOfRoundInstanceUnLoad(StartOfRound __instance) { if (Instance.EnableSexShop.Value && __instance.currentLevel.PlanetName == "71 Gordion" && __instance.currentLevel.levelID == 3 && NetworkManager.Singleton.IsServer) { NetworkManagerAC.Instance.RemoveShop(); } } } [CompilerGenerated] private sealed class d__76 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public MenuManager Instance; public Plugin <>4__this; private Transform 5__1; private Transform <LoadingTitle>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <HandleMenuChanges>d__76(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <Title>5__1 = null; <LoadingTitle>5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if ((Object)(object)Instance.versionNumberText == (Object)null) { <>2__current = null; <>1__state = 1; return true; } ((TMP_Text)Instance.versionNumberText).rectTransform.sizeDelta = new Vector2(400f, ((TMP_Text)Instance.versionNumberText).rectTransform.sizeDelta.y); TextMeshProUGUI versionNumberText = Instance.versionNumberText; ((TMP_Text)versionNumberText).text = ((TMP_Text)versionNumberText).text + " (Artem Company 2.3.1)"; ((Graphic)Instance.versionNumberText).color = Color.white; <Title>5__1 = Instance.menuButtons.transform.Find("HeaderImage"); ((Component)<Title>5__1).GetComponent<Image>().sprite = ACTitle; <LoadingTitle>5__2 = Instance.loadingScreen.transform.Find("Image"); ((Component)<LoadingTitle>5__2).GetComponent<Image>().sprite = ACTitle; ((Graphic)Instance.loadingText).color = Color.white; 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 const string GUID = "WaterGun.AC"; private const string NAME = "Artem Company"; private const string VERSION = "2.3.1"; public static Plugin Instance; public static AssetBundle bundle; public GameObject NMAC; private static Sprite ACTitle; public ConfigEntry<bool> CensorMode; public ConfigEntry<bool> EnableWaterGun; public ConfigEntry<bool> EnableDildo; public ConfigEntry<bool> EnableHeadShoulders; public ConfigEntry<bool> EnableAnalBeads; public ConfigEntry<bool> EnablePussyDestroyer; public ConfigEntry<bool> EnableAnalDestroyer; public ConfigEntry<bool> EnableDurex; public ConfigEntry<bool> EnableSexDoll; public ConfigEntry<bool> EnableNutcrackerSounds; public ConfigEntry<bool> EnableJesterSounds; public ConfigEntry<bool> EnableLandMineSounds; public ConfigEntry<bool> EnableCircuitBeesSounds; public ConfigEntry<bool> EnableHoardingBugSounds; public ConfigEntry<bool> EnableForestGiantSounds; public ConfigEntry<bool> EnableDressGirlSounds; public ConfigEntry<bool> EnableEyelessDogSounds; public ConfigEntry<bool> EnableSexShop; public ConfigEntry<int> PenetratorPrice; public ConfigEntry<int> PenetratorAmmoPrice; public ConfigEntry<bool> EnableCruiserSkinPatch; public ConfigEntry<bool> EnableTurretSkinPatch; public ConfigEntry<bool> EnablePaintings; public GameObject SexShopprefab; public AudioClip nutaimsfxnew; public AudioClip nutheadgoup; public AudioClip nutdie; public AudioClip nuttheme; public AudioClip nutreload; public AudioClip jestertheme; public AudioClip jesterscream; public AudioClip jesterpop; public AudioClip mineexplode; public AudioClip chitter; public AudioClip angry; public AudioClip eatplayeraudio; public AudioClip breathe; public AudioClip spy; public Material cruisermat; public GameObject newgearstick; public Item Dildo; public Item WaterGun; public Item HeadShoulders; public Item AnalBeads; public Item PussyDestroyer; public Item AnalDestroyer; public Item Durex; public Item SexDoll; public Material painting1; public Material painting2; public Material painting3; public Material painting4; public Material painting5; public Material painting6; public Material painting7; public GameObject turretpatchcontainer; public Material FlameTurret; public Material TurretFlame; public GameObject SpawnedShop; public Item Penetrator; public Item Penetratorshell; public AudioClip gunReloadSFX; public AudioClip gunSafetySFX; public AudioClip switchSafetyOnSFX; public AudioClip switchSafetyOffSFX; public AudioClip gunblastfail; public AudioClip gunblast; public Dictionary<Item, int> itemsToRegister = new Dictionary<Item, int>(); private void Awake() { //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Expected O, but got Unknown //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Unknown result type (might be due to invalid IL or missing references) //IL_06c0: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_07a2: Unknown result type (might be due to invalid IL or missing references) //IL_07a7: Unknown result type (might be due to invalid IL or missing references) //IL_0884: Unknown result type (might be due to invalid IL or missing references) //IL_0889: Unknown result type (might be due to invalid IL or missing references) //IL_0965: Unknown result type (might be due to invalid IL or missing references) //IL_096a: Unknown result type (might be due to invalid IL or missing references) //IL_0a47: Unknown result type (might be due to invalid IL or missing references) //IL_0a4c: Unknown result type (might be due to invalid IL or missing references) Instance = this; Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } EnableWaterGun = ((BaseUnityPlugin)this).Config.Bind<bool>("Scraps", "Enable WaterGun", true, "Enables WaterGun Spawning"); EnableDildo = ((BaseUnityPlugin)this).Config.Bind<bool>("Scraps", "Enable Dildo", true, "Enables Dildo Spawning"); EnableAnalBeads = ((BaseUnityPlugin)this).Config.Bind<bool>("Scraps", "Enable AnalBeads", true, "Enables AnalBeads Spawning"); EnableHeadShoulders = ((BaseUnityPlugin)this).Config.Bind<bool>("Scraps", "Enable Head&Shoulders", true, "Enables Head&Shoulders Spawning"); EnablePussyDestroyer = ((BaseUnityPlugin)this).Config.Bind<bool>("Scraps", "Enable PussyDestroyer", true, "Enables PussyDestroyer Spawning"); EnableAnalDestroyer = ((BaseUnityPlugin)this).Config.Bind<bool>("Scraps", "Enable AnalDestroyer", true, "Enables AnalDestroyer Spawning"); EnableDurex = ((BaseUnityPlugin)this).Config.Bind<bool>("Scraps", "Enable Durex", true, "Enables Durex Spawning"); EnableSexDoll = ((BaseUnityPlugin)this).Config.Bind<bool>("Scraps", "Enable SexDoll", true, "Enables SexDoll Spawning"); EnableNutcrackerSounds = ((BaseUnityPlugin)this).Config.Bind<bool>("Sounds", "Enable Nutcracker", true, "Enables Nutcracker Sound patches"); EnableJesterSounds = ((BaseUnityPlugin)this).Config.Bind<bool>("Sounds", "Enable Jester", true, "Enables Jester Sound patches"); EnableLandMineSounds = ((BaseUnityPlugin)this).Config.Bind<bool>("Sounds", "Enable LandMine", true, "Enables Landmine Sound patches"); EnableCircuitBeesSounds = ((BaseUnityPlugin)this).Config.Bind<bool>("Sounds", "Enable Circuit Bees", true, "Enables Circuit Bees Sound patches"); EnableHoardingBugSounds = ((BaseUnityPlugin)this).Config.Bind<bool>("Sounds", "Enable Hoarding Bug", true, "Enables Hoarding Bug Sound patches"); EnableDressGirlSounds = ((BaseUnityPlugin)this).Config.Bind<bool>("Sounds", "Enable Dress Girl", true, "Enables Dress Girl Sound patches"); EnableEyelessDogSounds = ((BaseUnityPlugin)this).Config.Bind<bool>("Sounds", "Enable Eyeless dog", true, "Enables Eyeless Dog Sound patches"); EnableForestGiantSounds = ((BaseUnityPlugin)this).Config.Bind<bool>("Sounds", "Enable Forest Giant", true, "Enables Forest Giant sound patches"); EnableSexShop = ((BaseUnityPlugin)this).Config.Bind<bool>("SexShop", "Enable Sex Shop", true, "[WIP] Enables sex shop at the company"); PenetratorPrice = ((BaseUnityPlugin)this).Config.Bind<int>("SexShop", "Penetrator price", 3000, "Allows tweaking penetrator price"); PenetratorAmmoPrice = ((BaseUnityPlugin)this).Config.Bind<int>("SexShop", "PenetratorAmmo Price", 100, "Allows tweaking penetrator ammo price"); EnableCruiserSkinPatch = ((BaseUnityPlugin)this).Config.Bind<bool>("Cruiser", "Enable CruiserSkinPatch", true, "Enables Cruiser Skin Patch"); EnableTurretSkinPatch = ((BaseUnityPlugin)this).Config.Bind<bool>("Turret", "Enable TurretSkinPatch", true, "Enables Turret Skin Patch"); CensorMode = ((BaseUnityPlugin)this).Config.Bind<bool>("CensorMode", "Enabled", false, "Enables Censor mode for the mod"); EnablePaintings = ((BaseUnityPlugin)this).Config.Bind<bool>("Paintings", "Enable PaintingsSkinPatch", true, "Enables paintings patch"); string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "acassets"); bundle = AssetBundle.LoadFromFile(text); ACTitle = bundle.LoadAsset<Sprite>("Assets/LethalCompany/Mods/AC/Menu/ACTitle.png"); NMAC = bundle.LoadAsset<GameObject>("Assets/LethalCompany/Mods/AC/ACNM.prefab"); NMAC.AddComponent<NetworkManagerAC>(); NetworkPrefabs.RegisterNetworkPrefab(NMAC); Harmony val = new Harmony("WaterGun.AC"); val.PatchAll(); Instance.Penetrator = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/AC/ACSexShop/Items/Penetrator/Penetrator.asset"); NetworkPrefabs.RegisterNetworkPrefab(Instance.Penetrator.spawnPrefab); Instance.itemsToRegister.Add(Instance.Penetrator, 0); Instance.Penetratorshell = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/AC/ACSexShop/Items/Penetrator/PenetratorAmmo.asset"); NetworkPrefabs.RegisterNetworkPrefab(Instance.Penetratorshell.spawnPrefab); Instance.itemsToRegister.Add(Instance.Penetratorshell, 0); if (Instance.EnableDildo.Value) { Instance.Dildo = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/AC/Scraps/Dildo/Dildo.asset"); if (Instance.CensorMode.Value) { ParticleSystem[] componentsInChildren = Instance.Dildo.spawnPrefab.GetComponentsInChildren<ParticleSystem>(); ParticleSystem[] array3 = componentsInChildren; foreach (ParticleSystem val2 in array3) { if (((Object)((Component)val2).gameObject).name == "CensorPart") { MainModule main = val2.main; ((MainModule)(ref main)).playOnAwake = true; } } } NetworkPrefabs.RegisterNetworkPrefab(Instance.Dildo.spawnPrefab); Instance.itemsToRegister.Add(Instance.Dildo, 50); } if (Instance.EnableWaterGun.Value) { Instance.WaterGun = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/AC/Scraps/WaterGun/WaterGun.asset"); NetworkPrefabs.RegisterNetworkPrefab(Instance.WaterGun.spawnPrefab); Instance.itemsToRegister.Add(Instance.WaterGun, 50); } if (Instance.EnableHeadShoulders.Value) { Instance.HeadShoulders = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/AC/Scraps/Head&Shoulders/HeadShoulders.asset"); NetworkPrefabs.RegisterNetworkPrefab(Instance.HeadShoulders.spawnPrefab); Instance.itemsToRegister.Add(Instance.HeadShoulders, 50); } if (Instance.EnableAnalBeads.Value) { Instance.AnalBeads = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/AC/Scraps/AnalBeads/Kulki.asset"); if (Instance.CensorMode.Value) { ParticleSystem[] componentsInChildren2 = Instance.AnalBeads.spawnPrefab.GetComponentsInChildren<ParticleSystem>(); ParticleSystem[] array4 = componentsInChildren2; foreach (ParticleSystem val3 in array4) { if (((Object)((Component)val3).gameObject).name == "CensorPart") { MainModule main2 = val3.main; ((MainModule)(ref main2)).playOnAwake = true; } } } NetworkPrefabs.RegisterNetworkPrefab(Instance.AnalBeads.spawnPrefab); Instance.itemsToRegister.Add(Instance.AnalBeads, 50); } if (Instance.EnablePussyDestroyer.Value) { Instance.PussyDestroyer = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/AC/Scraps/PussyDestroyer/PussyDestroyer.asset"); if (Instance.CensorMode.Value) { ParticleSystem[] componentsInChildren3 = Instance.PussyDestroyer.spawnPrefab.GetComponentsInChildren<ParticleSystem>(); ParticleSystem[] array5 = componentsInChildren3; foreach (ParticleSystem val4 in array5) { if (((Object)((Component)val4).gameObject).name == "CensorPart") { MainModule main3 = val4.main; ((MainModule)(ref main3)).playOnAwake = true; } } } NetworkPrefabs.RegisterNetworkPrefab(Instance.PussyDestroyer.spawnPrefab); Instance.itemsToRegister.Add(Instance.PussyDestroyer, 9); } if (Instance.EnableAnalDestroyer.Value) { Instance.AnalDestroyer = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/AC/Scraps/AnalDestroyer/AnalDestroyer.asset"); if (Instance.CensorMode.Value) { ParticleSystem[] componentsInChildren4 = Instance.AnalDestroyer.spawnPrefab.GetComponentsInChildren<ParticleSystem>(); ParticleSystem[] array6 = componentsInChildren4; foreach (ParticleSystem val5 in array6) { if (((Object)((Component)val5).gameObject).name == "CensorPart") { MainModule main4 = val5.main; ((MainModule)(ref main4)).playOnAwake = true; } } } NetworkPrefabs.RegisterNetworkPrefab(Instance.AnalDestroyer.spawnPrefab); Instance.itemsToRegister.Add(Instance.AnalDestroyer, 3); } if (Instance.EnableDurex.Value) { Instance.Durex = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/AC/Scraps/Durex/Durex.asset"); if (Instance.CensorMode.Value) { ParticleSystem[] componentsInChildren5 = Instance.Durex.spawnPrefab.GetComponentsInChildren<ParticleSystem>(); ParticleSystem[] array7 = componentsInChildren5; foreach (ParticleSystem val6 in array7) { if (((Object)((Component)val6).gameObject).name == "CensorPart") { MainModule main5 = val6.main; ((MainModule)(ref main5)).playOnAwake = true; } } } NetworkPrefabs.RegisterNetworkPrefab(Instance.Durex.spawnPrefab); Instance.itemsToRegister.Add(Instance.Durex, 25); } if (Instance.EnableSexDoll.Value) { Instance.SexDoll = bundle.LoadAsset<Item>("Assets/LethalCompany/Mods/AC/Scraps/SexDoll/SexDoll.asset"); if (Instance.CensorMode.Value) { ParticleSystem[] componentsInChildren6 = Instance.SexDoll.spawnPrefab.GetComponentsInChildren<ParticleSystem>(); ParticleSystem[] array8 = componentsInChildren6; foreach (ParticleSystem val7 in array8) { if (((Object)((Component)val7).gameObject).name == "CensorPart") { MainModule main6 = val7.main; ((MainModule)(ref main6)).playOnAwake = true; } } } NetworkPrefabs.RegisterNetworkPrefab(Instance.SexDoll.spawnPrefab); Instance.itemsToRegister.Add(Instance.SexDoll, 20); } if (Instance.EnableNutcrackerSounds.Value) { Instance.nutaimsfxnew = bundle.LoadAsset<AudioClip>("Assets/LethalCompany/Mods/AC/Enemies/CustomSounds/Nutcracker/AlertedSFX.wav"); Instance.nutheadgoup = bundle.LoadAsset<AudioClip>("Assets/LethalCompany/Mods/AC/Enemies/CustomSounds/Nutcracker/HeadGoUp.wav"); Instance.nutdie = bundle.LoadAsset<AudioClip>("Assets/LethalCompany/Mods/AC/Enemies/CustomSounds/Nutcracker/NutcrackerDie.wav"); Instance.nuttheme = bundle.LoadAsset<AudioClip>("Assets/LethalCompany/Mods/AC/Enemies/CustomSounds/Nutcracker/NutcrackerAngry.wav"); Instance.nutreload = bundle.LoadAsset<AudioClip>("Assets/LethalCompany/Mods/AC/Enemies/CustomSounds/Nutcracker/ShotgunReloadNutcracker.wav"); } if (Instance.EnableJesterSounds.Value) { Instance.jestertheme = bundle.LoadAsset<AudioClip>("Assets/LethalCompany/Mods/AC/Enemies/CustomSounds/Jester/JackInTheBoxTheme.wav"); Instance.jesterscream = bundle.LoadAsset<AudioClip>("Assets/LethalCompany/Mods/AC/Enemies/CustomSounds/Jester/Scream1.wav"); Instance.jesterpop = bundle.LoadAsset<AudioClip>("Assets/LethalCompany/Mods/AC/Enemies/CustomSounds/Jester/Pop1.wav"); } if (Instance.EnableLandMineSounds.Value) { Instance.mineexplode = bundle.LoadAsset<AudioClip>("Assets/LethalCompany/Mods/AC/Enemies/CustomSounds/Landmine/MineDetonate.wav"); } if (Instance.EnableHoardingBugSounds.Value) { Instance.chitter = bundle.LoadAsset<AudioClip>("Assets/LethalCompany/Mods/AC/Enemies/CustomSounds/HoardingBug/Chitter.wav"); } if (Instance.EnableCircuitBeesSounds.Value) { Instance.angry = bundle.LoadAsset<AudioClip>("Assets/LethalCompany/Mods/AC/Enemies/CustomSounds/CircuitBees/AngrySFX.wav"); } if (Instance.EnableForestGiantSounds.Value) { Instance.eatplayeraudio = bundle.LoadAsset<AudioClip>("Assets/LethalCompany/Mods/AC/Enemies/CustomSounds/ForestGiant/FGiantEatPlayerSFX.wav"); } if (Instance.EnableEyelessDogSounds.Value) { Instance.breathe = bundle.LoadAsset<AudioClip>("Assets/LethalCompany/Mods/AC/Enemies/CustomSounds/EyelessDog/Breathe1.wav"); } if (Instance.EnableDressGirlSounds.Value) { Instance.spy = bundle.LoadAsset<AudioClip>("Assets/LethalCompany/Mods/AC/Enemies/CustomSounds/GhostGirl/Breathing.wav"); } if (Instance.EnableCruiserSkinPatch.Value) { Instance.newgearstick = bundle.LoadAsset<GameObject>("Assets/LethalCompany/Mods/AC/Skins/GearBoxPatch.prefab"); Instance.cruisermat = bundle.LoadAsset<Material>("Assets/LethalCompany/Mods/AC/Skins/MainBodyPatch.mat"); } if (Instance.EnableCruiserSkinPatch.Value) { Instance.newgearstick = bundle.LoadAsset<GameObject>("Assets/LethalCompany/Mods/AC/Skins/GearBoxPatch.prefab"); Instance.cruisermat = bundle.LoadAsset<Material>("Assets/LethalCompany/Mods/AC/Skins/MainBodyPatch.mat"); } if (Instance.EnableTurretSkinPatch.Value) { Instance.FlameTurret = bundle.LoadAsset<Material>("Assets/LethalCompany/Mods/AC/Enemies/Turret/FlameTurret.mat"); Instance.TurretFlame = bundle.LoadAsset<Material>("Assets/LethalCompany/Mods/AC/Enemies/Turret/TurretFlame.mat"); Instance.turretpatchcontainer = bundle.LoadAsset<GameObject>("Assets/LethalCompany/Mods/AC/Enemies/Turret/TurretPatchContainer.prefab"); } if (Instance.EnablePaintings.Value) { Instance.painting1 = bundle.LoadAsset<Material>("Assets/LethalCompany/Mods/AC/Paintings/Painting1Material.mat"); Instance.painting2 = bundle.LoadAsset<Material>("Assets/LethalCompany/Mods/AC/Paintings/Painting2Material.mat"); Instance.painting3 = bundle.LoadAsset<Material>("Assets/LethalCompany/Mods/AC/Paintings/Painting3Material.mat"); Instance.painting4 = bundle.LoadAsset<Material>("Assets/LethalCompany/Mods/AC/Paintings/Painting4Material.mat"); Instance.painting5 = bundle.LoadAsset<Material>("Assets/LethalCompany/Mods/AC/Paintings/Painting5Material.mat"); Instance.painting6 = bundle.LoadAsset<Material>("Assets/LethalCompany/Mods/AC/Paintings/Painting6Material.mat"); Instance.painting7 = bundle.LoadAsset<Material>("Assets/LethalCompany/Mods/AC/Paintings/Painting7Material.mat"); } Instance.SexShopprefab = bundle.LoadAsset<GameObject>("Assets/LethalCompany/Mods/AC/ACSexShop/PatchContainer.prefab"); NetworkPrefabs.RegisterNetworkPrefab(Instance.SexShopprefab); ((BaseUnityPlugin)this).Logger.LogInfo((object)("Finished Loading, config values:\n\nSEXSHOP:\n\n" + $"EnableSexShop: {EnableSexShop.Value}\n" + $"PenetratorPrice: {PenetratorPrice.Value}\n" + $"PenetratorAmmoPrice: {PenetratorAmmoPrice.Value}\n\n" + "SOUNDS:\n\n" + $"EnableForestGiantSounds: {EnableForestGiantSounds.Value}\n" + $"EnableDressGirlSounds: {EnableDressGirlSounds.Value}\n" + $"EnableEyelessDogSounds: {EnableEyelessDogSounds.Value}\n" + $"EnableCircuitBeesSounds: {EnableCircuitBeesSounds.Value}\n" + $"EnableJesterSounds: {EnableJesterSounds.Value}\n" + $"EnableNutcrackerSounds: {EnableNutcrackerSounds.Value}\n" + $"EnableLandMineSounds: {EnableLandMineSounds.Value}\n" + $"EnableHoardingBugSounds: {EnableHoardingBugSounds.Value}\n\n" + "SCRAPS:\n\n" + $"EnableSexDoll: {EnableSexDoll.Value}\n" + $"EnableWaterGun: {EnableWaterGun.Value}\n" + $"EnableHeadShoulders: {EnableHeadShoulders.Value}\n" + $"EnableDildo: {EnableDildo.Value}\n" + $"EnableDurex: {EnableDurex.Value}\n" + $"EnableAnalDestroyer: {EnableAnalDestroyer.Value}\n" + $"EnablePussyDestroyer: {EnablePussyDestroyer.Value}\n" + $"EnableAnalBeads: {EnableAnalBeads.Value}\n\n" + "TURRET:\n\n" + $"EnableTurretSkinPatch: {EnableTurretSkinPatch.Value}\n\n" + "CRUISER:\n\n" + $"EnableCruiserSkinPatch: {EnableCruiserSkinPatch.Value}\n\n" + "PAINTINGS:\n\n" + $"EnablePaintingSkinPatch: {EnablePaintings.Value}\n\n")); } [IteratorStateMachine(typeof(<HandleMenuChanges>d__76))] public IEnumerator HandleMenuChanges(MenuManager Instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <HandleMenuChanges>d__76(0) { <>4__this = this, Instance = Instance }; } } public class WaterGunItem : GrabbableObject { public ParticleSystem WaterBubbles; public AudioSource WaterAudio; public override void EquipItem() { ((GrabbableObject)this).EquipItem(); base.playerHeldBy.equippedUsableItemQE = true; } public override void PocketItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.activatingItem = false; base.playerHeldBy.equippedUsableItemQE = false; } ((GrabbableObject)this).PocketItem(); StopSpraying(); } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.activatingItem = false; base.playerHeldBy.equippedUsableItemQE = false; } ((GrabbableObject)this).DiscardItem(); StopSpraying(); } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown) { StartSpraying(); } else { StopSpraying(); } } public void StopSpraying() { WaterBubbles.Stop(true, (ParticleSystemStopBehavior)1); WaterAudio.Stop(); } public void StartSpraying() { WaterBubbles.Play(true); WaterAudio.Play(); } } } namespace ACScripts.Utils { public class NetworkPrefabs { public static List<GameObject> prefabsToRegister = new List<GameObject>(); public static void RegisterNetworkPrefab(GameObject prefab) { if (!prefabsToRegister.Contains(prefab)) { prefabsToRegister.Add(prefab); Debug.Log((object)(((Object)prefab).name + " registered")); } else { Debug.LogError((object)(((Object)prefab).name + " Already registered")); } } } } namespace ACScripts.Managers { public class NetworkManagerAC : NetworkBehaviour { [CompilerGenerated] private sealed class <HandleShopSpawn>d__5 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public int PenetratorPrice; public int PenetratorAmmoPrice; public NetworkManagerAC <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <HandleShopSpawn>d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; goto IL_0050; case 1: <>1__state = -1; goto IL_0050; case 2: <>1__state = -1; goto IL_00c4; case 3: { <>1__state = -1; break; } IL_0050: if ((Object)(object)Plugin.Instance.SpawnedShop.transform.Find("PenetratorAmmoManager/penetratorammospawner") == (Object)null) { <>2__current = null; <>1__state = 1; return true; } ((Component)Plugin.Instance.SpawnedShop.transform.Find("PenetratorAmmoManager/penetratorammospawner")).GetComponent<InteractTrigger>().hoverTip = $"Buy SpermBall ■{PenetratorAmmoPrice} : [LMB]"; goto IL_00c4; IL_00c4: if ((Object)(object)Plugin.Instance.SpawnedShop.transform.Find("PenetratorManager/penetratorspawner") == (Object)null) { <>2__current = null; <>1__state = 2; return true; } break; } if ((Object)(object)Plugin.Instance.SpawnedShop.transform.Find("ShopAC/SexShopPropContainer (1)/Boombox") == (Object)null) { <>2__current = null; <>1__state = 3; return true; } ((Component)Plugin.Instance.SpawnedShop.transform.Find("ShopAC/SexShopPropContainer (1)/Boombox")).GetComponent<AudioSource>().Play(); ((Component)Plugin.Instance.SpawnedShop.transform.Find("PenetratorManager/penetratorspawner")).GetComponent<InteractTrigger>().hoverTip = $"Buy Penetrator ■{PenetratorPrice} : [LMB]"; 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(); } } [CompilerGenerated] private sealed class <WaitForShop>d__6 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NetworkObjectReference shopRef; public int penetratorPrice; public int penetratorAmmoPrice; public NetworkManagerAC <>4__this; private NetworkObject <netObj>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <WaitForShop>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <netObj>5__1 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <netObj>5__1 = null; break; case 1: <>1__state = -1; break; } if (!((NetworkObjectReference)(ref shopRef)).TryGet(ref <netObj>5__1, (NetworkManager)null)) { <>2__current = null; <>1__state = 1; return true; } Plugin.Instance.SpawnedShop = ((Component)<netObj>5__1).gameObject; Debug.Log((object)$"[Shop READY] Client {NetworkManager.Singleton.LocalClientId}"); ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.HandleShopSpawn(penetratorPrice, penetratorAmmoPrice)); 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 static NetworkManagerAC Instance; private void Awake() { Instance = this; } public void SetupShop() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Plugin.Instance.SpawnedShop == (Object)null && !StartOfRound.Instance.inShipPhase) { GameObject val = Object.Instantiate<GameObject>(Plugin.Instance.SexShopprefab, Vector3.zero, Quaternion.identity); val.GetComponent<SexShopManager>().PenetratorAmmoPrice = Plugin.Instance.PenetratorAmmoPrice.Value; val.GetComponent<SexShopManager>().PenetratorPrice = Plugin.Instance.PenetratorPrice.Value; val.GetComponent<NetworkObject>().Spawn(false); Plugin.Instance.SpawnedShop = val; } } public void RemoveShop() { if ((Object)(object)Plugin.Instance.SpawnedShop != (Object)null) { Plugin.Instance.SpawnedShop.GetComponent<NetworkObject>().Despawn(true); } } [ClientRpc] public void DisplayPurchaseClientRpc(string Header, string SubText, bool isWarning) { HUDManager.Instance.DisplayTip(Header, SubText, isWarning, false, "LC_Tip1"); Debug.Log((object)$"[SexShop] Displaying purchase on {NetworkManager.Singleton.LocalClientId}"); } [IteratorStateMachine(typeof(<HandleShopSpawn>d__5))] public IEnumerator HandleShopSpawn(int PenetratorPrice, int PenetratorAmmoPrice) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <HandleShopSpawn>d__5(0) { <>4__this = this, PenetratorPrice = PenetratorPrice, PenetratorAmmoPrice = PenetratorAmmoPrice }; } [IteratorStateMachine(typeof(<WaitForShop>d__6))] private IEnumerator WaitForShop(NetworkObjectReference shopRef, int penetratorPrice, int penetratorAmmoPrice) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <WaitForShop>d__6(0) { <>4__this = this, shopRef = shopRef, penetratorPrice = penetratorPrice, penetratorAmmoPrice = penetratorAmmoPrice }; } [ClientRpc] public void ApplyShopOnClientsClientRpc(int penetratorPrice, int penetratorAmmoPrice, NetworkObjectReference shopRef) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)this).StartCoroutine(WaitForShop(shopRef, penetratorPrice, penetratorAmmoPrice)); } [ServerRpc(RequireOwnership = false)] public void SlowEnemyOnServerRpc(NetworkObjectReference enemyObj, float speed) { NetworkObject val = default(NetworkObject); if (((NetworkObjectReference)(ref enemyObj)).TryGet(ref val, (NetworkManager)null)) { ((Component)val).GetComponent<EnemyAI>().agent.speed = speed; Debug.Log((object)((Component)val).GetComponent<EnemyAI>().agent.speed); } } } public class SexShopManager : NetworkBehaviour { [CompilerGenerated] private sealed class <HandleContainers>d__6 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SexShopManager <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <HandleContainers>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; goto IL_0044; case 1: <>1__state = -1; goto IL_0044; case 2: { <>1__state = -1; break; } IL_0044: if ((Object)(object)GameObject.Find("Map/ShippingContainers/ShippingContainer (1)") == (Object)null) { <>2__current = null; <>1__state = 1; return true; } break; } if ((Object)(object)GameObject.Find("Map/ShippingContainers/ShippingContainer (4)") == (Object)null) { <>2__current = null; <>1__state = 2; return true; } GameObject.Find("Map/ShippingContainers/ShippingContainer (1)").SetActive(false); GameObject.Find("Map/ShippingContainers/ShippingContainer (4)").SetActive(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 static SexShopManager Instance; private Terminal terminal; public Vector3 spawnpos; public int PenetratorPrice; public int PenetratorAmmoPrice; private void Awake() { Instance = this; if (((NetworkBehaviour)this).NetworkManager.IsServer) { terminal = Object.FindObjectOfType<Terminal>(); } ((MonoBehaviour)this).StartCoroutine(HandleContainers()); } [IteratorStateMachine(typeof(<HandleContainers>d__6))] public IEnumerator HandleContainers() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <HandleContainers>d__6(0) { <>4__this = this }; } public override void OnNetworkSpawn() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) ((NetworkBehaviour)this).OnNetworkSpawn(); if (NetworkManager.Singleton.IsServer) { NetworkManagerAC.Instance.ApplyShopOnClientsClientRpc(PenetratorPrice, PenetratorAmmoPrice, NetworkObjectReference.op_Implicit(((Component)Instance).GetComponent<NetworkObject>())); } } public void PurchasePenetrator(PlayerControllerB player) { ulong playerClientId = player.playerClientId; PurchasePenetratorServerRpc(playerClientId); } public void PurchasePenetratorAmmo(PlayerControllerB player) { ulong playerClientId = player.playerClientId; PurchasePenetratorAmmoServerRpc(playerClientId); } public void PlayCashRegisterAnim(PlayerControllerB player) { ulong playerClientId = player.playerClientId; PlayCashRegisterAnimServerRpc(playerClientId); } [ServerRpc(RequireOwnership = false)] public void PurchasePenetratorServerRpc(ulong clientid) { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (val.playerClientId == clientid) { if (terminal.groupCredits >= Plugin.Instance.PenetratorPrice.Value) { Debug.Log((object)("[SexShop] penetrator purchased by: " + val.playerUsername)); GameObject val2 = Object.Instantiate<GameObject>(Plugin.Instance.Penetrator.spawnPrefab, spawnpos, Quaternion.identity, StartOfRound.Instance.propsContainer); Terminal obj = terminal; obj.groupCredits -= Instance.PenetratorPrice; PlayCashRegisterAnim(val); NetworkManagerAC.Instance.DisplayPurchaseClientRpc("SexShop", $"Bought Penetrator for ■{PenetratorPrice}\nCurrent group credits: ■{terminal.groupCredits}", isWarning: false); Debug.Log((object)"[SexShop] Penetrator spawned."); val2.GetComponent<NetworkObject>().Spawn(false); } else { Debug.Log((object)("[SexShop] penetrator purchase denied to: " + val.playerUsername)); NetworkManagerAC.Instance.DisplayPurchaseClientRpc("SexShop", $"Can't affort Penetrator\nCurrent group credits: ■{terminal.groupCredits}", isWarning: true); } } } } [ServerRpc(RequireOwnership = false)] public void PurchasePenetratorAmmoServerRpc(ulong clientid) { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (val.playerClientId == clientid) { if (terminal.groupCredits >= Plugin.Instance.PenetratorAmmoPrice.Value) { Debug.Log((object)("[SexShop] penetrator purchased by: " + val.playerUsername)); GameObject val2 = Object.Instantiate<GameObject>(Plugin.Instance.Penetratorshell.spawnPrefab, spawnpos, Quaternion.identity, StartOfRound.Instance.propsContainer); Terminal obj = terminal; obj.groupCredits -= Instance.PenetratorAmmoPrice; PlayCashRegisterAnim(val); NetworkManagerAC.Instance.DisplayPurchaseClientRpc("SexShop", $"Bought SpermBall for ■{PenetratorAmmoPrice}\nCurrent group credits: ■{terminal.groupCredits}", isWarning: false); Debug.Log((object)"[SexShop] PenetratorShell spawned."); val2.GetComponent<NetworkObject>().Spawn(false); } else { Debug.Log((object)("[SexShop] penetratorAmmo purchase denied to: " + val.playerUsername)); NetworkManagerAC.Instance.DisplayPurchaseClientRpc("SexShop", $"Can't affort SpermBall\nCurrent group credits: ■{terminal.groupCredits}", isWarning: true); } } } } [ServerRpc(RequireOwnership = false)] public void PlayCashRegisterAnimServerRpc(ulong clientid) { PlayCashRegisterAnimClientRpc(clientid); Debug.Log((object)"[SexShop] Playing cashregisteranim on server"); } [ClientRpc] public void PlayCashRegisterAnimClientRpc(ulong clientid) { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (val.actualClientId == clientid) { AnimatedObjectTrigger component = GameObject.Find("SexShopCashRegister").GetComponent<AnimatedObjectTrigger>(); component.TriggerAnimation(val); ((Component)component).GetComponent<AudioSource>().Play(); Debug.Log((object)$"[SexShop] Playing cashregisteranim on {NetworkManager.Singleton.LocalClientId}"); } } } } }