Decompiled source of LewdCompany v1.1.0

plugins/LewdCompany/LewdCompany.dll

Decompiled 5 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LewdCompany;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("LewdCompany")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LewdCompany")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b8e44f17-f4e0-4a6a-a653-2ea30a13222c")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
public class Bracken : NetworkBehaviour
{
	private PlayerControllerB targetPlayer;

	private Animator bracken_anim;

	private Animator maleAnimator;

	private GameObject male;

	private bool played;

	private Coroutine animation_coroutine;

	private AudioSource audio_src;

	public override void OnNetworkSpawn()
	{
		((NetworkBehaviour)this).OnNetworkSpawn();
		bracken_anim = ((Component)this).GetComponent<Animator>();
		if ((Object)(object)bracken_anim == (Object)null)
		{
			bracken_anim = ((Component)this).GetComponentInChildren<Animator>();
		}
		if ((Object)(object)bracken_anim != (Object)null)
		{
			bracken_anim.SetTrigger("idle");
		}
		Transform[] componentsInChildren = ((Component)this).GetComponentsInChildren<Transform>(true);
		foreach (Transform val in componentsInChildren)
		{
			if (((Object)val).name == "man_mesh")
			{
				male = ((Component)val).gameObject;
				maleAnimator = male.GetComponent<Animator>();
				if ((Object)(object)maleAnimator == (Object)null)
				{
					maleAnimator = male.GetComponentInChildren<Animator>();
				}
				Debug.Log((object)"bracken male found");
			}
		}
		audio_src = ((Component)this).GetComponent<AudioSource>();
		if ((Object)(object)audio_src == (Object)null)
		{
			audio_src = ((Component)this).gameObject.AddComponent<AudioSource>();
		}
		audio_src.spatialBlend = 1f;
		audio_src.minDistance = 2f;
		audio_src.maxDistance = 20f;
		audio_src.playOnAwake = false;
		audio_src.loop = false;
		if ((Object)(object)male != (Object)null)
		{
			male.SetActive(false);
		}
		target_player();
		Debug.Log((object)"bracken init");
	}

	private void Update()
	{
		//IL_0054: 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_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: 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_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: 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)
		if (played || (!((NetworkBehaviour)this).IsServer && !((NetworkBehaviour)this).IsHost))
		{
			return;
		}
		if ((Object)(object)targetPlayer == (Object)null)
		{
			target_player();
		}
		else if (targetPlayer.isPlayerControlled && !targetPlayer.isPlayerDead)
		{
			Vector3 val = ((Component)targetPlayer).transform.position - ((Component)this).transform.position;
			val.y = 0f;
			if (((Vector3)(ref val)).sqrMagnitude > 0.1f)
			{
				Quaternion val2 = Quaternion.LookRotation(val);
				((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, val2, Time.deltaTime * 5f);
			}
		}
	}

	private void target_player()
	{
		//IL_004b: 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)
		float num = float.MaxValue;
		PlayerControllerB val = null;
		if ((Object)(object)StartOfRound.Instance != (Object)null)
		{
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB val2 in allPlayerScripts)
			{
				if ((Object)(object)val2 != (Object)null && val2.isPlayerControlled && !val2.isPlayerDead)
				{
					float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position);
					if (num2 < num)
					{
						num = num2;
						val = val2;
					}
				}
			}
		}
		targetPlayer = val;
		if ((Object)(object)targetPlayer != (Object)null)
		{
			Debug.Log((object)("bracken target - " + targetPlayer.playerUsername));
		}
		else
		{
			Debug.LogWarning((object)"bracken fuck player");
		}
	}

	public void strip_state(bool undress)
	{
		if ((Object)(object)male != (Object)null)
		{
			male.SetActive(undress);
		}
		Debug.Log((object)("bracken male: " + (undress ? "show" : "hidden")));
	}

	public bool nude()
	{
		return true;
	}

	public void start_sex(string triggerName)
	{
		Debug.Log((object)("bracken trig set - " + triggerName));
		if ((Object)(object)bracken_anim == (Object)null)
		{
			Debug.LogWarning((object)"bracken animator fucked up");
			return;
		}
		bool flag = false;
		AnimatorControllerParameter[] parameters = bracken_anim.parameters;
		for (int i = 0; i < parameters.Length; i++)
		{
			if (parameters[i].name == triggerName)
			{
				flag = true;
				break;
			}
		}
		if (!flag)
		{
			Debug.LogWarning((object)("bracken ohhh nooo bruh - " + triggerName));
			return;
		}
		played = true;
		if (lewd(triggerName))
		{
			strip_state(undress: true);
		}
		bracken_anim.SetTrigger(triggerName);
		Debug.Log((object)("bracken trig - " + triggerName));
		if ((Object)(object)audio_src != (Object)null && (Object)(object)LewdCompanionManager.Instance != (Object)null)
		{
			LewdCompanionManager instance = LewdCompanionManager.Instance;
			if (triggerName.Contains("fast"))
			{
				AudioClip val = instance.pick_sfx("moan");
				if ((Object)(object)val != (Object)null)
				{
					audio_src.PlayOneShot(val);
				}
				AudioClip val2 = instance.pick_sfx("pounding");
				if ((Object)(object)val2 != (Object)null)
				{
					audio_src.PlayOneShot(val2);
				}
			}
			else if (triggerName.Contains("cum"))
			{
				AudioClip val3 = instance.pick_sfx("ahh");
				if ((Object)(object)val3 != (Object)null)
				{
					audio_src.PlayOneShot(val3);
				}
			}
			else if (triggerName.Contains("slow"))
			{
				AudioClip val4 = instance.pick_sfx("moan");
				if ((Object)(object)val4 != (Object)null)
				{
					audio_src.PlayOneShot(val4);
				}
				AudioClip val5 = instance.pick_sfx("slide");
				if ((Object)(object)val5 != (Object)null)
				{
					audio_src.PlayOneShot(val5);
				}
			}
		}
		if (animation_coroutine != null)
		{
			((MonoBehaviour)this).StopCoroutine(animation_coroutine);
		}
		float num = length(triggerName);
		if (num <= 0f)
		{
			num = 3f;
		}
		animation_coroutine = ((MonoBehaviour)this).StartCoroutine(souls(num + 0.3f));
	}

	public void state_idle()
	{
		if ((Object)(object)bracken_anim != (Object)null)
		{
			bracken_anim.SetTrigger("idle");
			Debug.Log((object)"bracken set idle trigger");
		}
		if ((Object)(object)male != (Object)null)
		{
			male.SetActive(false);
		}
	}

	private float length(string triggerName)
	{
		if ((Object)(object)bracken_anim == (Object)null)
		{
			return 120f;
		}
		AnimationClip[] animationClips = bracken_anim.runtimeAnimatorController.animationClips;
		foreach (AnimationClip val in animationClips)
		{
			if (((Object)val).name.ToLower().Contains(triggerName.ToLower()) || triggerName.ToLower().Contains(((Object)val).name.ToLower()))
			{
				return val.length;
			}
		}
		return 120f;
	}

	private IEnumerator souls(float delay)
	{
		yield return (object)new WaitForSeconds(delay);
		played = false;
		animation_coroutine = null;
	}

	private bool lewd(string triggerName)
	{
		if (!triggerName.Contains("handjob") && !triggerName.Contains("paizuri"))
		{
			return triggerName.Contains("doggy");
		}
		return true;
	}
}
public class LewdCompanionAI : NetworkBehaviour
{
	private PlayerControllerB targetPlayer;

	private Animator slut_anim;

	private Animator maleAnimator;

	private GameObject wtf;

	private GameObject male;

	private bool strip;

	private bool played;

	private Coroutine animation_coroutine;

	private AudioSource audio_src;

	public override void OnNetworkSpawn()
	{
		((NetworkBehaviour)this).OnNetworkSpawn();
		slut_anim = ((Component)this).GetComponent<Animator>();
		if ((Object)(object)slut_anim == (Object)null)
		{
			slut_anim = ((Component)this).GetComponentInChildren<Animator>();
		}
		slut_anim.SetTrigger("idle");
		audio_src = ((Component)this).GetComponent<AudioSource>();
		if ((Object)(object)audio_src == (Object)null)
		{
			audio_src = ((Component)this).gameObject.AddComponent<AudioSource>();
		}
		audio_src.spatialBlend = 1f;
		audio_src.minDistance = 2f;
		audio_src.maxDistance = 20f;
		audio_src.playOnAwake = false;
		audio_src.loop = false;
		Transform[] componentsInChildren = ((Component)this).GetComponentsInChildren<Transform>(true);
		foreach (Transform val in componentsInChildren)
		{
			if (((Object)val).name == "Suit")
			{
				wtf = ((Component)val).gameObject;
				Debug.Log((object)"suit found");
			}
			if (((Object)val).name == "man_mesh")
			{
				male = ((Component)val).gameObject;
				maleAnimator = male.GetComponent<Animator>();
				if ((Object)(object)maleAnimator == (Object)null)
				{
					maleAnimator = male.GetComponentInChildren<Animator>();
				}
				Debug.Log((object)"male found");
			}
			if (((Object)val).name == "CamPiv" || ((Object)val).name == "SexCam")
			{
				Camera componentInChildren = ((Component)val).GetComponentInChildren<Camera>();
				if ((Object)(object)componentInChildren != (Object)null)
				{
					((Behaviour)componentInChildren).enabled = false;
					Debug.Log((object)"offed");
				}
			}
		}
		if ((Object)(object)wtf != (Object)null)
		{
			wtf.SetActive(true);
		}
		if ((Object)(object)male != (Object)null)
		{
			male.SetActive(false);
		}
		strip = false;
		if ((Object)(object)slut_anim != (Object)null)
		{
			slut_anim.SetBool("isUndressed", false);
		}
		target_player();
		Debug.Log((object)"init");
	}

