Decompiled source of OrbitalLaser v1.1.1

OrbitalLaser.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using OrbitalLaser.Components;
using OrbitalLaser.DamageTypes;
using OrbitalLaser.SkillStates;
using R2API;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Audio;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2BepInExPack.GameAssetPaths.Version_1_35_0;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;

[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("OrbitalLaser")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+cfc0581de4599b6bc3299941dfd7cb93685107c2")]
[assembly: AssemblyProduct("OrbitalLaser")]
[assembly: AssemblyTitle("OrbitalLaser")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 OrbitalLaser
{
	public static class Assets
	{
		public static GameObject orbitalLaserPrefab;

		public static ShakeEmitter orbitalLaserShakeEmitter;

		public static GameObject beaconGhostPrefab;

		public static GameObject beaconPickupPrefab;

		public static GameObject beaconPrefab;

		public static ProjectileImpactExplosion beaconPrefabImpactExplosion;

		public static GameObject laserSpawnerPrefab;

		public static AssetBundle assetBundle;

		public static void Init()
		{
			GetAssetBundle();
			CreateLaserPrefab();
			CreateBeaconGhostPrefab();
			EditLaserEquipment();
			CreateLaserSpawnerPrefab();
			CreateBeaconPrefab();
		}

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

		private static void EditLaserEquipment()
		{
			//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)
			EquipmentDef val = Addressables.LoadAssetAsync<EquipmentDef>((object)RoR2_Junk_OrbitalLaser.OrbitalLaser_asset).WaitForCompletion();
			val.pickupModelPrefab = beaconPickupPrefab;
			val.pickupIconSprite = assetBundle.LoadAsset<Sprite>("texBeaconIcon");
			val.cooldown = 120f;
			val.canDrop = true;
			val.enigmaCompatible = true;
		}

		private static void CreateLaserPrefab()
		{
			//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_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Expected O, but got Unknown
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			orbitalLaserPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Junk_OrbitalLaser.OrbitalLaser_prefab).WaitForCompletion(), "OrbitalLaser");
			Object.Destroy((Object)(object)orbitalLaserPrefab.GetComponent<OrbitalLaserController>());
			OrbitalLaser2Controller orbitalLaser2Controller = orbitalLaserPrefab.AddComponent<OrbitalLaser2Controller>();
			orbitalLaser2Controller.chargeEffect = ((Component)orbitalLaserPrefab.transform.Find("ChargeOrbitalLaser")).gameObject;
			orbitalLaser2Controller.fireEffect = ((Component)orbitalLaserPrefab.transform.Find("FireOrbitalLaser")).gameObject;
			Object.Destroy((Object)(object)((Component)orbitalLaserPrefab.transform.Find("MuzzleTransform")).gameObject);
			Object.Destroy((Object)(object)((Component)orbitalLaserPrefab.transform.Find("LaserPointerBeam")).gameObject);
			Object.Destroy((Object)(object)((Component)orbitalLaserPrefab.transform.Find("Midpoint")).gameObject);
			((SerializableEntityStateType)(ref orbitalLaserPrefab.GetComponent<EntityStateMachine>().initialStateType)).stateType = typeof(OrbitalLaserChargeState);
			GameObject val = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC1_MajorAndMinorConstruct.LaserMajorConstruct_prefab).WaitForCompletion());
			Transform val2 = val.transform.Find("LaserEnd");
			val2.parent = orbitalLaserPrefab.transform.Find("FireOrbitalLaser");
			((Component)val2).transform.localPosition = Vector3.zero;
			Object.Destroy((Object)(object)val);
			((Component)val2).gameObject.AddComponent<LaserEndController>();
			((Component)val2).gameObject.AddComponent<AkGameObj>();
			((Component)val2.Find("Point light")).GetComponent<Light>().color = new Color(0.49f, 0.9f, 0.16f, 1f);
			((Component)val2.Find("PP")).GetComponent<SphereCollider>().radius = 24f;
			orbitalLaserShakeEmitter = ((Component)val2).GetComponent<ShakeEmitter>();
			Object.Destroy((Object)(object)((Component)val2.Find("AreaIndicator")).gameObject);
			Object.Destroy((Object)(object)((Component)val2.Find("SoftGlowFlash")).gameObject);
			Transform val3 = orbitalLaserPrefab.transform.Find("FireOrbitalLaser/FiringLaserHolder");
			Transform val4 = val3.Find("FiringLaser");
			val3.localPosition = Vector3.up * 800f;
			val3.localScale = Vector3.one;
			val3.eulerAngles = Vector3.zero;
			Object.Destroy((Object)(object)((Component)val4).GetComponent<LaserPointer>());
			LineRenderer component = ((Component)val4).GetComponent<LineRenderer>();
			component.useWorldSpace = false;
			component.SetPosition(0, Vector3.zero);
			component.SetPosition(1, -val3.localPosition);
			Transform val5 = val2.Find("Flare");
			Material val6 = new Material(((Renderer)((Component)val5).GetComponent<ParticleSystemRenderer>()).sharedMaterial);
			val6.SetTexture("_RemapTex", Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common_ColorRamps.texRampHealingMedkit_png).WaitForCompletion());
			((Renderer)((Component)val5).GetComponent<ParticleSystemRenderer>()).sharedMaterial = val6;
		}

		private static void CreateBeaconGhostPrefab()
		{
			//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_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Expected O, but got Unknown
			//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_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Expected O, but got Unknown
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			beaconGhostPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Meteor.PickupMeteor_prefab).WaitForCompletion(), "BeaconGhost", false);
			Object.Destroy((Object)(object)beaconGhostPrefab.GetComponent<ModelPanelParameters>());
			beaconGhostPrefab.AddComponent<ProjectileGhostController>();
			beaconGhostPrefab.AddComponent<VFXAttributes>();
			Transform transform = beaconGhostPrefab.transform;
			transform.localScale *= 0.35f;
			LineRenderer val = beaconGhostPrefab.AddComponent<LineRenderer>();
			val.SetPosition(0, Vector3.zero);
			val.SetPosition(1, Vector3.up * 500f);
			val.widthCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[2]
			{
				new Keyframe(0f, 0.1357909f),
				new Keyframe(1f, 0.037909f)
			});
			val.useWorldSpace = true;
			val.widthMultiplier = 0f;
			((Renderer)val).material = Addressables.LoadAssetAsync<Material>((object)RoR2_Base_Captain.matCaptainAirstrikeAltLaser_mat).WaitForCompletion();
			beaconGhostPrefab.AddComponent<BeaconVisualController>();
			GameObject gameObject = ((Component)beaconGhostPrefab.transform.Find("mdlMeteor")).gameObject;
			Material val2 = new Material(((Renderer)gameObject.GetComponent<MeshRenderer>()).material);
			val2.SetColor("_Color", new Color(0.28f, 1f, 0.2f, 1f));
			val2.SetColor("_EmColor", new Color(0.19f, 0.52f, 0.21f, 1f));
			val2.SetTexture("_RemapTex", Addressables.LoadAssetAsync<Texture>((object)RoR2_DLC2_FalseSonBoss.texFSBLunarSpikeRamp_png).WaitForCompletion());
			((Renderer)gameObject.GetComponent<MeshRenderer>()).material = val2;
			beaconPickupPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Meteor.PickupMeteor_prefab).WaitForCompletion(), "BeaconPickup", false);
			gameObject = ((Component)beaconPickupPrefab.transform.Find("mdlMeteor")).gameObject;
			((Renderer)gameObject.GetComponent<MeshRenderer>()).material = val2;
		}

		private static void CreateBeaconPrefab()
		{
			//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_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			beaconPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Commando.CommandoGrenadeProjectile_prefab).WaitForCompletion(), "LaserBeacon");
			beaconPrefab.GetComponent<ProjectileController>().ghostPrefab = beaconGhostPrefab;
			((Collider)beaconPrefab.GetComponent<SphereCollider>()).material = Addressables.LoadAssetAsync<PhysicMaterial>((object)RoR2_Junk_Commando.physmatCommandoStickyGrenadeGrenade_physicMaterial).WaitForCompletion();
			beaconPrefabImpactExplosion = beaconPrefab.GetComponent<ProjectileImpactExplosion>();
			beaconPrefabImpactExplosion.impactEffect = null;
			((ProjectileExplosion)beaconPrefabImpactExplosion).fireChildren = true;
			beaconPrefabImpactExplosion.lifetime = 10f;
			beaconPrefabImpactExplosion.explodeOnLifeTimeExpiration = true;
			((ProjectileExplosion)beaconPrefabImpactExplosion).childrenCount = 1;
			((ProjectileExplosion)beaconPrefabImpactExplosion).blastRadius = 0f;
			((ProjectileExplosion)beaconPrefabImpactExplosion).blastDamageCoefficient = 0f;
			((ProjectileExplosion)beaconPrefabImpactExplosion).blastProcCoefficient = 0f;
			beaconPrefabImpactExplosion.lifetimeAfterImpact = 3f;
			((ProjectileExplosion)beaconPrefabImpactExplosion).bonusBlastForce = Vector3.zero;
			((ProjectileExplosion)beaconPrefabImpactExplosion).childrenProjectilePrefab = laserSpawnerPrefab;
			beaconPrefab.GetComponent<ProjectileSimple>().lifetime = 10.01f;
			beaconPrefab.AddComponent<ProjectileStickOnImpact>().alignNormals = true;
		}

		private static void CreateLaserSpawnerPrefab()
		{
			laserSpawnerPrefab = PrefabAPI.CreateEmptyPrefab("OrbitalLaserSpawner");
			laserSpawnerPrefab.AddComponent<ProjectileController>();
			laserSpawnerPrefab.AddComponent<TeamFilter>();
			laserSpawnerPrefab.AddComponent<LaserSpawnerController>();
		}
	}
	internal class ContentPacks : IContentPackProvider
	{
		[CompilerGenerated]
		private sealed class <FinalizeAsync>d__20 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public FinalizeAsyncArgs args;

			public ContentPacks <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <FinalizeAsync>d__20(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				if (<>1__state != 0)
				{
					return false;
				}
				<>1__state = -1;
				args.ReportProgress(1f);
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <GenerateContentPackAsync>d__19 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public GetContentPackAsyncArgs args;

			public ContentPacks <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <GenerateContentPackAsync>d__19(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				if (<>1__state != 0)
				{
					return false;
				}
				<>1__state = -1;
				ContentPack.Copy(<>4__this.contentPack, args.output);
				args.ReportProgress(1f);
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <LoadStaticContentAsync>d__18 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public LoadStaticContentAsyncArgs args;

			public ContentPacks <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <LoadStaticContentAsync>d__18(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				if (<>1__state != 0)
				{
					return false;
				}
				<>1__state = -1;
				<>4__this.contentPack.identifier = <>4__this.identifier;
				<>4__this.contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray());
				<>4__this.contentPack.masterPrefabs.Add(masterPrefabs.ToArray());
				<>4__this.contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray());
				<>4__this.contentPack.survivorDefs.Add(survivorDefs.ToArray());
				<>4__this.contentPack.unlockableDefs.Add(unlockableDefs.ToArray());
				<>4__this.contentPack.skillDefs.Add(skillDefs.ToArray());
				<>4__this.contentPack.skillFamilies.Add(skillFamilies.ToArray());
				<>4__this.contentPack.entityStateTypes.Add(entityStates.ToArray());
				<>4__this.contentPack.buffDefs.Add(buffDefs.ToArray());
				<>4__this.contentPack.effectDefs.Add(effectDefs.ToArray());
				<>4__this.contentPack.itemDefs.Add(itemDefs.ToArray());
				<>4__this.contentPack.itemTierDefs.Add(itemTierDefs.ToArray());
				<>4__this.contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray());
				args.ReportProgress(1f);
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		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<ItemDef> itemDefs = new List<ItemDef>();

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

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

		public string identifier => "com.Miyowi.OrbitalLaser";

		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);
		}

		[IteratorStateMachine(typeof(<LoadStaticContentAsync>d__18))]
		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <LoadStaticContentAsync>d__18(0)
			{
				<>4__this = this,
				args = args
			};
		}

		[IteratorStateMachine(typeof(<GenerateContentPackAsync>d__19))]
		public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <GenerateContentPackAsync>d__19(0)
			{
				<>4__this = this,
				args = args
			};
		}

		[IteratorStateMachine(typeof(<FinalizeAsync>d__20))]
		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <FinalizeAsync>d__20(0)
			{
				<>4__this = this,
				args = args
			};
		}
	}
	public static class Hooks
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Manipulator <0>__ReplaceInstantiatedPrefab;
		}

		public static void Init()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			object obj = <>O.<0>__ReplaceInstantiatedPrefab;
			if (obj == null)
			{
				Manipulator val = ReplaceInstantiatedPrefab;
				<>O.<0>__ReplaceInstantiatedPrefab = val;
				obj = (object)val;
			}
			EquipmentSlot.FireOrbitalLaser += (Manipulator)obj;
			Run.onRunStartGlobal += delegate
			{
				OrbitalLaser2Controller.instanceCount = 0;
			};
		}

		private static void ReplaceInstantiatedPrefab(ILContext il)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			Func<EquipmentSlot, Vector3, bool> func = delegate(EquipmentSlot equipmentSlot, Vector3 position)
			{
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: 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_007c: 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_0097: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
				//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00de: 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)
				if (OrbitalLaser2Controller.instanceCount >= Options.maxLaserCount.Value)
				{
					return false;
				}
				CharacterBody characterBody = equipmentSlot.characterBody;
				Ray val3 = default(Ray);
				if (Object.op_Implicit((Object)(object)characterBody.inputBank))
				{
					((Ray)(ref val3))..ctor(characterBody.inputBank.aimOrigin, characterBody.inputBank.aimDirection);
				}
				else
				{
					((Ray)(ref val3))..ctor(characterBody.transform.position, characterBody.transform.forward);
				}
				FireProjectileInfo val4 = default(FireProjectileInfo);
				val4.projectilePrefab = Assets.beaconPrefab;
				val4.position = ((Ray)(ref val3)).origin;
				val4.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref val3)).direction);
				val4.owner = ((Component)characterBody).gameObject;
				val4.damage = 0f;
				val4.force = 300f;
				val4.crit = false;
				FireProjectileInfo val5 = val4;
				ProjectileManager.instance.FireProjectile(val5);
				return true;
			};
			ILCursor val = new ILCursor(il);
			ILLabel val2 = val.DefineLabel();
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0)
			}))
			{
				val.Emit(OpCodes.Br, (object)val2);
				if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<NetworkServer>(x, "Spawn")
				}))
				{
					val.MarkLabel(val2);
					val.Emit(OpCodes.Ldarg_0);
					val.Emit(OpCodes.Ldloc_0);
					val.EmitDelegate<Func<EquipmentSlot, Vector3, bool>>(func);
					val.Emit(OpCodes.Ret);
				}
				else
				{
					Log.Error("Part 2 of ReplaceInstantiatedPrefab ILHook failed!");
				}
			}
			else
			{
				Log.Error("Part 1 of ReplaceInstantiatedPrefab ILHook failed!");
			}
		}
	}
	public static class Language
	{
		private const string prefix = "EQUIPMENT_ORBITALLASER_";

		public static void Init()
		{
			Add("NAME", "UES Stratagem");
			Add("PICKUP", "Throw a beacon that calls upon an orbital laser from the UES Safe Travels.");
			Add("DESC", "Throw a beacon to request an <style=cIsDamage>orbital laser strike</style> from the <style=cIsDamage>UES Safe Travels</style>, dealing <style=cIsDamage>12,000% damage</style> over <style=cIsUtility>6 seconds.</style>");
			Add("LORE", "<style=cMono>//--AUTO-TRANSCRIPTION FROM UES [Redacted] --//</style>\n\n\"Have you ever wondered what'd happen if you lit one of these babies from the ship?\"\n\n\"No. What?\"\n\n\"Well, think about it. How would the ship respond to a call to arms from its own location? It's not like we could fire lasers at ourselves. Like, if I-\"\n\n\"Stop blabbering. Those beacons are to alert <i>all</i> nearby combat-equipped UES vessels of an extreme immediate threat. Activation would result in a swift bombardment. Where the hell did you even find that? Hand it over right now.\"\n\n\n\"...\"\n\n\n\"I said hand it over. Why is it gl...\"\n\n\n\"...\"\n\n\n\"Tell me you didn't.\"\n\n<style=cMono>//--TRANSCRIPTION UNINTELLIGIBLE --//</style>");
		}

		public static string Add(string token, string text)
		{
			string text2 = "EQUIPMENT_ORBITALLASER_" + token;
			LanguageAPI.Add(text2, text);
			return text2;
		}
	}
	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 bool rooEnabled
		{
			get
			{
				if (!_rooEnabled.HasValue)
				{
					_rooEnabled = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");
				}
				return _rooEnabled.Value;
			}
		}

		public static ConfigEntry<float> fireFrequency { get; set; }

		public static ConfigEntry<float> damageCoefficientInitial { get; set; }

		public static ConfigEntry<float> damageCoefficientFinal { get; set; }

		public static ConfigEntry<float> procCoefficient { get; set; }

		public static ConfigEntry<float> fireDuration { get; set; }

		public static ConfigEntry<float> lifetimeAfterImpact { get; set; }

		public static ConfigEntry<bool> toggleSuperStun { get; set; }

		public static ConfigEntry<bool> toggleShipOrigin { get; set; }

		public static ConfigEntry<int> maxLaserCount { get; set; }

		private static void OnLaserSettingsChanged()
		{
			OrbitalLaser2Controller.fireFrequency = fireFrequency.Value;
			OrbitalLaser2Controller.damageCoefficientInitial = damageCoefficientInitial.Value / 100f;
			OrbitalLaser2Controller.damageCoefficientFinal = damageCoefficientFinal.Value / 100f;
			OrbitalLaser2Controller.procCoefficient = procCoefficient.Value;
			OrbitalLaser2Controller.fireDuration = fireDuration.Value;
			Assets.orbitalLaserShakeEmitter.duration = fireDuration.Value;
			Assets.beaconPrefabImpactExplosion.lifetimeAfterImpact = lifetimeAfterImpact.Value;
			SuperStun1s.shouldStun = toggleSuperStun.Value;
		}

		public static void Init()
		{
			fireFrequency = OrbitalLaser.config.Bind<float>("Orbital Laser", "Fire Frequency", 5f, "The frequency of damage ticks, with the time between calculated as 1/fireFrequency.");
			fireFrequency.SettingChanged += delegate
			{
				OnLaserSettingsChanged();
			};
			damageCoefficientInitial = OrbitalLaser.config.Bind<float>("Orbital Laser", "Initial Damage Coefficient", 400f, "The percentage damage coefficient the laser starts at.");
			damageCoefficientInitial.SettingChanged += delegate
			{
				OnLaserSettingsChanged();
			};
			damageCoefficientFinal = OrbitalLaser.config.Bind<float>("Orbital Laser", "Final Damage Coefficient", 400f, "The percentage damage coefficient the laser ends at.");
			damageCoefficientFinal.SettingChanged += delegate
			{
				OnLaserSettingsChanged();
			};
			procCoefficient = OrbitalLaser.config.Bind<float>("Orbital Laser", "Proc Coefficient", 0.5f, "The proc coefficient of each laser damage tick.");
			procCoefficient.SettingChanged += delegate
			{
				OnLaserSettingsChanged();
			};
			fireDuration = OrbitalLaser.config.Bind<float>("Orbital Laser", "Fire Duration", 6f, "The amount of time the laser fires for.");
			fireDuration.SettingChanged += delegate
			{
				OnLaserSettingsChanged();
			};
			toggleSuperStun = OrbitalLaser.config.Bind<bool>("Orbital Laser", "Toggle Super Stun", true, "Whether or not the laser is capable of attempting to stun enemies that normally ignore stun (most bosses apart from Mithrix don't implement a stun state, and for them this will not change anything).");
			toggleSuperStun.SettingChanged += delegate
			{
				OnLaserSettingsChanged();
			};
			toggleShipOrigin = OrbitalLaser.config.Bind<bool>("Orbital Laser", "Toggle Ship Origin", true, "Whether or not the laser origin and hitbox originate from the Safe Travels/Contact Light if the SafeTravelsInSkybox mod is installed.");
			maxLaserCount = OrbitalLaser.config.Bind<int>("Orbital Laser", "Max Laser Count", 10, "The maximum number of lasers that can active at once.");
			lifetimeAfterImpact = OrbitalLaser.config.Bind<float>("Orbital Laser Beacon", "Lifetime After Impact", 3f, "The maximum amount of time it can take for the laser to spawn after the beacon hits a surface (projectile already has an absolute max lifetime of 10s).");
			lifetimeAfterImpact.SettingChanged += delegate
			{
				OnLaserSettingsChanged();
			};
			if (rooEnabled)
			{
				RoOInit();
			}
		}

		public static void OnLoadFinished()
		{
			OnLaserSettingsChanged();
		}

		private static void RoOInit()
		{
			//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_0016: 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_0031: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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_0067: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: 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_009d: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: 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_0109: Expected O, but got Unknown
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Expected O, but got Unknown
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Expected O, but got Unknown
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Expected O, but got Unknown
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Expected O, but got Unknown
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Expected O, but got Unknown
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Expected O, but got Unknown
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Expected O, but got Unknown
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(fireFrequency, new StepSliderConfig
			{
				min = 0f,
				max = 1000f,
				increment = 1f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(damageCoefficientInitial, new StepSliderConfig
			{
				min = 0f,
				max = 20000f,
				increment = 10f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(damageCoefficientFinal, new StepSliderConfig
			{
				min = 0f,
				max = 20000f,
				increment = 10f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(procCoefficient, new StepSliderConfig
			{
				min = 0f,
				max = 10f,
				increment = 0.05f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(fireDuration, new StepSliderConfig
			{
				min = 0f,
				max = 20f,
				increment = 0.1f
			}));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(toggleSuperStun, new CheckBoxConfig()));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(toggleShipOrigin, new CheckBoxConfig()));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(lifetimeAfterImpact, new StepSliderConfig
			{
				min = 0f,
				max = 10f,
				increment = 0.1f
			}));
			ModSettingsManager.AddOption((BaseOption)new IntSliderOption(maxLaserCount, new IntSliderConfig
			{
				min = 0,
				max = 1000
			}));
			ModSettingsManager.SetModDescription("Config options for the Orbital Laser (UES Stratagem) mod.");
			ModSettingsManager.SetModIcon(Assets.assetBundle.LoadAsset<Sprite>("icon"));
		}
	}
	[BepInPlugin("mwmw.OrbitalLaser", "OrbitalLaser", "1.1.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class OrbitalLaser : BaseUnityPlugin
	{
		public const string PluginGUID = "mwmw.OrbitalLaser";

		public const string PluginAuthor = "mwmw";

		public const string PluginName = "OrbitalLaser";

		public const string PluginVersion = "1.1.1";

		public static ConfigFile config;

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

		private void OnLoadFinished()
		{
			Options.OnLoadFinished();
		}
	}
	public static class SoftDeps
	{
		private static bool? _shipEnabled;

		public static bool shipEnabled
		{
			get
			{
				if (!_shipEnabled.HasValue)
				{
					_shipEnabled = Chainloader.PluginInfos.ContainsKey("swuff.SafeTravelsInSkybox");
				}
				return _shipEnabled.Value;
			}
		}
	}
	public static class States
	{
		public static void Init()
		{
			ContentPacks.entityStates.Add(typeof(OrbitalLaserBaseState));
			ContentPacks.entityStates.Add(typeof(OrbitalLaserChargeState));
			ContentPacks.entityStates.Add(typeof(OrbitalLaserFireState));
			ContentPacks.entityStates.Add(typeof(OrbitalLaserDecayState));
		}
	}
}
namespace OrbitalLaser.SkillStates
{
	public abstract class OrbitalLaserBaseState : BaseState
	{
		protected OrbitalLaser2Controller controller;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			controller = ((EntityState)this).GetComponent<OrbitalLaser2Controller>();
		}
	}
	public class OrbitalLaserChargeState : OrbitalLaserBaseState
	{
		public override void OnEnter()
		{
			base.OnEnter();
			controller.chargeEffect.SetActive(true);
			controller.maxSpeed = controller.chargeMaxVelocity;
			OrbitalLaser2Controller.instanceCount++;
		}

		public override void OnExit()
		{
			controller.chargeEffect.SetActive(false);
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (NetworkServer.active && ((EntityState)this).fixedAge >= controller.chargeDuration)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new OrbitalLaserFireState());
			}
		}
	}
	public class OrbitalLaserDecayState : OrbitalLaserBaseState
	{
		public override void OnEnter()
		{
			base.OnEnter();
			controller.maxSpeed = 0f;
			OrbitalLaser2Controller.instanceCount--;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= controller.decayDuration)
			{
				EntityState.Destroy((Object)(object)((EntityState)this).gameObject);
			}
		}
	}
	public class OrbitalLaserFireState : OrbitalLaserBaseState
	{
		private float bulletAttackTimer;

		public override void OnEnter()
		{
			base.OnEnter();
			controller.fireEffect.SetActive(true);
			controller.maxSpeed = controller.fireMaxVelocity;
		}

		public override void OnExit()
		{
			controller.fireEffect.SetActive(false);
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Expected O, but got Unknown
			//IL_00dc: 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_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: 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_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!NetworkServer.active)
			{
				return;
			}
			if (((EntityState)this).fixedAge >= OrbitalLaser2Controller.fireDuration || !Object.op_Implicit((Object)(object)controller.ownerBody))
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new OrbitalLaserDecayState());
				return;
			}
			bulletAttackTimer -= ((EntityState)this).GetDeltaTime();
			if (Object.op_Implicit((Object)(object)controller.ownerBody) && bulletAttackTimer < 0f)
			{
				bulletAttackTimer += 1f / OrbitalLaser2Controller.fireFrequency;
				BulletAttack val = new BulletAttack();
				val.owner = ((Component)controller.ownerBody).gameObject;
				val.weapon = ((EntityState)this).gameObject;
				val.origin = ((EntityState)this).transform.position;
				val.maxDistance = 1200f;
				if (Options.toggleShipOrigin.Value && Object.op_Implicit((Object)(object)OrbitalLaser2Controller.cachedShipTransform))
				{
					val.aimVector = OrbitalLaser2Controller.cachedShipTransform.position + OrbitalLaser2Controller.cachedShipOffset - ((EntityState)this).transform.position;
				}
				else
				{
					val.aimVector = Vector3.up;
				}
				val.minSpread = 0f;
				val.maxSpread = 0f;
				val.damage = Mathf.Lerp(OrbitalLaser2Controller.damageCoefficientInitial * controller.ownerBody.damage, OrbitalLaser2Controller.damageCoefficientFinal * controller.ownerBody.damage, ((EntityState)this).fixedAge / OrbitalLaser2Controller.fireDuration);
				val.force = controller.force;
				val.muzzleName = "";
				val.isCrit = Util.CheckRoll(controller.ownerBody.crit, controller.ownerBody.master);
				val.stopperMask = ((LayerIndex)(ref LayerIndex.noCollision)).mask;
				val.damageColorIndex = (DamageColorIndex)3;
				val.damageType = DamageTypeCombo.op_Implicit((DamageType)32);
				val.procCoefficient = OrbitalLaser2Controller.procCoefficient;
				val.radius = 4.5f;
				DamageAPI.AddModdedDamageType(val, SuperStun1s.damageType);
				val.Fire();
			}
		}
	}
}
namespace OrbitalLaser.DamageTypes
{
	public static class SuperStun1s
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_TakeDamageProcess <0>__AddBossStun1s;
		}

		public static bool shouldStun;

		public static ModdedDamageType damageType;

		public static void Init()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0026: Expected O, but got Unknown
			damageType = DamageAPI.ReserveDamageType();
			object obj = <>O.<0>__AddBossStun1s;
			if (obj == null)
			{
				hook_TakeDamageProcess val = AddBossStun1s;
				<>O.<0>__AddBossStun1s = val;
				obj = (object)val;
			}
			HealthComponent.TakeDamageProcess += (hook_TakeDamageProcess)obj;
		}

		private static void AddBossStun1s(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageInfo);
			if (shouldStun && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.healthComponent) && DamageAPI.HasModdedDamageType(damageInfo, damageType))
			{
				SetStateOnHurt component = ((Component)self.body.healthComponent).GetComponent<SetStateOnHurt>();
				if (Object.op_Implicit((Object)(object)component) && component.hasEffectiveAuthority)
				{
					component.SetStunInternal(1f);
				}
			}
		}
	}
}
namespace OrbitalLaser.Components
{
	public class BeaconVisualController : MonoBehaviour
	{
		private LineRenderer lineRenderer;

