Decompiled source of FenrisSkills v1.0.1

FenrisSkills.dll

Decompiled 6 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Captain.Weapon;
using EntityStates.Drifter;
using EntityStates.Railgunner.Backpack;
using EntityStates.Railgunner.Weapon;
using FenrisSkills.Skills;
using FenrisSkills.Skills.Components;
using FenrisSkills.Skills.States.Captain;
using FenrisSkills.Skills.States.Chef;
using FenrisSkills.Skills.States.Railgunner;
using Microsoft.CodeAnalysis;
using R2API;
using Rewired.ComponentControls.Effects;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Audio;
using RoR2.ContentManagement;
using RoR2.EntityLogic;
using RoR2.ExpansionManagement;
using RoR2.HudOverlay;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using RoR2BepInExPack.GameAssetPaths.Version_1_39_0;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("FenrisSkills")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+8447935bf83a7be68a5d853d8df506c65bef8b95")]
[assembly: AssemblyProduct("FenrisSkills")]
[assembly: AssemblyTitle("FenrisSkills")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FenrisSkills
{
	public class Assets
	{
		public static AssetBundle assetBundle;

		public static GameObject railCannonProjectilePrefab;

		public static GameObject railCannonBulletTracerPrefab;

		public static GameObject railCannonBulletTracerCritPrefab;

		public static GameObject railCannonImpactPrefab;

		public static GameObject pyroOverlayPrefab;

		public static GameObject pyroTracerColdEffectPrefab;

		public static GameObject pyroHitColdEffectPrefab;

		public static GameObject pyroTracerWarmEffectPrefab;

		public static GameObject pyroHitWarmEffectPrefab;

		public static GameObject pyroTracerHotEffectPrefab;

		public static GameObject pyroHitHotEffectPrefab;

		public static void Init()
		{
			GetAssetBundle();
			TryBuildAsset("Rail Cannon Assets", CreateRailCannonAssets);
			TryBuildAsset("Snipe Pyro Assets", CreateSnipePyroAssets);
		}

		private static void TryBuildAsset(string assetName, Action buildAction)
		{
			try
			{
				buildAction();
			}
			catch (Exception arg)
			{
				Log.Warning($"Failed to complete building asset {assetName}!\n\n{arg}");
			}
		}

		private static void GetAssetBundle()
		{
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("FenrisSkills.mwmwfskillsbundle");
			if (stream != null)
			{
				assetBundle = AssetBundle.LoadFromStream(stream);
			}
		}

		private static void CreateRailCannonAssets()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			GameObject railCannonProjectileChild = assetBundle.LoadAsset<GameObject>("SpawnBulletProjectile");
			railCannonProjectileChild.AddComponent<CreateRailgunBullet>();
			railCannonProjectilePrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Captain.CaptainAirstrikeProjectile1_prefab).WaitForCompletion(), "RailCannonProjectile");
			TryBuildAsset("Rail Cannon Projectile Prefab", delegate
			{
				ProjectileImpactExplosion component = railCannonProjectilePrefab.GetComponent<ProjectileImpactExplosion>();
				((ProjectileExplosion)component).fireChildren = true;
				((ProjectileExplosion)component).childrenCount = 1;
				((ProjectileExplosion)component).childrenDamageCoefficient = 1f;
				((ProjectileExplosion)component).childrenProjectilePrefab = railCannonProjectileChild;
				((ProjectileExplosion)component).blastRadius = 0f;
			});
			railCannonBulletTracerPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_Railgunner.TracerRailgunSuper_prefab).WaitForCompletion(), "RailCannonTracer", false);
			TryBuildAsset("Rail Cannon Bullet Tracer Prefab", delegate
			{
				//IL_002c: 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_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0080: Unknown result type (might be due to invalid IL or missing references)
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b2: Expected O, but got Unknown
				//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
				Tracer component = railCannonBulletTracerPrefab.GetComponent<Tracer>();
				component.beamDensity = 1f;
				component.speed = 600f;
				railCannonBulletTracerPrefab.transform.localScale = Vector3.one * 6f;
				railCannonBulletTracerPrefab.transform.Find("FX/BeamParticles, Rings").localScale = Vector3.one * 20f;
				Transform val = railCannonBulletTracerPrefab.transform.Find("FX/mdlRailgunnerBeam");
				val.localScale = Vector3.one * 2f;
				SkinnedMeshRenderer component2 = ((Component)val.Find("mdlRailgunnerBeamMesh")).GetComponent<SkinnedMeshRenderer>();
				Material val2 = new Material(((Renderer)component2).sharedMaterial);
				val2.SetTexture("_RemapTex", Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common_ColorRamps.texRampGolem_png).WaitForCompletion());
				val2.SetFloat("_AlphaBoost", 5f);
				val2.SetInt("_Cull", 0);
				((Renderer)component2).sharedMaterial = val2;
			});
			railCannonBulletTracerCritPrefab = PrefabAPI.InstantiateClone(railCannonBulletTracerPrefab, "RailCannonTracerCrit", false);
			TryBuildAsset("Rail Cannon Bullet Tracer Crit Prefab", delegate
			{
				//IL_0021: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Expected O, but got Unknown
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				SkinnedMeshRenderer component = ((Component)railCannonBulletTracerCritPrefab.transform.Find("FX/mdlRailgunnerBeam/mdlRailgunnerBeamMesh")).GetComponent<SkinnedMeshRenderer>();
				Material val = new Material(((Renderer)component).sharedMaterial);
				val.SetTexture("_RemapTex", Addressables.LoadAssetAsync<Texture>((object)RoR2_DLC2_Items_SpeedBoostPickup.texSpeedBoostPickupThornRamp_png).WaitForCompletion());
				((Renderer)component).sharedMaterial = val;
			});
			railCannonImpactPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Captain.CaptainAirstrikeAltImpact_prefab).WaitForCompletion(), "RailCannonImpact", false);
			TryBuildAsset("Rail Cannon Impact Prefab", delegate
			{
				//IL_0063: 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_0103: 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_0133: Unknown result type (might be due to invalid IL or missing references)
				//IL_0138: Unknown result type (might be due to invalid IL or missing references)
				//IL_016f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0174: Unknown result type (might be due to invalid IL or missing references)
				Object.Destroy((Object)(object)railCannonImpactPrefab.GetComponent<AlignToNormal>());
				Object.Destroy((Object)(object)((Component)railCannonImpactPrefab.transform.Find("captain fletchette")).gameObject);
				Object.Destroy((Object)(object)((Component)railCannonImpactPrefab.transform.Find("PP")).GetComponent<SphereCollider>());
				railCannonImpactPrefab.transform.Find("Particles").localScale = Vector3.one * 3f;
				railCannonImpactPrefab.AddComponent<DestroyOnTimer>().duration = 10f;
				EffectComponent component = railCannonImpactPrefab.GetComponent<EffectComponent>();
				component.applyScale = false;
				component.soundName = "Play_railgunner_R_fire";
				ShakeEmitter component2 = railCannonImpactPrefab.GetComponent<ShakeEmitter>();
				component2.wave.amplitude = 3f;
				component2.wave.frequency = 30f;
				component2.duration = 0.4f;
				component2.radius = 200f;
				((Component)railCannonImpactPrefab.transform.Find("Particles/Flames")).transform.localScale = Vector3.one * 3f;
				ParticleSystem component3 = ((Component)railCannonImpactPrefab.transform.Find("Particles/Dust, Directional")).GetComponent<ParticleSystem>();
				ShapeModule shape = component3.shape;
				((ShapeModule)(ref shape)).radius = ((ShapeModule)(ref shape)).radius * 3f;
				Transform val = railCannonImpactPrefab.transform.Find("Particles/Decal");
				((Component)val).GetComponent<MeshFilter>().sharedMesh = Addressables.LoadAssetAsync<Mesh>((object)RoR2_DLC2_FalseSonBoss.meshLunarRainSummonVFX1_FBX_Sphere001_).WaitForCompletion();
				((Renderer)((Component)val).GetComponent<MeshRenderer>()).sharedMaterial = assetBundle.LoadAsset<Material>("InvisibleMaterial");
			});
			railCannonProjectilePrefab.GetComponent<ProjectileImpactExplosion>().impactEffect = railCannonImpactPrefab;
			GameObject railCannonGhostPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Captain.CaptainAirstrikeAltGhost_prefab).WaitForCompletion(), "RailCannonGhost", false);
			TryBuildAsset("Rail Cannon Ghost Prefab", delegate
			{
				//IL_000d: 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_00bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
				Transform transform = railCannonGhostPrefab.transform;
				transform.localScale *= 0.7f;
				Object.Destroy((Object)(object)((Component)railCannonGhostPrefab.transform.Find("AirstrikeOrientation")).gameObject);
				Object.Destroy((Object)(object)railCannonGhostPrefab.GetComponent<AkEvent>());
				Object.Destroy((Object)(object)railCannonGhostPrefab.GetComponent<StartEvent>());
				Object.Destroy((Object)(object)railCannonGhostPrefab.GetComponent<OnEnableEvent>());
				Object.Destroy((Object)(object)railCannonGhostPrefab.GetComponent<DelayedEvent>());
				PlaySoundOnDelay playSoundOnDelay = railCannonGhostPrefab.AddComponent<PlaySoundOnDelay>();
				playSoundOnDelay.soundString = "Play_captain_shift_preImpact";
				playSoundOnDelay.delay = 0.8f;
				GameObject obj = railCannonGhostPrefab;
				AkBank[] array = new AkBank[1];
				GameObject obj2 = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_Railgunner.RailgunnerBody_prefab).WaitForCompletion();
				array[0] = ((obj2 != null) ? obj2.GetComponent<AkBank>() : null);
				GiveAkBanksToObject(obj, (AkBank[])(object)array);
				railCannonProjectilePrefab.GetComponent<ProjectileController>().ghostPrefab = railCannonGhostPrefab;
				Transform val = railCannonGhostPrefab.transform.Find("AreaIndicatorCenter");
				((Component)val).GetComponent<RotateAroundAxis>().slowRotationSpeed = 40f;
				((Component)val.Find("IndicatorRing")).GetComponent<ObjectScaleCurve>().timeMax = 2f;
				ObjectTransformCurve[] componentsInChildren = ((Component)val).GetComponentsInChildren<ObjectTransformCurve>();
				ObjectTransformCurve[] array2 = componentsInChildren;
				foreach (ObjectTransformCurve val2 in array2)
				{
					val2.timeMax = 2f;
				}
			});
			Content.CreateAndAddEffectDef(railCannonImpactPrefab);
			Content.CreateAndAddEffectDef(railCannonBulletTracerPrefab);
			Content.CreateAndAddEffectDef(railCannonBulletTracerCritPrefab);
			ContentPacks.projectilePrefabs.Add(railCannonProjectileChild);
			ContentPacks.projectilePrefabs.Add(railCannonProjectilePrefab);
		}

		private static void CreateSnipePyroAssets()
		{
			//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_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			pyroOverlayPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_Railgunner.RailgunnerOverchargeUIReady_prefab).WaitForCompletion(), "PyroSnipeOverlay", false);
			TryBuildAsset("Pyro Overlay Prefab", delegate
			{
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0075: Unknown result type (might be due to invalid IL or missing references)
				//IL_0099: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
				Color val = default(Color);
				((Color)(ref val))..ctor(1f, 0.48f, 0.27f);
				TextMeshProUGUI component = ((Component)pyroOverlayPrefab.transform.Find("BarContainer/SoftGlow/Text, Normal")).GetComponent<TextMeshProUGUI>();
				((TMP_Text)component).m_fontColor32 = Color32.op_Implicit(val);
				((TMP_Text)component).m_fontColor = val;
				Color color = default(Color);
				((Color)(ref color))..ctor(0.99f, 0.56f, 0.39f);
				Image component2 = ((Component)pyroOverlayPrefab.transform.Find("BarContainer/Inner/FillBarDimensions/FillBar")).GetComponent<Image>();
				((Graphic)component2).color = color;
				Image component3 = ((Component)pyroOverlayPrefab.transform.Find("BarContainer/Inner/SpinnySquare")).GetComponent<Image>();
				((Graphic)component3).color = color;
				Image component4 = ((Component)pyroOverlayPrefab.transform.Find("BarContainer/Outer")).GetComponent<Image>();
				((Graphic)component4).color = color;
				PyroUIColorController pyroUIColorController = pyroOverlayPrefab.AddComponent<PyroUIColorController>();
				pyroUIColorController.imagesToUpdate = (Image[])(object)new Image[3] { component2, component3, component4 };
			});
			pyroTracerColdEffectPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_Railgunner.TracerRailgunSuper_prefab).WaitForCompletion(), "PyroTracerCold", false);
			TryBuildAsset("Pyro Tracer Cold Effect Prefab", delegate
			{
				//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_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Expected O, but got Unknown
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_0094: Unknown result type (might be due to invalid IL or missing references)
				//IL_009a: Expected O, but got Unknown
				//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d8: Expected O, but got Unknown
				//IL_0112: Unknown result type (might be due to invalid IL or missing references)
				//IL_0119: Expected O, but got Unknown
				//IL_0153: Unknown result type (might be due to invalid IL or missing references)
				//IL_015a: Expected O, but got Unknown
				//IL_0194: Unknown result type (might be due to invalid IL or missing references)
				//IL_019b: Expected O, but got Unknown
				//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
				Texture val = Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common_ColorRamps.texRampGolem_png).WaitForCompletion();
				LineRenderer component = ((Component)pyroTracerColdEffectPrefab.transform.Find("FX/Brief/Beam, Flash Briefly")).GetComponent<LineRenderer>();
				Material val2 = new Material(((Renderer)component).sharedMaterial);
				val2.SetFloat("_Boost", 3.5f);
				val2.SetColor("_TintColor", new Color(0.67f, 0.03f, 0f));
				((Renderer)component).sharedMaterial = val2;
				component = ((Component)pyroTracerColdEffectPrefab.transform.Find("FX/Longer/Beam, Linger")).GetComponent<LineRenderer>();
				Material val3 = new Material(((Renderer)component).sharedMaterial);
				val3.SetTexture("_RemapTex", val);
				((Renderer)component).sharedMaterial = val3;
				SkinnedMeshRenderer component2 = ((Component)pyroTracerColdEffectPrefab.transform.Find("FX/mdlRailgunnerBeam/mdlRailgunnerBeamMesh")).GetComponent<SkinnedMeshRenderer>();
				Material val4 = new Material(((Renderer)component2).sharedMaterial);
				val4.SetTexture("_RemapTex", val);
				((Renderer)component2).sharedMaterial = val4;
				ParticleSystemRenderer component3 = ((Component)pyroTracerColdEffectPrefab.transform.Find("FX/BeamParticles, Rings")).GetComponent<ParticleSystemRenderer>();
				Material val5 = new Material(((Renderer)component3).sharedMaterial);
				val5.SetTexture("_RemapTex", val);
				((Renderer)component3).sharedMaterial = val5;
				component3 = ((Component)pyroTracerColdEffectPrefab.transform.Find("FX/BeamParticles, Rings/BeamParticles, Small")).GetComponent<ParticleSystemRenderer>();
				Material val6 = new Material(((Renderer)component3).sharedMaterial);
				val6.SetTexture("_RemapTex", val);
				((Renderer)component3).sharedMaterial = val6;
				component3 = ((Component)pyroTracerColdEffectPrefab.transform.Find("TracerHead/HarshGlow, Billboard")).GetComponent<ParticleSystemRenderer>();
				Material val7 = new Material(((Renderer)component3).sharedMaterial);
				val7.SetTexture("_RemapTex", val);
				((Renderer)component3).sharedMaterial = val7;
				((Component)pyroTracerColdEffectPrefab.transform.Find("StartTransform/PP")).GetComponent<PostProcessVolume>().sharedProfile = Addressables.LoadAssetAsync<PostProcessProfile>((object)RoR2_DLC3_SolusHeart.ppvSHLaser_asset).WaitForCompletion();
			});
			pyroHitColdEffectPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_Railgunner.ImpactRailgun_prefab).WaitForCompletion(), "PyroHitCold", false);
			TryBuildAsset("Pyro Hit Cold Effect Prefab", delegate
			{
				//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_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Expected O, but got Unknown
				//IL_0070: Unknown result type (might be due to invalid IL or missing references)
				//IL_0076: Expected O, but got Unknown
				//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b2: Expected O, but got Unknown
				//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
				Texture val = Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common_ColorRamps.texRampGolem_png).WaitForCompletion();
				ParticleSystemRenderer component = ((Component)pyroHitColdEffectPrefab.transform.Find("BeamParticles, Small")).GetComponent<ParticleSystemRenderer>();
				Material val2 = new Material(((Renderer)component).sharedMaterial);
				val2.SetTexture("_RemapTex", val);
				((Renderer)component).sharedMaterial = val2;
				component = ((Component)pyroHitColdEffectPrefab.transform.Find("Flash,White")).GetComponent<ParticleSystemRenderer>();
				Material val3 = new Material(((Renderer)component).sharedMaterial);
				val3.SetTexture("_RemapTex", val);
				((Renderer)component).sharedMaterial = val3;
				component = ((Component)pyroHitColdEffectPrefab.transform.Find("Daggers")).GetComponent<ParticleSystemRenderer>();
				Material val4 = new Material(((Renderer)component).sharedMaterial);
				val4.SetTexture("_RemapTex", val);
				((Renderer)component).sharedMaterial = val4;
				MainModule main = ((Component)pyroHitColdEffectPrefab.transform.Find("Shockwave")).GetComponent<ParticleSystem>().main;
				((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(0.89f, 0.13f, 0.11f));
			});
			pyroTracerWarmEffectPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_Railgunner.TracerRailgunSuper_prefab).WaitForCompletion(), "PyroTracerWarm", false);
			TryBuildAsset("Pyro Tracer Warm Effect Prefab", delegate
			{
				//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_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Expected O, but got Unknown
				//IL_005f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0092: Unknown result type (might be due to invalid IL or missing references)
				//IL_0098: Expected O, but got Unknown
				//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d6: Expected O, but got Unknown
				//IL_0110: Unknown result type (might be due to invalid IL or missing references)
				//IL_0117: Expected O, but got Unknown
				//IL_0151: Unknown result type (might be due to invalid IL or missing references)
				//IL_0158: Expected O, but got Unknown
				//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ab: Expected O, but got Unknown
				//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
				Texture val = Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common_ColorRamps.texRampMagmaWorm_png).WaitForCompletion();
				LineRenderer component = ((Component)pyroTracerWarmEffectPrefab.transform.Find("FX/Brief/Beam, Flash Briefly")).GetComponent<LineRenderer>();
				Material val2 = new Material(((Renderer)component).sharedMaterial);
				val2.SetTexture("_RemapTex", val);
				val2.SetFloat("_Boost", 7f);
				val2.SetColor("_TintColor", Color.white);
				((Renderer)component).sharedMaterial = val2;
				component = ((Component)pyroTracerWarmEffectPrefab.transform.Find("FX/Longer/Beam, Linger")).GetComponent<LineRenderer>();
				Material val3 = new Material(((Renderer)component).sharedMaterial);
				val3.SetTexture("_RemapTex", val);
				((Renderer)component).sharedMaterial = val3;
				SkinnedMeshRenderer component2 = ((Component)pyroTracerWarmEffectPrefab.transform.Find("FX/mdlRailgunnerBeam/mdlRailgunnerBeamMesh")).GetComponent<SkinnedMeshRenderer>();
				Material val4 = new Material(((Renderer)component2).sharedMaterial);
				val4.SetTexture("_RemapTex", val);
				((Renderer)component2).sharedMaterial = val4;
				ParticleSystemRenderer component3 = ((Component)pyroTracerWarmEffectPrefab.transform.Find("FX/BeamParticles, Rings")).GetComponent<ParticleSystemRenderer>();
				Material val5 = new Material(((Renderer)component3).sharedMaterial);
				val5.SetTexture("_RemapTex", val);
				((Renderer)component3).sharedMaterial = val5;
				component3 = ((Component)pyroTracerWarmEffectPrefab.transform.Find("FX/BeamParticles, Rings/BeamParticles, Small")).GetComponent<ParticleSystemRenderer>();
				Material val6 = new Material(((Renderer)component3).sharedMaterial);
				val6.SetTexture("_RemapTex", val);
				val6.SetFloat("_AlphaBias", 0.05f);
				((Renderer)component3).sharedMaterial = val6;
				component3 = ((Component)pyroTracerWarmEffectPrefab.transform.Find("TracerHead/HarshGlow, Billboard")).GetComponent<ParticleSystemRenderer>();
				Material val7 = new Material(((Renderer)component3).sharedMaterial);
				val7.SetTexture("_RemapTex", val);
				((Renderer)component3).sharedMaterial = val7;
				((Component)pyroTracerWarmEffectPrefab.transform.Find("StartTransform/PP")).GetComponent<PostProcessVolume>().sharedProfile = Addressables.LoadAssetAsync<PostProcessProfile>((object)RoR2_DLC3_SolusHeart.ppvSHLaser_asset).WaitForCompletion();
			});
			pyroHitWarmEffectPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_Railgunner.ImpactRailgun_prefab).WaitForCompletion(), "PyroHitWarm", false);
			TryBuildAsset("Pyro Hit Warm Effect Prefab", delegate
			{
				//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_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Expected O, but got Unknown
				//IL_0070: Unknown result type (might be due to invalid IL or missing references)
				//IL_0076: Expected O, but got Unknown
				//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b2: Expected O, but got Unknown
				//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_010c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0111: Unknown result type (might be due to invalid IL or missing references)
				Texture val = Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common_ColorRamps.texRampMagmaWorm_png).WaitForCompletion();
				ParticleSystemRenderer component = ((Component)pyroHitWarmEffectPrefab.transform.Find("BeamParticles, Small")).GetComponent<ParticleSystemRenderer>();
				Material val2 = new Material(((Renderer)component).sharedMaterial);
				val2.SetTexture("_RemapTex", val);
				((Renderer)component).sharedMaterial = val2;
				component = ((Component)pyroHitWarmEffectPrefab.transform.Find("Flash,White")).GetComponent<ParticleSystemRenderer>();
				Material val3 = new Material(((Renderer)component).sharedMaterial);
				val3.SetTexture("_RemapTex", val);
				((Renderer)component).sharedMaterial = val3;
				component = ((Component)pyroHitWarmEffectPrefab.transform.Find("Daggers")).GetComponent<ParticleSystemRenderer>();
				Material val4 = new Material(((Renderer)component).sharedMaterial);
				val4.SetTexture("_RemapTex", val);
				val4.SetFloat("_AlphaBias", 0f);
				((Renderer)component).sharedMaterial = val4;
				MainModule main = ((Component)pyroHitWarmEffectPrefab.transform.Find("Shockwave")).GetComponent<ParticleSystem>().main;
				((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(0.89f, 0.67f, 0.11f));
			});
			pyroTracerHotEffectPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_Railgunner.TracerRailgunSuper_prefab).WaitForCompletion(), "PyroTracerHot", false);
			TryBuildAsset("Pyro Tracer Hot Effect Prefab", delegate
			{
				//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_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Expected O, but got Unknown
				//IL_005f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0092: Unknown result type (might be due to invalid IL or missing references)
				//IL_0098: Expected O, but got Unknown
				//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d6: Expected O, but got Unknown
				//IL_0110: Unknown result type (might be due to invalid IL or missing references)
				//IL_0117: Expected O, but got Unknown
				//IL_0151: Unknown result type (might be due to invalid IL or missing references)
				//IL_0158: Expected O, but got Unknown
				//IL_0192: Unknown result type (might be due to invalid IL or missing references)
				//IL_0199: Expected O, but got Unknown
				Texture val = Addressables.LoadAssetAsync<Texture>((object)RoR2_DLC1_Common_ColorRamps.texRampMinorConstructProjectile_png).WaitForCompletion();
				LineRenderer component = ((Component)pyroTracerHotEffectPrefab.transform.Find("FX/Brief/Beam, Flash Briefly")).GetComponent<LineRenderer>();
				Material val2 = new Material(((Renderer)component).sharedMaterial);
				val2.SetTexture("_RemapTex", val);
				val2.SetFloat("_Boost", 7f);
				val2.SetColor("_TintColor", Color.white);
				((Renderer)component).sharedMaterial = val2;
				component = ((Component)pyroTracerHotEffectPrefab.transform.Find("FX/Longer/Beam, Linger")).GetComponent<LineRenderer>();
				Material val3 = new Material(((Renderer)component).sharedMaterial);
				val3.SetTexture("_RemapTex", val);
				((Renderer)component).sharedMaterial = val3;
				SkinnedMeshRenderer component2 = ((Component)pyroTracerHotEffectPrefab.transform.Find("FX/mdlRailgunnerBeam/mdlRailgunnerBeamMesh")).GetComponent<SkinnedMeshRenderer>();
				Material val4 = new Material(((Renderer)component2).sharedMaterial);
				val4.SetTexture("_RemapTex", val);
				((Renderer)component2).sharedMaterial = val4;
				ParticleSystemRenderer component3 = ((Component)pyroTracerHotEffectPrefab.transform.Find("FX/BeamParticles, Rings")).GetComponent<ParticleSystemRenderer>();
				Material val5 = new Material(((Renderer)component3).sharedMaterial);
				val5.SetTexture("_RemapTex", val);
				((Renderer)component3).sharedMaterial = val5;
				component3 = ((Component)pyroTracerHotEffectPrefab.transform.Find("FX/BeamParticles, Rings/BeamParticles, Small")).GetComponent<ParticleSystemRenderer>();
				Material val6 = new Material(((Renderer)component3).sharedMaterial);
				val6.SetTexture("_RemapTex", val);
				((Renderer)component3).sharedMaterial = val6;
				component3 = ((Component)pyroTracerHotEffectPrefab.transform.Find("TracerHead/HarshGlow, Billboard")).GetComponent<ParticleSystemRenderer>();
				Material val7 = new Material(((Renderer)component3).sharedMaterial);
				val7.SetTexture("_RemapTex", val);
				((Renderer)component3).sharedMaterial = val7;
			});
			pyroHitHotEffectPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_Railgunner.ImpactRailgun_prefab).WaitForCompletion(), "PyroHitHot", false);
			TryBuildAsset("Pyro Hit Hot Effect Prefab", delegate
			{
				//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_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Expected O, but got Unknown
				//IL_0070: Unknown result type (might be due to invalid IL or missing references)
				//IL_0076: Expected O, but got Unknown
				//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b2: Expected O, but got Unknown
				//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_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)
				Texture val = Addressables.LoadAssetAsync<Texture>((object)RoR2_DLC1_Common_ColorRamps.texRampMinorConstructProjectile_png).WaitForCompletion();
				ParticleSystemRenderer component = ((Component)pyroHitHotEffectPrefab.transform.Find("BeamParticles, Small")).GetComponent<ParticleSystemRenderer>();
				Material val2 = new Material(((Renderer)component).sharedMaterial);
				val2.SetTexture("_RemapTex", val);
				((Renderer)component).sharedMaterial = val2;
				component = ((Component)pyroHitHotEffectPrefab.transform.Find("Flash,White")).GetComponent<ParticleSystemRenderer>();
				Material val3 = new Material(((Renderer)component).sharedMaterial);
				val3.SetTexture("_RemapTex", val);
				((Renderer)component).sharedMaterial = val3;
				component = ((Component)pyroHitHotEffectPrefab.transform.Find("Daggers")).GetComponent<ParticleSystemRenderer>();
				Material val4 = new Material(((Renderer)component).sharedMaterial);
				val4.SetTexture("_RemapTex", val);
				val4.SetFloat("_AlphaBias", 0f);
				((Renderer)component).sharedMaterial = val4;
				MainModule main = ((Component)pyroHitHotEffectPrefab.transform.Find("Shockwave")).GetComponent<ParticleSystem>().main;
				((MainModule)(ref main)).startColor = new MinMaxGradient(Color.white);
			});
			Content.CreateAndAddEffectDef(pyroTracerColdEffectPrefab);
			Content.CreateAndAddEffectDef(pyroHitColdEffectPrefab);
			Content.CreateAndAddEffectDef(pyroTracerWarmEffectPrefab);
			Content.CreateAndAddEffectDef(pyroHitWarmEffectPrefab);
			Content.CreateAndAddEffectDef(pyroTracerHotEffectPrefab);
			Content.CreateAndAddEffectDef(pyroHitHotEffectPrefab);
		}

		private static void GiveAkBanksToObject(GameObject obj, AkBank[] banks)
		{
			foreach (AkBank val in banks)
			{
				if ((Object)(object)val != (Object)null)
				{
					AkBank val2 = obj.AddComponent<AkBank>();
					((AkTriggerHandler)val2).triggerList = ((AkTriggerHandler)val).triggerList;
					val2.data.WwiseObjectReference = val.data.WwiseObjectReference;
					val2.unloadTriggerList = val.unloadTriggerList;
				}
			}
		}
	}
	internal class Content
	{
		internal static void Init()
		{
			Assets.Init();
			InitSkills();
			InitStates();
		}

		private static void InitSkills()
		{
			new CookSkill().Init();
			new CallRailgunStrikeSkill().Init();
			new PrepRailgunStrikeSkill().Init();
			new ChargeSnipePyroSkill().Init();
			new FireSnipePyroSkill().Init();
		}

		private static void InitStates()
		{
			ContentPacks.entityStates.Add(typeof(CookItem));
			ContentPacks.entityStates.Add(typeof(SetupRailgunStrike));
			ContentPacks.entityStates.Add(typeof(CallRailgunStrikeEnter));
			ContentPacks.entityStates.Add(typeof(CallRailgunStrikeBase));
			ContentPacks.entityStates.Add(typeof(CallRailgunStrike));
			ContentPacks.entityStates.Add(typeof(ChargeSnipePyro));
			ContentPacks.entityStates.Add(typeof(ChargingPyro));
			ContentPacks.entityStates.Add(typeof(ChargedPyro));
			ContentPacks.entityStates.Add(typeof(ExpiredPyro));
			ContentPacks.entityStates.Add(typeof(OnlinePyro));
			ContentPacks.entityStates.Add(typeof(UsePyro));
			ContentPacks.entityStates.Add(typeof(FireSnipePyro));
			ContentPacks.entityStates.Add(typeof(WindupSnipePyro));
		}

		internal static void AddEffectDef(EffectDef effectDef)
		{
			ContentPacks.effectDefs.Add(effectDef);
		}

		internal static EffectDef CreateAndAddEffectDef(GameObject effectPrefab)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			EffectDef val = new EffectDef(effectPrefab);
			AddEffectDef(val);
			return val;
		}
	}
	internal class ContentPacks : IContentPackProvider
	{
		internal ContentPack contentPack = new ContentPack();

		public static List<GameObject> bodyPrefabs = new List<GameObject>();

		public static List<GameObject> masterPrefabs = new List<GameObject>();

		public static List<GameObject> projectilePrefabs = new List<GameObject>();

		public static List<SurvivorDef> survivorDefs = new List<SurvivorDef>();

		public static List<UnlockableDef> unlockableDefs = new List<UnlockableDef>();

		public static List<SkillFamily> skillFamilies = new List<SkillFamily>();

		public static List<SkillDef> skillDefs = new List<SkillDef>();

		public static List<Type> entityStates = new List<Type>();

		public static List<BuffDef> buffDefs = new List<BuffDef>();

		public static List<EffectDef> effectDefs = new List<EffectDef>();

		public static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>();

		public static List<GameObject> networkedObjectPrefabs = new List<GameObject>();

		public static List<ItemDef> itemDefs = new List<ItemDef>();

		public static List<ItemTierDef> itemTierDefs = new List<ItemTierDef>();

		public string identifier => "mwmw.FenrisSkills";

		public void Init()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders);
		}

		private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider)
		{
			addContentPackProvider.Invoke((IContentPackProvider)(object)this);
		}

		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			contentPack.identifier = identifier;
			contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray());
			contentPack.masterPrefabs.Add(masterPrefabs.ToArray());
			contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray());
			contentPack.survivorDefs.Add(survivorDefs.ToArray());
			contentPack.unlockableDefs.Add(unlockableDefs.ToArray());
			contentPack.skillDefs.Add(skillDefs.ToArray());
			contentPack.skillFamilies.Add(skillFamilies.ToArray());
			contentPack.entityStateTypes.Add(entityStates.ToArray());
			contentPack.buffDefs.Add(buffDefs.ToArray());
			contentPack.effectDefs.Add(effectDefs.ToArray());
			contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray());
			contentPack.networkedObjectPrefabs.Add(networkedObjectPrefabs.ToArray());
			contentPack.itemDefs.Add(itemDefs.ToArray());
			contentPack.itemTierDefs.Add(itemTierDefs.ToArray());
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
		{
			ContentPack.Copy(contentPack, args.output);
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			args.ReportProgress(1f);
			yield break;
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("mwmw.FenrisSkills", "FenrisSkills", "1.0.0")]
	public class FenrisSkills : BaseUnityPlugin
	{
		public const string PluginGUID = "mwmw.FenrisSkills";

		public const string PluginAuthor = "mwmw";

		public const string PluginName = "FenrisSkills";

		public const string PluginVersion = "1.0.0";

		public static ConfigFile config;

		public void Awake()
		{
			config = ((BaseUnityPlugin)this).Config;
			Log.Init(((BaseUnityPlugin)this).Logger);
			Content.Init();
			Options.Init();
			new ContentPacks().Init();
			RoR2Application.onLoadFinished = (Action)Delegate.Combine(RoR2Application.onLoadFinished, new Action(OnLoadFinished));
		}

		private void OnLoadFinished()
		{
			Assets.railCannonProjectilePrefab.GetComponent<ProjectileImpactExplosion>().impactEffect = Assets.railCannonImpactPrefab;
		}
	}
	internal static class Log
	{
		private 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 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);
		}
	}
	public class Options
	{
		private static bool? _rooEnabled;

		public static ConfigEntry<bool> produceStrongFoods;

		public static ConfigEntry<float> pyroMinDamageCoeff;

		public static ConfigEntry<float> pyroMaxDamageCoeff;

		public static ConfigEntry<float> pyroDmgIncreaseSpd;

		public static ConfigEntry<float> pyroSelfDmgTimerMult;

		public static bool rooEnabled
		{
			get
			{
				if (!_rooEnabled.HasValue)
				{
					_rooEnabled = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");
				}
				return _rooEnabled.Value;
			}
		}

		public static void Init()
		{
			produceStrongFoods = FenrisSkills.config.Bind<bool>("CHEF: Cook", "Produce Strong Foods", false, "Whether or not the Cook skill can produce a permanent Ultimate Meal or Sautéed Worms, given the ingredients.");
			pyroMinDamageCoeff = FenrisSkills.config.Bind<float>("Railgunner: Pyrocharge", "Min Damage Coeff.", 10f, "The damage coefficient of Pyrocharge immediately upon activation.");
			pyroMaxDamageCoeff = FenrisSkills.config.Bind<float>("Railgunner: Pyrocharge", "Max Damage Coeff.", 80f, "The damage coefficient of Pyrocharge if charged to max.");
			pyroDmgIncreaseSpd = FenrisSkills.config.Bind<float>("Railgunner: Pyrocharge", "Damage Increase Speed", 0.18f, "How fast the damage of Pyrocharge increases along its logarithmic curve.");
			pyroSelfDmgTimerMult = FenrisSkills.config.Bind<float>("Railgunner: Pyrocharge", "Self-Damage Timer Mult.", 0.9f, "The multiplier for the time between self-burn stacks. Smaller values mean faster stacks.");
			if (rooEnabled)
			{
				RoOInit();
			}
		}

		public static void OnLoadFinished()
		{
		}

		private static void RoOInit()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: 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_0046: Expected O, but got Unknown
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: 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_007c: Expected O, but got Unknown
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Expected O, but got Unknown
			//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_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Expected O, but got Unknown
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Expected O, but got Unknown
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(produceStrongFoods, new CheckBoxConfig()));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(pyroMinDamageCoeff, new StepSliderConfig
			{
				min = 0f,
				max = 1000f,
				increment = 1f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(pyroMaxDamageCoeff, new StepSliderConfig
			{
				min = 0f,
				max = 1000f,
				increment = 1f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(pyroDmgIncreaseSpd, new StepSliderConfig
			{
				min = 0f,
				max = 100f,
				increment = 0.001f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(pyroSelfDmgTimerMult, new StepSliderConfig
			{
				min = 0f,
				max = 1f,
				increment = 0.001f
			}));
			ModSettingsManager.SetModDescription("Config options for FenrisSkills.");
			ModSettingsManager.SetModIcon(Assets.assetBundle.LoadAsset<Sprite>("icon"));
		}
	}
	public static class Utils
	{
		public static Random random = new Random();

		public static SphereSearch ExcludeByBuff(this SphereSearch self, BuffDef buff)
		{
			for (int num = self.searchData.candidatesCount - 1; num >= 0; num--)
			{
				HurtBox hurtBox = ((SearchData)(ref self.searchData)).GetCandidate(num).hurtBox;
				bool? obj;
				if (hurtBox == null)
				{
					obj = null;
				}
				else
				{
					HealthComponent healthComponent = hurtBox.healthComponent;
					if (healthComponent == null)
					{
						obj = null;
					}
					else
					{
						CharacterBody body = healthComponent.body;
						obj = ((body != null) ? new bool?(!body.HasBuff(buff)) : ((bool?)null));
					}
				}
				if ((!obj) ?? false)
				{
					((SearchData)(ref self.searchData)).RemoveCandidate(num);
				}
			}
			return self;
		}

		public static TSource RandomOrDefault<TSource>(this IList<TSource> enumerable)
		{
			if (enumerable.Count > 0)
			{
				return enumerable[Random.Range(0, enumerable.Count - 1)];
			}
			return default(TSource);
		}
	}
}
namespace FenrisSkills.Skills
{
	public abstract class BaseCaptainOrbitalSkill<T> : BaseSkill<T> where T : BaseCaptainOrbitalSkill<T>
	{
		protected virtual Sprite disabledIcon => Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_Captain.texCaptainSkillIcons_png_texCaptainSkillIcons_4_).WaitForCompletion();

		protected virtual string disabledNameToken => "CAPTAIN_SKILL_DISCONNECT_NAME";

		protected virtual string disabledDescriptionToken => "CAPTAIN_SKILL_DISCONNECT_DESCRIPTION";

		protected override Type skillDefType => typeof(CaptainOrbitalSkillDef);

		protected override void CreateSkill()
		{
			base.CreateSkill();
			SkillDef obj = BaseSkill<T>.skillDef;
			CaptainOrbitalSkillDef val = (CaptainOrbitalSkillDef)(object)((obj is CaptainOrbitalSkillDef) ? obj : null);
			val.disabledIcon = disabledIcon;
			val.disabledNameToken = disabledNameToken;
			val.disabledDescriptionToken = disabledDescriptionToken;
		}
	}
	public abstract class BaseRailgunSkillDef<T> : BaseSkill<T> where T : BaseRailgunSkillDef<T>
	{
		protected virtual Sprite offlineIcon => Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_Captain.texCaptainSkillIcons_png_texCaptainSkillIcons_4_).WaitForCompletion();

		protected virtual bool restockOnReload => false;

		protected override Type skillDefType => typeof(RailgunSkillDef);

		protected override void CreateSkill()
		{
			base.CreateSkill();
			SkillDef obj = BaseSkill<T>.skillDef;
			RailgunSkillDef val = (RailgunSkillDef)(object)((obj is RailgunSkillDef) ? obj : null);
			val.offlineIcon = offlineIcon;
			val.restockOnReload = restockOnReload;
		}
	}
	public abstract class BaseSkill<T> where T : BaseSkill<T>
	{
		public enum Skill
		{
			Primary,
			Secondary,
			Utility,
			Special
		}

		public static SkillDef skillDef;

		protected abstract string skillName { get; }

		protected abstract string skillDescription { get; }

		protected abstract Type activationState { get; }

		protected abstract string activationStateMachineName { get; }

		protected abstract GameObject bodyPrefab { get; }

		protected abstract Skill skillCategory { get; }

		protected abstract Sprite icon { get; }

		protected abstract int baseMaxStock { get; }

		protected abstract float baseRechargeInterval { get; }

		protected abstract bool beginSkillCooldownOnSkillEnd { get; }

		protected abstract bool canceledFromSprinting { get; }

		protected abstract bool cancelSprintingOnActivation { get; }

		protected abstract bool fullRestockOnAssign { get; }

		protected abstract InterruptPriority interruptPriority { get; }

		protected abstract bool isCombatSkill { get; }

		protected abstract bool mustKeyPress { get; }

		protected abstract int rechargeStock { get; }

		protected abstract int requiredStock { get; }

		protected abstract int stockToConsume { get; }

		protected virtual bool addToSkillFamily => true;

		protected virtual Type skillDefType => typeof(SkillDef);

		protected virtual void CreateSkill()
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Expected O, but got Unknown
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			string text = "FenrisSkills".ToUpper() + "_" + Regex.Replace(skillName.ToUpper(), "[\\s\\p{P}]", "");
			ScriptableObject obj = ScriptableObject.CreateInstance(skillDefType);
			skillDef = (SkillDef)(object)((obj is SkillDef) ? obj : null);
			skillDef.activationState = new SerializableEntityStateType(activationState);
			skillDef.activationStateMachineName = activationStateMachineName;
			skillDef.baseMaxStock = baseMaxStock;
			skillDef.baseRechargeInterval = baseRechargeInterval;
			skillDef.beginSkillCooldownOnSkillEnd = beginSkillCooldownOnSkillEnd;
			skillDef.canceledFromSprinting = canceledFromSprinting;
			skillDef.cancelSprintingOnActivation = cancelSprintingOnActivation;
			skillDef.fullRestockOnAssign = fullRestockOnAssign;
			skillDef.interruptPriority = interruptPriority;
			skillDef.isCombatSkill = isCombatSkill;
			skillDef.mustKeyPress = mustKeyPress;
			skillDef.rechargeStock = rechargeStock;
			skillDef.requiredStock = requiredStock;
			skillDef.stockToConsume = stockToConsume;
			skillDef.icon = icon;
			skillDef.skillDescriptionToken = text + "_DESC";
			skillDef.skillName = "{prefix}_NAME";
			skillDef.skillNameToken = text + "_NAME";
			LanguageAPI.Add(text + "_NAME", skillName);
			LanguageAPI.Add(text + "_DESC", skillDescription);
			ContentPacks.skillDefs.Add(skillDef);
			if (addToSkillFamily)
			{
				SkillLocator component = bodyPrefab.GetComponent<SkillLocator>();
				SkillFamily val = null;
				switch (skillCategory)
				{
				case Skill.Primary:
					val = component.primary.skillFamily;
					break;
				case Skill.Secondary:
					val = component.secondary.skillFamily;
					break;
				case Skill.Utility:
					val = component.utility.skillFamily;
					break;
				case Skill.Special:
					val = component.special.skillFamily;
					break;
				}
				Array.Resize(ref val.variants, val.variants.Length + 1);
				Variant[] variants = val.variants;
				int num = variants.Length - 1;
				Variant val2 = new Variant
				{
					skillDef = skillDef,
					unlockableDef = null
				};
				((Variant)(ref val2)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null);
				variants[num] = val2;
			}
		}

		public void Init()
		{
			CreateSkill();
		}
	}
	public class CallRailgunStrikeSkill : BaseSkill<CallRailgunStrikeSkill>
	{
		protected override string skillName => "OGM-84 'ATLAS' Strike";

		protected override string skillDescription => "<style=cIsDamage>Stunning</style>. Request an <style=cIsDamage>orbital railcannon strike</style> from the <style=cIsDamage>UES Safe Travels</style>, dealing <style=cIsDamage>3000% damage</style>, or <style=cIsDamage>4500% damage</style> on a critical hit.";

		protected override Type activationState => typeof(CallRailgunStrikeEnter);

		protected override string activationStateMachineName => "Weapon";

		protected override GameObject bodyPrefab => Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Captain.CaptainBody_prefab).WaitForCompletion();

		protected override Skill skillCategory => Skill.Primary;

		protected override Sprite icon => Assets.assetBundle.LoadAsset<Sprite>("texRailCannon");

		protected override int baseMaxStock => 1;

		protected override float baseRechargeInterval => 0f;

		protected override bool beginSkillCooldownOnSkillEnd => false;

		protected override bool canceledFromSprinting => true;

		protected override bool cancelSprintingOnActivation => true;

		protected override bool fullRestockOnAssign => true;

		protected override InterruptPriority interruptPriority => (InterruptPriority)2;

		protected override bool isCombatSkill => true;

		protected override bool mustKeyPress => true;

		protected override int rechargeStock => 0;

		protected override int requiredStock => 1;

		protected override int stockToConsume => 1;

		protected override bool addToSkillFamily => false;
	}
	public class ChargeSnipePyroSkill : BaseRailgunSkillDef<ChargeSnipePyroSkill>
	{
		protected override string skillName => "Pyrocharge";

		protected override string skillDescription => "<style=cIsDamage>Ignite</style>. Fire a piercing round for <style=cIsDamage>1000%-8000% damage</style>. Damage increases the longer you hold the skill. Holding the skill causes you to <style=cIsHealth>overheat</style>, taking rapidly increasing damage.";

		protected override Type activationState => typeof(ChargeSnipePyro);

		protected override string activationStateMachineName => "Weapon";

		protected override GameObject bodyPrefab => Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_Railgunner.RailgunnerBody_prefab).WaitForCompletion();

		protected override Skill skillCategory => Skill.Special;

		protected override Sprite icon => Assets.assetBundle.LoadAsset<Sprite>("texPyroSnipe");

		protected override int baseMaxStock => 1;

		protected override float baseRechargeInterval => 12f;

		protected override bool beginSkillCooldownOnSkillEnd => false;

		protected override bool canceledFromSprinting => false;

		protected override bool cancelSprintingOnActivation => true;

		protected override bool fullRestockOnAssign => true;

		protected override InterruptPriority interruptPriority => (InterruptPriority)1;

		protected override bool isCombatSkill => false;

		protected override bool mustKeyPress => false;

		protected override int rechargeStock => 1;

		protected override int requiredStock => 1;

		protected override int stockToConsume => 1;
	}
	public class CookSkill : BaseSkill<CookSkill>
	{
		protected override string skillName => "Cook";

		protected override string skillDescription => "Produce <style=cIsUtility>4 food-related temporary items</style>. Has a small chance to produce <style=cIsUtility>permanent meal items</style> if you have the correct ingredients.";

		protected override Type activationState => typeof(CookItem);

		protected override string activationStateMachineName => "Weapon";

		protected override GameObject bodyPrefab => Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_Chef.ChefBody_prefab).WaitForCompletion();

		protected override Skill skillCategory => Skill.Special;

		protected override Sprite icon => Assets.assetBundle.LoadAsset<Sprite>("texChefCook");

		protected override int baseMaxStock => 1;

		protected override float baseRechargeInterval => 35f;

		protected override bool beginSkillCooldownOnSkillEnd => false;

		protected override bool canceledFromSprinting => false;

		protected override bool cancelSprintingOnActivation => true;

		protected override bool fullRestockOnAssign => true;

		protected override InterruptPriority interruptPriority => (InterruptPriority)2;

		protected override bool isCombatSkill => false;

		protected override bool mustKeyPress => true;

		protected override int rechargeStock => 1;

		protected override int requiredStock => 1;

		protected override int stockToConsume => 1;
	}
	public class FireSnipePyroSkill : BaseRailgunSkillDef<FireSnipePyroSkill>
	{
		protected override string skillName => "Pyrocharged Railgun";

		protected override string skillDescription => "<style=cIsDamage>Ignite</style>. Launch a super-heated projectile for <style=cIsDamage>1000%-8000% damage</style>.";

		protected override Type activationState => typeof(WindupSnipePyro);

		protected override string activationStateMachineName => "Weapon";

		protected override GameObject bodyPrefab => Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_Railgunner.RailgunnerBody_prefab).WaitForCompletion();

		protected override Skill skillCategory => Skill.Special;

		protected override Sprite icon => Assets.assetBundle.LoadAsset<Sprite>("texPyroSnipeFire");

		protected override int baseMaxStock => 1;

		protected override float baseRechargeInterval => 1f;

		protected override bool beginSkillCooldownOnSkillEnd => false;

		protected override bool canceledFromSprinting => false;

		protected override bool cancelSprintingOnActivation => true;

		protected override bool fullRestockOnAssign => true;

		protected override InterruptPriority interruptPriority => (InterruptPriority)1;

		protected override bool isCombatSkill => true;

		protected override bool mustKeyPress => false;

		protected override int rechargeStock => 1;

		protected override int requiredStock => 1;

		protected override int stockToConsume => 1;

		protected override bool addToSkillFamily => false;
	}
	public class PrepRailgunStrikeSkill : BaseCaptainOrbitalSkill<PrepRailgunStrikeSkill>
	{
		protected override string skillName => "OGM-84 'ATLAS' Strike";

		protected override string skillDescription => "<style=cIsDamage>Stunning</style>. Request up to <style=cIsDamage>3</style> orbital railcannon strikes from the <style=cIsDamage>UES Safe Travels</style>. Each strike deals <style=cIsDamage>750% damage</style>, or <style=cIsDamage>1500% damage</style> on a critical hit.";

		protected override Type activationState => typeof(SetupRailgunStrike);

		protected override string activationStateMachineName => "Skillswap";

		protected override GameObject bodyPrefab => Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Captain.CaptainBody_prefab).WaitForCompletion();

		protected override Skill skillCategory => Skill.Utility;

		protected override Sprite icon => Assets.assetBundle.LoadAsset<Sprite>("texRailCannon");

		protected override int baseMaxStock => 1;

		protected override float baseRechargeInterval => 16f;

		protected override bool beginSkillCooldownOnSkillEnd => true;

		protected override bool canceledFromSprinting => true;

		protected override bool cancelSprintingOnActivation => true;

		protected override bool fullRestockOnAssign => true;

		protected override InterruptPriority interruptPriority => (InterruptPriority)2;

		protected override bool isCombatSkill => true;

		protected override bool mustKeyPress => true;

		protected override int rechargeStock => 1;

		protected override int requiredStock => 1;

		protected override int stockToConsume => 1;
	}
}
namespace FenrisSkills.Skills.States.Railgunner
{
	public class ChargedPyro : BaseCharged
	{
		private const float applyDotMaxTime = 0.5f;

