using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using YNGGAMEVISION.Patches;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("TestModForRepo")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TestModForRepo")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("df5667d6-d34d-4067-8647-e904005683fd")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace YNGGAMEVISION
{
public static class ConfigManager
{
public static ConfigEntry<bool> useTextPatch { get; private set; }
public static ConfigEntry<bool> useUpgradePatch { get; private set; }
public static ConfigEntry<bool> useHealthPatch { get; private set; }
public static ConfigEntry<bool> useSprintPatch { get; private set; }
public static ConfigEntry<float> SprintDrain { get; private set; }
public static ConfigEntry<float> SprintRechargeTime { get; private set; }
public static ConfigEntry<float> SprintRechargeAmount { get; private set; }
public static void Initialize(ConfigFile config)
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Expected O, but got Unknown
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Expected O, but got Unknown
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Expected O, but got Unknown
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Expected O, but got Unknown
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Expected O, but got Unknown
//IL_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: Expected O, but got Unknown
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Expected O, but got Unknown
useTextPatch = config.Bind<bool>("Flags settings", "useTextPatch", true, new ConfigDescription("Flag for TextChat patch.", (AcceptableValueBase)(object)new AcceptableValueList<bool>(new bool[2] { false, true }), Array.Empty<object>()));
useUpgradePatch = config.Bind<bool>("Flags settings", "useUpgradePatch", true, new ConfigDescription("Flag for Uprages patch.", (AcceptableValueBase)(object)new AcceptableValueList<bool>(new bool[2] { false, true }), Array.Empty<object>()));
useHealthPatch = config.Bind<bool>("Flags settings", "useHealthPatch", true, new ConfigDescription("Flag for Health patch.", (AcceptableValueBase)(object)new AcceptableValueList<bool>(new bool[2] { false, true }), Array.Empty<object>()));
useSprintPatch = config.Bind<bool>("Flags settings", "useSprintPatch", true, new ConfigDescription("Flag for Sprint patch.", (AcceptableValueBase)(object)new AcceptableValueList<bool>(new bool[2] { false, true }), Array.Empty<object>()));
SprintDrain = config.Bind<float>("Sprint Settings", "SprintDrain", 5f, new ConfigDescription("How fast ur stamina draining while sprint. In-game default value is 1f.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f), Array.Empty<object>()));
SprintRechargeTime = config.Bind<float>("Sprint Settings", "SprintRechargeTime", 0.5f, new ConfigDescription("How fast ur stamina stars recharging. In-game default value is 1f.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>()));
SprintRechargeAmount = config.Bind<float>("Sprint Settings", "SprintRechargeAmount", 3f, new ConfigDescription("Changes recharge amount per second. In-game default value is 2f.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f), Array.Empty<object>()));
}
}
[BepInPlugin("yngprodaction.repo.vision", "YNGGAMEVISION", "1.3.1")]
public class YngGameVision : BaseUnityPlugin
{
public const string pluginGuid = "yngprodaction.repo.vision";
public const string pluginName = "YNGGAMEVISION";
public const string pluginVersion = "1.3.1";
public void Awake()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Expected O, but got Unknown
((BaseUnityPlugin)this).Logger.LogInfo((object)"Mod YNGGAMEVISION was launched");
Harmony val = new Harmony("yngprodaction.repo.vision");
ConfigManager.Initialize(((BaseUnityPlugin)this).Config);
if (ConfigManager.useUpgradePatch.Value)
{
val.PatchAll(typeof(TextChatPatch));
((BaseUnityPlugin)this).Logger.LogInfo((object)"TextChat patch applied");
}
if (ConfigManager.useTextPatch.Value)
{
val.PatchAll(typeof(UpgradePatch));
((BaseUnityPlugin)this).Logger.LogInfo((object)"Upgrade patch applied");
}
if (ConfigManager.useHealthPatch.Value)
{
val.PatchAll(typeof(HealthPatch));
((BaseUnityPlugin)this).Logger.LogInfo((object)"Health patch applied");
}
if (ConfigManager.useSprintPatch.Value)
{
val.PatchAll(typeof(SprintPatch));
((BaseUnityPlugin)this).Logger.LogInfo((object)"Sprint patch applied!");
}
((BaseUnityPlugin)this).Logger.LogInfo((object)"YNGGAMEVISION:1.3.1 was initialized!");
}
}
}
namespace YNGGAMEVISION.Patches
{
[HarmonyPatch(typeof(ItemHealthPack))]
public static class HealthPatch
{
[HarmonyPatch("OnDestroy")]
[HarmonyPostfix]
public static void OnDestroyPatch(ItemHealthPack __instance)
{
List<PlayerAvatar> list = SemiFunc.PlayerGetAll();
foreach (PlayerAvatar item in list)
{
item.playerHealth.Heal(__instance.healAmount, true);
}
}
}
[HarmonyPatch(typeof(PlayerController))]
public static class SprintPatch
{
[HarmonyPatch("Start")]
[HarmonyPrefix]
public static void StartPatch(ref float ___EnergySprintDrain, ref float ___sprintRechargeTime, ref float ___sprintRechargeAmount)
{
___EnergySprintDrain = ConfigManager.SprintDrain.Value;
___sprintRechargeTime = ConfigManager.SprintRechargeTime.Value;
___sprintRechargeAmount = ConfigManager.SprintRechargeAmount.Value;
}
}
[HarmonyPatch(typeof(PlayerAvatar))]
public static class TextChatPatch
{
[HarmonyPatch("ChatMessageSend")]
[HarmonyPrefix]
public static void ChatMessageSendPatch(PlayerAvatar __instance, ref string _message, ref bool _debugMessage)
{
_message = "ya loh bez voicechata";
}
}
public static class UpgradePatch
{
[HarmonyPatch(typeof(ItemUpgradePlayerEnergy), "Upgrade")]
[HarmonyPrefix]
public static bool UpgradePlayerEnergyPatch()
{
List<PlayerAvatar> list = SemiFunc.PlayerGetAll();
foreach (PlayerAvatar item in list)
{
PunManager.instance.UpgradePlayerEnergy(SemiFunc.PlayerGetSteamID(item));
}
return false;
}
[HarmonyPatch(typeof(ItemUpgradePlayerHealth), "Upgrade")]
[HarmonyPrefix]
public static bool UpgradePlayerHealthPatch()
{
List<PlayerAvatar> list = SemiFunc.PlayerGetAll();
foreach (PlayerAvatar item in list)
{
PunManager.instance.UpgradePlayerHealth(SemiFunc.PlayerGetSteamID(item));
}
return false;
}
[HarmonyPatch(typeof(ItemUpgradePlayerExtraJump), "Upgrade")]
[HarmonyPrefix]
public static bool UpgradePlayerExtraJumpPatch()
{
List<PlayerAvatar> list = SemiFunc.PlayerGetAll();
foreach (PlayerAvatar item in list)
{
PunManager.instance.UpgradePlayerExtraJump(SemiFunc.PlayerGetSteamID(item));
}
return false;
}
[HarmonyPatch(typeof(ItemUpgradeMapPlayerCount), "Upgrade")]
[HarmonyPrefix]
public static bool UpgradeMapPlayerCountPatch()
{
List<PlayerAvatar> list = SemiFunc.PlayerGetAll();
foreach (PlayerAvatar item in list)
{
PunManager.instance.UpgradeMapPlayerCount(SemiFunc.PlayerGetSteamID(item));
}
return false;
}
[HarmonyPatch(typeof(ItemUpgradePlayerTumbleLaunch), "Upgrade")]
[HarmonyPrefix]
public static bool UpgradePlayerTumbleLaunchPatch()
{
List<PlayerAvatar> list = SemiFunc.PlayerGetAll();
foreach (PlayerAvatar item in list)
{
PunManager.instance.UpgradePlayerTumbleLaunch(SemiFunc.PlayerGetSteamID(item));
}
return false;
}
[HarmonyPatch(typeof(ItemUpgradePlayerSprintSpeed), "Upgrade")]
[HarmonyPrefix]
public static bool UpgradePlayerSprintSpeedPatch()
{
List<PlayerAvatar> list = SemiFunc.PlayerGetAll();
foreach (PlayerAvatar item in list)
{
PunManager.instance.UpgradePlayerSprintSpeed(SemiFunc.PlayerGetSteamID(item));
}
return false;
}
[HarmonyPatch(typeof(ItemUpgradePlayerGrabStrength), "Upgrade")]
[HarmonyPrefix]
public static bool UpgradePlayerGrabStrengthPatch()
{
List<PlayerAvatar> list = SemiFunc.PlayerGetAll();
foreach (PlayerAvatar item in list)
{
PunManager.instance.UpgradePlayerGrabStrength(SemiFunc.PlayerGetSteamID(item));
}
return false;
}
[HarmonyPatch(typeof(ItemUpgradePlayerGrabThrow), "Upgrade")]
[HarmonyPrefix]
public static bool UpgradePlayerThrowStrengthPatch()
{
List<PlayerAvatar> list = SemiFunc.PlayerGetAll();
foreach (PlayerAvatar item in list)
{
PunManager.instance.UpgradePlayerThrowStrength(SemiFunc.PlayerGetSteamID(item));
}
return false;
}
[HarmonyPatch(typeof(ItemUpgradePlayerGrabRange), "Upgrade")]
[HarmonyPrefix]
public static bool UpgradePlayerGrabRangePatch()
{
List<PlayerAvatar> list = SemiFunc.PlayerGetAll();
foreach (PlayerAvatar item in list)
{
PunManager.instance.UpgradePlayerGrabRange(SemiFunc.PlayerGetSteamID(item));
}
return false;
}
}
}