Decompiled source of GnarSurvivor v1.3.2

plugins/GnarSurvivor.dll

Decompiled 2 days ago
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using GnarSurvivor.Audio;
using GnarSurvivor.Data;
using GnarSurvivor.Model;
using GnarSurvivor.Projectiles;
using GnarSurvivor.States;
using GnarSurvivor.UI;
using HG.BlendableTypes;
using HarmonyLib;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.ConVar;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.EventSystems;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("RoR2")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.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 GnarSurvivor
{
	internal static class GnarBody
	{
		public static GameObject bodyPrefab;

		public static GameObject displayPrefab;

		public static SurvivorDef survivorDef;

		public static readonly Color BodyColor = new Color(0.93f, 0.62f, 0.25f);

		public static void Create()
		{
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			GnarLanguage.Register();
			GnarProjectiles.Create();
			bodyPrefab = CloneBody();
			ContentAddition.AddBody(bodyPrefab);
			GnarSkills.Create(bodyPrefab);
			displayPrefab = BuildDisplay();
			AddSkins();
			ModelSkinController componentInChildren = bodyPrefab.GetComponentInChildren<ModelSkinController>();
			displayPrefab.GetComponentInChildren<ModelSkinController>().skins = componentInChildren.skins;
			survivorDef = ScriptableObject.CreateInstance<SurvivorDef>();
			survivorDef.cachedName = "Gnar";
			survivorDef.displayNameToken = "GNAR_NAME";
			survivorDef.descriptionToken = "GNAR_DESCRIPTION";
			survivorDef.outroFlavorToken = "GNAR_OUTRO_FLAVOR";
			survivorDef.mainEndingEscapeFailureFlavorToken = "GNAR_OUTRO_FAILURE";
			survivorDef.primaryColor = BodyColor;
			survivorDef.bodyPrefab = bodyPrefab;
			survivorDef.displayPrefab = displayPrefab;
			survivorDef.desiredSortPosition = 100f;
			ContentAddition.AddSurvivorDef(survivorDef);
			GnarLanguage.Verify();
		}

		private static GameObject CloneBody()
		{
			//IL_005c: 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_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: 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_00cb: 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_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0360: Unknown result type (might be due to invalid IL or missing references)
			//IL_0367: Expected O, but got Unknown
			//IL_051d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0522: Unknown result type (might be due to invalid IL or missing references)
			//IL_0533: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody");
			if (!Object.op_Implicit((Object)(object)val))
			{
				throw new Exception("CommandoBody not found; cannot clone");
			}
			if (!Object.op_Implicit((Object)(object)val.transform.Find("CameraPivot")))
			{
				new Vector3(0f, 0.6f, 0f);
			}
			else
			{
				_ = val.transform.Find("CameraPivot").localPosition;
			}
			Vector3 localPosition = (Vector3)(Object.op_Implicit((Object)(object)val.transform.Find("AimOrigin")) ? val.transform.Find("AimOrigin").localPosition : new Vector3(0f, 0.4f, 0f));
			Vector3 localPosition2 = (Vector3)(Object.op_Implicit((Object)(object)val.transform.Find("ModelBase")) ? val.transform.Find("ModelBase").localPosition : new Vector3(0f, -0.92f, 0f));
			GnarItemDisplays.CaptureFromCommando(val);
			GameObject val2 = PrefabAPI.InstantiateClone(val, "GnarBody", true);
			SfxLocator component = val2.GetComponent<SfxLocator>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.deathSound = "";
				component.barkSound = "";
			}
			for (int num = val2.transform.childCount - 1; num >= 0; num--)
			{
				Object.DestroyImmediate((Object)(object)((Component)val2.transform.GetChild(num)).gameObject);
			}
			CharacterBody component2 = val2.GetComponent<CharacterBody>();
			component2.baseNameToken = "GNAR_NAME";
			component2.subtitleNameToken = "GNAR_SUBTITLE";
			component2.bodyColor = BodyColor;
			Sprite icon = GnarAssets.GetIcon("icons/gnar_circle.png");
			if (Object.op_Implicit((Object)(object)icon))
			{
				component2.portraitIcon = (Texture)(object)icon.texture;
			}
			component2.baseMaxHealth = 110f;
			component2.levelMaxHealth = 33f;
			component2.baseRegen = 1f;
			component2.levelRegen = 0.2f;
			component2.baseArmor = 0f;
			component2.levelArmor = 0f;
			component2.baseMaxShield = 0f;
			component2.levelMaxShield = 0f;
			component2.baseDamage = 12f;
			component2.levelDamage = 2.4f;
			component2.baseAttackSpeed = 1f;
			component2.levelAttackSpeed = 0f;
			component2.baseCrit = 1f;
			component2.levelCrit = 0f;
			component2.baseMoveSpeed = 7.2f;
			component2.levelMoveSpeed = 0f;
			component2.baseJumpPower = 15f;
			component2.levelJumpPower = 0f;
			component2.baseJumpCount = 1;
			component2.baseAcceleration = 80f;
			component2.sprintingSpeedMultiplier = 1.45f;
			component2.autoCalculateLevelStats = false;
			component2.rootMotionInMainState = false;
			component2.hullClassification = (HullClassification)0;
			component2.isChampion = false;
			Transform transform = new GameObject("ModelBase").transform;
			transform.SetParent(val2.transform, false);
			transform.localPosition = localPosition2;
			transform.localRotation = Quaternion.identity;
			Transform transform2 = new GameObject("CameraPivot").transform;
			transform2.SetParent(val2.transform, false);
			transform2.localPosition = new Vector3(0f, 1f, 0f);
			Transform transform3 = new GameObject("AimOrigin").transform;
			transform3.SetParent(val2.transform, false);
			transform3.localPosition = localPosition;
			component2.aimOriginTransform = transform3;
			GameObject val3 = new GameObject("mdlGnar");
			val3.transform.SetParent(transform, false);
			ChildLocator val4 = val3.AddComponent<ChildLocator>();
			val4.transformPairs = (NameTransformPair[])(object)new NameTransformPair[0];
			CharacterModel obj = val3.AddComponent<CharacterModel>();
			obj.body = component2;
			obj.itemDisplayRuleSet = GnarItemDisplays.RuleSet;
			obj.autoPopulateLightInfos = true;
			obj.invisibilityCount = 0;
			obj.temporaryOverlays = new List<TemporaryOverlayInstance>();
			obj.baseRendererInfos = (RendererInfo[])(object)new RendererInfo[0];
			val3.AddComponent<ModelSkinController>().skins = (SkinDef[])(object)new SkinDef[0];
			val3.AddComponent<GnarAnimDriver>();
			val3.AddComponent<GnarModelController>();
			SetupHurtbox(val2, val3, val4);
			ModelLocator component3 = val2.GetComponent<ModelLocator>();
			component3.modelTransform = val3.transform;
			component3.modelBaseTransform = transform;
			component3.dontDetatchFromParent = false;
			component3.normalizeToFloor = false;
			CharacterDirection component4 = val2.GetComponent<CharacterDirection>();
			if (Object.op_Implicit((Object)(object)component4))
			{
				component4.targetTransform = transform;
				component4.overrideAnimatorForwardTransform = null;
				component4.rootMotionAccumulator = null;
				component4.modelAnimator = null;
				component4.driveFromRootRotation = false;
				component4.turnSpeed = 720f;
			}
			CameraTargetParams component5 = val2.GetComponent<CameraTargetParams>();
			if (Object.op_Implicit((Object)(object)component5))
			{
				component5.cameraPivotTransform = transform2;
				CharacterCameraParams val5 = ScriptableObject.CreateInstance<CharacterCameraParams>();
				((Object)val5).name = "ccpGnar";
				val5.data = (Object.op_Implicit((Object)(object)component5.cameraParams) ? component5.cameraParams.data : CharacterCameraParamsData.basic);
				val5.data.pivotVerticalOffset = BlendableFloat.op_Implicit(0.95f);
				val5.data.idealLocalCameraPos = BlendableVector3.op_Implicit(new Vector3(0f, 0f, -7.5f));
				component5.cameraParams = val5;
			}
			CharacterDeathBehavior component6 = val2.GetComponent<CharacterDeathBehavior>();
			if (Object.op_Implicit((Object)(object)component6))
			{
				component6.deathState = new SerializableEntityStateType(typeof(GnarDeath));
				bool flag = default(bool);
				ContentAddition.AddEntityState(typeof(GnarDeath), ref flag);
			}
			val2.AddComponent<GnarRageController>();
			val2.AddComponent<GnarFormSync>();
			return val2;
		}

		private static void SetupHurtbox(GameObject body, GameObject model, ChildLocator locator)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: 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)
			GameObject val = new GameObject("MainHurtbox");
			val.transform.SetParent(model.transform, false);
			val.transform.localPosition = new Vector3(0f, 0.9f, 0f);
			val.layer = LayerIndex.entityPrecise.intVal;
			CapsuleCollider obj = val.AddComponent<CapsuleCollider>();
			obj.radius = 0.5f;
			obj.height = 1.5f;
			obj.direction = 1;
			HurtBoxGroup val2 = model.AddComponent<HurtBoxGroup>();
			HurtBox val3 = val.AddComponent<HurtBox>();
			val3.healthComponent = body.GetComponent<HealthComponent>();
			val3.isBullseye = true;
			val3.isSniperTarget = true;
			val3.damageModifier = (DamageModifier)0;
			val3.hurtBoxGroup = val2;
			val3.indexInGroup = 0;
			val2.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val3 };
			val2.mainHurtBox = val3;
			val2.bullseyeCount = 1;
			locator.transformPairs = locator.transformPairs.Append(new NameTransformPair
			{
				name = "MainHurtbox",
				transform = val.transform
			}).ToArray();
		}

		private static GameObject BuildDisplay()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: 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_0075: Expected O, but got Unknown
			//IL_007b: Expected O, but got Unknown
			GameObject val = new GameObject("GnarDisplay");
			val.AddComponent<ChildLocator>().transformPairs = (NameTransformPair[])(object)new NameTransformPair[0];
			CharacterModel obj = val.AddComponent<CharacterModel>();
			obj.autoPopulateLightInfos = true;
			obj.invisibilityCount = 0;
			obj.temporaryOverlays = new List<TemporaryOverlayInstance>();
			obj.baseRendererInfos = (RendererInfo[])(object)new RendererInfo[0];
			val.AddComponent<ModelSkinController>().skins = (SkinDef[])(object)new SkinDef[0];
			val.AddComponent<GnarAnimDriver>();
			val.AddComponent<GnarModelController>().isDisplay = true;
			GameObject result = PrefabAPI.InstantiateClone(val, "GnarDisplay", false);
			Object.Destroy((Object)val);
			return result;
		}

		private static void AddSkins()
		{
			//IL_002d: 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)
			GameObject gameObject = ((Component)bodyPrefab.GetComponent<ModelLocator>().modelTransform).gameObject;
			SkinEntry[] skins = GnarAssets.Manifest.skins;
			foreach (SkinEntry skinEntry in skins)
			{
				SkinDef val = Skins.CreateNewSkinDef(new SkinDefParamsInfo
				{
					Name = ((skinEntry.index == 0) ? "skinGnarDefault" : ("skinGnar" + skinEntry.index)),
					NameToken = "GNAR_SKIN_" + skinEntry.index,
					Icon = GnarAssets.GetIcon(skinEntry.icon),
					RootObject = gameObject,
					BaseSkins = (SkinDef[])(object)new SkinDef[0],
					RendererInfos = (RendererInfo[])(object)new RendererInfo[0],
					GameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[0],
					MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0],
					ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0],
					MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0]
				});
				Skins.AddSkinToCharacter(bodyPrefab, val);
			}
		}
	}
	public static class GnarContent
	{
		public static BuffDef MegaBuff;

		public static BuffDef RageBuff;

		public static BuffDef HyperBuff;

		public static BuffDef CatchBuff;

		public static void Init()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: 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_008f: Unknown result type (might be due to invalid IL or missing references)
			RageBuff = NewBuff("bdGnarRage", new Color(1f, 0.45f, 0.12f), stack: true, GnarAssets.GetIcon("icons/gnar_square.png"));
			MegaBuff = NewBuff("bdGnarMega", new Color(0.85f, 0.2f, 0.1f), stack: false, GnarAssets.GetIcon("icons/gnarbig_square.png"));
			HyperBuff = NewBuff("bdGnarHyper", new Color(1f, 0.85f, 0.2f), stack: false, GnarAssets.GetIcon("icons/gnar_circle.png"));
			CatchBuff = NewBuff("bdGnarCatch", Color.white, stack: false, null);
			CatchBuff.isHidden = true;
		}

		private static BuffDef NewBuff(string name, Color color, bool stack, Sprite icon)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			BuffDef obj = ScriptableObject.CreateInstance<BuffDef>();
			((Object)obj).name = name;
			obj.buffColor = color;
			obj.canStack = stack;
			obj.isDebuff = false;
			obj.isHidden = false;
			obj.iconSprite = icon;
			ContentAddition.AddBuffDef(obj);
			return obj;
		}
	}
	internal static class GnarLanguage
	{
		private static readonly HashSet<string> registered = new HashSet<string>();

		private static void Add(string token, string value)
		{
			LanguageAPI.Add(token, value);
			registered.Add(token);
		}

		public static void Register()
		{
			string text = "GNAR_";
			Add(text + "NAME", "Gnar");
			Add(text + "SUBTITLE", "The Missing Link");
			Add(text + "DESCRIPTION", "Gnar is a cheerful little yordle who gets <style=cDeath>very angry</style> and becomes a rampaging giant.<color=#CCD3E0>\r\n\r\n< ! > Mini Gnar is fast and ranged: keep your Boomerang in the air and catch it to speed up your cooldowns.\r\n\r\n< ! > Dealing and taking damage builds <style=cIsDamage>Rage</style>. At 100 Rage, use GNAR! to transform into Mega Gnar.\r\n\r\n< ! > Mega Gnar is tanky and hits like a truck, but his Rage drains away. Hit things to keep him big.\r\n\r\n< ! > Jumping on enemies with Hop makes you bounce higher.</color>\r\n");
			Add(text + "OUTRO_FLAVOR", "..and so he left, still shouting for his rock.");
			Add(text + "OUTRO_FAILURE", "..and so he vanished, mid-sentence, as a yordle does.");
			Add(text + "PASSIVE_NAME", "Rage Gene");
			Add(text + "PASSIVE_DESC", "Dealing and taking damage builds <style=cIsDamage>Rage</style>. At <style=cIsDamage>100 Rage</style> Gnar can transform into <style=cDeath>Mega Gnar</style>. Mega Gnar gains <style=cIsHealing>bonus health</style>, <style=cIsDamage>damage</style> and <style=cIsUtility>armor</style> and <style=cIsHealing>heals 1.2% of his maximum health</style> when he hits, but his Rage drains until he shrinks back.");
			Add(text + "PRIMARY_BOOMERANG_NAME", "Boomerang Throw");
			Add(text + "PRIMARY_BOOMERANG_DESC", "Throw a boomerang for <style=cIsDamage>260% damage</style> that <style=cIsUtility>slows</style>. It flies back for <style=cIsDamage>160% damage</style>. Catching it reduces your other cooldowns by <style=cIsUtility>0.75s</style> and builds <style=cIsDamage>Rage</style>.");
			Add(text + "SECONDARY_HYPER_NAME", "Hyper");
			Add(text + "SECONDARY_HYPER_DESC", "Get <style=cIsUtility>Hyper</style> for 5 seconds: <style=cIsDamage>+45% attack speed</style>, <style=cIsUtility>+25% movement speed</style>, and Boomerang Throw hits <style=cIsDamage>50% harder</style>. Every <style=cIsDamage>third hit</style> on the same enemy bursts for <style=cIsDamage>120% damage plus 8% of its maximum health</style> (up to 600% damage).");
			Add(text + "UTILITY_HOP_NAME", "Hop");
			Add(text + "UTILITY_HOP_DESC", "Leap forward. Landing on an enemy <style=cIsUtility>bounces</style> Gnar higher and deals <style=cIsDamage>180% damage</style> in a small area.");
			Add(text + "SPECIAL_TRANSFORM_NAME", "GNAR!");
			Add(text + "SPECIAL_TRANSFORM_DESC", "<style=cIsDamage>Requires 100 Rage.</style> Transform into <style=cDeath>Mega Gnar</style>, knocking nearby enemies back for <style=cIsDamage>300% damage</style>.");
			Add(text + "PRIMARY_BOULDER_NAME", "Boulder Toss");
			Add(text + "PRIMARY_BOULDER_DESC", "Hurl a boulder that explodes on impact for <style=cIsDamage>560% damage</style> in a large area and <style=cIsUtility>slows</style> enemies.");
			Add(text + "SECONDARY_WALLOP_NAME", "Wallop");
			Add(text + "SECONDARY_WALLOP_DESC", "Smash the ground in front of you for <style=cIsDamage>600% damage</style> and <style=cIsUtility>stun</style> enemies.");
			Add(text + "UTILITY_CRUNCH_NAME", "Crunch");
			Add(text + "UTILITY_CRUNCH_DESC", "Leap and slam down for <style=cIsDamage>420% damage</style>, <style=cIsUtility>slowing</style> enemies around the impact.");
			Add(text + "SPECIAL_GNAR_NAME", "GNAR!");
			Add(text + "SPECIAL_GNAR_DESC", "Roar, <style=cIsUtility>knocking back</style> and <style=cIsUtility>stunning</style> everything around you for <style=cIsDamage>900% damage</style>.");
			Add(text + "KEYWORD_RAGE", "<style=cKeywordName>Rage</style><style=cSub>Built by dealing and taking damage. Spend it on GNAR! to become Mega Gnar.</style>");
			Add(text + "BUFF_RAGE_NAME", "Rage");
			Add(text + "BUFF_RAGE_DESC", "The more Rage, the closer Gnar is to going big.");
			SkinEntry[] skins = GnarAssets.Manifest.skins;
			foreach (SkinEntry skinEntry in skins)
			{
				Add(text + "SKIN_" + skinEntry.index, skinEntry.name);
			}
		}

		public static void Verify()
		{
			List<string> missing = new List<string>();
			SkillDef[] array = (SkillDef[])(object)new SkillDef[8]
			{
				GnarSkills.MiniPrimary,
				GnarSkills.MiniSecondary,
				GnarSkills.MiniUtility,
				GnarSkills.MiniSpecial,
				GnarSkills.MegaPrimary,
				GnarSkills.MegaSecondary,
				GnarSkills.MegaUtility,
				GnarSkills.MegaSpecial
			};
			foreach (SkillDef val in array)
			{
				if (Object.op_Implicit((Object)(object)val))
				{
					Check(val.skillNameToken);
					Check(val.skillDescriptionToken);
				}
			}
			SkinEntry[] skins = GnarAssets.Manifest.skins;
			foreach (SkinEntry skinEntry in skins)
			{
				Check("GNAR_SKIN_" + skinEntry.index);
			}
			if (missing.Count > 0)
			{
				GnarPlugin.Log.LogError((object)("unregistered language tokens: " + string.Join(", ", missing)));
			}
			void Check(string token)
			{
				if (!string.IsNullOrEmpty(token) && !registered.Contains(token))
				{
					missing.Add(token);
				}
			}
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.woo.gnarsurvivor", "GnarSurvivor", "1.3.2")]
	public class GnarPlugin : BaseUnityPlugin
	{
		public const string Guid = "com.woo.gnarsurvivor";

		public const string Name = "GnarSurvivor";

		public const string Version = "1.3.2";

		public static GnarPlugin Instance;

		public static string PluginDir;

		public static ConfigEntry<float> MiniUnitScale;

		public static ConfigEntry<float> MegaUnitScale;

		public static ConfigEntry<float> MiniYaw;

		public static ConfigEntry<float> MegaYaw;

		public static ConfigEntry<float> RageGainMultiplier;

		public static ConfigEntry<float> RageDrainMegaPerSecond;

		public static ConfigEntry<float> RageDecayPerSecond;

		public static ConfigEntry<bool> VoiceLines;

		public static ConfigEntry<float> VoiceVolume;

		public static ConfigEntry<float> EffectVolume;

		public static ManualLogSource Log => ((BaseUnityPlugin)Instance).Logger;

		private void Update()
		{
			OsAudio.Paused = Time.timeScale <= 0.01f;
			GnarAudio.Enabled = VoiceLines.Value;
			GnarAudio.VoiceVolume = VoiceVolume.Value;
			GnarAudio.EffectVolume = EffectVolume.Value;
		}

		private void OnDestroy()
		{
			GnarAudio.Shutdown();
		}

		private void Awake()
		{
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Expected O, but got Unknown
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Expected O, but got Unknown
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Expected O, but got Unknown
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Expected O, but got Unknown
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Expected O, but got Unknown
			Instance = this;
			PluginDir = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location);
			MiniUnitScale = ((BaseUnityPlugin)this).Config.Bind<float>("Visuals", "Mini scale", 0.0115f, "Meters per League unit for Mini Gnar (default makes him about 1.4 m tall).");
			MegaUnitScale = ((BaseUnityPlugin)this).Config.Bind<float>("Visuals", "Mega scale", 0.0145f, "Meters per League unit for Mega Gnar (default makes him about 4.6 m tall).");
			MiniYaw = ((BaseUnityPlugin)this).Config.Bind<float>("Visuals", "Mini yaw offset", 0f, "Degrees to rotate the Mini model around Y.");
			MegaYaw = ((BaseUnityPlugin)this).Config.Bind<float>("Visuals", "Mega yaw offset", 0f, "Degrees to rotate the Mega model around Y.");
			if (Mathf.Approximately(MegaUnitScale.Value, 0.0085f) || Mathf.Approximately(MegaUnitScale.Value, 0.0125f) || Mathf.Approximately(MegaUnitScale.Value, 0.0234f))
			{
				MegaUnitScale.Value = 0.0145f;
				((BaseUnityPlugin)this).Config.Save();
			}
			RageGainMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Gameplay", "Rage gain multiplier", 1f, new ConfigDescription("Scales all Rage gained from dealing and taking damage.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 5f), Array.Empty<object>()));
			RageDrainMegaPerSecond = ((BaseUnityPlugin)this).Config.Bind<float>("Gameplay", "Mega rage drain per second", 8f, new ConfigDescription("Rage lost per second while Mega (8 = about 12 seconds from full).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 50f), Array.Empty<object>()));
			VoiceLines = ((BaseUnityPlugin)this).Config.Bind<bool>("Audio", "Voice lines", true, "Play Gnar's League voice lines and sound effects. Uses the Windows mixer, not the game's audio engine.");
			VoiceVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "Voice volume", 0.8f, new ConfigDescription("Volume of voice lines (0-1).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			EffectVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "Effect volume", 0.6f, new ConfigDescription("Volume of skill and impact sounds (0-1).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			RageDecayPerSecond = ((BaseUnityPlugin)this).Config.Bind<float>("Gameplay", "Mini rage decay per second", 5f, new ConfigDescription("Rage lost per second after 4s out of combat.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 50f), Array.Empty<object>()));
			try
			{
				GnarAssets.Init(PluginDir, ((BaseUnityPlugin)this).Logger);
				GnarAudio.Enabled = VoiceLines.Value;
				GnarAudio.VoiceVolume = VoiceVolume.Value;
				GnarAudio.EffectVolume = EffectVolume.Value;
				GnarAudio.Init(PluginDir, (Action<string>)((BaseUnityPlugin)this).Logger.LogInfo);
				GnarContent.Init();
				GnarStats.Hook();
				GnarSkinRow.Hook();
				GnarBody.Create();
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Gnar registered.");
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)("Gnar failed to initialise: " + ex));
			}
		}
	}
	public sealed class GnarRageController : MonoBehaviour
	{
		public const float MaxRage = 100f;

		private CharacterBody body;

		private float rage;

		private float lastCombat;

		private int shownRage = -1;

		private readonly Dictionary<GameObject, int> hyperHits = new Dictionary<GameObject, int>();

		private float nextMegaHeal;

		public float Rage => rage;

		private void Awake()
		{
			body = ((Component)this).GetComponent<CharacterBody>();
			GlobalEventManager.onServerDamageDealt += OnDamage;
		}

		private void OnDestroy()
		{
			GlobalEventManager.onServerDamageDealt -= OnDamage;
		}

		private void OnDamage(DamageReport r)
		{
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Invalid comparison between Unknown and I4
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: 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)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: 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_012b: 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_013c: 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)
			//IL_0146: 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_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active || !Object.op_Implicit((Object)(object)body))
			{
				return;
			}
			if ((Object)(object)r.attackerBody == (Object)(object)body && (Object)(object)r.victimBody != (Object)(object)body)
			{
				float num = Mathf.Clamp01(r.damageInfo.procCoefficient);
				if (num <= 0f)
				{
					return;
				}
				Gain((2.2f + Mathf.Min(3f, r.damageDealt / Mathf.Max(1f, body.damage) * 0.35f)) * num);
				if (body.HasBuff(GnarContent.HyperBuff) && Object.op_Implicit((Object)(object)r.victimBody) && num > 0f)
				{
					GameObject gameObject = ((Component)r.victimBody).gameObject;
					hyperHits.TryGetValue(gameObject, out var value);
					value++;
					if (value >= 3)
					{
						hyperHits[gameObject] = 0;
						new BlastAttack
						{
							attacker = ((Component)body).gameObject,
							inflictor = ((Component)body).gameObject,
							teamIndex = body.teamComponent.teamIndex,
							position = r.victimBody.corePosition,
							radius = 2.5f,
							baseDamage = body.damage * 1.2f + Mathf.Min(r.victimBody.maxHealth * 0.08f, body.damage * 6f),
							damageType = DamageTypeCombo.GenericSecondary,
							procCoefficient = 0f,
							falloffModel = (FalloffModel)0,
							attackerFiltering = (AttackerFiltering)2
						}.Fire();
						GnarAudio.Play("Play_sfx_Gnar_GnarBasicAttack2_OnHit");
					}
					else
					{
						hyperHits[gameObject] = value;
					}
					if (hyperHits.Count > 32)
					{
						hyperHits.Clear();
					}
				}
				if (body.HasBuff(GnarContent.MegaBuff) && Object.op_Implicit((Object)(object)body.healthComponent) && Time.time >= nextMegaHeal)
				{
					nextMegaHeal = Time.time + 0.35f;
					body.healthComponent.Heal(body.maxHealth * 0.012f, default(ProcChainMask), true);
				}
			}
			else if ((Object)(object)r.victimBody == (Object)(object)body && (Object)(object)r.attackerBody != (Object)(object)body)
			{
				float num2 = Mathf.Clamp(r.damageDealt / Mathf.Max(1f, body.maxHealth) * 100f * 0.75f, 1.5f, 28f);
				if ((int)r.dotType != -1)
				{
					num2 = Mathf.Min(num2, 1.5f);
				}
				Gain(num2);
			}
		}

		public void Gain(float amount)
		{
			if (NetworkServer.active)
			{
				bool flag = body.HasBuff(GnarContent.MegaBuff);
				amount *= GnarPlugin.RageGainMultiplier.Value * (flag ? 0.6f : 1f);
				rage = Mathf.Clamp(rage + amount, 0f, 100f);
				lastCombat = Time.time;
				Publish();
			}
		}

		public void ServerEnterMega()
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && !body.HasBuff(GnarContent.MegaBuff))
			{
				rage = 100f;
				body.AddBuff(GnarContent.MegaBuff);
				if (Object.op_Implicit((Object)(object)body.healthComponent))
				{
					body.healthComponent.Heal(body.maxHealth * 0.25f, default(ProcChainMask), true);
				}
				Publish();
			}
		}

		public void ServerExitMega()
		{
			if (NetworkServer.active && body.HasBuff(GnarContent.MegaBuff))
			{
				body.RemoveBuff(GnarContent.MegaBuff);
				rage = 0f;
				Publish();
			}
		}

		private void FixedUpdate()
		{
			if (!NetworkServer.active || !Object.op_Implicit((Object)(object)body))
			{
				return;
			}
			if (body.HasBuff(GnarContent.MegaBuff))
			{
				rage -= GnarPlugin.RageDrainMegaPerSecond.Value * Time.fixedDeltaTime;
				if (rage <= 0f)
				{
					ServerExitMega();
				}
				else
				{
					Publish();
				}
			}
			else if (rage > 0f && Time.time - lastCombat > 4f)
			{
				rage = Mathf.Max(0f, rage - GnarPlugin.RageDecayPerSecond.Value * Time.fixedDeltaTime);
				Publish();
			}
		}

		private void Publish()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			int num = Mathf.RoundToInt(rage);
			if (num != shownRage)
			{
				shownRage = num;
				body.SetBuffCount(GnarContent.RageBuff.buffIndex, num);
			}
		}
	}
	public sealed class GnarFormSync : MonoBehaviour
	{
		private CharacterBody body;

		private SkillLocator locator;

		private CameraTargetParams ctp;

		private CameraParamsOverrideHandle megaCam;

		private bool applied;

		private bool hadCatch;

		private void Awake()
		{
			body = ((Component)this).GetComponent<CharacterBody>();
			locator = ((Component)this).GetComponent<SkillLocator>();
			ctp = ((Component)this).GetComponent<CameraTargetParams>();
		}

		private void FixedUpdate()
		{
			if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)locator))
			{
				return;
			}
			if (body.hasEffectiveAuthority)
			{
				bool flag = body.HasBuff(GnarContent.CatchBuff);
				if (flag && !hadCatch)
				{
					if (Object.op_Implicit((Object)(object)locator.secondary))
					{
						locator.secondary.RunRecharge(0.75f);
					}
					if (Object.op_Implicit((Object)(object)locator.utility))
					{
						locator.utility.RunRecharge(0.75f);
					}
					GnarAudio.Play("Play_sfx_Gnar_GnarQCatch_hit");
				}
				hadCatch = flag;
			}
			bool flag2 = body.HasBuff(GnarContent.MegaBuff);
			if (flag2 != applied)
			{
				applied = flag2;
				if (!flag2)
				{
					GnarAudio.Play("Play_sfx_Gnar_GnarTransformBack_buffactivate");
				}
				if (body.hasEffectiveAuthority && Object.op_Implicit((Object)(object)ctp))
				{
					SetMegaCamera(flag2);
				}
				Set(locator.primary, GnarSkills.MegaPrimary, flag2);
				Set(locator.secondary, GnarSkills.MegaSecondary, flag2);
				Set(locator.utility, GnarSkills.MegaUtility, flag2);
				Set(locator.special, GnarSkills.MegaSpecial, flag2);
			}
		}

		private void SetMegaCamera(bool on)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: 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_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			if (((CameraParamsOverrideHandle)(ref megaCam)).isValid)
			{
				ctp.RemoveParamsOverride(megaCam, 0.6f);
				megaCam = default(CameraParamsOverrideHandle);
			}
			if (on)
			{
				CharacterCameraParamsData cameraParamsData = (Object.op_Implicit((Object)(object)ctp.cameraParams) ? ctp.cameraParams.data : CharacterCameraParamsData.basic);
				float num = Mathf.Clamp(GnarPlugin.MegaUnitScale.Value / 0.0085f, 0.75f, 3f);
				cameraParamsData.pivotVerticalOffset = new BlendableFloat
				{
					value = 1.9f * num,
					alpha = 1f
				};
				cameraParamsData.idealLocalCameraPos = new BlendableVector3
				{
					value = new Vector3(0f, 0f, -12.5f * num),
					alpha = 1f
				};
				megaCam = ctp.AddParamsOverride(new CameraParamsOverrideRequest
				{
					cameraParamsData = cameraParamsData,
					priority = 10f
				}, 0.6f);
			}
		}

		private void OnDisable()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (((CameraParamsOverrideHandle)(ref megaCam)).isValid && Object.op_Implicit((Object)(object)ctp))
			{
				ctp.RemoveParamsOverride(megaCam, 0f);
				megaCam = default(CameraParamsOverrideHandle);
			}
			if (applied && Object.op_Implicit((Object)(object)locator))
			{
				applied = false;
				Set(locator.primary, GnarSkills.MegaPrimary, on: false);
				Set(locator.secondary, GnarSkills.MegaSecondary, on: false);
				Set(locator.utility, GnarSkills.MegaUtility, on: false);
				Set(locator.special, GnarSkills.MegaSpecial, on: false);
			}
		}

		private void Set(GenericSkill slot, SkillDef def, bool on)
		{
			if (Object.op_Implicit((Object)(object)slot) && Object.op_Implicit((Object)(object)def))
			{
				if (on)
				{
					slot.SetSkillOverride((object)this, def, (SkillOverridePriority)4);
				}
				else
				{
					slot.UnsetSkillOverride((object)this, def, (SkillOverridePriority)4);
				}
			}
		}
	}
	internal static class GnarStats
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static StatHookEventHandler <0>__OnStats;
		}

		public static void Hook()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__OnStats;
			if (obj == null)
			{
				StatHookEventHandler val = OnStats;
				<>O.<0>__OnStats = val;
				obj = (object)val;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj;
		}

		private static void OnStats(CharacterBody sender, StatHookEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)sender))
			{
				if (sender.HasBuff(GnarContent.MegaBuff))
				{
					args.baseHealthAdd += 140f + 35f * (sender.level - 1f);
					args.armorAdd += 60f;
					args.damageMultAdd += 0.55f;
					args.moveSpeedMultAdd -= 0.05f;
				}
				if (sender.HasBuff(GnarContent.HyperBuff))
				{
					args.attackSpeedMultAdd += 0.45f;
					args.moveSpeedMultAdd += 0.25f;
				}
			}
		}
	}
	internal static class GnarSkills
	{
		public static SkillDef MiniPrimary;

		public static SkillDef MiniSecondary;

		public static SkillDef MiniUtility;

		public static SkillDef MiniSpecial;

		public static SkillDef MegaPrimary;

		public static SkillDef MegaSecondary;

		public static SkillDef MegaUtility;

		public static SkillDef MegaSpecial;

		public static void Create(GameObject body)
		{
			//IL_0009: 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)
			SkillLocator component = body.GetComponent<SkillLocator>();
			component.passiveSkill = new PassiveSkill
			{
				enabled = true,
				skillNameToken = "GNAR_PASSIVE_NAME",
				skillDescriptionToken = "GNAR_PASSIVE_DESC",
				keywordToken = "GNAR_KEYWORD_RAGE",
				icon = GnarAssets.GetIcon("icons/gnar_passive.png")
			};
			MiniPrimary = Def<GnarBoomerangThrow>("GnarBoomerang", "GNAR_PRIMARY_BOOMERANG", "Weapon", 1.1f, "icons/gnar_q.png", (InterruptPriority)0, attackSpeedRestock: true, cancelSprint: false, (SkillDef)null);
			MiniSecondary = Def<GnarHyper>("GnarHyper", "GNAR_SECONDARY_HYPER", "Weapon", 7f, "icons/gnar_w.png", (InterruptPriority)1, attackSpeedRestock: false, cancelSprint: false, (SkillDef)null);
			MiniUtility = Def<GnarHop>("GnarHop", "GNAR_UTILITY_HOP", "Body", 5f, "icons/gnar_e.png", (InterruptPriority)1, attackSpeedRestock: false, cancelSprint: false, (SkillDef)null);
			MiniSpecial = Def<GnarTransform>("GnarTransform", "GNAR_SPECIAL_TRANSFORM", "Weapon", 0.5f, "icons/gnartransform.png", (InterruptPriority)2, attackSpeedRestock: false, cancelSprint: true, (SkillDef)(object)ScriptableObject.CreateInstance<GnarTransformSkillDef>());
			MegaPrimary = Def<GnarBoulderToss>("GnarBoulder", "GNAR_PRIMARY_BOULDER", "Weapon", 1.6f, "icons/gnarbig_q.png", (InterruptPriority)0, attackSpeedRestock: true, cancelSprint: false, (SkillDef)null);
			MegaSecondary = Def<GnarWallop>("GnarWallop", "GNAR_SECONDARY_WALLOP", "Weapon", 5f, "icons/gnarbig_w.png", (InterruptPriority)1, attackSpeedRestock: false, cancelSprint: false, (SkillDef)null);
			MegaUtility = Def<GnarCrunch>("GnarCrunch", "GNAR_UTILITY_CRUNCH", "Body", 7f, "icons/gnarbig_e.png", (InterruptPriority)1, attackSpeedRestock: false, cancelSprint: false, (SkillDef)null);
			MegaSpecial = Def<GnarRoar>("GnarRoar", "GNAR_SPECIAL_GNAR", "Weapon", 15f, "icons/gnarbig_r.png", (InterruptPriority)2, attackSpeedRestock: false, cancelSprint: false, (SkillDef)null);
			Assign(component.primary, MiniPrimary, "Primary");
			Assign(component.secondary, MiniSecondary, "Secondary");
			Assign(component.utility, MiniUtility, "Utility");
			Assign(component.special, MiniSpecial, "Special");
		}

		private static SkillDef Def<TState>(string name, string tokenBase, string machine, float cooldown, string icon, InterruptPriority priority, bool attackSpeedRestock = false, bool cancelSprint = false, SkillDef def = null) where TState : EntityState
		{
			//IL_0062: 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_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: 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)
			def = (Object.op_Implicit((Object)(object)def) ? def : ScriptableObject.CreateInstance<SkillDef>());
			def.skillName = name;
			((Object)def).name = name;
			def.skillNameToken = tokenBase + "_NAME";
			def.skillDescriptionToken = tokenBase + "_DESC";
			def.icon = GnarAssets.GetIcon(icon);
			def.activationState = new SerializableEntityStateType(typeof(TState));
			def.activationStateMachineName = machine;
			def.interruptPriority = priority;
			def.baseRechargeInterval = cooldown;
			def.baseMaxStock = 1;
			def.rechargeStock = 1;
			def.requiredStock = 1;
			def.stockToConsume = 1;
			def.beginSkillCooldownOnSkillEnd = false;
			def.cancelSprintingOnActivation = cancelSprint;
			def.canceledFromSprinting = false;
			def.isCombatSkill = true;
			def.mustKeyPress = false;
			def.attackSpeedBuffsRestockSpeed = attackSpeedRestock;
			def.keywordTokens = new string[0];
			ContentAddition.AddSkillDef(def);
			bool flag = default(bool);
			ContentAddition.AddEntityState(typeof(TState), ref flag);
			return def;
		}

		private static void Assign(GenericSkill slot, SkillDef def, string name)
		{
			//IL_0027: 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_0049: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			SkillFamily val = ScriptableObject.CreateInstance<SkillFamily>();
			((Object)val).name = "GnarBody" + name + "Family";
			Variant[] array = new Variant[1];
			Variant val2 = new Variant
			{
				skillDef = def
			};
			((Variant)(ref val2)).viewableNode = new Node(def.skillNameToken, false, (Node)null);
			array[0] = val2;
			val.variants = (Variant[])(object)array;
			val.defaultVariantIndex = 0u;
			slot._skillFamily = val;
			ContentAddition.AddSkillFamily(val);
		}
	}
	public class GnarTransformSkillDef : SkillDef
	{
		public override bool CanExecute(GenericSkill skillSlot)
		{
			if (((SkillDef)this).CanExecute(skillSlot) && Object.op_Implicit((Object)(object)skillSlot.characterBody))
			{
				return skillSlot.characterBody.GetBuffCount(GnarContent.RageBuff) >= 100;
			}
			return false;
		}

		public override bool IsReady(GenericSkill skillSlot)
		{
			if (((SkillDef)this).IsReady(skillSlot) && Object.op_Implicit((Object)(object)skillSlot.characterBody))
			{
				return skillSlot.characterBody.GetBuffCount(GnarContent.RageBuff) >= 100;
			}
			return false;
		}

		public override Sprite GetCurrentIcon(GenericSkill skillSlot)
		{
			Sprite icon;
			if (!Object.op_Implicit((Object)(object)skillSlot.characterBody) || skillSlot.characterBody.GetBuffCount(GnarContent.RageBuff) < 100)
			{
				icon = GnarAssets.GetIcon("icons/gnartransformtired.png");
				if (icon == null)
				{
					return base.icon;
				}
			}
			else
			{
				icon = base.icon;
			}
			return icon;
		}
	}
}
namespace GnarSurvivor.UI
{
	internal static class GnarSkinRow
	{
		[HarmonyPatch(typeof(LoadoutPanelController), "Rebuild")]
		internal static class SkinRowPatch
		{
			private static void Postfix(LoadoutPanelController __instance)
			{
				try
				{
					Wrap(__instance);
				}
				catch (Exception ex)
				{
					GnarPlugin.Log.LogWarning((object)("[ui] skin row wrap failed: " + ex.Message));
				}
			}
		}