		private float stopwatch;

		public void OnEnable()
		{
			OrbitalLaser2Controller.instanceCount++;
		}

		public void Start()
		{
			lineRenderer = ((Component)this).GetComponent<LineRenderer>();
		}

		public void Update()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			stopwatch += Time.deltaTime;
			lineRenderer.SetPosition(0, ((Component)this).transform.position);
			lineRenderer.SetPosition(1, ((Component)this).transform.position + Vector3.up * 200f);
			if (stopwatch > 1f)
			{
				lineRenderer.widthMultiplier = Mathf.Min(Mathf.Lerp(0f, 1f, stopwatch - 1f), 1f);
			}
		}

		public void OnDisable()
		{
			lineRenderer.widthMultiplier = 0f;
			stopwatch = 0f;
			OrbitalLaser2Controller.instanceCount--;
		}
	}
	internal class LaserEndController : MonoBehaviour
	{
		private static LoopSoundDef flightSoundLoop = Addressables.LoadAssetAsync<LoopSoundDef>((object)RoR2_Base_Vagrant.lsdVagrantTrackingBombFlight_asset).WaitForCompletion();

		private void Awake()
		{
		}

		private void OnEnable()
		{
			Util.PlaySound(flightSoundLoop.startSoundName, ((Component)this).gameObject);
		}

		private void Update()
		{
		}

		private void OnDisable()
		{
			Util.PlaySound(flightSoundLoop.stopSoundName, ((Component)this).gameObject);
		}
	}
	public class LaserSpawnerController : MonoBehaviour
	{
		public void Start()
		{
			//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_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)
			//IL_003d: 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_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active)
			{
				ProjectileController component = ((Component)this).GetComponent<ProjectileController>();
				Vector3 val = ((Component)this).transform.position;
				RaycastHit val2 = default(RaycastHit);
				if (Physics.Raycast(((Component)this).transform.position, Vector3.down, ref val2, 500f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
				{
					val = ((RaycastHit)(ref val2)).point;
				}
				GameObject val3 = Object.Instantiate<GameObject>(Assets.orbitalLaserPrefab, val, Quaternion.identity);
				val3.GetComponent<OrbitalLaser2Controller>().ownerBody = component.Networkowner.GetComponent<CharacterBody>();
				NetworkServer.Spawn(val3);
			}
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
	public class OrbitalLaser2Controller : MonoBehaviour
	{
		public CharacterBody ownerBody;

		private InputBankTest ownerInputBank;

		[Header("Movement Parameters")]
		public float smoothDampTime = 0.1f;

		protected Vector3 velocity;

		public float maxSpeed;

		[Header("Attack Parameters")]
		public static float fireFrequency = 5f;

		public static float damageCoefficientInitial = 4f;

		public static float damageCoefficientFinal = 4f;

		public static float procCoefficient = 0.5f;

		public float force = 0f;

		[Header("Charge")]
		public GameObject chargeEffect;

		public float chargeDuration = 0f;

		public float chargeMaxVelocity = 40f;

		private Transform chargeEffectTransform;

		[Header("Fire")]
		public GameObject fireEffect;

		public static float fireDuration = 6f;

		public float fireMaxVelocity = 250f;

		[Header("Decay")]
		public float decayDuration = 1.5f;

		private Vector3 mostRecentPointerPosition;

		private Vector3 mostRecentPointerNormal;

		public static Transform cachedShipTransform;

		public static Vector3 cachedShipOffset;

		public static int instanceCount;

		public void Start()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: 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)
			chargeEffect.SetActive(true);
			chargeEffect.GetComponent<ObjectScaleCurve>().timeMax = chargeDuration;
			mostRecentPointerPosition = ((Component)this).transform.position;
			mostRecentPointerNormal = Vector3.up;
			if (!SoftDeps.shipEnabled || !Options.toggleShipOrigin.Value)
			{
				return;
			}
			if (!Object.op_Implicit((Object)(object)cachedShipTransform))
			{
				Scene activeScene = SceneManager.GetActiveScene();
				GameObject? obj2 = Array.Find(((Scene)(ref activeScene)).GetRootGameObjects(), (GameObject obj) => ((Object)obj).name == "Colony Ship Variant(Clone)");
				cachedShipTransform = ((obj2 != null) ? obj2.transform : null);
				if (Object.op_Implicit((Object)(object)cachedShipTransform))
				{
					float x = cachedShipTransform.localScale.x;
					cachedShipTransform = cachedShipTransform.Find("ShipJetCore/ShipHull");
					cachedShipOffset = cachedShipTransform.up * 2.2f * x;
				}
				else
				{
					activeScene = SceneManager.GetActiveScene();
					GameObject? obj3 = Array.Find(((Scene)(ref activeScene)).GetRootGameObjects(), (GameObject obj) => ((Object)obj).name == "ContactLightProp Variant(Clone)");
					cachedShipTransform = ((obj3 != null) ? obj3.transform : null);
				}
			}
			if (Object.op_Implicit((Object)(object)cachedShipTransform))
			{
				Transform val = ((Component)this).transform.Find("FireOrbitalLaser/FiringLaserHolder");
				Transform val2 = val.Find("FiringLaser");
				LineRenderer component = ((Component)val2).GetComponent<LineRenderer>();
				component.useWorldSpace = true;
				component.SetPosition(0, cachedShipTransform.position + cachedShipOffset);
				component.SetPosition(1, val2.position - val.localPosition);
			}
		}

		private void Update()
		{
		}

		private void FixedUpdate()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active)
			{
				((Component)this).transform.position = Vector3.SmoothDamp(((Component)this).transform.position, mostRecentPointerPosition, ref velocity, smoothDampTime, maxSpeed, Time.fixedDeltaTime);
			}
		}
	}
}