using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using MenuLib;
using MenuLib.MonoBehaviors;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("Autodesk.Fbx")]
[assembly: IgnoresAccessChecksTo("Discord.Sdk")]
[assembly: IgnoresAccessChecksTo("Domain_Reload")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("FbxBuildTestAssets")]
[assembly: IgnoresAccessChecksTo("Klattersynth")]
[assembly: IgnoresAccessChecksTo("Photon3Unity3D")]
[assembly: IgnoresAccessChecksTo("PhotonChat")]
[assembly: IgnoresAccessChecksTo("PhotonRealtime")]
[assembly: IgnoresAccessChecksTo("PhotonUnityNetworking")]
[assembly: IgnoresAccessChecksTo("PhotonUnityNetworking.Utilities")]
[assembly: IgnoresAccessChecksTo("PhotonVoice.API")]
[assembly: IgnoresAccessChecksTo("PhotonVoice")]
[assembly: IgnoresAccessChecksTo("PhotonVoice.PUN")]
[assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime")]
[assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime.Public")]
[assembly: IgnoresAccessChecksTo("Sirenix.OdinInspector.Attributes")]
[assembly: IgnoresAccessChecksTo("Sirenix.Serialization.Config")]
[assembly: IgnoresAccessChecksTo("Sirenix.Serialization")]
[assembly: IgnoresAccessChecksTo("Sirenix.Utilities")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.Formats.Fbx.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.MemoryProfiler")]
[assembly: IgnoresAccessChecksTo("Unity.Postprocessing.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.Splines")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Antlr3.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Core")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Flow")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.State")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: IgnoresAccessChecksTo("websocket-sharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Einhornyordle")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.2.0")]
[assembly: AssemblyInformationalVersion("0.2.0+b7443383e563b171088f4caafac814a06e2da26a")]
[assembly: AssemblyProduct("RepoLeveling")]
[assembly: AssemblyTitle("RepoLeveling")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.2.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 RepoLeveling
{
internal static class ConfigManager
{
internal static ConfigEntry<float> TotalHaulRequirementMultiplier;
internal static void Initialize()
{
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Expected O, but got Unknown
TotalHaulRequirementMultiplier = ((BaseUnityPlugin)RepoLeveling.Instance).Config.Bind<float>("General", "TotalHaulRequirementMultiplier", 1f, new ConfigDescription("The multiplier applied to the total haul requirement for skill point gains. Increase it to slow skill point gain, decrease it to gain skill points faster. Note that this value is limited to 2 decimal places to prevent floating point precision errors and the upper and lower range is limited for better compatibility with the REPO Config mod.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 10f), Array.Empty<object>()));
}
}
[HarmonyPatch(typeof(PunManager))]
internal static class PunManagerPatch
{
[HarmonyPostfix]
[HarmonyPatch("ReceiveSyncData")]
private static void ReceiveSyncData_Postfix(bool finalChunk)
{
if (finalChunk)
{
SaveDataManager.ApplySkills();
}
}
}
[BepInPlugin("Einhornyordle.RepoLeveling", "RepoLeveling", "0.2.0")]
public class RepoLeveling : BaseUnityPlugin
{
public static RepoLeveling Instance { get; set; }
internal static ManualLogSource Logger => Instance._logger;
private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger;
private Harmony? Harmony { get; set; }
private void Awake()
{
Instance = this;
((Component)this).gameObject.transform.parent = null;
((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
Patch();
ConfigManager.Initialize();
SaveDataManager.Initialize();
SkillsMenu.Initialize();
Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!");
}
private void OnDestroy()
{
Harmony? harmony = Harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
}
private void Patch()
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Expected O, but got Unknown
//IL_0025: Expected O, but got Unknown
if (Harmony == null)
{
Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID);
Harmony val2 = val;
Harmony = val;
}
Harmony.PatchAll();
}
}
public static class SaveDataManager
{
public static ConfigEntry<int> SaveCumulativeHaul;
public static ConfigEntry<int> SaveDeathHeadBattery;
public static ConfigEntry<int> SaveMapPlayerCount;
public static ConfigEntry<int> SaveCrouchRest;
public static ConfigEntry<int> SaveEnergy;
public static ConfigEntry<int> SaveExtraJump;
public static ConfigEntry<int> SaveGrabRange;
public static ConfigEntry<int> SaveGrabStrength;
public static ConfigEntry<int> SaveGrabThrow;
public static ConfigEntry<int> SaveHealth;
public static ConfigEntry<int> SaveSprintSpeed;
public static ConfigEntry<int> SaveTumbleClimb;
public static ConfigEntry<int> SaveTumbleLaunch;
public static ConfigEntry<int> SaveTumbleWings;
internal static void Initialize()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Expected O, but got Unknown
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Expected O, but got Unknown
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Expected O, but got Unknown
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Expected O, but got Unknown
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Expected O, but got Unknown
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Expected O, but got Unknown
//IL_0157: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Expected O, but got Unknown
//IL_0187: Unknown result type (might be due to invalid IL or missing references)
//IL_0191: Expected O, but got Unknown
//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
//IL_01c1: Expected O, but got Unknown
//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
//IL_01f1: Expected O, but got Unknown
//IL_0217: Unknown result type (might be due to invalid IL or missing references)
//IL_0221: Expected O, but got Unknown
//IL_0247: Unknown result type (might be due to invalid IL or missing references)
//IL_0251: Expected O, but got Unknown
//IL_0277: Unknown result type (might be due to invalid IL or missing references)
//IL_0281: Expected O, but got Unknown
//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
//IL_02b1: Expected O, but got Unknown
ConfigFile val = new ConfigFile(Path.Combine(Application.persistentDataPath, "REPOModData/RepoLeveling/save.cfg"), false);
SaveCumulativeHaul = val.Bind<int>("General", "CumulativeHaul", 0, new ConfigDescription("The total value of all hauls you've ever completed. This value is used to calculate your available skill points. Increase this to cheat skill points. Set to 0 to reset your progress.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, int.MaxValue), Array.Empty<object>()));
SaveDeathHeadBattery = val.Bind<int>("Skills", "DeathHeadBattery", 0, new ConfigDescription("The amount of death head battery upgrades you've skilled. Set to 0 to regain spent skill points.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, int.MaxValue), Array.Empty<object>()));
SaveMapPlayerCount = val.Bind<int>("Skills", "MapPlayerCount", 0, new ConfigDescription("The amount of map player count upgrades you've skilled. Set to 0 to regain spent skill points.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, int.MaxValue), Array.Empty<object>()));
SaveCrouchRest = val.Bind<int>("Skills", "CrouchRest", 0, new ConfigDescription("The amount of crouch rest upgrades you've skilled. Set to 0 to regain spent skill points.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, int.MaxValue), Array.Empty<object>()));
SaveEnergy = val.Bind<int>("Skills", "Energy", 0, new ConfigDescription("The amount of stamina upgrades you've skilled. Set to 0 to regain spent skill points.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, int.MaxValue), Array.Empty<object>()));
SaveExtraJump = val.Bind<int>("Skills", "ExtraJump", 0, new ConfigDescription("The amount of double jump upgrades you've skilled. Set to 0 to regain spent skill points.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, int.MaxValue), Array.Empty<object>()));
SaveGrabRange = val.Bind<int>("Skills", "GrabRange", 0, new ConfigDescription("The amount of range upgrades you've skilled. Set to 0 to regain spent skill points.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, int.MaxValue), Array.Empty<object>()));
SaveGrabStrength = val.Bind<int>("Skills", "GrabStrength", 0, new ConfigDescription("The amount of strength upgrades you've skilled. Set to 0 to regain spent skill points.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, int.MaxValue), Array.Empty<object>()));
SaveGrabThrow = val.Bind<int>("Skills", "GrabThrow", 0, new ConfigDescription("The amount of throw upgrades you've skilled. Set to 0 to regain spent skill points.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, int.MaxValue), Array.Empty<object>()));
SaveHealth = val.Bind<int>("Skills", "Health", 0, new ConfigDescription("The amount of health upgrades you've skilled. Set to 0 to regain spent skill points.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, int.MaxValue), Array.Empty<object>()));
SaveSprintSpeed = val.Bind<int>("Skills", "SprintSpeed", 0, new ConfigDescription("The amount of sprint speed upgrades you've skilled. Set to 0 to regain spent skill points.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, int.MaxValue), Array.Empty<object>()));
SaveTumbleClimb = val.Bind<int>("Skills", "TumbleClimb", 0, new ConfigDescription("The amount of tumble climb upgrades you've skilled. Set to 0 to regain spent skill points.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, int.MaxValue), Array.Empty<object>()));
SaveTumbleLaunch = val.Bind<int>("Skills", "TumbleLaunch", 0, new ConfigDescription("The amount of tumble launch upgrades you've skilled. Set to 0 to regain spent skill points.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, int.MaxValue), Array.Empty<object>()));
SaveTumbleWings = val.Bind<int>("Skills", "TumbleWings", 0, new ConfigDescription("The amount of tumble wings upgrades you've skilled. Set to 0 to regain spent skill points.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, int.MaxValue), Array.Empty<object>()));
}
public static void ResetProgress()
{
SaveCumulativeHaul.Value = 0;
ResetSkillPoints();
RepoLeveling.Logger.LogDebug((object)"Progress reset.");
}
public static void ResetSkillPoints()
{
SaveDeathHeadBattery.Value = 0;
SaveMapPlayerCount.Value = 0;
SaveCrouchRest.Value = 0;
SaveEnergy.Value = 0;
SaveExtraJump.Value = 0;
SaveGrabRange.Value = 0;
SaveGrabStrength.Value = 0;
SaveGrabThrow.Value = 0;
SaveHealth.Value = 0;
SaveSprintSpeed.Value = 0;
SaveTumbleClimb.Value = 0;
SaveTumbleLaunch.Value = 0;
SaveTumbleWings.Value = 0;
RepoLeveling.Logger.LogDebug((object)"Skill points reset.");
}
private static void ApplyUpgrade(Dictionary<string, int> upgradeDict, ConfigEntry<int> savedValue, Func<string, int, int> upgradeFunc)
{
upgradeDict.TryAdd(PlayerController.instance.playerSteamID, 0);
upgradeFunc(PlayerController.instance.playerSteamID, savedValue.Value);
}
public static void ApplySkills()
{
RepoLeveling.Logger.LogDebug((object)"Applying skill points...");
ApplyUpgrade(StatsManager.instance.playerUpgradeDeathHeadBattery, SaveDeathHeadBattery, (Func<string, int, int>)PunManager.instance.UpgradeDeathHeadBattery);
ApplyUpgrade(StatsManager.instance.playerUpgradeMapPlayerCount, SaveMapPlayerCount, (Func<string, int, int>)PunManager.instance.UpgradeMapPlayerCount);
ApplyUpgrade(StatsManager.instance.playerUpgradeCrouchRest, SaveCrouchRest, (Func<string, int, int>)PunManager.instance.UpgradePlayerCrouchRest);
ApplyUpgrade(StatsManager.instance.playerUpgradeStamina, SaveEnergy, (Func<string, int, int>)PunManager.instance.UpgradePlayerEnergy);
ApplyUpgrade(StatsManager.instance.playerUpgradeExtraJump, SaveExtraJump, (Func<string, int, int>)PunManager.instance.UpgradePlayerExtraJump);
ApplyUpgrade(StatsManager.instance.playerUpgradeRange, SaveGrabRange, (Func<string, int, int>)PunManager.instance.UpgradePlayerGrabRange);
ApplyUpgrade(StatsManager.instance.playerUpgradeStrength, SaveGrabStrength, (Func<string, int, int>)PunManager.instance.UpgradePlayerGrabStrength);
ApplyUpgrade(StatsManager.instance.playerUpgradeThrow, SaveGrabThrow, (Func<string, int, int>)PunManager.instance.UpgradePlayerThrowStrength);
ApplyUpgrade(StatsManager.instance.playerUpgradeHealth, SaveHealth, (Func<string, int, int>)PunManager.instance.UpgradePlayerHealth);
ApplyUpgrade(StatsManager.instance.playerUpgradeSpeed, SaveSprintSpeed, (Func<string, int, int>)PunManager.instance.UpgradePlayerSprintSpeed);
ApplyUpgrade(StatsManager.instance.playerUpgradeTumbleClimb, SaveTumbleClimb, (Func<string, int, int>)PunManager.instance.UpgradePlayerTumbleClimb);
ApplyUpgrade(StatsManager.instance.playerUpgradeLaunch, SaveTumbleLaunch, (Func<string, int, int>)PunManager.instance.UpgradePlayerTumbleLaunch);
ApplyUpgrade(StatsManager.instance.playerUpgradeTumbleWings, SaveTumbleWings, (Func<string, int, int>)PunManager.instance.UpgradePlayerTumbleWings);
RepoLeveling.Logger.LogDebug((object)"Skill points applied.");
}
public static int SkillPointsFromCumulativeHaul()
{
int num = (int)Math.Round((-1.0 + Math.Sqrt(1f + (float)(4 * SaveCumulativeHaul.Value) / (75f * ConfigManager.TotalHaulRequirementMultiplier.Value))) / 2.0);
RepoLeveling.Logger.LogDebug((object)$"Total skill points: {num}");
return num;
}
public static int TotalSpentSkillPoints()
{
int num = SaveDeathHeadBattery.Value + SaveMapPlayerCount.Value + SaveCrouchRest.Value + SaveEnergy.Value + SaveExtraJump.Value + SaveGrabRange.Value + SaveGrabStrength.Value + SaveGrabThrow.Value + SaveHealth.Value + SaveSprintSpeed.Value + SaveTumbleClimb.Value + SaveTumbleLaunch.Value + SaveTumbleWings.Value;
RepoLeveling.Logger.LogDebug((object)$"Spent skill points: {num}");
return num;
}
public static int AvailableSkillPoints()
{
int num = SkillPointsFromCumulativeHaul() - TotalSpentSkillPoints();
RepoLeveling.Logger.LogDebug((object)$"Available skill points: {num}");
return num;
}
public static int TotalCumulativeHaulNeededForNextSkillPoint()
{
int num = SkillPointsFromCumulativeHaul() + 1;
int num2 = (int)Math.Round((float)(75 * num * (num + 1)) * ConfigManager.TotalHaulRequirementMultiplier.Value);
RepoLeveling.Logger.LogDebug((object)$"Total haul needed for next skill point: {num2}");
return num2;
}
public static int NeededCumulativeHaulForNextSkillPoint()
{
int num = TotalCumulativeHaulNeededForNextSkillPoint() - SaveCumulativeHaul.Value;
RepoLeveling.Logger.LogDebug((object)$"Haul still needed for next skill point: {num}");
return num;
}
}
[HarmonyPatch(typeof(SemiFunc))]
internal static class SemiFuncPatch
{
[HarmonyPrefix]
[HarmonyPatch("OnSceneSwitch")]
private static void OnSceneSwitch_Prefix()
{
if (SemiFunc.RunIsArena())
{
RepoLeveling.Logger.LogDebug((object)$"Level failed, saving haul of {StatsManager.instance.GetRunStatTotalHaul()}");
ConfigEntry<int> saveCumulativeHaul = SaveDataManager.SaveCumulativeHaul;
saveCumulativeHaul.Value += StatsManager.instance.GetRunStatTotalHaul();
RepoLeveling.Logger.LogDebug((object)$"New total: {SaveDataManager.SaveCumulativeHaul.Value}");
}
}
[HarmonyPostfix]
[HarmonyPatch("OnSceneSwitch")]
private static void OnSceneSwitch_Postfix()
{
if (SemiFunc.RunIsLevel() && !StatsManager.instance.FetchPlayerUpgrades(PlayerController.instance.playerSteamID).Values.Any((int val) => val > 0))
{
SaveDataManager.ApplySkills();
}
}
}
public static class SkillsMenu
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static BuilderDelegate <>9__4_0;
public static BuilderDelegate <>9__4_1;
public static BuilderDelegate <>9__4_2;
public static Action <>9__6_2;
public static Action <>9__6_0;
public static Action <>9__6_1;
public static Action<int> <>9__7_0;
public static Action<int> <>9__7_1;
public static Action<int> <>9__7_2;
public static Action<int> <>9__7_3;
public static Action<int> <>9__7_4;
public static Action<int> <>9__7_5;
public static Action<int> <>9__7_6;
public static Action<int> <>9__7_7;
public static Action<int> <>9__7_8;
public static Action<int> <>9__7_9;
public static Action<int> <>9__7_10;
public static Action<int> <>9__7_11;
public static Action<int> <>9__7_12;
public static Action <>9__7_13;
internal void <Initialize>b__4_0(Transform parent)
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
MenuAPI.CreateREPOButton("Skills", (Action)CreateSkillsMenu, parent, new Vector2(0f, 360f));
}
internal void <Initialize>b__4_1(Transform parent)
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
MenuAPI.CreateREPOButton("Skills", (Action)CreateSkillsMenu, parent, new Vector2(0f, 360f));
}
internal void <Initialize>b__4_2(Transform parent)
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
MenuAPI.CreateREPOButton("Skills", (Action)CreateSkillsMenu, parent, new Vector2(0f, 360f));
}
internal void <CreateStatisticsPage>b__6_0()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
MenuAPI.OpenPopup("Reset Progress", Color.red, "Are you sure that you want to reset your progress? This cannot be undone!", (Action)delegate
{
SaveDataManager.ResetProgress();
_statisticsPage.ClosePage(true);
}, (Action)null);
}
internal void <CreateStatisticsPage>b__6_2()
{
SaveDataManager.ResetProgress();
_statisticsPage.ClosePage(true);
}
internal void <CreateStatisticsPage>b__6_1()
{
_statisticsPage.ClosePage(true);
}
internal void <CreateSkillsPage>b__7_0(int value)
{
OnSkillPointAssignmentChanged(0, SaveDataManager.SaveDeathHeadBattery, value);
}
internal void <CreateSkillsPage>b__7_1(int value)
{
OnSkillPointAssignmentChanged(1, SaveDataManager.SaveMapPlayerCount, value);
}
internal void <CreateSkillsPage>b__7_2(int value)
{
OnSkillPointAssignmentChanged(2, SaveDataManager.SaveCrouchRest, value);
}
internal void <CreateSkillsPage>b__7_3(int value)
{
OnSkillPointAssignmentChanged(3, SaveDataManager.SaveEnergy, value);
}
internal void <CreateSkillsPage>b__7_4(int value)
{
OnSkillPointAssignmentChanged(4, SaveDataManager.SaveExtraJump, value);
}
internal void <CreateSkillsPage>b__7_5(int value)
{
OnSkillPointAssignmentChanged(5, SaveDataManager.SaveGrabRange, value);
}
internal void <CreateSkillsPage>b__7_6(int value)
{
OnSkillPointAssignmentChanged(6, SaveDataManager.SaveGrabStrength, value);
}
internal void <CreateSkillsPage>b__7_7(int value)
{
OnSkillPointAssignmentChanged(7, SaveDataManager.SaveGrabThrow, value);
}
internal void <CreateSkillsPage>b__7_8(int value)
{
OnSkillPointAssignmentChanged(8, SaveDataManager.SaveHealth, value);
}
internal void <CreateSkillsPage>b__7_9(int value)
{
OnSkillPointAssignmentChanged(9, SaveDataManager.SaveSprintSpeed, value);
}
internal void <CreateSkillsPage>b__7_10(int value)
{
OnSkillPointAssignmentChanged(10, SaveDataManager.SaveTumbleClimb, value);
}
internal void <CreateSkillsPage>b__7_11(int value)
{
OnSkillPointAssignmentChanged(11, SaveDataManager.SaveTumbleLaunch, value);
}
internal void <CreateSkillsPage>b__7_12(int value)
{
OnSkillPointAssignmentChanged(12, SaveDataManager.SaveTumbleWings, value);
}
internal void <CreateSkillsPage>b__7_13()
{
SaveDataManager.ResetSkillPoints();
_statisticsPage.ClosePage(true);
}
}
private static REPOPopupPage _statisticsPage;
private static REPOPopupPage _skillsPage;
private static REPOLabel _availableSkillPoints;
private static REPOSlider[] _skillSliders;
internal static void Initialize()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: 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)
//IL_0067: Expected O, but got Unknown
object obj = <>c.<>9__4_0;
if (obj == null)
{
BuilderDelegate val = delegate(Transform parent)
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
MenuAPI.CreateREPOButton("Skills", (Action)CreateSkillsMenu, parent, new Vector2(0f, 360f));
};
<>c.<>9__4_0 = val;
obj = (object)val;
}
MenuAPI.AddElementToMainMenu((BuilderDelegate)obj);
object obj2 = <>c.<>9__4_1;
if (obj2 == null)
{
BuilderDelegate val2 = delegate(Transform parent)
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
MenuAPI.CreateREPOButton("Skills", (Action)CreateSkillsMenu, parent, new Vector2(0f, 360f));
};
<>c.<>9__4_1 = val2;
obj2 = (object)val2;
}
MenuAPI.AddElementToEscapeMenu((BuilderDelegate)obj2);
object obj3 = <>c.<>9__4_2;
if (obj3 == null)
{
BuilderDelegate val3 = delegate(Transform parent)
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
MenuAPI.CreateREPOButton("Skills", (Action)CreateSkillsMenu, parent, new Vector2(0f, 360f));
};
<>c.<>9__4_2 = val3;
obj3 = (object)val3;
}
MenuAPI.AddElementToLobbyMenu((BuilderDelegate)obj3);
}
private static void CreateSkillsMenu()
{
((BaseUnityPlugin)RepoLeveling.Instance).Config.Reload();
ConfigManager.TotalHaulRequirementMultiplier.Value = (float)Math.Round(ConfigManager.TotalHaulRequirementMultiplier.Value, 2);
CreateStatisticsPage();
CreateSkillsPage();
}
private static void CreateStatisticsPage()
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0140: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
//IL_0212: Unknown result type (might be due to invalid IL or missing references)
//IL_0258: Unknown result type (might be due to invalid IL or missing references)
//IL_029e: Unknown result type (might be due to invalid IL or missing references)
//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
_statisticsPage = MenuAPI.CreateREPOPopupPage("Statistics", (PresetSide)0, false, true, 0f);
REPOElement[] array = (REPOElement[])(object)new REPOElement[13]
{
(REPOElement)MenuAPI.CreateREPOLabel("Total Hauled:", ((Component)_statisticsPage).transform, new Vector2(70f, 270f)),
(REPOElement)MenuAPI.CreateREPOLabel("Next SP in:", ((Component)_statisticsPage).transform, new Vector2(70f, 240f)),
(REPOElement)MenuAPI.CreateREPOLabel("Total SP earned:", ((Component)_statisticsPage).transform, new Vector2(70f, 210f)),
(REPOElement)MenuAPI.CreateREPOLabel("Available SP:", ((Component)_statisticsPage).transform, new Vector2(70f, 180f)),
(REPOElement)MenuAPI.CreateREPOLabel("Current Haul:", ((Component)_statisticsPage).transform, new Vector2(70f, 150f)),
(REPOElement)MenuAPI.CreateREPOLabel($"{SaveDataManager.SaveCumulativeHaul.Value}k", ((Component)_statisticsPage).transform, new Vector2(260f, 270f)),
(REPOElement)MenuAPI.CreateREPOLabel($"{SaveDataManager.NeededCumulativeHaulForNextSkillPoint()}k", ((Component)_statisticsPage).transform, new Vector2(260f, 240f)),
(REPOElement)MenuAPI.CreateREPOLabel($"{SaveDataManager.SkillPointsFromCumulativeHaul()}", ((Component)_statisticsPage).transform, new Vector2(260f, 210f)),
(REPOElement)(_availableSkillPoints = MenuAPI.CreateREPOLabel($"{SaveDataManager.AvailableSkillPoints()}", ((Component)_statisticsPage).transform, new Vector2(260f, 180f))),
(REPOElement)MenuAPI.CreateREPOLabel($"{StatsManager.instance.GetRunStatTotalHaul()}k", ((Component)_statisticsPage).transform, new Vector2(260f, 150f)),
(REPOElement)MenuAPI.CreateREPOLabel("Note: SP = Skill Points", ((Component)_statisticsPage).transform, new Vector2(70f, 60f)),
(REPOElement)MenuAPI.CreateREPOButton("Reset progress", (Action)delegate
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
MenuAPI.OpenPopup("Reset Progress", Color.red, "Are you sure that you want to reset your progress? This cannot be undone!", (Action)delegate
{
SaveDataManager.ResetProgress();
_statisticsPage.ClosePage(true);
}, (Action)null);
}, ((Component)_statisticsPage).transform, new Vector2(60f, 20f)),
(REPOElement)MenuAPI.CreateREPOButton("Close", (Action)delegate
{
_statisticsPage.ClosePage(true);
}, ((Component)_statisticsPage).transform, new Vector2(280f, 20f))
};
REPOElement[] array2 = array;
foreach (REPOElement val in array2)
{
_statisticsPage.AddElement(val.rectTransform, Vector2.op_Implicit(((Transform)val.rectTransform).localPosition));
}
_statisticsPage.OpenPage(false);
}
private static void CreateSkillsPage()
{
//IL_005b: 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)
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
//IL_021b: Unknown result type (might be due to invalid IL or missing references)
//IL_0221: Unknown result type (might be due to invalid IL or missing references)
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_0292: Unknown result type (might be due to invalid IL or missing references)
//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0303: Unknown result type (might be due to invalid IL or missing references)
//IL_036e: Unknown result type (might be due to invalid IL or missing references)
//IL_0374: Unknown result type (might be due to invalid IL or missing references)
//IL_03df: Unknown result type (might be due to invalid IL or missing references)
//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
//IL_0451: Unknown result type (might be due to invalid IL or missing references)
//IL_0457: Unknown result type (might be due to invalid IL or missing references)
//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
//IL_04c9: Unknown result type (might be due to invalid IL or missing references)
//IL_0535: Unknown result type (might be due to invalid IL or missing references)
//IL_053b: Unknown result type (might be due to invalid IL or missing references)
//IL_05a7: Unknown result type (might be due to invalid IL or missing references)
//IL_05ad: 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_060b: Unknown result type (might be due to invalid IL or missing references)
//IL_068a: Unknown result type (might be due to invalid IL or missing references)
//IL_06a6: Unknown result type (might be due to invalid IL or missing references)
//IL_06ab: Unknown result type (might be due to invalid IL or missing references)
int num = SaveDataManager.AvailableSkillPoints();
_skillsPage = MenuAPI.CreateREPOPopupPage("Skills", (PresetSide)1, false, false, 0f);
_skillSliders = (REPOSlider[])(object)new REPOSlider[13]
{
MenuAPI.CreateREPOSlider("Death Head Battery", string.Empty, (Action<int>)delegate(int value)
{
OnSkillPointAssignmentChanged(0, SaveDataManager.SaveDeathHeadBattery, value);
}, ((Component)_skillsPage).transform, default(Vector2), 0, Math.Clamp(SaveDataManager.SaveDeathHeadBattery.Value + num, 0, int.MaxValue), SaveDataManager.SaveDeathHeadBattery.Value, "", "", (BarBehavior)0),
MenuAPI.CreateREPOSlider("Map Player Count", string.Empty, (Action<int>)delegate(int value)
{
OnSkillPointAssignmentChanged(1, SaveDataManager.SaveMapPlayerCount, value);
}, ((Component)_skillsPage).transform, default(Vector2), 0, Math.Clamp(SaveDataManager.SaveMapPlayerCount.Value + num, 0, 1), SaveDataManager.SaveMapPlayerCount.Value, "", "", (BarBehavior)0),
MenuAPI.CreateREPOSlider("Crouch Rest", string.Empty, (Action<int>)delegate(int value)
{
OnSkillPointAssignmentChanged(2, SaveDataManager.SaveCrouchRest, value);
}, ((Component)_skillsPage).transform, default(Vector2), 0, Math.Clamp(SaveDataManager.SaveCrouchRest.Value + num, 0, int.MaxValue), SaveDataManager.SaveCrouchRest.Value, "", "", (BarBehavior)0),
MenuAPI.CreateREPOSlider("Stamina", string.Empty, (Action<int>)delegate(int value)
{
OnSkillPointAssignmentChanged(3, SaveDataManager.SaveEnergy, value);
}, ((Component)_skillsPage).transform, default(Vector2), 0, Math.Clamp(SaveDataManager.SaveEnergy.Value + num, 0, int.MaxValue), SaveDataManager.SaveEnergy.Value, "", "", (BarBehavior)0),
MenuAPI.CreateREPOSlider("Double Jump", string.Empty, (Action<int>)delegate(int value)
{
OnSkillPointAssignmentChanged(4, SaveDataManager.SaveExtraJump, value);
}, ((Component)_skillsPage).transform, default(Vector2), 0, Math.Clamp(SaveDataManager.SaveExtraJump.Value + num, 0, int.MaxValue), SaveDataManager.SaveExtraJump.Value, "", "", (BarBehavior)0),
MenuAPI.CreateREPOSlider("Range", string.Empty, (Action<int>)delegate(int value)
{
OnSkillPointAssignmentChanged(5, SaveDataManager.SaveGrabRange, value);
}, ((Component)_skillsPage).transform, default(Vector2), 0, Math.Clamp(SaveDataManager.SaveGrabRange.Value + num, 0, int.MaxValue), SaveDataManager.SaveGrabRange.Value, "", "", (BarBehavior)0),
MenuAPI.CreateREPOSlider("Strength", string.Empty, (Action<int>)delegate(int value)
{
OnSkillPointAssignmentChanged(6, SaveDataManager.SaveGrabStrength, value);
}, ((Component)_skillsPage).transform, default(Vector2), 0, Math.Clamp(SaveDataManager.SaveGrabStrength.Value + num, 0, int.MaxValue), SaveDataManager.SaveGrabStrength.Value, "", "", (BarBehavior)0),
MenuAPI.CreateREPOSlider("Throw", string.Empty, (Action<int>)delegate(int value)
{
OnSkillPointAssignmentChanged(7, SaveDataManager.SaveGrabThrow, value);
}, ((Component)_skillsPage).transform, default(Vector2), 0, Math.Clamp(SaveDataManager.SaveGrabThrow.Value + num, 0, int.MaxValue), SaveDataManager.SaveGrabThrow.Value, "", "", (BarBehavior)0),
MenuAPI.CreateREPOSlider("Health", string.Empty, (Action<int>)delegate(int value)
{
OnSkillPointAssignmentChanged(8, SaveDataManager.SaveHealth, value);
}, ((Component)_skillsPage).transform, default(Vector2), 0, Math.Clamp(SaveDataManager.SaveHealth.Value + num, 0, int.MaxValue), SaveDataManager.SaveHealth.Value, "", "", (BarBehavior)0),
MenuAPI.CreateREPOSlider("Sprint Speed", string.Empty, (Action<int>)delegate(int value)
{
OnSkillPointAssignmentChanged(9, SaveDataManager.SaveSprintSpeed, value);
}, ((Component)_skillsPage).transform, default(Vector2), 0, Math.Clamp(SaveDataManager.SaveSprintSpeed.Value + num, 0, int.MaxValue), SaveDataManager.SaveSprintSpeed.Value, "", "", (BarBehavior)0),
MenuAPI.CreateREPOSlider("Tumble Climb", string.Empty, (Action<int>)delegate(int value)
{
OnSkillPointAssignmentChanged(10, SaveDataManager.SaveTumbleClimb, value);
}, ((Component)_skillsPage).transform, default(Vector2), 0, Math.Clamp(SaveDataManager.SaveTumbleClimb.Value + num, 0, int.MaxValue), SaveDataManager.SaveTumbleClimb.Value, "", "", (BarBehavior)0),
MenuAPI.CreateREPOSlider("Tumble Launch", string.Empty, (Action<int>)delegate(int value)
{
OnSkillPointAssignmentChanged(11, SaveDataManager.SaveTumbleLaunch, value);
}, ((Component)_skillsPage).transform, default(Vector2), 0, Math.Clamp(SaveDataManager.SaveTumbleLaunch.Value + num, 0, int.MaxValue), SaveDataManager.SaveTumbleLaunch.Value, "", "", (BarBehavior)0),
MenuAPI.CreateREPOSlider("Tumble Wings", string.Empty, (Action<int>)delegate(int value)
{
OnSkillPointAssignmentChanged(12, SaveDataManager.SaveTumbleWings, value);
}, ((Component)_skillsPage).transform, default(Vector2), 0, Math.Clamp(SaveDataManager.SaveTumbleWings.Value + num, 0, int.MaxValue), SaveDataManager.SaveTumbleWings.Value, "", "", (BarBehavior)0)
};
REPOSlider[] skillSliders = _skillSliders;
foreach (REPOSlider val in skillSliders)
{
_skillsPage.AddElementToScrollView(((REPOElement)val).rectTransform, default(Vector2), 0f, 0f);
}
((REPOElement)_skillSliders[0]).repoScrollViewElement.topPadding = 5f;
_skillsPage.scrollView.spacing = 5f;
REPOButton val2 = MenuAPI.CreateREPOButton("Reset spent skill points", (Action)delegate
{
SaveDataManager.ResetSkillPoints();
_statisticsPage.ClosePage(true);
}, ((Component)_skillsPage).transform, new Vector2(460f, 20f));
_skillsPage.AddElement(((REPOElement)val2).rectTransform, Vector2.op_Implicit(((Transform)((REPOElement)val2).rectTransform).localPosition));
_skillsPage.OpenPage(true);
}
private static void OnSkillPointAssignmentChanged(int index, ConfigEntry<int> entry, int value)
{
entry.Value = value;
int num = SaveDataManager.AvailableSkillPoints();
((TMP_Text)_availableSkillPoints.labelTMP).text = num.ToString();
REPOSlider[] skillSliders = _skillSliders;
foreach (REPOSlider val in skillSliders)
{
int num2 = ((((TMP_Text)val.labelTMP).text == "Map Player Count") ? 1 : int.MaxValue);
if ((Object)(object)val == (Object)(object)_skillSliders[index])
{
val.max = Mathf.Min(value + num, num2);
}
else
{
val.max = Mathf.Min(val.value + (float)num, (float)num2);
}
val.SetValue(val.value, false);
}
}
}
}