		public static void Hook()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				new Harmony("com.woo.gnarsurvivor.skinrow").PatchAll(typeof(SkinRowPatch));
			}
			catch (Exception ex)
			{
				GnarPlugin.Log.LogWarning((object)("[ui] skin row patch failed: " + ex.Message));
			}
		}

		private static bool OtherScrollModLoaded()
		{
			foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos)
			{
				if (pluginInfo.Value.Metadata.GUID == "com.KingEnderBrine.ScrollableLobbyUI")
				{
					return true;
				}
			}
			return false;
		}

		private static void Wrap(LoadoutPanelController panel)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Expected O, but got Unknown
			//IL_0124: 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_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: 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)
			if (OtherScrollModLoaded())
			{
				return;
			}
			Transform val = null;
			foreach (Transform item in ((Component)panel).transform)
			{
				Transform val2 = item;
				Transform val3 = val2.Find("SlotLabel");
				LanguageTextMeshController val4 = (Object.op_Implicit((Object)(object)val3) ? ((Component)val3).GetComponent<LanguageTextMeshController>() : null);
				if (Object.op_Implicit((Object)(object)val4) && val4.token == "LOADOUT_SKIN")
				{
					val = val2;
					break;
				}
			}
			if (!Object.op_Implicit((Object)(object)val) || Object.op_Implicit((Object)(object)val.Find("GnarSkinScroll")))
			{
				return;
			}
			Transform obj = val.Find("ButtonContainer");
			RectTransform val5 = (RectTransform)(object)((obj is RectTransform) ? obj : null);
			if (Object.op_Implicit((Object)(object)val5) && ((Transform)val5).childCount > 12)
			{
				GameObject val6 = new GameObject("GnarSkinScroll", new Type[4]
				{
					typeof(RectTransform),
					typeof(RectMask2D),
					typeof(ScrollRect),
					typeof(SkinScroller)
				});
				RectTransform val7 = (RectTransform)val6.transform;
				((Transform)val7).SetParent(val, false);
				val7.anchorMin = val5.anchorMin;
				val7.anchorMax = val5.anchorMax;
				val7.pivot = val5.pivot;
				val7.anchoredPosition = val5.anchoredPosition;
				val7.sizeDelta = val5.sizeDelta;
				((Transform)val5).SetParent((Transform)(object)val7, false);
				val5.anchorMin = new Vector2(0f, 0f);
				val5.anchorMax = new Vector2(0f, 1f);
				val5.pivot = new Vector2(0f, 0.5f);
				val5.anchoredPosition = Vector2.zero;
				val5.sizeDelta = Vector2.zero;
				ContentSizeFitter obj2 = ((Component)val5).gameObject.AddComponent<ContentSizeFitter>();
				obj2.horizontalFit = (FitMode)2;
				obj2.verticalFit = (FitMode)0;
				Transform val8 = ((Transform)val5).Find("Spacer");
				if (Object.op_Implicit((Object)(object)val8))
				{
					((RectTransform)val8).sizeDelta = new Vector2(0f, 0f);
				}
				ScrollRect component = val6.GetComponent<ScrollRect>();
				component.viewport = val7;
				component.content = val5;
				component.horizontal = true;
				component.vertical = false;
				component.movementType = (MovementType)2;
				component.inertia = false;
				component.scrollSensitivity = 30f;
				component.horizontalNormalizedPosition = 0f;
				val6.GetComponent<SkinScroller>().Init(component);
				GnarPlugin.Log.LogInfo((object)$"[ui] skin row scrollable: {((Transform)val5).childCount - 1} skins");
			}
		}
	}
	public sealed class SkinScroller : MonoBehaviour, IScrollHandler, IEventSystemHandler
	{
		private ScrollRect scroll;

		public void Init(ScrollRect s)
		{
			scroll = s;
		}

		public void OnScroll(PointerEventData e)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)scroll))
			{
				ScrollRect obj = scroll;
				obj.horizontalNormalizedPosition += e.scrollDelta.y * 0.05f;
			}
		}

		private void Update()
		{
			//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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: 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_0109: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)scroll) || !Object.op_Implicit((Object)(object)scroll.content))
			{
				return;
			}
			EventSystem current = EventSystem.current;
			GameObject val = (Object.op_Implicit((Object)(object)current) ? current.currentSelectedGameObject : null);
			if (!Object.op_Implicit((Object)(object)val) || !val.transform.IsChildOf((Transform)(object)scroll.content))
			{
				return;
			}
			Rect rect = scroll.viewport.rect;
			float width = ((Rect)(ref rect)).width;
			rect = scroll.content.rect;
			float width2 = ((Rect)(ref rect)).width;
			if (!(width2 <= width))
			{
				Bounds val2 = RectTransformUtility.CalculateRelativeRectTransformBounds((Transform)(object)scroll.viewport, val.transform);
				float num = width * 0.5f;
				if (((Bounds)(ref val2)).min.x < 0f - num)
				{
					ScrollRect obj = scroll;
					obj.horizontalNormalizedPosition -= (0f - num - ((Bounds)(ref val2)).min.x) / (width2 - width);
				}
				else if (((Bounds)(ref val2)).max.x > num)
				{
					ScrollRect obj2 = scroll;
					obj2.horizontalNormalizedPosition += (((Bounds)(ref val2)).max.x - num) / (width2 - width);
				}
			}
		}
	}
}
namespace GnarSurvivor.States
{
	public abstract class GnarSkillState : BaseSkillState
	{
		protected GnarModelController gmc;