	private void Update()
	{
		//IL_0054: 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_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: 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_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: 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)
		if (played || (!((NetworkBehaviour)this).IsServer && !((NetworkBehaviour)this).IsHost))
		{
			return;
		}
		if ((Object)(object)targetPlayer == (Object)null)
		{
			target_player();
		}
		else if (targetPlayer.isPlayerControlled && !targetPlayer.isPlayerDead)
		{
			Vector3 val = ((Component)targetPlayer).transform.position - ((Component)this).transform.position;
			val.y = 0f;
			if (((Vector3)(ref val)).sqrMagnitude > 0.1f)
			{
				Quaternion val2 = Quaternion.LookRotation(val);
				((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, val2, Time.deltaTime * 5f);
			}
		}
	}

	private void target_player()
	{
		//IL_004b: 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)
		float num = float.MaxValue;
		PlayerControllerB val = null;
		if ((Object)(object)StartOfRound.Instance != (Object)null)
		{
			PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
			foreach (PlayerControllerB val2 in allPlayerScripts)
			{
				if ((Object)(object)val2 != (Object)null && val2.isPlayerControlled && !val2.isPlayerDead)
				{
					float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position);
					if (num2 < num)
					{
						num = num2;
						val = val2;
					}
				}
			}
		}
		targetPlayer = val;
		if ((Object)(object)targetPlayer != (Object)null)
		{
			Debug.Log((object)("player - " + targetPlayer.playerUsername));
		}
		else
		{
			Debug.LogWarning((object)"fuck player");
		}
	}

	public void strip_state(bool undress)
	{
		strip = undress;
		if ((Object)(object)wtf != (Object)null)
		{
			wtf.SetActive(!undress);
		}
		if ((Object)(object)male != (Object)null)
		{
			male.SetActive(undress);
		}
		if ((Object)(object)slut_anim != (Object)null)
		{
			slut_anim.SetBool("zxc", undress);
		}
		Debug.Log((object)("suit - " + (undress ? "hide" : "show") + ", male: " + (undress ? "show" : "hiden")));
	}

	public bool nude()
	{
		return strip;
	}

	public void start_sex(string triggerName)
	{
		Debug.Log((object)("trig set - " + triggerName));
		if ((Object)(object)slut_anim == (Object)null)
		{
			slut_anim = ((Component)this).GetComponent<Animator>();
			if ((Object)(object)slut_anim == (Object)null)
			{
				slut_anim = ((Component)this).GetComponentInChildren<Animator>();
			}
			if ((Object)(object)slut_anim == (Object)null)
			{
				Debug.LogWarning((object)"animator fucked up");
				return;
			}
		}
		bool flag = false;
		AnimatorControllerParameter[] parameters = slut_anim.parameters;
		for (int i = 0; i < parameters.Length; i++)
		{
			if (parameters[i].name == triggerName)
			{
				flag = true;
				break;
			}
		}
		if (!flag)
		{
			Debug.LogWarning((object)("ohhh nooo bruh - " + triggerName));
			return;
		}
		played = true;
		if (lewd(triggerName) || triggerName == "strip_on")
		{
			strip_state(undress: true);
		}
		else if (triggerName == "strip_off")
		{
			strip_state(undress: false);
		}
		slut_anim.SetTrigger(triggerName);
		Debug.Log((object)("trig - " + triggerName));
		if ((Object)(object)audio_src != (Object)null && (Object)(object)LewdCompanionManager.Instance != (Object)null)
		{
			LewdCompanionManager instance = LewdCompanionManager.Instance;
			if (triggerName.Contains("fast"))
			{
				AudioClip val = instance.pick_sfx("moan");
				if ((Object)(object)val != (Object)null)
				{
					audio_src.PlayOneShot(val);
				}
				AudioClip val2 = instance.pick_sfx("pounding");
				if ((Object)(object)val2 != (Object)null)
				{
					audio_src.PlayOneShot(val2);
				}
			}
			else if (triggerName.Contains("cum"))
			{
				AudioClip val3 = instance.pick_sfx("ahh");
				if ((Object)(object)val3 != (Object)null)
				{
					audio_src.PlayOneShot(val3);
				}
			}
			else if (triggerName.Contains("slow"))
			{
				AudioClip val4 = instance.pick_sfx("moan");
				if ((Object)(object)val4 != (Object)null)
				{
					audio_src.PlayOneShot(val4);
				}
				AudioClip val5 = instance.pick_sfx("slide");
				if ((Object)(object)val5 != (Object)null)
				{
					audio_src.PlayOneShot(val5);
				}
			}
		}
		if (animation_coroutine != null)
		{
			((MonoBehaviour)this).StopCoroutine(animation_coroutine);
		}
		float num = length(triggerName);
		if (num <= 0f)
		{
			num = 3f;
		}
		animation_coroutine = ((MonoBehaviour)this).StartCoroutine(souls(num + 0.3f));
	}

	public void state_idle()
	{
		if ((Object)(object)slut_anim != (Object)null)
		{
			slut_anim.SetTrigger("idle");
			Debug.Log((object)"Set idle trigger");
		}
		if ((Object)(object)male != (Object)null)
		{
			male.SetActive(false);
		}
		if ((Object)(object)wtf != (Object)null)
		{
			wtf.SetActive(true);
		}
		strip = false;
		if ((Object)(object)slut_anim != (Object)null)
		{
			slut_anim.SetBool("isUndressed", false);
		}
	}

	private float length(string triggerName)
	{
		if ((Object)(object)slut_anim == (Object)null)
		{
			return 120f;
		}
		AnimationClip[] animationClips = slut_anim.runtimeAnimatorController.animationClips;
		foreach (AnimationClip val in animationClips)
		{
			if (((Object)val).name.ToLower().Contains(triggerName.ToLower()) || triggerName.ToLower().Contains(((Object)val).name.ToLower()))
			{
				return val.length;
			}
		}
		return 120f;
	}

	private IEnumerator souls(float delay)
	{
		yield return (object)new WaitForSeconds(delay);
		played = false;
		animation_coroutine = null;
	}

	private bool lewd(string triggerName)
	{
		if (!triggerName.Contains("cowgirl") && !triggerName.Contains("facesit") && !triggerName.Contains("doggy") && !triggerName.Contains("missionary"))
		{
			return triggerName.Contains("thingjob");
		}
		return true;
	}
}
[HarmonyPatch]
public static class LewdCompanionEnemyPatch
{
	public class warn : MonoBehaviour
	{
		public IEnumerator DelayedShow(float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			sh_warning();
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static UnityAction <>9__12_0;

		public static UnityAction <>9__12_1;

		public static UnityAction <>9__12_2;

		public static Func<SpawnableEnemyWithRarity, bool> <>9__16_0;

		public static Func<EnemyAI, bool> <>9__18_0;

		internal void <add_warning>b__12_0()
		{
			age_false();
		}

		internal void <add_warning>b__12_1()
		{
			age_false();
		}

		internal void <add_warning>b__12_2()
		{
			age_true();
		}

		internal bool <slut_onlvl>b__16_0(SpawnableEnemyWithRarity e)
		{
			return (Object)(object)e.enemyType == (Object)(object)slut_type;
		}

		internal bool <spawn_on_state>b__18_0(EnemyAI e)
		{
			return (Object)(object)e.enemyType == (Object)(object)slut_type;
		}
	}

	private static bool reg;

	private static EnemyType slut_type;

	private static GameObject warning;

	private static bool warn_showed;

	private static bool ass;

	private static GameObject bracken_prefab_cache;

