using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using TMPro; using Unity.Mathematics; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Localization; using UnityEngine.SceneManagement; using UnityEngine.UI; using Zorro.Core; using Zorro.Settings; using Zorro.Settings.UI; using Zorro.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("com.github.BloopTankStudios.PEAK-Hunter")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.5.0")] [assembly: AssemblyInformationalVersion("1.1.5+a7e0dbb61f431f0e9bb4d281320e285dd9b2805d")] [assembly: AssemblyProduct("com.github.BloopTankStudios.PEAK-Hunter")] [assembly: AssemblyTitle("Hunter")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.5.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace Hunter { [BepInPlugin("com.github.BloopTankStudios.PEAK-Hunter", "Hunter", "1.1.5")] public class Plugin : BaseUnityPlugin { public class HunterPlayerUpdater : MonoBehaviourPun { [CompilerGenerated] private sealed class <>c__DisplayClass3_0 { public int actorNumber; public bool giveAll; } [CompilerGenerated] private sealed class <>c__DisplayClass4_0 { public Item item; public PhotonView characterView; internal bool b__1() { return item.data != null; } } [PunRPC] public void RPC_RecieveConfigData(string section, string key, object value) { if (!(value is float value2)) { if (!(value is int value3)) { if (!(value is bool value4)) { if (value is string value5) { ConfigEntry val = (ConfigEntry)(object)_.hunterConfigData[section, key]; val.Value = value5; } } else { ConfigEntry val2 = (ConfigEntry)(object)_.hunterConfigData[section, key]; val2.Value = value4; } } else { ConfigEntry val3 = (ConfigEntry)(object)_.hunterConfigData[section, key]; val3.Value = value3; } } else { ConfigEntry val4 = (ConfigEntry)(object)_.hunterConfigData[section, key]; val4.Value = value2; } Log.LogDebug((object)("Set \"" + section + " - " + key + "\" to " + value)); _.UpdateHunterModSettings(); if (!(key == "TeamColors")) { return; } if (isInLobby) { SetPassportTeamColors(PassportManager.instance.dummy, 0); } foreach (Character allCharacter in Character.AllCharacters) { SetTeamColors(allCharacter.refs.customization); } } [PunRPC] public void RPCA_ChangeRole(int ActorNumber, bool isHunter) { if (!isHunter && hunterDatabase.Contains(ActorNumber)) { hunterDatabase.Remove(ActorNumber); } else if (isHunter && !hunterDatabase.Contains(ActorNumber)) { hunterDatabase.Add(ActorNumber); } if ((Object)(object)boardingPass != (Object)null) { BoardingPassUIPatch(boardingPass); } if (!_.teamColors.Value) { return; } Character val = null; foreach (Character allCharacter in Character.AllCharacters) { if (allCharacter.view.Owner.ActorNumber == ActorNumber) { val = allCharacter; } } if ((Object)(object)val != (Object)null) { SetTeamColors(val.refs.customization); if (isInLobby && val.IsLocal) { SetPassportTeamColors(PassportManager.instance.dummy, 0); } } } [PunRPC] public void RPCA_SetPlayerReadyStatus(int actorNumber, bool isReady) { if (!isReady && playersReady.Contains(actorNumber)) { playersReady.Remove(actorNumber); } else if (isReady && !playersReady.Contains(actorNumber)) { playersReady.Add(actorNumber); } Log.LogDebug((object)("Player " + actorNumber + " is " + (isReady ? "Ready" : "Not Ready"))); } [PunRPC] public void RPC_SpawnBlowgun(int actorNumber, bool giveAll) { <>c__DisplayClass3_0 CS$<>8__locals0 = new <>c__DisplayClass3_0(); CS$<>8__locals0.actorNumber = actorNumber; CS$<>8__locals0.giveAll = giveAll; if ((CS$<>8__locals0.giveAll || _.startWithBlowgun.Value) && PhotonNetwork.IsMasterClient) { ((MonoBehaviour)this).StartCoroutine(delay()); } [IteratorStateMachine(typeof(<>c__DisplayClass3_0.<g__delay|0>d))] IEnumerator delay() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <>c__DisplayClass3_0.<g__delay|0>d(0) { <>4__this = CS$<>8__locals0 }; } } [PunRPC] public void RPCA_EquippedBlowgun(PhotonView characterView, PhotonView itemView) { <>c__DisplayClass4_0 CS$<>8__locals0 = new <>c__DisplayClass4_0(); CS$<>8__locals0.characterView = characterView; CS$<>8__locals0.item = ((Component)itemView).GetComponent(); ((MonoBehaviour)this).StartCoroutine(waitForItemLoad()); [IteratorStateMachine(typeof(<>c__DisplayClass4_0.<g__waitForItemLoad|0>d))] IEnumerator waitForItemLoad() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <>c__DisplayClass4_0.<g__waitForItemLoad|0>d(0) { <>4__this = CS$<>8__locals0 }; } } } private enum SettingProfiles { Custom, Default, Zombie } private class HunterSettingProfiles : EnumSetting, IExposedSetting, IConditionalSetting { public HunterSettingProfiles() { base.Value = (SettingProfiles)_.UpdateProfileSetting(); } public override void ApplyValue() { if (base.Value == SettingProfiles.Custom) { return; } Dictionary dictionary = null; if (base.Value == SettingProfiles.Zombie) { dictionary = _.zombieValues; } foreach (KeyValuePair hunterConfigDatum in _.hunterConfigData) { object obj = hunterConfigDatum.Value.DefaultValue; if (dictionary != null && dictionary.ContainsKey(hunterConfigDatum.Key.Section + "/" + hunterConfigDatum.Key.Key)) { obj = dictionary[hunterConfigDatum.Key.Section + "/" + hunterConfigDatum.Key.Key]; } hunterConfigDatum.Value.BoxedValue = obj; if ((Object)(object)Character.localCharacter != (Object)null) { Character.localCharacter.view.RPC("RPC_RecieveConfigData", (RpcTarget)1, new object[3] { hunterConfigDatum.Key.Section, hunterConfigDatum.Key.Key, obj }); } } _.UpdateHunterModSettings(); } public string GetCategory() { return "General"; } public string GetDisplayName() { return "Setting Profiles"; } public override List GetLocalizedChoices() { return null; } public override List GetUnlocalizedChoices() { return new List { "Custom", "Default", "Zombie" }; } public bool ShouldShow() { if (!((Object)(object)Player.localPlayer == (Object)null)) { return PhotonNetwork.IsMasterClient; } return true; } protected override SettingProfiles GetDefaultValue() { return SettingProfiles.Custom; } } private class HunterCategorySetting : OffOnSetting, IExposedSetting { private string categoryName; public HunterCategorySetting(string categoryName) { this.categoryName = categoryName; } public override void ApplyValue() { } public string GetCategory() { return "General"; } public string GetDisplayName() { return "Category: " + Regex.Replace(categoryName, "(?!^)([A-Z])", " $1").Replace("_", ""); } public override List GetLocalizedChoices() { return null; } protected override OffOnMode GetDefaultValue() { return (OffOnMode)0; } } private class HunterNumSetting : FloatSetting, IExposedSetting { private bool isInt; private ConfigDefinition configDef; private ConfigEntryBase config; public HunterNumSetting(ConfigDefinition configDef, ConfigEntryBase config, bool isInt) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) this.isInt = isInt; this.configDef = configDef; this.config = config; ((FloatSetting)this).Value = (isInt ? ((float)(int)config.BoxedValue) : ((float)config.BoxedValue)); float2 minMaxValue = ((FloatSetting)this).GetMinMaxValue(); ((FloatSetting)this).MinValue = minMaxValue.x; ((FloatSetting)this).MaxValue = minMaxValue.y; } public override void ApplyValue() { if (isInt) { ((ConfigEntry)(object)config).Value = (int)((FloatSetting)this).Value; } else { ((ConfigEntry)(object)config).Value = ((FloatSetting)this).Value; } if ((Object)(object)Character.localCharacter != (Object)null) { Character.localCharacter.view.RPC("RPC_RecieveConfigData", (RpcTarget)1, new object[3] { configDef.Section, configDef.Key, config.BoxedValue }); Log.LogDebug((object)"Server: Sent Config Info"); } _.UpdateProfileSetting(); } public float GetValue() { if (!isInt) { return (float)config.BoxedValue; } return (int)config.BoxedValue; } public string GetCategory() { return "General"; } public string GetDisplayName() { return Regex.Replace(configDef.Key, "(?!^)([A-Z])", " $1"); } protected override float GetDefaultValue() { return (float)(isInt ? ((object)(int)config.DefaultValue) : config.DefaultValue); } protected override float2 GetMinMaxValue() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) switch (configDef.Key) { case "InitialHunterCooldownOnBeach": case "AddedCooldownPerCampfire": return new float2(0f, 100f); case "FallDamageMultiplier": return new float2(0f, 2f); case "BlowgunCooldownInMins": return new float2(0f, 20f); case "AttackKnockbackMultiplier": return new float2(0f, 10f); default: return new float2(0f, 1f); } } } private class HunterBoolSetting : OffOnSetting, IExposedSetting { private ConfigDefinition configDef; private ConfigEntry config; public HunterBoolSetting(ConfigDefinition configDef, ConfigEntry config) { this.configDef = configDef; this.config = config; ((EnumSetting)this).Value = (OffOnMode)(config.Value ? 1 : 0); } public override void ApplyValue() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 config.Value = (int)((EnumSetting)this).Value == 1; if ((Object)(object)Character.localCharacter != (Object)null) { Character.localCharacter.view.RPC("RPC_RecieveConfigData", (RpcTarget)0, new object[3] { configDef.Section, configDef.Key, config.Value }); Log.LogDebug((object)"Server: Sent Config Info"); } _.UpdateProfileSetting(); } public override int GetValue() { return ((bool)((ConfigEntryBase)config).BoxedValue) ? 1 : 0; } public string GetCategory() { return "General"; } public string GetDisplayName() { return Regex.Replace(configDef.Key, "(?!^)([A-Z])", " $1"); } public override List GetLocalizedChoices() { return null; } protected override OffOnMode GetDefaultValue() { if ((bool)((ConfigEntryBase)config).DefaultValue) { return (OffOnMode)1; } return (OffOnMode)0; } } private class HunterEnumSetting : EnumSetting, IExposedSetting { private ConfigDefinition configDef; private ConfigEntry config; public HunterEnumSetting(ConfigDefinition configDef, ConfigEntry config) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) this.configDef = configDef; this.config = config; if (Enum.TryParse(config.Value, ignoreCase: false, out STATUSTYPE result)) { base.Value = result; } else { base.Value = (STATUSTYPE)0; } } public override void ApplyValue() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) ConfigEntry obj = config; STATUSTYPE value = base.Value; obj.Value = ((object)(STATUSTYPE)(ref value)).ToString(); if ((Object)(object)Character.localCharacter != (Object)null) { Character.localCharacter.view.RPC("RPC_RecieveConfigData", (RpcTarget)1, new object[3] { configDef.Section, configDef.Key, config.Value }); Log.LogDebug((object)"Server: Sent Config Info"); } _.UpdateProfileSetting(); } public override int GetValue() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected I4, but got Unknown if (Enum.TryParse((string)((ConfigEntryBase)config).BoxedValue, ignoreCase: false, out STATUSTYPE result)) { return (int)result; } return 0; } public string GetCategory() { return "General"; } public string GetDisplayName() { return Regex.Replace(configDef.Key, "(?!^)([A-Z])", " $1"); } public override List GetLocalizedChoices() { return null; } public override List GetUnlocalizedChoices() { string[] names = Enum.GetNames(typeof(STATUSTYPE)); return names.ToList(); } protected override STATUSTYPE GetDefaultValue() { return (STATUSTYPE)0; } } [CompilerGenerated] private sealed class <g__waitForRespawn|72_0>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <g__waitForRespawn|72_0>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; case 1: <>1__state = -1; Log.LogDebug((object)"Hunter Respawned"); Character.localCharacter.refs.afflictions.UpdateWeight(); hunterCooldown = Time.time; ((MonoBehaviourPun)Character.localCharacter).photonView.RPC("RPCA_ReviveAtPosition", (RpcTarget)0, new object[3] { RespawnCharacterPos(nextSection: false), false, -1 }); Character.localCharacter.refs.afflictions.AddStatus((STATUSTYPE)5, 0.05f, false, true, true); Character.localCharacter.refs.afflictions.AddStatus((STATUSTYPE)3, 0.3f, false, true, true); 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 <g__waitForRespawn|72_1>d : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <g__waitForRespawn|72_1>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; case 1: <>1__state = -1; DisableFog(); DisableLavaRise(); ChangeRole(); Log.LogDebug((object)"Climber Respawned as Hunter"); Character.localCharacter.refs.afflictions.UpdateWeight(); hunterCooldown = Time.time; ((MonoBehaviourPun)Character.localCharacter).photonView.RPC("RPCA_ReviveAtPosition", (RpcTarget)0, new object[3] { RespawnCharacterPos(nextSection: false), false, -1 }); Character.localCharacter.refs.afflictions.SetStatus((STATUSTYPE)5, 0.05f, true); Character.localCharacter.refs.afflictions.AddStatus((STATUSTYPE)3, 0.3f, false, true, true); ((MonoBehaviour)_).StartCoroutine(_.showMessage("YOU ARE NOW A HUNTER")); 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(); } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__58_0; public static Func <>9__87_0; internal void b__58_0() { ChangeRole(); } internal int b__87_0(Character c) { return 1; } } [CompilerGenerated] private sealed class d__82 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ItemInstanceData itemData; private FloatItemData 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__82(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; itemData.TryGetDataEntry((DataEntryKey)11, ref 5__2); break; case 1: { <>1__state = -1; float num = (isInLobby ? 1f : _.blowgunCooldown.Value); FloatItemData obj = 5__2; obj.Value += 1f / (num * 60f); break; } } if (5__2.Value < 1f && itemData != null) { <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } if (itemData != null) { OptionableIntItemData val = default(OptionableIntItemData); itemData.TryGetDataEntry((DataEntryKey)2, ref val); val.Value = 1; itemData.data.Remove((DataEntryKey)11); Log.LogDebug((object)"Climber Blowdart Recharged"); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__65 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Plugin <>4__this; private int 5__2; private CharacterAfflictions 5__3; private float 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__65(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown int num = <>1__state; Plugin plugin = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = Singleton.Instance.currentSegment; if (5__2 == 0) { <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; } goto IL_0065; case 1: <>1__state = -1; goto IL_0065; case 2: <>1__state = -1; goto IL_0151; case 3: { <>1__state = -1; hunterCooldown = Time.time; ((MonoBehaviourPun)Character.localCharacter).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { RespawnCharacterPos(nextSection: false), true }); 5__3.ClearAllStatus(true); 5__3.UpdateWeight(); 5__3.AddStatus((STATUSTYPE)3, Character.localCharacter.GetMaxStamina(), false, true, true); 5__3.lastAddedStatus[3] = 0f; 5__3.currentDecrementalStatuses[3] = 0.025f; 5__3 = null; break; } IL_0151: if (5__2 == 0 && !playersReadyForHunter()) { hunterCooldown = float.PositiveInfinity; Log.LogDebug((object)"Waiting for Players to Load on Beach"); <>2__current = null; <>1__state = 2; return true; } hunterCooldown = 5__4 + Time.time; <>2__current = (object)new WaitForSeconds(5__4); <>1__state = 3; return true; IL_0065: ((MonoBehaviour)plugin).StartCoroutine(plugin.showMessage(isLocalHunter() ? "COOLDOWN ACTIVE" : "THE HUNTER IS NEAR...")); if (!isLocalHunter()) { break; } 5__3 = Character.localCharacter.refs.afflictions; 5__4 = plugin.initialCooldown.Value + plugin.additionalCooldown.Value * Singleton.Instance.currentSegment; 5__3.ClearAllStatus(true); 5__3.AddStatus((STATUSTYPE)3, 1f, false, true, true); 5__3.lastAddedStatus[3] = float.PositiveInfinity; Log.LogDebug((object)("Hunter Cooldown: " + 5__4)); goto IL_0151; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__44 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string message; private GameObject 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__44(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; Log.LogDebug((object)("Show Message: " + message)); 5__2 = Object.Instantiate(hunterNearPrefab, hunterNearPrefab.transform.parent); ((TMP_Text)((Component)5__2.transform.Find("Fog")).GetComponent()).text = message; 5__2.SetActive(true); <>2__current = (object)new WaitForSeconds(4f); <>1__state = 1; return true; case 1: <>1__state = -1; Object.Destroy((Object)(object)5__2); 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 static bool debugMode = false; public static Plugin _; public static bool isInLobby = false; private static List playersReady = new List(); private static int randomBlowgunRunner = -1; private static List hunterDatabase = new List(); private static float hunterCooldown = -1000f; private ConfigFile hunterConfigData = new ConfigFile(Path.Combine(Paths.ConfigPath, "BT_Hunter.cfg"), true); private ConfigEntry zombieMode; private ConfigEntry pickRandom; private ConfigEntry teamColors; private ConfigEntry initialCooldown; private ConfigEntry additionalCooldown; private ConfigEntry disableScoutmaster; private ConfigEntry climberExtraStamina; private ConfigEntry climberDamageMultiplier; private ConfigEntry climberRespawnCurse; private ConfigEntry startWithBlowgun; private ConfigEntry blowgunCooldown; private ConfigEntry hunterExtraStamina; private ConfigEntry hunterDamageMultiplier; private ConfigEntry enableHunterAttack; private ConfigEntry attackDrowsiness; private ConfigEntry attackKnockbackMultiplier; private ConfigEntry attackType; private ConfigEntry attackAmount; private Dictionary zombieValues = new Dictionary { { "_Gamemode/ZombieMode", true }, { "_Gamemode/PickRandomHunter", true }, { "_Gamemode/TeamColors", true }, { "ClimberStats/RespawnCurse", 0f }, { "HunterStats/ExtraStamina", 1f }, { "HunterStats/AttackType", "Curse" }, { "HunterStats/AttackMaxAffliction", 0.15f } }; private static AssetBundle assets; private static Sprite climberSprite; private static Sprite hunterSprite; private static Image? smallRoleIcon; private static GameObject hunterNearPrefab; private static TextMeshProUGUI roleLabel; private static Button? roleSwitcher; private static BoardingPass? boardingPass; private static SettingsTABSButton hunterTab; private static bool hasSetColors = false; public static bool hunterDropItems = false; public const string Id = "com.github.BloopTankStudios.PEAK-Hunter"; internal static ManualLogSource Log { get; private set; } = null; public static string Name => "Hunter"; public static string Version => "1.1.5"; private static bool isLocalHunter() { return isHunter(Character.localCharacter); } private static bool isHunter(Character character) { return hunterDatabase.Contains(character.view.Owner.ActorNumber); } private static bool playersReadyForHunter() { bool result = true; Player[] playerList = PhotonNetwork.PlayerList; foreach (Player val in playerList) { if (!playersReady.Contains(val.ActorNumber)) { result = false; continue; } Character playerCharacter = PlayerHandler.GetPlayerCharacter(val); if (playerCharacter.data.passedOutOnTheBeach > -5f) { result = false; } } return result; } [IteratorStateMachine(typeof(d__44))] private IEnumerator showMessage(string message) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__44(0) { message = message }; } private void Awake() { //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; _ = this; zombieMode = hunterConfigData.Bind("_Gamemode", "ZombieMode", false, "When Enabled, once Climbers die, they join the Hunter's Team"); pickRandom = hunterConfigData.Bind("_Gamemode", "PickRandomHunter", false, "Upon Game Start, a random Hunter will be chosen"); teamColors = hunterConfigData.Bind("_Gamemode", "TeamColors", false, "Colors players Blue or Red depending on which side their on. Useful for Zombie Mode"); initialCooldown = hunterConfigData.Bind("_Gamemode", "InitialHunterCooldownOnBeach", 10, "Change the Cooldown of how long the Hunter is knocked out"); additionalCooldown = hunterConfigData.Bind("_Gamemode", "AddedCooldownPerCampfire", 3, "Increases the amount of Cooldown applied after each Campfire Section"); disableScoutmaster = hunterConfigData.Bind("_Gamemode", "DisableScoutmaster", true, "Scoutmaster may be problematic with Hunter/Climber strategies!"); climberExtraStamina = hunterConfigData.Bind("ClimberStats", "ExtraStamina", 0f, "Applies this extra Stamina when the Climber is rested"); climberDamageMultiplier = hunterConfigData.Bind("ClimberStats", "FallDamageMultiplier", 0.5f, "Reduced/Increases the amount of Damage the Climber takes. (Not Including the Hunter Attack)"); climberRespawnCurse = hunterConfigData.Bind("ClimberStats", "RespawnCurse", 0.15f, "Amount of Curse to inflict upon Climbers for Dying and Respawning"); startWithBlowgun = hunterConfigData.Bind("ClimberStats", "StartWithBlowgun", true, "Determines if 1 Random Climber starts with a Blowdart"); blowgunCooldown = hunterConfigData.Bind("ClimberStats", "BlowgunCooldownInMins", 7f, "When the Blowgun will be usable again"); hunterExtraStamina = hunterConfigData.Bind("HunterStats", "ExtraStamina", 0.5f, "Applies this extra Stamina when the Hunter is rested"); hunterDamageMultiplier = hunterConfigData.Bind("HunterStats", "FallDamageMultiplier", 0.25f, "Reduced/Increases the amount of Damage the Hunter takes"); enableHunterAttack = hunterConfigData.Bind("HunterStats", "EnableHunterAttack", true, "Determines if Hunters can use their Right-Click Attack"); attackDrowsiness = hunterConfigData.Bind("HunterStats", "HunterDrowsinessDebuff", 0.5f, "The amount of Stamina Bar needed when the Hunter uses their Attack and amount of Drownsiness Applied"); attackKnockbackMultiplier = hunterConfigData.Bind("HunterStats", "AttackKnockbackMultiplier", 2f, "Modifies the amount of Knockback received when within range of the Hunter Attack"); attackType = hunterConfigData.Bind("HunterStats", "AttackType", "Injury", "The type of Afflication that can be received by Runners when within range of the Hunter Attack. [Injury, Hunger, Cold, Poison, Crab, Curse, Drowzy, Hot, ...]"); attackAmount = hunterConfigData.Bind("HunterStats", "AttackMaxAffliction", 0.3f, "The amount of Max Afflication Amount that can be received when within range of the Hunter Attack"); Log.LogDebug((object)"Config File Created"); string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "assets"); assets = AssetBundle.LoadFromFile(Path.Combine(path, "peak-hunter")); Texture2D val = assets.LoadAsset("Climber_Icon"); Texture2D val2 = assets.LoadAsset("Hunter_Icon"); climberSprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); hunterSprite = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f)); Log.LogDebug((object)"Assets Loaded"); Harmony.CreateAndPatchAll(typeof(Plugin), (string)null); Log.LogDebug((object)"Methods Patched"); Log.LogInfo((object)("Plugin " + Name + " is loaded!")); } private void OnDestroy() { } private void Update() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (debugMode && Input.GetKeyDown((KeyCode)103)) { Log.LogDebug((object)"Debug - Warping to next campfire"); hunterCooldown = Time.time; ((MonoBehaviourPun)Character.localCharacter).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { RespawnCharacterPos(nextSection: true), true }); } } [HarmonyPatch(typeof(Character), "Awake")] [HarmonyPostfix] private static void AttachRPCController(Character __instance) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); isInLobby = ((Scene)(ref activeScene)).name == "Airport"; if (!Object.op_Implicit((Object)(object)((Component)__instance).gameObject.GetComponent())) { ((Component)__instance).gameObject.AddComponent(); SyncPlayerData(__instance); } } [HarmonyPatch(typeof(Character), "Start")] [HarmonyPrefix] private static void StartCharacterScene(Character __instance) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) AttachRPCController(__instance); if (__instance.IsLocal) { __instance.view.RPC("RPCA_SetPlayerReadyStatus", (RpcTarget)0, new object[2] { __instance.view.Owner.ActorNumber, !isInLobby }); if (!((Object)(object)smallRoleIcon != (Object)null)) { smallRoleIcon = new GameObject("UI_RoleIcon", new Type[3] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image) }).GetComponent(); ((Component)smallRoleIcon).transform.SetParent(((Component)GUIManager.instance).transform.Find("Canvas_HUD/BarGroup/Bar")); ((Component)smallRoleIcon).transform.localScale = Vector3.one * 0.5f; ((Component)smallRoleIcon).GetComponent().anchoredPosition = new Vector2(-275f, 55f); smallRoleIcon.sprite = (isLocalHunter() ? hunterSprite : climberSprite); Log.LogDebug((object)"Small Role Icon added to HUD"); Character.localCharacter.view.RPC("RPC_SpawnBlowgun", (RpcTarget)2, new object[2] { Character.localCharacter.view.Owner.ActorNumber, isInLobby }); Log.LogDebug((object)"Give Local Blowgun"); } } } private static void SyncPlayerData(Character character) { if (character.IsLocal && isInLobby) { playersReady.Clear(); randomBlowgunRunner = -1; hunterDatabase.Clear(); hunterCooldown = -10000f; roleSwitcher = null; boardingPass = null; Log.LogDebug((object)"RESETTING STATIC VALUES"); } if (!PhotonNetwork.IsMasterClient) { return; } foreach (Character allCharacter in Character.AllCharacters) { character.view.RPC("RPCA_ChangeRole", (RpcTarget)1, new object[2] { allCharacter.view.Owner.ActorNumber, isHunter(allCharacter) }); } foreach (KeyValuePair hunterConfigDatum in _.hunterConfigData) { ((MonoBehaviourPun)character).photonView.RPC("RPC_RecieveConfigData", (RpcTarget)1, new object[3] { hunterConfigDatum.Key.Section, hunterConfigDatum.Key.Key, hunterConfigDatum.Value.BoxedValue }); } Log.LogDebug((object)"Server: Sent All Config Info"); } [HarmonyPatch(typeof(IsLookedAt), "Start")] [HarmonyPostfix] private static void RemoveOtherTeamNametags(IsLookedAt __instance) { if (!isInLobby && (_.zombieMode.Value || (isLocalHunter() ^ isHunter(__instance.characterInteractible.character)))) { ((Component)__instance).gameObject.SetActive(false); } } [HarmonyPatch(typeof(BackpackOnBackVisuals), "IsInteractible")] [HarmonyPrefix] private static bool LimitTeamBackpack(BackpackOnBackVisuals __instance, Character interactor, ref bool __result) { if (isHunter(interactor) ^ isHunter(__instance.character)) { __result = false; return false; } return true; } [HarmonyPatch(typeof(CharacterCustomization), "OnPlayerDataChange")] [HarmonyPostfix] private static void SetTeamColors(CharacterCustomization __instance) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (_.teamColors.Value || hasSetColors) { ChangeRefColors(__instance.refs, __instance.PlayerColor, isHunter(__instance._character), isPassport: false); } } [HarmonyPatch(typeof(PlayerCustomizationDummy), "SetPlayerColor")] [HarmonyPostfix] private static void SetPassportTeamColors(PlayerCustomizationDummy __instance, int index) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (_.teamColors.Value || hasSetColors) { ChangeRefColors(__instance.refs, Character.localCharacter.refs.customization.PlayerColor, isLocalHunter(), isPassport: true); } } private static void ChangeRefColors(CustomizationRefs refs, Color color, bool isHunter, bool isPassport) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) if (!isPassport) { hasSetColors = _.teamColors.Value; } if (_.teamColors.Value) { float[] array = new float[2] { Mathf.Min(new float[3] { color.r, color.g, color.b }), Mathf.Max(new float[3] { color.r, color.g, color.b }) }; color = new Color(1f, 1f, 1f) * array[0] + (array[1] - array[0]) * (isHunter ? new Color(1f, 0f, 0f) : new Color(0f, 0f, 1f)); } Renderer[] playerRenderers = refs.PlayerRenderers; for (int i = 0; i < playerRenderers.Length; i++) { playerRenderers[i].material.SetColor(CharacterCustomization.SkinColor, color); } playerRenderers = refs.EyeRenderers; for (int j = 0; j < playerRenderers.Length; j++) { playerRenderers[j].material.SetColor(CharacterCustomization.SkinColor, color); } } [HarmonyPatch(typeof(GUIManager), "Awake")] [HarmonyPostfix] private static void HunterIsNearPatch(GUIManager __instance) { hunterNearPrefab = Object.Instantiate(__instance.fogRises, __instance.fogRises.transform.parent); ((Object)hunterNearPrefab).name = "Notification_Hunter"; ((Behaviour)((Component)hunterNearPrefab.transform.Find("Fog")).GetComponent()).enabled = false; Log.LogDebug((object)"Hunter Near UI Prefab-ed"); } [HarmonyPatch(typeof(PassportManager), "Initialize")] [HarmonyPostfix] private static void PassportUIPatch(PassportManager __instance) { //IL_0049: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Expected O, but got Unknown //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Expected O, but got Unknown GameObject val = Object.Instantiate(((Component)((Component)__instance).transform.Find("PassportUI/Canvas/Panel/Panel/BG/UI_Close")).gameObject); ((Object)val).name = "UI_Role"; val.transform.SetParent(((Component)__instance).transform.Find("PassportUI/Canvas/Panel/Panel/BG/Portrait")); RectTransform component = val.GetComponent(); ((Transform)component).localScale = Vector3.one * 0.66f; component.anchorMin = new Vector2(0f, 0f); component.anchorMax = new Vector2(1f, 0f); component.pivot = new Vector2(0.5f, 0f); component.anchoredPosition = new Vector2(0f, 15f); component.sizeDelta = new Vector2(0f, -10f); component = ((Component)((Transform)component).Find("Box")).GetComponent(); component.anchorMin = new Vector2(0f, 0f); component.anchorMax = new Vector2(1f, 1f); Object.Destroy((Object)(object)val.GetComponent