Decompiled source of NemryReborn v0.1.0

plugins/NemryReborn/Nemry.Compatibility.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using EntityStates;
using EntityStates.Events;
using HG.BlendableTypes;
using MSU;
using Microsoft.CodeAnalysis;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using R2API;
using Rewired;
using RoR2;
using RoR2.CameraModes;
using RoR2.Navigation;
using SS2;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Nemry.Compatibility")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Nemry.Compatibility")]
[assembly: AssemblyTitle("Nemry.Compatibility")]
[assembly: AssemblyVersion("1.0.0.0")]
[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 NemryCompatibility
{
	public static class Emotes
	{
		private sealed class Pose : MonoBehaviour
		{
			private EntityState state;

			private Animator animator;

			private AnimatorCullingMode originalCulling;

			private string animationName;

			private int layer;

			private int animationHash;

			private bool restored;

			internal void Initialize(EntityState owner, Animator modelAnimator, string name)
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				state = owner;
				animator = modelAnimator;
				animationName = name;
				layer = animator.GetLayerIndex("FullBody, Override");
				animationHash = Animator.StringToHash(name);
				originalCulling = animator.cullingMode;
				animator.cullingMode = (AnimatorCullingMode)0;
				EnsureAnimation();
			}

			private void LateUpdate()
			{
				if (!restored)
				{
					if (state == null || !Object.op_Implicit((Object)(object)state.outer) || state.outer.state != state)
					{
						EndVisuals(state);
					}
					else
					{
						EnsureAnimation();
					}
				}
			}

			private void EnsureAnimation()
			{
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)animator) && layer >= 0 && animator.HasState(layer, animationHash))
				{
					AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(layer);
					if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).shortNameHash != animationHash)
					{
						animator.PlayInFixedTime(animationName, layer, 0f);
						animator.Update(0f);
					}
				}
			}

			internal void Restore()
			{
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				if (!restored)
				{
					restored = true;
					if (Object.op_Implicit((Object)(object)animator))
					{
						animator.cullingMode = originalCulling;
					}
				}
			}

			private void OnDestroy()
			{
				if (state != null)
				{
					poses.Remove(state);
				}
				Restore();
			}
		}

		private sealed class Playback : IDisposable
		{
			private readonly uint token;

			private readonly string eventName;

			private readonly GameObject emitter;

			private uint playingId;

			private volatile bool ended;

			private bool stopped;

			private float retryAt;

			private readonly EventCallback callback;

			internal Playback(uint token, string eventName, GameObject emitter)
			{
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Expected O, but got Unknown
				this.token = token;
				this.eventName = eventName;
				this.emitter = emitter;
				callback = new EventCallback(OnAudioEvent);
			}

			internal void Begin()
			{
				RoR2Application.onUpdate += Update;
				Post();
			}

			private void Post()
			{
				ended = false;
				playingId = AkSoundEngine.PostEvent(eventName, emitter, 1u, callback, (object)this);
				retryAt = Time.unscaledTime + 0.25f;
			}

			private void OnAudioEvent(object cookie, AkCallbackType type, AkCallbackInfo info)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Invalid comparison between Unknown and I4
				if ((int)type == 1 && !stopped)
				{
					ended = true;
				}
			}

			private void Update()
			{
				if (!Object.op_Implicit((Object)(object)emitter))
				{
					Stop(token);
				}
				else if ((ended || playingId == 0) && Time.unscaledTime >= retryAt)
				{
					Post();
				}
			}

			public void Dispose()
			{
				stopped = true;
				RoR2Application.onUpdate -= Update;
				if (playingId != 0)
				{
					AkSoundEngine.StopPlayingID(playingId);
				}
				playingId = 0u;
			}
		}

		private static readonly Dictionary<KeyCode, int> consumedFrames = new Dictionary<KeyCode, int>();

		private static readonly Dictionary<uint, Playback> sessions = new Dictionary<uint, Playback>();

		private static uint nextToken;

		private static readonly Dictionary<EntityState, Pose> poses = new Dictionary<EntityState, Pose>();

		public static void ReturnToMainIfAuthority(EntityStateMachine machine)
		{
			if (Object.op_Implicit((Object)(object)machine) && Util.HasEffectiveAuthority(machine.networkIdentity))
			{
				machine.SetNextStateToMain();
			}
		}

		public static void SetLayerWeightIfPresent(Animator animator, int layer, float weight)
		{
			if (Object.op_Implicit((Object)(object)animator) && layer >= 0)
			{
				animator.SetLayerWeight(layer, weight);
			}
		}

		public static void BeginVisuals(EntityState state, Animator animator, string animationName)
		{
			if (Object.op_Implicit((Object)(object)animator))
			{
				EndVisuals(state);
				Pose pose = ((Component)state.outer).gameObject.AddComponent<Pose>();
				poses.Add(state, pose);
				pose.Initialize(state, animator, animationName);
			}
		}

		public static void EndVisuals(EntityState state)
		{
			if (poses.TryGetValue(state, out var value))
			{
				poses.Remove(state);
				if (Object.op_Implicit((Object)(object)value))
				{
					value.Restore();
					Object.Destroy((Object)(object)value);
				}
			}
		}

		public static bool GetKeyDownOnce(KeyCode key)
		{
			//IL_0000: 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_0026: Unknown result type (might be due to invalid IL or missing references)
			if (!Input.GetKeyDown(key) || (consumedFrames.TryGetValue(key, out var value) && value == Time.frameCount))
			{
				return false;
			}
			consumedFrames[key] = Time.frameCount;
			return true;
		}

		public static uint Play(string eventName, GameObject emitter)
		{
			if (string.IsNullOrEmpty(eventName) || !Object.op_Implicit((Object)(object)emitter))
			{
				return 0u;
			}
			uint num = ++nextToken;
			Playback playback = new Playback(num, eventName, emitter);
			sessions.Add(num, playback);
			playback.Begin();
			return num;
		}

		public static void Stop(uint token)
		{
			if (sessions.TryGetValue(token, out var value))
			{
				sessions.Remove(token);
				value.Dispose();
			}
		}
	}
	public static class Runtime
	{
		private sealed class AimState
		{
			public AimRequest Request;
		}

		private static readonly ConditionalWeakTable<CameraTargetParams, AimState> AimStates = new ConditionalWeakTable<CameraTargetParams, AimState>();

		private static readonly MethodInfo InputCheck = typeof(PlayerCharacterMasterController).GetMethod("CanSendBodyInput", BindingFlags.Static | BindingFlags.NonPublic);

		[MethodImpl(MethodImplOptions.NoInlining)]
		public static void RegisterNemesis(GameObject master, ItemDef reward, string musicEvent)
		{
			StarstormBridge.Register(master, reward, musicEvent);
		}

		public static CharacterCameraParams SynchronizeLegacyCameraParams(CharacterCameraParams camera)
		{
			//IL_000c: 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_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			camera.data.minPitch = BlendableFloat.op_Implicit(camera.minPitch);
			camera.data.maxPitch = BlendableFloat.op_Implicit(camera.maxPitch);
			camera.data.wallCushion = BlendableFloat.op_Implicit(camera.wallCushion);
			camera.data.pivotVerticalOffset = BlendableFloat.op_Implicit(camera.pivotVerticalOffset);
			camera.data.idealLocalCameraPos = BlendableVector3.op_Implicit(camera.standardLocalCameraPos);
			return camera;
		}

		public static Material LoadMercSwipe()
		{
			//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)
			return Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Merc/matMercSwipe1.mat").WaitForCompletion());
		}

		public static void SetAimMode(CameraTargetParams camera, AimType type)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			AimState orCreateValue = AimStates.GetOrCreateValue(camera);
			AimRequest request = orCreateValue.Request;
			if (request != null)
			{
				request.Dispose();
			}
			orCreateValue.Request = (((int)type == 0) ? null : camera.RequestAimType(type));
		}

		public static AimType GetAimMode(CameraTargetParams camera)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			if (!AimStates.TryGetValue(camera, out var value) || value.Request == null)
			{
				return (AimType)0;
			}
			return value.Request.aimType;
		}

		public static void SetIdealCameraPosition(CameraTargetParams camera, Vector3 position)
		{
			//IL_000b: 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)
			camera.currentCameraParamsData.idealLocalCameraPos.value = position;
		}

		public static Vector3 GetIdealCameraPosition(CameraTargetParams camera)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			return camera.currentCameraParamsData.idealLocalCameraPos.value;
		}

		public static void InitializeTemporaryOverlays(CharacterModel model, List<TemporaryOverlay> overlays)
		{
			if (overlays.Count != 0)
			{
				throw new InvalidOperationException("Unexpected nonempty legacy overlay initialization");
			}
		}

		public static bool CanSendBodyInput(NetworkUser user, out LocalUser local, out Player player, out CameraRigController camera)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Expected O, but got Unknown
			object[] array = new object[5] { user, null, null, null, false };
			bool num = (bool)InputCheck.Invoke(null, array);
			local = (LocalUser)array[1];
			player = (Player)array[2];
			camera = (CameraRigController)array[3];
			if (num)
			{
				return !(bool)array[4];
			}
			return false;
		}

		public static void SetPitchYawFromLookVector(CameraRigController rig, Vector3 look)
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			CameraModeBase cameraMode = rig.cameraMode;
			Type type = ((object)cameraMode).GetType();
			MethodInfo? method = type.GetMethod("DebugGetInstanceData", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			if (method == null)
			{
				throw new MissingMethodException(type.FullName, "DebugGetInstanceData");
			}
			object obj = method.Invoke(cameraMode, new object[1] { rig });
			obj.GetType().GetMethod("SetPitchYawFromLookVector", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).Invoke(obj, new object[1] { look });
		}
	}
	public static class Standalone
	{
		private static Hook preferenceHook;

		public static void Initialize()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Expected O, but got Unknown
			if (preferenceHook != null)
			{
				throw new InvalidOperationException("Standalone support initialized twice");
			}
			preferenceHook = new Hook((MethodBase)typeof(UserProfile).GetMethod("GetSurvivorPreference"), (Delegate)new Func<Func<UserProfile, SurvivorDef>, UserProfile, SurvivorDef>(GetPreference));
		}

		private static SurvivorDef GetPreference(Func<UserProfile, SurvivorDef> original, UserProfile profile)
		{
			SurvivorDef val = original(profile);
			if (!Object.op_Implicit((Object)(object)val))
			{
				return SurvivorCatalog.defaultSurvivor;
			}
			return val;
		}

		public static GameObject LoadFootstepDust()
		{
			//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)
			GameObject obj = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/GenericFootstepDust.prefab").WaitForCompletion();
			if (!Object.op_Implicit((Object)(object)obj))
			{
				throw new InvalidOperationException("Current GenericFootstepDust asset missing");
			}
			return obj;
		}

		public static void AddNemryToken(string token, string text)
		{
			if (token.StartsWith("ROB_NEMRY_", StringComparison.Ordinal))
			{
				LanguageAPI.Add(token, text);
			}
		}

		public static AssetBundle LoadAssetBundle(Stream stream)
		{
			using MemoryStream memoryStream = new MemoryStream();
			stream.CopyTo(memoryStream);
			AssetBundle obj = AssetBundle.LoadFromMemory(memoryStream.ToArray());
			if (!Object.op_Implicit((Object)(object)obj))
			{
				throw new InvalidOperationException("Nemry isolated asset bundle failed to load");
			}
			return obj;
		}

		public static void IsolateCatalogNames(Type pluginType)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Expected O, but got Unknown
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Expected O, but got Unknown
			Assembly assembly = pluginType.Assembly;
			HashSet<Object> renamed = new HashSet<Object>();
			foreach (BuffDef item in Values("Buffs", "buffDefs"))
			{
				Rename((Object)item);
			}
			foreach (GameObject item2 in Values("Prefabs", "projectilePrefabs"))
			{
				Rename((Object)item2);
			}
			foreach (NetworkSoundEventDef item3 in Values("Assets", "networkSoundEventDefs"))
			{
				Rename((Object)item3);
			}
			foreach (EffectDef item4 in Values("Assets", "effectDefs"))
			{
				EffectDef val = item4;
				Rename((Object)(object)val.prefab);
				typeof(EffectDef).GetProperty("prefabName").GetSetMethod(nonPublic: true).Invoke(val, new object[1] { ((Object)val.prefab).name });
			}
			void Rename(Object asset)
			{
				if (Object.op_Implicit(asset) && renamed.Add(asset))
				{
					asset.name = "OatmealNemryReborn_" + asset.name;
				}
			}
			IEnumerable Values(string typeName, string fieldName)
			{
				return (IEnumerable)assembly.GetType("NemryReborn.Modules." + typeName, throwOnError: true).GetField(fieldName, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).GetValue(null);
			}
		}
	}
	public static class StarstormBridge
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Action <0>__FinishRegistration;

			public static Manipulator <1>__RewriteEligibility;

			public static Action<Run> <2>__ResetInvasionProgress;

			public static Action<CharacterBody> <3>__BodyStarted;

			public static Action<Action<GenericNemesisEvent>, GenericNemesisEvent> <4>__SpawnBoss;

			public static Action<Action<GenericNemesisEvent>, GenericNemesisEvent> <5>__BossDied;

			public static Action<Action<GameplayEventTextController, EventTextRequest, bool>, GameplayEventTextController, EventTextRequest, bool> <6>__QueueEventText;
		}

		private static GameObject master;

		private static ItemDef reward;

		private static string musicEvent;

		private static NemesisSpawnCard card;

		private static Hook spawnHook;

		private static Hook deathHook;

		private static Hook eventTextHook;

		private static ILHook eligibilityHook;

		private static bool nemryDefeatedThisRun;

		private static bool broadcastNextNemryEnd;

		private static NemryMusicTrack music;

		private static readonly FieldInfo CatalogField = typeof(NemesisCatalog).GetField("allSpawnCards", BindingFlags.Static | BindingFlags.NonPublic);

		private static readonly FieldInfo MusicOverrideField = typeof(GenericNemesisEvent).GetField("musicTrack", BindingFlags.Instance | BindingFlags.NonPublic);

		internal static void Register(GameObject originalMaster, ItemDef originalReward, string originalMusicEvent)
		{
			if (Object.op_Implicit((Object)(object)master))
			{
				throw new InvalidOperationException("Nemry invasion registered twice");
			}
			master = originalMaster;
			reward = originalReward;
			musicEvent = originalMusicEvent;
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(FinishRegistration));
		}

		private static void FinishRegistration()
		{
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Expected O, but got Unknown
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Expected O, but got Unknown
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Expected O, but got Unknown
			//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Expected O, but got Unknown
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Expected O, but got Unknown
			if (!Object.op_Implicit((Object)(object)reward))
			{
				reward = Items.ShinyPearl;
			}
			if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)reward))
			{
				throw new InvalidOperationException("Original Nemry invasion data missing");
			}
			NemesisSpawnCard[] array = NemesisCatalog.readonlySpawnCards ?? throw new InvalidOperationException("SS2 NemesisCatalog not initialized");
			NemesisSpawnCard val = ((IEnumerable<NemesisSpawnCard>)array).FirstOrDefault((Func<NemesisSpawnCard, bool>)((NemesisSpawnCard c) => Object.op_Implicit((Object)(object)c) && Object.op_Implicit((Object)(object)c.nemesisInventory)));
			if (!Object.op_Implicit((Object)(object)val))
			{
				throw new InvalidOperationException("SS2 has no initialized Nemesis inventory template");
			}
			if (array.Any((NemesisSpawnCard c) => Object.op_Implicit((Object)(object)c) && (Object)(object)((SpawnCard)c).prefab == (Object)(object)master))
			{
				throw new InvalidOperationException("Nemry invasion already in SS2 catalog");
			}
			card = ScriptableObject.CreateInstance<NemesisSpawnCard>();
			((Object)card).name = "cscOriginalNemryInvasion";
			((SpawnCard)card).prefab = master;
			CharacterBody component = master.GetComponent<CharacterMaster>().bodyPrefab.GetComponent<CharacterBody>();
			((SpawnCard)card).hullSize = component.hullClassification;
			((SpawnCard)card).nodeGraphType = (GraphType)(component.isFlying ? 1 : 0);
			card.itemDef = reward;
			card.nemesisInventory = val.nemesisInventory;
			card.skillOverrides = Array.Empty<SkillOverride>();
			card.statModifiers = Array.Empty<StatModifier>();
			card.useOverrideState = false;
			card.visualEffect = val.visualEffect;
			CatalogField.SetValue(null, array.Concat((IEnumerable<NemesisSpawnCard>)(object)new NemesisSpawnCard[1] { card }).ToArray());
			MethodInfo? method = typeof(EventDirector).GetMethod("TryAddNemesisInvader");
			object obj = <>O.<1>__RewriteEligibility;
			if (obj == null)
			{
				Manipulator val2 = RewriteEligibility;
				<>O.<1>__RewriteEligibility = val2;
				obj = (object)val2;
			}
			eligibilityHook = new ILHook((MethodBase)method, (Manipulator)obj);
			Run.onRunStartGlobal += ResetInvasionProgress;
			Run.onRunDestroyGlobal += ResetInvasionProgress;
			music = ScriptableObject.CreateInstance<NemryMusicTrack>();
			((MusicTrackDef)music).cachedName = "OriginalNemryBossTheme";
			music.EventName = musicEvent;
			CharacterBody.onBodyStartGlobal += BodyStarted;
			spawnHook = new Hook((MethodBase)typeof(GenericNemesisEvent).GetMethod("SpawnNemesisBoss"), (Delegate)new Action<Action<GenericNemesisEvent>, GenericNemesisEvent>(SpawnBoss));
			deathHook = new Hook((MethodBase)typeof(GenericNemesisEvent).GetMethod("OnBodyDeath"), (Delegate)new Action<Action<GenericNemesisEvent>, GenericNemesisEvent>(BossDied));
			eventTextHook = new Hook((MethodBase)typeof(GameplayEventTextController).GetMethod("EnqueueNewTextRequest"), (Delegate)new Action<Action<GameplayEventTextController, EventTextRequest, bool>, GameplayEventTextController, EventTextRequest, bool>(QueueEventText));
		}

		private static void ResetInvasionProgress(Run run)
		{
			nemryDefeatedThisRun = false;
		}

		private static void RewriteEligibility(ILContext context)
		{
			//IL_0048: 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)
			Instruction[] array = ((IEnumerable<Instruction>)context.Body.Instructions).Where(delegate(Instruction i)
			{
				//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)
				if (i.OpCode == OpCodes.Ldfld)
				{
					object operand = i.Operand;
					FieldReference val = (FieldReference)((operand is FieldReference) ? operand : null);
					if (val != null && ((MemberReference)((MemberReference)val).DeclaringType).FullName == "SS2.NemesisSpawnCard" && ((MemberReference)val).Name == "itemDef")
					{
						Instruction next = i.Next;
						object obj2 = ((next != null) ? next.Operand : null);
						MethodReference val2 = (MethodReference)((obj2 is MethodReference) ? obj2 : null);
						if (val2 != null && ((MemberReference)((MemberReference)val2).DeclaringType).FullName == "SS2.SS2Util" && ((MemberReference)val2).Name == "GetItemCountForPlayers")
						{
							return val2.Parameters.Count == 1;
						}
					}
				}
				return false;
			}).ToArray();
			if (array.Length != 1)
			{
				throw new InvalidOperationException("SS2 invasion reward-check shape changed; refusing broad eligibility patch");
			}
			Instruction obj = array[0];
			obj.OpCode = OpCodes.Nop;
			obj.Operand = null;
			obj.Next.OpCode = OpCodes.Call;
			obj.Next.Operand = ((MemberReference)context.Method).Module.ImportReference((MethodBase)typeof(StarstormBridge).GetMethod("CountInvasionCompletion"));
		}

		public static int CountInvasionCompletion(NemesisSpawnCard candidate)
		{
			if ((Object)(object)candidate == (Object)(object)card)
			{
				return nemryDefeatedThisRun ? 1 : 0;
			}
			return SS2Util.GetItemCountForPlayers(candidate.itemDef);
		}

		private static void BodyStarted(CharacterBody body)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)body) && body.bodyIndex == BodyCatalog.FindBodyIndex("NemryInvasionBody") && !Object.op_Implicit((Object)(object)((Component)body).GetComponent<NemryBossPresentation>()))
			{
				((Component)body).gameObject.AddComponent<NemryBossPresentation>().Initialize((MusicTrackDef)(object)music);
			}
		}

		private static void BossDied(Action<GenericNemesisEvent> original, GenericNemesisEvent encounter)
		{
			bool flag = Object.op_Implicit((Object)(object)encounter.spawnCard) && (Object)(object)((SpawnCard)encounter.spawnCard).prefab == (Object)(object)master;
			GameObject gameObject = ((Component)((EntityState)encounter).outer).gameObject;
			bool flag2 = broadcastNextNemryEnd;
			broadcastNextNemryEnd = flag && NetworkServer.active;
			try
			{
				original(encounter);
			}
			finally
			{
				broadcastNextNemryEnd = flag2;
			}
			if (flag && NetworkServer.active)
			{
				nemryDefeatedThisRun = true;
			}
			if (flag && NetworkServer.active && Object.op_Implicit((Object)(object)gameObject))
			{
				NetworkServer.Destroy(gameObject);
			}
		}

		private static void QueueEventText(Action<GameplayEventTextController, EventTextRequest, bool> original, GameplayEventTextController controller, EventTextRequest request, bool sendOverNetwork)
		{
			//IL_000e: 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)
			bool flag = broadcastNextNemryEnd && NetworkServer.active && request.eventToken == "SS2_EVENT_GENERICNEMESIS_END";
			if (flag)
			{
				broadcastNextNemryEnd = false;
			}
			original(controller, request, sendOverNetwork || flag);
		}

		private static void SpawnBoss(Action<GenericNemesisEvent> original, GenericNemesisEvent encounter)
		{
			int num;
			if (Object.op_Implicit((Object)(object)encounter.spawnCard))
			{
				num = (((Object)(object)((SpawnCard)encounter.spawnCard).prefab == (Object)(object)master) ? 1 : 0);
				if (num != 0)
				{
					encounter.mainTrack = (MusicTrackDef)(object)music;
					object value = MusicOverrideField.GetValue(encounter);
					value?.GetType().GetField("track").SetValue(value, music);
				}
			}
			else
			{
				num = 0;
			}
			original(encounter);
			if (num != 0 && !Object.op_Implicit((Object)(object)encounter.nemesisBossBody))
			{
				throw new InvalidOperationException("SS2 failed to spawn registered Nemry invasion");
			}
		}
	}
	internal sealed class NemryBossPresentation : MonoBehaviour
	{
		private MusicTrackOverride musicOverride;

		private bool stopped;

		internal void Initialize(MusicTrackDef track)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			int num = 0;
			MusicTrackOverride[] array = Object.FindObjectsOfType<MusicTrackOverride>();
			foreach (MusicTrackOverride val in array)
			{
				num = Math.Max(num, val.priority);
			}
			GameObject val2 = new GameObject("Nemry local boss music");
			val2.transform.SetParent(((Component)this).transform, false);
			musicOverride = val2.AddComponent<MusicTrackOverride>();
			musicOverride.track = track;
			musicOverride.priority = num + 1;
		}

		private void Update()
		{
			HealthComponent component = ((Component)this).GetComponent<HealthComponent>();
			if (Object.op_Implicit((Object)(object)component) && !component.alive)
			{
				StopPresentation();
			}
		}

		private void StopPresentation()
		{
			if (!stopped)
			{
				stopped = true;
				if (Object.op_Implicit((Object)(object)musicOverride))
				{
					Object.Destroy((Object)(object)((Component)musicOverride).gameObject);
				}
			}
		}

		private void OnDestroy()
		{
			StopPresentation();
		}
	}
	internal sealed class NemryMusicTrack : MusicTrackDef
	{
		internal string EventName;

		private uint playingId;

		private float lastVolume = -1f;

		public override void Play()
		{
			((MusicTrackDef)this).Stop();
			playingId = Util.PlaySound(EventName, ((Component)MusicController.Instance).gameObject);
			RefreshVolume();
			RoR2Application.onUpdate += RefreshVolume;
		}

		private void RefreshVolume()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Invalid comparison between Unknown and I4
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Invalid comparison between Unknown and I4
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			if (playingId == 0)
			{
				return;
			}
			int num = 1;
			float num2 = default(float);
			if ((int)AkSoundEngine.GetRTPCValue("Volume_Master", ulong.MaxValue, 0u, ref num2, ref num) != 1)
			{
				return;
			}
			num = 1;
			float num3 = default(float);
			if ((int)AkSoundEngine.GetRTPCValue("Volume_MSX", ulong.MaxValue, 0u, ref num3, ref num) == 1)
			{
				float num4 = ((num2 > 0f) ? Mathf.Clamp(num3 / num2 * 100f, 0f, 100f) : 0f);
				if (!Mathf.Approximately(lastVolume, num4))
				{
					AkSoundEngine.SetRTPCValueByPlayingID("Volume_MSX", num4, playingId);
					lastVolume = num4;
				}
			}
		}

		public override void Stop()
		{
			RoR2Application.onUpdate -= RefreshVolume;
			if (playingId != 0)
			{
				AkSoundEngine.StopPlayingID(playingId);
			}
			playingId = 0u;
			lastVolume = -1f;
		}
	}
}