	[HarmonyPatch(typeof(GameNetworkManager), "Start")]
	[HarmonyPostfix]
	private static void LoadEnemyType()
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)global::LewdCompany.LewdCompany.bundle == (Object)null)
		{
			Debug.LogError((object)"no bundle");
			return;
		}
		Scene activeScene = SceneManager.GetActiveScene();
		string name = ((Scene)(ref activeScene)).name;
		Debug.Log((object)("current scen " + name));
		if ((Object)(object)warning == (Object)null)
		{
			add_warning();
		}
		if (name == "MainMenu")
		{
			if (!warn_showed)
			{
				warn_show(0.5f);
			}
		}
		else if ((Object)(object)warning != (Object)null)
		{
			warning.SetActive(false);
		}
		fkc_test_method();
		cache_bracken();
	}

	[HarmonyPatch(typeof(SceneManager), "Internal_SceneLoaded")]
	[HarmonyPostfix]
	private static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
	{
		string name = ((Scene)(ref scene)).name;
		Debug.Log((object)("scen loaded " + name));
		if (name == "InitScene")
		{
			if ((Object)(object)warning == (Object)null)
			{
				add_warning();
			}
			if (!ass && !warn_showed)
			{
				ass = true;
				warn_show(3.7f);
			}
		}
		else if (name == "MainMenu")
		{
			if ((Object)(object)warning == (Object)null)
			{
				add_warning();
			}
			if (!warn_showed)
			{
				warn_show(0.5f);
			}
		}
		else if ((Object)(object)warning != (Object)null)
		{
			warning.SetActive(false);
			warn_showed = false;
		}
	}

	private static void warn_show(float delay)
	{
		//IL_0013: 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_001e: Expected O, but got Unknown
		if (!((Object)(object)warning == (Object)null))
		{
			GameObject val = new GameObject("Warning");
			Object.DontDestroyOnLoad((Object)val);
			warn warn = val.AddComponent<warn>();
			((MonoBehaviour)warn).StartCoroutine(warn.DelayedShow(delay));
		}
	}

	private static void cache_bracken()
	{
		if (!((Object)(object)bracken_prefab_cache != (Object)null) && !((Object)(object)global::LewdCompany.LewdCompany.bundle == (Object)null))
		{
			bracken_prefab_cache = global::LewdCompany.LewdCompany.bundle.LoadAsset<GameObject>("bracken");
			if ((Object)(object)bracken_prefab_cache == (Object)null)
			{
				bracken_prefab_cache = global::LewdCompany.LewdCompany.bundle.LoadAsset<GameObject>("Bracken");
			}
			if ((Object)(object)bracken_prefab_cache != (Object)null)
			{
				Debug.Log((object)"bracken cached");
			}
			else
			{
				Debug.LogError((object)"lmao");
			}
		}
	}

	private static void fkc_test_method()
	{
		if (!reg && !((Object)(object)global::LewdCompany.LewdCompany.bundle == (Object)null))
		{
			slut_type = global::LewdCompany.LewdCompany.bundle.LoadAsset<EnemyType>("Sexness");
			if (!((Object)(object)slut_type == (Object)null))
			{
				reg = true;
				Debug.Log((object)"e.t loaded");
			}
		}
	}

	public static void add_warning()
	{
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Expected O, but got Unknown
		//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c0: Expected O, but got Unknown
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Expected O, but got Unknown
		if ((Object)(object)global::LewdCompany.LewdCompany.bundle == (Object)null)
		{
			Debug.LogError((object)"bundle fucked up");
		}
		else
		{
			if ((Object)(object)warning != (Object)null)
			{
				return;
			}
			try
			{
				warning = global::LewdCompany.LewdCompany.bundle.LoadAsset<GameObject>("Warning");
				if ((Object)(object)warning == (Object)null)
				{
					Debug.LogError((object)"zxc");
					return;
				}
				warning = Object.Instantiate<GameObject>(warning);
				warning.SetActive(false);
				Object.DontDestroyOnLoad((Object)(object)warning);
				Transform val = warning.transform.Find("no");
				if ((Object)(object)val != (Object)null)
				{
					Button component = ((Component)val).GetComponent<Button>();
					if ((Object)(object)component != (Object)null)
					{
						ButtonClickedEvent onClick = component.onClick;
						object obj = <>c.<>9__12_0;
						if (obj == null)
						{
							UnityAction val2 = delegate
							{
								age_false();
							};
							<>c.<>9__12_0 = val2;
							obj = (object)val2;
						}
						((UnityEvent)onClick).AddListener((UnityAction)obj);
						Debug.Log((object)"button fucked up");
					}
				}
				else
				{
					Button[] componentsInChildren = warning.GetComponentsInChildren<Button>();
					foreach (Button val3 in componentsInChildren)
					{
						Text componentInChildren = ((Component)val3).GetComponentInChildren<Text>();
						if (!((Object)(object)componentInChildren != (Object)null) || !(componentInChildren.text.ToLower() == "no"))
						{
							continue;
						}
						ButtonClickedEvent onClick2 = val3.onClick;
						object obj2 = <>c.<>9__12_1;
						if (obj2 == null)
						{
							UnityAction val4 = delegate
							{
								age_false();
							};
							<>c.<>9__12_1 = val4;
							obj2 = (object)val4;
						}
						((UnityEvent)onClick2).AddListener((UnityAction)obj2);
						Debug.Log((object)"zxc");
						break;
					}
				}
				Transform val5 = warning.transform.Find("yes");
				if (!((Object)(object)val5 != (Object)null))
				{
					return;
				}
				Button component2 = ((Component)val5).GetComponent<Button>();
				if (!((Object)(object)component2 != (Object)null))
				{
					return;
				}
				ButtonClickedEvent onClick3 = component2.onClick;
				object obj3 = <>c.<>9__12_2;
				if (obj3 == null)
				{
					UnityAction val6 = delegate
					{
						age_true();
					};
					<>c.<>9__12_2 = val6;
					obj3 = (object)val6;
				}
				((UnityEvent)onClick3).AddListener((UnityAction)obj3);
				Debug.Log((object)"eee");
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("err " + ex.Message));
			}
		}
	}

	public static void sh_warning()
	{
		if ((Object)(object)warning != (Object)null)
		{
			warning.SetActive(true);
			warn_showed = true;
		}
		else
		{
			Debug.LogError((object)"ehh");
		}
	}

	public static void age_true()
	{
		PlayerPrefs.SetInt("verify", 1);
		PlayerPrefs.Save();
		if ((Object)(object)warning != (Object)null)
		{
			warning.SetActive(false);
			warn_showed = false;
		}
		fkc_test_method();
	}

	public static void age_false()
	{
		Debug.Log((object)"goodbye :-)");
		string directoryName = Path.GetDirectoryName(typeof(LewdCompanionEnemyPatch).Assembly.Location);
		try
		{
			string[] files = Directory.GetFiles(directoryName, "*.dll");
			foreach (string text in files)
			{
				if (text.Contains("LewdCompany"))
				{
					try
					{
						File.Delete(text);
						Debug.Log((object)("here " + text));
					}
					catch
					{
					}
				}
			}
		}
		catch
		{
		}
		Application.Quit();
		Process.GetCurrentProcess().Kill();
	}

	[HarmonyPatch(typeof(RoundManager), "Start")]
	[HarmonyPostfix]
	private static void slut_onlvl()
	{
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Expected O, but got Unknown
		if (!PlayerPrefs.HasKey("verify"))
		{
			Debug.Log((object)"fuck you");
		}
		else
		{
			if (!reg || (Object)(object)slut_type == (Object)null || (Object)(object)StartOfRound.Instance == (Object)null)
			{
				return;
			}
			SelectableLevel[] levels = StartOfRound.Instance.levels;
			foreach (SelectableLevel val in levels)
			{
				if (!((Object)(object)val == (Object)null) && !val.Enemies.Any((SpawnableEnemyWithRarity e) => (Object)(object)e.enemyType == (Object)(object)slut_type))
				{
					val.Enemies.Add(new SpawnableEnemyWithRarity(slut_type, 1));
					Debug.Log((object)("load - " + ((Object)val).name));
				}
			}
		}
	}

	private static Vector3 sp_ship()
	{
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = GameObject.Find("PlayerShipNavmesh");
		if ((Object)(object)val == (Object)null)
		{
			Debug.LogWarning((object)"psn fucked up");
			return new Vector3(0f, 2f, 5f);
		}
		return val.transform.position + new Vector3(20f, -5.4f, 2.3f);
	}

	[HarmonyPatch(typeof(RoundManager), "SpawnOutsideHazards")]
	[HarmonyPostfix]
	private static void spawn_on_state()
	{
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0135: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: 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_0141: Unknown result type (might be due to invalid IL or missing references)
		if (!PlayerPrefs.HasKey("verify"))
		{
			Debug.Log((object)"bruuuh");
		}
		else
		{
			if (!reg || (Object)(object)slut_type == (Object)null || (!NetworkManager.Singleton.IsServer && !NetworkManager.Singleton.IsHost) || (Object)(object)RoundManager.Instance == (Object)null || RoundManager.Instance.SpawnedEnemies.Any((EnemyAI e) => (Object)(object)e.enemyType == (Object)(object)slut_type))
			{
				return;
			}
			Vector3 val = sp_ship();
			GameObject val2 = Object.Instantiate<GameObject>(slut_type.enemyPrefab, val, Quaternion.identity);
			Debug.Log((object)"dick");
			if ((Object)(object)val2.GetComponent<LewdCompanionAI>() == (Object)null)
			{
				val2.AddComponent<LewdCompanionAI>();
				Debug.Log((object)"LCA added");
			}
			if ((Object)(object)val2.GetComponent<LewdCompanionInteraction>() == (Object)null)
			{
				val2.AddComponent<LewdCompanionInteraction>();
				Debug.Log((object)"LCI added");
			}
			NetworkObject component = val2.GetComponent<NetworkObject>();
			if ((Object)(object)component != (Object)null)
			{
				component.Spawn(false);
			}
			else
			{
				Debug.LogError((object)"n.o fuckkkk");
			}
			cache_bracken();
			if ((Object)(object)bracken_prefab_cache != (Object)null)
			{
				Vector3 val3 = val + new Vector3(2f, 0f, 0f);
				GameObject val4 = Object.Instantiate<GameObject>(bracken_prefab_cache, val3, Quaternion.identity);
				Debug.Log((object)"bracken spawned");
				if ((Object)(object)val4.GetComponent<Bracken>() == (Object)null)
				{
					val4.AddComponent<Bracken>();
					Debug.Log((object)"Bracken AI added");
				}
				if ((Object)(object)val4.GetComponent<BrackenInteraction>() == (Object)null)
				{
					val4.AddComponent<BrackenInteraction>();
					Debug.Log((object)"Bracken interaction added");
				}
				NetworkObject component2 = val4.GetComponent<NetworkObject>();
				if ((Object)(object)component2 != (Object)null)
				{
					component2.Spawn(false);
					Debug.Log((object)"bracken network spawned");
				}
				else
				{
					Debug.LogError((object)"bracken n.o fuckkkk - нет NetworkObject на префабе");
				}
			}
		}
	}
}
namespace LewdCompany;

public class BrackenInteraction : MonoBehaviour
{
	private bool ins;

	private bool interact;

	private void Start()
	{
		if ((Object)(object)((Component)this).GetComponent<Collider>() == (Object)null)
		{
			Debug.LogWarning((object)"bracken no coil");
			return;
		}
		interact = true;
		LewdCompany.Log.LogInfo((object)"bracken lci init");
	}

	private void OnTriggerEnter(Collider other)
	{
		if ((Object)(object)((Component)other).GetComponent<PlayerControllerB>() != (Object)null)
		{
			ins = true;
			LewdCompany.Log.LogInfo((object)"bracken trig enter");
		}
	}

	private void OnTriggerExit(Collider other)
	{
		if ((Object)(object)((Component)other).GetComponent<PlayerControllerB>() != (Object)null)
		{
			ins = false;
			LewdCompany.Log.LogInfo((object)"bracken trig left");
		}
	}

	private void Update()
	{
		if (interact && ins && Keyboard.current != null && ((ButtonControl)Keyboard.current.eKey).wasPressedThisFrame)
		{
			LewdCompany.Log.LogInfo((object)"bracken kayf");
			op_menu();
		}
		if (Keyboard.current != null && ((ButtonControl)Keyboard.current.escapeKey).wasPressedThisFrame && (Object)(object)BrackenManager.Instance != (Object)null)
		{
			LewdCompany.Log.LogInfo((object)"bracken esc toggle");
			BrackenManager.Instance.toggle_men(open: false);
		}
	}

	private void op_menu()
	{
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Expected O, but got Unknown
		if ((Object)(object)BrackenManager.Instance == (Object)null)
		{
			LewdCompany.Log.LogWarning((object)"bracken manager not found");
			if ((Object)(object)Object.FindObjectOfType<BrackenManager>() == (Object)null)
			{
				GameObject val = new GameObject("BrackenManager");
				val.AddComponent<BrackenManager>();
				Object.DontDestroyOnLoad((Object)val);
				LewdCompany.Log.LogInfo((object)"bracken eblan syka");
			}
		}
		if ((Object)(object)BrackenManager.Instance != (Object)null)
		{
			BrackenManager.Instance.toggle_men(open: true);
		}
		else
		{
			LewdCompany.Log.LogError((object)"bracken fucking idiot");
		}
	}
}
public class BrackenManager : MonoBehaviour
{
	private PlayerControllerB p_l;

	private GameObject bracken;

	private Animator bracken_anim;

	private Animator male_animator;

	private GameObject ui_pan;

	private Animator uiAnimator;

	private bool ui_opened;

	private bool search;

	private bool nevermore;

	private Camera main_camera;

	private GameObject camPiv;

	private Camera bracken_camera;