		private const float applyDotMinTime = 0.05f;

		public float damageCoefficient = minCoeff;

		private float currentApplyDotTime = 0.5f;

		private float applyDotStopwatch = 0.5f;

		private DotController dotController;

		private PyroUIColorController colorController;

		private static Color[] gradient = (Color[])(object)new Color[6]
		{
			new Color(0.27f, 0.08f, 0f),
			new Color(1f, 0.14f, 0.14f),
			new Color(1f, 0.58f, 0.04f),
			new Color(1f, 0.98f, 0.75f),
			Color.white,
			Color.white
		};

		public static GameObject pyroCrosshairOverridePrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_Railgunner.RailgunnerSuperchargeCrosshair_prefab).WaitForCompletion();

		public static LoopSoundDef pyroLoopSoundDef = Addressables.LoadAssetAsync<LoopSoundDef>((object)RoR2_DLC1_Railgunner.lsdRailgunnerBackpackCharged_asset).WaitForCompletion();

		public static float minCoeff => Options.pyroMinDamageCoeff.Value;

		public static float maxCoeff => Options.pyroMaxDamageCoeff.Value;

		public static float damageIncreaseSpd => Options.pyroDmgIncreaseSpd.Value;

		private static float applyDotTimeReductionMult => Options.pyroSelfDmgTimerMult.Value;