		protected float duration;

		private static readonly Collider[] overlapBuffer = (Collider[])(object)new Collider[16];

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			gmc = GnarModelController.Of(((EntityState)this).GetModelTransform());
		}

		protected void Anim(string clip, float seconds, float blend = 0.06f, float start = 0f)
		{
			if (Object.op_Implicit((Object)(object)gmc) && Object.op_Implicit((Object)(object)gmc.driver))
			{
				gmc.driver.PlayAction(clip, seconds, blend, start);
			}
		}

		protected void StopAnim()
		{
			if (Object.op_Implicit((Object)(object)gmc) && Object.op_Implicit((Object)(object)gmc.driver))
			{
				gmc.driver.CancelAction();
			}
		}

		protected Vector3 FlatAim()
		{
			//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_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 direction = ((Ray)(ref aimRay)).direction;
			direction.y = 0f;
			if (!(((Vector3)(ref direction)).sqrMagnitude < 0.01f))
			{
				return ((Vector3)(ref direction)).normalized;
			}
			return ((EntityState)this).transform.forward;
		}

		protected void Blast(Vector3 pos, float radius, float coefficient, DamageTypeCombo type, float force, float upForce, float proc = 1f)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: 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)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: 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_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: 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_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: 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_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: 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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			new BlastAttack
			{
				attacker = ((EntityState)this).gameObject,
				inflictor = ((EntityState)this).gameObject,
				teamIndex = ((BaseState)this).GetTeam(),
				position = pos,
				radius = radius,
				baseDamage = ((BaseState)this).damageStat * coefficient,
				baseForce = force,
				bonusForce = Vector3.up * upForce,
				crit = ((BaseState)this).RollCrit(),
				damageType = type,
				falloffModel = (FalloffModel)0,
				procCoefficient = proc,
				damageColorIndex = (DamageColorIndex)0,
				attackerFiltering = (AttackerFiltering)2
			}.Fire();
		}

		protected bool EnemyUnderfoot()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = ((EntityState)this).transform.position + Vector3.down * 0.75f;
			Collider[] array = overlapBuffer;
			LayerIndex entityPrecise = LayerIndex.entityPrecise;
			int num = Physics.OverlapSphereNonAlloc(val, 1f, array, LayerMask.op_Implicit(((LayerIndex)(ref entityPrecise)).mask), (QueryTriggerInteraction)2);
			for (int i = 0; i < num; i++)
			{
				HurtBox component = ((Component)overlapBuffer[i]).GetComponent<HurtBox>();
				if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent) && (Object)(object)component.healthComponent.body != (Object)(object)((EntityState)this).characterBody && FriendlyFireManager.ShouldSplashHitProceed(component.healthComponent, ((BaseState)this).GetTeam()))
				{
					return true;
				}
			}
			return false;
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
	public class GnarBoomerangThrow : GnarSkillState
	{
		private float fireTime;

		private bool fired;

		public override void OnEnter()
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			base.OnEnter();
			duration = Mathf.Max(0.3f, 0.62f / ((BaseState)this).attackSpeedStat);
			fireTime = duration * 0.3f;
			Anim("spell1", duration);
			((BaseState)this).StartAimMode(((BaseState)this).GetAimRay(), 1.5f, false);
			GnarAudio.Play("Play_sfx_Gnar_GnarQ_OnCast", voice: false, 0f, 0.9f);
			GnarAudio.Play("Play_vo_Gnar_GnarQ_cast3D", voice: true, 3.5f);
		}

		public override void FixedUpdate()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!fired && ((EntityState)this).fixedAge >= fireTime)
			{
				fired = true;
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					float num = 2.6f * (((EntityState)this).characterBody.HasBuff(GnarContent.HyperBuff) ? 1.5f : 1f);
					ProjectileManager.instance.FireProjectile(GnarProjectiles.Boomerang, ((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * 0.9f, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * num, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null);
					GnarAudio.Play("Play_sfx_Gnar_GnarQMissile_OnMissileLaunch", voice: false, 0f, 0.9f);
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class GnarHyper : GnarSkillState
	{
		public override void OnEnter()
		{
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			base.OnEnter();
			duration = 0.5f;
			Anim("idle_tantrum", duration);
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(GnarContent.HyperBuff, 5f);
			}
			GnarAudio.Play("Play_sfx_Gnar_GnarBasicAttack2_OnCast");
			GnarAudio.Play("Play_vo_Gnar_GnarBasicAttack2_cast3D", voice: true, 5f);
			GnarProjectiles.SpawnEffect(GnarProjectiles.LandImpact, ((EntityState)this).transform.position, 1.5f);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}
	}
	public class GnarHop : GnarSkillState
	{
		private bool bounced;

		private bool landed;

		private Vector3 dir;

		private float launchSpeed;

		protected virtual float Forward => 20f;

		protected virtual float Up => 15f;

		protected virtual float Radius => 3.6f;

		protected virtual float Coefficient => 1.8f;

		protected virtual DamageTypeCombo Type => DamageTypeCombo.GenericUtility;

		protected virtual string StartClip => "spell3_jump";

		protected virtual string BounceClip => "spell3_bounce";

		protected virtual string CastEvent => "Play_sfx_Gnar_GnarE_OnCast";

		protected virtual string CastVoice => "Play_vo_Gnar_GnarE_cast3D";

		protected virtual bool CanBounce => true;

		protected virtual float Force => 600f;

		public override void OnEnter()
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: 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_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: 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_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			base.OnEnter();
			duration = 2.2f;
			Anim(StartClip, 0.85f);
			if (((EntityState)this).isAuthority)
			{
				dir = ((((Vector3)(ref ((EntityState)this).inputBank.moveVector)).sqrMagnitude > 0.1f) ? ((Vector3)(ref ((EntityState)this).inputBank.moveVector)).normalized : FlatAim());
				dir.y = 0f;
				((Vector3)(ref dir)).Normalize();
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
				{
					((EntityState)this).characterDirection.forward = dir;
				}
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
				Vector3 velocity = ((EntityState)this).characterMotor.velocity;
				velocity.y = 0f;
				((EntityState)this).characterMotor.velocity = dir * Forward + velocity * 0.8f + Vector3.up * Up;
				Vector2 val = new Vector2(((EntityState)this).characterMotor.velocity.x, ((EntityState)this).characterMotor.velocity.z);
				launchSpeed = ((Vector2)(ref val)).magnitude;
				GnarAudio.Play(CastEvent);
				GnarAudio.Play(CastVoice, voice: true, 6f);
			}
		}

		public override void FixedUpdate()
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				if (!((EntityState)this).characterMotor.isGrounded && launchSpeed > 0.01f)
				{
					Vector3 velocity = ((EntityState)this).characterMotor.velocity;
					Vector2 val = new Vector2(velocity.x, velocity.z);
					float magnitude = ((Vector2)(ref val)).magnitude;
					if (magnitude < launchSpeed)
					{
						if (magnitude > 0.01f)
						{
							float num = launchSpeed / magnitude;
							velocity.x *= num;
							velocity.z *= num;
						}
						else
						{
							velocity.x = dir.x * launchSpeed;
							velocity.z = dir.z * launchSpeed;
						}
						((EntityState)this).characterMotor.velocity = velocity;
					}
				}
				if (((EntityState)this).fixedAge > 0.15f && ((EntityState)this).characterMotor.velocity.y < 0f && !bounced && CanBounce && EnemyUnderfoot())
				{
					bounced = true;
					((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
					((EntityState)this).characterMotor.velocity = new Vector3(((EntityState)this).characterMotor.velocity.x, Up * 1.05f, ((EntityState)this).characterMotor.velocity.z);
					Anim(BounceClip, 0.7f);
					GnarAudio.Play("Play_sfx_Gnar_GnarE_hit_friend");
					Blast(((EntityState)this).transform.position + Vector3.down * 0.6f, Radius, Coefficient, Type, Force, 0f);
					GnarProjectiles.SpawnEffect(GnarProjectiles.ExplosionQuick, ((EntityState)this).transform.position + Vector3.down * 0.6f, Radius * 0.5f);
					return;
				}
				if (((EntityState)this).fixedAge > 0.25f && ((EntityState)this).characterMotor.isGrounded && !landed)
				{
					landed = true;
					Land();
					((EntityState)this).outer.SetNextStateToMain();
					return;
				}
			}
			if (((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		protected virtual void Land()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			if (!bounced)
			{
				Blast(((EntityState)this).transform.position + Vector3.down * 0.6f, Radius * 0.85f, Coefficient * 0.5f, Type, Force * 0.5f, 0f);
				GnarProjectiles.SpawnEffect(GnarProjectiles.LandImpact, ((EntityState)this).transform.position + Vector3.down * 0.8f, Radius * 0.6f);
			}
		}

		public override void OnExit()
		{
			StopAnim();
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)7;
		}
	}
	public class GnarTransform : GnarSkillState
	{
		private bool done;

		public override void OnEnter()
		{
			base.OnEnter();
			duration = 1f;
			Anim("channel_wndup", duration);
			GnarAudio.Play("Play_sfx_Gnar_GnarR_OnCast");
			GnarAudio.Play("Play_vo_GnarBig_Attack2DGeneral", voice: true, 2f);
		}

		public override void FixedUpdate()
		{
			//IL_0019: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((EntityState)this).characterMotor.moveDirection = Vector3.zero;
			}
			if (!done && ((EntityState)this).fixedAge >= duration * 0.55f)
			{
				done = true;
				if (NetworkServer.active)
				{
					GnarRageController component = ((Component)((EntityState)this).characterBody).GetComponent<GnarRageController>();
					if (Object.op_Implicit((Object)(object)component))
					{
						component.ServerEnterMega();
					}
				}
				if (((EntityState)this).isAuthority)
				{
					Blast(((EntityState)this).transform.position, 10f, 3f, new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)32), (DamageTypeExtended)0, (DamageSource)8), 1800f, 600f);
				}
				GnarProjectiles.SpawnEffect(GnarProjectiles.ExplosionBig, ((EntityState)this).transform.position, 5f);
				GnarAudio.Play("Play_sfx_Gnar_GnarTransform_OnBuffActivate");
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)7;
		}
	}
	public class GnarBoulderToss : GnarSkillState
	{
		private float fireTime;

		private bool fired;

		public override void OnEnter()
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			base.OnEnter();
			duration = Mathf.Max(0.5f, 0.95f / ((BaseState)this).attackSpeedStat);
			fireTime = duration * 0.45f;
			Anim("spell1", duration);
			((BaseState)this).StartAimMode(((BaseState)this).GetAimRay(), 2f, false);
			if (Object.op_Implicit((Object)(object)gmc) && gmc.Active != null)
			{
				gmc.Active.SetPropVisible("rock", visible: true);
			}
			GnarAudio.Play("Play_sfx_Gnar_GnarBigQ_OnCast");
		}

		public override void FixedUpdate()
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: 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_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!fired && ((EntityState)this).fixedAge >= fireTime)
			{
				fired = true;
				if (Object.op_Implicit((Object)(object)gmc) && gmc.Active != null)
				{
					gmc.Active.SetPropVisible("rock", visible: false);
				}
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					Vector3 val = Quaternion.AngleAxis(-3f, Vector3.Cross(Vector3.up, ((Ray)(ref aimRay)).direction)) * ((Ray)(ref aimRay)).direction;
					ProjectileManager.instance.FireProjectile(GnarProjectiles.Boulder, ((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * 1.2f, Util.QuaternionSafeLookRotation(val), ((EntityState)this).gameObject, ((BaseState)this).damageStat * 5.6f, 1200f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null);
					GnarAudio.Play("Play_sfx_Gnar_GnarBigQ_OnMissileLaunch", voice: false, 0f, 1.1f);
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)gmc) && gmc.Active != null)
			{
				gmc.Active.SetPropVisible("rock", visible: false);
			}
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class GnarWallop : GnarSkillState
	{
		private bool hit;

		public override void OnEnter()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			base.OnEnter();
			duration = Mathf.Max(0.6f, 1f / ((BaseState)this).attackSpeedStat);
			Anim("spell2", duration);
			((BaseState)this).StartAimMode(((BaseState)this).GetAimRay(), 1.5f, true);
			GnarAudio.Play("Play_sfx_Gnar_GnarBigW_OnCast");
		}

		public override void FixedUpdate()
		{
			//IL_0019: 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_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: 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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: 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_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_009e: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((EntityState)this).characterMotor.moveDirection = Vector3.zero;
			}
			if (!hit && ((EntityState)this).fixedAge >= duration * 0.42f)
			{
				hit = true;
				Vector3 pos = ((EntityState)this).transform.position + FlatAim() * 4.5f + Vector3.up * 0.3f;
				if (((EntityState)this).isAuthority)
				{
					Blast(pos, 6.5f, 6f, new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)32), (DamageTypeExtended)0, (DamageSource)2), 2400f, 400f);
				}
				GnarProjectiles.SpawnEffect(GnarProjectiles.ExplosionQuick, pos, 2.2f);
				GnarAudio.Play("Play_sfx_Gnar_GnarBigW_hit2");
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)3;
		}
	}
	public class GnarCrunch : GnarHop
	{
		protected override float Forward => 14f;

		protected override float Up => 17f;

		protected override float Radius => 6.5f;

		protected override float Coefficient => 4.2f;

		protected override DamageTypeCombo Type => new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)8), (DamageTypeExtended)0, (DamageSource)4);

		protected override string StartClip => "spell3";

		protected override string BounceClip => "spell3";

		protected override bool CanBounce => false;

		protected override float Force => 2200f;

		protected override string CastEvent => "Play_sfx_Gnar_GnarBigE_OnCast";

		protected override string CastVoice => null;

		protected override void Land()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: 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_0057: 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_0066: Unknown result type (might be due to invalid IL or missing references)
			Blast(((EntityState)this).transform.position + Vector3.down * 0.8f, Radius, Coefficient, Type, Force, 500f);
			GnarProjectiles.SpawnEffect(GnarProjectiles.ExplosionBig, ((EntityState)this).transform.position + Vector3.down * 0.8f, Radius * 0.6f);
			GnarAudio.Play("Play_sfx_Gnar_GnarBigE_hit");
		}
	}
	public class GnarRoar : GnarSkillState
	{
		private bool done;

		public override void OnEnter()
		{
			base.OnEnter();
			duration = 1.05f;
			Anim("spell4", duration);
			GnarAudio.Play("Play_sfx_Gnar_GnarR_hit");
			GnarAudio.Play("Play_vo_GnarBig_Attack2DGeneral", voice: true, 2f);
		}

		public override void FixedUpdate()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((EntityState)this).characterMotor.moveDirection = Vector3.zero;
			}
			if (!done && ((EntityState)this).fixedAge >= duration * 0.4f)
			{
				done = true;
				if (((EntityState)this).isAuthority)
				{
					Blast(((EntityState)this).transform.position, 14f, 9f, new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)32), (DamageTypeExtended)0, (DamageSource)8), 3500f, 900f);
				}
				GnarProjectiles.SpawnEffect(GnarProjectiles.ExplosionBig, ((EntityState)this).transform.position, 7f);
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)7;
		}
	}
	public class GnarDeath : GenericCharacterDeath
	{
		public override void PlayDeathAnimation(float crossfadeDuration = 0.1f)
		{
			GnarAudio.Play("Play_vo_Gnar_Death3D", voice: true);
			GnarModelController gnarModelController = GnarModelController.Of(((EntityState)this).GetModelTransform());
			if (Object.op_Implicit((Object)(object)gnarModelController) && Object.op_Implicit((Object)(object)gnarModelController.driver))
			{
				gnarModelController.driver.PlayAction("death", -1f, 0.08f, 0f, null, thenLooping: true, loopAction: false, 9999f);
			}
		}
	}
}
namespace GnarSurvivor.Projectiles
{
	internal static class GnarProjectiles
	{
		public static GameObject Boomerang;