	private bool bracken_act;

	private float pivoty;

	private float pivotx;

	private bool shift;

	private bool cumming;

	private string current_pose = "";

	public static BrackenManager Instance { get; private set; }

	private void Awake()
	{
		if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
			return;
		}
		Instance = this;
		LewdCompany.Log.LogInfo((object)"bracken instance");
		Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
		SceneManager.sceneLoaded += OnSceneLoaded;
		ui_ftp();
	}

	private void Start()
	{
		LewdCompany.Log.LogInfo((object)"bracken compl");
		((MonoBehaviour)this).StartCoroutine(main());
		cam_find();
	}

	private void cam_find()
	{
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Expected O, but got Unknown
		//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		main_camera = Camera.main;
		if ((Object)(object)main_camera == (Object)null)
		{
			main_camera = Object.FindObjectOfType<Camera>();
		}
		if ((Object)(object)bracken == (Object)null)
		{
			LewdCompany.Log.LogWarning((object)"bracken cam_find: bracken NULL");
			return;
		}
		Transform val = null;
		Transform[] componentsInChildren = bracken.GetComponentsInChildren<Transform>(true);
		foreach (Transform val2 in componentsInChildren)
		{
			if (((Object)val2).name == "CamPiv")
			{
				val = val2;
				break;
			}
		}
		if ((Object)(object)val == (Object)null)
		{
			LewdCompany.Log.LogWarning((object)"bracken cam_find: CamPiv NOT FOUND");
			return;
		}
		camPiv = ((Component)val).gameObject;
		bracken_camera = camPiv.GetComponentInChildren<Camera>();
		if ((Object)(object)bracken_camera == (Object)null)
		{
			GameObject val3 = new GameObject("BrackenCam");
			val3.transform.parent = camPiv.transform;
			val3.transform.localPosition = Vector3.zero;
			val3.transform.localRotation = Quaternion.identity;
			bracken_camera = val3.AddComponent<Camera>();
		}
		((Behaviour)bracken_camera).enabled = false;
		LewdCompany.Log.LogInfo((object)"bracken cam found");
	}

	private IEnumerator main()
	{
		yield return (object)new WaitForSeconds(1f);
		find_bracken();
		api_male();
		if (!nevermore)
		{
			ui_ass();
			nevermore = true;
		}
		cam_find();
	}

	private void api_male()
	{
		if ((Object)(object)bracken == (Object)null)
		{
			return;
		}
		Transform[] componentsInChildren = bracken.GetComponentsInChildren<Transform>(true);
		foreach (Transform val in componentsInChildren)
		{
			if (((Object)val).name == "man_mesh")
			{
				male_animator = ((Component)val).GetComponent<Animator>();
				if ((Object)(object)male_animator == (Object)null)
				{
					male_animator = ((Component)val).GetComponentInChildren<Animator>();
				}
				LewdCompany.Log.LogInfo((object)"bracken male fucked up");
				return;
			}
		}
		LewdCompany.Log.LogWarning((object)"bracken male bruh");
	}

	private void Update()
	{
		//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_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
		if (Keyboard.current == null)
		{
			return;
		}
		if (bracken_act)
		{
			if (Mouse.current != null)
			{
				Vector2 val = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).delta).ReadValue();
				if (Mouse.current.leftButton.isPressed)
				{
					pivoty += val.x * 0.5f;
					pivotx += val.y * 0.5f;
					pivotx = Mathf.Clamp(pivotx, -80f, 80f);
					if ((Object)(object)camPiv != (Object)null)
					{
						camPiv.transform.localRotation = Quaternion.Euler(pivotx, pivoty, 0f);
					}
				}
				float y = ((InputControl<Vector2>)(object)Mouse.current.scroll).ReadValue().y;
				if (y != 0f && (Object)(object)bracken_camera != (Object)null)
				{
					float num = bracken_camera.fieldOfView - y * 5f;
					bracken_camera.fieldOfView = Mathf.Clamp(num, 20f, 100f);
				}
			}
			bool flag = ((ButtonControl)Keyboard.current.leftShiftKey).isPressed || ((ButtonControl)Keyboard.current.rightShiftKey).isPressed;
			if (flag && !shift && (Object)(object)bracken != (Object)null && !string.IsNullOrEmpty(current_pose))
			{
				string femaleTrigger = "b_" + current_pose + "_fast";
				string maleTrigger = get_male_trigger(current_pose, "fast");
				zxc_da(femaleTrigger, maleTrigger);
			}
			shift = flag;
			bool isPressed = ((ButtonControl)Keyboard.current.spaceKey).isPressed;
			if (isPressed && !cumming && !string.IsNullOrEmpty(current_pose))
			{
				string femaleTrigger2 = "b_" + current_pose + "_cum";
				string maleTrigger2 = get_male_trigger(current_pose, "cum");
				zxc_da(femaleTrigger2, maleTrigger2);
			}
			cumming = isPressed;
			if (((ButtonControl)Keyboard.current.escapeKey).wasPressedThisFrame)
			{
				astral_step();
			}
		}
		if (((ButtonControl)Keyboard.current.f1Key).wasPressedThisFrame)
		{
			toggle_men(!ui_opened);
		}
		if (((ButtonControl)Keyboard.current.escapeKey).wasPressedThisFrame && ui_opened)
		{
			toggle_men(open: false);
		}
	}

	private string get_male_trigger(string pose, string stage)
	{
		switch (pose)
		{
		case "handjob":
			return "m_handjob_static";
		case "paizuri":
			return "m_paizuri_static";
		case "doggy":
			switch (stage)
			{
			case "start":
				return "m_doggy_br_start";
			case "slow":
				return "m_doggy_br_slow";
			case "fast":
				return "m_doggy_br_fast";
			case "cum":
				return "m_doggy_br_cum";
			}
			break;
		}
		return "m_handjob_static";
	}

	private void bracken_cam()
	{
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		LewdCompany.Log.LogInfo((object)$"bracken_cam called, bracken_camera null? {(Object)(object)bracken_camera == (Object)null}");
		if ((Object)(object)bracken_camera == (Object)null)
		{
			cam_find();
			if ((Object)(object)bracken_camera == (Object)null)
			{
				LewdCompany.Log.LogWarning((object)"bracken_cam: STILL null, abort");
				return;
			}
		}
		if ((Object)(object)main_camera != (Object)null)
		{
			((Behaviour)main_camera).enabled = false;
		}
		((Behaviour)bracken_camera).enabled = true;
		bracken_act = true;
		pivoty = 0f;
		pivotx = 0f;
		if ((Object)(object)camPiv != (Object)null)
		{
			camPiv.transform.localRotation = Quaternion.identity;
		}
		Cursor.lockState = (CursorLockMode)1;
		Cursor.visible = false;
		fuck_off_player();
		LewdCompany.Log.LogInfo((object)"bracken cam on");
	}

	private void astral_step()
	{
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Invalid comparison between Unknown and I4
		if ((Object)(object)bracken_camera != (Object)null)
		{
			((Behaviour)bracken_camera).enabled = false;
		}
		if ((Object)(object)main_camera != (Object)null)
		{
			((Behaviour)main_camera).enabled = true;
		}
		fuck_on_player();
		bracken_act = false;
		current_pose = "";
		Cursor.lockState = (CursorLockMode)1;
		Cursor.visible = false;
		if ((Object)(object)bracken != (Object)null)
		{
			Bracken component = bracken.GetComponent<Bracken>();
			if ((Object)(object)component != (Object)null)
			{
				component.state_idle();
			}
		}
		if ((Object)(object)male_animator != (Object)null)
		{
			AnimatorControllerParameter[] parameters = male_animator.parameters;
			foreach (AnimatorControllerParameter val in parameters)
			{
				if ((int)val.type == 9)
				{
					male_animator.ResetTrigger(val.name);
				}
			}
		}
		LewdCompany.Log.LogInfo((object)"bracken off");
	}

	private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
	{
		LewdCompany.Log.LogInfo((object)("bracken scene load " + ((Scene)(ref scene)).name));
		nevermore = false;
		((MonoBehaviour)this).StartCoroutine(main());
	}

	private void find_bracken()
	{
		if (search)
		{
			return;
		}
		search = true;
		Bracken bracken = Object.FindObjectOfType<Bracken>();
		if ((Object)(object)bracken != (Object)null)
		{
			this.bracken = ((Component)bracken).gameObject;
			bracken_anim = this.bracken.GetComponent<Animator>();
			if ((Object)(object)bracken_anim == (Object)null)
			{
				bracken_anim = this.bracken.GetComponentInChildren<Animator>();
			}
			LewdCompany.Log.LogInfo((object)"bracken found via AI");
			search = false;
			return;
		}
		GameObject val = GameObject.Find("bracken(Clone)");
		if ((Object)(object)val != (Object)null)
		{
			this.bracken = val;
			bracken_anim = this.bracken.GetComponent<Animator>();
			if ((Object)(object)bracken_anim == (Object)null)
			{
				bracken_anim = this.bracken.GetComponentInChildren<Animator>();
			}
			LewdCompany.Log.LogInfo((object)"bracken found via name");
			search = false;
		}
		else
		{
			LewdCompany.Log.LogWarning((object)"bracken not found");
			search = false;
		}
	}

	private void ui_ftp()
	{
		if (!((Object)(object)ui_pan != (Object)null) && !((Object)(object)LewdCompany.ui_bracken == (Object)null))
		{
			ui_pan = Object.Instantiate<GameObject>(LewdCompany.ui_bracken);
			Object.DontDestroyOnLoad((Object)(object)ui_pan);
			ui_pan.SetActive(false);
			uiAnimator = ui_pan.GetComponent<Animator>();
			LewdCompany.Log.LogInfo((object)"bracken ui created");
		}
	}

	private void ui_ass()
	{
		if ((Object)(object)ui_pan == (Object)null)
		{
			return;
		}
		LewdCompany.Log.LogInfo((object)"bracken ui ass");
		Button[] componentsInChildren = ui_pan.GetComponentsInChildren<Button>(true);
		int num = 0;
		Button[] array = componentsInChildren;
		foreach (Button val in array)
		{
			if (!((Object)(object)((Component)val).GetComponent<LewdUIButton>() != (Object)null))
			{
				LewdUIButton lewdUIButton = ((Component)val).gameObject.AddComponent<LewdUIButton>();
				lewdUIButton.use_bracken = true;
				switch (((Object)((Component)val).gameObject).name.ToLower())
				{
				case "handjob_butt":
					lewdUIButton.animation_trig = "b_handjob_start";
					lewdUIButton.maleTrigger = "m_handjob_static";
					break;
				case "paizuri_butt":
					lewdUIButton.animation_trig = "b_paizuri_start";
					lewdUIButton.maleTrigger = "m_paizuri_static";
					break;
				case "doggy_butt":
					lewdUIButton.animation_trig = "b_doggy_start";
					lewdUIButton.maleTrigger = "m_doggy_br_start";
					break;
				}
				num++;
			}
		}
		LewdCompany.Log.LogInfo((object)$"bracken stacked {num}");
	}

	private void fuck_off_player()
	{
		if (!((Object)(object)p_l != (Object)null))
		{
			p_l = GameNetworkManager.Instance?.localPlayerController;
			if ((Object)(object)p_l == (Object)null)
			{
				LewdCompany.Log.LogWarning((object)"bracken no player");
				return;
			}
			p_l.disableLookInput = true;
			p_l.disableMoveInput = true;
			p_l.disableInteract = true;
			((Component)p_l).gameObject.SetActive(false);
			p_l.CancelSpecialTriggerAnimations();
			LewdCompany.Log.LogInfo((object)"bracken zxc lock");
		}
	}

	private void fuck_on_player()
	{
		if (!((Object)(object)p_l == (Object)null))
		{
			p_l.disableLookInput = false;
			p_l.disableMoveInput = false;
			p_l.disableInteract = false;
			((Component)p_l).gameObject.SetActive(true);
			p_l.CancelSpecialTriggerAnimations();
			LewdCompany.Log.LogInfo((object)"bracken zxc unl");
			if ((Object)(object)bracken_anim != (Object)null)
			{
				bracken_anim.SetTrigger("idle");
			}
			if ((Object)(object)male_animator != (Object)null)
			{
				male_animator.SetTrigger("m_handjob_static");
			}
			p_l = null;
		}
	}

	public void toggle_men(bool open)
	{
		LewdCompany.Log.LogInfo((object)$"bracken toggle {open}");
		ui_opened = open;
		if ((Object)(object)ui_pan != (Object)null)
		{
			ui_pan.SetActive(open);
		}
		if (open)
		{
			Cursor.lockState = (CursorLockMode)0;
			Cursor.visible = true;
		}
		else
		{
			Cursor.lockState = (CursorLockMode)1;
			Cursor.visible = false;
		}
	}

	public bool menu_opened()
	{
		return ui_opened;
	}

	public void zxc_da(string femaleTrigger, string maleTrigger)
	{
		LewdCompany.Log.LogInfo((object)("bracken female " + femaleTrigger + ", male " + maleTrigger));
		if (femaleTrigger.Contains("handjob"))
		{
			current_pose = "handjob";
		}
		else if (femaleTrigger.Contains("paizuri"))
		{
			current_pose = "paizuri";
		}
		else if (femaleTrigger.Contains("doggy"))
		{
			current_pose = "doggy";
		}
		lewd_anim(femaleTrigger);
		if (!string.IsNullOrEmpty(maleTrigger))
		{
			male_lewd(maleTrigger);
		}
	}

	public void lewd_anim(string triggerName)
	{
		LewdCompany.Log.LogInfo((object)("bracken trig set " + triggerName));
		if (triggerName.Contains("handjob"))
		{
			current_pose = "handjob";
		}
		else if (triggerName.Contains("paizuri"))
		{
			current_pose = "paizuri";
		}
		else if (triggerName.Contains("doggy"))
		{
			current_pose = "doggy";
		}
		if ((Object)(object)this.bracken == (Object)null)
		{
			LewdCompany.Log.LogWarning((object)"bracken search girl");
			find_bracken();
			if ((Object)(object)this.bracken == (Object)null)
			{
				return;
			}
		}
		Bracken bracken = this.bracken.GetComponent<Bracken>();
		if ((Object)(object)bracken == (Object)null)
		{
			bracken = this.bracken.AddComponent<Bracken>();
		}
		bracken.start_sex(triggerName);
		if (is_sex(triggerName) && !bracken_act)
		{
			bracken_cam();
		}
		((MonoBehaviour)this).StartCoroutine(close_menu(0.5f));
	}

	public void male_lewd(string triggerName)
	{
		if ((Object)(object)male_animator == (Object)null)
		{
			api_male();
			if ((Object)(object)male_animator == (Object)null)
			{
				return;
			}
		}
		LewdCompany.Log.LogInfo((object)("bracken male trig set " + triggerName));
		bool flag = false;
		AnimatorControllerParameter[] parameters = male_animator.parameters;
		for (int i = 0; i < parameters.Length; i++)
		{
			if (parameters[i].name == triggerName)
			{
				flag = true;
				break;
			}
		}
		if (!flag)
		{
			LewdCompany.Log.LogWarning((object)"bracken param fuckkkk");
		}
		else
		{
			male_animator.SetTrigger(triggerName);
		}
	}

	private bool is_sex(string triggerName)
	{
		if (!triggerName.Contains("handjob") && !triggerName.Contains("paizuri"))
		{
			return triggerName.Contains("doggy");
		}
		return true;
	}

	private IEnumerator close_menu(float delay)
	{
		yield return (object)new WaitForSeconds(delay);
		toggle_men(open: false);
	}

	private void OnDestroy()
	{
		SceneManager.sceneLoaded -= OnSceneLoaded;
	}
}
public class LewdCompanionInteraction : MonoBehaviour
{
	private bool ins;

