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.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Photon.Pun;
using REPONoItemsLeft;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("REPONoItemsLeft")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("REPONoItemsLeft")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("2ad62837-eb44-4bdd-9102-c6d3ae425ed5")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
internal class ModPatch
{
public static bool showDebugLogs;
public static float counterTime;
public static bool stopTimerOverQuota;
public static bool showMapRemaining;
private static float currentValuablesValue;
private static int currentExtractionHaulGoal;
public static bool hasCompletedAllTasks;
private static bool onCountdown;
private static State _currentExtractionPointState;
private static GameObject _mapValueHUD;
private static PlayerAvatar _lastPlayerGrabbing;
private static bool _isLevelGenerationDone;
public static bool extractionCompletedAllowed;
private static bool _ignoreMultator;
[HarmonyPatch(typeof(LevelGenerator), "Start")]
[HarmonyPrefix]
public static void StartPrefix(LevelGenerator __instance)
{
if (SemiFunc.RunIsLevel())
{
((Component)LevelGenerator.Instance).gameObject.AddComponent<HUDManager>();
((Component)LevelGenerator.Instance).gameObject.AddComponent<KillManager>();
if (showDebugLogs)
{
Log.Info("Managers added!");
}
PrepareVariables();
}
}
[HarmonyPatch(typeof(LevelGenerator), "GenerateDone")]
[HarmonyPostfix]
public static void GenerateDonePostfix(LevelGenerator __instance)
{
if (SemiFunc.RunIsLevel())
{
CheckForMutatorsMod();
CreateHUDElements();
_isLevelGenerationDone = true;
if (showDebugLogs)
{
Log.Info("Level Generation done!");
}
}
}
[HarmonyPatch(typeof(PhysGrabObject), "DestroyPhysGrabObjectRPC")]
[HarmonyPostfix]
public static void DestroyPhysGrabObjectRPCPostfix(PhysGrabObject __instance)
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Expected O, but got Unknown
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
if (SemiFunc.RunIsLevel())
{
FieldInfo fieldInfo = AccessTools.Field(typeof(PhysGrabObject), "lastPlayerGrabbing");
_lastPlayerGrabbing = (PlayerAvatar)fieldInfo.GetValue(__instance);
CheckForItems(((Component)__instance).GetComponent<ValuableObject>());
if ((Object)(object)_mapValueHUD != (Object)null)
{
KillManager.instance.TextBlink(_mapValueHUD.GetComponent<TextMeshProUGUI>(), Color.red, Color.white);
}
KillCheck();
}
}
[HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "BreakRPC")]
[HarmonyPostfix]
public static void BreakRPCPostfix(PhysGrabObjectImpactDetector __instance)
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Expected O, but got Unknown
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Expected O, but got Unknown
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
if (SemiFunc.RunIsLevel())
{
FieldInfo fieldInfo = AccessTools.Field(typeof(PhysGrabObjectImpactDetector), "physGrabObject");
PhysGrabObject obj = (PhysGrabObject)fieldInfo.GetValue(__instance);
FieldInfo fieldInfo2 = AccessTools.Field(typeof(PhysGrabObject), "lastPlayerGrabbing");
_lastPlayerGrabbing = (PlayerAvatar)fieldInfo2.GetValue(obj);
CheckForItems();
if ((Object)(object)_mapValueHUD != (Object)null && (Object)(object)((Component)__instance).GetComponent<ValuableObject>() != (Object)null)
{
KillManager.instance.TextBlink(_mapValueHUD.GetComponent<TextMeshProUGUI>(), Color.red, Color.white);
}
KillCheck();
}
}
[HarmonyPatch(typeof(ValuableObject), "DollarValueSetLogic")]
[HarmonyPostfix]
public static void DollarValueSetLogicPostfix(ValuableObject __instance)
{
//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)
if (!SemiFunc.RunIsLevel() || !_isLevelGenerationDone)
{
return;
}
CheckForItems();
if ((Object)(object)_mapValueHUD != (Object)null)
{
KillManager.instance.TextBlink(_mapValueHUD.GetComponent<TextMeshProUGUI>(), Color.green, Color.white);
}
if (!onCountdown)
{
KillCheck();
}
else
{
if (!stopTimerOverQuota || !(currentValuablesValue > (float)currentExtractionHaulGoal))
{
return;
}
onCountdown = false;
PlayerAvatar.instance.PlayerGlitchShort();
if ((Object)(object)KillManager.instance != (Object)null)
{
if (!SemiFunc.IsMultiplayer())
{
KillManager.instance.StopKillThemAll();
return;
}
PhotonView component = ((Component)KillManager.instance).GetComponent<PhotonView>();
if ((Object)(object)component != (Object)null)
{
component.RPC("StopKillThemAll", (RpcTarget)0, Array.Empty<object>());
}
else
{
Log.Warn("PhotonView not found on KillManager.");
}
}
else
{
Log.Warn("KillManager instance is null!");
}
}
}
[HarmonyPatch(typeof(ValuableObject), "DollarValueSetRPC")]
[HarmonyPostfix]
public static void DollarValueSetRPCPostfix(ValuableObject __instance)
{
//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)
if (!SemiFunc.RunIsLevel() || !_isLevelGenerationDone)
{
return;
}
CheckForItems();
if ((Object)(object)_mapValueHUD != (Object)null)
{
KillManager.instance.TextBlink(_mapValueHUD.GetComponent<TextMeshProUGUI>(), Color.green, Color.white);
}
if (!onCountdown)
{
KillCheck();
}
else
{
if (!stopTimerOverQuota || !(currentValuablesValue > (float)currentExtractionHaulGoal))
{
return;
}
onCountdown = false;
PlayerAvatar.instance.PlayerGlitchShort();
if ((Object)(object)KillManager.instance != (Object)null)
{
if (!SemiFunc.IsMultiplayer())
{
KillManager.instance.StopKillThemAll();
return;
}
PhotonView component = ((Component)KillManager.instance).GetComponent<PhotonView>();
if ((Object)(object)component != (Object)null)
{
component.RPC("StopKillThemAll", (RpcTarget)0, Array.Empty<object>());
}
else
{
Log.Warn("PhotonView not found on KillManager.");
}
}
else
{
Log.Warn("KillManager instance is null!");
}
}
}
[HarmonyPatch(typeof(ExtractionPoint), "HaulGoalSetRPC")]
[HarmonyPostfix]
public static void HaulGoalSetRPC(ExtractionPoint __instance)
{
if (SemiFunc.RunIsLevel() && _isLevelGenerationDone)
{
CheckManagers();
CheckForItems();
KillCheck();
if ((Object)(object)_mapValueHUD != (Object)null)
{
_mapValueHUD.SetActive(true);
}
}
}
[HarmonyPatch(typeof(ExtractionPoint), "StateExtracting")]
[HarmonyPostfix]
public static void StateExtractingPostfix(ExtractionPoint __instance)
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Expected O, but got Unknown
//IL_0071: 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_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Invalid comparison between Unknown and I4
if (!SemiFunc.RunIsLevel() || !_isLevelGenerationDone)
{
return;
}
FieldInfo fieldInfo = AccessTools.Field(typeof(RoundDirector), "extractionPointCurrent");
ExtractionPoint val = (ExtractionPoint)fieldInfo.GetValue(RoundDirector.instance);
if ((Object)(object)val != (Object)null)
{
ExtractionPoint component = ((Component)val).GetComponent<ExtractionPoint>();
FieldInfo fieldInfo2 = AccessTools.Field(typeof(ExtractionPoint), "currentState");
State val2 = (State)fieldInfo2.GetValue(component);
if ((int)val2 == 6 && onCountdown && KillManager.counterObj.activeSelf)
{
onCountdown = false;
KillManager.instance.StopKillThemAll();
KillManager.counterObj.SetActive(false);
}
}
}
[HarmonyPatch(typeof(RoundDirector), "ExtractionPointsUnlockRPC")]
[HarmonyPostfix]
public static void ExtractionPointsUnlockRPCPostfix(RoundDirector __instance)
{
if (!SemiFunc.RunIsLevel() || !_isLevelGenerationDone)
{
return;
}
onCountdown = false;
if ((Object)(object)KillManager.instance != (Object)null)
{
if (!SemiFunc.IsMultiplayer())
{
KillManager.instance.StopKillThemAll();
return;
}
PhotonView component = ((Component)KillManager.instance).GetComponent<PhotonView>();
if ((Object)(object)component != (Object)null)
{
component.RPC("StopKillThemAll", (RpcTarget)0, Array.Empty<object>());
}
else
{
Log.Warn("PhotonView not found on KillManager.");
}
}
else
{
Log.Warn("KillManager instance is null!");
}
}
[HarmonyPatch(typeof(RoundDirector), "ExtractionCompletedAllRPC")]
[HarmonyPostfix]
public static void ExtractionCompletedAllRPCPostfix(RoundDirector __instance)
{
if (!SemiFunc.RunIsLevel() || !_isLevelGenerationDone || !extractionCompletedAllowed)
{
return;
}
hasCompletedAllTasks = true;
if ((Object)(object)_mapValueHUD != (Object)null)
{
_mapValueHUD.SetActive(false);
}
if ((Object)(object)KillManager.instance != (Object)null)
{
if (!SemiFunc.IsMultiplayer())
{
KillManager.instance.CompletedAllTasks();
return;
}
PhotonView component = ((Component)KillManager.instance).GetComponent<PhotonView>();
if ((Object)(object)component != (Object)null)
{
if (SemiFunc.IsMasterClient())
{
component.RPC("CompletedAllTasks", (RpcTarget)0, Array.Empty<object>());
}
}
else
{
Log.Warn("PhotonView not found on KillManager.");
}
}
else
{
Log.Warn("KillManager instance is null!");
}
}
private static void PrepareVariables()
{
_ignoreMultator = false;
_isLevelGenerationDone = false;
hasCompletedAllTasks = false;
onCountdown = false;
KillManager.hasCompletedTask = false;
currentValuablesValue = 0f;
_lastPlayerGrabbing = null;
if (showDebugLogs)
{
Log.Info("Variables prepared!");
}
}
private static void CheckForMutatorsMod()
{
Type type = null;
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
foreach (Assembly assembly in assemblies)
{
try
{
type = assembly.GetTypes().FirstOrDefault((Type t) => t.Name == "MutatorManager");
if (type != null)
{
break;
}
}
catch (Exception)
{
}
}
if (type == null)
{
if (showDebugLogs)
{
Log.Warn("MutatorManager not found.");
}
return;
}
object obj = type.GetProperty("Instance", BindingFlags.Static | BindingFlags.Public)?.GetValue(null);
if (obj == null)
{
if (showDebugLogs)
{
Log.Warn("MutatorManager instance is null.");
}
return;
}
object obj2 = type.GetProperty("CurrentMutator", BindingFlags.Instance | BindingFlags.Public)?.GetValue(obj);
if (obj2 == null)
{
if (showDebugLogs)
{
Log.Warn("CurrentMutator is null.");
}
return;
}
object obj3 = obj2.GetType().GetProperty("Name", BindingFlags.Instance | BindingFlags.Public)?.GetValue(obj2);
if (obj3 != null)
{
if (obj3?.ToString() == "Hunting Season")
{
_ignoreMultator = true;
}
if (showDebugLogs)
{
Log.Info($"Current Mutator: {obj3}");
Log.Info($"Ignoring functions due to Mutator: {_ignoreMultator}");
}
}
else if (showDebugLogs)
{
Log.Warn("Error while trying to get CurrentMutator name.");
}
}
private static void CheckManagers()
{
if ((Object)(object)KillManager.instance == (Object)null)
{
((Component)LevelGenerator.Instance).gameObject.AddComponent<KillManager>();
Log.Warn("KillManager instance is null, adding new instance.");
}
else if ((Object)(object)HUDManager.instance == (Object)null)
{
((Component)LevelGenerator.Instance).gameObject.AddComponent<HUDManager>();
Log.Warn("HUDManager instance is null, adding new instance.");
}
else if (showDebugLogs)
{
Log.Info("Managers instantiated!");
}
}
private static void CreateHUDElements()
{
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: 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_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_0164: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
//IL_0204: Unknown result type (might be due to invalid IL or missing references)
//IL_0228: Unknown result type (might be due to invalid IL or missing references)
//IL_024c: Unknown result type (might be due to invalid IL or missing references)
//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
GameObject val = GameObject.Find("Game Hud");
GameObject val2 = GameObject.Find("Tax Haul");
if (!((Object)(object)val != (Object)null) || !((Object)(object)val2 != (Object)null))
{
return;
}
TMP_FontAsset font = val2.GetComponent<TMP_Text>().font;
GameObject val3 = HUDManager.instance.CreateTextGUIElement("Kill Or Die HUD", font, val.transform, _enableWordWrapping: false, (TextAlignmentOptions)514, (HorizontalAlignmentOptions)2, (VerticalAlignmentOptions)512, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 0f));
val3.SetActive(false);
GameObject val4 = HUDManager.instance.CreateTextGUIElement("Final Countdown HUD", font, val.transform, _enableWordWrapping: false, (TextAlignmentOptions)514, (HorizontalAlignmentOptions)2, (VerticalAlignmentOptions)512, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, 0f));
val4.SetActive(false);
GameObject val5 = HUDManager.instance.CreateTextGUIElement("Die HUD", font, val.transform, _enableWordWrapping: false, (TextAlignmentOptions)514, (HorizontalAlignmentOptions)2, (VerticalAlignmentOptions)512, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 0f));
val5.SetActive(false);
if (showMapRemaining)
{
_mapValueHUD = HUDManager.instance.CreateTextGUIElement("Map Value", font, val.transform, _enableWordWrapping: false, (TextAlignmentOptions)516, (HorizontalAlignmentOptions)4, (VerticalAlignmentOptions)512, new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(1f, 1f), new Vector2(1f, 1.5f));
((Component)_mapValueHUD.transform).GetComponent<RectTransform>().sizeDelta = new Vector2(0f, 0f);
((Component)_mapValueHUD.transform).GetComponent<RectTransform>().offsetMin = new Vector2(0f, -100f);
((Component)_mapValueHUD.transform).GetComponent<RectTransform>().offsetMax = new Vector2(0f, -100f);
_mapValueHUD.SetActive(false);
GameObject val6 = Object.Instantiate<GameObject>(((Component)val2.transform.GetChild(0)).gameObject);
val6.transform.SetParent(_mapValueHUD.transform);
val6.transform.localPosition = new Vector3(-50f, 0f, 0f);
val6.transform.localScale = new Vector3(2f, 0.5f, 1f);
val6.SetActive(true);
}
KillManager.killOrDieObj = val3;
KillManager.dieObj = val5;
KillManager.counterObj = val4;
if (showDebugLogs)
{
Log.Info("HUDs created!");
}
if (!SemiFunc.IsMultiplayer())
{
KillManager.instance.SetCounterTimer(counterTime);
}
else if (SemiFunc.IsMasterClient())
{
PhotonView component = ((Component)KillManager.instance).GetComponent<PhotonView>();
if ((Object)(object)component != (Object)null)
{
component.RPC("SetCounterTimer", (RpcTarget)0, new object[1] { counterTime });
}
else
{
Log.Warn("PhotonView not found on KillManager.");
}
}
}
private static void KillCheck()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Invalid comparison between Unknown and I4
if (hasCompletedAllTasks || !_isLevelGenerationDone || (int)_currentExtractionPointState != 2 || !(currentValuablesValue < (float)currentExtractionHaulGoal) || onCountdown || _ignoreMultator)
{
return;
}
onCountdown = true;
string text = "";
if ((Object)(object)_lastPlayerGrabbing != (Object)null)
{
FieldInfo fieldInfo = AccessTools.Field(typeof(PlayerAvatar), "playerName");
text = (string)fieldInfo.GetValue(_lastPlayerGrabbing);
}
int num = Random.Range(0, 15);
if ((Object)(object)KillManager.instance != (Object)null)
{
if (!SemiFunc.IsMultiplayer())
{
KillManager.instance.CallKillThemAll(text, num);
}
else if (SemiFunc.IsMasterClient())
{
PhotonView component = ((Component)KillManager.instance).GetComponent<PhotonView>();
if ((Object)(object)component != (Object)null)
{
component.RPC("CallKillThemAll", (RpcTarget)0, new object[2] { text, num });
}
else
{
Log.Warn("PhotonView not found on KillManager.");
}
}
}
else
{
Log.Warn("KillManager instance is null!");
}
}
private static void CheckForItems(ValuableObject ignoreThis = null)
{
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
currentValuablesValue = 0f;
List<ValuableObject> list = Object.FindObjectsOfType<ValuableObject>().ToList();
if ((Object)(object)ignoreThis != (Object)null)
{
list.Remove(ignoreThis);
}
for (int i = 0; i < list.Count; i++)
{
FieldInfo fieldInfo = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent");
currentValuablesValue += (float)fieldInfo.GetValue(list[i]);
}
if ((Object)(object)_mapValueHUD != (Object)null)
{
HUDManager.instance.SetChangeText(_mapValueHUD.GetComponent<TextMeshProUGUI>(), $"Left: {currentValuablesValue:C0}", Color.white, 24);
}
UpdateHaulGoal();
}
private static void UpdateHaulGoal()
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Expected O, but got Unknown
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: 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)
FieldInfo fieldInfo = AccessTools.Field(typeof(RoundDirector), "extractionPointCurrent");
ExtractionPoint val = (ExtractionPoint)fieldInfo.GetValue(RoundDirector.instance);
if ((Object)(object)val != (Object)null)
{
ExtractionPoint component = ((Component)val).GetComponent<ExtractionPoint>();
FieldInfo fieldInfo2 = AccessTools.Field(typeof(ExtractionPoint), "currentState");
State currentExtractionPointState = (State)fieldInfo2.GetValue(component);
currentExtractionHaulGoal = component.haulGoal;
_currentExtractionPointState = currentExtractionPointState;
}
}
}
public class HUDManager : MonoBehaviour
{
public static HUDManager instance;
private void Awake()
{
instance = this;
}
public GameObject CreateTextGUIElement(string _name = "HUDElement", TMP_FontAsset _fontAsset = null, Transform _parent = null, bool _enableWordWrapping = true, TextAlignmentOptions _alignment = 2050, HorizontalAlignmentOptions _horizontalAlignment = 1, VerticalAlignmentOptions _verticalAlignment = 2048, Vector2 _anchorMin = default(Vector2), Vector2 _anchorMax = default(Vector2), Vector2 _pivot = default(Vector2), Vector2 _anchoredPosition = default(Vector2))
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: 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_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_007f: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject();
((Object)val).name = _name;
val.AddComponent<TextMeshProUGUI>();
TextMeshProUGUI component = val.GetComponent<TextMeshProUGUI>();
((TMP_Text)component).font = _fontAsset;
((TMP_Text)component).enableWordWrapping = _enableWordWrapping;
((TMP_Text)component).alignment = _alignment;
((TMP_Text)component).horizontalAlignment = _horizontalAlignment;
((TMP_Text)component).verticalAlignment = _verticalAlignment;
val.transform.SetParent(((Component)_parent).transform, false);
RectTransform component2 = val.GetComponent<RectTransform>();
component2.anchorMin = _anchorMin;
component2.anchorMax = _anchorMax;
component2.pivot = _pivot;
component2.anchoredPosition = _anchoredPosition;
return val;
}
public void SetChangeText(TextMeshProUGUI element, string text, Color color, int fontSize)
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
((TMP_Text)element).text = text;
((Graphic)element).color = color;
((TMP_Text)element).fontSize = fontSize;
}
}
public class KillManager : MonoBehaviourPun
{
[CompilerGenerated]
private sealed class <DelayExtractionLogic>d__19 : IEnumerator<object>, IDisposable, IEnumerator
{
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 <DelayExtractionLogic>d__19(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(15f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
ModPatch.extractionCompletedAllowed = true;
ModPatch.hasCompletedAllTasks = false;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <KillThemAll>d__18 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public string playerName;
public int messageIdx;
public KillManager <>4__this;
private TextMeshProUGUI <killOrDieText>5__1;
private TextMeshProUGUI <counterText>5__2;
private TextMeshProUGUI <dieText>5__3;
private string[] <messages>5__4;
private string[] <messagesNoPlayer>5__5;
private float <timer>5__6;
private int <minutes>5__7;
private int <seconds>5__8;
private bool <hasGlitched>5__9;
private float <lerpFactor>5__10;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <KillThemAll>d__18(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<killOrDieText>5__1 = null;
<counterText>5__2 = null;
<dieText>5__3 = null;
<messages>5__4 = null;
<messagesNoPlayer>5__5 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_035c: Unknown result type (might be due to invalid IL or missing references)
//IL_0381: Unknown result type (might be due to invalid IL or missing references)
//IL_038b: Expected O, but got Unknown
//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
//IL_03ec: Expected O, but got Unknown
//IL_041e: Unknown result type (might be due to invalid IL or missing references)
//IL_0443: Unknown result type (might be due to invalid IL or missing references)
//IL_044d: Expected O, but got Unknown
//IL_047f: Unknown result type (might be due to invalid IL or missing references)
//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
//IL_04ae: Expected O, but got Unknown
//IL_0531: Unknown result type (might be due to invalid IL or missing references)
//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0320: Unknown result type (might be due to invalid IL or missing references)
//IL_032a: Expected O, but got Unknown
//IL_06d8: Unknown result type (might be due to invalid IL or missing references)
//IL_06fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0707: Expected O, but got Unknown
//IL_0600: Unknown result type (might be due to invalid IL or missing references)
//IL_0605: Unknown result type (might be due to invalid IL or missing references)
//IL_0610: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<killOrDieText>5__1 = killOrDieObj.GetComponent<TextMeshProUGUI>();
<counterText>5__2 = counterObj.GetComponent<TextMeshProUGUI>();
<dieText>5__3 = dieObj.GetComponent<TextMeshProUGUI>();
<messages>5__4 = new string[16]
{
"Oops, <color=red>" + playerName + "</color>! All on you!",
"Oh no, <color=red>" + playerName + "</color> made a mistake...",
"Yeah, you can blame <color=red>" + playerName + "</color> for this.",
"Be careful next time, <color=red>" + playerName + "</color>.",
"Bad luck, <color=red>" + playerName + "</color>...",
"Wait, who invited <color=red>" + playerName + "</color> again?",
"Well done, <color=red>" + playerName + "</color>... not!",
"Nice job, <color=red>" + playerName + "</color>. Now look what you’ve done!",
"Everybody, a round of applause for <color=red>" + playerName + "</color>!",
"Oops! That was definitely <color=red>" + playerName + "</color>'s fault.",
"Uh-oh, <color=red>" + playerName + "</color> did it again...",
"Quick, act natural! Maybe no one saw, <color=red>" + playerName + "</color>.",
"Seriously, <color=red>" + playerName + "</color>? You had one job!",
"Guess who just made history? <color=red>" + playerName + "</color>!",
"RIP, whatever that was. Thanks, <color=red>" + playerName + "</color>.",
"Breaking news: <color=red>" + playerName + "</color> strikes again!"
};
<messagesNoPlayer>5__5 = new string[16]
{
"Oops, something went seriously wrong!", "Oh no... the item didn’t make it.", "Well, that definitely wasn’t part of the plan.", "Maybe next time things will go smoother.", "Sometimes... things just fall apart.", "Who left that item without a safety net?", "Perfect execution... almost.", "Nice try! Too bad the item gave up.", "And there goes another one into the void.", "Whew! Hopefully no one saw that.",
"Gravity claims another victim.", "If anyone asks, nothing happened.", "And the 'Oops of the Day' award goes to... fate.", "Physics: 1, Teamwork: 0.", "A moment of silence for the fallen item.", "Breaking news: Item spontaneously self-destructs. Everyone confused."
};
if (playerName == "")
{
<messages>5__4 = <messagesNoPlayer>5__5;
}
PlayerAvatar.instance.PlayerGlitchShort();
HUDManager.instance.SetChangeText(<killOrDieText>5__1, <messages>5__4[messageIdx], Color.white, 32);
((Component)<killOrDieText>5__1).gameObject.SetActive(true);
<>2__current = (object)new WaitForSeconds(3f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
((Component)<killOrDieText>5__1).gameObject.SetActive(false);
HUDManager.instance.SetChangeText(<killOrDieText>5__1, "Not enough valuables on the map.", Color.white, 32);
((Component)<killOrDieText>5__1).gameObject.SetActive(true);
<>2__current = (object)new WaitForSeconds(2f);
<>1__state = 2;
return true;
case 2:
<>1__state = -1;
((Component)<killOrDieText>5__1).gameObject.SetActive(false);
HUDManager.instance.SetChangeText(<killOrDieText>5__1, "Kill a <color=red>Monster</color> to get <color=green>Money</color>", Color.white, 32);
((Component)<killOrDieText>5__1).gameObject.SetActive(true);
<>2__current = (object)new WaitForSeconds(3f);
<>1__state = 3;
return true;
case 3:
<>1__state = -1;
((Component)<killOrDieText>5__1).gameObject.SetActive(false);
HUDManager.instance.SetChangeText(<killOrDieText>5__1, "or", Color.white, 32);
((Component)<killOrDieText>5__1).gameObject.SetActive(true);
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 4;
return true;
case 4:
<>1__state = -1;
((Component)<killOrDieText>5__1).gameObject.SetActive(false);
HUDManager.instance.SetChangeText(<killOrDieText>5__1, "DIE", Color.red, 100);
((Component)<killOrDieText>5__1).gameObject.SetActive(true);
<>2__current = (object)new WaitForSeconds(2f);
<>1__state = 5;
return true;
case 5:
<>1__state = -1;
((Component)<killOrDieText>5__1).gameObject.SetActive(false);
<timer>5__6 = countTime;
<minutes>5__7 = (int)<timer>5__6 / 60;
<seconds>5__8 = (int)<timer>5__6 % 60;
PlayerAvatar.instance.PlayerGlitchShort();
HUDManager.instance.SetChangeText(<counterText>5__2, $"{<minutes>5__7}:{<seconds>5__8:00}", Color.white, 18);
((Component)<counterText>5__2).gameObject.SetActive(true);
<hasGlitched>5__9 = false;
goto IL_0678;
case 6:
<>1__state = -1;
<timer>5__6 -= Time.deltaTime;
goto IL_0678;
case 7:
{
<>1__state = -1;
((Component)<dieText>5__3).gameObject.SetActive(false);
if (!SemiFunc.IsMultiplayer())
{
PlayerAvatar.instance.PlayerDeathRPC(0);
}
else
{
PlayerAvatar.instance.photonView.RPC("PlayerDeathRPC", (RpcTarget)0, new object[1] { 0 });
}
((Component)<dieText>5__3).gameObject.SetActive(false);
break;
}
IL_0678:
if (<timer>5__6 > 0f && !hasCompletedTask)
{
<minutes>5__7 = (int)<timer>5__6 / 60;
<seconds>5__8 = (int)<timer>5__6 % 60;
((TMP_Text)<counterText>5__2).text = $"{<minutes>5__7}:{<seconds>5__8:00}";
if (<timer>5__6 <= 11f)
{
if (!<hasGlitched>5__9)
{
<hasGlitched>5__9 = true;
PlayerAvatar.instance.PlayerGlitchShort();
}
<lerpFactor>5__10 = 1f - <timer>5__6 % 1f;
((Graphic)<counterText>5__2).color = Color.Lerp(Color.red, Color.white, <lerpFactor>5__10);
((TMP_Text)<counterText>5__2).text = $"{<seconds>5__8}";
((TMP_Text)<counterText>5__2).fontSize = 32f;
}
<>2__current = null;
<>1__state = 6;
return true;
}
if (!hasCompletedTask)
{
((Component)<counterText>5__2).gameObject.SetActive(false);
PlayerAvatar.instance.PlayerGlitchShort();
HUDManager.instance.SetChangeText(<dieText>5__3, "Better luck next time! <color=red>;)</color>", Color.white, 32);
((Component)<dieText>5__3).gameObject.SetActive(true);
<>2__current = (object)new WaitForSeconds(3f);
<>1__state = 7;
return true;
}
break;
}
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
public static KillManager instance;
public static float countTime;
public static GameObject killOrDieObj;
public static GameObject counterObj;
public static GameObject dieObj;
public static bool hasCompletedTask = false;
private static float textBlinkTime;
private static Color textBlinkColor = Color.white;
private static Color textBlinkColorOriginal = Color.white;
private static TextMeshProUGUI textGUI;
private void Awake()
{
instance = this;
((MonoBehaviour)this).StartCoroutine(DelayExtractionLogic());
}
private void Update()
{
TextBlinkLogic();
}
public void TextBlink(TextMeshProUGUI text, Color textColor, Color textColorOriginal)
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
textGUI = text;
textBlinkTime = 0.3f;
textBlinkColor = textColor;
textBlinkColorOriginal = textColorOriginal;
}
private void TextBlinkLogic()
{
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
if (textBlinkTime > 0f)
{
textBlinkTime -= Time.deltaTime;
if (textBlinkTime <= 0f)
{
((Graphic)textGUI).color = textBlinkColorOriginal;
}
else
{
((Graphic)textGUI).color = textBlinkColor;
}
}
}
[PunRPC]
public void SetCounterTimer(float timer)
{
Log.Info($"Setting counter timer to {timer}. Good luck!");
countTime = timer;
}
[PunRPC]
public void CompletedAllTasks()
{
hasCompletedTask = true;
((MonoBehaviour)this).StopCoroutine(KillThemAll());
if (counterObj.activeSelf)
{
counterObj.SetActive(false);
}
}
[PunRPC]
public void CallKillThemAll(string playerName, int messageIdx)
{
hasCompletedTask = false;
((MonoBehaviour)this).StartCoroutine(KillThemAll(playerName, messageIdx));
}
[PunRPC]
public void StopKillThemAll()
{
hasCompletedTask = true;
((MonoBehaviour)this).StopCoroutine(KillThemAll());
if (counterObj.activeSelf)
{
counterObj.SetActive(false);
}
}
[IteratorStateMachine(typeof(<KillThemAll>d__18))]
private IEnumerator KillThemAll(string playerName = "", int messageIdx = 0)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <KillThemAll>d__18(0)
{
<>4__this = this,
playerName = playerName,
messageIdx = messageIdx
};
}
[IteratorStateMachine(typeof(<DelayExtractionLogic>d__19))]
private static IEnumerator DelayExtractionLogic()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <DelayExtractionLogic>d__19(0);
}
}
namespace REPONoItemsLeft;
[BepInPlugin("FNKTLabs.REPONoItemsLeft", "No Items Left", "1.2.8")]
public class ModBase : BaseUnityPlugin
{
private const string modGUID = "FNKTLabs.REPONoItemsLeft";
private const string modName = "No Items Left";
private const string modVersion = "1.2.8";
private Harmony _harmony = new Harmony("FNKTLabs.REPONoItemsLeft");
public static ConfigEntry<bool> config_ShowDebugLogs;
public static ConfigEntry<float> config_Timer;
public static ConfigEntry<bool> config_ToggleStopTimerOverQuota;
public static ConfigEntry<bool> config_ShowMapRemaining;
public void Awake()
{
Log.Init(((BaseUnityPlugin)this).Logger);
Log.Info("REPO No Items Left loaded!");
ConfigFile();
_harmony.PatchAll(typeof(ModBase));
_harmony.PatchAll(typeof(ModPatch));
}
public void ConfigFile()
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Expected O, but got Unknown
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Expected O, but got Unknown
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Expected O, but got Unknown
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Expected O, but got Unknown
config_ShowDebugLogs = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Debug Logs", false, new ConfigDescription("Toggle whether debug logs are shown", (AcceptableValueBase)null, Array.Empty<object>()));
ModPatch.showDebugLogs = config_ShowDebugLogs.Value;
config_Timer = ((BaseUnityPlugin)this).Config.Bind<float>("Countdown Timer", "Seconds", 300f, new ConfigDescription("Sets the countdown timer in seconds", (AcceptableValueBase)(object)new AcceptableValueRange<float>(10f, 600f), Array.Empty<object>()));
ModPatch.counterTime = config_Timer.Value;
config_ToggleStopTimerOverQuota = ((BaseUnityPlugin)this).Config.Bind<bool>("Countdown Timer", "Stop Timer When Over Quota", false, new ConfigDescription("Stops the countdown timer when collected amount exceeds the required objective", (AcceptableValueBase)null, Array.Empty<object>()));
ModPatch.stopTimerOverQuota = config_ToggleStopTimerOverQuota.Value;
config_ShowMapRemaining = ((BaseUnityPlugin)this).Config.Bind<bool>("Remaining Value", "Visible", true, new ConfigDescription("Display remaining value on map", (AcceptableValueBase)null, Array.Empty<object>()));
ModPatch.showMapRemaining = config_ShowMapRemaining.Value;
}
}
public static class Log
{
public static ManualLogSource Source;
public static void Init(ManualLogSource logger)
{
Source = logger;
}
public static void Info(object msg)
{
ManualLogSource source = Source;
if (source != null)
{
source.LogInfo(msg);
}
}
public static void Warn(object msg)
{
ManualLogSource source = Source;
if (source != null)
{
source.LogWarning(msg);
}
}
public static void Error(object msg)
{
ManualLogSource source = Source;
if (source != null)
{
source.LogError(msg);
}
}
}