Decompiled source of Submariner v1.0.6

plugins/SubmarinerMod.dll

Decompiled 2 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EmotesAPI;
using EntityStates;
using EntityStates.AI.Walker;
using EntityStates.Loader;
using HG;
using HG.BlendableTypes;
using KinematicCharacterController;
using On.RoR2;
using On.RoR2.Projectile;
using On.RoR2.UI;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using SubmarinerMod.Modules;
using SubmarinerMod.Modules.Achievements;
using SubmarinerMod.Modules.BaseStates;
using SubmarinerMod.Modules.Characters;
using SubmarinerMod.Submariner;
using SubmarinerMod.Submariner.Components;
using SubmarinerMod.Submariner.Content;
using SubmarinerMod.Submariner.SkillStates;
using ThreeEyedGames;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("SubmarinerMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+f4d3eda79f24ede5e7277a1dc7866e09f5ddf9f0")]
[assembly: AssemblyProduct("SubmarinerMod")]
[assembly: AssemblyTitle("SubmarinerMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
internal enum SubmarinerCameraParams
{
	DEFAULT,
	AIM_PISTOL,
	AIM_SNIPER,
	EMOTE
}
namespace SubmarinerMod
{
	internal static class Log
	{
		internal static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void ErrorAssetBundle(string assetName, string bundleName)
		{
			Error("failed to load asset, " + assetName + ", because it does not exist in asset bundle, " + bundleName);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.kenko.Submariner", "Submariner", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class SubmarinerPlugin : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_AssignHookReferenceToBodyStateMachine <>9__9_0;

			internal void <Awake>b__9_0(orig_AssignHookReferenceToBodyStateMachine orig, ProjectileGrappleController self)
			{
				orig.Invoke(self);
				if (Object.op_Implicit((Object)(object)self.owner.stateMachine) && self.owner.stateMachine.state is HarpoonShot harpoonShot)
				{
					harpoonShot.SetHookReference(((Component)self).gameObject);
				}
			}
		}

		public const string MODUID = "com.kenko.Submariner";

		public const string MODNAME = "Submariner";

		public const string MODVERSION = "1.0.0";

		public const string DEVELOPER_PREFIX = "KENKO";

		public static SubmarinerPlugin instance;

		public static bool emotesInstalled => Chainloader.PluginInfos.ContainsKey("com.weliveinasociety.CustomEmotesAPI");

		public static bool scepterInstalled => Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter");

		private void Awake()
		{
			//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)
			//IL_0049: Expected O, but got Unknown
			instance = this;
			NetworkingAPI.RegisterMessageType<SyncBloodExplosion>();
			Log.Init(((BaseUnityPlugin)this).Logger);
			Language.Init();
			new SubmarinerSurvivor().Initialize();
			object obj = <>c.<>9__9_0;
			if (obj == null)
			{
				hook_AssignHookReferenceToBodyStateMachine val = delegate(orig_AssignHookReferenceToBodyStateMachine orig, ProjectileGrappleController self)
				{
					orig.Invoke(self);
					if (Object.op_Implicit((Object)(object)self.owner.stateMachine) && self.owner.stateMachine.state is HarpoonShot harpoonShot)
					{
						harpoonShot.SetHookReference(((Component)self).gameObject);
					}
				};
				<>c.<>9__9_0 = val;
				obj = (object)val;
			}
			ProjectileGrappleController.AssignHookReferenceToBodyStateMachine += (hook_AssignHookReferenceToBodyStateMachine)obj;
			new ContentPacks().Initialize();
		}

		private void Start()
		{
			SoundBanks.Init();
		}
	}
}
namespace SubmarinerMod.Submariner
{
	public class SubmarinerSurvivor : SurvivorBase<SubmarinerSurvivor>
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_Init <>9__62_0;

			internal void <Emotes>b__62_0(orig_Init orig)
			{
				orig.Invoke();
				GameObject val = SubmarinerAssets.mainAssetBundle.LoadAsset<GameObject>("submariner_emoteskeleton");
				CustomEmotesAPI.ImportArmature(characterPrefab, val, 0, true);
			}
		}

		public const string SUBMARINER_PREFIX = "KENKO_SUBMARINER_";

		internal static GameObject characterPrefab;

		public static SkillDef convictScepterSkillDef;

		public override string assetBundleName => "submariner";

		public override string bodyName => "SubmarinerBody";

		public override string masterName => "SubmarinerMonsterMaster";

		public override string modelPrefabName => "mdlSubmariner";

		public override string displayPrefabName => "SubmarinerDisplay";

		public override string survivorTokenPrefix => "KENKO_SUBMARINER_";

		public override BodyInfo bodyInfo => new BodyInfo
		{
			bodyName = bodyName,
			bodyNameToken = "KENKO_SUBMARINER_NAME",
			subtitleNameToken = "KENKO_SUBMARINER_SUBTITLE",
			characterPortrait = assetBundle.LoadAsset<Texture>("texSubmarinerIcon"),
			bodyColor = SubmarinerAssets.SubmarinerColor,
			sortPosition = 5.99f,
			crosshair = Assets.LoadCrosshair("Standard"),
			podPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/SurvivorPod"),
			maxHealth = 130f,
			healthRegen = 1.5f,
			armor = 20f,
			damage = 12f,
			jumpCount = 1
		};

		public override CustomRendererInfo[] customRendererInfos => new CustomRendererInfo[8]
		{
			new CustomRendererInfo
			{
				childName = "Model"
			},
			new CustomRendererInfo
			{
				childName = "AnchorModel"
			},
			new CustomRendererInfo
			{
				childName = "GearModel"
			},
			new CustomRendererInfo
			{
				childName = "BeastModel"
			},
			new CustomRendererInfo
			{
				childName = "VisorModel"
			},
			new CustomRendererInfo
			{
				childName = "HarpoonModel"
			},
			new CustomRendererInfo
			{
				childName = "HeadModel"
			},
			new CustomRendererInfo
			{
				childName = "RopeModel"
			}
		};

		public override UnlockableDef characterUnlockableDef => SubmarinerUnlockables.characterUnlockableDef;

		public override ItemDisplaysBase itemDisplays => new SubmarinerItemDisplays();

		public override AssetBundle assetBundle { get; protected set; }

		public override GameObject bodyPrefab { get; protected set; }

		public override CharacterBody prefabCharacterBody { get; protected set; }

		public override GameObject characterModelObject { get; protected set; }

		public override CharacterModel prefabCharacterModel { get; protected set; }

		public override GameObject displayPrefab { get; protected set; }

		public override void Initialize()
		{
			base.Initialize();
		}

		public override void InitializeCharacter()
		{
			SubmarinerConfig.Init();
			SubmarinerUnlockables.Init();
			base.InitializeCharacter();
			CameraParams.InitializeParams();
			ChildLocator componentInChildren = bodyPrefab.GetComponentInChildren<ChildLocator>();
			DamageTypes.Init();
			SubmarinerStates.Init();
			SubmarinerTokens.Init();
			SubmarinerAssets.Init(assetBundle);
			SubmarinerBuffs.Init(assetBundle);
			InitializeEntityStateMachines();
			InitializeSkills();
			InitializeSkins();
			InitializeCharacterMaster();
			AdditionalBodySetup();
			characterPrefab = bodyPrefab;
			AddHooks();
		}

		private void AdditionalBodySetup()
		{
			AddHitboxes();
			bodyPrefab.AddComponent<SubmarinerController>();
		}

		public void AddHitboxes()
		{
			Prefabs.SetupHitBoxGroup(characterModelObject, "MeleeHitbox", "MeleeHitbox");
			Prefabs.SetupHitBoxGroup(characterModelObject, "HarpoonKickHitbox", "HarpoonKickHitbox");
		}

		public override void InitializeEntityStateMachines()
		{
			Prefabs.ClearEntityStateMachines(bodyPrefab);
			Prefabs.AddMainEntityStateMachine(bodyPrefab, "Body", typeof(MainState), typeof(SpawnTeleporterState));
			Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon");
			Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon2");
			Prefabs.AddEntityStateMachine(bodyPrefab, "Dash");
			Prefabs.AddEntityStateMachine(bodyPrefab, "Hook");
		}

		public override void InitializeSkills()
		{
			bodyPrefab.AddComponent<SubmarinerPassive>();
			Skills.CreateSkillFamilies(bodyPrefab);
			AddPassiveSkills();
			AddPrimarySkills();
			AddSecondarySkills();
			AddUtilitySkills();
			AddSpecialSkills();
		}

		private void AddPassiveSkills()
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			SubmarinerPassive component = bodyPrefab.GetComponent<SubmarinerPassive>();
			SkillLocator component2 = bodyPrefab.GetComponent<SkillLocator>();
			component2.passiveSkill.enabled = false;
			component.SubmarinerPassiveSkillDef = Skills.CreateSkillDef(new SkillDefInfo
			{
				skillName = "KENKO_SUBMARINER_PASSIVE_NAME",
				skillNameToken = "KENKO_SUBMARINER_PASSIVE_NAME",
				skillDescriptionToken = "KENKO_SUBMARINER_PASSIVE_DESCRIPTION",
				skillIcon = assetBundle.LoadAsset<Sprite>("texPassive"),
				keywordTokens = new string[1] { Tokens.submarinerRegenBuff },
				activationState = new SerializableEntityStateType(typeof(Idle)),
				activationStateMachineName = "",
				baseMaxStock = 1,
				baseRechargeInterval = 0f,
				beginSkillCooldownOnSkillEnd = false,
				canceledFromSprinting = false,
				forceSprintDuringState = false,
				fullRestockOnAssign = true,
				interruptPriority = (InterruptPriority)0,
				resetCooldownTimerOnUse = false,
				isCombatSkill = false,
				mustKeyPress = false,
				cancelSprintingOnActivation = false,
				rechargeStock = 1,
				requiredStock = 2,
				stockToConsume = 1
			});
			Skills.AddPassiveSkills(component.passiveSkillSlot.skillFamily, component.SubmarinerPassiveSkillDef);
		}

		private void AddPrimarySkills()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			SteppedSkillDef val = Skills.CreateSkillDef<SteppedSkillDef>(new SkillDefInfo("Anchor", "KENKO_SUBMARINER_PRIMARY_SWING_NAME", "KENKO_SUBMARINER_PRIMARY_SWING_DESCRIPTION", assetBundle.LoadAsset<Sprite>("texPrimary"), new SerializableEntityStateType(typeof(Swing))));
			val.stepCount = 2;
			val.stepGraceDuration = 0.25f;
			((SkillDef)val).keywordTokens = new string[0];
			Skills.AddPrimarySkills(bodyPrefab, (SkillDef)val);
		}

		private void AddSecondarySkills()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			SkillDefInfo skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = "Harpoon";
			skillDefInfo.skillNameToken = "KENKO_SUBMARINER_SECONDARY_HARPOON_NAME";
			skillDefInfo.skillDescriptionToken = "KENKO_SUBMARINER_SECONDARY_HARPOON_DESCRIPTION";
			skillDefInfo.keywordTokens = new string[0];
			skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texSecondary");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(HarpoonShot));
			skillDefInfo.activationStateMachineName = "Hook";
			skillDefInfo.interruptPriority = (InterruptPriority)0;
			skillDefInfo.baseMaxStock = 2;
			skillDefInfo.baseRechargeInterval = 4f;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 0;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.dontAllowPastMaxStocks = false;
			skillDefInfo.beginSkillCooldownOnSkillEnd = true;
			skillDefInfo.mustKeyPress = true;
			skillDefInfo.isCombatSkill = true;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.cancelSprintingOnActivation = false;
			skillDefInfo.forceSprintDuringState = false;
			SkillDef val = Skills.CreateSkillDef(skillDefInfo);
			Skills.AddSecondarySkills(bodyPrefab, val);
		}

		private void AddUtilitySkills()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: 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)
			SkillDefInfo skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = "Mine";
			skillDefInfo.skillNameToken = "KENKO_SUBMARINER_UTILITY_MINE_NAME";
			skillDefInfo.skillDescriptionToken = "KENKO_SUBMARINER_UTILITY_MINE_DESCRIPTION";
			skillDefInfo.keywordTokens = new string[0];
			skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texUtility");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(BackFlip));
			skillDefInfo.activationStateMachineName = "Dash";
			skillDefInfo.interruptPriority = (InterruptPriority)1;
			skillDefInfo.baseRechargeInterval = 7f;
			skillDefInfo.baseMaxStock = 1;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.dontAllowPastMaxStocks = false;
			skillDefInfo.mustKeyPress = false;
			skillDefInfo.beginSkillCooldownOnSkillEnd = false;
			skillDefInfo.isCombatSkill = false;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.cancelSprintingOnActivation = false;
			skillDefInfo.forceSprintDuringState = true;
			SkillDef val = Skills.CreateSkillDef(skillDefInfo);
			skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = "Beast";
			skillDefInfo.skillNameToken = "KENKO_SUBMARINER_UTILITY_BEAST_NAME";
			skillDefInfo.skillDescriptionToken = "KENKO_SUBMARINER_UTILITY_BEAST_DESCRIPTION";
			skillDefInfo.keywordTokens = new string[1] { Tokens.slayerKeyword };
			skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texAltUtility");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(BeastRide));
			skillDefInfo.activationStateMachineName = "Body";
			skillDefInfo.interruptPriority = (InterruptPriority)1;
			skillDefInfo.baseRechargeInterval = 7f;
			skillDefInfo.baseMaxStock = 1;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.dontAllowPastMaxStocks = false;
			skillDefInfo.mustKeyPress = false;
			skillDefInfo.beginSkillCooldownOnSkillEnd = true;
			skillDefInfo.isCombatSkill = false;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.cancelSprintingOnActivation = false;
			skillDefInfo.forceSprintDuringState = true;
			SkillDef val2 = Skills.CreateSkillDef(skillDefInfo);
			Skills.AddUtilitySkills(bodyPrefab, val, val2);
		}

		private void AddSpecialSkills()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			SkillDefInfo skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = "AnchorThrow";
			skillDefInfo.skillNameToken = "KENKO_SUBMARINER_SPECIAL_ANCHORTHROW_NAME";
			skillDefInfo.skillDescriptionToken = "KENKO_SUBMARINER_SPECIAL_ANCHORTHROW_DESCRIPTION";
			skillDefInfo.keywordTokens = new string[0];
			skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texSpecial");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(AimAnchor));
			skillDefInfo.activationStateMachineName = "Weapon";
			skillDefInfo.interruptPriority = (InterruptPriority)1;
			skillDefInfo.baseRechargeInterval = 16f;
			skillDefInfo.baseMaxStock = 1;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.dontAllowPastMaxStocks = false;
			skillDefInfo.mustKeyPress = true;
			skillDefInfo.beginSkillCooldownOnSkillEnd = true;
			skillDefInfo.isCombatSkill = true;
			skillDefInfo.canceledFromSprinting = true;
			skillDefInfo.cancelSprintingOnActivation = true;
			skillDefInfo.forceSprintDuringState = false;
			SkillDef val = Skills.CreateSkillDef(skillDefInfo);
			Skills.AddSpecialSkills(bodyPrefab, val);
		}

		private void InitializeScepter()
		{
		}

		public override void InitializeSkins()
		{
			ModelSkinController val = ((Component)prefabCharacterModel).gameObject.AddComponent<ModelSkinController>();
			ChildLocator component = ((Component)prefabCharacterModel).GetComponent<ChildLocator>();
			RendererInfo[] baseRendererInfos = prefabCharacterModel.baseRendererInfos;
			List<SkinDef> list = new List<SkinDef>();
			SkinDef val2 = Skins.CreateSkinDef("DEFAULT_SKIN", assetBundle.LoadAsset<Sprite>("texDefaultSkin"), baseRendererInfos, ((Component)prefabCharacterModel).gameObject);
			val2.meshReplacements = Skins.getMeshReplacements(assetBundle, baseRendererInfos, "meshSubmariner", "meshAnchor", "meshGear", "meshBeast", "meshVisor", "meshHarpoon", "meshHead", "meshRope");
			list.Add(val2);
			val.skins = list.ToArray();
		}

		public override void InitializeCharacterMaster()
		{
			SubmarinerAI.Init(bodyPrefab, masterName);
		}

		private void AddHooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			LoadoutPanelController.Rebuild += new hook_Rebuild(LoadoutPanelController_Rebuild);
			GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			if (SubmarinerPlugin.emotesInstalled)
			{
				Emotes();
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static void Emotes()
		{
			//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_0020: Expected O, but got Unknown
			object obj = <>c.<>9__62_0;
			if (obj == null)
			{
				hook_Init val = delegate(orig_Init orig)
				{
					orig.Invoke();
					GameObject val2 = SubmarinerAssets.mainAssetBundle.LoadAsset<GameObject>("submariner_emoteskeleton");
					CustomEmotesAPI.ImportArmature(characterPrefab, val2, 0, true);
				};
				<>c.<>9__62_0 = val;
				obj = (object)val;
			}
			SurvivorCatalog.Init += (hook_Init)obj;
		}

		private static void LoadoutPanelController_Rebuild(orig_Rebuild orig, LoadoutPanelController self)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (self.currentDisplayData.bodyIndex != BodyCatalog.FindBodyIndex("SubmarinerBody"))
			{
				return;
			}
			LanguageTextMeshController[] componentsInChildren = ((Component)self).gameObject.GetComponentsInChildren<LanguageTextMeshController>();
			foreach (LanguageTextMeshController val in componentsInChildren)
			{
				if (Object.op_Implicit((Object)(object)val) && val.token == "LOADOUT_SKILL_MISC")
				{
					val.token = "Passive";
				}
			}
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)self) || !(self.baseNameToken == "KENKO_SUBMARINER_NAME"))
			{
				return;
			}
			SubmarinerController component = ((Component)self).gameObject.GetComponent<SubmarinerController>();
			if (Object.op_Implicit((Object)(object)component))
			{
				if (self.HasBuff(SubmarinerBuffs.SubmarinerRegenBuff))
				{
					self.regen *= 1.1f * (float)self.GetBuffCount(SubmarinerBuffs.SubmarinerRegenBuff);
				}
				self.moveSpeed *= component.movementSpeedAnchorIncrease;
			}
			if (self.HasBuff(SubmarinerBuffs.SubmarinerBeastBuff))
			{
				self.moveSpeed *= 1f + 0.1f * (float)self.GetBuffCount(SubmarinerBuffs.SubmarinerBeastBuff);
				self.damage += 2.5f * (float)self.GetBuffCount(SubmarinerBuffs.SubmarinerBeastBuff);
			}
		}

		private static void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport)
		{
			CharacterBody attackerBody = damageReport.attackerBody;
			if (Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)damageReport.attackerMaster) && Object.op_Implicit((Object)(object)damageReport.victim) && attackerBody.baseNameToken == "KENKO_SUBMARINER_NAME" && attackerBody.HasBuff(SubmarinerBuffs.SubmarinerBeastBuff))
			{
				attackerBody.AddBuff(SubmarinerBuffs.SubmarinerBeastBuff);
				attackerBody.RecalculateStats();
			}
		}
	}
}
namespace SubmarinerMod.Submariner.SkillStates
{
	public class AimAnchor : AimThrowableBase
	{
		public static string enterSoundString;