plugins/NemryReborn/NemryReborn.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AncientScepter;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.ClayBruiser.Weapon;
using EntityStates.Commando;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.Croco;
using EntityStates.Engi.EngiWeapon;
using EntityStates.GolemMonster;
using EntityStates.Huntress;
using EntityStates.ImpMonster;
using EntityStates.LemurianBruiserMonster;
using EntityStates.Mage;
using EntityStates.Merc;
using EntityStates.NullifierMonster;
using HG;
using JetBrains.Annotations;
using KinematicCharacterController;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using NemryCompatibility;
using NemryReborn.Modules;
using NemryReborn.Modules.Achievements;
using NemryReborn.Modules.Components;
using NemryReborn.Modules.Enemies;
using NemryReborn.Modules.Misc;
using NemryReborn.Modules.Survivors;
using NemryReborn.SkillStates;
using NemryReborn.SkillStates.BaseStates;
using NemryReborn.SkillStates.Bazooka;
using NemryReborn.SkillStates.Bazooka.Scepter;
using NemryReborn.SkillStates.Emotes;
using NemryReborn.SkillStates.Henry;
using NemryReborn.SkillStates.Henry.Frenzy;
using NemryReborn.SkillStates.Henry.Frenzy.Scepter;
using NemryReborn.SkillStates.Henry.Shotgun;
using NemryReborn.SkillStates.MrGreen;
using NemryReborn.SkillStates.Nemry;
using NemryReborn.SkillStates.Nemry.Beam;
using NemryReborn.SkillStates.Nemry.ChargeSlash;
using NemryReborn.SkillStates.Nemry.Stab;
using NemryReborn.SkillStates.Nemry.Torrent;
using NemryReborn.SkillStates.Stinger;
using On.RoR2;
using On.RoR2.UI;
using R2API;
using R2API.Utils;
using Rewired;
using Rewired.Data;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Navigation;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("HenryMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Nemry Reborn")]
[assembly: AssemblyTitle("Nemry Reborn")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
internal class BodyInfo
{
	internal string bodyName = "";

	internal string bodyNameToken = "";

	internal string subtitleNameToken = "";

	internal Texture characterPortrait = null;

	internal GameObject crosshair = null;

	internal GameObject podPrefab = null;

	internal float maxHealth = 100f;

	internal float healthGrowth = 2f;

	internal float healthRegen = 0f;

	internal float shield = 0f;

	internal float shieldGrowth = 0f;

	internal float moveSpeed = 7f;

	internal float moveSpeedGrowth = 0f;

	internal float acceleration = 80f;

	internal float jumpPower = 15f;

	internal float jumpPowerGrowth = 0f;

	internal float damage = 12f;

	internal float attackSpeed = 1f;

	internal float attackSpeedGrowth = 0f;

	internal float armor = 0f;

	internal float armorGrowth = 0f;

	internal float crit = 1f;

	internal float critGrowth = 0f;

	internal int jumpCount = 1;

	internal Color bodyColor = Color.grey;

	internal Vector3 aimOriginPosition = new Vector3(0f, 1.8f, 0f);

	internal Vector3 modelBasePosition = new Vector3(0f, -0.92f, 0f);

	internal Vector3 cameraPivotPosition = new Vector3(0f, 1.6f, 0f);
}
internal class CustomRendererInfo
{
	internal string childName;

	internal Material material;

	internal bool ignoreOverlays;
}
internal class SkillDefInfo
{
	public string skillName;

	public string skillNameToken;

	public string skillDescriptionToken;

	public Sprite skillIcon;

	public SerializableEntityStateType activationState;

	public string activationStateMachineName;

	public int baseMaxStock;

	public float baseRechargeInterval;

	public bool beginSkillCooldownOnSkillEnd;

	public bool canceledFromSprinting;

	public bool forceSprintDuringState;

	public bool fullRestockOnAssign;

	public InterruptPriority interruptPriority;

	public bool resetCooldownTimerOnUse;

	public bool isCombatSkill;

	public bool mustKeyPress;

	public bool cancelSprintingOnActivation;

	public int rechargeStock;

	public int requiredStock;

	public int stockToConsume;

	public string[] keywordTokens;
}
namespace NemryReborn
{
	[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.oatmeal.NemryReborn", "Nemry Reborn", "0.1.0")]
	[R2APISubmoduleDependency(new string[] { "PrefabAPI", "LanguageAPI", "SoundAPI" })]
	public class HenryPlugin : BaseUnityPlugin
	{
		public const string MODUID = "com.oatmeal.NemryReborn";

		public const string MODNAME = "Nemry Reborn";

		public const string MODVERSION = "0.1.0";

		public const string developerPrefix = "ROB";

		public static bool starstormInstalled = false;

		public static bool scepterInstalled = false;

		public static HenryPlugin instance;

		internal static CharacterCameraParams defaultCameraParams;

		internal static CharacterCameraParams zoomInCameraParams;

		internal static CharacterCameraParams emoteCameraParams;

		private void Awake()
		{
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			Standalone.Initialize();
			instance = this;
			if (Chainloader.PluginInfos.ContainsKey("com.TeamMoonstorm.Starstorm2"))
			{
				starstormInstalled = true;
			}
			if (Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter"))
			{
				scepterInstalled = true;
			}
			defaultCameraParams = NewCameraParams("ccpHenryDefault", 70f, 1.37f, new Vector3(0f, 0f, -10f));
			zoomInCameraParams = NewCameraParams("ccpHenryZoomIn", 70f, 1.37f, new Vector3(0f, -1f, -5.5f));
			emoteCameraParams = NewCameraParams("ccpHenryEmote", 70f, 1.37f, new Vector3(0f, -1.4f, -6f));
			Assets.Initialize();
			Config.ReadConfig();
			States.RegisterStates();
			Buffs.RegisterBuffs();
			Projectiles.RegisterProjectiles();
			Tokens.AddTokens();
			ItemDisplays.PopulateDisplays();
			new Nemry().CreateCharacter();
			Standalone.IsolateCatalogNames(typeof(HenryPlugin));
			new ContentPacks().Initialize();
			Hook();
			ContentManager.onContentPacksAssigned += LateSetup;
		}

		private void LateSetup(ReadOnlyArray<ReadOnlyContentPack> obj)
		{
		}

		private static CharacterCameraParams NewCameraParams(string name, float pitch, float pivotVerticalOffset, Vector3 standardPosition)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			return NewCameraParams(name, pitch, pivotVerticalOffset, standardPosition, 0.1f);
		}

		private static CharacterCameraParams NewCameraParams(string name, float pitch, float pivotVerticalOffset, Vector3 standardPosition, float wallCushion)
		{
			//IL_0036: 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)
			CharacterCameraParams val = ScriptableObject.CreateInstance<CharacterCameraParams>();
			val.maxPitch = pitch;
			val.minPitch = 0f - pitch;
			val.pivotVerticalOffset = pivotVerticalOffset;
			val.standardLocalCameraPos = standardPosition;
			val.wallCushion = wallCushion;
			CharacterCameraParams val2 = val;
			return Runtime.SynchronizeLegacyCameraParams(val2);
		}

		private void Hook()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self))
			{
				if (self.HasBuff(Buffs.armorBuff))
				{
					self.armor += 300f;
				}
				if (self.HasBuff(Buffs.frenzyBuff))
				{
					self.attackSpeed += 5f;
					self.moveSpeed += 5f;
					self.regen += 8f;
				}
				if (self.HasBuff(Buffs.frenzyScepterBuff))
				{
					self.attackSpeed += 6f;
					self.moveSpeed += 8f;
					self.regen += 12f;
					self.armor += 100f;
				}
			}
		}
	}
}
namespace NemryReborn.SkillStates
{
	public class FistBarrage : BaseMeleeAttack
	{
		private HenryFuryComponent furyComponent;