		public static GameObject Boulder;

		public static GameObject SlashImpact;

		public static GameObject ExplosionBig;

		public static GameObject ExplosionQuick;

		public static GameObject LandImpact;

		public static void Create()
		{
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: 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_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_030e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_0327: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_036a: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: Unknown result type (might be due to invalid IL or missing references)
			SlashImpact = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/OmniEffect/OmniImpactVFXSlash");
			ExplosionBig = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/ExplosionVFX");
			ExplosionQuick = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/OmniEffect/OmniExplosionVFXQuick");
			LandImpact = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/CharacterLandImpact");
			GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/FMJ"), "GnarBoomerangProjectile", true);
			for (int num = val.transform.childCount - 1; num >= 0; num--)
			{
				Transform child = val.transform.GetChild(num);
				if (((Object)child).name != "Hitbox")
				{
					Object.DestroyImmediate((Object)(object)((Component)child).gameObject);
				}
			}
			MeshFilter[] components = val.GetComponents<MeshFilter>();
			for (int i = 0; i < components.Length; i++)
			{
				Object.DestroyImmediate((Object)(object)components[i]);
			}
			ProjectileSimple component = val.GetComponent<ProjectileSimple>();
			if (Object.op_Implicit((Object)(object)component))
			{
				Object.DestroyImmediate((Object)(object)component);
			}
			Transform val2 = val.transform.Find("Hitbox");
			if (Object.op_Implicit((Object)(object)val2))
			{
				val2.localScale = new Vector3(1.5f, 0.6f, 1.5f);
			}
			SphereCollider component2 = val.GetComponent<SphereCollider>();
			if (Object.op_Implicit((Object)(object)component2))
			{
				((Collider)component2).isTrigger = true;
				component2.radius = 0.5f;
			}
			Rigidbody component3 = val.GetComponent<Rigidbody>();
			component3.useGravity = false;
			component3.isKinematic = false;
			component3.drag = 0f;
			component3.mass = 1f;
			ProjectileOverlapAttack component4 = val.GetComponent<ProjectileOverlapAttack>();
			component4.damageCoefficient = 1f;
			component4.resetInterval = -1f;
			component4.fireFrequency = 30f;
			component4.impactEffect = SlashImpact;
			component4.overlapProcCoefficient = 0.8f;
			component4.forceVector = Vector3.zero;
			component4.pushAwayForce = 100f;
			val.GetComponent<ProjectileDamage>().damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)8), (DamageTypeExtended)0, (DamageSource)1);
			ProjectileController component5 = val.GetComponent<ProjectileController>();
			component5.allowPrediction = false;
			component5.ghostPrefabAddress = new AssetReferenceT<GameObject>("");
			component5.ghostPrefab = MakeGhost("GnarBoomerangGhost", "boomerang", mega: false, 0.0045f, new Vector3(0f, 0f, 90f), Vector3.right * 900f);
			val.AddComponent<GnarBoomerangProjectile>();
			ContentAddition.AddProjectile(val);
			Boomerang = val;
			GameObject val3 = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/CommandoGrenadeProjectile"), "GnarBoulderProjectile", true);
			for (int num2 = val3.transform.childCount - 1; num2 >= 0; num2--)
			{
				Object.DestroyImmediate((Object)(object)((Component)val3.transform.GetChild(num2)).gameObject);
			}
			ApplyTorqueOnStart component6 = val3.GetComponent<ApplyTorqueOnStart>();
			if (Object.op_Implicit((Object)(object)component6))
			{
				Object.DestroyImmediate((Object)(object)component6);
			}
			ProjectileSimple component7 = val3.GetComponent<ProjectileSimple>();
			component7.lifetime = 5f;
			component7.desiredForwardSpeed = 58f;
			ProjectileImpactExplosion component8 = val3.GetComponent<ProjectileImpactExplosion>();
			((ProjectileExplosion)component8).blastRadius = 8f;
			((ProjectileExplosion)component8).blastDamageCoefficient = 1f;
			((ProjectileExplosion)component8).blastProcCoefficient = 1f;
			((ProjectileExplosion)component8).falloffModel = (FalloffModel)0;
			component8.impactEffect = ExplosionBig;
			component8.lifetime = 5f;
			component8.destroyOnEnemy = true;
			component8.destroyOnWorld = true;
			((ProjectileExplosion)component8).bonusBlastForce = new Vector3(0f, 600f, 0f);
			val3.GetComponent<ProjectileDamage>().damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)8), (DamageTypeExtended)0, (DamageSource)1);
			ProjectileController component9 = val3.GetComponent<ProjectileController>();
			component9.allowPrediction = false;
			component9.ghostPrefabAddress = new AssetReferenceT<GameObject>("");
			component9.ghostPrefab = MakeGhost("GnarBoulderGhost", "rock", mega: true, GnarPlugin.MegaUnitScale.Value * 1.6f, Vector3.zero, new Vector3(260f, 0f, 120f));
			val3.GetComponent<Rigidbody>().useGravity = true;
			ContentAddition.AddProjectile(val3);
			Boulder = val3;
		}

		private static GameObject MakeGhost(string name, string match, bool mega, float scale, Vector3 meshEuler, Vector3 spin)
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			//IL_0045: Expected O, but got Unknown
			GameObject val = new GameObject(name);
			val.AddComponent<ProjectileGhostController>();
			GnarProjectileGhost gnarProjectileGhost = val.AddComponent<GnarProjectileGhost>();
			gnarProjectileGhost.match = match;
			gnarProjectileGhost.mega = mega;
			gnarProjectileGhost.scale = scale;
			gnarProjectileGhost.meshEuler = meshEuler;
			gnarProjectileGhost.spin = spin;
			GameObject val2 = PrefabAPI.InstantiateClone(val, name, false);
			Object.Destroy((Object)val);
			GnarPlugin.Log.LogInfo((object)$"[ghost] built {name}: GnarProjectileGhost on prefab = {(Object)(object)val2.GetComponent<GnarProjectileGhost>() != (Object)null}");
			return val2;
		}

		public static void SpawnEffect(GameObject effect, Vector3 pos, float scale = 1f, Quaternion? rot = null)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: 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)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			if (Object.op_Implicit((Object)(object)effect))
			{
				EffectManager.SpawnEffect(effect, new EffectData
				{
					origin = pos,
					scale = scale,
					rotation = (Quaternion)(((??)rot) ?? Quaternion.identity)
				}, NetworkServer.active);
			}
		}
	}
	public sealed class GnarBoomerangProjectile : MonoBehaviour
	{
		public float outSpeed = 50f;

		public float outTime = 0.8f;

		public float returnSpeed = 52f;

		public float catchDist = 1.5f;

		public float maxLife = 5f;

		private Rigidbody rb;

		private ProjectileController pc;

		private ProjectileDamage dmg;

		private ProjectileOverlapAttack oa;

		private Vector3 dir;

		private float age;

		private bool returning;

		private void Start()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			rb = ((Component)this).GetComponent<Rigidbody>();
			pc = ((Component)this).GetComponent<ProjectileController>();
			dmg = ((Component)this).GetComponent<ProjectileDamage>();
			oa = ((Component)this).GetComponent<ProjectileOverlapAttack>();
			dir = ((Component)this).transform.forward;
			if (NetworkServer.active)
			{
				rb.velocity = dir * outSpeed;
			}
		}

		private void FixedUpdate()
		{
			//IL_004d: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: 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_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: 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_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active || (Object)(object)rb == (Object)null)
			{
				return;
			}
			age += Time.fixedDeltaTime;
			if (!returning)
			{
				float num = Mathf.Clamp01(age / outTime);
				rb.velocity = dir * (outSpeed * (1f - 0.9f * num * num));
				Vector3 position = ((Component)this).transform.position;
				Vector3 val = dir;
				float num2 = outSpeed * Time.fixedDeltaTime * 1.5f;
				LayerIndex world = LayerIndex.world;
				bool flag = Physics.Raycast(position, val, num2, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1);
				if (age >= outTime || flag)
				{
					returning = true;
					age = outTime;
					ProjectileDamage obj = dmg;
					obj.damage *= 0.61538464f;
					oa.ResetOverlapAttack();
					GnarAudio.Play("Play_sfx_Gnar_GnarQMissileReturn_OnMissileLaunch", voice: false, 0f, 0.8f);
				}
				return;
			}
			GameObject owner = pc.owner;
			if (!Object.op_Implicit((Object)(object)owner) || age > maxLife)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
				return;
			}
			Vector3 val2 = owner.transform.position + Vector3.up * 0.2f - ((Component)this).transform.position;
			float num3 = Mathf.Min(returnSpeed, 8f + (age - outTime) * 60f);
			rb.velocity = ((Vector3)(ref val2)).normalized * num3;
			if (((Vector3)(ref val2)).magnitude < catchDist)
			{
				Catch(owner);
			}
		}

		private void Catch(GameObject owner)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			CharacterBody component = owner.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.AddTimedBuff(GnarContent.CatchBuff, 0.3f);
				GnarRageController component2 = ((Component)component).GetComponent<GnarRageController>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					component2.Gain(4f);
				}
			}
			GnarProjectiles.SpawnEffect(GnarProjectiles.LandImpact, ((Component)this).transform.position, 0.6f);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
	public sealed class GnarProjectileGhost : MonoBehaviour
	{
		public string match;

		public bool mega;

		public float scale;

		public Vector3 meshEuler;

		public Vector3 spin;

		private Transform meshT;

		private float age;

		private bool built;

		private Vector3 spinAngle;

		private static bool loggedMesh;

		private void OnEnable()
		{
			age = 0f;
			built = false;
			GnarPlugin.Log.LogInfo((object)("[ghost] " + ((Object)this).name + " enabled"));
		}

		private void Update()
		{
			//IL_0047: 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_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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_006d: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			if (!built)
			{
				age += Time.deltaTime;
				built = Resolve() || age > 0.25f;
			}
			if (Object.op_Implicit((Object)(object)meshT))
			{
				spinAngle += spin * Time.deltaTime;
				meshT.localRotation = Quaternion.Euler(meshEuler) * Quaternion.Euler(spinAngle);
			}
		}

		private bool Resolve()
		{
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Expected O, but got Unknown
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: 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_0201: Unknown result type (might be due to invalid IL or missing references)
			ProjectileGhostController component = ((Component)this).GetComponent<ProjectileGhostController>();
			Transform val = (Object.op_Implicit((Object)(object)component) ? component.authorityTransform : null);
			ProjectileController val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent<ProjectileController>() : null);
			CharacterBody val3 = ((Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.owner)) ? val2.owner.GetComponent<CharacterBody>() : null);
			if (!Object.op_Implicit((Object)(object)val3) && age < 0.25f)
			{
				return false;
			}
			int skinListIndex = 0;
			GnarModelController gnarModelController = (Object.op_Implicit((Object)(object)val3) ? GnarModelController.Of(val3) : null);
			if (Object.op_Implicit((Object)(object)gnarModelController))
			{
				skinListIndex = Mathf.Max(0, gnarModelController.skinListIndex);
			}
			Material material;
			Mesh val4 = GnarAssets.BuildProp(skinListIndex, mega, match, scale, out material);
			if (!Object.op_Implicit((Object)(object)val4) && match == "rock")
			{
				val4 = GnarAssets.BuildRock(0.85f);
				material = GnarAssets.GetMaterial(null, "rock");
			}
			if (!loggedMesh)
			{
				loggedMesh = true;
				GnarPlugin.Log.LogInfo((object)("[prop] " + match + ": mesh " + (Object.op_Implicit((Object)(object)val4) ? (val4.vertexCount + " vert