	private bool interact;

	private void Start()
	{
		if ((Object)(object)((Component)this).GetComponent<Collider>() == (Object)null)
		{
			Debug.LogWarning((object)"no coil");
			return;
		}
		interact = true;
		LewdCompany.Log.LogInfo((object)"lci init");
	}

	private void OnTriggerEnter(Collider other)
	{
		if ((Object)(object)((Component)other).GetComponent<PlayerControllerB>() != (Object)null)
		{
			ins = true;
			LewdCompany.Log.LogInfo((object)"trig enter");
		}
	}

	private void OnTriggerExit(Collider other)
	{
		if ((Object)(object)((Component)other).GetComponent<PlayerControllerB>() != (Object)null)
		{
			ins = false;
			LewdCompany.Log.LogInfo((object)"trig left");
		}
	}

	private void Update()
	{
		if (interact && ins && Keyboard.current != null && ((ButtonControl)Keyboard.current.eKey).wasPressedThisFrame)
		{
			LewdCompany.Log.LogInfo((object)"kayf");
			op_menu();
		}
		if (Keyboard.current != null && ((ButtonControl)Keyboard.current.escapeKey).wasPressedThisFrame && (Object)(object)LewdCompanionManager.Instance != (Object)null)
		{
			LewdCompany.Log.LogInfo((object)"esc toggle");
			LewdCompanionManager.Instance.toggle_men(open: false);
		}
	}

	private void op_menu()
	{
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Expected O, but got Unknown
		if ((Object)(object)LewdCompanionManager.Instance == (Object)null)
		{
			LewdCompany.Log.LogWarning((object)"manager not found");
			LewdCompanionManager lewdCompanionManager = Object.FindObjectOfType<LewdCompanionManager>();
			if ((Object)(object)lewdCompanionManager != (Object)null)
			{
				FieldInfo field = typeof(LewdCompanionManager).GetField("Instance", BindingFlags.Static | BindingFlags.NonPublic);
				if (field != null)
				{
					field.SetValue(null, lewdCompanionManager);
					LewdCompany.Log.LogInfo((object)"yeess suuka");
				}
			}
			else
			{
				GameObject val = new GameObject("LewdCompanionManager");
				lewdCompanionManager = val.AddComponent<LewdCompanionManager>();
				Object.DontDestroyOnLoad((Object)val);
				LewdCompany.Log.LogInfo((object)"eblan syka");
			}
		}
		if ((Object)(object)LewdCompanionManager.Instance != (Object)null)
		{
			LewdCompanionManager.Instance.toggle_men(open: true);
		}
		else
		{
			LewdCompany.Log.LogError((object)"fucking idiot");
		}
	}
}
public class LewdCompanionManager : MonoBehaviour
{
	private PlayerControllerB p_l;

	private GameObject companion;

	private Animator companion_anim;

	private GameObject male_mod;

	private Animator male_animator;

	private GameObject ui_pan;

	private Animator uiAnimator;

	private bool ui_opened;

	private bool search;

	private bool nevermore;

	private Camera main_camera;

	private GameObject camPiv;

	private Camera sexCamera;

	private bool sex_act;

	private Vector3 last_pos;

	private float pivoty;

	private float pivotx;

	private bool shift;

	private bool cumming;

	private string current_pose = "";

	private Dictionary<string, List<AudioClip>> sfx = new Dictionary<string, List<AudioClip>>();

	public static LewdCompanionManager Instance { get; private set; }