		public static string exitSoundString;

		public override void OnEnter()
		{
			base.maxDistance = 50f;
			base.arcVisualizerPrefab = SubmarinerAssets.throwable;
			base.projectilePrefab = SubmarinerAssets.anchorPrefab;
			base.endpointVisualizerPrefab = SubmarinerAssets.throwableEnd;
			base.damageCoefficient = SubmarinerStaticValues.anchorDamageCoefficient;
			base.baseMinimumDuration = 0.25f;
			enterSoundString = "sfx_driver_button_foley";
			exitSoundString = "sfx_scout_cleaver_throw";
			((AimThrowableBase)this).OnEnter();
			((EntityState)this).PlayAnimation("Gesture, Override", "ChargeAnchor");
			Util.PlaySound(enterSoundString, ((EntityState)this).gameObject);
			base.detonationRadius = 7f;
		}

		public override void OnExit()
		{
			((AimThrowableBase)this).OnExit();
			((EntityState)this).PlayAnimation("Gesture, Override", "ThrowAnchor", "Harpoon.playbackRate", 1f / ((BaseState)this).attackSpeedStat);
			((EntityState)this).outer.SetNextState((EntityState)(object)new RecoverAnchor());
			Util.PlaySound(exitSoundString, ((EntityState)this).gameObject);
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class BackFlip : BaseSubmarinerSkillState
	{
		public static GameObject dashPrefab = SubmarinerAssets.dashEffect;

		public static GameObject projectilePrefab = SubmarinerAssets.minePrefab;

		public static float smallHopVelocity = 12f;

		public static float baseDuration = 0.5f;

		public static float dashDuration = 0.25f;

		public static float pushAwayForce = 2.5f;

		public static float pushAwayYFactor = 10f;

		public static float speedCoefficient = 7f;

		public static string beginSoundString = "sfx_driver_dodge";

		public static string endSoundString = "sfx_submariner_dash";

		public static float damageCoefficient = SubmarinerStaticValues.mineDamageCoefficient;

		public static float procCoefficient = 1f;

		public static GameObject hitEffectPrefab = SubmarinerAssets.batHitEffectRed;

		public static float hitPauseDuration = 0.012f;

		public bool mine = true;

		private Vector3 dashVector = Vector3.zero;

		public override void OnEnter()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: 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_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			RefreshState();
			base.OnEnter();
			((BaseState)this).StartAimMode(0.5f + baseDuration, false);
			Ray aimRay = ((BaseState)this).GetAimRay();
			dashVector = ((Ray)(ref aimRay)).direction;
			if (mine)
			{
				FireProjectile();
			}
			if (((EntityState)this).isAuthority)
			{
				if (NetworkServer.active)
				{
					((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
				}
				((EntityState)this).characterMotor.velocity.y = 0f;
				((EntityState)this).characterDirection.forward = dashVector;
				((EntityState)this).characterBody.isSprinting = true;
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground();
				Vector3 val = -((EntityState)this).characterDirection.forward;
				val.y = pushAwayYFactor;
				((EntityState)this).characterMotor.velocity = val * pushAwayForce;
			}
			((EntityState)this).PlayAnimation("FullBody, Override", "BackFlip", "Dash.playbackRate", baseDuration + dashDuration);
		}

		public override void FixedUpdate()
		{
			base.FixedUpdate();
			((BaseState)this).StartAimMode(2f, false);
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= baseDuration + dashDuration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public void FireProjectile()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((BaseState)this).GetAimRay();
			if (((EntityState)this).isAuthority)
			{
				ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, 200f, Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
			}
		}

		public override void OnExit()
		{
			if (NetworkServer.active && ((EntityState)this).characterBody.HasBuff(Buffs.HiddenInvincibility))
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
				((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.3f);
			}
			((BaseState)this).SmallHop(((EntityState)this).characterMotor, smallHopVelocity);
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)3;
		}
	}
	public class BaseEmote : BaseState
	{
		private Animator animator;

		private ChildLocator childLocator;

		private float duration;

		private uint activePlayID;

		public LocalUser localUser;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			childLocator = ((EntityState)this).GetModelChildLocator();
			FindLocalUser();
			((EntityState)this).characterBody.hideCrosshair = true;
		}

		private void FindLocalUser()
		{
			if (localUser != null || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				return;
			}
			foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList)
			{
				if ((Object)(object)readOnlyLocalUsers.cachedBody == (Object)(object)((EntityState)this).characterBody)
				{
					localUser = readOnlyLocalUsers;
					break;
				}
			}
		}

