Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of PiggyVarietyModFixed v1.4.302
PiggyVarietyMod.dll
Decompiled 3 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using DunGen; using DunGen.Graph; using GameNetcodeStuff; using HarmonyLib; using LethalCompanyInputUtils.Api; using LethalLib.Modules; using PiggyVarietyMod.Patches; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("PiggysVarietyModFixed")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PiggysVarietyModFixed")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("ad52d41b-d67a-4836-86c7-6e644a48ee3d")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace PiggyVarietyMod { [BepInPlugin("Piggy.PiggyVarietyMod", "PiggyVarietyMod", "1.3.19")] public class Plugin : BaseUnityPlugin { private const string modGUID = "Piggy.PiggyVarietyMod"; private const string modName = "PiggyVarietyMod"; private const string modVersion = "1.3.19"; private readonly Harmony harmony = new Harmony("Piggy.PiggyVarietyMod"); private static Plugin Instance; public static ManualLogSource mls; public static AssetBundle Bundle; internal static PVInputActions InputActionInstance = new PVInputActions(); public static GameObject teslaGateSpawn; public static GameObject teslaGatePrefab; public static AudioClip teslaIdleStart; public static AudioClip teslaIdle; public static AudioClip teslaIdleEnd; public static AudioClip teslaCrack; public static AudioClip teslaBeep; public static AudioClip teslaWindUp; public static AudioClip teslaUnderbass; public static AudioClip teslaClimax; public static AudioClip flashlightShake; public static AudioClip gummylightClick; public static AudioClip gummylightOutage; public static AudioClip flashFlicker; public static Material flashlightBulb; public static Material blackRubber; public static GameObject gummylightPrefab; public static GameObject m4Prefab; public static GameObject axePrefab; public static Item revolverItem; public static Item revolverAmmoItem; public static Item gummyFlashlight; public static Item arItem; public static Item arMagItem; public static Item axeItem; public static Item bulbItem; public static Item chemicalItem; public static int revolverRarity; public static int revolverAmmoRarity; public static int revolverMaxPlayerDamage; public static int revolverMaxMonsterDamage; public static int rifleMaxPlayerDamage; public static int rifleMonsterDamage; public static bool customGunInfinityAmmo; public static int revolverPrice; public static int revolverAmmoPrice; public static int riflePrice; public static int rifleMagPrice; public static int rifleRarity; public static int rifleMagRarity; public static bool twoHandedRifle; public static int axeRarity; public static int axePrice; public static int bulbRarity; public static int chemicalRarity; public static int gummyLightRarity; public static int gummyLightPrice; public static float teslaSpawnWeight; public static float teslaSoundVolume; public static bool teslaShake; public static bool translateKorean; public static AudioClip revolverAmmoInsert; public static AudioClip revolverCylinderOpen; public static AudioClip revolverCylinderClose; public static AudioClip revolverDryFire; public static AudioClip revolverBlast1; public static AudioClip revolverBlast2; public static AudioClip m4FireClip; public static AudioClip m4ReloadClip; public static AudioClip m4InspectClip; public static AudioClip m4TriggerClip; public static RuntimeAnimatorController playerAnimator; public static RuntimeAnimatorController otherPlayerAnimator; public static string PluginDirectory; private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } PluginDirectory = ((BaseUnityPlugin)this).Info.Location; LoadAssets(); mls = Logger.CreateLogSource("Piggy.PiggyVarietyMod"); mls.LogInfo((object)"Piggy's Variety Mod is loaded"); teslaSoundVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Generic", "TeslaGateVolume", 1f, "(Default 1) Sets the sound volume for Tesla Gate.").Value; teslaShake = ((BaseUnityPlugin)this).Config.Bind<bool>("Generic", "TeslaGateShake", false, "(Experimental, Default false) Shake the screen when near Tesla Gate.").Value; revolverMaxPlayerDamage = ((BaseUnityPlugin)this).Config.Bind<int>("Generic", "RevolverMaxPlayerDamage", 70, "(Default 70) Sets the maximum amount of damage the Revolver can deals on the player.").Value; revolverMaxMonsterDamage = ((BaseUnityPlugin)this).Config.Bind<int>("Generic", "RevolverMaxMonsterDamage", 4, "(Default 4) Sets the maximum amount of damage the Revolver can deals on the monster.").Value; rifleMaxPlayerDamage = ((BaseUnityPlugin)this).Config.Bind<int>("Generic", "RifleMaxPlayerDamage", 22, "(Default 22) Sets the maximum amount of damage the Rifle can deals on the player.").Value; rifleMonsterDamage = ((BaseUnityPlugin)this).Config.Bind<int>("Generic", "RifleMonsterDamage", 1, "(Default 1) Sets the amount of damage the Rifle deals to monsters.").Value; customGunInfinityAmmo = ((BaseUnityPlugin)this).Config.Bind<bool>("Generic", "CustomGunInfinityAmmo", false, "(Default false) If true, reloading custom guns will no longer require ammo.").Value; twoHandedRifle = ((BaseUnityPlugin)this).Config.Bind<bool>("Generic", "TwoHandedRifle", false, "(Default false) If true, changes the rifle to a two-handed item.").Value; teslaSpawnWeight = ((BaseUnityPlugin)this).Config.Bind<float>("Spawn", "TeslaGateWeight", 1f, "(Default 1) Sets the spawn weight for the Tesla Gate.").Value; revolverRarity = ((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "RevolverRarity", 20, "(Default 20) Sets the spawn rarity for the Revolver.").Value; revolverAmmoRarity = ((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "RevolverAmmoRarity", 60, "(Default 60) Sets the spawn rarity for the Revolver ammo.").Value; gummyLightRarity = ((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "GummylightAmmoRarity", 0, "(Default 0) Sets the spawn rarity for the Gummy flashlight.").Value; axeRarity = ((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "AxeRarity", 0, "(Default 0) Sets the spawn rarity for the Axe.").Value; revolverPrice = ((BaseUnityPlugin)this).Config.Bind<int>("Store", "RevolverPrice", -1, "(Recommended -1 or 550) Set the price of the Revolver. If -1, removes the item from the store list.").Value; revolverAmmoPrice = ((BaseUnityPlugin)this).Config.Bind<int>("Store", "RevolverAmmoPrice", -1, "(Recommended -1 or 30) Set the price of the Revolver ammo. If -1, removes the item from the store list.").Value; gummyLightPrice = ((BaseUnityPlugin)this).Config.Bind<int>("Store", "GummylightAmmoPrice", 30, "(Recommended 30) Set the price of the Gummy flashlight. If -1, removes the item from the store list.").Value; riflePrice = ((BaseUnityPlugin)this).Config.Bind<int>("Store", "RiflePrice", -1, "(Recommended -1 or 1,000~) Set the price of the Rifle (M4A1). If -1, removes the item from the store list.").Value; rifleMagPrice = ((BaseUnityPlugin)this).Config.Bind<int>("Store", "RifleMagPrice", -1, "(Recommended -1 or 400~) Set the price of the Rifle magazine. If -1, removes the item from the store list.").Value; rifleRarity = ((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "RifleRarity", 20, "(Default 20) Sets the spawn rarity for the Rifle.").Value; rifleMagRarity = ((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "RifleMagRarity", 60, "(Default 60) Sets the spawn rarity for the Rifle magazine.").Value; axePrice = ((BaseUnityPlugin)this).Config.Bind<int>("Store", "AxePrice", 45, "(Recommended 45) Set the price of the Axe. If -1, removes the item from the store list.").Value; bulbRarity = ((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "BulbRarity", 30, "(Default 30) Sets the spawn rarity for the Bulb.").Value; chemicalRarity = ((BaseUnityPlugin)this).Config.Bind<int>("Scrap", "ChemicalRarity", 30, "(Default 30) Sets the spawn rarity for the Chemical.").Value; translateKorean = ((BaseUnityPlugin)this).Config.Bind<bool>("Translation", "Enable Korean", false, "Set language to Korean.").Value; NetworkPrefabs.RegisterNetworkPrefab(teslaGatePrefab); NetworkPrefabs.RegisterNetworkPrefab(revolverItem.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(revolverAmmoItem.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(gummyFlashlight.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(arItem.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(arMagItem.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(axeItem.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(bulbItem.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(chemicalItem.spawnPrefab); Utilities.FixMixerGroups(revolverItem.spawnPrefab); Utilities.FixMixerGroups(revolverAmmoItem.spawnPrefab); Utilities.FixMixerGroups(gummyFlashlight.spawnPrefab); Utilities.FixMixerGroups(arItem.spawnPrefab); Utilities.FixMixerGroups(arMagItem.spawnPrefab); Utilities.FixMixerGroups(axeItem.spawnPrefab); Utilities.FixMixerGroups(bulbItem.spawnPrefab); Utilities.FixMixerGroups(chemicalItem.spawnPrefab); Items.RegisterItem(revolverItem); Items.RegisterItem(revolverAmmoItem); Items.RegisterItem(gummyFlashlight); Items.RegisterItem(arItem); Items.RegisterItem(arMagItem); Items.RegisterItem(axeItem); Items.RegisterItem(bulbItem); Items.RegisterItem(chemicalItem); if (translateKorean) { Translate(); } CreateShopItem(); Items.RegisterScrap(revolverItem, revolverRarity, (LevelTypes)(-1)); Items.RegisterScrap(revolverAmmoItem, revolverAmmoRarity, (LevelTypes)(-1)); Items.RegisterScrap(arItem, rifleRarity, (LevelTypes)(-1)); Items.RegisterScrap(arMagItem, rifleMagRarity, (LevelTypes)(-1)); Items.RegisterScrap(bulbItem, bulbRarity, (LevelTypes)(-1)); Items.RegisterScrap(chemicalItem, chemicalRarity, (LevelTypes)(-1)); Items.RegisterScrap(gummyFlashlight, gummyLightRarity, (LevelTypes)(-1)); Items.RegisterScrap(axeItem, axeRarity, (LevelTypes)(-1)); Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); foreach (Type type in types) { try { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array = methods; foreach (MethodInfo methodInfo in array) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } catch { mls.LogInfo((object)"Skipping Netcode Class"); } } mls.LogInfo((object)"Netcode Successfully Patched!"); } private void LoadAssets() { //IL_0788: Unknown result type (might be due to invalid IL or missing references) //IL_0792: Expected O, but got Unknown try { Bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(PluginDirectory), "piggyvarietymod")); } catch (Exception ex) { mls.LogError((object)("Couldn't load asset bundle: " + ex.Message)); return; } try { teslaGateSpawn = Bundle.LoadAsset<GameObject>("TeslaGateSpawn.prefab"); teslaGatePrefab = Bundle.LoadAsset<GameObject>("TeslaGate.prefab"); teslaGatePrefab.AddComponent<TeslaGate>(); teslaCrack = Bundle.LoadAsset<AudioClip>("Tesla_Crack.ogg"); teslaBeep = Bundle.LoadAsset<AudioClip>("Tesla_Beeps.ogg"); teslaWindUp = Bundle.LoadAsset<AudioClip>("Tesla_WindUp.ogg"); teslaUnderbass = Bundle.LoadAsset<AudioClip>("Tesla_Underbass.ogg"); teslaClimax = Bundle.LoadAsset<AudioClip>("Tesla_Climax.ogg"); teslaIdleStart = Bundle.LoadAsset<AudioClip>("Tesla_IdleStarts.ogg"); teslaIdle = Bundle.LoadAsset<AudioClip>("Tesla_IdleLoop.ogg"); teslaIdleEnd = Bundle.LoadAsset<AudioClip>("Tesla_IdleEnd.ogg"); flashlightShake = Bundle.LoadAsset<AudioClip>("FlashlightShake.wav"); gummylightClick = Bundle.LoadAsset<AudioClip>("GummyFlashlightClick.wav"); gummylightOutage = Bundle.LoadAsset<AudioClip>("GummylightBatteryOutage.wav"); flashFlicker = Bundle.LoadAsset<AudioClip>("FlashlightFlicker.ogg"); flashlightBulb = Bundle.LoadAsset<Material>("FlashlightBulb1.mat"); blackRubber = Bundle.LoadAsset<Material>("BlackRubber1.mat"); Plugin.revolverItem = Bundle.LoadAsset<Item>("Revolver.asset"); revolverAmmoItem = Bundle.LoadAsset<Item>("RevolverAmmo.asset"); arItem = Bundle.LoadAsset<Item>("M4A1.asset"); arMagItem = Bundle.LoadAsset<Item>("Magazine.asset"); Plugin.axeItem = Bundle.LoadAsset<Item>("Axe.asset"); gummyFlashlight = Bundle.LoadAsset<Item>("GummyFlashlight.asset"); chemicalItem = Bundle.LoadAsset<Item>("Chemical.asset"); bulbItem = Bundle.LoadAsset<Item>("Bulb.asset"); gummylightPrefab = Bundle.LoadAsset<GameObject>("GummylightItem.prefab"); m4Prefab = Bundle.LoadAsset<GameObject>("M4Item.prefab"); axePrefab = Bundle.LoadAsset<GameObject>("AxeItem.prefab"); revolverAmmoInsert = Bundle.LoadAsset<AudioClip>("RevolverReload.wav"); revolverCylinderOpen = Bundle.LoadAsset<AudioClip>("RevolverCylinderOpen.wav"); revolverCylinderClose = Bundle.LoadAsset<AudioClip>("RevolverCylinderClose.wav"); revolverDryFire = Bundle.LoadAsset<AudioClip>("RevolverDryFire.wav"); revolverBlast1 = Bundle.LoadAsset<AudioClip>("RevolverBlast1.wav"); revolverBlast2 = Bundle.LoadAsset<AudioClip>("RevolverBlast2.wav"); m4FireClip = Bundle.LoadAsset<AudioClip>("M4Fire1.wav"); m4InspectClip = Bundle.LoadAsset<AudioClip>("InspectM4v2.wav"); m4TriggerClip = Bundle.LoadAsset<AudioClip>("M4Trigger.wav"); m4ReloadClip = Bundle.LoadAsset<AudioClip>("M4Reload.wav"); playerAnimator = Bundle.LoadAsset<RuntimeAnimatorController>("PlayerAnimator.controller"); otherPlayerAnimator = Bundle.LoadAsset<RuntimeAnimatorController>("OtherPlayerAnimator.controller"); RevolverItem revolverItem = Plugin.revolverItem.spawnPrefab.AddComponent<RevolverItem>(); ((GrabbableObject)revolverItem).grabbable = true; ((GrabbableObject)revolverItem).grabbableToEnemies = true; revolverItem.gunReloadSFX = revolverAmmoInsert; revolverItem.cylinderOpenSFX = revolverCylinderOpen; revolverItem.cylinderCloseSFX = revolverCylinderClose; revolverItem.gunShootSFX.Add(revolverBlast1); revolverItem.gunShootSFX.Add(revolverBlast2); revolverItem.noAmmoSFX = revolverDryFire; revolverItem.gunSafetySFX = revolverDryFire; revolverItem.switchSafetyOffSFX = revolverDryFire; revolverItem.switchSafetyOnSFX = revolverDryFire; revolverItem.gunAudio = ((Component)revolverItem).gameObject.GetComponent<AudioSource>(); revolverItem.gunShootAudio = ((Component)((Component)revolverItem).gameObject.transform.GetChild(1)).GetComponent<AudioSource>(); revolverItem.gunBulletsRicochetAudio = ((Component)((Component)revolverItem).gameObject.transform.GetChild(2)).GetComponent<AudioSource>(); revolverItem.gunAnimator = ((Component)revolverItem).gameObject.GetComponent<Animator>(); revolverItem.revolverRayPoint = ((Component)revolverItem).gameObject.transform.GetChild(3); revolverItem.gunShootParticle = ((Component)((Component)revolverItem).gameObject.transform.GetChild(3).GetChild(0)).GetComponent<ParticleSystem>(); revolverItem.cylinderTransform = ((Component)revolverItem).gameObject.transform.GetChild(5).GetChild(0).GetChild(0); revolverItem.revolverAmmos.Add(((Component)((Component)revolverItem).gameObject.transform.GetChild(5).GetChild(0).GetChild(0) .GetChild(0)).GetComponent<MeshRenderer>()); revolverItem.revolverAmmos.Add(((Component)((Component)revolverItem).gameObject.transform.GetChild(5).GetChild(0).GetChild(0) .GetChild(1)).GetComponent<MeshRenderer>()); revolverItem.revolverAmmos.Add(((Component)((Component)revolverItem).gameObject.transform.GetChild(5).GetChild(0).GetChild(0) .GetChild(2)).GetComponent<MeshRenderer>()); revolverItem.revolverAmmos.Add(((Component)((Component)revolverItem).gameObject.transform.GetChild(5).GetChild(0).GetChild(0) .GetChild(3)).GetComponent<MeshRenderer>()); revolverItem.revolverAmmos.Add(((Component)((Component)revolverItem).gameObject.transform.GetChild(5).GetChild(0).GetChild(0) .GetChild(4)).GetComponent<MeshRenderer>()); revolverItem.revolverAmmos.Add(((Component)((Component)revolverItem).gameObject.transform.GetChild(5).GetChild(0).GetChild(0) .GetChild(5)).GetComponent<MeshRenderer>()); revolverItem.revolverAmmoInHandTransform = ((Component)revolverItem).gameObject.transform.GetChild(0); revolverItem.revolverAmmoInHand = ((Component)((Component)revolverItem).gameObject.transform.GetChild(0).GetChild(0)).GetComponent<MeshRenderer>(); revolverItem.gunCompatibleAmmoID = 500; ((GrabbableObject)revolverItem).itemProperties = Plugin.revolverItem; arItem.spawnPrefab = m4Prefab; M4Item m4Item = arItem.spawnPrefab.AddComponent<M4Item>(); ((GrabbableObject)m4Item).grabbable = true; ((GrabbableObject)m4Item).isInFactory = true; ((GrabbableObject)m4Item).itemProperties = arItem; ((GrabbableObject)m4Item).grabbableToEnemies = true; m4Item.gunCompatibleAmmoID = 485; m4Item.gunAnimator = ((Component)m4Item).gameObject.GetComponent<Animator>(); m4Item.gunAudio = ((Component)m4Item).gameObject.GetComponent<AudioSource>(); m4Item.gunShootAudio = ((Component)((Component)m4Item).transform.GetChild(0)).GetComponent<AudioSource>(); m4Item.gunBulletsRicochetAudio = ((Component)((Component)m4Item).transform.GetChild(1)).GetComponent<AudioSource>(); m4Item.gunShootSFX = m4FireClip; m4Item.gunReloadSFX = m4ReloadClip; m4Item.gunInspectSFX = m4InspectClip; m4Item.noAmmoSFX = m4TriggerClip; m4Item.gunShootParticle = ((Component)((Component)m4Item).transform.GetChild(5).GetChild(0)).GetComponent<ParticleSystem>(); m4Item.gunRayPoint = ((Component)m4Item).transform.GetChild(5); if (twoHandedRifle) { arItem.twoHanded = true; } gummyFlashlight.spawnPrefab = gummylightPrefab; GummylightItem gummylightItem = gummyFlashlight.spawnPrefab.AddComponent<GummylightItem>(); ((GrabbableObject)gummylightItem).useCooldown = 0.12f; ((GrabbableObject)gummylightItem).itemProperties = gummyFlashlight; ((GrabbableObject)gummylightItem).mainObjectRenderer = ((Component)((Component)gummylightItem).transform.GetChild(2)).GetComponent<MeshRenderer>(); ((GrabbableObject)gummylightItem).insertedBattery = new Battery(false, 1f); ((GrabbableObject)gummylightItem).insertedBattery.charge = 1f; ((GrabbableObject)gummylightItem).grabbableToEnemies = true; gummylightItem.flashlightBulb = ((Component)((Component)gummylightItem).transform.GetChild(0)).GetComponent<Light>(); gummylightItem.flashlightBulbGlow = ((Component)((Component)gummylightItem).transform.GetChild(1)).GetComponent<Light>(); gummylightItem.flashlightAudio = ((Component)gummylightItem).GetComponent<AudioSource>(); gummylightItem.flashlightClips = (AudioClip[])(object)new AudioClip[1] { gummylightClick }; gummylightItem.outOfBatteriesClip = gummylightOutage; gummylightItem.flashlightFlicker = flashFlicker; gummylightItem.bulbLight = flashlightBulb; gummylightItem.bulbDark = blackRubber; gummylightItem.flashlightMesh = ((Component)((Component)gummylightItem).transform.GetChild(2)).GetComponent<MeshRenderer>(); gummylightItem.changeMaterial = true; ((GrabbableObject)gummylightItem).isInFactory = true; ((GrabbableObject)gummylightItem).grabbable = true; gummylightItem.flashlightTypeID = 10; Object.Destroy((Object)(object)gummyFlashlight.spawnPrefab.GetComponent<FlashlightItem>()); Plugin.axeItem.spawnPrefab = axePrefab; AxeItem axeItem = Plugin.axeItem.spawnPrefab.AddComponent<AxeItem>(); Shovel component = Plugin.axeItem.spawnPrefab.GetComponent<Shovel>(); ((GrabbableObject)axeItem).itemProperties = Plugin.axeItem; ((GrabbableObject)axeItem).grabbable = true; ((GrabbableObject)axeItem).isInFactory = true; ((GrabbableObject)axeItem).grabbableToEnemies = true; axeItem.axeHitForce = 2; axeItem.reelUp = component.reelUp; axeItem.swing = component.swing; axeItem.hitSFX = component.hitSFX; axeItem.axeAudio = component.shovelAudio; Object.Destroy((Object)(object)component); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Successfully loaded assets!"); } catch (Exception ex2) { ((BaseUnityPlugin)this).Logger.LogError((object)("Couldn't load assets: " + ex2.Message)); } } private void Translate() { revolverItem.toolTips[0] = "격발 : [RMB]"; revolverItem.toolTips[1] = "탄약 삽탄하기 : [E]"; revolverItem.toolTips[2] = "실린더 열기 : [Q]"; gummyFlashlight.toolTips[0] = "전등 전환하기 : [RMB]"; gummyFlashlight.toolTips[1] = "손전등 흔들기 : [Q]"; arItem.toolTips[0] = "격발 : [RMB]"; arItem.toolTips[1] = "재장전 : [E]"; arItem.toolTips[2] = "탄약 확인하기 : [Q]"; axeItem.toolTips[0] = "도끼 휘두르기 : [RMB]"; revolverItem.spawnPrefab.GetComponentInChildren<ScanNodeProperties>().headerText = "리볼버"; revolverAmmoItem.spawnPrefab.GetComponentInChildren<ScanNodeProperties>().headerText = "총알"; arItem.spawnPrefab.GetComponentInChildren<ScanNodeProperties>().headerText = "소총"; arMagItem.spawnPrefab.GetComponentInChildren<ScanNodeProperties>().headerText = "탄창"; bulbItem.spawnPrefab.GetComponentInChildren<ScanNodeProperties>().headerText = "전구"; chemicalItem.spawnPrefab.GetComponentInChildren<ScanNodeProperties>().headerText = "화학 약품"; } private void CreateShopItem() { if (translateKorean) { revolverAmmoItem.itemName = "총알"; revolverItem.itemName = "리볼버"; gummyFlashlight.itemName = "젤리 손전등"; arMagItem.itemName = "탄창"; arItem.itemName = "소총"; axeItem.itemName = "도끼"; chemicalItem.itemName = "화학 약품"; bulbItem.itemName = "전구"; } else { revolverAmmoItem.itemName = "Bullet"; revolverItem.itemName = "Revolver"; gummyFlashlight.itemName = "Gummy flashlight"; arMagItem.itemName = "Magazine"; arItem.itemName = "Rifle"; axeItem.itemName = "Axe"; } TerminalNode val = NewTerminalNode("리볼버를 주문하려고 합니다. 수량: [variableAmount]. \r\n아이템의 총 가격: [totalCost].\n\nCONFIRM 또는 DENY를 입력하세요.\n\n", "You have requested to order revolvers. Amount: [variableAmount]. \r\nTotal cost of items: [totalCost].\n\nPlease CONFIRM or DENY.\n\n"); TerminalNode val2 = NewTerminalNode("[variableAmount]개의 리볼버를 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n", "Ordered [variableAmount] revolvers. Your new balance is [playerCredits].\n\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\n\n"); TerminalNode val3 = NewTerminalNode("\n더욱 강력한 자기 보호를 위해!\n실린더를 열고 리볼버 탄약을 삽탄하여 장전하세요.\n\n", "\nFor more powerful self-defense!\nOpen the cylinder and insert revolver ammo to load it.\n\n"); TerminalNode val4 = NewTerminalNode("리볼버 탄약을 주문하려고 합니다. 수량: [variableAmount]. \r\n아이템의 총 가격: [totalCost].\n\nCONFIRM 또는 DENY를 입력하세요.\n\n", "You have requested to order revolver ammos. Amount: [variableAmount]. \r\nTotal cost of items: [totalCost].\n\nPlease CONFIRM or DENY.\n\n"); TerminalNode val5 = NewTerminalNode("[variableAmount]개의 리볼버 탄약을 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n", "Ordered [variableAmount] revolver ammos. Your new balance is [playerCredits].\n\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\n\n"); TerminalNode val6 = NewTerminalNode("\n리볼버에 장전하고 <b>치명적인</b> 순간에 격발하세요!\n\n", "\nLoad to your revolver and fire at LETHAL moments!\n\n"); TerminalNode val7 = NewTerminalNode("소총을 주문하려고 합니다. 수량: [variableAmount]. \r\n아이템의 총 가격: [totalCost].\n\nCONFIRM 또는 DENY를 입력하세요.\n\n", "You have requested to order rifles. Amount: [variableAmount]. \r\nTotal cost of items: [totalCost].\n\nPlease CONFIRM or DENY.\n\n"); TerminalNode val8 = NewTerminalNode("[variableAmount]개의 소총을 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n", "Ordered [variableAmount] rifles. Your new balance is [playerCredits].\n\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\n\n"); TerminalNode val9 = NewTerminalNode("\n더욱 강력한 자기 보호를 위해!\n탄창을 장전하여 사용하세요.\n\n", "\nFor more powerful self-defense!\nload magazine to fire it.\n\n"); TerminalNode val10 = NewTerminalNode("소총 탄창을 주문하려고 합니다. 수량: [variableAmount]. \r\n아이템의 총 가격: [totalCost].\n\nCONFIRM 또는 DENY를 입력하세요.\n\n", "You have requested to order rifle magazines. Amount: [variableAmount]. \r\nTotal cost of items: [totalCost].\n\nPlease CONFIRM or DENY.\n\n"); TerminalNode val11 = NewTerminalNode("[variableAmount]개의 소총 탄창을 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n", "Ordered [variableAmount] rifle magazines. Your new balance is [playerCredits].\n\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\n\n"); TerminalNode val12 = NewTerminalNode("\n소총에 장전하고 <b>치명적인</b> 순간에 격발하세요!\n\n", "\nLoad to your rifle and fire at LETHAL moments!\n\n"); TerminalNode val13 = NewTerminalNode("젤리 손전등을 주문하려고 합니다. 수량: [variableAmount]. \r\n아이템의 총 가격: [totalCost].\n\nCONFIRM 또는 DENY를 입력하세요.\n\n", "You have requested to order gummy flashlights. Amount: [variableAmount]. \r\nTotal cost of items: [totalCost].\n\nPlease CONFIRM or DENY.\n\n"); TerminalNode val14 = NewTerminalNode("[variableAmount]개의 젤리 손전등을 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n", "Ordered [variableAmount] gummy flashlights. Your new balance is [playerCredits].\n\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\n\n"); TerminalNode val15 = NewTerminalNode("\n자가발전 손전등입니다.\n그저 평범한 장난감이지만, 배터리가 다 떨어졌을 때 여러분의 어두운 앞길을 비춰 줄 것입니다!\n\n", "\nA self-powered flashlight.\nIt's just a toy, but it'll light up your dark path when the batteries run out!\n\n"); TerminalNode val16 = NewTerminalNode("도끼를 주문하려고 합니다. 수량: [variableAmount]. \r\n아이템의 총 가격: [totalCost].\n\nCONFIRM 또는 DENY를 입력하세요.\n\n", "You have requested to order Axe. Amount: [variableAmount]. \r\nTotal cost of items: [totalCost].\n\nPlease CONFIRM or DENY.\n\n"); TerminalNode val17 = NewTerminalNode("[variableAmount] 도끼를 주문했습니다. 당신의 현재 소지금은 [playerCredits]입니다.\n\n우리의 계약자는 작업 중에도 빠른 무료 배송 혜택을 누릴 수 있습니다! 구매한 모든 상품은 1시간마다 대략적인 위치에 도착합니다.\n\n", "Ordered [variableAmount] Axe. Your new balance is [playerCredits].\n\nOur contractors enjoy fast, free shipping while on the job! Any purchased items will arrive hourly at your approximate location.\n\n"); TerminalNode val18 = NewTerminalNode("\n일반적인 도끼입니다.\n자기 방어 도구로도 사용할 수 있습니다\n\n", "\nJust an Axe.\nUsable as a defense tool\n\n"); if (revolverPrice > -1) { Items.RegisterShopItem(revolverItem, val, val2, val3, revolverPrice); } if (revolverAmmoPrice > -1) { Items.RegisterShopItem(revolverAmmoItem, val4, val5, val6, revolverAmmoPrice); } if (gummyLightPrice > -1) { Items.RegisterShopItem(gummyFlashlight, val13, val14, val15, gummyLightPrice); } if (riflePrice > -1) { Items.RegisterShopItem(arItem, val7, val8, val9, riflePrice); } if (rifleMagPrice > -1) { Items.RegisterShopItem(arMagItem, val10, val11, val12, rifleMagPrice); } if (rifleMagPrice > -1) { Items.RegisterShopItem(arMagItem, val10, val11, val12, rifleMagPrice); } if (axePrice > -1) { Items.RegisterShopItem(axeItem, val16, val17, val18, axePrice); } } public TerminalNode NewTerminalNode(string korean, string english) { TerminalNode val = ScriptableObject.CreateInstance<TerminalNode>(); if (translateKorean) { val.displayText = korean; } else { val.displayText = english; } val.clearPreviousText = true; val.maxCharactersToType = 15; val.buyRerouteToMoon = -1; val.displayPlanetInfo = -1; val.shipUnlockableID = -1; val.creatureFileID = -1; val.storyLogFileID = -1; return val; } } public class PVInputActions : LcInputActions { [InputAction(/*Could not decode attribute arguments.*/)] public InputAction RifleReloadKey { get; set; } } } namespace PiggyVarietyMod.Patches { public class AxeItem : GrabbableObject { [CompilerGenerated] private sealed class <reelUpAxe>d__14 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public AxeItem <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <reelUpAxe>d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((GrabbableObject)<>4__this).playerHeldBy.activatingItem = true; ((GrabbableObject)<>4__this).playerHeldBy.twoHanded = true; ((GrabbableObject)<>4__this).playerHeldBy.playerBodyAnimator.ResetTrigger("axeHit"); ((GrabbableObject)<>4__this).playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true); <>4__this.axeAudio.PlayOneShot(<>4__this.reelUp); <>4__this.ReelUpSFXServerRpc(); <>2__current = (object)new WaitForSeconds(0.35f); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitUntil((Func<bool>)(() => !<>4__this.isHoldingButton || !((GrabbableObject)<>4__this).isHeld)); <>1__state = 2; return true; case 2: <>1__state = -1; <>4__this.SwingAxe(!((GrabbableObject)<>4__this).isHeld); <>2__current = (object)new WaitForSeconds(0.13f); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 4; return true; case 4: <>1__state = -1; <>4__this.HitAxe(!((GrabbableObject)<>4__this).isHeld); <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 5; return true; case 5: <>1__state = -1; <>4__this.reelingUp = false; <>4__this.reelingUpCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public int axeHitForce = 2; public bool reelingUp; public bool isHoldingButton; private Coroutine reelingUpCoroutine; private RaycastHit[] objectsHitByAxe; private List<RaycastHit> objectsHitByAxeList = new List<RaycastHit>(); public AudioClip reelUp; public AudioClip swing; public AudioClip[] hitSFX; public AudioSource axeAudio; private PlayerControllerB previousPlayerHeldBy; private int axeMask = 11012424; public override void Start() { ((GrabbableObject)this).Start(); } public override void ItemActivate(bool used, bool buttonDown = true) { if ((Object)(object)base.playerHeldBy == (Object)null) { return; } Debug.Log((object)$"Is player pressing down button?: {buttonDown}"); isHoldingButton = buttonDown; Debug.Log((object)("PLAYER ACTIVATED ITEM TO HIT WITH AXE. Who sent this log: " + ((Object)((Component)GameNetworkManager.Instance.localPlayerController).gameObject).name)); if (!reelingUp && buttonDown) { reelingUp = true; previousPlayerHeldBy = base.playerHeldBy; Debug.Log((object)$"Set previousPlayerHeldBy: {previousPlayerHeldBy}"); if (reelingUpCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine); } reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(reelUpAxe()); } } [IteratorStateMachine(typeof(<reelUpAxe>d__14))] private IEnumerator reelUpAxe() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <reelUpAxe>d__14(0) { <>4__this = this }; } [ServerRpc] public void ReelUpSFXServerRpc() { ReelUpSFXClientRpc(); } [ClientRpc] public void ReelUpSFXClientRpc() { if (!((NetworkBehaviour)this).IsOwner) { axeAudio.PlayOneShot(reelUp); } } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.activatingItem = false; } ((GrabbableObject)this).DiscardItem(); } public void SwingAxe(bool cancel = false) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false); if (!cancel) { axeAudio.PlayOneShot(swing); previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false); } } public void HitAxe(bool cancel = false) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_052c: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0229: 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_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_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_024c: 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_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: 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_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_02a4: 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_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0364: 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_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)previousPlayerHeldBy == (Object)null) { Debug.LogError((object)"Previousplayerheldby is null on this client when HitAxe is called."); return; } previousPlayerHeldBy.activatingItem = false; bool flag = false; bool flag2 = false; bool flag3 = false; int num = -1; if (!cancel) { previousPlayerHeldBy.twoHanded = false; objectsHitByAxe = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.8f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.5f, axeMask, (QueryTriggerInteraction)2); objectsHitByAxeList = objectsHitByAxe.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList(); List<EnemyAI> list = new List<EnemyAI>(); IHittable val2 = default(IHittable); RaycastHit val3 = default(RaycastHit); for (int i = 0; i < objectsHitByAxeList.Count; i++) { Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward; RaycastHit val = objectsHitByAxeList[i]; if (((Component)((RaycastHit)(ref val)).transform).TryGetComponent<IHittable>(ref val2)) { val = objectsHitByAxeList[i]; if (!((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform)) { val = objectsHitByAxeList[i]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; val = objectsHitByAxeList[i]; if (Physics.Linecast(position, ((RaycastHit)(ref val)).point, ref val3, StartOfRound.Instance.walkableSurfacesMask, (QueryTriggerInteraction)1)) { goto IL_0221; } } val = objectsHitByAxeList[i]; TerrainObstacleTrigger componentInChildren = ((Component)((RaycastHit)(ref val)).collider).GetComponentInChildren<TerrainObstacleTrigger>(); if ((Object)(object)componentInChildren != (Object)null && ((NetworkBehaviour)this).IsOwner) { RoundManager.Instance.DestroyTreeOnLocalClient(((Component)componentInChildren).transform.position); } } } goto IL_0221; IL_0221: val = objectsHitByAxeList[i]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 8) { val = objectsHitByAxeList[i]; if (((Component)((RaycastHit)(ref val)).transform).gameObject.layer != 11) { val = objectsHitByAxeList[i]; if (!((Component)((RaycastHit)(ref val)).transform).TryGetComponent<IHittable>(ref val2)) { continue; } val = objectsHitByAxeList[i]; if ((Object)(object)((RaycastHit)(ref val)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val = objectsHitByAxeList[i]; if (!(((RaycastHit)(ref val)).point == Vector3.zero)) { Vector3 position2 = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; val = objectsHitByAxeList[i]; if (Physics.Linecast(position2, ((RaycastHit)(ref val)).point, ref val3, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { continue; } } flag = true; try { val = objectsHitByAxeList[i]; EnemyAICollisionDetect component = ((Component)((RaycastHit)(ref val)).collider).GetComponent<EnemyAICollisionDetect>(); if ((Object)(object)component != (Object)null) { if ((Object)(object)component.mainScript == (Object)null || list.Contains(component.mainScript)) { continue; } goto IL_045c; } val = objectsHitByAxeList[i]; if (!((Object)(object)((Component)((RaycastHit)(ref val)).transform).GetComponent<PlayerControllerB>() != (Object)null)) { goto IL_045c; } if (flag3) { continue; } flag3 = true; goto IL_045c; IL_045c: bool flag4 = val2.Hit(axeHitForce, forward, previousPlayerHeldBy, true, 1); if (flag4 && (Object)(object)component != (Object)null) { list.Add(component.mainScript); } if (!flag2) { flag2 = flag4; } } catch (Exception arg) { Debug.Log((object)$"Exception caught when hitting object with axe from player #{previousPlayerHeldBy.playerClientId}: {arg}"); } continue; } } val = objectsHitByAxeList[i]; if (((RaycastHit)(ref val)).collider.isTrigger) { continue; } flag = true; val = objectsHitByAxeList[i]; string tag = ((Component)((RaycastHit)(ref val)).collider).gameObject.tag; for (int j = 0; j < StartOfRound.Instance.footstepSurfaces.Length; j++) { if (StartOfRound.Instance.footstepSurfaces[j].surfaceTag == tag) { num = j; break; } } } } if (flag) { RoundManager.PlayRandomClip(axeAudio, hitSFX, true, 1f, 0, 1000); Object.FindObjectOfType<RoundManager>().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); if (!flag2 && num != -1) { axeAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(axeAudio, StartOfRound.Instance.footstepSurfaces[num].hitSurfaceSFX, 1f); } base.playerHeldBy.playerBodyAnimator.SetTrigger("axeHit"); HitAxeServerRpc(num); } } [ServerRpc] public void HitAxeServerRpc(int hitSurfaceID) { HitAxeClientRpc(hitSurfaceID); } [ClientRpc] public void HitAxeClientRpc(int hitSurfaceID) { if (!((NetworkBehaviour)this).IsOwner) { RoundManager.PlayRandomClip(axeAudio, hitSFX, true, 1f, 0, 1000); if (hitSurfaceID != -1) { HitSurfaceWithAxe(hitSurfaceID); } } } private void HitSurfaceWithAxe(int hitSurfaceID) { axeAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(axeAudio, StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX, 1f); } } public class CustomTouchInteractTrigger : MonoBehaviour { public bool isIdleTrigger; public bool isKillTrigger; public TeslaGate teslaGate; private void OnTriggerEnter(Collider collider) { //IL_01e5: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB component = ((Component)collider).GetComponent<PlayerControllerB>(); if ((Object)(object)component != (Object)null) { Plugin.mls.LogInfo((object)("Tesla gate detected player: " + component.playerUsername + ", Idle: " + isIdleTrigger + ", Kill: " + isKillTrigger)); if (!component.isPlayerDead) { if (isIdleTrigger) { teslaGate.activatePlayerList.Add(component); teslaGate.activateList.Add(((Component)collider).gameObject); } else if (!isIdleTrigger && !isKillTrigger) { teslaGate.engagingPlayerList.Add(component); teslaGate.engagingList.Add(((Component)collider).gameObject); } } } EnemyAICollisionDetect component2 = ((Component)collider).GetComponent<EnemyAICollisionDetect>(); IHittable val = default(IHittable); if ((Object)(object)component2 != (Object)null && ((Component)((Component)component2).transform).TryGetComponent<IHittable>(ref val)) { Plugin.mls.LogInfo((object)("Tesla gate detected enemy: " + component2.mainScript.enemyType.enemyName + ", Idle: " + isIdleTrigger + ", Kill: " + isKillTrigger)); if (isKillTrigger && (Object)(object)component2 != (Object)null && (Object)(object)component2.mainScript != (Object)null && ((NetworkBehaviour)component2.mainScript).IsOwner && component2.mainScript.enemyType.canDie && !component2.mainScript.isEnemyDead) { val.Hit(5, Vector3.zero, (PlayerControllerB)null, true, -1); } } } private void OnTriggerStay(Collider collider) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) if (!isKillTrigger) { return; } PlayerControllerB component = ((Component)collider).GetComponent<PlayerControllerB>(); if ((Object)(object)component != (Object)null && (Object)(object)component == (Object)(object)GameNetworkManager.Instance.localPlayerController && !component.isPlayerDead) { GameNetworkManager.Instance.localPlayerController.KillPlayer(Vector3.down * 17f, true, (CauseOfDeath)11, 0, default(Vector3)); return; } EnemyAICollisionDetect component2 = ((Component)collider).GetComponent<EnemyAICollisionDetect>(); if ((Object)(object)component2 != (Object)null && (Object)(object)component2.mainScript != (Object)null && ((NetworkBehaviour)component2.mainScript).IsOwner && component2.mainScript.enemyType.canDie && !component2.mainScript.isEnemyDead) { component2.mainScript.KillEnemyOnOwnerClient(false); } } private void OnTriggerExit(Collider collider) { PlayerControllerB component = ((Component)collider).GetComponent<PlayerControllerB>(); if ((Object)(object)component != (Object)null) { teslaGate.engagingPlayerList.Remove(component); teslaGate.engagingList.Remove(((Component)collider).gameObject); if (isIdleTrigger) { teslaGate.activatePlayerList.Remove(component); teslaGate.activateList.Remove(((Component)collider).gameObject); } } } } [HarmonyPatch(typeof(Dungeon))] internal class DungeonPatch { [HarmonyPrefix] [HarmonyPatch("SpawnDoorPrefab")] private static void SpawnDoorPrefab_Prefix(Doorway a, Doorway b, RandomStream randomStream) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Expected O, but got Unknown for (int i = 0; i < a.ConnectorPrefabWeights.Count; i++) { GameObjectWeight val = a.ConnectorPrefabWeights[i]; if (((Object)val.GameObject).name == "TeslaGateSpawn") { return; } if (((Object)val.GameObject).name == "BigDoorSpawn") { GameObjectWeight val2 = new GameObjectWeight(); a.ConnectorPrefabWeights.Add(val2); val2.Weight = 0.05f * Plugin.teslaSpawnWeight; val2.GameObject = Plugin.teslaGateSpawn; Plugin.mls.LogInfo((object)("added tesla to " + ((Object)((Component)a).gameObject).name)); } } for (int j = 0; j < b.ConnectorPrefabWeights.Count; j++) { GameObjectWeight val3 = b.ConnectorPrefabWeights[j]; if (((Object)val3.GameObject).name == "TeslaGateSpawn") { break; } if (((Object)val3.GameObject).name == "BigDoorSpawn") { GameObjectWeight val4 = new GameObjectWeight(); b.ConnectorPrefabWeights.Add(val4); val4.Weight = 0.07f * Plugin.teslaSpawnWeight; val4.GameObject = Plugin.teslaGateSpawn; Plugin.mls.LogInfo((object)("added tesla to " + ((Object)((Component)b).gameObject).name)); } } } } public class GummylightItem : GrabbableObject { [Space(15f)] public bool usingPlayerHelmetLight; public int flashlightInterferenceLevel; public static int globalFlashlightInterferenceLevel; public Light flashlightBulb; public Light flashlightBulbGlow; public AudioSource flashlightAudio; public AudioClip[] flashlightClips; public AudioClip outOfBatteriesClip; public AudioClip flashlightFlicker; public Material bulbLight; public Material bulbDark; public MeshRenderer flashlightMesh; public int flashlightTypeID; public bool changeMaterial = true; private float initialIntensity; private PlayerControllerB previousPlayerHeldBy; public override void Start() { base.useCooldown = 0.12f; base.itemProperties = Plugin.gummyFlashlight; base.mainObjectRenderer = ((Component)((Component)this).transform.GetChild(2)).GetComponent<MeshRenderer>(); base.insertedBattery.charge = 1f; base.grabbableToEnemies = true; flashlightBulb = ((Component)((Component)this).transform.GetChild(0)).GetComponent<Light>(); flashlightBulbGlow = ((Component)((Component)this).transform.GetChild(1)).GetComponent<Light>(); flashlightAudio = ((Component)this).GetComponent<AudioSource>(); flashlightClips = (AudioClip[])(object)new AudioClip[1] { Plugin.gummylightClick }; outOfBatteriesClip = Plugin.gummylightOutage; flashlightFlicker = Plugin.flashFlicker; bulbLight = Plugin.flashlightBulb; bulbDark = Plugin.blackRubber; flashlightMesh = ((Component)((Component)this).transform.GetChild(2)).GetComponent<MeshRenderer>(); changeMaterial = true; base.isInFactory = true; base.grabbable = true; flashlightTypeID = 0; base.itemProperties.batteryUsage = 60f; Object.Destroy((Object)(object)((Component)this).GetComponent<FlashlightItem>()); ((GrabbableObject)this).Start(); initialIntensity = flashlightBulb.intensity; } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (flashlightInterferenceLevel < 2) { SwitchFlashlight(used); } flashlightAudio.PlayOneShot(flashlightClips[Random.Range(0, flashlightClips.Length)]); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 7f, 0.4f, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); } public override void UseUpBatteries() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).UseUpBatteries(); SwitchFlashlight(on: false); flashlightAudio.PlayOneShot(outOfBatteriesClip, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 13f, 0.65f, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); } public override void PocketItem() { previousPlayerHeldBy.equippedUsableItemQE = false; if (!((NetworkBehaviour)this).IsOwner) { ((GrabbableObject)this).PocketItem(); return; } if ((Object)(object)previousPlayerHeldBy != (Object)null) { ((Behaviour)flashlightBulb).enabled = false; ((Behaviour)flashlightBulbGlow).enabled = false; if (base.isBeingUsed && ((Object)(object)previousPlayerHeldBy.ItemSlots[previousPlayerHeldBy.currentItemSlot] == (Object)null || previousPlayerHeldBy.ItemSlots[previousPlayerHeldBy.currentItemSlot].itemProperties.itemId != 1 || previousPlayerHeldBy.ItemSlots[previousPlayerHeldBy.currentItemSlot].itemProperties.itemId != 6)) { ((Behaviour)previousPlayerHeldBy.helmetLight).enabled = true; previousPlayerHeldBy.pocketedFlashlight = (GrabbableObject)(object)this; usingPlayerHelmetLight = true; PocketFlashlightServerRpc(stillUsingFlashlight: true); } else { base.isBeingUsed = false; usingPlayerHelmetLight = false; ((Behaviour)flashlightBulbGlow).enabled = false; SwitchFlashlight(on: false); PocketFlashlightServerRpc(); } } else { Debug.Log((object)"Could not find what player was holding this flashlight item"); } if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; } ((GrabbableObject)this).PocketItem(); } [ServerRpc] public void PocketFlashlightServerRpc(bool stillUsingFlashlight = false) { PocketFlashlightClientRpc(stillUsingFlashlight); } [ClientRpc] public void PocketFlashlightClientRpc(bool stillUsingFlashlight) { if (((NetworkBehaviour)this).IsOwner) { return; } ((Behaviour)flashlightBulb).enabled = false; ((Behaviour)flashlightBulbGlow).enabled = false; if (stillUsingFlashlight) { if (!((Object)(object)previousPlayerHeldBy == (Object)null)) { ((Behaviour)previousPlayerHeldBy.helmetLight).enabled = true; previousPlayerHeldBy.pocketedFlashlight = (GrabbableObject)(object)this; usingPlayerHelmetLight = true; } } else { base.isBeingUsed = false; usingPlayerHelmetLight = false; ((Behaviour)flashlightBulbGlow).enabled = false; SwitchFlashlight(on: false); } } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.equippedUsableItemQE = false; } if ((Object)(object)previousPlayerHeldBy != (Object)null) { ((Behaviour)previousPlayerHeldBy.helmetLight).enabled = false; ((Behaviour)flashlightBulb).enabled = base.isBeingUsed; ((Behaviour)flashlightBulbGlow).enabled = base.isBeingUsed; } ((GrabbableObject)this).DiscardItem(); } public override void EquipItem() { previousPlayerHeldBy = base.playerHeldBy; base.playerHeldBy.equippedUsableItemQE = true; base.playerHeldBy.ChangeHelmetLight(flashlightTypeID, true); ((Behaviour)base.playerHeldBy.helmetLight).enabled = false; usingPlayerHelmetLight = false; if (base.isBeingUsed) { SwitchFlashlight(on: true); } ((GrabbableObject)this).EquipItem(); } public void SwitchFlashlight(bool on) { base.isBeingUsed = on; if (!((NetworkBehaviour)this).IsOwner) { Debug.Log((object)$"Flashlight click. playerheldby null?: {(Object)(object)base.playerHeldBy != (Object)null}"); Debug.Log((object)$"Flashlight being disabled or enabled: {on}"); if ((Object)(object)base.playerHeldBy != (Object)null) { base.playerHeldBy.ChangeHelmetLight(flashlightTypeID, on); } ((Behaviour)flashlightBulb).enabled = false; ((Behaviour)flashlightBulbGlow).enabled = false; } else { ((Behaviour)flashlightBulb).enabled = on; ((Behaviour)flashlightBulbGlow).enabled = on; } if (usingPlayerHelmetLight && (Object)(object)base.playerHeldBy != (Object)null) { ((Behaviour)base.playerHeldBy.helmetLight).enabled = on; } if (changeMaterial) { Material[] sharedMaterials = ((Renderer)flashlightMesh).sharedMaterials; if (on) { sharedMaterials[1] = bulbLight; } else { sharedMaterials[1] = bulbDark; } ((Renderer)flashlightMesh).sharedMaterials = sharedMaterials; } } public override void Update() { //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0255: 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_0207: Unknown result type (might be due to invalid IL or missing references) if (base.currentUseCooldown >= 0f) { base.currentUseCooldown -= Time.deltaTime; } if (((NetworkBehaviour)this).IsOwner) { if ((base.isBeingUsed && base.itemProperties.requiresBattery) || ((Behaviour)flashlightBulb).enabled) { base.isBeingUsed = true; if (base.insertedBattery.charge > 0f) { if (!base.itemProperties.itemIsTrigger) { Battery insertedBattery = base.insertedBattery; insertedBattery.charge -= Time.deltaTime / base.itemProperties.batteryUsage; } } else if (!base.insertedBattery.empty) { base.insertedBattery.empty = true; if (base.isBeingUsed) { Debug.Log((object)"Use up batteries local"); base.isBeingUsed = false; ((GrabbableObject)this).UseUpBatteries(); base.isSendingItemRPC++; ((GrabbableObject)this).UseUpItemBatteriesServerRpc(); } } } if (!base.wasOwnerLastFrame) { base.wasOwnerLastFrame = true; } } else if (base.wasOwnerLastFrame) { base.wasOwnerLastFrame = false; } if (!base.isHeld && (Object)(object)base.parentObject == (Object)null) { if (base.fallTime >= 1f) { if (!base.reachedFloorTarget) { if (!base.hasHitGround) { ((GrabbableObject)this).PlayDropSFX(); ((GrabbableObject)this).OnHitGround(); } base.reachedFloorTarget = true; if (base.floorYRot == -1) { ((Component)this).transform.rotation = Quaternion.Euler(base.itemProperties.restingRotation.x, ((Component)this).transform.eulerAngles.y, base.itemProperties.restingRotation.z); } else { ((Component)this).transform.rotation = Quaternion.Euler(base.itemProperties.restingRotation.x, (float)(base.floorYRot + base.itemProperties.floorYOffset) + 90f, base.itemProperties.restingRotation.z); } } ((Component)this).transform.localPosition = base.targetFloorPosition; return; } base.reachedFloorTarget = false; ((GrabbableObject)this).FallWithCurve(); if (((Component)this).transform.localPosition.y - base.targetFloorPosition.y < 0.05f && !base.hasHitGround) { ((GrabbableObject)this).PlayDropSFX(); ((GrabbableObject)this).OnHitGround(); return; } } else if (base.isHeld || base.isHeldByEnemy) { base.reachedFloorTarget = false; } int num = ((flashlightInterferenceLevel <= globalFlashlightInterferenceLevel) ? globalFlashlightInterferenceLevel : flashlightInterferenceLevel); if (num >= 2) { flashlightBulb.intensity = 0f; } else if (num == 1) { flashlightBulb.intensity = Random.Range(0f, 200f); } else { flashlightBulb.intensity = initialIntensity; } } public override void ItemInteractLeftRight(bool right) { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)$"r/l activate: {right}"); if (!right && (Object)(object)base.playerHeldBy != (Object)null) { flashlightAudio.PlayOneShot(Plugin.flashlightShake); WalkieTalkie.TransmitOneShotAudio(flashlightAudio, Plugin.flashlightShake, 1f); base.playerHeldBy.playerBodyAnimator.SetTrigger("shakeItem"); float num = base.insertedBattery.charge * 100f + 8f; if (num <= 100f) { ((GrabbableObject)this).SyncBatteryServerRpc((int)num); } else { ((GrabbableObject)this).SyncBatteryServerRpc(100); } if (((NetworkBehaviour)this).IsOwner) { RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 5f, 0.2f, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 941); } base.isBeingUsed = false; } } } public class M4Item : GrabbableObject { [CompilerGenerated] private sealed class <CheckAmmoGunAnimation>d__48 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public M4Item <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CheckAmmoGunAnimation>d__48(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((GrabbableObject)<>4__this).playerHeldBy.playerBodyAnimator.SetTrigger("InspectM4"); <>4__this.isInspecting = true; <>4__this.gunAudio.PlayOneShot(<>4__this.gunInspectSFX); if ((Object)(object)((GrabbableObject)<>4__this).playerHeldBy == (Object)(object)StartOfRound.Instance.localPlayerController) { WalkieTalkie.TransmitOneShotAudio(<>4__this.gunAudio, <>4__this.gunInspectSFX, 1f); } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; if (Plugin.translateKorean) { <>4__this.KR_SetAmmoControlTip(isChecking: true); } else { <>4__this.SetAmmoControlTip(isChecking: true); } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 2; return true; case 2: <>1__state = -1; <>4__this.isInspecting = 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(); } } [CompilerGenerated] private sealed class <FireDelay>d__41 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public M4Item <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FireDelay>d__41(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.cantFire = true; <>2__current = (object)new WaitForSeconds(0.07f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.cantFire = 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(); } } [CompilerGenerated] private sealed class <ReloadGunAnimation>d__51 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public M4Item <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ReloadGunAnimation>d__51(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((GrabbableObject)<>4__this).playerHeldBy.playerBodyAnimator.SetTrigger("ReloadM4"); <>4__this.gunAnimator.SetTrigger("Reloading"); <>4__this.isReloading = true; <>4__this.gunAudio.PlayOneShot(<>4__this.gunReloadSFX); if ((Object)(object)((GrabbableObject)<>4__this).playerHeldBy == (Object)(object)StartOfRound.Instance.localPlayerController) { WalkieTalkie.TransmitOneShotAudio(<>4__this.gunAudio, <>4__this.gunReloadSFX, 1f); } <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; case 1: <>1__state = -1; if (<>4__this.isReloading) { if ((Object)(object)((GrabbableObject)<>4__this).playerHeldBy == (Object)(object)StartOfRound.Instance.localPlayerController && !Plugin.customGunInfinityAmmo) { ((GrabbableObject)<>4__this).playerHeldBy.DestroyItemInSlotAndSync(<>4__this.ammoSlotToUse); } <>4__this.ammoSlotToUse = -1; <>4__this.ammosLoaded = 30; if (Plugin.translateKorean) { <>4__this.KR_SetAmmoControlTip(isChecking: true); } else { <>4__this.SetAmmoControlTip(isChecking: true); } } <>2__current = (object)new WaitForSeconds(0.55f); <>1__state = 2; return true; case 2: <>1__state = -1; <>4__this.isReloading = 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(); } } private bool isCrouching; private bool isJumping; private bool isWalking; private bool isSprinting; private AnimatorStateInfo currentStateInfo; private float currentAnimationTime; public int gunCompatibleAmmoID = 1410; public bool isReloading; public bool isInspecting; public bool cantFire; public bool isFiring; public int ammosLoaded; public Animator gunAnimator; public AudioSource gunAudio; public AudioSource gunShootAudio; public AudioSource gunBulletsRicochetAudio; public AudioClip gunShootSFX; public AudioClip gunReloadSFX; public AudioClip gunInspectSFX; public AudioClip noAmmoSFX; private int ammoSlotToUse = -1; private bool localClientSendingShootGunRPC; private bool localClientSendingReloadGunRPC; private PlayerControllerB previousPlayerHeldBy; public ParticleSystem gunShootParticle; public Transform gunRayPoint; private RaycastHit[] enemyColliders; private RaycastHit[] playerColliders; private EnemyAI heldByEnemy; public override void Start() { ((GrabbableObject)this).Start(); } public override int GetItemDataToSave() { ((GrabbableObject)this).GetItemDataToSave(); return ammosLoaded; } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); ammosLoaded = saveData; } public override void Update() { ((GrabbableObject)this).Update(); if (!((Object)(object)base.playerHeldBy == (Object)null)) { if (!isInspecting && isFiring && !isReloading && !cantFire && !base.playerHeldBy.playerBodyAnimator.GetBool("ReloadM4") && ammosLoaded > 0) { ShootGunAndSync(heldByPlayer: true); } if (Plugin.InputActionInstance.RifleReloadKey.triggered && !isReloading && ammosLoaded < 30) { StartReloadGunAndSync(); } } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); previousPlayerHeldBy = base.playerHeldBy; previousPlayerHeldBy.equippedUsableItemQE = true; if ((Object)(object)base.playerHeldBy != (Object)null) { UpdateAnimator(base.playerHeldBy, base.playerHeldBy.playerBodyAnimator, restore: false); } if (Plugin.translateKorean) { KR_SetAmmoControlTip(isChecking: false); } else { SetAmmoControlTip(isChecking: false); } } public override void GrabItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { UpdateAnimator(base.playerHeldBy, base.playerHeldBy.playerBodyAnimator, restore: false); } ((GrabbableObject)this).GrabItem(); } public override void GrabItemFromEnemy(EnemyAI enemy) { ((GrabbableObject)this).GrabItemFromEnemy(enemy); heldByEnemy = enemy; } public override void DiscardItemFromEnemy() { ((GrabbableObject)this).DiscardItemFromEnemy(); heldByEnemy = null; } public override void ItemActivate(bool used, bool buttonDown = false) { Debug.Log((object)buttonDown); isFiring = buttonDown; if (!isInspecting && !isReloading && !cantFire && !base.playerHeldBy.playerBodyAnimator.GetBool("ReloadM4") && ammosLoaded <= 0) { gunAudio.PlayOneShot(noAmmoSFX); } } 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 gunPosition; Vector3 forward; if (!heldByPlayer) { gunPosition = gunRayPoint.position; forward = gunRayPoint.forward; } else { gunPosition = ((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(gunPosition, forward); Debug.Log((object)"Calling shoot gun and sync"); localClientSendingShootGunRPC = true; ShootGunServerRpc(gunPosition, forward); } [ServerRpc(RequireOwnership = false)] public void ShootGunServerRpc(Vector3 gunPosition, Vector3 gunForward) { //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(gunPosition, gunForward); } [ClientRpc] public void ShootGunClientRpc(Vector3 gunPosition, Vector3 gunForward) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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(gunPosition, gunForward); } } [IteratorStateMachine(typeof(<FireDelay>d__41))] public IEnumerator FireDelay() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FireDelay>d__41(0) { <>4__this = this }; } public void ShootGun(Vector3 gunPosition, Vector3 gunForward) { //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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_01be: 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_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0208: 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_0255: 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_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_05ac: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_0649: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_0752: Unknown result type (might be due to invalid IL or missing references) //IL_075c: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Unknown result type (might be due to invalid IL or missing references) //IL_070a: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) if (Plugin.translateKorean) { KR_SetAmmoControlTip(isChecking: false); } else { SetAmmoControlTip(isChecking: false); } CentipedeAI[] array = Object.FindObjectsByType<CentipedeAI>((FindObjectsSortMode)0); FlowerSnakeEnemy[] array2 = Object.FindObjectsByType<FlowerSnakeEnemy>((FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i].clingingToPlayer == (Object)(object)base.playerHeldBy) { ((EnemyAI)array[i]).HitEnemy(2, base.playerHeldBy, true, -1); } } for (int j = 0; j < array2.Length; j++) { if ((Object)(object)array2[j].clingingToPlayer == (Object)(object)base.playerHeldBy) { ((EnemyAI)array2[j]).HitEnemy(2, base.playerHeldBy, true, -1); } } ((MonoBehaviour)this).StartCoroutine(FireDelay()); if (base.isHeld && (Object)(object)base.playerHeldBy != (Object)null && (Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { base.playerHeldBy.playerBodyAnimator.SetTrigger("ShootM4"); } gunAnimator.SetTrigger("Fire"); gunShootAudio.PlayOneShot(gunShootSFX); WalkieTalkie.TransmitOneShotAudio(gunShootAudio, gunShootSFX, 1f); gunShootParticle.Play(true); ammosLoaded = Mathf.Clamp(ammosLoaded - 1, 0, 30); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { return; } float num = Vector3.Distance(((Component)localPlayerController).transform.position, ((Component)gunRayPoint).transform.position); Vector3 val = localPlayerController.playerCollider.ClosestPoint(gunPosition); if (num < 12f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } Ray val2 = default(Ray); ((Ray)(ref val2))..ctor(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)base.playerHeldBy.gameplayCamera).transform.forward); if (enemyColliders == null) { enemyColliders = (RaycastHit[])(object)new RaycastHit[35]; } RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((Component)base.playerHeldBy.gameplayCamera).transform.forward, ref val3, float.PositiveInfinity, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { ((Component)gunBulletsRicochetAudio).transform.position = ((Ray)(ref val2)).GetPoint(((RaycastHit)(ref val3)).distance - 0.5f); gunBulletsRicochetAudio.Play(); } if ((Object)(object)base.playerHeldBy == (Object)(object)StartOfRound.Instance.localPlayerController) { int num2 = Physics.SphereCastNonAlloc(val2, 0.25f, enemyColliders, float.PositiveInfinity, 524288, (QueryTriggerInteraction)2); IHittable val4 = default(IHittable); for (int k = 0; k < num2; k++) { Debug.Log((object)"Raycasting enemy"); if (!Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref enemyColliders[k])).transform).GetComponent<EnemyAICollisionDetect>())) { continue; } EnemyAI mainScript = ((Component)((RaycastHit)(ref enemyColliders[k])).transform).GetComponent<EnemyAICollisionDetect>().mainScript; if ((Object)(object)heldByEnemy != (Object)null && (Object)(object)heldByEnemy == (Object)(object)mainScript) { Debug.Log((object)"Rifle is held by enemy, skipping enemy raycast"); continue; } Debug.Log((object)("Hit enemy " + mainScript.enemyType.enemyName)); if (((RaycastHit)(ref enemyColliders[k])).distance == 0f) { Debug.Log((object)"Spherecast started inside enemy collider"); } else if (Physics.Linecast(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((RaycastHit)(ref enemyColliders[k])).point, ref val3, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { Debug.DrawRay(((RaycastHit)(ref val3)).point, Vector3.up, Color.red, 15f); Debug.DrawLine(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((RaycastHit)(ref enemyColliders[k])).point, Color.cyan, 15f); Plugin.mls.LogInfo((object)("Raycast hit wall: " + ((Object)((Component)((RaycastHit)(ref val3)).collider).gameObject).name + ", distance: " + ((RaycastHit)(ref val3)).distance)); } else if (((Component)((RaycastHit)(ref enemyColliders[k])).transform).TryGetComponent<IHittable>(ref val4)) { Vector3 forward = ((Component)base.playerHeldBy.gameplayCamera).transform.forward; float num3 = Vector3.Distance(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((RaycastHit)(ref enemyColliders[k])).point); Plugin.mls.LogInfo((object)("Damage to enemy, damage: " + Plugin.rifleMonsterDamage + ", distance:" + num3)); val4.Hit(Plugin.rifleMonsterDamage, forward, base.playerHeldBy, true, -1); } else { Plugin.mls.LogInfo((object)("Could not get hittable script from collider, transform: " + ((Object)((RaycastHit)(ref enemyColliders[k])).transform).name)); } } } if (playerColliders == null) { playerColliders = (RaycastHit[])(object)new RaycastHit[10]; } int num4 = Physics.SphereCastNonAlloc(val2, 0.3f, playerColliders, float.PositiveInfinity, StartOfRound.Instance.collidersRoomMaskDefaultAndPlayers, (QueryTriggerInteraction)2); for (int l = 0; l < num4; l++) { if ((Object)(object)((Component)((RaycastHit)(ref playerColliders[l])).transform).GetComponent<PlayerControllerB>() != (Object)null && (Object)(object)((Component)((RaycastHit)(ref playerColliders[l])).transform).GetComponent<PlayerControllerB>() != (Object)(object)base.playerHeldBy) { float num5 = Vector3.Distance(((Component)base.playerHeldBy.gameplayCamera).transform.position, ((RaycastHit)(ref playerColliders[l])).point); if (num5 < 10f) { ((Component)((RaycastHit)(ref playerColliders[l])).transform).GetComponent<PlayerControllerB>().DamagePlayer(Plugin.rifleMaxPlayerDamage, true, true, (CauseOfDeath)7, 0, false, ((Component)base.playerHeldBy.gameplayCamera).transform.forward * 30f); } else if (num5 < 25f) { ((Component)((RaycastHit)(ref playerColliders[l])).transform).GetComponent<PlayerControllerB>().DamagePlayer(Mathf.RoundToInt((float)(Plugin.rifleMaxPlayerDamage - Plugin.rifleMaxPlayerDamage / 3)), true, true, (CauseOfDeath)7, 0, false, ((Component)base.playerHeldBy.gameplayCamera).transform.forward * 30f); } else { ((Component)((RaycastHit)(ref playerColliders[l])).transform).GetComponent<PlayerControllerB>().DamagePlayer(Mathf.RoundToInt((float)(Plugin.rifleMaxPlayerDamage / 3)), true, true, (CauseOfDeath)7, 0, false, ((Component)base.playerHeldBy.gameplayCamera).transform.forward * 30f); } Debug.Log((object)"Player ouch"); } } } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if (!((Object)(object)base.playerHeldBy == (Object)null)) { Debug.Log((object)$"r/l activate: {right}"); if (!right) { StartCheckMagazine(); } } } private void StartReloadGunAndSync() { if ((Plugin.customGunInfinityAmmo || ReloadedGun()) && !isReloading) { Debug.Log((object)"Calling reload gun...."); ((MonoBehaviour)this).StartCoroutine(ReloadGunAnimation()); Debug.Log((object)"Calling reload gun and sync"); localClientSendingReloadGunRPC = true; ReloadGunServerRpc(); } else { gunAudio.PlayOneShot(noAmmoSFX); } } [ServerRpc(RequireOwnership = false)] public void ReloadGunServerRpc() { ReloadGunClientRpc(); } [ClientRpc] public void ReloadGunClientRpc() { Debug.Log((object)"Reload gun client rpc received"); if (localClientSendingReloadGunRPC) { localClientSendingReloadGunRPC = false; Debug.Log((object)"localClientSendingReloadGunRPC was true"); } else { ((MonoBehaviour)this).StartCoroutine(ReloadGunAnimation()); } } private void StartCheckMagazine() { if (!isInspecting) { ((MonoBehaviour)this).StartCoroutine(CheckAmmoGunAnimation()); } else { gunAudio.PlayOneShot(noAmmoSFX); } } [IteratorStateMachine(typeof(<CheckAmmoGunAnimation>d__48))] private IEnumerator CheckAmmoGunAnimation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CheckAmmoGunAnimation>d__48(0) { <>4__this = this }; } private void SetAmmoControlTip(bool isChecking) { string text = "Check ammo : [Q]"; if (ammosLoaded == 30) { text = (isChecking ? "Check ammo : [Q] [Full]" : "Check ammo : [Q] [??]"); } else if (ammosLoaded >= 20 && 30 > ammosLoaded) { text = (isChecking ? "Check ammo : [Q] [<30]" : "Check ammo : [Q] [??]"); } else if (ammosLoaded >= 10 && 20 > ammosLoaded) { text = (isChecking ? "Check ammo : [Q] [<20]" : "Check ammo : [Q] [??]"); } else if (ammosLoaded >= 1 && 10 > ammosLoaded) { text = (isChecking ? "Check ammo : [Q] [<10]" : "Check ammo : [Q] [??]"); } else if (ammosLoaded <= 0) { text = (isChecking ? "Check ammo : [Q] [Empty]" : "Check ammo : [Q] [??]"); } if (((NetworkBehaviour)this).IsOwner) { HUDManager.Instance.ChangeControlTip(3, text, false); string text2 = InputActionRebindingExtensions.GetBindingDisplayString(Plugin.InputActionInstance.RifleReloadKey, (DisplayStringOptions)0, (string)null).Replace(" | ", ""); HUDManager.Instance.ChangeControlTip(2, "Reload : [" + text2 + "]", false); } } private void KR_SetAmmoControlTip(bool isChecking) { string text = "탄약 확인하기 : [Q]"; if (ammosLoaded == 30) { text = (isChecking ? "탄약 확인하기 : [Q] [가득 참]" : "탄약 확인하기 : [Q] [??]"); } else if (ammosLoaded >= 20 && 30 > ammosLoaded) { text = (isChecking ? "탄약 확인하기 : [Q] [<30]" : "탄약 확인하기 : [Q] [??]"); } else if (ammosLoaded >= 10 && 20 > ammosLoaded) { text = (isChecking ? "탄약 확인하기 : [Q] [<20]" : "탄약 확인하기 : [Q] [??]"); } else if (ammosLoaded >= 1 && 10 > ammosLoaded) { text = (isChecking ? "탄약 확인하기 : [Q] [<10]" : "탄약 확인하기 : [Q] [??]"); } else if (ammosLoaded <= 0) { text = (isChecking ? "탄약 확인하기 : [Q] [비어 있음]" : "탄약 확인하기 : [Q] [??]"); } if (((NetworkBehaviour)this).IsOwner) { HUDManager.Instance.ChangeControlTip(3, text, false); string text2 = InputActionRebindingExtensions.GetBindingDisplayString(Plugin.InputActionInstance.RifleReloadKey, (DisplayStringOptions)0, (string)null).Replace(" | ", ""); HUDManager.Instance.ChangeControlTip(2, "재장전 : [" + text2 + "]", false); } } [IteratorStateMachine(typeof(<ReloadGunAnimation>d__51))] private IEnumerator ReloadGunAnimation() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ReloadGunAnimation>d__51(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() { if ((Object)(object)base.playerHeldBy != (Object)null) { UpdateAnimator(base.playerHeldBy, base.playerHeldBy.playerBodyAnimator, restore: true); } ((GrabbableObject)this).PocketItem(); StopUsingGun(); } public override void DiscardItem() { if ((Object)(object)base.playerHeldBy != (Object)null) { UpdateAnimator(base.playerHeldBy, base.playerHeldBy.playerBodyAnimator, restore: true); } ((GrabbableObject)this).DiscardItem(); StopUsingGun(); } private void StopUsingGun() { previousPlayerHeldBy.equippedUsableItemQE = false; gunAudio.Stop(); isReloading = false; previousPlayerHeldBy.playerBodyAnimator.SetTrigger("SwitchHoldAnimation"); gunAnimator.SetTrigger("Reset"); isInspecting = false; if ((Object)(object)base.playerHeldBy != (Object)null) { UpdateAnimator(base.playerHeldBy, base.playerHeldBy.playerBodyAnimator, restore: true); } } private void UpdateAnimator(PlayerControllerB player, Animator playerBodyAnimator, bool restore) { if (!restore) { if ((Object)(object)playerBodyAnimator.runtimeAnimatorController != (Object)(object)Plugin.playerAnimator && (Object)(object)playerBodyAnimator.runtimeAnimatorController != (Object)(object)Plugin.otherPlayerAnimator) { if ((Object)(object)player == (Object)(object)StartOfRound.Instance.localPlayerController) { SaveAnimatorStates(playerBodyAnimator); playerBodyAnimator.runtimeAnimatorController = Plugin.playerAnimator; RestoreAnimatorStates(playerBodyAnimator); Plugin.mls.LogInfo((object)"Replace Player Animator!"); } else { SaveAnimatorStates(playerBodyAnimator); playerBodyAnimator.runtimeAnimatorController = Plugin.otherPlayerAnimator; RestoreAnimatorStates(playerBodyAnimator); Plugin.mls.LogInfo((object)"Replace Other Player Animator!"); } } } else { SaveAnimatorStates(playerBodyAnimator); playerBodyAnimator.runtimeAnimatorController = PlayerControllerBPatch.originalPlayerAnimator; RestoreAnimatorStates(playerBodyAnimator); Plugin.mls.LogInfo((object)"Replace Other Player Animator!"); } } private void SaveAnimatorStates(Animator animator) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) isCrouching = animator.GetBool("crouching"); isJumping = animator.GetBool("Jumping"); isWalking = animator.GetBool("Walking"); isSprinting = animator.GetBool("Sprinting"); currentStateInfo = animator.GetCurrentAnimatorStateInfo(0); currentAnimationTime = ((AnimatorStateInfo)(ref currentStateInfo)).normalizedTime; } public void RestoreAnimatorStates(Animator animator) { animator.Play(((AnimatorStateInfo)(ref currentStateInfo)).fullPathHash, 0, currentAnimationTime); animator.SetBool("crouching", isCrouching); animator.SetBool("Jumping", isJumping); animator.SetBool("Walking", isWalking); animator.SetBool("Sprinting", isSprinting); } } [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatch { public static RuntimeAnimatorController originalPlayerAnimator; [HarmonyPostfix] [HarmonyPatch("ConnectClientToPlayerObject")] private static void Start_Postfix(PlayerControllerB __instance) { if ((Object)(object)originalPlayerAnimator == (Object)null) { Plugin.mls.LogInfo((object)"Cloning Player Animation Controller"); originalPlayerAnimator = Object.Instantiate<RuntimeAnimatorController>(__instance.playerBodyAnimator.runtimeAnimatorController); ((Object)originalPlayerAnimator).name = "DefaultPlayerAnimator"; } } } public class RevolverItem : GrabbableObject { [CompilerGenerated] private sealed class <FireDelay>d__45 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public RevolverItem <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FireDelay>d__45(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.cantFire = true; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.cantFire = 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(); } } [CompilerGenerated] private sealed class <ReloadGunAnimation>d__54 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public RevolverItem <>4__this; private int <>s__1; private List<MeshRenderer>.Enumerator <>s__2; private MeshRenderer <ammo>5__3; private int <i>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ReloadGunAnimation>d__54(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__2 = default(List<MeshRenderer>.Enumerator); <ammo>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0162: 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_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Expected O, but got Unknown //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_0540: Expected O, but got Unknown //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: 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_0253: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: 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_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (<>4__this.isCylinderMoving && !<>4__this.gunAnimator.GetBool("Reloading")) { return false; } <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 1; return true; case 1: { <>1__state = -1; ((GrabbableObject)<>4__this).playerHeldBy.playerBodyAnimator.SetTrigger("RevolverInsertBullet"); <>4__this.isReloading = true; <>4__this.gunAudio.PlayOneShot(<>4__this.gunReloadSFX); if ((Object)(object)((GrabbableObject)<>4__this).playerHeldBy == (Object)(object)StartOfRound.Instance.localPlayerController) { WalkieTalkie.TransmitOneShotAudio(<>4__this.gunAudio, <>4__this.gunReloadSFX, 1f); ((Renderer)<>4__this.revolverAmmoInHand).enabled = true; <>4__this.revolverAmmoInHandTransform.SetParent(((GrabbableObject)<>4__this).playerHeldBy.leftHandItemTarget); <>4__this.revolverAmmoInHandTransform.localPosition = new Vector3(0.0033f, 0.0732f, -0.0762f); <>4__this.revolverAmmoInHandTransform.localEulerAngles = new Vector3(6.533f, 106.232f, -12.891f); } int ammosLoaded = <>4__this.ammosLoaded; <>s__1 = ammosLoaded; switch (<>s__1) { case 0: <>4__this.cylinderTransform.localRotation = Quaternion.Euler(new Vector3(0f, 0f, 0f)); break; case 1: <>4__this.cylinderTransform.localRotation = Quaternion.Euler(new Vector3(0f, 60f, 0f)); break; case 2: <>4__this.cylinderTransform.localRotation = Quaternion.Euler(new Vector3(0f, 120f, 0f)); break; case 3: <>4__this.cylinderTransform.localRotation = Quaternion.Euler(new Vector3(0f, 180f, 0f)); break; case 4: <>4__this.cylinderTransform.localRotation = Quaternion.Euler(new Vector3(0f, 240f, 0f)); break; case 5: <>4__this.cylinderTransform.localRotation = Quaternion.Euler(new Vector3(0f, 300f, 0f)); break; case 6: <>4__this.cylinderTransform.localRotation = Quaternion.Euler(new Vector3(0f, 0f, 0f)); break; } <>4__this.gunAudio.PlayOneShot(<>4__this.gunReloadSFX); <>2__current = (object)new WaitForSeconds(0.75f); <>1__state = 2; return true; } case 2: <>1__state = -1; if ((Object)(object)((GrabbableObject)<>4__this).playerHeldBy != (Object)null) { if ((Object)(object)((GrabbableObject)<>4__this).playerHeldBy == (Object)(object)StartOfRound.Instance.localPlayerController && !Plugin.customGunInfinityAmmo) { ((GrabbableObject)<>4__this).playerHeldBy.DestroyItemInSlotAndSync(<>4__this.ammoSlotToUse); } <>4__this.ammoSlotToUse = -1; <>4__this