		public override void OnEnter()
		{
			Util.PlaySound("Play_lemurianBruiser_m1_fly_loop", ((EntityState)this).gameObject);
			base.crosshairOverridePrefab = pyroCrosshairOverridePrefab;
			base.animationStateName = "Charged";
			base.animationPlaybackRateParam = "Backpack.playbackRate";
			base.animationLayerName = "Backpack";
			base.primaryOverride = BaseSkill<FireSnipePyroSkill>.skillDef;
			base.overlayPrefab = Assets.pyroOverlayPrefab;
			base.overlayChildLocatorEntry = "CrosshairExtras";
			((BaseBackpack)this).mecanimBoolName = "isBackpackActive";
			((BaseBackpack)this).loopSoundDef = pyroLoopSoundDef;
			((BaseBackpack)this).enterSoundString = "Play_railgunner_R_gun_ready";
			base.duration = 9999f;
			((BaseCharged)this).OnEnter();
			base.overlayController.onInstanceAdded += delegate(OverlayController controller, GameObject instance)
			{
				colorController = instance.GetComponent<PyroUIColorController>();
			};
		}

		public override void FixedUpdate()
		{
			//IL_017d: 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_01e0: 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_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			((BaseCharged)this).FixedUpdate();
			damageCoefficient = Mathf.Lerp(damageCoefficient, maxCoeff, damageIncreaseSpd * Time.deltaTime);
			if (base.duration > 0f)
			{
				float num = damageCoefficient / maxCoeff;
				foreach (ImageFillController fillUi in base.fillUiList)
				{
					fillUi.SetTValue(num);
				}
				if (Object.op_Implicit((Object)(object)colorController) && gradient.Length > 2)
				{
					float num2 = 1f / (float)(gradient.Length - 1);
					int num3 = Mathf.Clamp(Mathf.FloorToInt((float)(gradient.Length - 1) * num), 0, gradient.Length - 2);
					Color color = Color.Lerp(gradient[num3], gradient[num3 + 1], (num - num2 * (float)num3) / num2);
					colorController.UpdateColors(color);
				}
			}
			if (!NetworkServer.active)
			{
				return;
			}
			applyDotStopwatch += Time.deltaTime;
			if (!(applyDotStopwatch > currentApplyDotTime))
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).healthComponent))
			{
				while (applyDotStopwatch >= currentApplyDotTime)
				{
					InflictDotInfo val = new InflictDotInfo
					{
						victimObject = ((EntityState)this).gameObject,
						attackerObject = ((EntityState)this).gameObject,
						totalDamage = ((EntityState)this).healthComponent.fullHealth * 0.1f,
						dotIndex = (DotIndex)1,
						damageMultiplier = 1f,
						hitHurtBox = ((EntityState)this).characterBody.mainHurtBox
					};
					DotController.InflictDot(ref val);
					if (!Object.op_Implicit((Object)(object)dotController))
					{
						DotController.dotControllerLocator.TryGetValue(((Object)((EntityState)this).gameObject).GetInstanceID(), out dotController);
					}
					if (Object.op_Implicit((Object)(object)dotController) && dotController.dotStackList.Count > 0)
					{
						List<DotStack> dotStackList = dotController.dotStackList;
						dotStackList[dotStackList.Count - 1].timer = 0.5f;
						List<DotStack> dotStackList2 = dotController.dotStackList;
						dotStackList2[dotStackList2.Count - 1].totalDuration = 0.5f;
					}
					applyDotStopwatch -= currentApplyDotTime;
				}
			}
			applyDotStopwatch = 0f;
			currentApplyDotTime = Mathf.Clamp(currentApplyDotTime * applyDotTimeReductionMult, 0.05f, 0.5f);
		}

		public override EntityState InstantiateExpiredState()
		{
			return (EntityState)(object)new ExpiredPyro();
		}
	}
	public class ChargeSnipePyro : BaseChargeSnipe
	{
		public override void OnEnter()
		{
			base.baseDuration = 2f;
			base.animationStateName = "ChargeSuper";
			base.animationPlaybackRateParam = "Super.playbackRate";
			base.animationLayerName = "Gesture, Override";
			((BaseChargeSnipe)this).OnEnter();
		}

		public override EntityState InstantiateBackpackState()
		{
			return (EntityState)(object)new ChargingPyro();
		}
	}
	public class ChargingPyro : BaseCharging
	{
		public static GameObject pyroCrosshairOverridePrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_UI.SimpleDotCrosshair_prefab).WaitForCompletion();

		public static LoopSoundDef pyroLoopSoundDef = Addressables.LoadAssetAsync<LoopSoundDef>((object)RoR2_DLC1_Railgunner.lsdRailgunnerBackpackCharging_asset).WaitForCompletion();

		public override void OnEnter()
		{
			((BaseBackpack)this).mecanimBoolName = "mecanimBoolName";
			((BaseBackpack)this).loopSoundDef = pyroLoopSoundDef;
			((BaseBackpack)this).enterSoundString = "Play_railgunner_R_gun_swap";
			base.crosshairOverridePrefab = pyroCrosshairOverridePrefab;
			base.baseDuration = 2f;
			base.animationStateName = "Charging";
			base.animationPlaybackRateParam = "Backpack.playbackRate";
			base.animationLayerName = "Backpack";
			base.overlayPrefab = Assets.pyroOverlayPrefab;
			base.overlayChildLocatorEntry = "CrosshairExtras";
			((BaseCharging)this).OnEnter();
		}

		public override EntityState InstantiateChargedState()
		{
			return (EntityState)(object)new ChargedPyro();
		}
	}
	public class ExpiredPyro : BaseExpired
	{
		public override void OnEnter()
		{
			base.animationStateName = "Expired";
			base.animationPlaybackRateParam = "Backpack.playbackRate";
			base.animationLayerName = "Backpack";
			base.forceShieldRegen = true;
			base.duration = 0.5f;
			((BaseExpired)this).OnEnter();
		}

		public override EntityState InstantiateNextState()
		{
			return (EntityState)(object)new OnlinePyro();
		}
	}
	public class FireSnipePyro : BaseFireSnipe
	{
		public static GameObject pyroMuzzleFlashPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common_VFX.Muzzleflash1_prefab).WaitForCompletion();

		public override void OnEnter()
		{
			EntityStateMachine val = ((EntityState)this).FindSiblingStateMachine("Backpack");
			if (Object.op_Implicit((Object)(object)val) && val.state is ChargedPyro chargedPyro)
			{
				((GenericBulletBaseState)this).damageCoefficient = chargedPyro.damageCoefficient;
			}
			else
			{
				((GenericBulletBaseState)this).damageCoefficient = ChargedPyro.minCoeff;
			}
			Util.PlaySound("Stop_lemurianBruiser_m1_fly_loop", ((EntityState)this).gameObject);
			if (((GenericBulletBaseState)this).damageCoefficient > ChargedPyro.maxCoeff * 0.75f)
			{
				((GenericBulletBaseState)this).hitEffectPrefab = Assets.pyroHitHotEffectPrefab;
				((GenericBulletBaseState)this).tracerEffectPrefab = Assets.pyroTracerHotEffectPrefab;
			}
			else if (((GenericBulletBaseState)this).damageCoefficient > ChargedPyro.maxCoeff * 0.45f)
			{
				((GenericBulletBaseState)this).hitEffectPrefab = Assets.pyroHitWarmEffectPrefab;
				((GenericBulletBaseState)this).tracerEffectPrefab = Assets.pyroTracerWarmEffectPrefab;
			}
			else
			{
				((GenericBulletBaseState)this).hitEffectPrefab = Assets.pyroHitColdEffectPrefab;
				((GenericBulletBaseState)this).tracerEffectPrefab = Assets.pyroTracerColdEffectPrefab;
			}
			base.headshotSoundString = "Play_railgunner_m2_headshot";
			((GenericBulletBaseState)this).force = 4000f;
			((GenericBulletBaseState)this).fireSoundString = "Play_railgunner_R_fire";
			base.critDamageMultiplier = 1f;
			((GenericBulletBaseState)this).bulletRadius = 2f;
			((GenericBulletBaseState)this).bulletCount = 1;
			((GenericBulletBaseState)this).baseDuration = 1f;
			base.animationStateName = "FireSuper";
			base.animationPlaybackRateParam = "Super.playbackRate";
			base.animationLayerName = "Gesture, Override";
			((GenericBulletBaseState)this).recoilAmplitudeY = 6f;
			((GenericBulletBaseState)this).recoilAmplitudeX = 1f;
			base.queueReload = false;
			((GenericBulletBaseState)this).procCoefficient = 1.5f;
			base.piercingDamageCoefficientPerTarget = 1f;
			((GenericBulletBaseState)this).muzzleName = "MuzzleRight";
			((GenericBulletBaseState)this).muzzleFlashPrefab = pyroMuzzleFlashPrefab;
			((GenericBulletBaseState)this).minSpread = 0f;
			((GenericBulletBaseState)this).maxSpread = 0f;
			((GenericBulletBaseState)this).maxDistance = 9999f;
			base.isPiercing = true;
			((GenericBulletBaseState)this).useSmartCollision = true;
			base.useSecondaryStocks = false;
			base.trajectoryAimAssistMultiplier = 0f;
			((GenericBulletBaseState)this).spreadYawScale = 0f;
			((GenericBulletBaseState)this).spreadPitchScale = 0f;
			((GenericBulletBaseState)this).spreadBloomValue = 0f;
			base.selfKnockbackForce = 3000f;
			((BaseFireSnipe)this).OnEnter();
		}

		public override void ModifyBullet(BulletAttack bulletAttack)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0026: Unknown result type (might be due to invalid IL or missing references)
			((BaseFireSnipe)this).ModifyBullet(bulletAttack);
			bulletAttack.damageType |= new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)128), (DamageTypeExtended)0, (DamageSource)8);
		}

		public override EntityState InstantiateBackpackState()
		{
			return (EntityState)(object)new UsePyro();
		}
	}
	public class OnlinePyro : BaseOnline
	{
		public override void OnEnter()
		{
			base.cooldownParamName = "SpecialCooldown";
			base.animationStateName = "Idle";
			base.animationLayerName = "Backpack";
			base.requiredSkillDef = BaseSkill<ChargeSnipePyroSkill>.skillDef;
			((BaseOnline)this).OnEnter();
		}
	}
	public class UsePyro : BaseBackpack
	{
		public float duration = 1f;

		public string animationLayerName;

		public string animationStateName;

		public string animationPlaybackRateParam;

		public override void OnEnter()
		{
			((BaseBackpack)this).OnEnter();
			((EntityState)this).PlayAnimation(animationLayerName, animationStateName, animationPlaybackRateParam, duration, 0f);
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0003: 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)
			return (InterruptPriority)9;
		}
	}
	public class WindupSnipePyro : BaseWindupSnipe
	{
		public static GameObject pyroCrosshairOverridePrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_Railgunner.RailgunnerSuperchargeCrosshair_prefab).WaitForCompletion();

		public static GameObject pyroWindupEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_Railgunner.WindupRailgunnerSuper_prefab).WaitForCompletion();

		public override void OnEnter()
		{
			base.crosshairOverridePrefab = pyroCrosshairOverridePrefab;
			base.animationStateName = "WindupSuper";
			base.animationPlaybackRateParam = "Super.playbackRate";
			base.animationLayerName = "Gesture, Override";
			base.windupEffectPrefab = pyroWindupEffectPrefab;
			base.windupEffectMuzzle = "MuzzleSniper";
			base.enterSoundString = "Play_railgunner_R_preFire";
			base.duration = 0.3f;
			((BaseWindupSnipe)this).OnEnter();
		}

		public override EntityState InstantiateNextState()
		{
			return (EntityState)(object)new FireSnipePyro();
		}
	}
}
namespace FenrisSkills.Skills.States.Chef
{
	public class CookItem : BaseState
	{
		public float firstDropDelay = 0.4f;

