using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BeerMod.BeerValuable;
using BeerMod.PourStream;
using BeerMod.Settings;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Rendering.PostProcessing;
[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: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("NilsThatBoi")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.4.0")]
[assembly: AssemblyInformationalVersion("1.0.4+6c2bbfb3c577b11412f8e4462e4abf117a79f776")]
[assembly: AssemblyProduct("BeerMod")]
[assembly: AssemblyTitle("BeerMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.4.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 BeerMod.Settings
{
internal static class SettingsClass
{
public static ConfigEntry<byte>? PourAngle { get; private set; }
public static ConfigEntry<float>? VoiceChatPitch { get; private set; }
public static ConfigEntry<float>? PlayerSpeed { get; private set; }
public static ConfigEntry<float>? LookSpeed { get; private set; }
public static ConfigEntry<float>? AnimationSpeed { get; private set; }
public static ConfigEntry<float>? TimeScale { get; private set; }
public static ConfigEntry<float>? TorqueStrength { get; private set; }
public static ConfigEntry<float>? PupilSize { get; private set; }
public static ConfigEntry<float>? ZoomSize { get; private set; }
public static ConfigEntry<float>? Saturation { get; private set; }
public static ConfigEntry<int>? SegmentCount { get; private set; }
public static ConfigEntry<float>? ArcHeight { get; private set; }
public static ConfigEntry<float>? MinInvert { get; private set; }
public static ConfigEntry<float>? MaxInvert { get; private set; }
public static ConfigEntry<float>? InvertDuration { get; private set; }
public static ConfigEntry<float>? TiltChance { get; private set; }
public static ConfigEntry<float>? TiltDegreeX { get; private set; }
public static ConfigEntry<float>? TiltDegreeZ { get; private set; }
public static ConfigEntry<float>? TiltSpeed { get; private set; }
public static ConfigEntry<float>? Vignette { get; private set; }
public static ConfigEntry<float>? MotionBlur { get; private set; }
public static ConfigEntry<float>? BloomIntensity { get; private set; }
public static ConfigEntry<float>? BloomThreshold { get; private set; }
public static ConfigEntry<float>? Contrast { get; private set; }
public static void Initialize(ConfigFile config)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Expected O, but got Unknown
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Expected O, but got Unknown
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Expected O, but got Unknown
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Expected O, but got Unknown
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: Expected O, but got Unknown
//IL_0140: Unknown result type (might be due to invalid IL or missing references)
//IL_014a: Expected O, but got Unknown
//IL_0179: Unknown result type (might be due to invalid IL or missing references)
//IL_0183: Expected O, but got Unknown
//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Expected O, but got Unknown
//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
//IL_01f5: Expected O, but got Unknown
//IL_0224: Unknown result type (might be due to invalid IL or missing references)
//IL_022e: Expected O, but got Unknown
//IL_0253: Unknown result type (might be due to invalid IL or missing references)
//IL_025d: Expected O, but got Unknown
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_0296: Expected O, but got Unknown
//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
//IL_02cf: Expected O, but got Unknown
//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0308: Expected O, but got Unknown
//IL_0337: Unknown result type (might be due to invalid IL or missing references)
//IL_0341: Expected O, but got Unknown
//IL_0370: Unknown result type (might be due to invalid IL or missing references)
//IL_037a: Expected O, but got Unknown
//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
//IL_03b3: Expected O, but got Unknown
//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
//IL_03ec: Expected O, but got Unknown
//IL_041b: Unknown result type (might be due to invalid IL or missing references)
//IL_0425: Expected O, but got Unknown
//IL_0454: Unknown result type (might be due to invalid IL or missing references)
//IL_045e: Expected O, but got Unknown
//IL_048d: Unknown result type (might be due to invalid IL or missing references)
//IL_0497: Expected O, but got Unknown
//IL_04c6: Unknown result type (might be due to invalid IL or missing references)
//IL_04d0: Expected O, but got Unknown
//IL_04ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0509: Expected O, but got Unknown
//IL_0538: Unknown result type (might be due to invalid IL or missing references)
//IL_0542: Expected O, but got Unknown
PourAngle = config.Bind<byte>("Pouring", "Pouring angle for bottle", (byte)85, new ConfigDescription("The pouring angle for liquid animation", (AcceptableValueBase)(object)new AcceptableValueRange<byte>((byte)1, (byte)180), Array.Empty<object>()));
VoiceChatPitch = config.Bind<float>("Pitch", "Voice chat pitch", 0.75f, new ConfigDescription("Overriding the pitch of player when beer is picked up", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 2f), Array.Empty<object>()));
PlayerSpeed = config.Bind<float>("Speed", "Player speed", 0.8f, new ConfigDescription("Speed that the player moves when holding the beer", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 2f), Array.Empty<object>()));
LookSpeed = config.Bind<float>("Speed", "Player look speed", 0.8f, new ConfigDescription("Speed that the player looks around when holding the beer", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 2f), Array.Empty<object>()));
AnimationSpeed = config.Bind<float>("Speed", "Player animation speed", 0.8f, new ConfigDescription("Speed of the player's animation when holding the beer", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 2f), Array.Empty<object>()));
TimeScale = config.Bind<float>("Speed", "Player time scale speed", 0.8f, new ConfigDescription("Speed of the player's time scale when holding the beer", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 1f), Array.Empty<object>()));
TorqueStrength = config.Bind<float>("Torque", "Player torque strength", 0.9f, new ConfigDescription("Players torque strength when holding the bottle", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 2f), Array.Empty<object>()));
PupilSize = config.Bind<float>("Pupil", "pupil size", 0.9f, new ConfigDescription("Players pupil size when holdin the beer", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 4f), Array.Empty<object>()));
ZoomSize = config.Bind<float>("Zoom", "Zoom size", 50f, new ConfigDescription("Players camera zoom size when holdin the beer", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 50f), Array.Empty<object>()));
Saturation = config.Bind<float>("Saturation", "Saturation difference", 2f, new ConfigDescription("Saturation difference when holding the beer", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 50f), Array.Empty<object>()));
SegmentCount = config.Bind<int>("Animation", "Beer pour animation quality", 12, new ConfigDescription("Beer pouring animation quality set by segments in the stream", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 36), Array.Empty<object>()));
ArcHeight = config.Bind<float>("Animation", "arc height", 1f, new ConfigDescription("The curve of the stream as it falls", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>()));
MinInvert = config.Bind<float>("Invert", "minimum time", 2f, new ConfigDescription("minimum time until inverted movement", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 20f), Array.Empty<object>()));
MaxInvert = config.Bind<float>("Invert", "maximum time", 5f, new ConfigDescription("maximum time until inverted movement", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 20f), Array.Empty<object>()));
InvertDuration = config.Bind<float>("Invert", "invert time duration", 2f, new ConfigDescription("inverted movement duration", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 20f), Array.Empty<object>()));
TiltChance = config.Bind<float>("Invert", "Tilt chance", 0.75f, new ConfigDescription("Chance of a camera tilt while inverted", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
TiltDegreeX = config.Bind<float>("Invert", "Verticle tilt range", 3f, new ConfigDescription("The range of the verticle camera tilt, tied to Invert durations", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f), Array.Empty<object>()));
TiltDegreeZ = config.Bind<float>("Invert", "Horizontal tilt range", 10f, new ConfigDescription("The range of the horizontal camera tilt, tied to Invert durations", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f), Array.Empty<object>()));
TiltSpeed = config.Bind<float>("Invert", "Tilt speed", 2f, new ConfigDescription("the speed at which the camera tilts, tied to Invert durations", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f), Array.Empty<object>()));
Vignette = config.Bind<float>("Vignette", "Vignette intensity", 0.5f, new ConfigDescription("player's vision Vignette intensity", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 200f), Array.Empty<object>()));
MotionBlur = config.Bind<float>("MotionBlur", "MotionBlur intensity", 0.5f, new ConfigDescription("player's MotionBlur intensity", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f), Array.Empty<object>()));
BloomIntensity = config.Bind<float>("Bloom", "bloom Intensity", 1f, new ConfigDescription("player's bloom intensity", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f), Array.Empty<object>()));
BloomThreshold = config.Bind<float>("Bloom", "bloom Threshold", 0.5f, new ConfigDescription("player's bloom Threshold", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f), Array.Empty<object>()));
Contrast = config.Bind<float>("Contrast", "Contrast intensity", 0.5f, new ConfigDescription("player's Contrast intensity", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 20f), Array.Empty<object>()));
}
}
}
namespace BeerMod.PourStream
{
public class PourStreamClass : MonoBehaviour
{
[CompilerGenerated]
private sealed class <BeginPour>d__11 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public PourStreamClass <>4__this;
object? IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object? IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <BeginPour>d__11(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: 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_0090: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
break;
case 1:
<>1__state = -1;
break;
}
if (((Component)<>4__this).gameObject.activeSelf)
{
if (<>4__this.pourSound != null)
{
<>4__this.pourSound.PlayLoop(true, 0.1f, 0.1f, 1f);
}
<>4__this.targetPosition = <>4__this.FindEndPoint();
<>4__this.DrawParabolicArc(((Component)<>4__this).transform.position, <>4__this.targetPosition);
<>2__current = null;
<>1__state = 1;
return true;
}
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 <EndPour>d__14 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public PourStreamClass <>4__this;
private Vector3 <start>5__1;
private bool <allAtEnd>5__2;
private int <i>5__3;
private Vector3 <current>5__4;
private Vector3 <next>5__5;
object? IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object? IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <EndPour>d__14(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: 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_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<start>5__1 = ((Component)<>4__this).transform.position;
break;
case 1:
<>1__state = -1;
break;
}
<allAtEnd>5__2 = true;
<i>5__3 = 0;
while (<i>5__3 < <>4__this.segmentCount)
{
<current>5__4 = <>4__this.lineRenderer.GetPosition(<i>5__3);
<next>5__5 = Vector3.MoveTowards(<current>5__4, <>4__this.targetPosition, Time.deltaTime * 2f);
<>4__this.lineRenderer.SetPosition(<i>5__3, <next>5__5);
if (<next>5__5 != <>4__this.targetPosition)
{
<allAtEnd>5__2 = false;
}
<i>5__3++;
}
if (!<allAtEnd>5__2)
{
<>2__current = null;
<>1__state = 1;
return true;
}
Object.Destroy((Object)(object)((Component)<>4__this).gameObject);
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 <UpdateParticle>d__19 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public PourStreamClass <>4__this;
private EmissionModule <emission>5__1;
private bool <isHitting>5__2;
object? IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object? IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <UpdateParticle>d__19(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
<emission>5__1 = default(EmissionModule);
<>1__state = -2;
}
private bool MoveNext()
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<emission>5__1 = <>4__this.splashParticle.emission;
<>4__this.splashParticle.Play();
break;
case 1:
<>1__state = -1;
break;
}
if (((Component)<>4__this).gameObject.activeSelf)
{
((Component)<>4__this.splashParticle).gameObject.transform.position = <>4__this.targetPosition;
<isHitting>5__2 = <>4__this.HasReachedPosition(<>4__this.segmentCount - 1, <>4__this.targetPosition);
((EmissionModule)(ref <emission>5__1)).enabled = <isHitting>5__2;
<>2__current = null;
<>1__state = 1;
return true;
}
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();
}
}
private LineRenderer? lineRenderer;
[Header("Pour audio from Sound.cs")]
public Sound? pourSound;
private ParticleSystem? splashParticle;
private EmissionModule splashEmission;
private Coroutine? pourRoutine;
private Vector3 targetPosition = Vector3.zero;
private int segmentCount;
private float arcHeight;
private void Awake()
{
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
if (pourSound == null)
{
Debug.LogError((object)"pourStream wasn't assigned/found in the inspector!");
}
segmentCount = SettingsClass.SegmentCount.Value;
arcHeight = SettingsClass.ArcHeight.Value;
lineRenderer = ((Component)this).GetComponent<LineRenderer>();
lineRenderer.positionCount = segmentCount;
splashParticle = ((Component)this).GetComponentInChildren<ParticleSystem>();
splashEmission = splashParticle.emission;
((EmissionModule)(ref splashEmission)).enabled = false;
if (pourSound == null || (Object)(object)lineRenderer == (Object)null || (Object)(object)splashParticle == (Object)null)
{
((Behaviour)this).enabled = false;
}
}
private void Start()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < segmentCount; i++)
{
lineRenderer.SetPosition(i, ((Component)this).transform.position);
}
}
public void Begin()
{
pourRoutine = ((MonoBehaviour)this).StartCoroutine(BeginPour());
((MonoBehaviour)this).StartCoroutine(UpdateParticle());
}
[IteratorStateMachine(typeof(<BeginPour>d__11))]
private IEnumerator BeginPour()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <BeginPour>d__11(0)
{
<>4__this = this
};
}
private void DrawParabolicArc(Vector3 start, Vector3 end)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: 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_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: 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)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
float num = Vector3.Distance(start, end);
float num2 = num * 0.5f;
float num3 = Mathf.Min(arcHeight, num2);
Vector3 val = end - start;
Vector3 val2 = Vector3.Cross(Vector3.Cross(val, Vector3.down), val);
Vector3 normalized = ((Vector3)(ref val2)).normalized;
for (int i = 0; i < segmentCount; i++)
{
float num4 = (float)i / (float)(segmentCount - 1);
Vector3 val3 = Vector3.Lerp(start, end, num4);
float num5 = 4f * num3 * num4 * (1f - num4);
val3 += normalized * num5;
lineRenderer.SetPosition(i, val3);
}
}
public void End()
{
if (pourSound != null)
{
pourSound.PlayLoop(false, 0.1f, 0.1f, 1f);
}
if (pourRoutine != null)
{
((MonoBehaviour)this).StopCoroutine(pourRoutine);
}
pourRoutine = ((MonoBehaviour)this).StartCoroutine(EndPour());
}
[IteratorStateMachine(typeof(<EndPour>d__14))]
private IEnumerator EndPour()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <EndPour>d__14(0)
{
<>4__this = this
};
}
private Vector3 FindEndPoint()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: 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)
//IL_0044: 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)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
Ray val = default(Ray);
((Ray)(ref val))..ctor(((Component)this).transform.position, Vector3.down);
RaycastHit val2 = default(RaycastHit);
Physics.Raycast(val, ref val2, 2f);
return Object.op_Implicit((Object)(object)((RaycastHit)(ref val2)).collider) ? ((RaycastHit)(ref val2)).point : ((Ray)(ref val)).GetPoint(2f);
}
private void MoveToPosition(int index, Vector3 targetPosition)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
lineRenderer.SetPosition(index, targetPosition);
}
private void AnimateToPosition(int index, Vector3 targetPosition)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//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_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
Vector3 position = lineRenderer.GetPosition(index);
Vector3 val = Vector3.MoveTowards(position, targetPosition, Time.deltaTime * 1.75f);
lineRenderer.SetPosition(index, val);
}
private bool HasReachedPosition(int index, Vector3 targetPosition)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//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)
Vector3 position = lineRenderer.GetPosition(index);
return position == targetPosition;
}
[IteratorStateMachine(typeof(<UpdateParticle>d__19))]
private IEnumerator UpdateParticle()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <UpdateParticle>d__19(0)
{
<>4__this = this
};
}
}
}
namespace BeerMod.PourDetector
{
public class PourDetector : MonoBehaviour
{
private int pourThreshold;
public Transform? Origin;
public GameObject? PourStreamPrefab;
private bool isPouring;
private PourStreamClass? currentPourStream;
private void Awake()
{
pourThreshold = SettingsClass.PourAngle.Value;
}
private void Update()
{
bool flag = CalculatePourAngle() > (float)pourThreshold;
if (isPouring != flag)
{
isPouring = flag;
if (isPouring)
{
StartPour();
}
else
{
EndPour();
}
}
}
private void StartPour()
{
currentPourStream = CreatePourStream();
currentPourStream.Begin();
}
private void EndPour()
{
currentPourStream.End();
currentPourStream = null;
}
private float CalculatePourAngle()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
return Vector3.Angle(((Component)this).transform.up, Vector3.up);
}
private PourStreamClass CreatePourStream()
{
//IL_000d: 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)
GameObject val = Object.Instantiate<GameObject>(PourStreamPrefab, Origin.position, Quaternion.identity, ((Component)this).transform);
return val.GetComponent<PourStreamClass>();
}
}
}
namespace BeerMod.MovementInfluence
{
[HarmonyPatch]
internal static class Patch_SemiFunc_Input
{
[HarmonyPatch(typeof(SemiFunc), "InputMovementX")]
[HarmonyPostfix]
private static void PostInputMovementX(ref float __result)
{
if (BeerValuableClass.InvertInputActive && BeerValuableClass.InvertX)
{
__result = 0f - __result;
}
}
[HarmonyPatch(typeof(SemiFunc), "InputMovementY")]
[HarmonyPostfix]
private static void Post_InputMovementY(ref float __result)
{
if (BeerValuableClass.InvertInputActive && BeerValuableClass.InvertY)
{
__result = 0f - __result;
}
}
}
[HarmonyPatch(typeof(PlayerController), "Update")]
internal static class Patch_PlayerController_Look
{
private static void Postfix(PlayerController __instance)
{
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
if (!BeerValuableClass.InvertInputActive)
{
return;
}
float num = Input.GetAxis("Mouse X");
float num2 = Input.GetAxis("Mouse Y");
if (BeerValuableClass.InvertMouseX)
{
num = 0f - num;
}
if (BeerValuableClass.InvertMouseY)
{
num2 = 0f - num2;
}
__instance.cameraGameObject.transform.Rotate(0f - num2, num, 0f);
if (BeerValuableClass.TiltActive)
{
Transform transform = __instance.cameraGameObject.transform;
Vector3 localEulerAngles = transform.localEulerAngles;
if (localEulerAngles.x > 180f)
{
localEulerAngles.x -= 360f;
}
if (localEulerAngles.z > 180f)
{
localEulerAngles.z -= 360f;
}
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(localEulerAngles.x + BeerValuableClass.TiltAngleX, __instance.cameraGameObject.transform.localEulerAngles.y, localEulerAngles.z + BeerValuableClass.TiltAngleZ);
float tiltSpeed = BeerValuableClass.TiltSpeed;
transform.localEulerAngles = Vector3.Lerp(localEulerAngles, val, Time.deltaTime * tiltSpeed);
}
}
}
}
namespace BeerMod.Core
{
[BepInPlugin("NilsThatBoi.BeerMod", "BeerMod", "1.0.4")]
public class BeerModClass : BaseUnityPlugin
{
internal static BeerModClass Instance { get; private set; }
internal static ManualLogSource Logger => Instance._logger;
private ManualLogSource _logger => ((BaseUnityPlugin)this).Logger;
internal Harmony? Harmony { get; set; }
private void Awake()
{
Instance = this;
((Component)this).gameObject.transform.parent = null;
((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
SettingsClass.Initialize(((BaseUnityPlugin)this).Config);
Logger.LogInfo((object)$"{((BaseUnityPlugin)this).Info.Metadata.GUID} v{((BaseUnityPlugin)this).Info.Metadata.Version} has loaded!");
}
internal void Patch()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Expected O, but got Unknown
//IL_0026: Expected O, but got Unknown
if (Harmony == null)
{
Harmony val = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID);
Harmony val2 = val;
Harmony = val;
}
Harmony.PatchAll();
}
internal void Unpatch()
{
Harmony? harmony = Harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
}
private void Update()
{
}
}
}
namespace BeerMod.BeerValuable
{
public class BeerValuableClass : MonoBehaviour
{
public enum States
{
Idle,
Active
}
[CompilerGenerated]
private sealed class <InversionCycle>d__78 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public BeerValuableClass <>4__this;
private float <delay>5__1;
object? IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object? IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <InversionCycle>d__78(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Expected O, but got Unknown
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
break;
case 1:
<>1__state = -1;
InvertInputActive = true;
InvertX = Random.value > 0.5f;
InvertY = Random.value > 0.5f;
InvertMouseX = Random.value > 0.5f;
InvertMouseY = Random.value > 0.5f;
if (Random.value < <>4__this.tiltChance)
{
TiltActive = true;
TiltAngleX = Random.Range(0f - <>4__this.tiltDegreeX, <>4__this.tiltDegreeX);
TiltAngleZ = Random.Range(0f - <>4__this.tiltDegreeZ, <>4__this.tiltDegreeZ);
}
<>2__current = (object)new WaitForSeconds(<>4__this.invertDuration);
<>1__state = 2;
return true;
case 2:
<>1__state = -1;
if (TiltActive)
{
TiltActive = false;
TiltAngleX = 0f;
TiltAngleZ = 0f;
}
InvertInputActive = false;
InvertX = false;
InvertY = false;
InvertMouseX = false;
InvertMouseY = false;
break;
}
if ((Object)(object)<>4__this.physGrabObject != (Object)null && <>4__this.physGrabObject.grabbedLocal)
{
<delay>5__1 = Random.Range(<>4__this.minInvertInterval, <>4__this.maxInvertInterval);
<>2__current = (object)new WaitForSeconds(<delay>5__1);
<>1__state = 1;
return true;
}
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();
}
}
private static readonly string[] beerPhrases = new string[52]
{
"Burppp", "WHOOOHOOOO", "I love this beer!", "Get me my car keys!", "REPO beer is the best!", "It's 5 PM somewhere!", "Heyyy I'm drinking hereeee!", "Why is the room spinning?", "This one's for the boys!", "I'm totally fine, trust me.",
"Another round!", "This better not be non alcoholic!", "Suddenly, I can dance.", "Hold my beer and watch this.", "That hit different...", "Is this F D A approved?", "Was that a cop?", "Let’s make poor decisions!", "My liver just rage quit.", "Who put a steering wheel on the ceiling?",
"Chug! Chug! Chug!", "Wait... was that glass?", "I feel powerful. And confused.", "This tastes like victory.", "Gimme another!", "Trust me, I have a P h D in Beerology.", "1 million beers please", "Wh where'd my hands go?", "I ain’t even that drunk...", "This beer... it gets me.",
"Issss juss one beer, officer.", "Lemme tell you somethin...", "I can totally drive. No, really.", "You’re my best friend now.", "Wait, did I drink it or drop it?", "I swear I saw a unicorn.", "Why is everything upside down?", "I'm walking perfectly fine!", "Who turned down gravity?", "Beer makes you fast—science!",
"Shhh... I’m hiding from the floor.", "Is this my hand or yours?", "Time is fake. Beer is real.", "Y’all ever hear colors?", "My sanity left the bar hours ago!", "I’m not drunk, you're drunk.", "Heh... gravity’s overrated anyway.", "I love you, random object.", "What seems to be the officer, problem?", "KOWABUNGAA!",
"I dare you to steal my beer!", "Chat watch this!"
};
private bool stateStart;
private bool localMsgHasPlayed;
private PhysGrabObject? physGrabObject;
private PhotonView? photonView;
private float tiltDegreeX;
private float tiltDegreeZ;
private float tiltChance;
private float minInvertInterval;
private float maxInvertInterval;
private float invertDuration;
private float defaultBloomIntensity;
private float defaultBloomThreshold;
private float voiceChatPitch;
private float playerSpeed;
private float lookSpeed;
private float animationSpeed;
private float timeScale;
private float torqueStrength;
private float pupilSize;
private float zoomSize;
private float saturation;
private float vignette;
private float motionBlur;
private float bloomIntensity;
private float bloomThreshold;
private float contrast;
private float soundPitchLerp;
private Renderer? beerValuableRenderer;
private float _normalShutterAngle;
private States currentState;
private Coroutine? _invertRoutine;
public static bool InvertInputActive { get; private set; }
public static bool InvertX { get; private set; }
public static bool InvertY { get; private set; }
public static bool InvertMouseX { get; private set; }
public static bool InvertMouseY { get; private set; }
public static bool TiltActive { get; private set; } = false;
public static float TiltAngleX { get; private set; } = 0f;
public static float TiltAngleZ { get; private set; } = 0f;
public static float TiltSpeed { get; private set; } = SettingsClass.TiltSpeed.Value;
private void Awake()
{
minInvertInterval = SettingsClass.MinInvert.Value;
maxInvertInterval = SettingsClass.MaxInvert.Value;
invertDuration = SettingsClass.InvertDuration.Value;
defaultBloomIntensity = LevelGenerator.Instance.Level.BloomIntensity;
defaultBloomThreshold = LevelGenerator.Instance.Level.BloomThreshold;
voiceChatPitch = SettingsClass.VoiceChatPitch.Value;
playerSpeed = SettingsClass.PlayerSpeed.Value;
lookSpeed = SettingsClass.PlayerSpeed.Value;
animationSpeed = SettingsClass.AnimationSpeed.Value;
timeScale = SettingsClass.TimeScale.Value;
torqueStrength = SettingsClass.TorqueStrength.Value;
pupilSize = SettingsClass.PupilSize.Value;
zoomSize = SettingsClass.ZoomSize.Value;
saturation = SettingsClass.Saturation.Value;
vignette = SettingsClass.Vignette.Value;
motionBlur = SettingsClass.MotionBlur.Value;
bloomIntensity = SettingsClass.BloomIntensity.Value;
bloomThreshold = SettingsClass.BloomThreshold.Value;
contrast = SettingsClass.Contrast.Value;
tiltChance = SettingsClass.TiltChance.Value;
tiltDegreeX = SettingsClass.TiltDegreeX.Value;
tiltDegreeZ = SettingsClass.TiltDegreeZ.Value;
_normalShutterAngle = ((ParameterOverride<float>)(object)PostProcessing.Instance.motionBlur.shutterAngle).value;
}
private void Start()
{
physGrabObject = ((Component)this).GetComponent<PhysGrabObject>();
beerValuableRenderer = (Renderer?)(object)((Component)this).GetComponentInChildren<MeshRenderer>(true);
photonView = ((Component)this).GetComponent<PhotonView>();
if ((Object)(object)physGrabObject == (Object)null)
{
Debug.LogError((object)"PhysGrabObject not found!");
((Behaviour)this).enabled = false;
}
else if ((Object)(object)beerValuableRenderer == (Object)null)
{
Debug.LogError((object)"MeshRenderer not found!");
((Behaviour)this).enabled = false;
}
else if ((Object)(object)photonView == (Object)null)
{
Debug.LogError((object)"photonView not found!");
((Behaviour)this).enabled = false;
}
}
private void Update()
{
if (!((Object)(object)beerValuableRenderer == (Object)null))
{
switch (currentState)
{
case States.Active:
StateActive();
break;
case States.Idle:
StateIdle();
break;
}
}
}
[PunRPC]
public void SetStateRPC(States state)
{
currentState = state;
stateStart = true;
}
private void SetState(States state)
{
if (SemiFunc.IsMasterClientOrSingleplayer())
{
if (!SemiFunc.IsMultiplayer())
{
SetStateRPC(state);
return;
}
photonView.RPC("SetStateRPC", (RpcTarget)0, new object[1] { state });
}
}
private void StateIdle()
{
if (stateStart)
{
stateStart = false;
if (_invertRoutine != null)
{
((MonoBehaviour)this).StopCoroutine(_invertRoutine);
}
_invertRoutine = null;
InvertInputActive = false;
((ParameterOverride<float>)(object)PostProcessing.Instance.motionBlur.shutterAngle).value = _normalShutterAngle;
LevelGenerator.Instance.Level.BloomIntensity = defaultBloomIntensity;
LevelGenerator.Instance.Level.BloomThreshold = defaultBloomThreshold;
}
if (SemiFunc.IsMasterClientOrSingleplayer() && physGrabObject.grabbed)
{
SetState(States.Active);
}
soundPitchLerp = Mathf.Lerp(soundPitchLerp, 0f, Time.deltaTime * 10f);
}
private void StateActive()
{
if (stateStart && physGrabObject.grabbedLocal)
{
_invertRoutine = ((MonoBehaviour)this).StartCoroutine(InversionCycle());
localMsgHasPlayed = false;
stateStart = false;
}
soundPitchLerp = Mathf.Lerp(soundPitchLerp, 1f, Time.deltaTime * 2f);
foreach (PhysGrabber item in physGrabObject.playerGrabbing)
{
if (Object.op_Implicit((Object)(object)item) && !item.isLocal)
{
item.playerAvatar.voiceChat.OverridePitch(voiceChatPitch, 1f, 2f, 0.1f, 0f, 0f);
}
}
if (SemiFunc.IsMasterClientOrSingleplayer() && !physGrabObject.grabbed)
{
SetState(States.Idle);
}
if (physGrabObject.grabbedLocal)
{
GrabEffects();
TrySendLocalMessage();
}
}
private void TrySendLocalMessage()
{
if (!localMsgHasPlayed)
{
SendMessage();
localMsgHasPlayed = true;
}
}
private void GrabEffects()
{
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
PlayerAvatar instance = PlayerAvatar.instance;
if (Object.op_Implicit((Object)(object)instance.voiceChat))
{
instance.voiceChat.OverridePitch(voiceChatPitch, 1f, 2f, 0.1f, 0f, 0f);
}
instance.OverridePupilSize(pupilSize, 4, 1f, 1f, 5f, 0.5f, 0.1f);
PlayerController.instance.OverrideSpeed(playerSpeed, 0.1f);
PlayerController.instance.OverrideLookSpeed(lookSpeed, 2f, 1f, 0.1f);
PlayerController.instance.OverrideAnimationSpeed(animationSpeed, 1f, 2f, 0.1f);
PlayerController.instance.OverrideTimeScale(timeScale, 0.1f);
physGrabObject.OverrideTorqueStrength(torqueStrength, 0.1f);
CameraZoom.Instance.OverrideZoomSet(zoomSize, 0.1f, 0.5f, 1f, ((Component)this).gameObject, 0);
PostProcessing.Instance.SaturationOverride(saturation, 0.1f, 0.5f, 0.1f, ((Component)this).gameObject);
PostProcessing.Instance.VignetteOverride(Color.black, vignette, 1f, 1f, 0.5f, 0.1f, ((Component)this).gameObject);
((ParameterOverride<float>)(object)PostProcessing.Instance.motionBlur.shutterAngle).value = motionBlur;
PostProcessing.Instance.ContrastOverride(contrast, 1f, 1f, 1f, ((Component)this).gameObject);
LevelGenerator.Instance.Level.BloomIntensity = bloomIntensity;
LevelGenerator.Instance.Level.BloomThreshold = bloomThreshold;
}
[IteratorStateMachine(typeof(<InversionCycle>d__78))]
private IEnumerator InversionCycle()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <InversionCycle>d__78(0)
{
<>4__this = this
};
}
public void ResetInversion()
{
((MonoBehaviour)this).StopAllCoroutines();
InvertInputActive = false;
InvertX = false;
InvertY = false;
InvertMouseX = false;
InvertMouseY = false;
TiltActive = false;
TiltAngleX = 0f;
TiltAngleZ = 0f;
}
private void SendMessage()
{
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
string text = beerPhrases[Random.Range(0, beerPhrases.Length)];
Color val = default(Color);
((Color)(ref val))..ctor(0.95f, 0.8f, 0.1f, 1f);
ChatManager.instance.PossessChatScheduleStart(10);
ChatManager.instance.PossessChat((PossessChatID)0, text, 1f, val, 0f, false, 0, (UnityEvent)null);
ChatManager.instance.PossessChatScheduleEnd();
}
}
}
namespace BeerMod.BeerValuableBreak
{
[HarmonyPatch(typeof(PhysGrabObject), "DestroyPhysGrabObject")]
internal static class Patch_PhysGrabObject_Break
{
private static void Postfix(PhysGrabObject __instance)
{
BeerValuableClass component = ((Component)__instance).GetComponent<BeerValuableClass>();
if ((Object)(object)component != (Object)null)
{
component.ResetInversion();
}
}
}
}