using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using ConfigSpace;
using Curse;
using Gui;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using WeForgotBingBong;
using Zorro.Core;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("WeForgotBingBong")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0+b8b5abac810e691fc39b15a3c6c57d351cd7fbd4")]
[assembly: AssemblyProduct("WeForgotBingBong")]
[assembly: AssemblyTitle("WeForgotBingBong")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.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 Gui
{
public class UIManager : MonoBehaviour
{
[CompilerGenerated]
private sealed class <TryFindFontUntilSuccess>d__14 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public UIManager <>4__this;
private TMP_FontAsset <newFont>5__1;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <TryFindFontUntilSuccess>d__14(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<newFont>5__1 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
break;
case 1:
<>1__state = -1;
<newFont>5__1 = null;
break;
}
<newFont>5__1 = <>4__this.CacheGameFont();
if ((Object)(object)<newFont>5__1 != (Object)null)
{
if ((Object)(object)<newFont>5__1 != (Object)(object)gameFont)
{
gameFont = <newFont>5__1;
<>4__this.ApplyFontToAllTexts();
Debug.Log((object)("[WeForgotBingBong] Apply game font: " + ((Object)gameFont).name));
}
return false;
}
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 1;
return true;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
public static UIManager instance;
private bool isHeld;
private float distance;
private bool hasValidData = false;
private string currentCurseType = "None";
private float curseTimer = 0f;
private bool isInvincible = false;
private float invincibleTimer = 0f;
private Canvas canvas = null;
private TextMeshProUGUI statusTextTMP = null;
private TextMeshProUGUI timerTextTMP = null;
private TextMeshProUGUI distanceTextTMP = null;
private static TMP_FontAsset? gameFont;
private void Awake()
{
if ((Object)(object)instance == (Object)null)
{
instance = this;
Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
CreateUI();
((MonoBehaviour)this).StartCoroutine(TryFindFontUntilSuccess());
}
else
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
[IteratorStateMachine(typeof(<TryFindFontUntilSuccess>d__14))]
private IEnumerator TryFindFontUntilSuccess()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <TryFindFontUntilSuccess>d__14(0)
{
<>4__this = this
};
}
private TMP_FontAsset? CacheGameFont()
{
TMP_FontAsset[] array = Resources.FindObjectsOfTypeAll<TMP_FontAsset>();
if (array.Length == 0)
{
return null;
}
return ((IEnumerable<TMP_FontAsset>)array).FirstOrDefault((Func<TMP_FontAsset, bool>)((TMP_FontAsset f) => ((Object)f).name.Contains("DarumaDropOne-Regular", StringComparison.OrdinalIgnoreCase)));
}
private void ApplyFontToAllTexts()
{
if (!((Object)(object)gameFont == (Object)null))
{
TMP_Text[] array = Resources.FindObjectsOfTypeAll<TMP_Text>();
foreach (TMP_Text val in array)
{
val.font = gameFont;
val.fontMaterial = ((TMP_Asset)gameFont).material;
}
}
}
private void CreateUI()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: 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)
GameObject val = new GameObject("UIManagerCanvas");
val.transform.SetParent(((Component)this).transform);
canvas = val.AddComponent<Canvas>();
canvas.renderMode = (RenderMode)0;
canvas.pixelPerfect = true;
CanvasScaler val2 = val.AddComponent<CanvasScaler>();
val2.uiScaleMode = (ScaleMode)1;
val2.referenceResolution = new Vector2(1920f, 1080f);
val.AddComponent<GraphicRaycaster>();
statusTextTMP = CreateTMPText("StatusText", new Vector2(0f, 20f), 22, (TextAlignmentOptions)514);
timerTextTMP = CreateTMPText("TimerText", new Vector2(0f, 50f), 28, (TextAlignmentOptions)514);
distanceTextTMP = CreateTMPText("DistanceText", new Vector2(0f, 70f), 18, (TextAlignmentOptions)514);
}
private TextMeshProUGUI CreateTMPText(string name, Vector2 anchoredPos, int fontSize, TextAlignmentOptions align)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject(name);
val.transform.SetParent(((Component)canvas).transform, false);
TextMeshProUGUI val2 = val.AddComponent<TextMeshProUGUI>();
((TMP_Text)val2).text = "";
((TMP_Text)val2).fontSize = fontSize;
((TMP_Text)val2).alignment = align;
((Graphic)val2).color = Color.white;
if ((Object)(object)gameFont != (Object)null)
{
((TMP_Text)val2).font = gameFont;
((TMP_Text)val2).fontMaterial = ((TMP_Asset)gameFont).material;
}
RectTransform rectTransform = ((TMP_Text)val2).rectTransform;
rectTransform.anchorMin = new Vector2(0.5f, 0f);
rectTransform.anchorMax = new Vector2(0.5f, 0f);
rectTransform.pivot = new Vector2(0.5f, 0f);
rectTransform.anchoredPosition = anchoredPos;
rectTransform.sizeDelta = new Vector2(800f, 50f);
return val2;
}
public void SetBingBongStatus(bool held, float dist)
{
isHeld = held;
distance = Mathf.Max(0f, dist);
hasValidData = true;
UpdateUI();
}
public void SetCurseInfo(string curseType, float timer)
{
currentCurseType = curseType;
curseTimer = timer;
UpdateUI();
}
public void SetInvincibilityInfo(bool active, float remainingTime)
{
isInvincible = active;
invincibleTimer = remainingTime;
UpdateUI();
}
private void UpdateUI()
{
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: 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_01b1: Unknown result type (might be due to invalid IL or missing references)
//IL_018f: Unknown result type (might be due to invalid IL or missing references)
if (!hasValidData)
{
return;
}
if (isHeld)
{
((TMP_Text)statusTextTMP).text = "<color=#5CB338>BingBong is being carried</color>";
}
else
{
((TMP_Text)statusTextTMP).text = "<color=#FB4141>BingBong has been forgotten</color>";
}
if (isInvincible)
{
if (invincibleTimer > 3f)
{
((Graphic)timerTextTMP).color = Color.gray;
}
else if (invincibleTimer > 1f)
{
((Graphic)timerTextTMP).color = new Color(0.93f, 0.91f, 0.32f);
}
else
{
((Graphic)timerTextTMP).color = new Color(0.98f, 0.26f, 0.25f);
}
((TMP_Text)timerTextTMP).text = $"Invincible {invincibleTimer:F1}s";
((TMP_Text)distanceTextTMP).text = ((distance > 0f) ? $"({distance:F1}m Away from BingBong)" : "");
}
else if (!isHeld)
{
float num = Mathf.Max(0f, curseTimer);
if (num > 3f)
{
((Graphic)timerTextTMP).color = Color.gray;
}
else if (num > 1f)
{
((Graphic)timerTextTMP).color = new Color(0.93f, 0.91f, 0.32f);
}
else
{
((Graphic)timerTextTMP).color = new Color(0.98f, 0.26f, 0.25f);
}
((TMP_Text)timerTextTMP).text = $"Curse in {num:F1}s";
((TMP_Text)distanceTextTMP).text = ((distance > 0f) ? $"({distance:F1}m Away from BingBong)" : "");
}
else
{
((TMP_Text)timerTextTMP).text = "";
((TMP_Text)distanceTextTMP).text = "";
}
}
}
}
namespace Curse
{
public class BingBongCurseLogic : MonoBehaviour
{
private ushort bingBongItemID;
private float timer = 0f;
private readonly Dictionary<Player, float> playerPickupTime = new Dictionary<Player, float>();
private Player[] cachedPlayers = Array.Empty<Player>();
private float lastPlayerUpdateTime = 0f;
private const float PLAYER_UPDATE_INTERVAL = 1f;
private bool lastCurseState = false;
private Item[] cachedBingBongs = (Item[])(object)new Item[0];
private float lastBingBongUpdateTime = 0f;
private const float BINGBONG_UPDATE_INTERVAL = 2f;
private readonly Dictionary<Player, List<MonoBehaviour>> activeCurses = new Dictionary<Player, List<MonoBehaviour>>();
public void Setup(ushort itemID, float interval, bool displayUI)
{
bingBongItemID = itemID;
}
private void Update()
{
//IL_0270: Unknown result type (might be due to invalid IL or missing references)
//IL_0275: Unknown result type (might be due to invalid IL or missing references)
//IL_0340: Unknown result type (might be due to invalid IL or missing references)
//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
//IL_0345: Unknown result type (might be due to invalid IL or missing references)
//IL_0371: Unknown result type (might be due to invalid IL or missing references)
//IL_0377: Invalid comparison between Unknown and I4
//IL_0313: Unknown result type (might be due to invalid IL or missing references)
//IL_037b: Unknown result type (might be due to invalid IL or missing references)
//IL_0381: Invalid comparison between Unknown and I4
//IL_0337: Unknown result type (might be due to invalid IL or missing references)
//IL_032e: Unknown result type (might be due to invalid IL or missing references)
//IL_038e: Unknown result type (might be due to invalid IL or missing references)
//IL_0397: Unknown result type (might be due to invalid IL or missing references)
if (LoadingScreenHandler.loading)
{
return;
}
if (Time.time - lastPlayerUpdateTime >= 1f)
{
cachedPlayers = Object.FindObjectsByType<Player>((FindObjectsSortMode)0);
lastPlayerUpdateTime = Time.time;
}
if (cachedPlayers.Length == 0)
{
return;
}
if (Time.time - lastBingBongUpdateTime >= 2f)
{
List<Item> list = new List<Item>();
Item[] array = Object.FindObjectsByType<Item>((FindObjectsSortMode)0);
foreach (Item val in array)
{
if ((Object)(object)val != (Object)null && (val.itemID == bingBongItemID || ((Object)val).name.Contains("BingBong")) && (Object)(object)((Component)val).transform.root == (Object)(object)((Component)val).transform)
{
list.Add(val);
}
}
cachedBingBongs = list.ToArray();
lastBingBongUpdateTime = Time.time;
}
bool flag = false;
Player val2 = null;
List<string> list2 = new List<string>();
Player[] array2 = cachedPlayers;
foreach (Player val3 in array2)
{
if (!((Object)(object)val3 == (Object)null))
{
if (Plugin.CheckIfPlayerHasBingBong(val3, bingBongItemID))
{
flag = true;
string item = ((Object)val3).name ?? "Unknown Player";
list2.Add(item);
}
if (((MonoBehaviourPun)val3).photonView.IsMine)
{
val2 = val3;
}
}
}
bool flag2 = (Object)(object)RunManager.Instance != (Object)null && RunManager.Instance.timeSinceRunStarted < ConfigClass.invincibilityPeriod.Value;
float remainingTime = 0f;
if (flag2 && (Object)(object)RunManager.Instance != (Object)null)
{
remainingTime = ConfigClass.invincibilityPeriod.Value - RunManager.Instance.timeSinceRunStarted;
}
if (ConfigClass.showUI.Value && (Object)(object)val2 != (Object)null)
{
Vector3 val4;
if ((Object)(object)val2.character != (Object)null && (Object)(object)val2.character.refs.head != (Object)null)
{
val4 = ((Component)val2.character.refs.head).transform.position;
}
else
{
Character character = val2.character;
Vector3? obj;
if (character == null)
{
obj = null;
}
else
{
CharacterRefs refs = character.refs;
if (refs == null)
{
obj = null;
}
else
{
Bodypart head = refs.head;
if (head == null)
{
obj = null;
}
else
{
Transform transform = ((Component)head).transform;
obj = ((transform != null) ? new Vector3?(transform.position) : null);
}
}
}
Vector3? val5 = obj;
? val6;
if (!val5.HasValue)
{
Character character2 = val2.character;
Vector3? obj2;
if (character2 == null)
{
obj2 = null;
}
else
{
Transform transform2 = ((Component)character2).transform;
obj2 = ((transform2 != null) ? new Vector3?(transform2.position) : null);
}
val6 = ((??)obj2) ?? ((Component)val2).transform.position;
}
else
{
val6 = val5.GetValueOrDefault();
}
val4 = (Vector3)val6;
}
float num = float.MaxValue;
Item[] array3 = cachedBingBongs;
foreach (Item val7 in array3)
{
if (!((Object)(object)val7 == (Object)null) && (int)val7.itemState != 1 && (int)val7.itemState != 2)
{
float num2 = Vector3.Distance(val4, ((Component)val7).transform.position);
if (num2 < num)
{
num = num2;
}
}
}
if (num == float.MaxValue)
{
num = -1f;
}
UIManager.instance?.SetBingBongStatus(flag, num);
if (flag2)
{
UIManager.instance?.SetInvincibilityInfo(active: true, remainingTime);
UIManager.instance?.SetCurseInfo("", 0f);
}
else
{
UIManager.instance?.SetInvincibilityInfo(active: false, 0f);
if (!flag)
{
float num3 = Mathf.Max(0f, ConfigClass.curseInterval.Value - timer);
UIManager.instance?.SetCurseInfo(GetCurrentCurseTypeDisplay(), num3);
}
else
{
UIManager.instance?.SetCurseInfo("", 0f);
}
}
}
if (!flag2 && !flag)
{
timer += Time.deltaTime;
if (timer >= ConfigClass.curseInterval.Value)
{
int num4 = 0;
Player[] array4 = cachedPlayers;
foreach (Player val8 in array4)
{
if ((Object)(object)val8 != (Object)null)
{
ApplyCurse(val8);
num4++;
}
}
timer = 0f;
}
}
if (lastCurseState != flag)
{
lastCurseState = flag;
}
}
private void ApplyCurse(Player player)
{
string playerName = ((Object)player).name ?? "Unknown Player";
if (!activeCurses.ContainsKey(player))
{
activeCurses[player] = new List<MonoBehaviour>();
}
ApplyCurseAlternative(player, playerName);
}
private void ApplyCurseAlternative(Player player, string playerName)
{
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
try
{
if (!((Object)(object)player.character != (Object)null) || player.character.refs == null || !((Object)(object)player.character.refs.afflictions != (Object)null))
{
return;
}
List<STATUSTYPE> availableCurseTypes = GetAvailableCurseTypes();
if (availableCurseTypes.Count == 0)
{
return;
}
List<STATUSTYPE> list = SelectCurses(availableCurseTypes);
foreach (STATUSTYPE item in list)
{
ApplySpecificCurse(player, playerName, item);
}
}
catch (Exception)
{
}
}
private List<STATUSTYPE> GetAvailableCurseTypes()
{
List<STATUSTYPE> list = new List<STATUSTYPE>();
if (ConfigClass.enablePoison.Value)
{
list.Add((STATUSTYPE)3);
}
if (ConfigClass.enableInjury.Value)
{
list.Add((STATUSTYPE)0);
}
if (ConfigClass.enableHunger.Value)
{
list.Add((STATUSTYPE)1);
}
if (ConfigClass.enableDrowsy.Value)
{
list.Add((STATUSTYPE)6);
}
if (ConfigClass.enableCurse.Value)
{
list.Add((STATUSTYPE)5);
}
if (ConfigClass.enableCold.Value)
{
list.Add((STATUSTYPE)2);
}
if (ConfigClass.enableHot.Value)
{
list.Add((STATUSTYPE)8);
}
return list;
}
private List<STATUSTYPE> SelectCurses(List<STATUSTYPE> availableCurses)
{
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: 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_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
List<STATUSTYPE> list = new List<STATUSTYPE>();
if (ConfigClass.debugMode.Value)
{
Plugin.Logger.LogInfo((object)("[SelectCurses] Available curses: " + string.Join(", ", availableCurses)));
Plugin.Logger.LogInfo((object)$"[SelectCurses] Selection mode: {ConfigClass.curseSelectionMode.Value}");
Plugin.Logger.LogInfo((object)("[SelectCurses] Single curse type setting: " + ConfigClass.singleCurseType.Value));
}
switch (ConfigClass.curseSelectionMode.Value)
{
case Plugin.CurseSelectionMode.Single:
{
STATUSTYPE curseTypeFromString = GetCurseTypeFromString(ConfigClass.singleCurseType.Value);
if (availableCurses.Contains(curseTypeFromString))
{
list.Add(curseTypeFromString);
if (ConfigClass.debugMode.Value)
{
Plugin.Logger.LogInfo((object)$"[SelectCurses] Selected single curse: {curseTypeFromString}");
}
}
else if (availableCurses.Count > 0)
{
list.Add(availableCurses[0]);
if (ConfigClass.debugMode.Value)
{
Plugin.Logger.LogInfo((object)$"[SelectCurses] Single curse not available, fallback to: {availableCurses[0]}");
}
}
break;
}
case Plugin.CurseSelectionMode.Random:
if (availableCurses.Count > 0)
{
int num = Random.Range(0, availableCurses.Count);
list.Add(availableCurses[num]);
if (ConfigClass.debugMode.Value)
{
Plugin.Logger.LogInfo((object)$"[SelectCurses] Random selection: {availableCurses[num]} (index {num} of {availableCurses.Count})");
}
}
break;
case Plugin.CurseSelectionMode.Multiple:
list.AddRange(availableCurses);
if (ConfigClass.debugMode.Value)
{
Plugin.Logger.LogInfo((object)("[SelectCurses] Multiple curses selected: " + string.Join(", ", list)));
}
break;
}
if (ConfigClass.debugMode.Value)
{
Plugin.Logger.LogInfo((object)("[SelectCurses] Final selected curses: " + string.Join(", ", list)));
}
return list;
}
private STATUSTYPE GetCurseTypeFromString(string curseTypeString)
{
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
string text = curseTypeString.ToLower();
if (1 == 0)
{
}
STATUSTYPE result = (STATUSTYPE)(text switch
{
"poison" => 3,
"injury" => 0,
"hunger" => 1,
"drowsy" => 6,
"curse" => 5,
"cold" => 2,
"hot" => 8,
_ => 3,
});
if (1 == 0)
{
}
return result;
}
private void ApplySpecificCurse(Player player, string playerName, STATUSTYPE curseType)
{
//IL_0002: 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_0022: Unknown result type (might be due to invalid IL or missing references)
float finalIntensityForCurseType = GetFinalIntensityForCurseType(curseType);
if (ConfigClass.debugMode.Value)
{
Plugin.Logger.LogInfo((object)$"[ApplySpecificCurse] Applying {curseType} to {playerName} with intensity {finalIntensityForCurseType}");
}
player.character.refs.afflictions.AddStatus(curseType, finalIntensityForCurseType, false);
}
private float GetFinalIntensityForCurseType(STATUSTYPE curseType)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Expected I4, but got Unknown
if (1 == 0)
{
}
float result = (int)curseType switch
{
3 => ConfigClass.poisonIntensity.Value,
0 => ConfigClass.injuryIntensity.Value,
1 => ConfigClass.hungerIntensity.Value,
6 => ConfigClass.drowsyIntensity.Value,
5 => ConfigClass.curseStatusIntensity.Value,
2 => ConfigClass.coldIntensity.Value,
8 => ConfigClass.hotIntensity.Value,
_ => 0.1f,
};
if (1 == 0)
{
}
return result;
}
private string GetCurrentCurseTypeDisplay()
{
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
List<STATUSTYPE> availableCurseTypes = GetAvailableCurseTypes();
if (availableCurseTypes.Count == 0)
{
return "No Curse";
}
return ConfigClass.curseSelectionMode.Value switch
{
Plugin.CurseSelectionMode.Single => GetCurseTypeDisplayName(GetCurseTypeFromString(ConfigClass.singleCurseType.Value)),
Plugin.CurseSelectionMode.Random => "Random Curse",
Plugin.CurseSelectionMode.Multiple => "Multiple Curse",
_ => "Unknown Mode",
};
}
private string GetCurseTypeDisplayName(STATUSTYPE curseType)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Expected I4, but got Unknown
if (1 == 0)
{
}
string result = (int)curseType switch
{
3 => "Poison",
0 => "Injury",
1 => "Hunger",
6 => "Drowsy",
5 => "Curse",
2 => "Cold",
8 => "Hot",
_ => "Unknown",
};
if (1 == 0)
{
}
return result;
}
}
}
namespace WeForgotBingBong
{
[BepInPlugin("com.yeci.weforgotbingbong", "WeForgotBingBong!", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
public enum CurseSelectionMode
{
Single,
Random,
Multiple
}
[CompilerGenerated]
private sealed class <InitializeBingBongLogic>d__13 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Plugin <>4__this;
private ItemDatabase <db>5__1;
private bool <foundBingBong>5__2;
private Dictionary<ushort, Item>.Enumerator <>s__3;
private KeyValuePair<ushort, Item> <kv>5__4;
private BingBongCurseLogic <curseLogic>5__5;
private BingBongCurseLogic <curseLogic>5__6;
private GameObject <uiManagerGO>5__7;
private UIManager <uiManager>5__8;
private Player[] <players>5__9;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <InitializeBingBongLogic>d__13(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<db>5__1 = null;
<>s__3 = default(Dictionary<ushort, Item>.Enumerator);
<kv>5__4 = default(KeyValuePair<ushort, Item>);
<curseLogic>5__5 = null;
<curseLogic>5__6 = null;
<uiManagerGO>5__7 = null;
<uiManager>5__8 = null;
<players>5__9 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Expected O, but got Unknown
//IL_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_01a2: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
<db>5__1 = SingletonAsset<ItemDatabase>.Instance;
if ((Object)(object)<db>5__1 == (Object)null)
{
return false;
}
<foundBingBong>5__2 = false;
<>s__3 = <db>5__1.itemLookup.GetEnumerator();
try
{
while (<>s__3.MoveNext())
{
<kv>5__4 = <>s__3.Current;
if (((Object)<kv>5__4.Value).name == "BingBong")
{
<>4__this.bingBong = ((Component)<kv>5__4.Value).gameObject;
<>4__this.bingBongItemID = <kv>5__4.Value.itemID;
<foundBingBong>5__2 = true;
<curseLogic>5__5 = <>4__this.bingBong.AddComponent<BingBongCurseLogic>();
<curseLogic>5__5.Setup(<>4__this.bingBongItemID, ConfigClass.curseInterval.Value, ConfigClass.showUI.Value);
break;
}
<kv>5__4 = default(KeyValuePair<ushort, Item>);
}
}
finally
{
((IDisposable)<>s__3).Dispose();
}
<>s__3 = default(Dictionary<ushort, Item>.Enumerator);
if (<foundBingBong>5__2)
{
if (ConfigClass.showUI.Value)
{
<uiManagerGO>5__7 = new GameObject("BingBongUIManager");
<uiManager>5__8 = <uiManagerGO>5__7.AddComponent<UIManager>();
<uiManagerGO>5__7 = null;
<uiManager>5__8 = null;
}
<curseLogic>5__6 = <>4__this.bingBong.GetComponent<BingBongCurseLogic>();
if ((Object)(object)<curseLogic>5__6 != (Object)null)
{
<players>5__9 = Object.FindObjectsByType<Player>((FindObjectsSortMode)0);
<players>5__9 = null;
}
((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.StartLocalPlayerSetup());
((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.MonitorPlayerInventoryChanges());
((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.MonitorItemStateChanges());
((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.MonitorPlayerJoins());
<curseLogic>5__6 = null;
}
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <MonitorItemStateChanges>d__14 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Plugin <>4__this;
private Item[] <allItems>5__1;
private Item[] <>s__2;
private int <>s__3;
private Item <item>5__4;
private Player <player>5__5;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <MonitorItemStateChanges>d__14(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<allItems>5__1 = null;
<>s__2 = null;
<item>5__4 = null;
<player>5__5 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Invalid comparison between Unknown and I4
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
break;
case 1:
<>1__state = -1;
<allItems>5__1 = Object.FindObjectsByType<Item>((FindObjectsSortMode)0);
<>s__2 = <allItems>5__1;
for (<>s__3 = 0; <>s__3 < <>s__2.Length; <>s__3++)
{
<item>5__4 = <>s__2[<>s__3];
if ((<item>5__4.itemID == <>4__this.bingBongItemID || ((Object)<item>5__4).name.Contains("BingBong")) && (int)<item>5__4.itemState == 1)
{
<player>5__5 = ((Component)<item>5__4).GetComponentInParent<Player>();
if ((Object)(object)<player>5__5 != (Object)null)
{
}
<player>5__5 = null;
}
<item>5__4 = null;
}
<>s__2 = null;
<allItems>5__1 = null;
break;
}
<>2__current = (object)new WaitForSeconds(3f);
<>1__state = 1;
return true;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <MonitorPlayerInventoryChanges>d__15 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Plugin <>4__this;
private Player[] <players>5__1;
private Player[] <>s__2;
private int <>s__3;
private Player <player>5__4;
private bool <currentlyHolding>5__5;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <MonitorPlayerInventoryChanges>d__15(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<players>5__1 = null;
<>s__2 = null;
<player>5__4 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
break;
case 1:
<>1__state = -1;
<players>5__1 = Object.FindObjectsByType<Player>((FindObjectsSortMode)0);
<>s__2 = <players>5__1;
for (<>s__3 = 0; <>s__3 < <>s__2.Length; <>s__3++)
{
<player>5__4 = <>s__2[<>s__3];
if (((MonoBehaviourPun)<player>5__4).photonView.IsMine)
{
<currentlyHolding>5__5 = CheckIfPlayerHasBingBong(<player>5__4, <>4__this.bingBongItemID);
if (!<currentlyHolding>5__5)
{
}
}
<player>5__4 = null;
}
<>s__2 = null;
<players>5__1 = null;
break;
}
<>2__current = (object)new WaitForSeconds(2f);
<>1__state = 1;
return true;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <MonitorPlayerJoins>d__16 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Plugin <>4__this;
private HashSet<Player> <trackedPlayers>5__1;
private Player[] <players>5__2;
private Player[] <>s__3;
private int <>s__4;
private Player <player>5__5;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <MonitorPlayerJoins>d__16(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<trackedPlayers>5__1 = null;
<players>5__2 = null;
<>s__3 = null;
<player>5__5 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<trackedPlayers>5__1 = new HashSet<Player>();
break;
case 1:
<>1__state = -1;
<players>5__2 = Object.FindObjectsByType<Player>((FindObjectsSortMode)0);
<>s__3 = <players>5__2;
for (<>s__4 = 0; <>s__4 < <>s__3.Length; <>s__4++)
{
<player>5__5 = <>s__3[<>s__4];
if ((Object)(object)<player>5__5 != (Object)null && (Object)(object)((MonoBehaviourPun)<player>5__5).photonView != (Object)null && !<trackedPlayers>5__1.Contains(<player>5__5))
{
<trackedPlayers>5__1.Add(<player>5__5);
if (ConfigClass.debugMode.Value)
{
Logger.LogInfo((object)("New player detected: " + ((Object)<player>5__5).name));
}
}
<player>5__5 = null;
}
<>s__3 = null;
<trackedPlayers>5__1.RemoveWhere((Player p) => (Object)(object)p == (Object)null);
<players>5__2 = null;
break;
}
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 1;
return true;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <StartLocalPlayerSetup>d__17 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Plugin <>4__this;
private Player[] <players>5__1;
private Player <localPlayer>5__2;
private Player[] <>s__3;
private int <>s__4;
private Player <player>5__5;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <StartLocalPlayerSetup>d__17(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<players>5__1 = null;
<localPlayer>5__2 = null;
<>s__3 = null;
<player>5__5 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
<players>5__1 = Object.FindObjectsByType<Player>((FindObjectsSortMode)0);
<localPlayer>5__2 = null;
<>s__3 = <players>5__1;
for (<>s__4 = 0; <>s__4 < <>s__3.Length; <>s__4++)
{
<player>5__5 = <>s__3[<>s__4];
if ((Object)(object)<player>5__5 != (Object)null && (Object)(object)((MonoBehaviourPun)<player>5__5).photonView != (Object)null && ((MonoBehaviourPun)<player>5__5).photonView.IsMine)
{
<localPlayer>5__2 = <player>5__5;
break;
}
<player>5__5 = null;
}
<>s__3 = null;
if ((Object)(object)<localPlayer>5__2 != (Object)null && ConfigClass.debugMode.Value)
{
Logger.LogInfo((object)("Local player ready: " + ((Object)<localPlayer>5__2).name));
}
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();
}
}
internal static ManualLogSource Logger;
private bool alreadyLoaded = false;
private GameObject bingBong = null;
private ushort bingBongItemID;
private static GameObject? uiManagerGO;
public static Plugin Instance { get; private set; }
private void Awake()
{
Instance = this;
Logger = ((BaseUnityPlugin)this).Logger;
SceneManager.sceneLoaded += OnSceneLoaded;
ConfigClass.InitConfig(((BaseUnityPlugin)this).Config);
}
private void OnSceneLoaded(Scene scene, LoadSceneMode _)
{
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Expected O, but got Unknown
if (!alreadyLoaded)
{
alreadyLoaded = true;
((MonoBehaviour)this).StartCoroutine(InitializeBingBongLogic());
}
if (ConfigClass.showUI.Value)
{
if ((Object)(object)uiManagerGO == (Object)null)
{
uiManagerGO = new GameObject("BingBongUIManager");
uiManagerGO.AddComponent<UIManager>();
}
}
else if ((Object)(object)uiManagerGO != (Object)null)
{
Object.Destroy((Object)(object)uiManagerGO);
uiManagerGO = null;
}
}
private void OnDestroy()
{
if ((Object)(object)uiManagerGO != (Object)null)
{
Object.Destroy((Object)(object)uiManagerGO);
uiManagerGO = null;
}
}
[IteratorStateMachine(typeof(<InitializeBingBongLogic>d__13))]
private IEnumerator InitializeBingBongLogic()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <InitializeBingBongLogic>d__13(0)
{
<>4__this = this
};
}
[IteratorStateMachine(typeof(<MonitorItemStateChanges>d__14))]
private IEnumerator MonitorItemStateChanges()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <MonitorItemStateChanges>d__14(0)
{
<>4__this = this
};
}
[IteratorStateMachine(typeof(<MonitorPlayerInventoryChanges>d__15))]
private IEnumerator MonitorPlayerInventoryChanges()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <MonitorPlayerInventoryChanges>d__15(0)
{
<>4__this = this
};
}
[IteratorStateMachine(typeof(<MonitorPlayerJoins>d__16))]
private IEnumerator MonitorPlayerJoins()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <MonitorPlayerJoins>d__16(0)
{
<>4__this = this
};
}
[IteratorStateMachine(typeof(<StartLocalPlayerSetup>d__17))]
private IEnumerator StartLocalPlayerSetup()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <StartLocalPlayerSetup>d__17(0)
{
<>4__this = this
};
}
public static bool CheckIfPlayerHasBingBong(Player player, ushort bingBongItemID)
{
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)player == (Object)null || player.itemSlots == null)
{
return false;
}
for (int i = 0; i < player.itemSlots.Length; i++)
{
ItemSlot val = player.itemSlots[i];
if (!val.IsEmpty() && (Object)(object)val.prefab != (Object)null && (val.prefab.itemID == bingBongItemID || ((Object)val.prefab).name.Contains("BingBong")))
{
return true;
}
}
if (ConfigClass.countTempSlotAsCarrying.Value && !player.tempFullSlot.IsEmpty() && (Object)(object)player.tempFullSlot.prefab != (Object)null && (player.tempFullSlot.prefab.itemID == bingBongItemID || ((Object)player.tempFullSlot.prefab).name.Contains("BingBong")))
{
return true;
}
if (ConfigClass.countBackpackAsCarrying.Value && player.backpackSlot.hasBackpack && !((ItemSlot)player.backpackSlot).IsEmpty())
{
BackpackReference fromEquippedBackpack = BackpackReference.GetFromEquippedBackpack(player.character);
BackpackData data = ((BackpackReference)(ref fromEquippedBackpack)).GetData();
if (data != null)
{
ItemSlot[] itemSlots = data.itemSlots;
foreach (ItemSlot val2 in itemSlots)
{
if (!val2.IsEmpty() && (Object)(object)val2.prefab != (Object)null && (val2.prefab.itemID == bingBongItemID || ((Object)val2.prefab).name.Contains("BingBong")))
{
Logger.LogInfo((object)("[BackpackCheck] Found BingBong inside backpack of " + ((Object)player).name));
return true;
}
}
}
}
return false;
}
}
}
namespace ConfigSpace
{
public class ConfigClass
{
public static ConfigEntry<float> curseInterval;
public static ConfigEntry<float> invincibilityPeriod;
public static ConfigEntry<bool> showUI;
public static ConfigEntry<bool> debugMode;
public static ConfigEntry<Plugin.CurseSelectionMode> curseSelectionMode;
public static ConfigEntry<string> singleCurseType;
public static ConfigEntry<bool> enablePoison;
public static ConfigEntry<bool> enableInjury;
public static ConfigEntry<bool> enableHunger;
public static ConfigEntry<bool> enableDrowsy;
public static ConfigEntry<bool> enableCurse;
public static ConfigEntry<bool> enableCold;
public static ConfigEntry<bool> enableHot;
public static ConfigEntry<bool> countBackpackAsCarrying;
public static ConfigEntry<bool> countTempSlotAsCarrying;
public static ConfigEntry<float> poisonIntensity;
public static ConfigEntry<float> injuryIntensity;
public static ConfigEntry<float> hungerIntensity;
public static ConfigEntry<float> drowsyIntensity;
public static ConfigEntry<float> curseStatusIntensity;
public static ConfigEntry<float> coldIntensity;
public static ConfigEntry<float> hotIntensity;
public static void InitConfig(ConfigFile config)
{
curseInterval = config.Bind<float>("General", "CurseInterval", 5f, "Interval in seconds between curse applications (Min: 0.01, Max: 60.0)");
invincibilityPeriod = config.Bind<float>("General", "InvincibilityPeriod", 20f, "Duration in seconds for invincibility after curse application (Min: 0.0, Max: 60.0)");
showUI = config.Bind<bool>("UI", "ShowBingBongUI", true, "Whether to display BingBong status on screen");
debugMode = config.Bind<bool>("Debug", "EnableDebugMode", false, "Enable debug mode for detailed logging");
curseSelectionMode = config.Bind<Plugin.CurseSelectionMode>("CurseType", "SelectionMode", Plugin.CurseSelectionMode.Single, "Curse selection mode: Single(one type), Random(random selection), Multiple(multiple curses)");
singleCurseType = config.Bind<string>("CurseType", "SingleCurseType", "Poison", "Single curse type (effective when SelectionMode is set to Single)");
enablePoison = config.Bind<bool>("CurseType", "EnablePoison", true, "Enable poison curse");
enableInjury = config.Bind<bool>("CurseType", "EnableInjury", true, "Enable injury curse");
enableHunger = config.Bind<bool>("CurseType", "EnableHunger", true, "Enable hunger curse");
enableDrowsy = config.Bind<bool>("CurseType", "EnableDrowsy", true, "Enable drowsy curse");
enableCurse = config.Bind<bool>("CurseType", "EnableCurse", false, "Enable curse status");
enableCold = config.Bind<bool>("CurseType", "EnableCold", true, "Enable cold curse");
enableHot = config.Bind<bool>("CurseType", "EnableHot", true, "Enable hot curse");
countBackpackAsCarrying = config.Bind<bool>("CarryingDetection", "CountBackpackAsCarrying", true, "Whether BingBong in backpack counts as carrying (prevents curses)");
countTempSlotAsCarrying = config.Bind<bool>("CarryingDetection", "CountTempSlotAsCarrying", true, "Whether BingBong in temporary item slot counts as carrying");
poisonIntensity = config.Bind<float>("CurseIntensity", "PoisonIntensity", 0.1f, "Final poison curse intensity (0.01-10.0)");
injuryIntensity = config.Bind<float>("CurseIntensity", "InjuryIntensity", 0.1f, "Final injury curse intensity (0.01-10.0)");
hungerIntensity = config.Bind<float>("CurseIntensity", "HungerIntensity", 0.1f, "Final hunger curse intensity (0.01-10.0)");
drowsyIntensity = config.Bind<float>("CurseIntensity", "DrowsyIntensity", 0.1f, "Final drowsy curse intensity (0.01-10.0)");
curseStatusIntensity = config.Bind<float>("CurseIntensity", "CurseStatusIntensity", 0.1f, "Final curse status intensity (0.01-10.0)");
coldIntensity = config.Bind<float>("CurseIntensity", "ColdIntensity", 0.1f, "Final cold curse intensity (0.01-10.0)");
hotIntensity = config.Bind<float>("CurseIntensity", "HotIntensity", 0.1f, "Final hot curse intensity (0.01-10.0)");
SetupConfigConstraints();
}
private static void SetupConfigConstraints()
{
curseInterval.SettingChanged += delegate
{
if (curseInterval.Value < 0.01f)
{
curseInterval.Value = 0.01f;
}
if (curseInterval.Value > 60f)
{
curseInterval.Value = 60f;
}
};
invincibilityPeriod.SettingChanged += delegate
{
if (invincibilityPeriod.Value < 0f)
{
invincibilityPeriod.Value = 0f;
}
if (invincibilityPeriod.Value > 60f)
{
invincibilityPeriod.Value = 60f;
}
};
poisonIntensity.SettingChanged += delegate
{
if (poisonIntensity.Value < 0.01f)
{
poisonIntensity.Value = 0.01f;
}
if (poisonIntensity.Value > 10f)
{
poisonIntensity.Value = 10f;
}
};
injuryIntensity.SettingChanged += delegate
{
if (injuryIntensity.Value < 0.01f)
{
injuryIntensity.Value = 0.01f;
}
if (injuryIntensity.Value > 10f)
{
injuryIntensity.Value = 10f;
}
};
hungerIntensity.SettingChanged += delegate
{
if (hungerIntensity.Value < 0.01f)
{
hungerIntensity.Value = 0.01f;
}
if (hungerIntensity.Value > 10f)
{
hungerIntensity.Value = 10f;
}
};
drowsyIntensity.SettingChanged += delegate
{
if (drowsyIntensity.Value < 0.01f)
{
drowsyIntensity.Value = 0.01f;
}
if (drowsyIntensity.Value > 10f)
{
drowsyIntensity.Value = 10f;
}
};
curseStatusIntensity.SettingChanged += delegate
{
if (curseStatusIntensity.Value < 0.01f)
{
curseStatusIntensity.Value = 0.01f;
}
if (curseStatusIntensity.Value > 10f)
{
curseStatusIntensity.Value = 10f;
}
};
coldIntensity.SettingChanged += delegate
{
if (coldIntensity.Value < 0.01f)
{
coldIntensity.Value = 0.01f;
}
if (coldIntensity.Value > 10f)
{
coldIntensity.Value = 10f;
}
};
hotIntensity.SettingChanged += delegate
{
if (hotIntensity.Value < 0.01f)
{
hotIntensity.Value = 0.01f;
}
if (hotIntensity.Value > 10f)
{
hotIntensity.Value = 10f;
}
};
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}