	private void Awake()
	{
		if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
			return;
		}
		Instance = this;
		LewdCompany.Log.LogInfo((object)"instance");
		Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
		SceneManager.sceneLoaded += OnSceneLoaded;
		ui_ftp();
	}

	private void sfx_load()
	{
		string[] array = new string[45]
		{
			"ahh0", "ahh1", "ahh2", "ahh3", "ahh4", "ahh5", "ahh6", "ahh7", "ahh8", "ahh9",
			"mmm0", "mmm1", "mmm2", "mmm3", "mmm4", "mmm5", "mmm6", "mmm7", "mmm8", "mmm9",
			"moan0", "moan1", "moan2", "moan3", "moan4", "moan5", "moan6", "moan7", "pounding0", "pounding1",
			"pounding2", "pounding3", "pounding4", "pounding5", "pounding6", "pounding7", "pounding8", "pounding9", "slide0", "slide1",
			"slide2", "slide3", "slide4", "slide5", "slide6"
		};
		foreach (string text in array)
		{
			AudioClip val = LewdCompany.bundle.LoadAsset<AudioClip>(text);
			if ((Object)(object)val == (Object)null)
			{
				LewdCompany.Log.LogError((object)"suck my dick lmao");
				continue;
			}
			string key = text.TrimEnd('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
			if (!sfx.ContainsKey(key))
			{
				sfx[key] = new List<AudioClip>();
			}
			sfx[key].Add(val);
		}
	}

	public AudioClip pick_sfx(string category)
	{
		if (!sfx.ContainsKey(category))
		{
			return null;
		}
		List<AudioClip> list = sfx[category];
		if (list.Count == 0)
		{
			return null;
		}
		return list[Random.Range(0, list.Count)];
	}

	private void Start()
	{
		LewdCompany.Log.LogInfo((object)"compl");
		((MonoBehaviour)this).StartCoroutine(main());
		cam_find();
	}

	private void cam_find()
	{
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Expected O, but got Unknown
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		main_camera = Camera.main;
		if ((Object)(object)main_camera == (Object)null)
		{
			main_camera = Object.FindObjectOfType<Camera>();
		}
		if (!((Object)(object)companion != (Object)null))
		{
			return;
		}
		Transform val = companion.transform.Find("CamPiv");
		if ((Object)(object)val != (Object)null)
		{
			camPiv = ((Component)val).gameObject;
			sexCamera = camPiv.GetComponentInChildren<Camera>();
			if ((Object)(object)sexCamera == (Object)null)
			{
				GameObject val2 = new GameObject("SexCam");
				val2.transform.parent = camPiv.transform;
				val2.transform.localPosition = Vector3.zero;
				val2.transform.localRotation = Quaternion.identity;
				sexCamera = val2.AddComponent<Camera>();
			}
			((Behaviour)sexCamera).enabled = false;
			LewdCompany.Log.LogInfo((object)"gg");
		}
	}

	private IEnumerator main()
	{
		yield return (object)new WaitForSeconds(1f);
		find_slut();
		api_male();
		if (!nevermore)
		{
			ui_ass();
			nevermore = true;
		}
		cam_find();
	}

	private void api_male()
	{
		GameObject val = GameObject.Find("man_mesh");
		if ((Object)(object)val == (Object)null)
		{
			val = GameObject.Find("man_mesh(Clone)");
		}
		if ((Object)(object)val != (Object)null)
		{
			male_mod = val;
			male_animator = val.GetComponent<Animator>();
			if ((Object)(object)male_animator == (Object)null)
			{
				male_animator = val.GetComponentInChildren<Animator>();
			}
			if ((Object)(object)male_animator != (Object)null && !((Behaviour)male_animator).enabled)
			{
				((Behaviour)male_animator).enabled = true;
			}
			LewdCompany.Log.LogInfo((object)"male fucked up");
		}
		else
		{
			LewdCompany.Log.LogWarning((object)"bruh");
		}
	}

	private void Update()
	{
		//IL_0036: 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_00db: 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_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		if (Keyboard.current == null)
		{
			LewdCompany.Log.LogWarning((object)"NO WAY MAN");
			return;
		}
		if (sex_act)
		{
			if (Mouse.current != null)
			{
				Vector2 val = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).delta).ReadValue();
				if (Mouse.current.leftButton.isPressed)
				{
					pivoty += val.x * 0.5f;
					pivotx += val.y * 0.5f;
					pivotx = Mathf.Clamp(pivotx, -80f, 80f);
					if ((Object)(object)camPiv != (Object)null)
					{
						camPiv.transform.localRotation = Quaternion.Euler(pivotx, pivoty, 0f);
					}
				}
				float y = ((InputControl<Vector2>)(object)Mouse.current.scroll).ReadValue().y;
				if (y != 0f && (Object)(object)sexCamera != (Object)null)
				{
					float num = sexCamera.fieldOfView - y * 5f;
					sexCamera.fieldOfView = Mathf.Clamp(num, 20f, 100f);
				}
			}
			bool flag = ((ButtonControl)Keyboard.current.leftShiftKey).isPressed || ((ButtonControl)Keyboard.current.rightShiftKey).isPressed;
			if (flag && !shift && (Object)(object)companion != (Object)null && !string.IsNullOrEmpty(current_pose))
			{
				string femaleTrigger = "fast_" + current_pose;
				string maleTrigger = get_male_trigger(current_pose, "fast");
				zxc_da(femaleTrigger, maleTrigger);
			}
			shift = flag;
			bool isPressed = ((ButtonControl)Keyboard.current.spaceKey).isPressed;
			if (isPressed && !cumming && !string.IsNullOrEmpty(current_pose))
			{
				string femaleTrigger2 = "cum_" + current_pose;
				string maleTrigger2 = get_male_trigger(current_pose, "cum");
				zxc_da(femaleTrigger2, maleTrigger2);
			}
			cumming = isPressed;
			if (((ButtonControl)Keyboard.current.escapeKey).wasPressedThisFrame)
			{
				astral_step();
			}
		}
		if (((ButtonControl)Keyboard.current.f1Key).wasPressedThisFrame)
		{
			LewdCompany.Log.LogInfo((object)"f1");
			toggle_men(!ui_opened);
		}
		if (((ButtonControl)Keyboard.current.f2Key).wasPressedThisFrame)
		{
			LewdCompany.Log.LogInfo((object)"f2");
			lewd_anim("strip_on");
		}
		if (((ButtonControl)Keyboard.current.f3Key).wasPressedThisFrame)
		{
			LewdCompany.Log.LogInfo((object)"f3");
			lewd_anim("strip_off");
			if (sex_act)
			{
				astral_step();
			}
		}
		if (((ButtonControl)Keyboard.current.f4Key).wasPressedThisFrame && !fasteeer())
		{
			LewdCompany.Log.LogInfo((object)"f4");
			zxc_da("start_cowgirl", "facesit_static");
			sex_cam();
		}
		if (((ButtonControl)Keyboard.current.f4Key).wasPressedThisFrame && fasteeer())
		{
			LewdCompany.Log.LogInfo((object)"s+f4");
			zxc_da("slow_cowgirl", "facesit_static");
			sex_cam();
		}
		if (((ButtonControl)Keyboard.current.f5Key).wasPressedThisFrame && !fasteeer())
		{
			LewdCompany.Log.LogInfo((object)"f5");
			zxc_da("fast_cowgirl", "facesit_static");
			sex_cam();
		}
		if (((ButtonControl)Keyboard.current.f5Key).wasPressedThisFrame && fasteeer())
		{
			LewdCompany.Log.LogInfo((object)"s+f5");
			zxc_da("cum_cowgirl", "facesit_static");
			sex_cam();
		}
		if (((ButtonControl)Keyboard.current.f6Key).wasPressedThisFrame && !fasteeer())
		{
			LewdCompany.Log.LogInfo((object)"f6");
			zxc_da("start_facesit", "facesit_static");
			sex_cam();
		}
		if (((ButtonControl)Keyboard.current.f6Key).wasPressedThisFrame && fasteeer())
		{
			LewdCompany.Log.LogInfo((object)"s+f6");
			zxc_da("slow_facesit", "facesit_static");
			sex_cam();
		}
		if (((ButtonControl)Keyboard.current.f7Key).wasPressedThisFrame && !fasteeer())
		{
			LewdCompany.Log.LogInfo((object)"f7");
			zxc_da("fast_facesit", "facesit_static");
			sex_cam();
		}
		if (((ButtonControl)Keyboard.current.f7Key).wasPressedThisFrame && fasteeer())
		{
			LewdCompany.Log.LogInfo((object)"s+f7");
			zxc_da("cum_facesit", "facesit_static");
			sex_cam();
		}
		if (((ButtonControl)Keyboard.current.escapeKey).wasPressedThisFrame && ui_opened)
		{
			LewdCompany.Log.LogInfo((object)"esc");
			toggle_men(open: false);
		}
	}

	private string get_male_trigger(string pose, string stage)
	{
		switch (pose)
		{
		case "cowgirl":
		case "facesit":
			return "facesit_static";
		case "doggy":
			switch (stage)
			{
			case "start":
				return "m_dog_st";
			case "slow":
				return "m_dog_slow";
			case "fast":
				return "m_dog_fast";
			case "cum":
				return "m_dog_cum";
			}
			break;
		case "missionary":
			switch (stage)
			{
			case "start":
				return "m_miss_st";
			case "slow":
				return "m_miss_slow";
			case "fast":
				return "m_miss_fast";
			case "cum":
				return "m_miss_cum";
			}
			break;
		case "thingjob":
			switch (stage)
			{
			case "start":
				return "m_thing_st";
			case "slow":
				return "m_thing_slow";
			case "fast":
				return "m_thing_fast";
			case "cum":
				return "m_thing_cum";
			}
			break;
		}
		return "facesit_static";
	}

	private void sex_cam()
	{
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)sexCamera == (Object)null)
		{
			cam_find();
			if ((Object)(object)sexCamera == (Object)null)
			{
				return;
			}
		}
		if ((Object)(object)main_camera != (Object)null)
		{
			((Behaviour)main_camera).enabled = false;
		}
		((Behaviour)sexCamera).enabled = true;
		sex_act = true;
		pivoty = 0f;
		pivotx = 0f;
		ManualLogSource log = LewdCompany.Log;
		object arg = (Object)(object)sexCamera == (Object)null;
		Camera obj = sexCamera;
		object arg2 = ((obj != null) ? new bool?(((Behaviour)obj).enabled) : ((bool?)null));
		Camera obj2 = sexCamera;
		log.LogInfo((object)$"sexCam null? {arg}; enabled: {arg2}; pos: {((obj2 != null) ? new Vector3?(((Component)obj2).transform.position) : ((Vector3?)null))}");
		if ((Object)(object)camPiv != (Object)null)
		{
			camPiv.transform.localRotation = Quaternion.identity;
		}
		Cursor.lockState = (CursorLockMode)1;
		Cursor.visible = false;
		fuck_off_player();
		LewdCompany.Log.LogInfo((object)"sc on sluuut");
	}

	private void astral_step()
	{
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Invalid comparison between Unknown and I4
		if ((Object)(object)sexCamera != (Object)null)
		{
			((Behaviour)sexCamera).enabled = false;
		}
		if ((Object)(object)main_camera != (Object)null)
		{
			((Behaviour)main_camera).enabled = true;
		}
		fuck_on_player();
		sex_act = false;
		current_pose = "";
		Cursor.lockState = (CursorLockMode)1;
		Cursor.visible = false;
		if ((Object)(object)companion != (Object)null)
		{
			LewdCompanionAI component = companion.GetComponent<LewdCompanionAI>();
			if ((Object)(object)component != (Object)null)
			{
				component.state_idle();
			}
		}
		if ((Object)(object)male_animator != (Object)null)
		{
			AnimatorControllerParameter[] parameters = male_animator.parameters;
			foreach (AnimatorControllerParameter val in parameters)
			{
				if ((int)val.type == 9)
				{
					male_animator.ResetTrigger(val.name);
				}
			}
		}
		LewdCompany.Log.LogInfo((object)"sc onnnn bruuuh");
	}

	private bool fasteeer()
	{
		if (!((ButtonControl)Keyboard.current.leftShiftKey).isPressed)
		{
			return ((ButtonControl)Keyboard.current.rightShiftKey).isPressed;
		}
		return true;
	}

	private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
	{
		LewdCompany.Log.LogInfo((object)("scene load " + ((Scene)(ref scene)).name));
		nevermore = false;
		((MonoBehaviour)this).StartCoroutine(main());
	}

	private void find_slut()
	{
		if (search)
		{
			return;
		}
		search = true;
		LewdCompanionAI lewdCompanionAI = Object.FindObjectOfType<LewdCompanionAI>();
		if ((Object)(object)lewdCompanionAI != (Object)null)
		{
			companion = ((Component)lewdCompanionAI).gameObject;
			companion_anim = companion.GetComponent<Animator>();
			if ((Object)(object)companion_anim == (Object)null)
			{
				companion_anim = companion.GetComponentInChildren<Animator>();
			}
			LewdCompany.Log.LogInfo((object)"girlf");
			search = false;
			return;
		}
		GameObject val = GameObject.Find("female_lc(Clone)");
		if ((Object)(object)val != (Object)null)
		{
			companion = val;
			companion_anim = companion.GetComponent<Animator>();
			if ((Object)(object)companion_anim == (Object)null)
			{
				companion_anim = companion.GetComponentInChildren<Animator>();
			}
			LewdCompany.Log.LogInfo((object)"found");
			search = false;
		}
		else
		{
			LewdCompany.Log.LogWarning((object)"not found, go fuck");
			search = false;
		}
	}

	private void ui_ftp()
	{
		if (!((Object)(object)ui_pan != (Object)null) && !((Object)(object)LewdCompany.ui == (Object)null))
		{
			ui_pan = Object.Instantiate<GameObject>(LewdCompany.ui);
			Object.DontDestroyOnLoad((Object)(object)ui_pan);
			ui_pan.SetActive(false);
			uiAnimator = ui_pan.GetComponent<Animator>();
			LewdCompany.Log.LogInfo((object)"ui created");
		}
	}

	private void ui_ass()
	{
		if ((Object)(object)ui_pan == (Object)null)
		{
			return;
		}
		LewdCompany.Log.LogInfo((object)"asssss");
		Button[] componentsInChildren = ui_pan.GetComponentsInChildren<Button>(true);
		int num = 0;
		Button[] array = componentsInChildren;
		foreach (Button val in array)
		{
			if (!((Object)(object)((Component)val).GetComponent<LewdUIButton>() != (Object)null))
			{
				LewdUIButton lewdUIButton = ((Component)val).gameObject.AddComponent<LewdUIButton>();
				switch (((Object)((Component)val).gameObject).name.ToLower())
				{
				case "cowgirl_butt":
					lewdUIButton.animation_trig = "start_cowgirl";
					lewdUIButton.maleTrigger = "facesit_static";
					LewdCompany.Log.LogInfo((object)"1 s");
					break;
				case "facesit_butt":
					lewdUIButton.animation_trig = "start_facesit";
					lewdUIButton.maleTrigger = "facesit_static";
					LewdCompany.Log.LogInfo((object)"2 s");
					break;
				case "facedown_doggy_butt":
					lewdUIButton.animation_trig = "start_doggy";
					lewdUIButton.maleTrigger = "m_dog_st";
					LewdCompany.Log.LogInfo((object)"3 s");
					break;
				case "missionary_butt":
					lewdUIButton.animation_trig = "start_missionary";
					lewdUIButton.maleTrigger = "m_miss_st";
					LewdCompany.Log.LogInfo((object)"4 s");
					break;
				case "thing_butt":
					lewdUIButton.animation_trig = "start_thingjob";
					lewdUIButton.maleTrigger = "m_thing_st";
					LewdCompany.Log.LogInfo((object)"6 s");
					break;
				case "strip_butt":
					lewdUIButton.toggle = true;
					LewdCompany.Log.LogInfo((object)"7 s");
					break;
				}
				num++;
			}
		}
		LewdCompany.Log.LogInfo((object)$"stacked {num}");
	}

	private void fuck_off_player()
	{
		if (!((Object)(object)p_l != (Object)null))
		{
			p_l = GameNetworkManager.Instance?.localPlayerController;
			if ((Object)(object)p_l == (Object)null)
			{
				LewdCompany.Log.LogWarning((object)"no player");
				return;
			}
			p_l.disableLookInput = true;
			p_l.disableMoveInput = true;
			p_l.disableInteract = true;
			p_l.CancelSpecialTriggerAnimations();
			((Component)p_l).gameObject.SetActive(false);
			LewdCompany.Log.LogInfo((object)"zxc lock");
		}
	}

	private void fuck_on_player()
	{
		if (!((Object)(object)p_l == (Object)null))
		{
			p_l.disableLookInput = false;
			p_l.disableMoveInput = false;
			p_l.disableInteract = false;
			p_l.CancelSpecialTriggerAnimations();
			LewdCompany.Log.LogInfo((object)"zxc unl");
			companion_anim.SetTrigger("idle");
			male_animator.SetTrigger("facesit_static");
			((Component)p_l).gameObject.SetActive(true);
			p_l = null;
		}
	}

	public void toggle_men(bool open)
	{
		LewdCompany.Log.LogInfo((object)$"toggle {open}");
		ui_opened = open;
		if ((Object)(object)ui_pan != (Object)null)
		{
			ui_pan.SetActive(open);
		}
		if (open)
		{
			Cursor.lockState = (CursorLockMode)0;
			Cursor.visible = true;
			LewdCompany.Log.LogInfo((object)"cur unlock");
		}
		else
		{
			Cursor.lockState = (CursorLockMode)1;
			Cursor.visible = false;
			LewdCompany.Log.LogInfo((object)"cur lock");
		}
	}

	public bool menu_opened()
	{
		return ui_opened;
	}

	public void zxc_da(string femaleTrigger, string maleTrigger)
	{
		LewdCompany.Log.LogInfo((object)(" female " + femaleTrigger + ", male " + maleTrigger));
		if (femaleTrigger.Contains("cowgirl"))
		{
			current_pose = "cowgirl";
		}
		else if (femaleTrigger.Contains("facesit"))
		{
			current_pose = "facesit";
		}
		else if (femaleTrigger.Contains("doggy"))
		{
			current_pose = "doggy";
		}
		else if (femaleTrigger.Contains("missionary"))
		{
			current_pose = "missionary";
		}
		else if (femaleTrigger.Contains("thingjob"))
		{
			current_pose = "thingjob";
		}
		lewd_anim(femaleTrigger);
		if (!string.IsNullOrEmpty(maleTrigger))
		{
			male_lewd(maleTrigger);
		}
	}

	public void lewd_anim(string triggerName)
	{
		LewdCompany.Log.LogInfo((object)("trig set " + triggerName));
		if (triggerName.Contains("cowgirl"))
		{
			current_pose = "cowgirl";
		}
		else if (triggerName.Contains("facesit"))
		{
			current_pose = "facesit";
		}
		else if (triggerName.Contains("doggy"))
		{
			current_pose = "doggy";
		}
		else if (triggerName.Contains("missionary"))
		{
			current_pose = "missionary";
		}
		else if (triggerName.Contains("thingjob"))
		{
			current_pose = "thingjob";
		}
		if ((Object)(object)companion == (Object)null)
		{
			LewdCompany.Log.LogWarning((object)"search girl");
			find_slut();
			if ((Object)(object)companion == (Object)null)
			{
				return;
			}
		}
		LewdCompanionAI lewdCompanionAI = companion.GetComponent<LewdCompanionAI>();
		if ((Object)(object)lewdCompanionAI == (Object)null)
		{
			LewdCompany.Log.LogWarning((object)"wtf");
			lewdCompanionAI = companion.AddComponent<LewdCompanionAI>();
		}
		lewdCompanionAI.start_sex(triggerName);
		if (is_sex(triggerName) && !sex_act)
		{
			sex_cam();
		}
		((MonoBehaviour)this).StartCoroutine(close_menu(0.5f));
	}

	public void male_lewd(string triggerName)
	{
		if ((Object)(object)male_animator == (Object)null)
		{
			api_male();
			if ((Object)(object)male_animator == (Object)null)
			{
				return;
			}
		}
		LewdCompany.Log.LogInfo((object)("male trig set " + triggerName));
		bool flag = false;
		AnimatorControllerParameter[] parameters = male_animator.parameters;
		for (int i = 0; i < parameters.Length; i++)
		{
			if (parameters[i].name == triggerName)
			{
				flag = true;
				break;
			}
		}
		if (!flag)
		{
			LewdCompany.Log.LogWarning((object)"param fuckkkk");
		}
		else
		{
			male_animator.SetTrigger(triggerName);
		}
	}

	private bool is_sex(string triggerName)
	{
		if (!triggerName.Contains("cowgirl") && !triggerName.Contains("facesit") && !triggerName.Contains("doggy") && !triggerName.Contains("missionary"))
		{
			return triggerName.Contains("thingjob");
		}
		return true;
	}

	public void strip()
	{
		LewdCompany.Log.LogInfo((object)"ui togl strip");
		if ((Object)(object)companion == (Object)null)
		{
			LewdCompany.Log.LogWarning((object)"eblan not found");
			return;
		}
		LewdCompanionAI lewdCompanionAI = companion.GetComponent<LewdCompanionAI>();
		if ((Object)(object)lewdCompanionAI == (Object)null)
		{
			LewdCompany.Log.LogWarning((object)"comp not found");
			lewdCompanionAI = companion.AddComponent<LewdCompanionAI>();
		}
		bool flag = lewdCompanionAI.nude();
		if (flag)
		{
			lewd_anim("strip_off");
		}
		else
		{
			lewd_anim("strip_on");
		}
		LewdCompany.Log.LogInfo((object)$"state {!flag}");
	}

	private IEnumerator close_menu(float delay)
	{
		yield return (object)new WaitForSeconds(delay);
		toggle_men(open: false);
	}

	private void OnDestroy()
	{
		SceneManager.sceneLoaded -= OnSceneLoaded;
	}
}
[BepInPlugin("com.lewdcompany.plugin", "Lewd Company", "1.0.0")]
[BepInProcess("Lethal Company.exe")]
public class LewdCompany : BaseUnityPlugin
{
	public static ManualLogSource Log;