		public override void OnEnter()
		{
			//IL_002f: 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_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			furyComponent = ((EntityState)this).gameObject.GetComponent<HenryFuryComponent>();
			hitboxName = "Punch";
			damageType = (DamageType)2;
			damageCoefficient = 2.4f;
			procCoefficient = 1f;
			pushForce = 100f;
			bonusForce = Vector3.zero;
			baseDuration = 0.8f;
			attackStartTime = 0.2f;
			attackEndTime = 0.4f;
			baseEarlyExitTime = 0.3f;
			hitStopDuration = 0.015f;
			attackRecoil = 0.75f;
			hitHopVelocity = 2f;
			swingSoundString = "OatmealNemryReborn_974165675";
			hitSoundString = "";
			muzzleString = "SwingCenter";
			swingEffectPrefab = Assets.fistBarrageEffect;
			hitEffectPrefab = Assets.punchImpactEffect;
			impactSound = Assets.punchHitSoundEvent.index;
			base.OnEnter();
		}

		protected override void PlayAttackAnimation()
		{
			if (animator.GetBool("isGrounded"))
			{
				if (!animator.GetBool("isMoving"))
				{
					((EntityState)this).PlayAnimation("FullBody, Override", "FastPunch" + (1 + swingIndex), "Punch.playbackRate", duration, 0f);
				}
			}
			else
			{
				((EntityState)this).PlayAnimation("FullBody, Override", "FastPunch" + (1 + swingIndex), "FastPunch.playbackRate", duration, 0f);
			}
			((EntityState)this).PlayAnimation("Gesture, Override", "FastPunch" + (1 + swingIndex), "FastPunch.playbackRate", duration, 0f);
		}

