Decompiled source of PRZ AlwaysKickFriendAss v2.6.4

BepInEx/plugins/PRZ_AlwaysKickFriendAss.dll

Decompiled 3 weeks ago
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 BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("PRZ_AlwaysKickFriendAss")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("PRZ_AlwaysKickFriendAss")]
[assembly: AssemblyTitle("PRZ_AlwaysKickFriendAss")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 PRZ_AlwaysKickFriendAss
{
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	public static class KKeyKickMode
	{
		private static float lastKickTime;

		public static bool Prefix(Character ___character, ref bool __result)
		{
			if ((Object)(object)___character == (Object)null || (Object)(object)___character.data == (Object)null)
			{
				return true;
			}
			if ((Object)(object)Plugin.Instance != (Object)null && Plugin.Instance.IsComboDown(Plugin.Instance.KeyKick.Value))
			{
				lastKickTime = Time.time;
			}
			bool flag = Time.time - lastKickTime < 0.3f;
			if (___character.data.isKicking || flag)
			{
				__result = true;
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(CharacterGrabbing), "Start")]
	public static class BoostKick
	{
		public static void Postfix(CharacterGrabbing __instance)
		{
			__instance.kickForce = 100f;
			__instance.kickRange = 50f;
			__instance.kickRagdollTime = 3f;
		}
	}
	[HarmonyPatch(typeof(CursorHandler), "Update")]
	public static class CursorHandlerPatch
	{
		[HarmonyPrefix]
		public static bool Prefix()
		{
			if (Plugin.PanelMouseMode)
			{
				Cursor.lockState = (CursorLockMode)0;
				Cursor.visible = true;
				return false;
			}
			return true;
		}
	}
	public class AssGUI : MonoBehaviour
	{
		public static AssGUI Instance;

		private GUIStyle normalStyle;

		private bool showPanel = false;

		private Rect panelRect = new Rect(0f, 0f, 400f, 230f);

		private bool positionSet = false;

		private string powerInput = "1";

		private float _panelAlpha = 1f;

		private float _lastActivityTime = 0f;

		private const float FadeOutDelay = 15f;

		private bool isEnglish
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Invalid comparison between Unknown and I4
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: Invalid comparison between Unknown and I4
				Language cURRENT_LANGUAGE = LocalizedText.CURRENT_LANGUAGE;
				return (int)cURRENT_LANGUAGE != 9 && (int)cURRENT_LANGUAGE != 10;
			}
		}

		private void Awake()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			Instance = this;
			normalStyle = new GUIStyle();
			normalStyle.fontSize = 16;
			normalStyle.normal.textColor = Color.white;
		}

		public void TogglePanel()
		{
			showPanel = !showPanel;
			if (showPanel)
			{
				ResetActivity();
			}
		}

		public void ResetActivity()
		{
			_lastActivityTime = Time.time;
		}

		private void Update()
		{
			if (showPanel && Plugin.PanelMouseMode && Input.GetMouseButtonDown(0))
			{
				ResetActivity();
			}
			if (Plugin.PanelMouseMode)
			{
				ResetActivity();
			}
		}

		private void OnGUI()
		{
			//IL_003f: 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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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)
			//IL_00e3: 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)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Expected O, but got Unknown
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			if (showPanel)
			{
				if (!positionSet)
				{
					panelRect = new Rect((float)(Screen.width - 410), 10f, 400f, 230f);
					positionSet = true;
				}
				float num = ((Time.time - _lastActivityTime > 15f && !Plugin.PanelMouseMode) ? 0.3f : 1f);
				_panelAlpha = Mathf.Lerp(_panelAlpha, num, Time.deltaTime * 8f);
				Color color = GUI.color;
				GUI.color = new Color(1f, 1f, 1f, _panelAlpha);
				normalStyle.normal.textColor = new Color(1f, 1f, 1f, _panelAlpha);
				panelRect = GUI.Window(0, panelRect, new WindowFunction(DrawPanel), "PRZ - AKFA v2.6.4");
				GUI.color = color;
			}
		}

		private void DrawPanel(int windowID)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: 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_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0415: Unknown result type (might be due to invalid IL or missing references)
			Plugin instance = Plugin.Instance;
			if ((Object)(object)instance == (Object)null)
			{
				return;
			}
			GUI.Label(new Rect(10f, 30f, 80f, 25f), isEnglish ? "Power:" : "力度:", normalStyle);
			powerInput = GUI.TextField(new Rect(75f, 30f, 80f, 25f), powerInput);
			if (float.TryParse(powerInput, out var result))
			{
				if (result < 0.5f)
				{
					result = 0.5f;
					powerInput = "0.5";
				}
				else if (result > 500f)
				{
					result = 500f;
					powerInput = "500";
				}
				Plugin.KickPower = result;
			}
			GUI.Label(new Rect(165f, 30f, 120f, 25f), "(0.5~500)", normalStyle);
			string text = (instance.IsTracking ? "ON" : "OFF");
			string text2 = "None";
			Character currentTarget = instance.GetCurrentTarget();
			if ((Object)(object)currentTarget != (Object)null)
			{
				text2 = currentTarget.characterName;
			}
			GUI.Label(new Rect(10f, 60f, 200f, 25f), isEnglish ? ("Track: " + text) : ("追踪: " + text), normalStyle);
			GUI.Label(new Rect(10f, 90f, 380f, 25f), (isEnglish ? "Target: " : "目标: ") + text2, normalStyle);
			string value = instance.KeyKick.Value;
			KeyboardShortcut value2 = instance.KeyTrack.Value;
			string text3 = ((object)((KeyboardShortcut)(ref value2)).MainKey/*cast due to .constrained prefix*/).ToString();
			value2 = instance.KeyTarget.Value;
			string text4 = ((object)((KeyboardShortcut)(ref value2)).MainKey/*cast due to .constrained prefix*/).ToString();
			value2 = instance.KeyPull.Value;
			string text5 = ((object)((KeyboardShortcut)(ref value2)).MainKey/*cast due to .constrained prefix*/).ToString();
			value2 = instance.KeyPanel.Value;
			string text6 = ((object)((KeyboardShortcut)(ref value2)).MainKey/*cast due to .constrained prefix*/).ToString();
			GUI.Label(new Rect(10f, 120f, 380f, 25f), isEnglish ? ("[" + value + "]Kick [" + text5 + "]TP [" + text4 + "]Target") : ("[" + value + "]踢 [" + text5 + "]传送 [" + text4 + "]换"), normalStyle);
			GUI.Label(new Rect(10f, 145f, 380f, 25f), isEnglish ? ("[" + text3 + "]Track [" + text6 + "]Panel  [~]Mouse") : ("[" + text3 + "]追踪 [" + text6 + "]面板  [~]鼠标"), normalStyle);
			GUI.Label(new Rect(10f, 170f, 380f, 25f), isEnglish ? "Keys: editable in cfg. belike Q + Mouse1" : "按键:可在cfg中修改 示例 Q +Mouse1", normalStyle);
			GUI.Label(new Rect(30f, 195f, 380f, 25f), isEnglish ? "(Mouse1  *M must be uppercase!)" : "(鼠标填写*M必须大写!)有疑问请到b站找我!", normalStyle);
			GUI.DragWindow(new Rect(0f, 0f, 400f, 230f));
		}
	}
	[BepInPlugin("com.prz.alwayskickfriendass", "PRZ - AlwaysKickFriendAss", "2.6.4")]
	[BepInProcess("Peak.exe")]
	public class Plugin : BaseUnityPlugin
	{
		public static Plugin Instance;

		public static float KickPower = 1f;

		public static bool PanelMouseMode = false;

		public static float KickCooldown = 0.5f;

		private float lastKickTime = 0f;

		public ConfigEntry<string> KeyKick;

		public ConfigEntry<KeyboardShortcut> KeyTrack;

		public ConfigEntry<KeyboardShortcut> KeyTarget;

		public ConfigEntry<KeyboardShortcut> KeyPull;

		public ConfigEntry<KeyboardShortcut> KeyPanel;

		private List<Character> playerList = new List<Character>();

		private Character currentTarget;

		private int targetIndex = 0;

		private bool isTracking = false;

		private float pauseEndTime = 0f;

		private bool kickPressedLastFrame = false;

		private bool trackPressedLastFrame = false;

		private bool targetPressedLastFrame = false;

		private bool pullPressedLastFrame = false;

		private bool panelPressedLastFrame = false;

		private bool tildePressedLastFrame = false;

		public bool IsTracking => isTracking;

		private void Awake()
		{
			//IL_0044: 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_009c: 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_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Expected O, but got Unknown
			Instance = this;
			KeyKick = ((BaseUnityPlugin)this).Config.Bind<string>("Hotkeys", "Kick", "Q + Mouse1", "踢人键,可写 K 或 Q + Mouse1(鼠标右键)/ Kick key, e.g. K or Q + Mouse1");
			KeyTrack = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkeys", "Track", new KeyboardShortcut((KeyCode)117, Array.Empty<KeyCode>()), "开关追踪 / Toggle tracking");
			KeyTarget = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkeys", "Target", new KeyboardShortcut((KeyCode)105, Array.Empty<KeyCode>()), "切换目标 / Switch target");
			KeyPull = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkeys", "Pull", new KeyboardShortcut((KeyCode)106, Array.Empty<KeyCode>()), "拉回 / Pull back");
			KeyPanel = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkeys", "Panel", new KeyboardShortcut((KeyCode)288, Array.Empty<KeyCode>()), "开关面板 / Toggle panel");
			((BaseUnityPlugin)this).Config.Bind<float>("Settings", "KickCooldown", 0.5f, "踢人冷却秒数 / Kick cooldown in seconds");
			Harmony val = new Harmony("com.prz.alwayskickfriendass");
			val.PatchAll();
			((Component)this).gameObject.AddComponent<AssGUI>();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"PRZ - AlwaysKickFriendAss v2.6.4 loaded!");
		}

		private void Update()
		{
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			bool key = Input.GetKey((KeyCode)96);
			if (key && !tildePressedLastFrame)
			{
				PanelMouseMode = !PanelMouseMode;
				((BaseUnityPlugin)this).Logger.LogInfo((object)$"[AKFA] Panel mouse mode: {PanelMouseMode}");
			}
			tildePressedLastFrame = key;
			if (PanelMouseMode)
			{
				Cursor.lockState = (CursorLockMode)0;
				Cursor.visible = true;
			}
			bool flag = IsComboDown(KeyKick.Value);
			if (flag && !kickPressedLastFrame)
			{
				TriggerKick();
			}
			kickPressedLastFrame = flag;
			KeyboardShortcut value = KeyTrack.Value;
			bool key2 = Input.GetKey(((KeyboardShortcut)(ref value)).MainKey);
			if (key2 && !trackPressedLastFrame)
			{
				ToggleTracking();
			}
			trackPressedLastFrame = key2;
			value = KeyTarget.Value;
			bool key3 = Input.GetKey(((KeyboardShortcut)(ref value)).MainKey);
			if (key3 && !targetPressedLastFrame)
			{
				SwitchTarget();
			}
			targetPressedLastFrame = key3;
			value = KeyPull.Value;
			bool key4 = Input.GetKey(((KeyboardShortcut)(ref value)).MainKey);
			if (key4 && !pullPressedLastFrame)
			{
				ManualPullBack();
			}
			pullPressedLastFrame = key4;
			value = KeyPanel.Value;
			bool key5 = Input.GetKey(((KeyboardShortcut)(ref value)).MainKey);
			if (key5 && !panelPressedLastFrame && (Object)(object)AssGUI.Instance != (Object)null)
			{
				AssGUI.Instance.TogglePanel();
			}
			panelPressedLastFrame = key5;
			bool flag2 = Time.time < pauseEndTime;
			if (isTracking && !flag2 && (Object)(object)currentTarget != (Object)null)
			{
				FollowTarget();
			}
		}

		public bool IsComboDown(string combo)
		{
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			if (string.IsNullOrEmpty(combo))
			{
				return false;
			}
			string[] array = combo.Split('+');
			KeyCode? val = null;
			int num = -1;
			string[] array2 = array;
			foreach (string text in array2)
			{
				string text2 = text.Trim();
				KeyCode result2;
				if (text2.StartsWith("Mouse", StringComparison.OrdinalIgnoreCase))
				{
					string s = text2.Substring(5);
					if (int.TryParse(s, out var result))
					{
						num = result;
					}
				}
				else if (Enum.TryParse<KeyCode>(text2, ignoreCase: true, out result2))
				{
					val = result2;
				}
			}
			if (num >= 0 && !Input.GetMouseButton(num))
			{
				return false;
			}
			if (val.HasValue && !Input.GetKey(val.Value))
			{
				return false;
			}
			return true;
		}

		public Character GetCurrentTarget()
		{
			return currentTarget;
		}

		private void SwitchTarget()
		{
			playerList = ScanPlayers();
			if (playerList.Count != 0)
			{
				targetIndex = (targetIndex + 1) % playerList.Count;
				currentTarget = playerList[targetIndex];
			}
		}

		private void ToggleTracking()
		{
			isTracking = !isTracking;
			if (isTracking)
			{
				playerList = ScanPlayers();
				if (playerList.Count > 0)
				{
					currentTarget = playerList[targetIndex % playerList.Count];
				}
			}
			else
			{
				RestoreGravity();
			}
		}

		private void ManualPullBack()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: 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_0072: 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_007c: 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)
			Character localCharacter = GetLocalCharacter();
			if ((Object)(object)currentTarget == (Object)null || (Object)(object)localCharacter == (Object)null || (Object)(object)((MonoBehaviourPun)currentTarget).photonView == (Object)null)
			{
				return;
			}
			Vector3 worldPosition = GetWorldPosition(localCharacter);
			Vector3 val = worldPosition + ((Component)localCharacter).transform.right * 1.1f + Vector3.up * 0.15f;
			try
			{
				((MonoBehaviourPun)currentTarget).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { val, false });
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)("拉回失败: " + ex.Message));
			}
		}

		private Vector3 GetWorldPosition(Character c)
		{
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			Rigidbody[] componentsInChildren = ((Component)c).GetComponentsInChildren<Rigidbody>(true);
			string[] array = new string[6] { "hip", "hips", "pelvis", "torso", "chest", "body" };
			string[] array2 = array;
			foreach (string value in array2)
			{
				Rigidbody[] array3 = componentsInChildren;
				foreach (Rigidbody val in array3)
				{
					if (!((Object)(object)val == (Object)null) && ((Component)val).gameObject.activeInHierarchy && ((Object)val).name.ToLower().Contains(value))
					{
						return val.worldCenterOfMass;
					}
				}
			}
			if (componentsInChildren.Length != 0)
			{
				return componentsInChildren[0].worldCenterOfMass;
			}
			return ((Component)c).transform.position;
		}

		private List<Character> ScanPlayers()
		{
			List<Character> list = new List<Character>();
			foreach (Character allCharacter in Character.AllCharacters)
			{
				if ((Object)(object)((MonoBehaviourPun)allCharacter).photonView != (Object)null && !((MonoBehaviourPun)allCharacter).photonView.IsMine)
				{
					list.Add(allCharacter);
				}
			}
			return list;
		}

		private void FollowTarget()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: 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_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: 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)
			//IL_00bc: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: 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_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			Character localCharacter = GetLocalCharacter();
			if (!((Object)(object)localCharacter == (Object)null) && !((Object)(object)currentTarget == (Object)null))
			{
				Vector3 center = currentTarget.Center;
				Vector3 center2 = localCharacter.Center;
				Vector3 val = center - center2;
				val.y = 0f;
				float magnitude = ((Vector3)(ref val)).magnitude;
				float num = ((magnitude > 15f) ? 100f : ((magnitude > 8f) ? 40f : ((!(magnitude > 3f)) ? 5f : 15f)));
				Vector3 val2 = ((!(magnitude > 0.1f)) ? center : (center - ((Vector3)(ref val)).normalized * 0.5f));
				val2.y += 0.9f;
				Rigidbody val3 = ((Component)localCharacter).GetComponent<Rigidbody>();
				if ((Object)(object)val3 == (Object)null)
				{
					val3 = ((Component)localCharacter).GetComponentInChildren<Rigidbody>();
				}
				if ((Object)(object)val3 != (Object)null)
				{
					val3.useGravity = false;
					Vector3 val4 = val2 - center2;
					Vector3 normalized = ((Vector3)(ref val4)).normalized;
					val3.linearVelocity = normalized * num;
				}
				else
				{
					((Component)localCharacter).transform.position = Vector3.Lerp(((Component)localCharacter).transform.position, val2, Time.deltaTime * (num / 10f));
				}
			}
		}

		private void RestoreGravity()
		{
			Character localCharacter = GetLocalCharacter();
			if (!((Object)(object)localCharacter == (Object)null))
			{
				Rigidbody val = ((Component)localCharacter).GetComponent<Rigidbody>();
				if ((Object)(object)val == (Object)null)
				{
					val = ((Component)localCharacter).GetComponentInChildren<Rigidbody>();
				}
				if ((Object)(object)val != (Object)null)
				{
					val.useGravity = true;
				}
			}
		}

		private void TriggerKick()
		{
			if (!(Time.time - lastKickTime < KickCooldown))
			{
				lastKickTime = Time.time;
				Character localCharacter = GetLocalCharacter();
				if (!((Object)(object)localCharacter == (Object)null))
				{
					localCharacter.data.currentStamina = KickPower;
					localCharacter.data.sincePressReach = 0f;
					localCharacter.data.isKicking = false;
					localCharacter.data.isGrounded = true;
					((MonoBehaviour)this).StartCoroutine(DrainStamina(localCharacter));
					pauseEndTime = Time.time + 3f;
				}
			}
		}

		private IEnumerator DrainStamina(Character local)
		{
			yield return (object)new WaitForSeconds(1f);
			if ((Object)(object)local != (Object)null && (Object)(object)local.data != (Object)null)
			{
				local.data.currentStamina = 0f;
			}
		}

		private Character GetLocalCharacter()
		{
			foreach (Character allCharacter in Character.AllCharacters)
			{
				PhotonView component = ((Component)allCharacter).gameObject.GetComponent<PhotonView>();
				if ((Object)(object)component != (Object)null && component.IsMine)
				{
					return allCharacter;
				}
			}
			return null;
		}
	}
}