		public float delayBetweenDrops = 0.2f;

		public float dropForce = 15f;

		public float dropForceIncreasePerItem = 5f;

		public float moveSpeedCoefficient = 0.6f;

		public static PickupDropTable tempItemsDropTable = Assets.assetBundle.LoadAsset<PickupDropTable>("dtChefCook");

		private Xoroshiro128Plus rng;

		private int itemsToDrop;

		private int itemsDropped;

		private WalkSpeedPenaltyModifier walkSpeedModifier;

		private float itemDropTimeoutAuthority;

		private bool _isFirstDrop;

		private bool droppedItemServer;

		private bool exitingStatePermanently = true;

		private float currentTriggerTime;

		private static HashSet<PickupIndex> foodIndices = new HashSet<PickupIndex>
		{
			PickupCatalog.FindPickupIndex(Items.CookedSteak.itemIndex),
			PickupCatalog.FindPickupIndex(Items.Stew.itemIndex),
			PickupCatalog.FindPickupIndex(Items.BonusHealthBoost.itemIndex),
			PickupCatalog.FindPickupIndex(Items.WyrmOnHit.itemIndex),
			PickupCatalog.FindPickupIndex(Items.UltimateMeal.itemIndex)
		};

		private static HashSet<PickupIndex> strongFoodIndices = new HashSet<PickupIndex>
		{
			PickupCatalog.FindPickupIndex(Items.WyrmOnHit.itemIndex),
			PickupCatalog.FindPickupIndex(Items.UltimateMeal.itemIndex)
		};