		protected override void PlaySwingEffect()
		{
			base.PlaySwingEffect();
		}

		protected override void OnHitEnemyAuthority()
		{
			base.OnHitEnemyAuthority();
			if (Object.op_Implicit((Object)(object)furyComponent))
			{
				furyComponent.AddFury();
			}
		}

		protected override void SetNextState()
		{
			int num = swingIndex + 1;
			if (num == 3)
			{
				num = 1;
			}
			if (((BaseState)this).attackSpeedStat >= 5f)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new FistBarrage
				{
					swingIndex = num
				});
			}
			else
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new PunchCombo
				{
					swingIndex = num
				});
			}
		}

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	public class HenryMain : GenericCharacterMain
	{
		private Animator animator;

		private HenryController henryController;

		protected EntityStateMachine weaponStateMachine;

		public LocalUser localUser;

		public override void OnEnter()
		{
			((GenericCharacterMain)this).OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			henryController = ((EntityState)this).GetComponent<HenryController>();
			localUser = LocalUserManager.readOnlyLocalUsersList[0];
			EntityStateMachine[] components = ((EntityState)this).gameObject.GetComponents<EntityStateMachine>();
			foreach (EntityStateMachine val in components)
			{
				if (Object.op_Implicit((Object)(object)val) && val.customName == "Weapon")
				{
					weaponStateMachine = val;
				}
			}
		}

		public override void Update()
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			((GenericCharacterMain)this).Update();
			if (((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded && !localUser.isUIFocused)
			{
				if (Emotes.GetKeyDownOnce(Config.restKeybind.Value))
				{
					((EntityState)this).outer.SetInterruptState((EntityState)(object)new Rest(), (InterruptPriority)0);
				}
				else if (Emotes.GetKeyDownOnce(Config.danceKeybind.Value))
				{
					((EntityState)this).outer.SetInterruptState((EntityState)(object)new Dance(), (InterruptPriority)0);
				}
			}
		}

		public override void FixedUpdate()
		{
			((GenericCharacterMain)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)animator))
			{
				float num = 1f;
				if (animator.GetBool("isGrounded"))
				{
					num = 0f;
				}
				animator.SetFloat("inAir", num);
				animator.SetBool("inCombat", !((EntityState)this).characterBody.outOfCombat || !((EntityState)this).characterBody.outOfDanger);
			}
			if (Object.op_Implicit((Object)(object)henryController))
			{
				animator.SetBool("inBazooka", henryController.hasBazookaReady);
				if (henryController.hasBazookaReady)
				{
					((EntityState)this).characterBody.isSprinting = false;
					((BaseState)this).StartAimMode(0.5f, false);
				}
			}
		}
	}
	public class PunchCombo : BaseMeleeAttack
	{
		private HenryFuryComponent furyComponent;

		public override void OnEnter()
		{
			//IL_002f: 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_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			furyComponent = ((EntityState)this).gameObject.GetComponent<HenryFuryComponent>();
			hitboxName = "Punch";
			damageType = (DamageType)2;
			damageCoefficient = 2.4f;
			procCoefficient = 1f;
			pushForce = 500f;
			bonusForce = Vector3.zero;
			baseDuration = 0.8f;
			attackStartTime = 0.2f;
			attackEndTime = 0.4f;
			baseEarlyExitTime = 0.3f;
			hitStopDuration = 0.015f;
			attackRecoil = 0.75f;
			hitHopVelocity = 6f;
			swingSoundString = "OatmealNemryReborn_974165675";
			hitSoundString = "";
			muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight");
			swingEffectPrefab = Assets.punchSwingEffect;
			hitEffectPrefab = Assets.punchImpactEffect;
			impactSound = Assets.punchHitSoundEvent.index;
			base.OnEnter();
		}

		protected override void PlayAttackAnimation()
		{
			if (animator.GetBool("isGrounded"))
			{
				if (!animator.GetBool("isMoving"))
				{
					((EntityState)this).PlayCrossfade("FullBody, Override", "Punch" + (1 + swingIndex), "Punch.playbackRate", duration, 0.05f);
				}
			}
			else
			{
				((EntityState)this).PlayCrossfade("FullBody, Override", "Punch" + (1 + swingIndex), "Punch.playbackRate", duration, 0.05f);
			}
			((EntityState)this).PlayCrossfade("Gesture, Override", "Punch" + (1 + swingIndex), "Punch.playbackRate", duration, 0.05f);
		}

		protected override void PlaySwingEffect()
		{
			base.PlaySwingEffect();
		}

		protected override void OnHitEnemyAuthority()
		{
			base.OnHitEnemyAuthority();
			if (Object.op_Implicit((Object)(object)furyComponent))
			{
				furyComponent.AddFury();
			}
		}

		protected override void SetNextState()
		{
			int num = swingIndex + 1;
			if (num == 3)
			{
				num = 1;
			}
			if (((BaseState)this).attackSpeedStat >= 5f)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new FistBarrage
				{
					swingIndex = num
				});
			}
			else
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new PunchCombo
				{
					swingIndex = num
				});
			}
		}

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	public class Roll : BaseSkillState
	{
		public static float baseDuration = 0.5f;

		public static float initialSpeedCoefficient = 5f;

		public static float finalSpeedCoefficient = 2.5f;

		public static float dodgeFOV = DodgeState.dodgeFOV;

		private float duration;

		private bool hasFrenzy;

		private Transform modelTransform;

		private float rollSpeed;

		private Vector3 forwardDirection;

		private Animator animator;

		private Vector3 previousPosition;

		private CharacterModel characterModel;

		private HurtBoxGroup hurtboxGroup;

		public override void OnEnter()
		{
			//IL_011a: 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_018c: 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_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: 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_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: 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_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0335: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			modelTransform = ((EntityState)this).GetModelTransform();
			hasFrenzy = ((EntityState)this).characterBody.HasBuff(Buffs.frenzyBuff) || ((EntityState)this).characterBody.HasBuff(Buffs.frenzyScepterBuff);
			duration = baseDuration;
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				characterModel = ((Component)modelTransform).GetComponent<CharacterModel>();
				hurtboxGroup = ((Component)modelTransform).GetComponent<HurtBoxGroup>();
			}
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector);
				forwardDirection = ((Vector3)(ref val)).normalized;
			}
			Vector3 val2 = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : forwardDirection);
			Vector3 val3 = Vector3.Cross(Vector3.up, val2);
			float num = Vector3.Dot(forwardDirection, val2);
			float num2 = Vector3.Dot(forwardDirection, val3);
			RecalculateRollSpeed();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterMotor.velocity.y = 0f;
				((EntityState)this).characterMotor.velocity = forwardDirection * rollSpeed;
			}
			Vector3 val4 = (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) ? ((EntityState)this).characterMotor.velocity : Vector3.zero);
			previousPosition = ((EntityState)this).transform.position - val4;
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.armorBuff, 3f * baseDuration);
				((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.5f * baseDuration);
			}
			string text = "OatmealNemryReborn_3530230980";
			if (hasFrenzy)
			{
				text = "OatmealNemryReborn_2491267974";
				HideModel();
				CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject));
				duration = 0.25f;
			}
			else
			{
				((EntityState)this).PlayAnimation("FullBody, Override", "Roll", "Roll.playbackRate", duration, 0f);
			}
			Util.PlaySound(text, ((EntityState)this).gameObject);
		}

		private void HideModel()
		{
			if (Object.op_Implicit((Object)(object)characterModel))
			{
				CharacterModel obj = characterModel;
				obj.invisibilityCount++;
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup val = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = val.hurtBoxesDeactivatorCounter + 1;
				val.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
		}

		private void ShowModel()
		{
			//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_002c: Unknown result type (might be due to invalid IL or missing references)
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.velocity *= 0.1f;
			CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject));
			if (Object.op_Implicit((Object)(object)characterModel))
			{
				CharacterModel obj = characterModel;
				obj.invisibilityCount--;
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup val = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = val.hurtBoxesDeactivatorCounter - 1;
				val.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
		}

		private void CreateBlinkEffect(Vector3 origin)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Expected O, but got Unknown
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			EffectData val = new EffectData();
			val.rotation = Quaternion.identity;
			val.origin = origin;
			EffectManager.SpawnEffect(BlinkState.blinkPrefab, val, false);
		}

		private void RecalculateRollSpeed()
		{
			rollSpeed = ((BaseState)this).moveSpeedStat * Mathf.Lerp(initialSpeedCoefficient, finalSpeedCoefficient, ((EntityState)this).fixedAge / baseDuration);
		}

		public override void FixedUpdate()
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: 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_00e6: 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_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: 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_014f: 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_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			RecalculateRollSpeed();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = forwardDirection;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				((EntityState)this).cameraTargetParams.fovOverride = Mathf.Lerp(dodgeFOV, 60f, ((EntityState)this).fixedAge / duration);
			}
			Vector3 val = ((EntityState)this).transform.position - previousPosition;
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && normalized != Vector3.zero)
			{
				Vector3 val2 = normalized * rollSpeed;
				float num = Mathf.Max(Vector3.Dot(val2, forwardDirection), 0f);
				val2 = forwardDirection * num;
				val2.y = 0f;
				((EntityState)this).characterMotor.velocity = val2;
			}
			previousPosition = ((EntityState)this).transform.position;
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				((EntityState)this).cameraTargetParams.fovOverride = -1f;
			}
			((EntityState)this).OnExit();
			if (hasFrenzy)
			{
				ShowModel();
			}
			((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			((BaseSkillState)this).OnSerialize(writer);
			writer.Write(forwardDirection);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			((BaseSkillState)this).OnDeserialize(reader);
			forwardDirection = reader.ReadVector3();
		}
	}
	public class Shoot : BaseSkillState
	{
		public static float damageCoefficient = 4.2f;

		public static float procCoefficient = 1f;

		public static float baseDuration = 0.6f;

		public static float force = 800f;

		public static float recoil = 3f;

		public static float range = 256f;

		public static GameObject tracerEffectPrefab = Resources.Load<GameObject>("Prefabs/Effects/Tracers/TracerGoldGat");

		private float duration;

		private float fireTime;

		private bool hasFired;

		private string muzzleString;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.2f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			muzzleString = "Muzzle";
			((EntityState)this).PlayAnimation("LeftArm, Override", "ShootGun", "ShootGun.playbackRate", 1.8f, 0f);
		}

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

		private void Fire()
		{
			//IL_0092: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Expected O, but got Unknown
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: 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_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: 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_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				((EntityState)this).characterBody.AddSpreadBloom(1.5f);
				EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false);
				Util.PlaySound("OatmealNemryReborn_3326093983", ((EntityState)this).gameObject);
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil);
					BulletAttack val = new BulletAttack
					{
						bulletCount = 1u,
						aimVector = ((Ray)(ref aimRay)).direction,
						origin = ((Ray)(ref aimRay)).origin,
						damage = damageCoefficient * ((BaseState)this).damageStat,
						damageColorIndex = (DamageColorIndex)0
					};
					Adapters.BulletAttack_Set_damageType(val, (DamageType)0);
					val.falloffModel = (FalloffModel)1;
					val.maxDistance = range;
					val.force = force;
					val.hitMask = CommonMasks.bullet;
					val.minSpread = 0f;
					val.maxSpread = 0f;
					val.isCrit = ((BaseState)this).RollCrit();
					val.owner = ((EntityState)this).gameObject;
					val.muzzleName = muzzleString;
					val.smartCollision = false;
					val.procChainMask = default(ProcChainMask);
					val.procCoefficient = procCoefficient;
					val.radius = 0.75f;
					val.sniper = false;
					val.stopperMask = CommonMasks.bullet;
					val.weapon = null;
					val.tracerEffectPrefab = tracerEffectPrefab;
					val.spreadPitchScale = 0f;
					val.spreadYawScale = 0f;
					val.queryTriggerInteraction = (QueryTriggerInteraction)0;
					val.hitEffectPrefab = FirePistol2.hitEffectPrefab;
					val.Fire();
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime)
			{
				Fire();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0006: 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)
			return (InterruptPriority)2;
		}
	}
	public class ShootAlt : BaseSkillState
	{
		public static float damageCoefficient = 0.9f;

		public static float procCoefficient = 1f;

		public static float baseDuration = 0.3f;

		public static float force = 200f;

		public static float recoil = 1f;

		public static float range = 256f;

		public static GameObject tracerEffectPrefab = Resources.Load<GameObject>("Prefabs/Effects/Tracers/TracerCommandoDefault");

		private float duration;

		private float fireTime;

		private bool hasFired;

		private string muzzleString;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.2f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			muzzleString = "AltMuzzle";
			((EntityState)this).PlayAnimation("RightArm, Override", "ShootAltGun", "ShootAltGun.playbackRate", 3f * duration, 0f);
		}

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

		private void Fire()
		{
			//IL_0092: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Expected O, but got Unknown
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: 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_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: 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_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				((EntityState)this).characterBody.AddSpreadBloom(0.5f);
				EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false);
				Util.PlaySound("OatmealNemryReborn_1635077218", ((EntityState)this).gameObject);
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil);
					BulletAttack val = new BulletAttack
					{
						bulletCount = 1u,
						aimVector = ((Ray)(ref aimRay)).direction,
						origin = ((Ray)(ref aimRay)).origin,
						damage = damageCoefficient * ((BaseState)this).damageStat,
						damageColorIndex = (DamageColorIndex)0
					};
					Adapters.BulletAttack_Set_damageType(val, (DamageType)0);
					val.falloffModel = (FalloffModel)1;
					val.maxDistance = range;
					val.force = force;
					val.hitMask = CommonMasks.bullet;
					val.minSpread = 0f;
					val.maxSpread = 0f;
					val.isCrit = ((BaseState)this).RollCrit();
					val.owner = ((EntityState)this).gameObject;
					val.muzzleName = muzzleString;
					val.smartCollision = false;
					val.procChainMask = default(ProcChainMask);
					val.procCoefficient = procCoefficient;
					val.radius = 0.75f;
					val.sniper = false;
					val.stopperMask = CommonMasks.bullet;
					val.weapon = null;
					val.tracerEffectPrefab = tracerEffectPrefab;
					val.spreadPitchScale = 0f;
					val.spreadYawScale = 0f;
					val.queryTriggerInteraction = (QueryTriggerInteraction)0;
					val.hitEffectPrefab = FirePistol2.hitEffectPrefab;
					val.Fire();
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime)
			{
				Fire();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0006: 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)
			return (InterruptPriority)2;
		}
	}
	public class ShootUzi : BaseSkillState
	{
		public static float damageCoefficient = 0.75f;

		public static float procCoefficient = 0.75f;

		public static float baseDuration = 0.1f;

		public static float force = 100f;

		public static float recoil = 1.5f;

		public static float range = 256f;

		public static GameObject tracerEffectPrefab = Resources.Load<GameObject>("Prefabs/Effects/Tracers/TracerCommandoDefault");

		private float duration;

		private string muzzleString;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			((EntityState)this).characterBody.SetAimTimer(2f);
			muzzleString = "Muzzle";
			((EntityState)this).PlayAnimation("LeftArm, Override", "ShootUzi", "ShootGun.playbackRate", 5f * duration, 0f);
			Fire();
		}

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

		private void Fire()
		{
			//IL_0066: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: 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_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_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00ff: Expected O, but got Unknown
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: 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_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: 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_0191: 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_01a7: 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_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).characterBody.AddSpreadBloom(0.5f);
			EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false);
			Util.PlaySound("OatmealNemryReborn_29352", ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil);
				BulletAttack val = new BulletAttack
				{
					bulletCount = 1u,
					aimVector = ((Ray)(ref aimRay)).direction,
					origin = ((Ray)(ref aimRay)).origin,
					damage = damageCoefficient * ((BaseState)this).damageStat,
					damageColorIndex = (DamageColorIndex)0
				};
				Adapters.BulletAttack_Set_damageType(val, (DamageType)0);
				val.falloffModel = (FalloffModel)1;
				val.maxDistance = range;
				val.force = force;
				val.hitMask = CommonMasks.bullet;
				val.minSpread = 0f;
				val.maxSpread = 8f;
				val.isCrit = ((BaseState)this).RollCrit();
				val.owner = ((EntityState)this).gameObject;
				val.muzzleName = muzzleString;
				val.smartCollision = false;
				val.procChainMask = default(ProcChainMask);
				val.procCoefficient = procCoefficient;
				val.radius = 0.75f;
				val.sniper = false;
				val.stopperMask = CommonMasks.bullet;
				val.weapon = null;
				val.tracerEffectPrefab = tracerEffectPrefab;
				val.spreadPitchScale = 0.5f;
				val.spreadYawScale = 0.5f;
				val.queryTriggerInteraction = (QueryTriggerInteraction)0;
				val.hitEffectPrefab = FirePistol2.hitEffectPrefab;
				val.Fire();
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new UziIdle());
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0006: 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)
			return (InterruptPriority)2;
		}
	}
	public class SlashCombo : BaseMeleeAttack
	{
		private HenryFuryComponent furyComponent;

		public override void OnEnter()
		{
			//IL_002f: 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_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			furyComponent = ((EntityState)this).gameObject.GetComponent<HenryFuryComponent>();
			hitboxName = "Sword";
			damageType = (DamageType)0;
			damageCoefficient = 2.8f;
			procCoefficient = 1f;
			pushForce = 300f;
			bonusForce = Vector3.zero;
			baseDuration = 1f;
			attackStartTime = 0.2f;
			attackEndTime = 0.4f;
			baseEarlyExitTime = 0.4f;
			hitStopDuration = 0.012f;
			attackRecoil = 0.5f;
			hitHopVelocity = 4f;
			swingSoundString = "OatmealNemryReborn_1338646738";
			hitSoundString = "";
			muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight");
			swingEffectPrefab = Assets.swordSwingEffect;
			hitEffectPrefab = Assets.swordHitImpactEffect;
			impactSound = Assets.swordHitSoundEvent.index;
			base.OnEnter();
		}

		protected override void PlayAttackAnimation()
		{
			base.PlayAttackAnimation();
		}

		protected override void PlaySwingEffect()
		{
			base.PlaySwingEffect();
		}

		protected override void OnHitEnemyAuthority()
		{
			base.OnHitEnemyAuthority();
			if (Object.op_Implicit((Object)(object)furyComponent))
			{
				furyComponent.AddFury();
			}
		}

		protected override void SetNextState()
		{
			int num = ((swingIndex == 0) ? 1 : 0);
			((EntityState)this).outer.SetNextState((EntityState)(object)new SlashCombo
			{
				swingIndex = num
			});
		}

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	public class ThrowBomb : BaseSkillState
	{
		public static float damageCoefficient = 16f;

		public static float procCoefficient = 1f;

		public static float baseDuration = 0.65f;

		public static float throwForce = 80f;

		private float duration;

		private float fireTime;

		private bool hasFired;

		private Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.35f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			animator = ((EntityState)this).GetModelAnimator();
			((EntityState)this).PlayAnimation("Gesture, Override", "ThrowBomb", "ThrowBomb.playbackRate", duration, 0f);
		}

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

		private void Fire()
		{
			//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_0073: 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 (!hasFired)
			{
				hasFired = true;
				Util.PlaySound("OatmealNemryReborn_2540911743", ((EntityState)this).gameObject);
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					ProjectileManager.instance.FireProjectile(Projectiles.bombPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, damageCoefficient * ((BaseState)this).damageStat, 4000f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, throwForce);
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime)
			{
				Fire();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0006: 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)
			return (InterruptPriority)2;
		}
	}
}
namespace NemryReborn.SkillStates.Nemry
{
	public class Burst : BaseNemrySkillState
	{
		public static float baseDuration = 0.2f;

