using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Wasted")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Wasted")]
[assembly: AssemblyTitle("Wasted")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[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]
[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;
}
}
}
namespace Wasted
{
[BepInPlugin("yourname.whiteknuckle.wasted", "Wasted%", "1.0.0")]
[BepInProcess("White Knuckle.exe")]
public class Plugin : BaseUnityPlugin
{
private Coroutine? _wineCoroutine;
private void Awake()
{
SceneManager.sceneLoaded += OnSceneLoaded;
((BaseUnityPlugin)this).Logger.LogInfo((object)"[Wasted%] Loaded");
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
if ((Object)(object)CommandConsole.instance != (Object)null)
{
CommandConsole.hasCheated = true;
CL_GameManager.gamemode.allowAchievements = false;
((BaseUnityPlugin)this).Logger.LogInfo((object)"[Wasted%] Scene loaded, applying wine buff");
if (_wineCoroutine != null)
{
((MonoBehaviour)this).StopCoroutine(_wineCoroutine);
}
_wineCoroutine = ((MonoBehaviour)this).StartCoroutine(WineRoutine());
}
}
private IEnumerator WineRoutine()
{
yield return (object)new WaitForSeconds(2f);
ENT_Player player = ENT_Player.GetPlayer();
if ((Object)(object)player != (Object)null)
{
BuffContainer wine = new BuffContainer();
wine.id = "intoxication";
wine.loseOverTime = false;
wine.loseRate = 0f;
wine.buffTime = 1f;
wine.multiplier = 20f;
wine.buffs = new List<Buff>
{
new Buff
{
id = "intoxication",
maxAmount = 5f
}
};
((GameEntity)player).Buff(wine);
((BaseUnityPlugin)this).Logger.LogInfo((object)"[Wasted%] Wine buff applied successfully");
}
else
{
((BaseUnityPlugin)this).Logger.LogError((object)"[Wasted%] Could not find player!");
}
}
}
}