		public HashSet<PickupIndex> craftableFoodItems;

		private static ExpansionDef requiredExpansion = Addressables.LoadAssetAsync<ExpansionDef>((object)RoR2_DLC3.DLC3_asset).WaitForCompletion();

		private float checkingTime
		{
			get
			{
				if (!_isFirstDrop)
				{
					return delayBetweenDrops;
				}
				return firstDropDelay;
			}
		}

		public override void OnEnter()
		{
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Expected O, but got Unknown
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Expected O, but got Unknown
			((BaseState)this).OnEnter();
			currentTriggerTime = 0f;
			itemsToDrop = 4;
			if (itemsDropped == 0)
			{
				_isFirstDrop = true;
				((EntityState)this).PlayAnimation("Gesture, Additive", "FireYesChef", "FireYesChef.playbackRate", 0.6f, 0f);
				((EntityState)this).PlayAnimation("Gesture, Override", "FireYesChef", "FireYesChef.playbackRate", 0.6f, 0f);
				Util.PlaySound("Play_chef_skill4_boost_activate", ((EntityState)this).gameObject);
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					walkSpeedModifier = new WalkSpeedPenaltyModifier
					{
						penalty = 1f - moveSpeedCoefficient
					};
					((EntityState)this).characterMotor.AddWalkSpeedPenalty(walkSpeedModifier);
				}
			}
			if (NetworkServer.active)
			{
				rng = new Xoroshiro128Plus(Run.instance.treasureRng.nextUlong);
			}
			((BaseState)this).StartAimMode(checkingTime + 0.5f, false);
			itemDropTimeoutAuthority = checkingTime + 0.05f;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (NetworkServer.active && !droppedItemServer)
			{
				currentTriggerTime += ((EntityState)this).GetDeltaTime();
				if (currentTriggerTime >= checkingTime)
				{
					DropTempItemServer();
				}
			}
			if (((EntityState)this).isAuthority && (((EntityState)this).fixedAge > itemDropTimeoutAuthority || droppedItemServer))
			{
				SetNextStateAuthority();
			}
		}