		public static float damageCoefficient = 6.8f;

		public static float procCoefficient = 1f;

		public static float blastForce = 2500f;

		public static float pushForce = 100f;

		public static float recoil = 5f;

		protected Vector3 aimDirection;

		public override void OnEnter()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			base.OnEnter();
			((BaseState)this).StartAimMode(0.5f, true);
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
			Fire();
			SpendEnergy(10f, (SkillSlot)2);
			((EntityState)this).PlayAnimation("Gesture, Override", "ShootGun", "ShootGun.playbackRate", baseDuration, 0f);
		}

		protected void Fire()
		{
			//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_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_008a: 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)
			//IL_0099: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Expected O, but got Unknown
			//IL_0106: 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_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: 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_01ce: Expected O, but got Unknown
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((BaseState)this).GetAimRay();
			aimDirection = ((Ray)(ref aimRay)).direction;
			((EntityState)this).characterBody.AddSpreadBloom(2f);
			EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, "Muzzle", false);
			Util.PlaySound("OatmealNemryReborn_3373198172", ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).characterMotor.velocity = -aimDirection * pushForce;
				((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil);
				BlastAttack val = new BlastAttack();
				val.radius = 10f;
				val.procCoefficient = 1f;
				val.position = ((Ray)(ref aimRay)).origin + 2f * ((Ray)(ref aimRay)).direction;
				val.attacker = ((EntityState)this).gameObject;
				val.crit = ((BaseState)this).RollCrit();
				val.baseDamage = ((EntityState)this).characterBody.damage * damageCoefficient;
				val.falloffModel = (FalloffModel)0;
				val.baseForce = blastForce;
				val.teamIndex = TeamComponent.GetObjectTeam(val.attacker);
				Adapters.BlastAttack_Set_damageType(val, (DamageType)32);
				val.attackerFiltering = (AttackerFiltering)2;
				Result val2 = val.Fire();
				EffectData val3 = new EffectData();
				val3.origin = ((Ray)(ref aimRay)).origin + 2f * ((Ray)(ref aimRay)).direction;
				val3.scale = 8f;
				EffectManager.SpawnEffect(Resources.Load<GameObject>("Prefabs/Effects/ImpactEffects/FusionCellExplosion"), val3, true);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= baseDuration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			//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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnExit();
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.velocity *= 0.2f;
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2);
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0006: 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)
			return (InterruptPriority)2;
		}
	}
	public class DodgeSlash : BaseSkillState
	{
		public static float duration = 0.6f;

		private float previousAirControl;

		public override void OnEnter()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: 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_0050: 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_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: 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_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: 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_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: 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_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			previousAirControl = ((EntityState)this).characterMotor.airControl;
			((EntityState)this).characterMotor.airControl = BaseLeap.airControl;
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 val = -((Ray)(ref aimRay)).direction;
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).characterBody.isSprinting = true;
				val.y = Mathf.Max(val.y, BaseLeap.minimumY);
				Vector3 val2 = ((Vector3)(ref val)).normalized * BaseLeap.aimVelocity * 10f;
				Vector3 val3 = Vector3.up * BaseLeap.upwardVelocity;
				Vector3 val4 = new Vector3(val.x, 0f, val.z);
				Vector3 val5 = ((Vector3)(ref val4)).normalized * BaseLeap.forwardVelocity;
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
				((EntityState)this).characterMotor.velocity = val2 + val3 + val5;
				((EntityState)this).characterMotor.velocity.y *= 0.8f;
				if (((EntityState)this).characterMotor.velocity.y < 0f)
				{
					((EntityState)this).characterMotor.velocity.y *= 0.1f;
				}
			}
			((EntityState)this).characterDirection.moveVector = val;
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
			((EntityState)this).PlayAnimation("FullBody, Override", "DodgeSlash", "DodgeSlash.playbackRate", duration, 0f);
			Util.PlayAttackSpeedSound(DodgeState.dodgeSoundString, ((EntityState)this).gameObject, 1.5f);
		}

		public override void OnExit()
		{
			//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_0020: 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_0050: 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)
			((EntityState)this).OnExit();
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2);
			((EntityState)this).characterMotor.airControl = previousAirControl;
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.velocity *= 0.9f;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			((BaseState)this).StartAimMode(0.5f, false);
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0006: 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)
			return (InterruptPriority)4;
		}
	}
	public class FlashStep : BaseNemrySkillState
	{
		public static float duration = 0.1f;

		private Transform modelTransform;

		private float stopwatch;

		private Vector3 blinkDestination = Vector3.zero;

		private Vector3 blinkStart = Vector3.zero;

		private Animator animator;

		private CharacterModel characterModel;

		private HurtBoxGroup hurtboxGroup;

		public override void OnEnter()
		{
			//IL_014f: 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_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)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: 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_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			base.OnEnter();
			Util.PlaySound("OatmealNemryReborn_2491267974", ((EntityState)this).gameObject);
			modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				animator = ((Component)modelTransform).GetComponent<Animator>();
				characterModel = ((Component)modelTransform).GetComponent<CharacterModel>();
				hurtboxGroup = ((Component)modelTransform).GetComponent<HurtBoxGroup>();
			}
			if (Object.op_Implicit((Object)(object)characterModel))
			{
				CharacterModel obj = characterModel;
				obj.invisibilityCount++;
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup val = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = val.hurtBoxesDeactivatorCounter + 1;
				val.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((Behaviour)((EntityState)this).characterMotor).enabled = false;
			}
			Vector3 val2 = ((EntityState)this).transform.position;
			if (Object.op_Implicit((Object)(object)tracker) && Object.op_Implicit((Object)(object)tracker.GetTrackingTarget()))
			{
				Vector3 position = ((Component)tracker.GetTrackingTarget()).transform.position;
				Ray aimRay = ((BaseState)this).GetAimRay();
				val2 = position - 1.25f * ((Ray)(ref aimRay)).direction;
				val2.y = ((Component)tracker.GetTrackingTarget()).transform.position.y;
			}
			blinkDestination = ((EntityState)this).transform.position;
			blinkStart = ((EntityState)this).transform.position;
			blinkDestination = val2;
			blinkDestination += ((EntityState)this).transform.position - ((EntityState)this).characterBody.footPosition;
			CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject));
			SpendEnergy(5f, (SkillSlot)2);
		}

		private void CreateBlinkEffect(Vector3 origin)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Expected O, but got Unknown
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: 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_0033: Unknown result type (might be due to invalid IL or missing references)
			EffectData val = new EffectData();
			val.rotation = Util.QuaternionSafeLookRotation(blinkDestination - blinkStart);
			val.origin = origin;
			EffectManager.SpawnEffect(BlinkState.blinkPrefab, val, false);
		}

		private void SetPosition(Vector3 newPosition)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.SetPositionAndRotation(newPosition, Quaternion.identity, true);
			}
		}

		public override void FixedUpdate()
		{
			//IL_0078: 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_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterMotor.velocity = Vector3.zero;
			}
			SetPosition(Vector3.Lerp(blinkStart, blinkDestination, stopwatch / duration));
			if (stopwatch >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			Util.PlaySound(BlinkState.endSoundString, ((EntityState)this).gameObject);
			CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject));
			modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform) && Object.op_Implicit((Object)(object)BlinkState.destealthMaterial))
			{
				TemporaryOverlay val = ((Component)animator).gameObject.AddComponent<TemporaryOverlay>();
				val.duration = 1f;
				val.destroyComponentOnEnd = true;
				val.originalMaterial = BlinkState.destealthMaterial;
				val.inspectorCharacterModel = ((Component)animator).gameObject.GetComponent<CharacterModel>();
				val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
				val.animateShaderAlpha = true;
			}
			if (Object.op_Implicit((Object)(object)characterModel))
			{
				CharacterModel obj = characterModel;
				obj.invisibilityCount--;
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup val2 = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = val2.hurtBoxesDeactivatorCounter - 1;
				val2.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((Behaviour)((EntityState)this).characterMotor).enabled = true;
			}
			((EntityState)this).OnExit();
		}
	}
	public class MainState : HenryMain
	{
		private CustomInputBank customInputBank;

		public override void OnEnter()
		{
			base.OnEnter();
			customInputBank = ((EntityState)this).gameObject.GetComponent<CustomInputBank>();
		}

		public override void Update()
		{
			base.Update();
			if (((EntityState)this).isAuthority && !localUser.isUIFocused && Object.op_Implicit((Object)(object)customInputBank) && customInputBank.weaponSwapSkill.down)
			{
				weaponStateMachine.SetInterruptState((EntityState)(object)new WeaponSwap(), (InterruptPriority)1);
			}
		}

		public override void FixedUpdate()
		{
			base.FixedUpdate();
		}
	}
	public class ShootGun : BaseNemrySkillState
	{
		public static float damageCoefficient = 0.9f;

		public static float boostedDamageCoefficient = 3.5f;

		public static float procCoefficient = 1f;

		public static float baseDuration = 0.6f;

		public static float force = 200f;

		public static float recoil = 1.5f;

		public static float range = 256f;

		public static float energyCost = 2.5f;

		public static GameObject tracerEffectPrefab = Resources.Load<GameObject>("Prefabs/Effects/Tracers/TracerEngiTurret");

		private float duration;

		private float fireTime;

		private bool hasFired;

		private string muzzleString;

		private bool isBoosted;

		private bool hasReplicatedShotType;

		private bool replicatedBoostedShot;

		public override void OnEnter()
		{
			base.OnEnter();
			duration = Shoot.baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.2f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			muzzleString = "Muzzle";
			isBoosted = false;
			if (ResolveReplicatedShotType(energyComponent, energyCost, (SkillSlot)0, this))
			{
				isBoosted = true;
			}
			((EntityState)this).PlayAnimation("Gesture, Override", "ShootGun", "ShootGun.playbackRate", 1.5f * duration, 0f);
		}

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

		private void Fire()
		{
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: 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_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Expected O, but got Unknown
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: 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_01cc: 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_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: 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_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: 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_014f: Unknown result type (might be due to invalid IL or missing references)
			if (hasFired)
			{
				return;
			}
			hasFired = true;
			((EntityState)this).characterBody.AddSpreadBloom(1.5f);
			EffectManager.SimpleMuzzleFlash(Assets.muzzleFlashEnergy, ((EntityState)this).gameObject, muzzleString, false);
			string text = "OatmealNemryReborn_2634976301";
			if (isBoosted)
			{
				text = "OatmealNemryReborn_1402231934";
			}
			Util.PlaySound(text, ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil);
				LayerMask stopperMask = CommonMasks.bullet;
				float num = damageCoefficient;
				FalloffModel falloffModel = (FalloffModel)1;
				GameObject energyTracer = tracerEffectPrefab;
				if (isBoosted)
				{
					num = boostedDamageCoefficient;
					stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask;
					falloffModel = (FalloffModel)0;
					energyTracer = Assets.energyTracer;
				}
				BulletAttack val = new BulletAttack
				{
					bulletCount = 1u,
					aimVector = ((Ray)(ref aimRay)).direction,
					origin = ((Ray)(ref aimRay)).origin,
					damage = num * ((BaseState)this).damageStat,
					damageColorIndex = (DamageColorIndex)0
				};
				Adapters.BulletAttack_Set_damageType(val, (DamageType)0);
				val.falloffModel = falloffModel;
				val.maxDistance = range;
				val.force = force;
				val.hitMask = CommonMasks.bullet;
				val.minSpread = 0f;
				val.maxSpread = 0f;
				val.isCrit = ((BaseState)this).RollCrit();
				val.owner = ((EntityState)this).gameObject;
				val.muzzleName = muzzleString;
				val.smartCollision = false;
				val.procChainMask = default(ProcChainMask);
				val.procCoefficient = procCoefficient;
				val.radius = 0.75f;
				val.sniper = false;
				val.stopperMask = stopperMask;
				val.weapon = null;
				val.tracerEffectPrefab = energyTracer;
				val.spreadPitchScale = 0f;
				val.spreadYawScale = 0f;
				val.queryTriggerInteraction = (QueryTriggerInteraction)0;
				val.hitEffectPrefab = FirePistol2.hitEffectPrefab;
				val.Fire();
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime)
			{
				Fire();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0006: 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)
			return (InterruptPriority)1;
		}

		private static bool ResolveReplicatedShotType(NemryEnergyComponent energy, float amount, SkillSlot skillSlot, ShootGun state)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			if (state.hasReplicatedShotType)
			{
				return state.replicatedBoostedShot;
			}
			return energy.SpendEnergy(amount, skillSlot);
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			((BaseSkillState)this).OnSerialize(writer);
			writer.Write(isBoosted);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			replicatedBoostedShot = reader.ReadBoolean();
			hasReplicatedShotType = true;
		}
	}
	public class SlashCombo : BaseMeleeAttack
	{
		private NemryEnergyComponent energyComponent;

		public override void OnEnter()
		{
			//IL_0018: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			hitboxName = "Sword";
			damageType = (DamageType)0;
			damageCoefficient = 3.8f;
			procCoefficient = 1f;
			pushForce = 300f;
			bonusForce = Vector3.zero;
			baseDuration = 1f;
			attackStartTime = 0.2f;
			attackEndTime = 0.4f;
			baseEarlyExitTime = 0.4f;
			hitStopDuration = 0.012f;
			attackRecoil = 0.5f;
			hitHopVelocity = 4f;
			swingSoundString = "OatmealNemryReborn_2248390803";
			hitSoundString = "";
			muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight");
			swingEffectPrefab = Assets.nemSwordSwingEffect;
			hitEffectPrefab = Assets.nemSwordHitImpactEffect;
			impactSound = Assets.nemSwordHitSoundEvent.index;
			base.OnEnter();
			energyComponent = ((EntityState)this).GetComponent<NemryEnergyComponent>();
		}

		protected override void PlayAttackAnimation()
		{
			if (animator.GetBool("isGrounded"))
			{
				if (!animator.GetBool("isMoving"))
				{
					((EntityState)this).PlayCrossfade("FullBody, Override", "Slash" + (1 + swingIndex), "Slash.playbackRate", duration, 0.05f);
				}
			}
			else
			{
				((EntityState)this).PlayCrossfade("FullBody, Override", "Slash" + (1 + swingIndex), "Slash.playbackRate", duration, 0.05f);
			}
			((EntityState)this).PlayCrossfade("Gesture, Override", "Slash" + (1 + swingIndex), "Slash.playbackRate", duration, 0.05f);
		}

		protected override void PlaySwingEffect()
		{
			base.PlaySwingEffect();
		}

		protected override void OnHitEnemyAuthority()
		{
			base.OnHitEnemyAuthority();
			energyComponent.AddEnergy(20f);
		}

		protected override void SetNextState()
		{
			int num = swingIndex + 1;
			if (num == 3)
			{
				num = 1;
			}
			((EntityState)this).outer.SetNextState((EntityState)(object)new SlashCombo
			{
				swingIndex = num
			});
		}

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	public class SpawnState : BaseState
	{
		public static float duration = 3.6f;

		private CameraRigController cameraController;

		private bool initCamera;

		private Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			((EntityState)this).PlayAnimation("Body", "Spawn");
			Util.PlaySound(SpawnState.spawnSoundString, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)((EntityState)this).GetAimAnimator()))
			{
				((Behaviour)((EntityState)this).GetAimAnimator()).enabled = false;
			}
			animator.SetLayerWeight(animator.GetLayerIndex("AimPitch"), 0f);
			animator.SetLayerWeight(animator.GetLayerIndex("AimYaw"), 0f);
			EffectManager.SimpleMuzzleFlash(SpawnState.spawnEffectPrefab, ((EntityState)this).gameObject, "SpawnOrigin", false);
		}

		public override void FixedUpdate()
		{
			//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)
			((EntityState)this).FixedUpdate();
			if (!Object.op_Implicit((Object)(object)cameraController))
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master.playerCharacterMasterController) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master.playerCharacterMasterController.networkUser))
				{
					cameraController = ((EntityState)this).characterBody.master.playerCharacterMasterController.networkUser.cameraRigController;
				}
			}
			else if (!initCamera)
			{
				initCamera = true;
				Runtime.SetPitchYawFromLookVector(cameraController, -((EntityState)this).characterDirection.forward);
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)((EntityState)this).GetAimAnimator()))
			{
				((Behaviour)((EntityState)this).GetAimAnimator()).enabled = true;
			}
			animator.SetLayerWeight(animator.GetLayerIndex("AimPitch"), 1f);
			animator.SetLayerWeight(animator.GetLayerIndex("AimYaw"), 1f);
		}
	}
	public class SpearStab : BaseMeleeAttack
	{
		public override void OnEnter()
		{
			//IL_0018: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: 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)
			hitboxName = "Spear";
			damageType = (DamageType)8388608;
			damageCoefficient = 1.6f;
			procCoefficient = 1f;
			pushForce = 250f;
			bonusForce = Vector3.zero;
			baseDuration = 0.8f;
			attackStartTime = 0.25f;
			attackEndTime = 0.35f;
			baseEarlyExitTime = 0.2f;
			hitStopDuration = 0.025f;
			attackRecoil = 1.25f;
			hitHopVelocity = 6f;
			swingSoundString = "OatmealNemryReborn_1338646738";
			hitSoundString = "";
			muzzleString = "SwingCenter";
			swingEffectPrefab = Assets.spearSwingEffect;
			hitEffectPrefab = Assets.swordHitImpactEffect;
			impactSound = Assets.swordHitSoundEvent.index;
			base.OnEnter();
			((EntityState)this).characterBody.isSprinting = false;
		}

		public override void FixedUpdate()
		{
			base.FixedUpdate();
			if (stopwatch <= duration * attackEndTime)
			{
				((EntityState)this).characterBody.isSprinting = false;
			}
		}

		protected override void PlayAttackAnimation()
		{
			((EntityState)this).PlayCrossfade("Gesture, Override", "Stab", "Stab.playbackRate", duration, 0.05f);
		}

		protected override void PlaySwingEffect()
		{
			base.PlaySwingEffect();
		}

		protected override void OnHitEnemyAuthority()
		{
			base.OnHitEnemyAuthority();
		}

		protected override void SetNextState()
		{
			((EntityState)this).outer.SetNextState((EntityState)(object)new SpearStab());
		}

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	public class VoidBlast : BaseSkillState
	{
		public static float damageCoefficient = 4.5f;

		public static float procCoefficient = 1f;

		public static float baseDuration = 0.8f;

		public static float throwForce = 80f;

		private float duration;

		private float fireTime;

		private bool hasFired;

		private Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = ThrowBomb.baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.35f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			animator = ((EntityState)this).GetModelAnimator();
			((EntityState)this).PlayAnimation("Gesture, Override", "VoidBlast", "VoidBlast.playbackRate", duration, 0f);
		}

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

		private void Fire()
		{
			//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_0073: 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 (!hasFired)
			{
				hasFired = true;
				Util.PlaySound("OatmealNemryReborn_2540911743", ((EntityState)this).gameObject);
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					ProjectileManager.instance.FireProjectile(Projectiles.voidBlastPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, damageCoefficient * ((BaseState)this).damageStat, -2000f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, throwForce);
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime)
			{
				Fire();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0006: 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)
			return (InterruptPriority)2;
		}
	}
	public class WeaponSwap : BaseNemrySkillState
	{
		public static float baseDuration = 0.4f;

		public static SkillDef gunPrimaryDef = NemryReborn.Modules.Enemies.Nemry.gunPrimaryDef;

		public static SkillDef gunSecondaryDef = NemryReborn.Modules.Enemies.Nemry.gunSecondaryDef;

		public static SkillDef gunUtilityDef = NemryReborn.Modules.Enemies.Nemry.gunUtilityDef;

		public static SkillDef gunSpecialDef = NemryReborn.Modules.Enemies.Nemry.gunSpecialDef;

		private float duration;

		private Animator animator;

		public override void OnEnter()
		{
			base.OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			if (duration <= 0.1f)
			{
				duration = 0.1f;
			}
			animator = ((EntityState)this).GetModelAnimator();
			if (energyComponent.weaponMode == NemryEnergyComponent.WeaponMode.Sword)
			{
				((EntityState)this).PlayAnimation("Gesture, Override", "GunMode", "WeaponSwap.playbackRate", duration, 0f);
				Util.PlaySound("OatmealNemryReborn_189491286", ((EntityState)this).gameObject);
				((EntityState)this).characterBody._defaultCrosshairPrefab = Assets.LoadCrosshair("Standard");
				((EntityState)this).skillLocator.primary.SetSkillOverride((object)((EntityState)this).skillLocator.primary, gunPrimaryDef, (SkillOverridePriority)4);
				((EntityState)this).skillLocator.secondary.SetSkillOverride((object)((EntityState)this).skillLocator.secondary, gunSecondaryDef, (SkillOverridePriority)4);
				((EntityState)this).skillLocator.utility.SetSkillOverride((object)((EntityState)this).skillLocator.utility, gunUtilityDef, (SkillOverridePriority)4);
				((EntityState)this).skillLocator.special.SetSkillOverride((object)((EntityState)this).skillLocator.special, gunSpecialDef, (SkillOverridePriority)4);
				energyComponent.weaponMode = NemryEnergyComponent.WeaponMode.Gun;
				animator.SetLayerWeight(animator.GetLayerIndex("Body, Gun"), 1f);
			}
			else
			{
				((EntityState)this).PlayAnimation("Gesture, Override", "SwordMode", "WeaponSwap.playbackRate", duration, 0f);
				Util.PlaySound("OatmealNemryReborn_1975547099", ((EntityState)this).gameObject);
				((EntityState)this).characterBody._defaultCrosshairPrefab = Assets.LoadCrosshair("SimpleDot");
				((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).skillLocator.primary, gunPrimaryDef, (SkillOverridePriority)4);
				((EntityState)this).skillLocator.secondary.UnsetSkillOverride((object)((EntityState)this).skillLocator.secondary, gunSecondaryDef, (SkillOverridePriority)4);
				((EntityState)this).skillLocator.utility.UnsetSkillOverride((object)((EntityState)this).skillLocator.utility, gunUtilityDef, (SkillOverridePriority)4);
				((EntityState)this).skillLocator.special.UnsetSkillOverride((object)((EntityState)this).skillLocator.special, gunSpecialDef, (SkillOverridePriority)4);
				energyComponent.weaponMode = NemryEnergyComponent.WeaponMode.Sword;
				animator.SetLayerWeight(animator.GetLayerIndex("Body, Gun"), 0f);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0006: 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)
			return (InterruptPriority)2;
		}
	}
}
namespace NemryReborn.SkillStates.Nemry.Torrent
{
	public class TorrentAir : BaseNemrySkillState
	{
		public static GameObject bulletTracerEffectPrefab = Assets.energyTracer;