		protected void PlayEmote(string animString, string soundString = "", float animDuration = 0f)
		{
			PlayEmote(animString, soundString, ((EntityState)this).GetModelAnimator(), animDuration);
		}

		protected void PlayEmote(string animString, string soundString, Animator animator, float animDuration = 0f)
		{
			if (animDuration >= 0f && duration != 0f)
			{
				animDuration = duration;
			}
			if (duration > 0f)
			{
				EntityState.PlayAnimationOnAnimator(animator, "FullBody, Override", animString, "Emote.playbackRate", animDuration);
			}
			else
			{
				animator.SetFloat("Emote.playbackRate", 1f);
				EntityState.PlayAnimationOnAnimator(animator, "FullBody, Override", animString);
			}
			if (!string.IsNullOrEmpty(soundString))
			{
				activePlayID = Util.PlaySound(soundString, ((EntityState)this).gameObject);
			}
		}

		public override void Update()
		{
			((EntityState)this).Update();
			if (((EntityState)this).isAuthority)
			{
				CheckEmote<Rest>(SubmarinerConfig.restKey);
			}
		}

		private void CheckEmote(KeyCode keybind, EntityState state)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown(keybind) && !localUser.isUIFocused)
			{
				((EntityState)this).outer.SetInterruptState(state, (InterruptPriority)0);
			}
		}

		private void CheckEmote<T>(ConfigEntry<KeyboardShortcut> keybind) where T : EntityState, new()
		{
			if (Config.GetKeyPressed(keybind))
			{
				FindLocalUser();
				if (localUser != null && !localUser.isUIFocused)
				{
					((EntityState)this).outer.SetInterruptState((EntityState)(object)new T(), (InterruptPriority)0);
				}
			}
		}

		public override void FixedUpdate()
		{
			//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)
			((EntityState)this).FixedUpdate();
			bool flag = false;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded)
			{
				flag = true;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
			{
				if (((EntityState)this).inputBank.skill1.down)
				{
					flag = true;
				}
				if (((EntityState)this).inputBank.skill2.down)
				{
					flag = true;
				}
				if (((EntityState)this).inputBank.skill3.down)
				{
					flag = true;
				}
				if (((EntityState)this).inputBank.skill4.down)
				{
					flag = true;
				}
				if (((EntityState)this).inputBank.moveVector != Vector3.zero)
				{
					flag = true;
				}
			}
			if (duration > 0f && ((EntityState)this).fixedAge >= duration)
			{
				flag = true;
			}
			if (flag && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).characterBody.hideCrosshair = false;
			((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
			if (activePlayID != 0)
			{
				AkSoundEngine.StopPlayingID(activePlayID);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)0;
		}
	}
	public class BeastImpact : BaseSubmarinerState
	{
		public HealthComponent victimHealthComponent;

		public Vector3 idealDirection;

		public bool isCrit;

		public override void OnEnter()
		{
			//IL_0148: 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_00c9: 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_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: 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_0057: 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_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Expected O, but got Unknown
			base.OnEnter();
			if (NetworkServer.active)
			{
				if (Object.op_Implicit((Object)(object)victimHealthComponent))
				{
					DamageInfo val = new DamageInfo
					{
						attacker = ((EntityState)this).gameObject,
						damage = ((BaseState)this).damageStat * BeastRide.knockbackDamageCoefficient,
						crit = isCrit,
						procCoefficient = 1f,
						damageColorIndex = (DamageColorIndex)3,
						damageType = (DamageType)524320,
						position = ((EntityState)this).characterBody.corePosition
					};
					victimHealthComponent.TakeDamage(val);
					GlobalEventManager.instance.OnHitEnemy(val, ((Component)victimHealthComponent).gameObject);
					GlobalEventManager.instance.OnHitAll(val, ((Component)victimHealthComponent).gameObject);
				}
				((EntityState)this).healthComponent.TakeDamageForce(idealDirection * (0f - BeastRide.knockbackForce), true, false);
			}
			if (((EntityState)this).isAuthority)
			{
				((BaseState)this).AddRecoil(-0.5f * BeastRide.recoilAmplitude * 3f, -0.5f * BeastRide.recoilAmplitude * 3f, -0.5f * BeastRide.recoilAmplitude * 8f, 0.5f * BeastRide.recoilAmplitude * 3f);
				EffectManager.SimpleImpactEffect(BeastRide.knockbackEffectPrefab, ((EntityState)this).characterBody.corePosition, ((EntityState)this).characterDirection.forward, true);
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnSerialize(writer);
			writer.Write(Object.op_Implicit((Object)(object)victimHealthComponent) ? ((Component)victimHealthComponent).gameObject : null);
			writer.Write(idealDirection);
			writer.Write(isCrit);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnDeserialize(reader);
			GameObject val = reader.ReadGameObject();
			victimHealthComponent = (Object.op_Implicit((Object)(object)val) ? val.GetComponent<HealthComponent>() : null);
			idealDirection = reader.ReadVector3();
			isCrit = reader.ReadBoolean();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)4;
		}
	}
	public class BeastRide : BaseCharacterMain
	{
		public float baseDuration = 5f;

		public float speedMultiplier = 2.2f;

		public static float chargeDamageCoefficient = SubmarinerStaticValues.beastDamageCoefficient;

		public static float awayForceMagnitude = 0f;

		public static float upwardForceMagnitude = 2100f;

		public static GameObject impactEffectPrefab = LoaderMeleeAttack.overchargeImpactEffectPrefab;

		public static float hitPauseDuration = 0.04f;

		public static string impactSoundString = "Play_acrid_m2_bite_shoot";

		public static float recoilAmplitude = 1f;

		public static string startSoundString = "Play_acrid_shift_fly_loop";

		public static string endSoundString = "Stop_acrid_shift_fly_loop";

		public static GameObject knockbackEffectPrefab = LoaderMeleeAttack.overchargeImpactEffectPrefab;

		public static float knockbackDamageCoefficient = 10f;

		public static float massThresholdForKnockback = 250f;

		public static float knockbackForce = 8000f;

		private uint soundID;

		private float duration;

		private float hitPauseTimer;

		private Vector3 idealDirection;

		private OverlapAttack attack;

		private bool inHitPause;

		private List<HurtBox> victimsStruck = new List<HurtBox>();

		public override void OnEnter()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Expected O, but got Unknown
			//IL_01ae: 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_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			((BaseCharacterMain)this).OnEnter();
			duration = baseDuration;
			if (((EntityState)this).isAuthority)
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
				{
					idealDirection = ((EntityState)this).inputBank.aimDirection;
					idealDirection.y = 0f;
				}
				UpdateDirection();
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
			{
				((EntityState)this).modelLocator.normalizeToFloor = true;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = idealDirection;
			}
			soundID = Util.PlaySound(startSoundString, ((EntityState)this).gameObject);
			if (!SubmarinerConfig.enableFunnyMode.Value)
			{
				((Component)((BaseState)this).FindModelChild("BeastModel")).gameObject.SetActive(true);
			}
			((EntityState)this).PlayCrossfade("FullBody, Override", "BeastStart", 0.1f);
			((BaseCharacterMain)this).modelAnimator.SetFloat("aimWeight", 0f);
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.ArmorBoost);
				((EntityState)this).characterBody.AddBuff(SubmarinerBuffs.SubmarinerBeastBuff);
			}
			HitBoxGroup hitBoxGroup = null;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "MeleeHitbox");
			}
			attack = new OverlapAttack();
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.teamIndex = ((BaseState)this).GetTeam();
			attack.damage = chargeDamageCoefficient * ((BaseState)this).damageStat;
			attack.hitEffectPrefab = impactEffectPrefab;
			attack.forceVector = Vector3.up * upwardForceMagnitude;
			attack.pushAwayForce = awayForceMagnitude;
			attack.hitBoxGroup = hitBoxGroup;
			attack.isCrit = ((BaseState)this).RollCrit();
			attack.damageType = (DamageType)524288;
		}

		public override void OnExit()
		{
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//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)
			AkSoundEngine.StopPlayingID(soundID);
			Util.PlaySound(endSoundString, ((EntityState)this).gameObject);
			if (!((EntityState)this).outer.destroying && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).PlayAnimation("FullBody, Override", "BeastEnd", "Dash.playbackRate", 0.4f);
				((EntityState)this).characterBody.isSprinting = false;
				if (NetworkServer.active)
				{
					((EntityState)this).characterBody.RemoveBuff(Buffs.ArmorBoost);
					((EntityState)this).characterBody.SetBuffCount(SubmarinerBuffs.SubmarinerBeastBuff.buffIndex, 0);
				}
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.disableAirControlUntilCollision)
			{
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.velocity += GetIdealVelocity();
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
			{
				((EntityState)this).modelLocator.normalizeToFloor = false;
			}
			((BaseCharacterMain)this).modelAnimator.SetFloat("aimWeight", 1f);
			((BaseCharacterMain)this).OnExit();
			if (!SubmarinerConfig.enableFunnyMode.Value)
			{
				((Component)((BaseState)this).FindModelChild("BeastModel")).gameObject.SetActive(false);
			}
		}

		private void UpdateDirection()
		{
			//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)
			//IL_0021: 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_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
			{
				Vector2 val = Util.Vector3XZToVector2XY(((EntityState)this).inputBank.moveVector);
				if (val != Vector2.zero)
				{
					((Vector2)(ref val)).Normalize();
					Vector3 val2 = new Vector3(val.x, 0f, val.y);
					idealDirection = ((Vector3)(ref val2)).normalized;
				}
			}
		}

		private Vector3 GetIdealVelocity()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: 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_002a: Unknown result type (might be due to invalid IL or missing references)
			return ((EntityState)this).characterDirection.forward * ((EntityState)this).characterBody.moveSpeed * speedMultiplier;
		}

		public override void FixedUpdate()
		{
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d8: 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_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: 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_011c: 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_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			((BaseCharacterMain)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
			else
			{
				if (!((EntityState)this).isAuthority)
				{
					return;
				}
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
				{
					((EntityState)this).characterBody.isSprinting = true;
				}
				if (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.special) && ((EntityState)this).inputBank.skill4.down)
				{
					((EntityState)this).skillLocator.special.ExecuteIfReady();
				}
				UpdateDirection();
				if (!inHitPause)
				{
					if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
					{
						((EntityState)this).characterDirection.moveVector = idealDirection;
						if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.disableAirControlUntilCollision)
						{
							CharacterMotor characterMotor = ((EntityState)this).characterMotor;
							characterMotor.rootMotion += GetIdealVelocity() * Time.fixedDeltaTime;
						}
					}
					attack.damage = ((BaseState)this).damageStat * chargeDamageCoefficient;
					if (!attack.Fire(victimsStruck))
					{
						return;
					}
					Util.PlaySound(impactSoundString, ((EntityState)this).gameObject);
					inHitPause = true;
					hitPauseTimer = hitPauseDuration;
					((BaseState)this).AddRecoil(-0.5f * recoilAmplitude, -0.5f * recoilAmplitude, -0.5f * recoilAmplitude, 0.5f * recoilAmplitude);
					((EntityState)this).PlayAnimation("FullBody, Override", "BeastEat", "Dash.playbackRate", hitPauseDuration);
					for (int i = 0; i < victimsStruck.Count; i++)
					{
						float num = 0f;
						HurtBox val = victimsStruck[i];
						if (!Object.op_Implicit((Object)(object)val.healthComponent))
						{
							continue;
						}
						CharacterMotor component = ((Component)val.healthComponent).GetComponent<CharacterMotor>();
						if (Object.op_Implicit((Object)(object)component))
						{
							num = component.mass;
						}
						else
						{
							Rigidbody component2 = ((Component)val.healthComponent).GetComponent<Rigidbody>();
							if (Object.op_Implicit((Object)(object)component2))
							{
								num = component2.mass;
							}
						}
						if (num >= massThresholdForKnockback)
						{
							((EntityState)this).outer.SetNextState((EntityState)(object)new BeastImpact
							{
								victimHealthComponent = val.healthComponent,
								idealDirection = idealDirection,
								isCrit = attack.isCrit
							});
							break;
						}
					}
				}
				else
				{
					((EntityState)this).characterMotor.velocity = Vector3.zero;
					hitPauseTimer -= Time.fixedDeltaTime;
					if (hitPauseTimer < 0f)
					{
						inHitPause = false;
					}
				}
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)4;
		}
	}
	internal class Bounce : BaseSubmarinerSkillState
	{
		public static float baseDuration = 1f;

		public Vector3 faceDirection;

		public override void OnEnter()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			RefreshState();
			base.OnEnter();
			if (!((EntityState)this).characterMotor.isGrounded)
			{
				((EntityState)this).characterMotor.ApplyForce(Vector3.up * 12f, true, false);
			}
		}

		public override void FixedUpdate()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			base.FixedUpdate();
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).characterDirection.forward = faceDirection;
				((EntityState)this).characterBody.isSprinting = true;
				((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
				if (((EntityState)this).fixedAge >= baseDuration)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)1;
		}
	}
	public class HarpoonShot : BaseSubmarinerSkillState
	{
		private Transform modelTransform;

		public static GameObject dashPrefab = SubmarinerAssets.dashEffect;

		public static GameObject projectilePrefab = SubmarinerAssets.hookPrefab;

		public static float smallHopVelocity = 12f;

		public static float baseDuration = 1f;

		public static float dashDuration = 0.5f;

		public static float pushAwayForce = 10f;

		public static float pushAwayYFactor = 2.5f;

		public static float speedCoefficient = 5f;

		public static string beginSoundString = "sfx_driver_dodge";

		public static string endSoundString = "sfx_submariner_dash";

		public static float damageCoefficient = SubmarinerStaticValues.harpoonDamageCoefficient;

		public static float procCoefficient = 1f;

		public static GameObject hitEffectPrefab = SubmarinerAssets.batHitEffectRed;

		public static float hitPauseDuration = 0.012f;

		private OverlapAttack attack;

		private List<HurtBox> victimsStruck = new List<HurtBox>();

		private Vector3 dashVector = Vector3.zero;

		private ChildLocator childLocator;

		public GameObject hookInstance;

		protected ProjectileStickOnImpact hookStickOnImpact;

		private bool isStuck;

		private bool hasHit;

		private bool hadHookInstance;

		private AimRequest aimRequest;

		public override void OnEnter()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: 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)
			RefreshState();
			base.OnEnter();
			((BaseState)this).StartAimMode(0.5f + baseDuration, false);
			Ray aimRay = ((BaseState)this).GetAimRay();
			dashVector = ((Ray)(ref aimRay)).direction;
			attack = new OverlapAttack();
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.damageType = (DamageType)32;
			attack.procCoefficient = 1f;
			attack.teamIndex = ((BaseState)this).GetTeam();
			attack.isCrit = ((BaseState)this).RollCrit();
			attack.forceVector = Vector3.zero;
			attack.pushAwayForce = 1f;
			attack.damage = damageCoefficient * ((BaseState)this).damageStat;
			attack.hitBoxGroup = ((BaseState)this).FindHitBoxGroup("HarpoonKickHitbox");
			attack.hitEffectPrefab = SubmarinerAssets.batHitEffect;
			DamageAPI.AddModdedDamageType(attack, DamageTypes.SubmarinerRegeneration);
			FireProjectile();
			Util.PlaySound("Play_loader_m2_launch", ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("Gesture, Override", "FireHarpoon", "Harpoon.playbackRate", baseDuration);
		}

		private void CreateDashEffect()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			Transform val = childLocator.FindChild("Chest");
			if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)dashPrefab))
			{
				EffectManager.SpawnEffect(dashPrefab, new EffectData
				{
					origin = val.position,
					rotation = Util.QuaternionSafeLookRotation(-dashVector)
				}, true);
			}
		}

		public override void FixedUpdate()
		{
			//IL_018e: 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_01c2: 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_01db: 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_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: 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_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)
			base.FixedUpdate();
			((BaseState)this).StartAimMode(2f, false);
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)hookStickOnImpact) && Object.op_Implicit((Object)(object)hookStickOnImpact.stuckBody))
			{
				Rigidbody component = ((Component)hookStickOnImpact.stuckBody).GetComponent<Rigidbody>();
				if (Object.op_Implicit((Object)(object)component) && component.mass >= hookInstance.GetComponent<ProjectileGrappleController>().yankMassLimit)
				{
					if (hookStickOnImpact.stuck && !isStuck)
					{
						if (NetworkServer.active)
						{
							((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
						}
						((EntityState)this).PlayAnimation("FullBody, Override", "HarpoonPullStart", "Dash.playbackRate", dashDuration);
						((EntityState)this).characterMotor.velocity.y = 0f;
						CharacterMotor characterMotor = ((EntityState)this).characterMotor;
						characterMotor.velocity += dashVector * 52.5f;
					}
					isStuck = hookStickOnImpact.stuck;
					if (attack.Fire(victimsStruck))
					{
						((EntityState)this).PlayAnimation("FullBody, Override", "HarpoonEndToKick", "Dash.playbackRate", dashDuration);
						hasHit = true;
						((EntityState)this).characterMotor.velocity.y = 0f;
						((EntityState)this).characterDirection.forward = dashVector;
						((EntityState)this).characterBody.isSprinting = true;
						((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground();
						Vector3 val = -((EntityState)this).characterDirection.forward;
						val.y = pushAwayYFactor;
						((EntityState)this).characterMotor.velocity = val * pushAwayForce;
						((EntityState)this).outer.SetNextState((EntityState)(object)new Bounce
						{
							faceDirection = dashVector
						});
					}
				}
			}
			if (((EntityState)this).isAuthority && !Object.op_Implicit((Object)(object)hookInstance) && hadHookInstance)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public void SetHookReference(GameObject hook)
		{
			hookInstance = hook;
			hookStickOnImpact = hook.GetComponent<ProjectileStickOnImpact>();
			hadHookInstance = true;
		}

		public void FireProjectile()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: 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_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: 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_00ab: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				FireProjectileInfo val = default(FireProjectileInfo);
				val.position = ((Ray)(ref aimRay)).origin;
				val.rotation = Quaternion.LookRotation(((Ray)(ref aimRay)).direction);
				val.crit = ((EntityState)this).characterBody.RollCrit();
				val.damage = ((BaseState)this).damageStat * (damageCoefficient / 2f);
				val.force = 0f;
				val.damageColorIndex = (DamageColorIndex)0;
				val.procChainMask = default(ProcChainMask);
				val.projectilePrefab = projectilePrefab;
				val.owner = ((EntityState)this).gameObject;
				FireProjectileInfo val2 = val;
				ProjectileManager.instance.FireProjectile(val2);
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (!hasHit)
			{
				((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.1f);
			}
			if (NetworkServer.active && ((EntityState)this).characterBody.HasBuff(Buffs.HiddenInvincibility))
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
				((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.3f);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)3;
		}
	}
	public class MainState : GenericCharacterMain
	{
		private Animator animator;

		public LocalUser localUser;

		public override void OnEnter()
		{
			((GenericCharacterMain)this).OnEnter();
			animator = ((BaseCharacterMain)this).modelAnimator;
			FindLocalUser();
		}

		private void CheckEmote<T>(ConfigEntry<KeyboardShortcut> keybind) where T : EntityState, new()
		{
			if (Config.GetKeyPressed(keybind))
			{
				FindLocalUser();
				if (localUser != null && !localUser.isUIFocused)
				{
					((EntityState)this).outer.SetInterruptState((EntityState)(object)new T(), (InterruptPriority)0);
				}
			}
		}

		private void FindLocalUser()
		{
			if (localUser != null || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				return;
			}
			foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList)
			{
				if ((Object)(object)readOnlyLocalUsers.cachedBody == (Object)(object)((EntityState)this).characterBody)
				{
					localUser = readOnlyLocalUsers;
					break;
				}
			}
		}

		public override void FixedUpdate()
		{
			((GenericCharacterMain)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)animator))
			{
				bool flag = false;
				if (!((EntityState)this).characterBody.outOfDanger || !((EntityState)this).characterBody.outOfCombat)
				{
					flag = true;
				}
				animator.SetBool("inCombat", flag);
				if (((BaseState)this).isGrounded)
				{
					animator.SetFloat("airBlend", 0f);
				}
				else
				{
					animator.SetFloat("airBlend", 1f);
				}
				if (animator.GetCurrentStateName(animator.GetLayerIndex("Body")) == "RestIdle")
				{
					((Behaviour)base.aimAnimator).enabled = false;
				}
				else
				{
					((Behaviour)base.aimAnimator).enabled = true;
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded)
			{
				CheckEmote<Rest>(SubmarinerConfig.restKey);
			}
		}

		public override void ProcessJump()
		{
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Expected O, but got Unknown
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Expected O, but got Unknown
			//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_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Expected O, but got Unknown
			if (!((BaseCharacterMain)this).hasCharacterMotor)
			{
				return;
			}
			bool flag = false;
			bool flag2 = false;
			if (!base.jumpInputReceived || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || ((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.maxJumpCount)
			{
				return;
			}
			int itemCount = ((EntityState)this).characterBody.inventory.GetItemCount(Items.JumpBoost);
			float num = 1f;
			float num2 = 1f;
			if (((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.baseJumpCount)
			{
				flag = true;
				num = 1.5f;
				num2 = 1.5f;
			}
			else if (itemCount > 0 && ((EntityState)this).characterBody.isSprinting)
			{
				float num3 = ((EntityState)this).characterBody.acceleration * ((EntityState)this).characterMotor.airControl;
				if (((EntityState)this).characterBody.moveSpeed > 0f && num3 > 0f)
				{
					flag2 = true;
					float num4 = Mathf.Sqrt(10f * (float)itemCount / num3);
					float num5 = ((EntityState)this).characterBody.moveSpeed / num3;
					num = (num4 + num5) / num5;
				}
			}
			GenericCharacterMain.ApplyJumpVelocity(((EntityState)this).characterMotor, ((EntityState)this).characterBody, num, num2, false);
			if (((BaseCharacterMain)this).hasModelAnimator)
			{
				int layerIndex = ((BaseCharacterMain)this).modelAnimator.GetLayerIndex("Body");
				if (layerIndex >= 0)
				{
					if (((EntityState)this).characterBody.isSprinting)
					{
						((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("SprintJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
					}
					else if (flag)
					{
						((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("BonusJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
					}
					else
					{
						((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("Jump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
					}
				}
			}
			if (flag)
			{
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/FeatherEffect"), new EffectData
				{
					origin = ((EntityState)this).characterBody.footPosition
				}, true);
			}
			else if (((EntityState)this).characterMotor.jumpCount > 0)
			{
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/CharacterLandImpact"), new EffectData
				{
					origin = ((EntityState)this).characterBody.footPosition,
					scale = ((EntityState)this).characterBody.radius
				}, true);
			}
			if (flag2)
			{
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/BoostJumpEffect"), new EffectData
				{
					origin = ((EntityState)this).characterBody.footPosition,
					rotation = Util.QuaternionSafeLookRotation(((EntityState)this).characterMotor.velocity)
				}, true);
			}
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.jumpCount++;
		}
	}
	public class RecoverAnchor : BaseSubmarinerSkillState
	{
		public static GameObject muzzleEffectPrefab;

		public static float baseDuration = 1f;

		private float duration;

		public override void OnEnter()
		{
			RefreshState();
			submarinerController.DisableAnchor();
			base.OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
		}

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

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)1;
		}
	}
	public class Rest : BaseEmote
	{
		public override void OnEnter()
		{
			base.OnEnter();
			PlayEmote("RestEmote", "", 1.5f);
		}
	}
	public class Swing : BaseMeleeAttack
	{
		protected GameObject swingEffectInstance;

		public override void OnEnter()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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_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)
			RefreshState();
			hitboxGroupName = "MeleeHitbox";
			damageType = (DamageType)0;
			damageCoefficient = SubmarinerStaticValues.swingDamageCoefficient;
			procCoefficient = 1f;
			pushForce = 1500f;
			bonusForce = Vector3.zero;
			baseDuration = 1.2f;
			attackStartPercentTime = 0.6f;
			attackEndPercentTime = 0.9f;
			earlyExitPercentTime = 1f;
			hitStopDuration = 0.15f;
			attackRecoil = 0.75f;
			hitHopVelocity = 6f;
			swingSoundString = "Play_loader_m1_swing";
			hitSoundString = "";
			muzzleString = ((swingIndex % 2 == 0) ? "SwingMuzzle1" : "SwingMuzzle2");
			playbackRateParam = "Swing.playbackRate";
			swingEffectPrefab = SubmarinerAssets.batSwingEffect;
			moddedDamageTypeHolder.Add(DamageTypes.SubmarinerRegeneration);
			hitEffectPrefab = SubmarinerAssets.batHitEffect;
			impactSound = SubmarinerAssets.batImpactSoundEvent.index;
			base.OnEnter();
		}

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

		protected override void FireAttack()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//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_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				Vector3 direction = ((Ray)(ref aimRay)).direction;
				direction.y = Mathf.Max(direction.y, direction.y * 0.5f);
				((BaseState)this).FindModelChild("MeleePivot").rotation = Util.QuaternionSafeLookRotation(direction);
			}
			base.FireAttack();
		}

		protected override void PlaySwingEffect()
		{
			Util.PlaySound(swingSoundString, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)swingEffectPrefab))
			{
				Transform val = ((BaseState)this).FindModelChild(muzzleString);
				if (Object.op_Implicit((Object)(object)val))
				{
					swingEffectInstance = Object.Instantiate<GameObject>(swingEffectPrefab, val);
				}
			}
		}

		protected override void PlayAttackAnimation()
		{
			((EntityState)this).PlayCrossfade("Gesture, Override", "Swing" + (1 + swingIndex), playbackRateParam, duration * 1.3f, duration * 0.4f);
		}

		public override void OnExit()
		{
			base.OnExit();
			if (Object.op_Implicit((Object)(object)swingEffectInstance))
			{
				EntityState.Destroy((Object)(object)swingEffectInstance);
			}
		}
	}
}
namespace SubmarinerMod.Submariner.Content
{
	public static class DamageTypes
	{
		public static ModdedDamageType Default;

		public static ModdedDamageType SubmarinerRegeneration;

		internal static void Init()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Default = DamageAPI.ReserveDamageType();
			SubmarinerRegeneration = DamageAPI.ReserveDamageType();
			Hook();
		}

		private static void Hook()
		{
			GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
		}

		private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
		{
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			DamageInfo damageInfo = damageReport.damageInfo;
			if (Object.op_Implicit((Object)(object)damageReport.attackerBody) && Object.op_Implicit((Object)(object)damageReport.victimBody))
			{
				HealthComponent victim = damageReport.victim;
				GameObject inflictor = damageInfo.inflictor;
				CharacterBody victimBody = damageReport.victimBody;
				EntityStateMachine component = ((Component)victimBody).GetComponent<EntityStateMachine>();
				CharacterBody attackerBody = damageReport.attackerBody;
				GameObject gameObject = damageReport.attacker.gameObject;
				if (NetworkServer.active && attackerBody.baseNameToken == "KENKO_SUBMARINER_NAME" && DamageAPI.HasModdedDamageType(damageInfo, SubmarinerRegeneration) && Object.op_Implicit((Object)(object)victimBody) && Object.op_Implicit((Object)(object)attackerBody))
				{
					attackerBody.AddTimedBuff(SubmarinerBuffs.SubmarinerRegenBuff, 2.5f);
				}
			}
		}
	}
	public static class SubmarinerAI
	{
		public static void Init(GameObject bodyPrefab, string masterName)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: 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_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: 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_01ac: 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_0210: 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_0244: 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_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_0350: Unknown result type (might be due to invalid IL or missing references)
			//IL_0364: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Prefabs.CreateBlankMasterPrefab(bodyPrefab, masterName);
			BaseAI component = val.GetComponent<BaseAI>();
			component.aimVectorDampTime = 0.1f;
			component.aimVectorMaxSpeed = 360f;
			AISkillDriver val2 = val.AddComponent<AISkillDriver>();
			val2.customName = "Use Primary Swing";
			val2.skillSlot = (SkillSlot)0;
			val2.requiredSkill = null;
			val2.requireSkillReady = false;
			val2.requireEquipmentReady = false;
			val2.minUserHealthFraction = float.NegativeInfinity;
			val2.maxUserHealthFraction = float.PositiveInfinity;
			val2.minTargetHealthFraction = float.NegativeInfinity;
			val2.maxTargetHealthFraction = float.PositiveInfinity;
			val2.minDistance = 0f;
			val2.maxDistance = 8f;
			val2.selectionRequiresTargetLoS = false;
			val2.selectionRequiresOnGround = false;
			val2.selectionRequiresAimTarget = false;
			val2.maxTimesSelected = -1;
			val2.moveTargetType = (TargetType)0;
			val2.activationRequiresTargetLoS = false;
			val2.activationRequiresAimTargetLoS = false;
			val2.activationRequiresAimConfirmation = false;
			val2.movementType = (MovementType)1;
			val2.moveInputScale = 1f;
			val2.aimType = (AimType)1;
			val2.ignoreNodeGraph = false;
			val2.shouldSprint = false;
			val2.shouldFireEquipment = false;
			val2.buttonPressType = (ButtonPressType)0;
			val2.driverUpdateTimerOverride = -1f;
			val2.resetCurrentEnemyOnNextDriverSelection = false;
			val2.noRepeat = false;
			val2.nextHighPriorityOverride = null;
			AISkillDriver val3 = val.AddComponent<AISkillDriver>();
			val3.customName = "Use Secondary Shoot";
			val3.skillSlot = (SkillSlot)1;
			val3.requireSkillReady = true;
			val3.minDistance = 0f;
			val3.maxDistance = 25f;
			val3.selectionRequiresTargetLoS = false;
			val3.selectionRequiresOnGround = false;
			val3.selectionRequiresAimTarget = false;
			val3.maxTimesSelected = -1;
			val3.moveTargetType = (TargetType)0;
			val3.activationRequiresTargetLoS = false;
			val3.activationRequiresAimTargetLoS = false;
			val3.activationRequiresAimConfirmation = true;
			val3.movementType = (MovementType)1;
			val3.moveInputScale = 1f;
			val3.aimType = (AimType)1;
			val3.buttonPressType = (ButtonPressType)0;
			AISkillDriver val4 = val.AddComponent<AISkillDriver>();
			val4.customName = "Use Utility Roll";
			val4.skillSlot = (SkillSlot)2;
			val4.requireSkillReady = true;
			val4.minDistance = 8f;
			val4.maxDistance = 20f;
			val4.selectionRequiresTargetLoS = true;
			val4.selectionRequiresOnGround = false;
			val4.selectionRequiresAimTarget = false;
			val4.maxTimesSelected = -1;
			val4.moveTargetType = (TargetType)0;
			val4.activationRequiresTargetLoS = false;
			val4.activationRequiresAimTargetLoS = false;
			val4.activationRequiresAimConfirmation = false;
			val4.movementType = (MovementType)2;
			val4.moveInputScale = 1f;
			val4.aimType = (AimType)1;
			val4.buttonPressType = (ButtonPressType)0;
			AISkillDriver val5 = val.AddComponent<AISkillDriver>();
			val5.customName = "Use Special bomb";
			val5.skillSlot = (SkillSlot)3;
			val5.requireSkillReady = true;
			val5.minDistance = 0f;
			val5.maxDistance = 20f;
			val5.selectionRequiresTargetLoS = false;
			val5.selectionRequiresOnGround = false;
			val5.selectionRequiresAimTarget = false;
			val5.maxTimesSelected = -1;
			val5.moveTargetType = (TargetType)0;
			val5.activationRequiresTargetLoS = false;
			val5.activationRequiresAimTargetLoS = false;
			val5.activationRequiresAimConfirmation = false;
			val5.movementType = (MovementType)1;
			val5.moveInputScale = 1f;
			val5.aimType = (AimType)1;
			val5.buttonPressType = (ButtonPressType)0;
			AISkillDriver val6 = val.AddComponent<AISkillDriver>();
			val6.customName = "Chase";
			val6.skillSlot = (SkillSlot)(-1);
			val6.requireSkillReady = false;
			val6.minDistance = 0f;
			val6.maxDistance = float.PositiveInfinity;
			val6.moveTargetType = (TargetType)0;
			val6.activationRequiresTargetLoS = false;
			val6.activationRequiresAimTargetLoS = false;
			val6.activationRequiresAimConfirmation = false;
			val6.movementType = (MovementType)1;
			val6.moveInputScale = 1f;
			val6.aimType = (AimType)1;
			val6.buttonPressType = (ButtonPressType)0;
		}
	}
	public static class SubmarinerAssets
	{
		internal static AssetBundle mainAssetBundle;

		internal static Material commandoMat;

		internal static Material anchorMat;

		internal static Material ghostMat;

		internal static Shader hotpoo = Resources.Load<Shader>("Shaders/Deferred/HGStandard");

		internal static GameObject bloodSplatterEffect;

		internal static GameObject bloodExplosionEffect;

		internal static GameObject bloodSpurtEffect;

		internal static GameObject batSwingEffect;

		internal static GameObject swordSwingEffect;

		internal static GameObject batHitEffect;

		internal static GameObject batHitEffectRed;

		internal static GameObject dashEffect;

		internal static GameObject SubmarinerGuilty;

		internal static GameObject SubmarinerConvicted;

		internal static GameObject SubmarinerConvictedConsume;

		internal static GameObject throwable;

		internal static GameObject throwableEnd;

		internal static GameObject anchorTether;

		internal static GameObject hookPrefab;

		internal static GameObject minePrefab;

		internal static GameObject mineExplosionPrefab;

		internal static GameObject anchorPrefab;

		internal static NetworkSoundEventDef batImpactSoundEvent;

		internal static NetworkSoundEventDef swordImpactSoundEvent;

		internal static Color SubmarinerColor = new Color(0.23921569f, 0.8980392f, 28f / 85f);

		internal static Color SubmarinerSecondaryColor = new Color(14f / 51f, 21f / 85f, 0.36862746f);

		public static void Init(AssetBundle assetBundle)
		{
			mainAssetBundle = assetBundle;
			CreateMaterials();
			CreateModels();
			CreateEffects();
			CreateSounds();
			CreateProjectiles();
			CreateUI();
		}

		private static void CleanChildren(Transform startingTrans)
		{
			for (int num = startingTrans.childCount - 1; num >= 0; num--)
			{
				if (startingTrans.GetChild(num).childCount > 0)
				{
					CleanChildren(startingTrans.GetChild(num));
				}
				Object.DestroyImmediate((Object)(object)((Component)startingTrans.GetChild(num)).gameObject);
			}
		}

		private static void CreateMaterials()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			anchorMat = mainAssetBundle.LoadAsset<Material>("matSubmariner");
			ghostMat = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matGhostEffect.mat").WaitForCompletion();
		}

		private static void CreateModels()
		{
		}

		private static void CreateEffects()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_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_01ca: 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_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: 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_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0378: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03da: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0427: Unknown result type (might be due to invalid IL or missing references)
			//IL_042c: Unknown result type (might be due to invalid IL or missing references)
			//IL_045f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0464: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0511: Unknown result type (might be due to invalid IL or missing references)
			//IL_0516: Unknown result type (might be due to invalid IL or missing references)
			//IL_0549: Unknown result type (might be due to invalid IL or missing references)
			//IL_054e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0572: Unknown result type (might be due to invalid IL or missing references)
			//IL_0577: Unknown result type (might be due to invalid IL or missing references)
			//IL_0591: Unknown result type (might be due to invalid IL or missing references)
			//IL_0596: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0622: Unknown result type (might be due to invalid IL or missing references)
			//IL_0642: Unknown result type (might be due to invalid IL or missing references)
			//IL_0647: Unknown result type (might be due to invalid IL or missing references)
			//IL_0661: Unknown result type (might be due to invalid IL or missing references)
			//IL_0666: Unknown result type (might be due to invalid IL or missing references)
			//IL_07de: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0892: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0915: Unknown result type (might be due to invalid IL or missing references)
			//IL_095f: Unknown result type (might be due to invalid IL or missing references)
			//IL_096f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0974: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a15: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a1a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a4d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a5d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a62: Unknown result type (might be due to invalid IL or missing references)
			throwable = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/BasicThrowableVisualizer.prefab").WaitForCompletion();
			throwableEnd = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressArrowRainIndicator.prefab").WaitForCompletion();
			bloodExplosionEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ImpBoss/ImpBossBlink.prefab").WaitForCompletion(), "DriverBloodExplosion", false);
			Material material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matBloodHumanLarge.mat").WaitForCompletion();
			Material val = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/moon2/matBloodSiphon.mat").WaitForCompletion();
			((Renderer)((Component)bloodExplosionEffect.transform.Find("Particles/LongLifeNoiseTrails")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)bloodExplosionEffect.transform.Find("Particles/LongLifeNoiseTrails, Bright")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)bloodExplosionEffect.transform.Find("Particles/Dash")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)bloodExplosionEffect.transform.Find("Particles/Dash, Bright")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)bloodExplosionEffect.transform.Find("Particles/DashRings")).GetComponent<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/moon2/matBloodSiphon.mat").WaitForCompletion();
			((Component)bloodExplosionEffect.GetComponentInChildren<Light>()).gameObject.SetActive(false);
			bloodExplosionEffect.GetComponentInChildren<PostProcessVolume>().sharedProfile = Addressables.LoadAssetAsync<PostProcessProfile>((object)"RoR2/Base/title/ppLocalGold.asset").WaitForCompletion();
			SubmarinerMod.Modules.Content.CreateAndAddEffectDef(bloodExplosionEffect);
			bloodSpurtEffect = mainAssetBundle.LoadAsset<GameObject>("BloodSpurtEffect");
			((Renderer)((Component)bloodSpurtEffect.transform.Find("Blood")).GetComponent<ParticleSystemRenderer>()).material = val;
			((Component)bloodSpurtEffect.transform.Find("Trails")).GetComponent<ParticleSystemRenderer>().trailMaterial = val;
			anchorTether = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Treebot/EntangleOrbEffect.prefab").WaitForCompletion(), "SubmarinerChains");
			anchorTether.AddComponent<NetworkIdentity>();
			Material[] materials = (Material[])(object)new Material[1] { Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Gravekeeper/matGravekeeperHookChain.mat").WaitForCompletion() };
			((Renderer)((Component)anchorTether.transform.GetChild(0)).GetComponent<LineRenderer>()).materials = materials;
			((Component)anchorTether.transform.GetChild(0)).GetComponent<LineRenderer>().textureMode = (LineTextureMode)1;
			Transform transform = anchorTether.transform;
			transform.localScale *= 0.5f;
			Object.Destroy((Object)(object)((Component)anchorTether.transform.GetChild(0).GetChild(0)).gameObject);
			((Behaviour)anchorTether.gameObject.GetComponent<AkEvent>()).enabled = false;
			((Behaviour)anchorTether.gameObject.GetComponent<AkGameObj>()).enabled = false;
			anchorTether.gameObject.AddComponent<DestroyOnCondition>();
			SubmarinerMod.Modules.Content.CreateAndAddEffectDef(anchorTether);
			dashEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherDashEffect.prefab").WaitForCompletion(), "SubmarinerDashEffect");
			dashEffect.AddComponent<NetworkIdentity>();
			Object.Destroy((Object)(object)((Component)dashEffect.transform.Find("Point light")).gameObject);
			Object.Destroy((Object)(object)((Component)dashEffect.transform.Find("Flash, White")).gameObject);
			Object.Destroy((Object)(object)((Component)dashEffect.transform.Find("NoiseTrails")).gameObject);
			Transform obj = dashEffect.transform.Find("Donut");
			obj.localScale *= 0.5f;
			Transform obj2 = dashEffect.transform.Find("Donut, Distortion");
			obj2.localScale *= 0.5f;
			((Renderer)((Component)dashEffect.transform.Find("Dash")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_RemapTex", Addressables.LoadAssetAsync<Texture>((object)"RoR2/Base/Common/ColorRamps/texRampDefault.png").WaitForCompletion());
			((Renderer)((Component)dashEffect.transform.Find("Dash")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", SubmarinerColor);
			SubmarinerMod.Modules.Content.CreateAndAddEffectDef(dashEffect);
			batHitEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Bandit2/HitsparkBandit.prefab").WaitForCompletion(), "InterreogatorBatHitEffect");
			batHitEffect.AddComponent<NetworkIdentity>();
			SubmarinerMod.Modules.Content.CreateAndAddEffectDef(batHitEffect);
			batHitEffectRed = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Bandit2/HitsparkBandit.prefab").WaitForCompletion(), "InterreogatorBatRedHitEffect");
			batHitEffectRed.AddComponent<NetworkIdentity>();
			((Renderer)((Component)batHitEffectRed.transform.Find("Particles").Find("TriangleSparksLarge")).gameObject.GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", Color.red);
			((Renderer)((Component)batHitEffectRed.transform.Find("Particles").Find("TriangleSparks")).gameObject.GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", Color.red);
			SubmarinerMod.Modules.Content.CreateAndAddEffectDef(batHitEffectRed);
			batSwingEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/MercSwordSlash.prefab").WaitForCompletion(), "SubmarinerBatSwing", false);
			((Renderer)((Component)batSwingEffect.transform.GetChild(0)).GetComponent<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Huntress/matHuntressSwingTrail.mat").WaitForCompletion();
			MainModule main = ((Component)batSwingEffect.transform.GetChild(0)).GetComponent<ParticleSystem>().main;
			((MainModule)(ref main)).startLifetimeMultiplier = ((MainModule)(ref main)).startLifetimeMultiplier * 2f;
			swordSwingEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/MercSwordSlash.prefab").WaitForCompletion(), "SubmarinerswordSwing", false);
			Transform child = swordSwingEffect.transform.GetChild(0);
			child.localScale *= 1.5f;
			((Renderer)((Component)swordSwingEffect.transform.GetChild(0)).GetComponent<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matGenericSwingTrail.mat").WaitForCompletion();
			((Renderer)((Component)swordSwingEffect.transform.GetChild(0)).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", SubmarinerColor);
			main = ((Component)swordSwingEffect.transform.GetChild(0)).GetComponent<ParticleSystem>().main;
			((MainModule)(ref main)).startLifetimeMultiplier = ((MainModule)(ref main)).startLifetimeMultiplier * 2f;
			bloodSplatterEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherSlamImpact.prefab").WaitForCompletion(), "SubmarinerSplat", true);
			bloodSplatterEffect.AddComponent<NetworkIdentity>();
			((Component)bloodSplatterEffect.transform.GetChild(0)).gameObject.SetActive(false);
			((Component)bloodSplatterEffect.transform.GetChild(1)).gameObject.SetActive(false);
			((Component)bloodSplatterEffect.transform.GetChild(2)).gameObject.SetActive(false);
			((Component)bloodSplatterEffect.transform.GetChild(3)).gameObject.SetActive(false);
			((Component)bloodSplatterEffect.transform.GetChild(4)).gameObject.SetActive(false);
			((Component)bloodSplatterEffect.transform.GetChild(5)).gameObject.SetActive(false);
			((Component)bloodSplatterEffect.transform.GetChild(6)).gameObject.SetActive(false);
			((Component)bloodSplatterEffect.transform.GetChild(7)).gameObject.SetActive(false);
			((Component)bloodSplatterEffect.transform.GetChild(8)).gameObject.SetActive(false);
			((Component)bloodSplatterEffect.transform.GetChild(9)).gameObject.SetActive(false);
			((Component)bloodSplatterEffect.transform.GetChild(10)).gameObject.SetActive(false);
			((Component)bloodSplatterEffect.transform.Find("Decal")).GetComponent<Decal>().Material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Imp/matImpDecal.mat").WaitForCompletion();
			((Component)bloodSplatterEffect.transform.Find("Decal")).GetComponent<AnimateShaderAlpha>().timeMax = 10f;
			((Component)bloodSplatterEffect.transform.GetChild(12)).gameObject.SetActive(false);
			((Component)bloodSplatterEffect.transform.GetChild(13)).gameObject.SetActive(false);
			((Component)bloodSplatterEffect.transform.GetChild(14)).gameObject.SetActive(false);
			((Component)bloodSplatterEffect.transform.GetChild(15)).gameObject.SetActive(false);
			bloodSplatterEffect.transform.localScale = Vector3.one;
			SubmarinerMod.Modules.Content.CreateAndAddEffectDef(bloodSplatterEffect);
			SubmarinerConvicted = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/SlowOnHit/SlowDownTime.prefab").WaitForCompletion(), "Convicted", true);
			SubmarinerConvicted.AddComponent<NetworkIdentity>();
			((Renderer)((Component)SubmarinerConvicted.transform.Find("Visual").GetChild(0)).gameObject.GetComponent<MeshRenderer>()).materials[0].SetColor("_TintColor", new Color(0.6509804f, 53f / 85f, 4f / 51f));
			((Renderer)((Component)SubmarinerConvicted.transform.Find("Visual").GetChild(1)).gameObject.GetComponent<MeshRenderer>()).materials[0].SetColor("_TintColor", new Color(0.6509804f, 53f / 85f, 4f / 51f));
			Material val2 = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Merc/matMercExposed.mat").WaitForCompletion());
			val2.SetTexture("_MainTex", mainAssetBundle.LoadAsset<Texture>("texGuilty"));
			val2.SetColor("_TintColor", SubmarinerColor);
			SubmarinerGuilty = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/MercExposeEffect.prefab").WaitForCompletion(), "Guilty", true);
			SubmarinerGuilty.AddComponent<NetworkIdentity>();
			((Renderer)((Component)SubmarinerGuilty.transform.Find("Visual, On").Find("PulseEffect, Ring")).gameObject.GetComponent<ParticleSystemRenderer>()).material = val2;
			val2 = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Merc/matMercExposed.mat").WaitForCompletion());
			val2.SetTexture("_MainTex", mainAssetBundle.LoadAsset<Texture>("texGuilty"));
			val2.SetColor("_TintColor", Color.red);
			SubmarinerConvictedConsume = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/MercExposeConsumeEffect.prefab").WaitForCompletion(), "ConvictMarked", true);
			SubmarinerConvictedConsume.AddComponent<NetworkIdentity>();
			((Renderer)((Component)SubmarinerConvictedConsume.transform.Find("Visual, Consumed").Find("PulseEffect, Ring (1)")).gameObject.GetComponent<ParticleSystemRenderer>()).material = val2;
			SubmarinerConvictedConsume.gameObject.GetComponent<EffectComponent>().soundName = "sfx_SUBMARINER_point";
			Object.Destroy((Object)(object)((Component)SubmarinerConvictedConsume.transform.Find("Visual, Consumed").Find("PulseEffect, Slash")).gameObject);
			SubmarinerMod.Modules.Content.CreateAndAddEffectDef(SubmarinerConvictedConsume);
		}

		private static void CreateProjectiles()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0153: 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_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0301: Unknown result type (might be due to invalid IL or missing references)
			//IL_0372: Unknown result type (might be due to invalid IL or missing references)
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			//IL_0508: Unknown result type (might be due to invalid IL or missing references)
			//IL_050d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0593: Unknown result type (might be due to invalid IL or missing references)
			//IL_059d: Unknown result type (might be due to invalid IL or missing re