	public static AssetBundle bundle;

	public static GameObject slut;

	public static GameObject ui;

	public static GameObject bracken_prefab;

	public static GameObject ui_bracken;

	public static bool isLoaded;

	private void Awake()
	{
		//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0204: Expected O, but got Unknown
		//IL_0246: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0252: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: Expected O, but got Unknown
		Log = ((BaseUnityPlugin)this).Logger;
		Log.LogInfo((object)"sexmod loading");
		string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "lewdcompany");
		Log.LogInfo((object)("bundle - " + text));
		if (!File.Exists(text))
		{
			Log.LogError((object)"bundle not found");
			return;
		}
		bundle = AssetBundle.LoadFromFile(text);
		if ((Object)(object)bundle == (Object)null)
		{
			Log.LogError((object)"xyuna peredeluvay");
			return;
		}
		slut = bundle.LoadAsset<GameObject>("female_lc");
		ui = bundle.LoadAsset<GameObject>("UI LC");
		bracken_prefab = bundle.LoadAsset<GameObject>("bracken");
		ui_bracken = bundle.LoadAsset<GameObject>("UI Bracken");
		Log.LogInfo((object)("girl " + (((Object)(object)slut != (Object)null) ? "1" : "0")));
		Log.LogInfo((object)("ui " + (((Object)(object)ui != (Object)null) ? "1" : "0")));
		Log.LogInfo((object)("bracken " + (((Object)(object)bracken_prefab != (Object)null) ? "1" : "0")));
		Log.LogInfo((object)("ui_bracken " + (((Object)(object)ui_bracken != (Object)null) ? "1" : "0")));
		if ((Object)(object)slut == (Object)null || (Object)(object)ui == (Object)null)
		{
			Log.LogError((object)"fuckyou");
			return;
		}
		isLoaded = true;
		Log.LogInfo((object)"bundle load");
		Harmony.CreateAndPatchAll(typeof(LewdCompanionEnemyPatch), (string)null);
		Log.LogInfo((object)"patch sucsess");
		GameObject val = new GameObject("LewdCompanionManager");
		LewdCompanionManager value = val.AddComponent<LewdCompanionManager>();
		Object.DontDestroyOnLoad((Object)val);
		val.SetActive(true);
		FieldInfo field = typeof(LewdCompanionManager).GetField("Instance", BindingFlags.Static | BindingFlags.NonPublic);
		if (field != null)
		{
			field.SetValue(null, value);
			Log.LogInfo((object)"ui work");
		}
		GameObject val2 = new GameObject("BrackenManager");
		BrackenManager value2 = val2.AddComponent<BrackenManager>();
		Object.DontDestroyOnLoad((Object)val2);
		val2.SetActive(true);
		FieldInfo field2 = typeof(BrackenManager).GetField("Instance", BindingFlags.Static | BindingFlags.NonPublic);
		if (field2 != null)
		{
			field2.SetValue(null, value2);
			Log.LogInfo((object)"bracken ui work");
		}
	}
}
public class LewdUIButton : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler
{
	public string animation_trig;