		private void SetNextStateAuthority()
		{
			if (((EntityState)this).isAuthority)
			{
				if (itemsDropped >= itemsToDrop - 1)
				{
					((EntityState)this).outer.SetNextStateToMain();
					return;
				}
				CookItem cookItem = EntityStateCatalog.InstantiateState(typeof(CookItem)) as CookItem;
				cookItem.itemsDropped = itemsDropped + 1;
				cookItem.craftableFoodItems = craftableFoodItems;
				((EntityState)this).outer.SetNextState((EntityState)(object)cookItem);
			}
		}

		private void DropTempItemServer()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: 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_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Invalid comparison between Unknown and I4
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Expected O, but got Unknown
			//IL_01c3: 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_01cd: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active || droppedItemServer)
			{
				return;
			}
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			float num = 12f;
			Vector3 val = modelTransform.right * (3f * ((float)itemsDropped + 1f) - 6f);
			Vector3 val2 = modelTransform.forward * dropForce + val;
			((Vector3)(ref val2))..ctor(val2.x, num, val2.z);
			Vector3 position = ((EntityState)this).transform.position;
			if (Object.op_Implicit((Object)(object)tempItemsDropTable))
			{
				UniquePickup pickup = default(UniquePickup);
				if (!Run.instance.IsExpansionEnabled(requiredExpansion) || !(Random.value > 0.95f) || !GetMealItem(ref pickup))
				{
					pickup = tempItemsDropTable.GeneratePickup(rng);
					pickup.decayValue = 1f;
				}
				if (((EntityState)this).characterBody.isPlayerControlled)
				{
					PickupDropletController.CreatePickupDroplet(pickup, position, val2, false, false);
				}
				else
				{
					PickupDef pickupDef = PickupCatalog.GetPickupDef(pickup.pickupIndex);
					ItemIndex itemIndex = pickupDef.itemIndex;
					ScrapperController.CreateItemTakenOrb(position, ((EntityState)this).gameObject, itemIndex);
					((EntityState)this).characterBody.inventory.GiveItemTemp(itemIndex, 1f);
					string baseToken = (((int)((EntityState)this).teamComponent.teamIndex == 1) ? "PLAYER_PICKUP" : "MONSTER_PICKUP");
					PlayerPickupChatMessage val3 = new PlayerPickupChatMessage();
					((SubjectChatMessage)val3).subjectAsCharacterBody = ((EntityState)this).characterBody;
					((SubjectChatMessage)val3).baseToken = baseToken;
					val3.pickupToken = Language.GetStringFormatted("ITEM_MODIFIER_TEMP", new object[1] { Language.GetStringFormatted(pickupDef.nameToken, Array.Empty<object>()) });
					val3.pickupColor = Color32.op_Implicit(pickupDef.baseColor);
					val3.pickupQuantity = 1u;
					PlayerPickupChatMessage val4 = val3;
					Chat.SendBroadcastChat((ChatMessageBase)(object)val4);
				}
			}
			droppedItemServer = true;
		}

		private bool GetMealItem(ref UniquePickup pickup)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			if (craftableFoodItems == null)
			{
				GetCraftableFoodItems();
			}
			if (craftableFoodItems.Count > 0)
			{
				pickup.pickupIndex = craftableFoodItems.ElementAt(Random.Range(0, craftableFoodItems.Count - 1));
				return true;
			}
			return false;
		}

		private void GetCraftableFoodItems()
		{
			//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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: 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_0126: Unknown result type (might be due to invalid IL or missing references)
			craftableFoodItems = new HashSet<PickupIndex>();
			if (!Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory))
			{
				return;
			}
			int count = ((EntityState)this).characterBody.inventory.itemAcquisitionOrder.Count;
			List<PickupIndex> list = new List<PickupIndex>();
			for (int i = 0; i < count; i++)
			{
				ItemIndex val = ((EntityState)this).characterBody.inventory.itemAcquisitionOrder[i];
				PickupIndex item = PickupCatalog.FindPickupIndex(val);
				for (int j = 0; j < ((EntityState)this).characterBody.inventory.GetItemCountEffective(val); j++)
				{
					list.Add(item);
				}
			}
			RecipeEntry[] array = CraftableCatalog.FindApplicableRecipesByIngredients(list.ToArray());
			RecipeEntry[] array2 = array;
			foreach (RecipeEntry val2 in array2)
			{
				if (foodIndices.Contains(val2.result) && (Options.produceStrongFoods.Value || !strongFoodIndices.Contains(val2.result)))
				{
					craftableFoodItems.Add(val2.result);
				}
			}
		}

		public override void ModifyNextState(EntityState nextState)
		{
			((EntityState)this).ModifyNextState(nextState);
			Salvage val = (Salvage)(object)((nextState is Salvage) ? nextState : null);
			exitingStatePermanently = val == null;
			if (!exitingStatePermanently && NetworkServer.active && !droppedItemServer)
			{
				DropTempItemServer();
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && walkSpeedModifier != null)
			{
				((EntityState)this).characterMotor.RemoveWalkSpeedPenalty(walkSpeedModifier);
			}
			((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)7;
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			((EntityState)this).OnSerialize(writer);
			writer.Write((byte)itemsDropped);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			((EntityState)this).OnDeserialize(reader);
			itemsDropped = reader.ReadByte();
		}
	}
}
namespace FenrisSkills.Skills.States.Captain
{
	public class CallRailgunStrike : CallRailgunStrikeBase
	{
		public const float projectileForce = 4000f;

