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 REPONoItemsLeft.Patches;
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
{
[CompilerGenerated]
private sealed class <LerpColor>d__25 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public TextMeshProUGUI textElement;
public Color startColor;
public Color endColor;
private float <duration>5__1;
private float <elapsedTime>5__2;
private float <lerpFactor>5__3;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <LerpColor>d__25(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<duration>5__1 = 1f;
<elapsedTime>5__2 = 0f;
break;
case 1:
<>1__state = -1;
break;
}
if (<elapsedTime>5__2 < <duration>5__1)
{
<lerpFactor>5__3 = <elapsedTime>5__2 / <duration>5__1;
((Graphic)textElement).color = Color.Lerp(startColor, endColor, <lerpFactor>5__3);
<elapsedTime>5__2 += Time.deltaTime;
<>2__current = null;
<>1__state = 1;
return true;
}
((Graphic)textElement).color = endColor;
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 float counterTime;
public static bool showMapRemaining;
private static float currentValuablesValue;
private static int currentExtractionHaulGoal;
private static bool hasCompletedAllTasks;
private static bool onCountdown;
private static State _currentExtractionPointState;
private static GameObject _mapValueHUD;
private static Coroutine _colorLerpCoroutine;
private static PlayerAvatar _lastPlayerGrabbing;
[HarmonyPatch(typeof(LevelGenerator), "GenerateDone")]
[HarmonyPostfix]
public static void GenerateDonePostfix(LevelGenerator __instance)
{
if (SemiFunc.RunIsLevel())
{
((Component)__instance).gameObject.AddComponent<HUDManager>();
((Component)__instance).gameObject.AddComponent<KillManager>();
PrepareVariables();
CreateHUDElements();
}
}
[HarmonyPatch(typeof(PhysGrabObject), "DestroyPhysGrabObjectRPC")]
[HarmonyPostfix]
public static void DestroyPhysGrabObjectRPCPostfix(PhysGrabObject __instance)
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Expected O, but got Unknown
//IL_00b7: 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)
if (!SemiFunc.RunIsLevel())
{
return;
}
FieldInfo fieldInfo = AccessTools.Field(typeof(PhysGrabObject), "lastPlayerGrabbing");
_lastPlayerGrabbing = (PlayerAvatar)fieldInfo.GetValue(__instance);
FieldInfo fieldInfo2 = AccessTools.Field(typeof(RoundDirector), "allExtractionPointsCompleted");
hasCompletedAllTasks = (bool)fieldInfo2.GetValue(RoundDirector.instance);
CheckForItems(((Component)__instance).GetComponent<ValuableObject>());
if ((Object)(object)_mapValueHUD != (Object)null)
{
if (_colorLerpCoroutine != null && (Object)(object)((Component)__instance).GetComponent<ValuableObject>() != (Object)null)
{
((MonoBehaviour)CoroutineHelper.Instance).StopCoroutine(_colorLerpCoroutine);
}
_colorLerpCoroutine = ((MonoBehaviour)CoroutineHelper.Instance).StartCoroutine(LerpColor(_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_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
if (!SemiFunc.RunIsLevel())
{
return;
}
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);
FieldInfo fieldInfo3 = AccessTools.Field(typeof(RoundDirector), "allExtractionPointsCompleted");
hasCompletedAllTasks = (bool)fieldInfo3.GetValue(RoundDirector.instance);
CheckForItems();
if ((Object)(object)_mapValueHUD != (Object)null && (Object)(object)((Component)__instance).GetComponent<ValuableObject>() != (Object)null)
{
if (_colorLerpCoroutine != null)
{
((MonoBehaviour)CoroutineHelper.Instance).StopCoroutine(_colorLerpCoroutine);
}
_colorLerpCoroutine = ((MonoBehaviour)CoroutineHelper.Instance).StartCoroutine(LerpColor(_mapValueHUD.GetComponent<TextMeshProUGUI>(), Color.red, Color.white));
}
KillCheck();
}
[HarmonyPatch(typeof(ValuableObject), "DollarValueSetLogic")]
[HarmonyPostfix]
public static void DollarValueSetLogicPostfix(ValuableObject __instance)
{
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
if (!SemiFunc.RunIsLevel())
{
return;
}
FieldInfo fieldInfo = AccessTools.Field(typeof(RoundDirector), "allExtractionPointsCompleted");
hasCompletedAllTasks = (bool)fieldInfo.GetValue(RoundDirector.instance);
CheckForItems();
if ((Object)(object)_mapValueHUD != (Object)null)
{
if (_colorLerpCoroutine != null)
{
((MonoBehaviour)CoroutineHelper.Instance).StopCoroutine(_colorLerpCoroutine);
}
_colorLerpCoroutine = ((MonoBehaviour)CoroutineHelper.Instance).StartCoroutine(LerpColor(_mapValueHUD.GetComponent<TextMeshProUGUI>(), Color.green, Color.white));
}
KillCheck();
}
[HarmonyPatch(typeof(ValuableObject), "DollarValueSetRPC")]
[HarmonyPostfix]
public static void DollarValueSetRPCPostfix(ValuableObject __instance)
{
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
if (!SemiFunc.RunIsLevel())
{
return;
}
FieldInfo fieldInfo = AccessTools.Field(typeof(RoundDirector), "allExtractionPointsCompleted");
hasCompletedAllTasks = (bool)fieldInfo.GetValue(RoundDirector.instance);
CheckForItems();
if ((Object)(object)_mapValueHUD != (Object)null)
{
if (_colorLerpCoroutine != null)
{
((MonoBehaviour)CoroutineHelper.Instance).StopCoroutine(_colorLerpCoroutine);
}
_colorLerpCoroutine = ((MonoBehaviour)CoroutineHelper.Instance).StartCoroutine(LerpColor(_mapValueHUD.GetComponent<TextMeshProUGUI>(), Color.green, Color.white));
}
KillCheck();
}
[HarmonyPatch(typeof(ExtractionPoint), "HaulGoalSetRPC")]
[HarmonyPostfix]
public static void HaulGoalSetRPC(ExtractionPoint __instance)
{
if (SemiFunc.RunIsLevel())
{
CheckManagers();
CheckForItems();
KillCheck();
if ((Object)(object)_mapValueHUD != (Object)null)
{
_mapValueHUD.SetActive(true);
}
}
}
[HarmonyPatch(typeof(ExtractionPoint), "StateExtracting")]
[HarmonyPostfix]
public static void StateExtractingPostfix(ExtractionPoint __instance)
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Expected O, but got Unknown
//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_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Invalid comparison between Unknown and I4
if (!SemiFunc.RunIsLevel())
{
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())
{
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())
{
return;
}
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()
{
hasCompletedAllTasks = false;
onCountdown = false;
KillManager.hasCompletedTask = false;
currentValuablesValue = 0f;
_lastPlayerGrabbing = null;
}
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
{
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, 1f));
((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;
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_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Invalid comparison between Unknown and I4
if (hasCompletedAllTasks || (int)_currentExtractionPointState != 2 || !(currentValuablesValue < (float)currentExtractionHaulGoal) || onCountdown)
{
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_00a0: Unknown result type (might be due to invalid IL or missing references)
if (!hasCompletedAllTasks)
{
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++)
{
currentValuablesValue += list[i].dollarValueCurrent;
}
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;
}
}
[IteratorStateMachine(typeof(<LerpColor>d__25))]
private static IEnumerator LerpColor(TextMeshProUGUI textElement, Color startColor, Color endColor)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: 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_0016: Unknown result type (might be due to invalid IL or missing references)
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <LerpColor>d__25(0)
{
textElement = textElement,
startColor = startColor,
endColor = endColor
};
}
}
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 <KillThemAll>d__11 : 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__11(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;
private void Awake()
{
instance = this;
}
[PunRPC]
public void SetCounterTimer(float timer)
{
Log.Info($"Setting counter timer to {timer}");
countTime = timer;
}
[PunRPC]
public void CompletedAllTasks()
{
Log.Info("Players completed all tasks!");
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__11))]
private IEnumerator KillThemAll(string playerName = "", int messageIdx = 0)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <KillThemAll>d__11(0)
{
<>4__this = this,
playerName = playerName,
messageIdx = messageIdx
};
}
}
namespace REPONoItemsLeft
{
[BepInPlugin("FNKTLabs.REPONoItemsLeft", "No Items Left", "1.2.2")]
public class ModBase : BaseUnityPlugin
{
private const string modGUID = "FNKTLabs.REPONoItemsLeft";
private const string modName = "No Items Left";
private const string modVersion = "1.2.2";
private Harmony _harmony = new Harmony("FNKTLabs.REPONoItemsLeft");
public static ConfigEntry<float> config_Timer;
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_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: 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
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_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);
}
}
}
}
namespace REPONoItemsLeft.Patches
{
public class CoroutineHelper : MonoBehaviour
{
private static CoroutineHelper instance;
public static CoroutineHelper Instance
{
get
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
if ((Object)(object)instance == (Object)null)
{
GameObject val = new GameObject("CoroutineHelper");
instance = val.AddComponent<CoroutineHelper>();
Object.DontDestroyOnLoad((Object)(object)val);
}
return instance;
}
}
}
}