	public string maleTrigger;

	public bool toggle;

	public bool use_bracken;

	public Image arrowImage;

	private Button button;

	private Text buttonText;

	private void Start()
	{
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Expected O, but got Unknown
		button = ((Component)this).GetComponent<Button>();
		if ((Object)(object)button == (Object)null)
		{
			LewdCompany.Log.LogWarning((object)("bruh - '" + ((Object)((Component)this).gameObject).name + "'!"));
			return;
		}
		buttonText = ((Component)this).GetComponentInChildren<Text>();
		if ((Object)(object)arrowImage != (Object)null)
		{
			((Component)arrowImage).gameObject.SetActive(false);
		}
		((UnityEventBase)button.onClick).RemoveAllListeners();
		((UnityEvent)button.onClick).AddListener(new UnityAction(click));
		LewdCompany.Log.LogInfo((object)("butt broooo '" + ((Object)((Component)this).gameObject).name + "'"));
		if (string.IsNullOrEmpty(animation_trig))
		{
			if ((Object)(object)buttonText != (Object)null && !string.IsNullOrEmpty(buttonText.text))
			{
				set_trig(buttonText.text);
			}
			else
			{
				set_fa(((Object)((Component)this).gameObject).name);
			}
		}
	}

	private void set_trig(string text)
	{
		string text2 = text.ToLower().Trim();
		LewdCompany.Log.LogInfo((object)("Setting trigger from text: '" + text2 + "'"));
		switch (text2)
		{
		case "cowgirl start":
		case "cowgirl":
			animation_trig = "start_cowgirl";
			maleTrigger = "facesit_static";
			break;
		case "cowgirl slow":
			animation_trig = "slow_cowgirl";
			maleTrigger = "facesit_static";
			break;
		case "cowgirl fast":
			animation_trig = "fast_cowgirl";
			maleTrigger = "facesit_static";
			break;
		case "cowgirl cum":
			animation_trig = "cum_cowgirl";
			maleTrigger = "facesit_static";
			break;
		case "facesit start":
		case "facesit":
			animation_trig = "start_facesit";
			maleTrigger = "facesit_static";
			break;
		case "facesit slow":
			animation_trig = "slow_facesit";
			maleTrigger = "facesit_static";
			break;
		case "facesit fast":
			animation_trig = "fast_facesit";
			maleTrigger = "facesit_static";
			break;
		case "facesit cum":
			animation_trig = "cum_facesit";
			maleTrigger = "facesit_static";
			break;
		case "doggy start":
		case "doggy":
			animation_trig = "start_doggy";
			maleTrigger = "m_dog_st";
			break;
		case "doggy slow":
			animation_trig = "slow_doggy";
			maleTrigger = "m_dog_slow";
			break;
		case "doggy fast":
			animation_trig = "fast_doggy";
			maleTrigger = "m_dog_fast";
			break;
		case "doggy cum":
			animation_trig = "cum_doggy";
			maleTrigger = "m_dog_cum";
			break;
		case "missionary start":
		case "missionary":
			animation_trig = "start_missionary";
			maleTrigger = "m_miss_st";
			break;
		case "missionary slow":
			animation_trig = "slow_missionary";
			maleTrigger = "m_miss_slow";
			break;
		case "missionary fast":
			animation_trig = "fast_missionary";
			maleTrigger = "m_miss_fast";
			break;
		case "missionary cum":
			animation_trig = "cum_missionary";
			maleTrigger = "m_miss_cum";
			break;
		case "thingjob start":
		case "thingjob":
			animation_trig = "start_thingjob";
			maleTrigger = "m_thing_st";
			break;
		case "thingjob slow":
			animation_trig = "slow_thingjob";
			maleTrigger = "m_thing_slow";
			break;
		case "thingjob fast":
			animation_trig = "fast_thingjob";
			maleTrigger = "m_thing_fast";
			break;
		case "thingjob cum":
			animation_trig = "cum_thingjob";
			maleTrigger = "m_thing_cum";
			break;
		case "toggle strip":
		case "strip":
			toggle = true;
			break;
		default:
			LewdCompany.Log.LogWarning((object)("Unknown button text: '" + text + "'"));
			break;
		}
	}

	private void set_fa(string name)
	{
		string text = name.ToLower();
		LewdCompany.Log.LogInfo((object)("Setting trigger from name: '" + text + "'"));
		switch (text)
		{
		case "cowgirl_butt":
			animation_trig = "start_cowgirl";
			maleTrigger = "facesit_static";
			break;
		case "facesit_butt":
			animation_trig = "start_facesit";
			maleTrigger = "facesit_static";
			break;
		case "facedown_doggy_butt":
			animation_trig = "start_doggy";
			maleTrigger = "m_dog_st";
			break;
		case "missionary_butt":
			animation_trig = "start_missionary";
			maleTrigger = "m_miss_st";
			break;
		case "thing_butt":
			animation_trig = "start_thingjob";
			maleTrigger = "m_thing_st";
			break;
		case "strip_butt":
			toggle = true;
			break;
		case "handjob_butt":
			animation_trig = "b_handjob_start";
			maleTrigger = "m_handjob_static";
			break;
		case "paizuri_butt":
			animation_trig = "b_paizuri_start";
			maleTrigger = "m_paizuri_static";
			break;
		case "doggy_butt":
			animation_trig = "b_doggy_start";
			maleTrigger = "m_doggy_br_start";
			break;
		default:
			LewdCompany.Log.LogWarning((object)("Unknown button name: '" + name + "'"));
			break;
		}
	}

	private void click()
	{
		LewdCompany.Log.LogInfo((object)$"butt click '{((Object)((Component)this).gameObject).name}' use_bracken={use_bracken}");
		if (use_bracken)
		{
			if ((Object)(object)BrackenManager.Instance == (Object)null)
			{
				LewdCompany.Log.LogError((object)"BrackenManager null!");
				return;
			}
			if (!string.IsNullOrEmpty(animation_trig))
			{
				BrackenManager.Instance.lewd_anim(animation_trig);
			}
			if (!string.IsNullOrEmpty(maleTrigger))
			{
				BrackenManager.Instance.male_lewd(maleTrigger);
			}
			BrackenManager.Instance.toggle_men(open: false);
			return;
		}
		if ((Object)(object)LewdCompanionManager.Instance == (Object)null)
		{
			LewdCompany.Log.LogError((object)"Manager null!");
			return;
		}
		if (toggle)
		{
			LewdCompanionManager.Instance.strip();
		}
		else
		{
			if (!string.IsNullOrEmpty(animation_trig))
			{
				LewdCompanionManager.Instance.lewd_anim(animation_trig);
			}
			if (!string.IsNullOrEmpty(maleTrigger))
			{
				LewdCompanionManager.Instance.male_lewd(maleTrigger);
			}
		}
		LewdCompanionManager.Instance.toggle_men(open: false);
	}

	public void OnPointerEnter(PointerEventData eventData)
	{
		if ((Object)(object)arrowImage != (Object)null)
		{
			((Component)arrowImage).gameObject.SetActive(true);
		}
	}

	public void OnPointerExit(PointerEventData eventData)
	{
		if ((Object)(object)arrowImage != (Object)null)
		{
			((Component)arrowImage).gameObject.SetActive(false);
		}
	}
}