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.1.0")]
[assembly: AssemblyInformationalVersion("1.1.1+eedf08d95b2a72abe038a58e2dcba1cad107ede8")]
[assembly: AssemblyProduct("com.github.BloopTankStudios.PEAK-Hunter")]
[assembly: AssemblyTitle("Hunter")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.1.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.1")]
public class Plugin : BaseUnityPlugin
{
public class HunterPlayerUpdater : MonoBehaviourPun
{
[CompilerGenerated]
private sealed class <>c__DisplayClass3_0
{
public int actorNumber;
public bool ignoreHunter;
}
[CompilerGenerated]
private sealed class <>c__DisplayClass4_0
{
public Item item;
public PhotonView characterView;
internal bool <RPCA_EquippedBlowgun>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<string> val = (ConfigEntry<string>)(object)_.hunterConfigData[section, key];
val.Value = value5;
}
}
else
{
ConfigEntry<bool> val2 = (ConfigEntry<bool>)(object)_.hunterConfigData[section, key];
val2.Value = value4;
}
}
else
{
ConfigEntry<int> val3 = (ConfigEntry<int>)(object)_.hunterConfigData[section, key];
val3.Value = value3;
}
}
else
{
ConfigEntry<float> val4 = (ConfigEntry<float>)(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 ignoreHunter)
{
<>c__DisplayClass3_0 CS$<>8__locals0 = new <>c__DisplayClass3_0();
CS$<>8__locals0.actorNumber = actorNumber;
CS$<>8__locals0.ignoreHunter = ignoreHunter;
if (_.startWithBlowgun.Value && PhotonNetwork.IsMasterClient)
{
((MonoBehaviour)this).StartCoroutine(delay());
}
[IteratorStateMachine(typeof(<>c__DisplayClass3_0.<<RPC_SpawnBlowgun>g__delay|0>d))]
IEnumerator delay()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <>c__DisplayClass3_0.<<RPC_SpawnBlowgun>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<Item>();
((MonoBehaviour)this).StartCoroutine(waitForItemLoad());
[IteratorStateMachine(typeof(<>c__DisplayClass4_0.<<RPCA_EquippedBlowgun>g__waitForItemLoad|0>d))]
IEnumerator waitForItemLoad()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <>c__DisplayClass4_0.<<RPCA_EquippedBlowgun>g__waitForItemLoad|0>d(0)
{
<>4__this = CS$<>8__locals0
};
}
}
}
private enum SettingProfiles
{
Custom,
OneHunter
}
private class HunterSettingProfiles : EnumSetting<SettingProfiles>, IExposedSetting, IConditionalSetting
{
public HunterSettingProfiles()
{
base.Value = (SettingProfiles)_.UpdateProfileSetting();
}
public override void ApplyValue()
{
if (base.Value != SettingProfiles.OneHunter)
{
return;
}
foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> hunterConfigDatum in _.hunterConfigData)
{
hunterConfigDatum.Value.BoxedValue = hunterConfigDatum.Value.DefaultValue;
if ((Object)(object)Character.localCharacter != (Object)null)
{
Character.localCharacter.view.RPC("RPC_RecieveConfigData", (RpcTarget)1, new object[3]
{
hunterConfigDatum.Key.Section,
hunterConfigDatum.Key.Key,
hunterConfigDatum.Value.DefaultValue
});
}
}
_.UpdateHunterModSettings();
}
public string GetCategory()
{
return "General";
}
public string GetDisplayName()
{
return "Setting Profiles";
}
public override List<LocalizedString> GetLocalizedChoices()
{
return null;
}
public override List<string> GetUnlocalizedChoices()
{
return new List<string> { "Custom", "1 Hunter" };
}
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<LocalizedString> 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<int>)(object)config).Value = (int)((FloatSetting)this).Value;
}
else
{
((ConfigEntry<float>)(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<bool> config;
public HunterBoolSetting(ConfigDefinition configDef, ConfigEntry<bool> config)
{
this.configDef = configDef;
this.config = config;
((EnumSetting<OffOnMode>)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<OffOnMode>)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<LocalizedString> GetLocalizedChoices()
{
return null;
}
protected override OffOnMode GetDefaultValue()
{
if ((bool)((ConfigEntryBase)config).DefaultValue)
{
return (OffOnMode)1;
}
return (OffOnMode)0;
}
}
private class HunterEnumSetting : EnumSetting<STATUSTYPE>, IExposedSetting
{
private ConfigDefinition configDef;
private ConfigEntry<string> config;
public HunterEnumSetting(ConfigDefinition configDef, ConfigEntry<string> config)
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
this.configDef = configDef;
this.config = config;
if (Enum.TryParse<STATUSTYPE>(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<string> 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<STATUSTYPE>((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<LocalizedString> GetLocalizedChoices()
{
return null;
}
public override List<string> GetUnlocalizedChoices()
{
string[] names = Enum.GetNames(typeof(STATUSTYPE));
return names.ToList();
}
protected override STATUSTYPE GetDefaultValue()
{
return (STATUSTYPE)0;
}
}
[CompilerGenerated]
private sealed class <<HunterDeathPatch>g__waitForRespawn|69_0>d : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <<HunterDeathPatch>g__waitForRespawn|69_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[2]
{
RespawnCharacterPos(nextSection: false),
false
});
Character.localCharacter.refs.afflictions.AddStatus((STATUSTYPE)5, 0.05f, false, true);
Character.localCharacter.refs.afflictions.AddStatus((STATUSTYPE)3, 0.3f, false, 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 <<HunterDeathPatch>g__waitForRespawn|69_1>d : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <<HunterDeathPatch>g__waitForRespawn|69_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[2]
{
RespawnCharacterPos(nextSection: false),
false
});
Character.localCharacter.refs.afflictions.SetStatus((STATUSTYPE)5, 0.05f, true);
Character.localCharacter.refs.afflictions.AddStatus((STATUSTYPE)3, 0.3f, false, 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();
}
}
[CompilerGenerated]
private sealed class <<HunterDeathPatch>g__waitForRespawn|69_2>d : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <<HunterDeathPatch>g__waitForRespawn|69_2>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_0050: 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;
((MonoBehaviourPun)Character.localCharacter).photonView.RPC("RPCA_ReviveAtPosition", (RpcTarget)0, new object[2]
{
RespawnCharacterPos(nextSection: false),
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();
}
}
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static UnityAction <>9__56_0;
public static Func<Character, int> <>9__84_0;
internal void <PassportUIPatch>b__56_0()
{
ChangeRole();
}
internal int <DontRespawnHuntersPatch_Effigy>b__84_0(Character c)
{
return 1;
}
}
[CompilerGenerated]
private sealed class <ItemCooldown>d__79 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public ItemInstanceData itemData;
private FloatItemData <regainedUsage>5__2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ItemCooldown>d__79(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<regainedUsage>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<FloatItemData>((DataEntryKey)11, ref <regainedUsage>5__2);
break;
case 1:
{
<>1__state = -1;
float num = (isInLobby ? 1f : _.blowgunCooldown.Value);
FloatItemData obj = <regainedUsage>5__2;
obj.Value += 1f / (num * 60f);
break;
}
}
if (<regainedUsage>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<OptionableIntItemData>((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 <LoadNewStage>d__62 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Plugin <>4__this;
private int <currSegment>5__2;
private CharacterAfflictions <afflictions>5__3;
private float <cooldownLength>5__4;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <LoadNewStage>d__62(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<afflictions>5__3 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_01b4: 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_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_0181: Expected O, but got Unknown
int num = <>1__state;
Plugin plugin = <>4__this;
switch (num)
{
default:
return false;
case 0:
<>1__state = -1;
<currSegment>5__2 = Singleton<MapHandler>.Instance.currentSegment;
if (<currSegment>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_0150;
case 3:
{
<>1__state = -1;
hunterCooldown = Time.time;
((MonoBehaviourPun)Character.localCharacter).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2]
{
RespawnCharacterPos(nextSection: false),
true
});
<afflictions>5__3.ClearAllStatus(true);
<afflictions>5__3.UpdateWeight();
<afflictions>5__3.AddStatus((STATUSTYPE)3, Character.localCharacter.GetMaxStamina(), false, true);
<afflictions>5__3.lastAddedStatus[3] = 0f;
<afflictions>5__3.currentDecrementalStatuses[3] = 0.025f;
<afflictions>5__3 = null;
break;
}
IL_0150:
if (<currSegment>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 = <cooldownLength>5__4 + Time.time;
<>2__current = (object)new WaitForSeconds(<cooldownLength>5__4);
<>1__state = 3;
return true;
IL_0065:
((MonoBehaviour)plugin).StartCoroutine(plugin.showMessage(isLocalHunter() ? "COOLDOWN ACTIVE" : "THE HUNTER IS NEAR..."));
if (!isLocalHunter())
{
break;
}
<afflictions>5__3 = Character.localCharacter.refs.afflictions;
<cooldownLength>5__4 = plugin.initialCooldown.Value + plugin.additionalCooldown.Value * Singleton<MapHandler>.Instance.currentSegment;
<afflictions>5__3.ClearAllStatus(true);
<afflictions>5__3.AddStatus((STATUSTYPE)3, 1f, false, true);
<afflictions>5__3.lastAddedStatus[3] = float.PositiveInfinity;
Log.LogDebug((object)("Hunter Cooldown: " + <cooldownLength>5__4));
goto IL_0150;
}
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 <showMessage>d__43 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public string message;
private GameObject <hunterNear>5__2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <showMessage>d__43(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<hunterNear>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));
<hunterNear>5__2 = Object.Instantiate<GameObject>(hunterNearPrefab, hunterNearPrefab.transform.parent);
((TMP_Text)((Component)<hunterNear>5__2.transform.Find("Fog")).GetComponent<TextMeshProUGUI>()).text = message;
<hunterNear>5__2.SetActive(true);
<>2__current = (object)new WaitForSeconds(4f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
Object.Destroy((Object)(object)<hunterNear>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<int> playersReady = new List<int>();
private static int randomBlowgunRunner = -1;
private static List<int> hunterDatabase = new List<int>();
private static float hunterCooldown = -1000f;
private ConfigFile hunterConfigData = new ConfigFile(Path.Combine(Paths.ConfigPath, "BT_Hunter.cfg"), true);
private ConfigEntry<bool> zombieMode;
private ConfigEntry<bool> pickRandom;
private ConfigEntry<bool> teamColors;
private ConfigEntry<int> initialCooldown;
private ConfigEntry<int> additionalCooldown;
private ConfigEntry<bool> disableScoutmaster;
private ConfigEntry<float> climberExtraStamina;
private ConfigEntry<float> climberDamageMultiplier;
private ConfigEntry<float> climberRespawnCurse;
private ConfigEntry<bool> startWithBlowgun;
private ConfigEntry<float> blowgunCooldown;
private ConfigEntry<float> hunterExtraStamina;
private ConfigEntry<float> hunterDamageMultiplier;
private ConfigEntry<bool> enableHunterAttack;
private ConfigEntry<float> attackDrowsiness;
private ConfigEntry<float> attackKnockbackMultiplier;
private ConfigEntry<string> attackType;
private ConfigEntry<float> attackAmount;
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.1";
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 > 0f)
{
result = false;
}
}
return result;
}
[IteratorStateMachine(typeof(<showMessage>d__43))]
private IEnumerator showMessage(string message)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <showMessage>d__43(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<bool>("_Gamemode", "ZombieMode", false, "When Enabled, once Climbers die, they join the Hunter's Team");
pickRandom = hunterConfigData.Bind<bool>("_Gamemode", "PickRandomHunter", false, "Upon Game Start, a random Hunter will be chosen");
teamColors = hunterConfigData.Bind<bool>("_Gamemode", "TeamColors", false, "Colors players Blue or Red depending on which side their on. Useful for Zombie Mode");
initialCooldown = hunterConfigData.Bind<int>("_Gamemode", "InitialHunterCooldownOnBeach", 10, "Change the Cooldown of how long the Hunter is knocked out");
additionalCooldown = hunterConfigData.Bind<int>("_Gamemode", "AddedCooldownPerCampfire", 3, "Increases the amount of Cooldown applied after each Campfire Section");
disableScoutmaster = hunterConfigData.Bind<bool>("_Gamemode", "DisableScoutmaster", true, "Scoutmaster may be problematic with Hunter/Climber strategies!");
climberExtraStamina = hunterConfigData.Bind<float>("ClimberStats", "ExtraStamina", 0f, "Applies this extra Stamina when the Climber is rested");
climberDamageMultiplier = hunterConfigData.Bind<float>("ClimberStats", "FallDamageMultiplier", 0.5f, "Reduced/Increases the amount of Damage the Climber takes. (Not Including the Hunter Attack)");
climberRespawnCurse = hunterConfigData.Bind<float>("ClimberStats", "RespawnCurse", 0.15f, "Amount of Curse to inflict upon Climbers for Dying and Respawning");
startWithBlowgun = hunterConfigData.Bind<bool>("ClimberStats", "StartWithBlowgun", true, "Determines if 1 Random Climber starts with a Blowdart");
blowgunCooldown = hunterConfigData.Bind<float>("ClimberStats", "BlowgunCooldownInMins", 7f, "When the Blowgun will be usable again");
hunterExtraStamina = hunterConfigData.Bind<float>("HunterStats", "ExtraStamina", 0.5f, "Applies this extra Stamina when the Hunter is rested");
hunterDamageMultiplier = hunterConfigData.Bind<float>("HunterStats", "FallDamageMultiplier", 0.25f, "Reduced/Increases the amount of Damage the Hunter takes");
enableHunterAttack = hunterConfigData.Bind<bool>("HunterStats", "EnableHunterAttack", true, "Determines if Hunters can use their Right-Click Attack");
attackDrowsiness = hunterConfigData.Bind<float>("HunterStats", "HunterDrowsinessDebuff", 0.5f, "The amount of Stamina Bar needed when the Hunter uses their Attack and amount of Drownsiness Applied");
attackKnockbackMultiplier = hunterConfigData.Bind<float>("HunterStats", "AttackKnockbackMultiplier", 2f, "Modifies the amount of Knockback received when within range of the Hunter Attack");
attackType = hunterConfigData.Bind<string>("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<float>("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<Texture2D>("Climber_Icon");
Texture2D val2 = assets.LoadAsset<Texture2D>("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()
{
assets.Unload(true);
}
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 AddHunterUpdaterPatch(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)
//IL_00e4: 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_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
Scene activeScene = SceneManager.GetActiveScene();
isInLobby = ((Scene)(ref activeScene)).name == "Airport";
((Component)__instance).gameObject.AddComponent<HunterPlayerUpdater>();
SyncPlayerData(__instance);
if (__instance.IsLocal)
{
if (isInLobby)
{
__instance.view.RPC("RPCA_SetPlayerReadyStatus", (RpcTarget)0, new object[2]
{
__instance.view.Owner.ActorNumber,
false
});
}
else
{
__instance.view.RPC("RPCA_SetPlayerReadyStatus", (RpcTarget)0, new object[2]
{
__instance.view.Owner.ActorNumber,
true
});
}
smallRoleIcon = new GameObject("UI_RoleIcon", new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(Image)
}).GetComponent<Image>();
((Component)smallRoleIcon).transform.SetParent(((Component)GUIManager.instance).transform.Find("Canvas_HUD/BarGroup/Bar"));
((Component)smallRoleIcon).transform.localScale = Vector3.one * 0.5f;
((Component)smallRoleIcon).GetComponent<RectTransform>().anchoredPosition = new Vector2(-275f, 55f);
smallRoleIcon.sprite = (isLocalHunter() ? hunterSprite : climberSprite);
Log.LogDebug((object)"Small Role Icon added to HUD");
}
}
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<ConfigDefinition, ConfigEntryBase> 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 (isLocalHunter() ^ isHunter(interactor))
{
__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<GameObject>(__instance.fogRises, __instance.fogRises.transform.parent);
((Object)hunterNearPrefab).name = "Notification_Hunter";
((Behaviour)((Component)hunterNearPrefab.transform.Find("Fog")).GetComponent<LocalizedText>()).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<GameObject>(((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<RectTransform>();
((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<RectTransform>();
component.anchorMin = new Vector2(0f, 0f);
component.anchorMax = new Vector2(1f, 1f);
Object.Destroy((Object)(object)val.GetComponent<Button>());
Object.Destroy((Object)(object)((Component)val.transform.Find("Box/Icon")).gameObject);
roleLabel = new GameObject("Title", new Type[3]
{
typeof(RectTransform),
typeof(CanvasRenderer),
typeof(TextMeshProUGUI)
}).GetComponent<TextMeshProUGUI>();
((TMP_Text)roleLabel).transform.SetParent(val.transform.Find("Box"));
((TMP_Text)roleLabel).transform.localScale = Vector3.one;
component = ((Component)roleLabel).GetComponent<RectTransform>();
component.anchorMin = new Vector2(0.5f, 0f);
component.anchorMax = new Vector2(0.5f, 1f);
component.anchoredPosition = new Vector2(-25f, -25f);
((TMP_Text)roleLabel).text = (isLocalHunter() ? "HUNTER" : "CLIMBER");
((TMP_Text)roleLabel).fontSize = 29f;
((TMP_Text)roleLabel).horizontalAlignment = (HorizontalAlignmentOptions)2;
TextMeshProUGUI component2 = ((Component)((Component)__instance).transform.Find("PassportUI/Canvas/Panel/Panel/BG/Text/Name/Text")).GetComponent<TextMeshProUGUI>();
((TMP_Text)roleLabel).font = ((TMP_Text)component2).font;
((Graphic)roleLabel).color = ((Graphic)component2).color;
roleSwitcher = Object.Instantiate<GameObject>(((Component)((Component)__instance).transform.Find("PassportUI/Canvas/Panel/Panel/BG/UI_Close")).gameObject).GetComponent<Button>();
((Object)roleSwitcher).name = "UI_SwitchRole";
((Component)roleSwitcher).transform.SetParent(val.transform);
component = ((Component)roleSwitcher).GetComponent<RectTransform>();
((Transform)component).localScale = Vector3.one;
component.anchorMin = new Vector2(1f, 0.5f);
component.anchorMax = new Vector2(1f, 0.5f);
component.pivot = new Vector2(1f, 0.5f);
component.anchoredPosition = new Vector2(0f, 0f);
component.sizeDelta = new Vector2(0f, 0f);
component = ((Component)((Transform)component).Find("Box")).GetComponent<RectTransform>();
component.anchorMin = new Vector2(0f, 0f);
component.anchorMax = new Vector2(1f, 1f);
((Component)((Component)roleSwitcher).transform.Find("Box/Icon")).GetComponent<RawImage>().texture = (Texture)(object)assets.LoadAsset<Texture2D>(isLocalHunter() ? "Hunter_Icon" : "Climber_Icon");
((Component)((Component)roleSwitcher).transform.Find("SFX Click")).GetComponent<SFX_PlayOneShot>().sfxs = ((Component)((Component)__instance).transform.Find("PassportUI/Canvas/Panel/Panel/BG/Options/Stuff/Grid/UI_PassportGridButton/SFX Click")).GetComponent<SFX_PlayOneShot>().sfxs;
roleSwitcher.onClick = new ButtonClickedEvent();
ButtonClickedEvent onClick = roleSwitcher.onClick;
object obj = <>c.<>9__56_0;
if (obj == null)
{
UnityAction val2 = delegate
{
ChangeRole();
};
<>c.<>9__56_0 = val2;
obj = (object)val2;
}
((UnityEvent)onClick).AddListener((UnityAction)obj);
Log.LogDebug((object)"Passport UI Modified");
}
[HarmonyPatch(typeof(BoardingPass), "OnOpen")]
[HarmonyPostfix]
private static void BoardingPassUIPatch(BoardingPass __instance)
{
for (int i = 0; i < Mathf.Min(Character.AllCharacters.Count, __instance.players.Length); i++)
{
__instance.players[i].sprite = (isHunter(Character.AllCharacters[i]) ? hunterSprite : climberSprite);
}
if ((Object)(object)boardingPass == (Object)null)
{
boardingPass = __instance;
}
Log.LogDebug((object)"Boarding Pass UI Modified");
}
private static void ChangeRole()
{
bool flag = !isLocalHunter();
Character.localCharacter.view.RPC("RPCA_ChangeRole", (RpcTarget)0, new object[2]
{
Character.localCharacter.view.Owner.ActorNumber,
flag
});
smallRoleIcon.sprite = (flag ? hunterSprite : climberSprite);
if ((Object)(object)roleSwitcher != (Object)null)
{
((Component)((Component)roleSwitcher).transform.Find("Box/Icon")).GetComponent<RawImage>().texture = (Texture)(object)assets.LoadAsset<Texture2D>(flag ? "Hunter_Icon" : "Climber_Icon");
((TMP_Text)roleLabel).text = (flag ? "HUNTER" : "CLIMBER");
EventSystem.current.SetSelectedGameObject((GameObject)null);
}
Log.LogDebug((object)("Role Changed -> " + (flag ? "HUNTER" : "CLIMBER")));
}
[HarmonyPatch(typeof(Campfire), "EveryoneInRange")]
[HarmonyPrefix]
private static bool CampfireWithoutHunterPatch(Campfire __instance, ref bool __result, out string printout)
{
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
bool flag = true;
printout = "";
foreach (Character allPlayerCharacter in PlayerHandler.GetAllPlayerCharacters())
{
if (!((Object)(object)allPlayerCharacter == (Object)null) && !((MonoBehaviourPun)allPlayerCharacter).photonView.Owner.IsInactive && !isHunter(allPlayerCharacter))
{
float num = Vector3.Distance(((Component)__instance).transform.position, allPlayerCharacter.Center);
if (num > 15f && !allPlayerCharacter.data.dead)
{
flag = false;
printout += $"\n{((MonoBehaviourPun)allPlayerCharacter).photonView.Owner.NickName} {Mathf.RoundToInt(num * CharacterStats.unitsToMeters)}m";
}
}
}
if (isLocalHunter() && !debugMode)
{
flag = false;
}
if (!flag)
{
printout = LocalizedText.GetText("CANTLIGHT", true) + "\n" + printout;
}
__result = flag;
return false;
}
[HarmonyPatch(typeof(AirportCheckInKiosk), "LoadIslandMaster")]
[HarmonyPostfix]
private static void HunterRandomizerPatch(AirportCheckInKiosk __instance)
{
if (!PhotonNetwork.IsMasterClient)
{
return;
}
if (_.pickRandom.Value)
{
foreach (Character allCharacter in Character.AllCharacters)
{
allCharacter.view.RPC("RPCA_ChangeRole", (RpcTarget)0, new object[2]
{
Character.localCharacter.view.Owner.ActorNumber,
false
});
}
int index = Random.Range(0, Character.AllCharacters.Count);
Character.AllCharacters[index].view.RPC("RPCA_ChangeRole", (RpcTarget)0, new object[2]
{
Character.localCharacter.view.Owner.ActorNumber,
true
});
Log.LogDebug((object)"Server: Chosen Random Hunter");
}
Log.LogDebug((object)("Runners Total: " + (Character.AllCharacters.Count - hunterDatabase.Count)));
if (Character.AllCharacters.Count - hunterDatabase.Count > 0)
{
int index2;
do
{
index2 = Random.Range(0, Character.AllCharacters.Count);
}
while (isHunter(Character.AllCharacters[index2]));
randomBlowgunRunner = Character.AllCharacters[index2].view.Owner.ActorNumber;
Log.LogDebug((object)("Server: Chosen Random Blowgun Runner -> " + randomBlowgunRunner + ": " + Character.AllCharacters[index2].characterName));
}
}
[HarmonyPatch(typeof(RunManager), "StartRun")]
[HarmonyPatch(typeof(Campfire), "Light_Rpc")]
[HarmonyPostfix]
private static void ReachedNextStagePatch()
{
if (!isInLobby)
{
if (Singleton<MapHandler>.Instance.currentSegment == 0)
{
Character.localCharacter.view.RPC("RPC_SpawnBlowgun", (RpcTarget)2, new object[2]
{
Character.localCharacter.view.Owner.ActorNumber,
false
});
}
((MonoBehaviour)_).StartCoroutine(_.LoadNewStage());
}
else
{
Character.localCharacter.view.RPC("RPC_SpawnBlowgun", (RpcTarget)2, new object[2]
{
Character.localCharacter.view.Owner.ActorNumber,
true
});
}
}
[IteratorStateMachine(typeof(<LoadNewStage>d__62))]
private IEnumerator LoadNewStage()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <LoadNewStage>d__62(0)
{
<>4__this = this
};
}
[HarmonyPatch(typeof(FogSphere), "Update")]
[HarmonyPostfix]
private static void DisableFog()
{
if (isLocalHunter())
{
((Component)Singleton<OrbFogHandler>.Instance.sphere).gameObject.SetActive(false);
}
}
[HarmonyPatch(typeof(LavaRising), "Update")]
[HarmonyPostfix]
private static void DisableLavaRise()
{
if (isLocalHunter())
{
Singleton<LavaRising>.Instance.timeTraveled = 0f;
}
}
[HarmonyPatch(typeof(CharacterItems), "DropAllItems")]
[HarmonyPrefix]
private static bool HunterDoesntDropItems(CharacterItems __instance, bool includeBackpack)
{
if (isInLobby)
{
return false;
}
if (__instance.character.IsLocal)
{
if (isLocalHunter() && !hunterDropItems)
{
return false;
}
hunterDropItems = false;
}
return true;
}
[HarmonyPatch(typeof(Character), "HandlePassedOut")]
[HarmonyPrefix]
private static void HunterCantDieOnCooldownPatch(Character __instance)
{
if (isInLobby || (hunterCooldown > Time.time && isLocalHunter()))
{
__instance.data.deathTimer = 0f;
}
if (__instance.data.deathTimer > 1f && isLocalHunter())
{
hunterDropItems = true;
__instance.refs.items.DropAllItems(true);
}
}
[HarmonyPatch(typeof(Character), "UpdateVariablesFixed")]
[HarmonyPostfix]
private static void DisableHunterDeathTimer(Character __instance)
{
if (isHunter(__instance) && __instance.data.fullyPassedOut && !Object.op_Implicit((Object)(object)__instance.data.carrier))
{
CharacterData data = __instance.data;
data.deathTimer -= Time.fixedDeltaTime / 60f;
}
}
[HarmonyPatch(typeof(Character), "CheckEndGame")]
[HarmonyPrefix]
private static bool HunterDeathPatch(Character __instance)
{
if (!__instance.data.dead)
{
return true;
}
bool flag = true;
for (int i = 0; i < Character.AllCharacters.Count; i++)
{
if (!Character.AllCharacters[i].data.dead && !isHunter(Character.AllCharacters[i]))
{
flag = false;
}
}
if (debugMode)
{
flag = false;
}
if (flag)
{
if (PhotonNetwork.IsMasterClient)
{
__instance.EndGame();
}
return false;
}
if (!__instance.IsLocal)
{
return false;
}
if (isLocalHunter())
{
((MonoBehaviour)_).StartCoroutine(waitForRespawn());
}
else if (_.zombieMode.Value)
{
((MonoBehaviour)_).StartCoroutine(waitForRespawn());
}
else if (debugMode)
{
((MonoBehaviour)_).StartCoroutine(waitForRespawn());
}
return false;
[IteratorStateMachine(typeof(<<HunterDeathPatch>g__waitForRespawn|69_0>d))]
static IEnumerator waitForRespawn()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <<HunterDeathPatch>g__waitForRespawn|69_0>d(0);
}
[IteratorStateMachine(typeof(<<HunterDeathPatch>g__waitForRespawn|69_1>d))]
static IEnumerator waitForRespawn()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <<HunterDeathPatch>g__waitForRespawn|69_1>d(0);
}
[IteratorStateMachine(typeof(<<HunterDeathPatch>g__waitForRespawn|69_2>d))]
static IEnumerator waitForRespawn()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <<HunterDeathPatch>g__waitForRespawn|69_2>d(0);
}
}
[HarmonyPatch(typeof(CharacterData))]
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
[HarmonyPrefix]
private static bool HuntersNotSpectatable(CharacterData __instance, ref bool __result)
{
if (isHunter(__instance.character) && !__instance.character.IsLocal)
{
__result = false;
return false;
}
return true;
}
[HarmonyPatch(typeof(GUIManager), "UpdateSpectate")]
[HarmonyPostfix]
private static void HunterSpectateGUI(GUIManager __instance)
{
if (isLocalHunter())
{
__instance.spectatingInputs.SetActive(true);
}
}
[HarmonyPatch(typeof(MainCameraMovement), "HandleSpecSelection")]
[HarmonyPostfix]
private static void HunterSpectateInputs(MainCameraMovement __instance, ref bool __result)
{
if (__result && isLocalHunter())
{
if (Character.localCharacter.input.spectateLeftWasPressed && __instance.sinceSwitch > 0.2f)
{
Transitions.instance.PlayTransition((TransitionType)3, (Action)__instance.SwapSpecPlayerLeft, 5f, 5f);
__instance.sinceSwitch = 0f;
}
if (Character.localCharacter.input.spectateRightWasPressed && __instance.sinceSwitch > 0.2f)
{
Transitions.instance.PlayTransition((TransitionType)3, (Action)__instance.SwapSpecPlayerRight, 5f, 5f);
__instance.sinceSwitch = 0f;
}
}
}
private static Vector3 RespawnCharacterPos(bool nextSection)
{
//IL_0014: 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_0017: Invalid comparison between Unknown and I4
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Invalid comparison between Unknown and I4
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
int num = Singleton<MapHandler>.Instance.currentSegment;
if (nextSection)
{
num++;
}
Segment val = (Segment)(byte)num;
Vector3 val2 = (((int)val != 5) ? Singleton<MapHandler>.Instance.segments[num].reconnectSpawnPos.position : Singleton<MapHandler>.Instance.respawnThePeak.position);
if ((int)val == 0 || (int)val == 4)
{
val2 += Vector3.up;
}
return val2;
}
[HarmonyPatch(typeof(Character), "ClampStamina")]
[HarmonyPostfix]
private static void ExtraStaminaPatch(Character __instance)
{
if (!__instance.CanRegenStamina())
{
return;
}
if (isLocalHunter())
{
float num = _.hunterExtraStamina.Value;
if (_.zombieMode.Value)
{
num /= (float)hunterDatabase.Count;
}
if (isInLobby && __instance.data.extraStamina > num)
{
__instance.SetExtraStamina(num);
}
if (__instance.data.extraStamina < num)
{
__instance.AddExtraStamina(Time.fixedDeltaTime * 0.1f);
}
}
else
{
if (isInLobby && __instance.data.extraStamina > _.climberExtraStamina.Value)
{
__instance.SetExtraStamina(_.climberExtraStamina.Value);
}
if (__instance.data.extraStamina < _.climberExtraStamina.Value)
{
__instance.AddExtraStamina(Time.fixedDeltaTime * 0.1f);
}
}
}
[HarmonyPatch(typeof(CharacterAfflictions), "AddStatus")]
[HarmonyPrefix]
private static void ModifyHealthPatch(CharacterAfflictions __instance, STATUSTYPE statusType, ref float amount, bool fromRPC)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Invalid comparison between Unknown and I4
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
if ((int)statusType == 6 && isInLobby)
{
__instance.currentStatuses[statusType] += amount;
}
if ((int)statusType != 0)
{
return;
}
if (isHunter(__instance.character))
{
amount *= _.hunterDamageMultiplier.Value;
if (hunterCooldown - Time.time > -7f)
{
amount = 0f;
}
Log.LogDebug((object)("Time since hunterCooldown: " + (hunterCooldown - Time.time)));
}
else
{
amount *= _.climberDamageMultiplier.Value;
}
Log.LogDebug((object)("Reduced Damage: " + amount));
}
[HarmonyPatch(typeof(CharacterGrabbing), "RPCA_StartReaching")]
[HarmonyPostfix]
private static void HunterReachAttackPatch(CharacterGrabbing __instance)
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: 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_0118: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
//IL_0181: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Unknown result type (might be due to invalid IL or missing references)
//IL_018a: Unknown result type (might be due to invalid IL or missing references)
//IL_019e: Unknown result type (might be due to invalid IL or missing references)
//IL_0168: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Unknown result type (might be due to invalid IL or missing references)
if (!_.enableHunterAttack.Value || !isHunter(__instance.character) || __instance.character.GetMaxStamina() <= 0f)
{
return;
}
Vector3 val = __instance.character.Center + __instance.character.data.lookDirection * 1.5f;
__instance.character.PlayPoofVFX(val);
float num = Mathf.Pow(5f, 3f);
foreach (Character allCharacter in Character.AllCharacters)
{
float num2 = Vector3.Distance(val, allCharacter.Center);
if (!(num2 < 5f))
{
continue;
}
float num3 = (num - Mathf.Pow(num2, 3f)) / num;
if (!isHunter(allCharacter))
{
if (!Enum.TryParse<STATUSTYPE>(_.attackType.Value, ignoreCase: false, out STATUSTYPE result))
{
result = (STATUSTYPE)0;
}
float num4 = num3 * _.attackAmount.Value;
if ((int)result == 0)
{
num4 /= _.climberDamageMultiplier.Value;
}
allCharacter.refs.afflictions.AddStatus(result, num4, false, true);
}
else
{
num3 *= 0.5f;
}
if (!allCharacter.data.isClimbing)
{
allCharacter.Fall(0.1f, 0f);
}
Vector3 val2 = __instance.character.Center;
if ((Object)(object)allCharacter == (Object)(object)__instance.character)
{
val2 = val;
}
float num5 = num3 * 666f;
Vector3 val3 = allCharacter.Center - val2;
allCharacter.AddForce(num5 * ((Vector3)(ref val3)).normalized * _.attackKnockbackMultiplier.Value, 1f, 1f);
}
__instance.character.refs.afflictions.AddStatus((STATUSTYPE)6, _.attackDrowsiness.Value, false, true);
Log.LogDebug((object)"Hunter Attack!");
}
[HarmonyPatch(typeof(Item), "GetItemName")]
[HarmonyPostfix]
private static void BlowgunRenamePatch(Item __instance, ItemInstanceData data, ref string __result)
{
ItemInstanceData val = data;
if (val == null)
{
val = __instance.data;
}
OptionableIntItemData val2 = default(OptionableIntItemData);
if (val.TryGetDataEntry<OptionableIntItemData>((DataEntryKey)0, ref val2) && val2.Value == 1)
{
__result = "REUSABLE " + __result;
}
}
[HarmonyPatch(typeof(Item), "Consume")]
[HarmonyPrefix]
private static bool BlowgunReusePatch(Item __instance)
{
OptionableIntItemData data = __instance.GetData<OptionableIntItemData>((DataEntryKey)0);
if (!data.HasData || data.Value != 1)
{
return true;
}
__instance.SetUseRemainingPercentage(0f);
((MonoBehaviour)_).StartCoroutine(_.ItemCooldown(__instance.data));
Log.LogDebug((object)"Climber Blowdart on Recharge");
return false;
}
[IteratorStateMachine(typeof(<ItemCooldown>d__79))]
private IEnumerator ItemCooldown(ItemInstanceData itemData)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ItemCooldown>d__79(0)
{
itemData = itemData
};
}
[HarmonyPatch(typeof(ScoutmasterSpawner), "SpawnScoutmaster")]
[HarmonyPrefix]
public static bool DisableScoutmasterPatch()
{
if (_.disableScoutmaster.Value)
{
Log.LogDebug((object)"Disabled Scoutmaster Spawning");
return false;
}
return true;
}
[HarmonyPatch(typeof(Character), "PlayerIsDeadOrDown")]
[HarmonyPrefix]
private static bool HuntersNotDeadPatch(ref bool __result)
{
__result = false;
foreach (Character allCharacter in Character.AllCharacters)
{
if ((allCharacter.data.dead || allCharacter.data.fullyPassedOut) && !isHunter(allCharacter))
{
__result = true;
}
}
return false;
}
[HarmonyPatch(typeof(RespawnChest), "RespawnAllPlayersHere")]
[HarmonyPrefix]
private static bool DontRespawnHuntersPatch(RespawnChest __instance)
{
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
foreach (Character allCharacter in Character.AllCharacters)
{
if ((allCharacter.data.dead || allCharacter.data.fullyPassedOut) && !isHunter(allCharacter))
{
((MonoBehaviourPun)allCharacter).photonView.RPC("RPCA_ReviveAtPosition", (RpcTarget)0, new object[2]
{
((Component)__instance).transform.position + ((Component)__instance).transform.up * 8f,
true
});
}
}
return false;
}
[HarmonyPatch(typeof(RespawnChest), "IsInteractible")]
[HarmonyPrefix]
private static bool HunterNotUseStatuePatch(RespawnChest __instance, Character interactor, ref bool __result)
{
if (isHunter(interactor))
{
__result = false;
return false;
}
return true;
}
[HarmonyPatch(typeof(ScoutEffigy), "FinishConstruction")]
[HarmonyPrefix]
private static bool DontRespawnHuntersPatch_Effigy(ScoutEffigy __instance, ref GameObject __result)
{
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: 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)
__result = null;
if (!((Constructable)__instance).constructing)
{
return false;
}
if ((Object)(object)((Constructable)__instance).currentPreview == (Object)null)
{
return false;
}
List<Character> list = new List<Character>();
foreach (Character allCharacter in Character.AllCharacters)
{
if ((allCharacter.data.dead || allCharacter.data.fullyPassedOut) && !isHunter(allCharacter))
{
list.Add(allCharacter);
}
}
if (list.Count == 0)
{
return false;
}
((MonoBehaviourPun)Util.RandomSelection<Character>((IEnumerable<Character>)list, (Func<Character, int>)((Character c) => 1))).photonView.RPC("RPCA_ReviveAtPosition", (RpcTarget)0, new object[2]
{
((RaycastHit)(ref ((Constructable)__instance).currentConstructHit)).point + Vector3.up * 1f,
false
});
if (Object.op_Implicit((Object)(object)Singleton<AchievementManager>.Instance))
{
Singleton<AchievementManager>.Instance.AddToRunBasedInt((RUNBASEDVALUETYPE)2, 1);
}
return false;
}
[HarmonyPatch(typeof(Character), "RPCA_Revive")]
[HarmonyPostfix]
private static void ModifyReviveCurse(Character __instance, bool applyStatus)
{
if (applyStatus && !isLocalHunter())
{
if (_.climberRespawnCurse.Value > 0.05f)
{
__instance.refs.afflictions.AddStatus((STATUSTYPE)5, _.climberRespawnCurse.Value - 0.05f, false, true);
}
else if (_.climberRespawnCurse.Value < 0.05f)
{
__instance.refs.afflictions.SubtractStatus((STATUSTYPE)5, 0.05f - _.climberRespawnCurse.Value, false, false);
}
Log.LogDebug((object)"Modified Curse Value");
}
}
[HarmonyPatch(typeof(SharedSettingsMenu), "OnEnable")]
[HarmonyPrefix]
private static void AddedHunterMenuPatch(SharedSettingsMenu __instance)
{
//IL_00ab: 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)
if ((Object)(object)hunterTab == (Object)null)
{
hunterTab = Object.Instantiate<GameObject>(((Component)((Component)__instance).transform.Find("Content/TABS/General")).gameObject, ((Component)__instance).transform.Find("Content/TABS")).GetComponent<SettingsTABSButton>();
((Object)hunterTab).name = "Hunter";
((Behaviour)((Component)((TAB_Button)hunterTab).text).GetComponent<LocalizedText>()).enabled = false;
((TMP_Text)((TAB_Button)hunterTab).text).text = "HUNTER MOD";
((TABS<SettingsTABSButton>)(object)__instance.m_tabs).AddButton(hunterTab);
((Component)((Component)__instance).transform.Find("Content/Parent")).GetComponent<RectTransform>().pivot = new Vector2(0.5f, 1f);
((Component)((Component)__instance).transform.Find("Content/Parent")).GetComponent<RectTransform>().anchoredPosition = new Vector2(0f, -62f);
Log.LogDebug((object)"Added Hunter Mod Tab");
}
}
[HarmonyPatch(typeof(SharedSettingsMenu), "RefreshSettings")]
[HarmonyPrefix]
private static bool HunterMenuSettingsPatch(SharedSettingsMenu __instance)
{
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)((TABS<SettingsTABSButton>)(object)__instance.m_tabs).selectedButton != (Object)(object)hunterTab)
{
((Component)__instance).transform.Find("Content/Parent").localScale = Vector3.one * 1f;
return true;
}
((Component)__instance).transform.Find("Content/Parent").localScale = Vector3.one * 0.475f;
__instance.settings.Clear();
__instance.settings.Add((IExposedSetting)(object)new HunterSettingProfiles());
string text = "";
foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> hunterConfigDatum in _.hunterConfigData)
{
if (hunterConfigDatum.Key.Section != text)
{
__instance.settings.Add((IExposedSetting)(object)new HunterCategorySetting(hunterConfigDatum.Key.Section));
text = hunterConfigDatum.Key.Section;
}
object boxedValue = hunterConfigDatum.Value.BoxedValue;
if (!(boxedValue is float))
{
if (!(boxedValue is int))
{
if (!(boxedValue is bool))
{
if (boxedValue is string)
{
__instance.settings.Add((IExposedSetting)(object)new HunterEnumSetting(hunterConfigDatum.Key, (ConfigEntry<string>)(object)hunterConfigDatum.Value));
}
}
else
{
__instance.settings.Add((IExposedSetting)(object)new HunterBoolSetting(hunterConfigDatum.Key, (ConfigEntry<bool>)(object)hunterConfigDatum.Value));
}
}
else
{
__instance.settings.Add((IExposedSetting)(object)new HunterNumSetting(hunterConfigDatum.Key, hunterConfigDatum.Value, isInt: true));
}
}
else
{
__instance.settings.Add((IExposedSetting)(object)new HunterNumSetting(hunterConfigDatum.Key, hunterConfigDatum.Value, isInt: false));
}
}
Log.LogDebug((object)"First Pass: Loaded Hunter Tab Options");
return false;
}
[HarmonyPatch(typeof(SharedSettingsMenu), "ShowSettings")]
[HarmonyPostfix]
private static void HunterMenuSettingsPostPatch(SharedSettingsMenu __instance)
{
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)((TABS<SettingsTABSButton>)(object)__instance.m_tabs).selectedButton != (Object)(object)hunterTab)
{
return;
}
Transform val = ((Component)__instance).transform.Find("Content/Parent");
int num = 0;
EnumSettingUI[] componentsInChildren = ((Component)val).GetComponentsInChildren<EnumSettingUI>();
foreach (EnumSettingUI val2 in componentsInChildren)
{
if (((TMP_Text)((Component)val2).GetComponentInParent<SettingsUICell>().m_text).text.Contains("CATEGORY"))
{
((TMP_Text)((Component)val2).GetComponentInParent<SettingsUICell>().m_text).fontSizeMax = 40f;
switch (num)
{
case 0:
((Graphic)((Component)val2).GetComponentInParent<SettingsUICell>().m_text).color = new Color(0.75f, 0.594f, 0.188f);
break;
case 1:
((Graphic)((Component)val2).GetComponentInParent<SettingsUICell>().m_text).color = new Color(0.188f, 0.458f, 0.75f);
break;
case 2:
((Graphic)((Component)val2).GetComponentInParent<SettingsUICell>().m_text).color = new Color(0.75f, 0.192f, 0.238f);
break;
}
((Component)val2).gameObject.SetActive(false);
num++;
}
}
LocalizedText[] componentsInChildren2 = ((Component)((Component)__instance).transform.Find("Content/Parent")).GetComponentsInChildren<LocalizedText>();
foreach (LocalizedText val3 in componentsInChildren2)
{
((Behaviour)val3).enabled = false;
val3.tmp.text = val3.currentText.Replace("LOC: ", "");
}
for (int k = 0; k < val.childCount; k++)
{
((TMP_Text)((Component)val.GetChild(k).Find("OnlyOnMainMenu")).GetComponent<TextMeshProUGUI>()).text = "THESE SETTINGS CAN ONLY BE ADJUSTED BY THE HOST.";
}
if ((Object)(object)Player.localPlayer != (Object)null && !PhotonNetwork.IsMasterClient)
{
Selectable[] componentsInChildren3 = ((Component)((Component)__instance).transform.Find("Content/Parent")).GetComponentsInChildren<Selectable>();
foreach (Selectable val4 in componentsInChildren3)
{
val4.interactable = false;
}
}
Log.LogDebug((object)"Second Pass: Loaded Hunter Tab Options");
}
private void UpdateHunterModSettings()
{
if ((Object)(object)hunterTab == (Object)null)
{
return;
}
SharedSettingsMenu componentInParent = ((Component)hunterTab).GetComponentInParent<SharedSettingsMenu>();
Log.LogDebug((object)("Failed to load Hunter Tab -> " + ((Object)(object)componentInParent == (Object)null || (Object)(object)componentInParent.m_tabs == (Object)null || (Object)(object)((TABS<SettingsTABSButton>)(object)componentInParent.m_tabs).selectedButton == (Object)null || (Object)(object)((TABS<SettingsTABSButton>)(object)componentInParent.m_tabs).selectedButton != (Object)(object)hunterTab)));
if ((Object)(object)componentInParent == (Object)null || (Object)(object)componentInParent.m_tabs == (Object)null || (Object)(object)((TABS<SettingsTABSButton>)(object)componentInParent.m_tabs).selectedButton == (Object)null || (Object)(object)((TABS<SettingsTABSButton>)(object)componentInParent.m_tabs).selectedButton != (Object)(object)hunterTab)
{
return;
}
Transform val = ((Component)componentInParent).transform.Find("Content/Parent");
for (int i = 1; i < val.childCount; i++)
{
FloatSettingUI componentInChildren = ((Component)val.GetChild(i)).GetComponentInChildren<FloatSettingUI>();
if (componentInChildren != null)
{
componentInChildren.slider.SetValueWithoutNotify(((HunterNumSetting)(object)componentInParent.settings[i]).GetValue());
componentInChildren.inputField.SetTextWithoutNotify(((FloatSetting)(HunterNumSetting)(object)componentInParent.settings[i]).Expose(componentInChildren.slider.value));
continue;
}
EnumSettingUI componentInChildren2 = ((Component)val.GetChild(i)).GetComponentInChildren<EnumSettingUI>();
if (componentInChildren2 != null)
{
if (componentInParent.settings[i] is HunterBoolSetting)
{
componentInChildren2.dropdown.SetValueWithoutNotify(((EnumSetting<OffOnMode>)(object)(HunterBoolSetting)(object)componentInParent.settings[i]).GetValue());
}
else if (componentInParent.settings[i] is HunterEnumSetting)
{
componentInChildren2.dropdown.SetValueWithoutNotify(((EnumSetting<STATUSTYPE>)(HunterEnumSetting)(object)componentInParent.settings[i]).GetValue());
}
}
}
UpdateProfileSetting();
Log.LogDebug((object)"Hunter Tab Updated");
}
private int UpdateProfileSetting()
{
SharedSettingsMenu componentInParent = ((Component)hunterTab).GetComponentInParent<SharedSettingsMenu>();
Transform val = ((Component)componentInParent).transform.Find("Content/Parent");
EnumSettingUI componentInChildren = ((Component)val.GetChild(0)).GetComponentInChildren<EnumSettingUI>();
bool flag = false;
foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> hunterConfigDatum in _.hunterConfigData)
{
object boxedValue = hunterConfigDatum.Value.BoxedValue;
if (!(boxedValue is float num))
{
if (!(boxedValue is int num2))
{
if (!(boxedValue is bool flag2))
{
if (boxedValue is string text && text != (string)hunterConfigDatum.Value.DefaultValue)
{
flag = true;
}
}
else if (flag2 != (bool)hunterConfigDatum.Value.DefaultValue)
{
flag = true;
}
}
else if (num2 != (int)hunterConfigDatum.Value.DefaultValue)
{
flag = true;
}
}
else if (num != (float)hunterConfigDatum.Value.DefaultValue)
{
flag = true;
}
}
int num3 = ((!flag) ? 1 : 0);
componentInChildren.dropdown.SetValueWithoutNotify(num3);
return num3;
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}