		private static int CallAirstrike3StateHash = Animator.StringToHash("CallAirstrike3");

		public override void OnExit()
		{
			((EntityState)this).PlayAnimation("Gesture, Override", CallAirstrike3StateHash);
			((EntityState)this).PlayAnimation("Gesture, Additive", CallAirstrike3StateHash);
			((BaseState)this).AddRecoil(-2f, -2f, -0.5f, 0.5f);
			base.OnExit();
		}

		public override void ModifyProjectile(ref FireProjectileInfo fireProjectileInfo)
		{
			//IL_0017: 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)
			((CallAirstrikeBase)this).ModifyProjectile(ref fireProjectileInfo);
			fireProjectileInfo.force = 4000f;
			fireProjectileInfo.damageTypeOverride = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)32), (DamageTypeExtended)0, (DamageSource)4);
		}
	}
	public class CallRailgunStrikeBase : CallAirstrikeBase
	{
		private static GameObject endpointVisualizer = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Treebot.TreebotMortarAreaIndicator_prefab).WaitForCompletion();

		public override void OnEnter()
		{
			base.airstrikeRadius = 20f;
			base.bloom = 0.4f;
			((AimThrowableBase)this).maxDistance = 1000f;
			((AimThrowableBase)this).rayRadius = 0.2f;
			((AimThrowableBase)this).projectilePrefab = Assets.railCannonProjectilePrefab;
			((AimThrowableBase)this).endpointVisualizerPrefab = endpointVisualizer;
			((AimThrowableBase)this).endpointVisualizerRadiusScale = 0f;
			((AimThrowableBase)this).setFuse = false;
			((AimThrowableBase)this).damageCoefficient = 30f;
			((AimThrowableBase)this).baseMinimumDuration = 0.1f;
			((CallAirstrikeBase)this).OnEnter();
		}

		public override void OnExit()
		{
			((CallAirstrikeBase)this).OnExit();
		}
	}
	public class CallRailgunStrikeEnter : BaseSkillState
	{
		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new CallRailgunStrike());
			}
		}

		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 SetupRailgunStrike : BaseState
	{
		public static SkillDef primarySkillDef = BaseSkill<CallRailgunStrikeSkill>.skillDef;

		public static GameObject crosshairOverridePrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Captain.CaptainAirstrikeCrosshair_prefab).WaitForCompletion();

		public static string enterSoundString = "Play_captain_shift_start";

		public static string exitSoundString = "Play_captain_shift_end";

		public static GameObject effectMuzzlePrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Captain.CaptainRadioEffect_prefab).WaitForCompletion();

		public static string effectMuzzleString = "MuzzleHandRadio";

		public static float baseExitDuration = 0.3f;

		private GenericSkill primarySkillSlot;

		private GameObject effectMuzzleInstance;

		private Animator modelAnimator;

		private float timerSinceComplete;

		private bool beginExit;

		private OverrideRequest crosshairOverrideRequest;

		private static int PrepAirstrikeHash = Animator.StringToHash("PrepAirstrike");

		private float exitDuration => baseExitDuration / base.attackSpeedStat;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			primarySkillSlot = (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) ? ((EntityState)this).skillLocator.primary : null);
			if (Object.op_Implicit((Object)(object)primarySkillSlot))
			{
				primarySkillSlot.SetSkillOverride((object)this, primarySkillDef, (SkillOverridePriority)4);
			}
			modelAnimator = ((EntityState)this).GetModelAnimator();
			if (Object.op_Implicit((Object)(object)modelAnimator))
			{
				modelAnimator.SetBool(PrepAirstrikeHash, true);
			}
			((EntityState)this).PlayCrossfade("Gesture, Override", PrepAirstrikeHash, 0.1f);
			((EntityState)this).PlayCrossfade("Gesture, Additive", PrepAirstrikeHash, 0.1f);
			Transform val = ((BaseState)this).FindModelChild(effectMuzzleString);
			if (Object.op_Implicit((Object)(object)val))
			{
				effectMuzzleInstance = Object.Instantiate<GameObject>(effectMuzzlePrefab, val);
			}
			if (Object.op_Implicit((Object)(object)crosshairOverridePrefab))
			{
				crosshairOverrideRequest = CrosshairUtils.RequestOverrideForBody(((EntityState)this).characterBody, crosshairOverridePrefab, (OverridePriority)1);
			}
			Util.PlaySound(enterSoundString, ((EntityState)this).gameObject);
			Util.PlaySound("Play_captain_shift_active_loop", ((EntityState)this).gameObject);
		}

		public override void FixedUpdate()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				CharacterDirection characterDirection = ((EntityState)this).characterDirection;
				Ray aimRay = ((BaseState)this).GetAimRay();
				characterDirection.moveVector = ((Ray)(ref aimRay)).direction;
			}
			if (!Object.op_Implicit((Object)(object)primarySkillSlot) || primarySkillSlot.stock == 0)
			{
				beginExit = true;
			}
			if (beginExit)
			{
				timerSinceComplete += ((EntityState)this).GetDeltaTime();
				if (timerSinceComplete > exitDuration)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)primarySkillSlot))
			{
				primarySkillSlot.UnsetSkillOverride((object)this, primarySkillDef, (SkillOverridePriority)4);
			}
			Util.PlaySound(exitSoundString, ((EntityState)this).gameObject);
			Util.PlaySound("Stop_captain_shift_active_loop", ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)effectMuzzleInstance))
			{
				EntityState.Destroy((Object)(object)effectMuzzleInstance);
			}
			if (Object.op_Implicit((Object)(object)modelAnimator))
			{
				modelAnimator.SetBool(PrepAirstrikeHash, false);
			}
			OverrideRequest obj = crosshairOverrideRequest;
			if (obj != null)
			{
				obj.Dispose();
			}
			((EntityState)this).OnExit();
		}
	}
}
namespace FenrisSkills.Skills.Components
{
	public class CreateRailgunBullet : MonoBehaviour
	{
		public void Start()
		{
			//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_0062: 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_0074: 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_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: 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_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: 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_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Expected O, but got Unknown
			ProjectileDamage component = ((Component)this).GetComponent<ProjectileDamage>();
			ProjectileController component2 = ((Component)this).GetComponent<ProjectileController>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2))
			{
				bool flag = false;
				if (Object.op_Implicit((Object)(object)component2.owner))
				{
					CharacterBody component3 = component2.owner.GetComponent<CharacterBody>();
					if (component3 != null)
					{
						flag = component3.RollCrit();
					}
				}
				BulletAttack val = new BulletAttack
				{
					aimVector = Vector3.down,
					origin = ((Component)this).transform.position + Vector3.up * 1000f,
					owner = component2.owner,
					weapon = ((Component)((Component)this).transform.Find("Muzzle")).gameObject,
					bulletCount = 1u,
					damage = (flag ? (component.damage * 1.5f) : component.damage),
					damageColorIndex = (DamageColorIndex)0,
					damageType = component.damageType,
					falloffModel = (FalloffModel)0,
					force = component.force,
					HitEffectNormal = false,
					procChainMask = default(ProcChainMask),
					procCoefficient = 1f,
					maxDistance = 2000f,
					radius = 14f,
					isCrit = flag,
					minSpread = 0f,
					maxSpread = 0f,
					stopperMask = LayerMask.op_Implicit(0),
					smartCollision = false,
					sniper = false,
					tracerEffectPrefab = (flag ? Assets.railCannonBulletTracerCritPrefab : Assets.railCannonBulletTracerPrefab)
				};
				val.Fire();
			}
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
	public class PlaySoundOnDelay : MonoBehaviour
	{
		public float delay = 1f;

		public string soundString;

		public bool resetOnEnable = true;

		private float stopwatch;

		private bool activated;

		private void OnEnable()
		{
			if (resetOnEnable)
			{
				stopwatch = 0f;
				activated = false;
			}
		}

		public void Update()
		{
			if (!activated)
			{
				stopwatch += Time.deltaTime;
				if (stopwatch >= delay)
				{
					Util.PlaySound(soundString, ((Component)this).gameObject);
					activated = true;
				}
			}
		}
	}
	public class PyroUIColorController : MonoBehaviour
	{
		public Image[] imagesToUpdate;

		public void UpdateColors(Color color)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			if (imagesToUpdate != null)
			{
				Image[] array = imagesToUpdate;
				foreach (Image val in array)
				{
					((Graphic)val).color = color;
				}
			}
		}
	}
}