		public static float damageCoefficient = 2.1f;

		public static float baseFireInterval = 0.09f;

		public static float bulletRecoil = 0.5f;

		public static float hopHeight = 22f;

		public static float procCoefficient = 0.9f;

		public static float bulletForce = 150f;

		public static float baseStartDuration = 0.5f;

		private float startDuration;

		private float fireInterval;

		private float fireStopwatch;

		private string muzzleString;

		private int storedJumpCount;

		public override void OnEnter()
		{
			//IL_007e: 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)
			storedJumpCount = ((EntityState)this).characterMotor.jumpCount;
			base.OnEnter();
			((EntityState)this).characterBody.SetAimTimer(2f);
			fireInterval = baseFireInterval / ((BaseState)this).attackSpeedStat;
			startDuration = baseStartDuration / ((BaseState)this).attackSpeedStat;
			muzzleString = "Muzzle";
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.velocity *= 0.25f;
			((BaseState)this).SmallHop(((EntityState)this).characterMotor, hopHeight);
			((EntityState)this).PlayAnimation("FullBody, Override", "AirTorrent", "Torrent.playbackRate", startDuration, 0f);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (((EntityState)this).characterMotor.isGrounded)
			{
				((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
			}
			else
			{
				((EntityState)this).PlayAnimation("FullBody, Override", "AirTorrentExit", "Torrent.playbackRate", 0.4f / ((BaseState)this).attackSpeedStat, 0f);
			}
		}

		private void FireBullet()
		{
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: 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_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: 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_019b: 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_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: 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_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Expected O, but got Unknown
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: 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_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: 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_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: 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)
			((BaseState)this).AddRecoil(-2f * bulletRecoil, -3f * bulletRecoil, -1f * bulletRecoil, 1f * bulletRecoil);
			((EntityState)this).characterBody.AddSpreadBloom(0.33f * bulletRecoil);
			EffectManager.SimpleMuzzleFlash(FireGrenades.effectPrefab, ((EntityState)this).gameObject, muzzleString, false);
			Util.PlaySound("OatmealNemryReborn_1402231934", ((EntityState)this).gameObject);
			if (((EntityState)this).fixedAge >= startDuration)
			{
				((EntityState)this).PlayAnimation("FullBody, Override", "AirTorrentLoop", "Torrent.playbackRate", fireInterval, 0f);
			}
			if (((EntityState)this).isAuthority)
			{
				float damage = damageCoefficient * ((BaseState)this).damageStat;
				Vector3 position = ((EntityState)this).GetModelChildLocator().FindChild(muzzleString).position;
				Vector3 aimVector = ((EntityState)this).GetModelChildLocator().FindChild(muzzleString).forward;
				if (((EntityState)this).fixedAge >= startDuration)
				{
					aimVector = Vector3.down;
				}
				Ray aimRay = ((BaseState)this).GetAimRay();
				BulletAttack val = new BulletAttack
				{
					bulletCount = 1u,
					aimVector = aimVector,
					origin = position,
					damage = damage,
					damageColorIndex = (DamageColorIndex)0
				};
				Adapters.BulletAttack_Set_damageType(val, (DamageType)0);
				val.falloffModel = (FalloffModel)0;
				val.maxDistance = 256f;
				val.force = bulletForce;
				val.hitMask = CommonMasks.bullet;
				val.minSpread = 0f;
				val.maxSpread = 5f;
				val.isCrit = ((BaseState)this).RollCrit();
				val.own