Decompiled source of Ms Isle v2.2.0

MsIsle.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Commando;
using EntityStates.Drone.DroneWeapon;
using MissileDroneSurvivor.MsIsleEntityStates;
using MissileDroneSurvivor.Projectiles;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RoR2;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("MsIsle")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MsIsle")]
[assembly: AssemblyTitle("MsIsle")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace ExamplePlugin
{
	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);
		}
	}
}
namespace MissileDroneSurvivor
{
	internal class DamageAccumulator : MonoBehaviour
	{
		public float accumulatedDamage;

		public float damageMultiplier = 0.175f;

		public float damageToRadiusMultiplier = 0.15f;

		private float baseDamageCoeff;

		private float baseRadius;

		private HealthComponent healthComponent;

		private ProjectileImpactExplosion projectileImpactExplosion;

		private const float maxDamageMult = 20f;

		private const float maxRadiusMult = 125f;

		private TeamComponent teamComponent;

		private bool forcedTeamYet;

		private void Awake()
		{
			healthComponent = ((Component)this).GetComponent<HealthComponent>();
			projectileImpactExplosion = ((Component)this).GetComponent<ProjectileImpactExplosion>();
			healthComponent.dontShowHealthbar = true;
			accumulatedDamage = 0f;
			baseDamageCoeff = ((ProjectileExplosion)projectileImpactExplosion).blastDamageCoefficient;
			baseRadius = ((ProjectileExplosion)projectileImpactExplosion).blastRadius;
			teamComponent = ((Component)this).GetComponent<TeamComponent>();
			forcedTeamYet = false;
		}

		public void FixedUpdate()
		{
			float num = healthComponent.fullHealth - healthComponent.health;
			healthComponent.health = healthComponent.fullHealth;
			accumulatedDamage += num;
			float num2 = SCurveAccumulatedDamage(accumulatedDamage * damageMultiplier, 20f, 0.01f, 45f);
			float num3 = SCurveAccumulatedDamage(accumulatedDamage * damageToRadiusMultiplier, 125f, 0.01f, 45f);
			((ProjectileExplosion)projectileImpactExplosion).blastDamageCoefficient = baseDamageCoeff + num2;
			((ProjectileExplosion)projectileImpactExplosion).blastRadius = baseRadius + num3;
			if (!forcedTeamYet)
			{
				teamComponent.teamIndex = (TeamIndex)2;
				forcedTeamYet = true;
			}
		}

		private float SCurveAccumulatedDamage(float x, float L, float k, float s)
		{
			float num = L / (1f + Mathf.Exp((0f - k) * (x - s)));
			float num2 = L / (1f + Mathf.Exp(k * s));
			return num - num2;
		}
	}
	internal class DamageAccumulatorFixed : MonoBehaviour, IOnIncomingDamageServerReceiver
	{
		public float accumulatedDamage;

		public float damageMultiplier = 0.175f;

		public float damageToRadiusMultiplier = 0.15f;

		private float baseDamageCoeff;

		private float baseRadius;

		private HealthComponent healthComponent;

		private ProjectileImpactExplosion projectileImpactExplosion;

		private const float maxDamageMult = 30f;

		private const float maxRadiusMult = 150f;

		private TeamComponent teamComponent;

		private bool forcedTeamYet;

		private void Start()
		{
			ProjectileController component = ((Component)this).GetComponent<ProjectileController>();
			if ((Object)(object)component != (Object)null && (Object)(object)component.owner != (Object)null)
			{
				DronePassiveSkill component2 = component.owner.GetComponent<DronePassiveSkill>();
				if ((Object)(object)component2 != (Object)null)
				{
					component2.mostRecentNuke = ((Component)this).transform;
				}
			}
		}

		private void Awake()
		{
			healthComponent = ((Component)this).GetComponent<HealthComponent>();
			projectileImpactExplosion = ((Component)this).GetComponent<ProjectileImpactExplosion>();
			healthComponent.dontShowHealthbar = true;
			accumulatedDamage = 0f;
			baseDamageCoeff = ((ProjectileExplosion)projectileImpactExplosion).blastDamageCoefficient;
			baseRadius = ((ProjectileExplosion)projectileImpactExplosion).blastRadius;
			teamComponent = ((Component)this).GetComponent<TeamComponent>();
			forcedTeamYet = false;
		}

		public void FixedUpdate()
		{
			if (!forcedTeamYet)
			{
				teamComponent.teamIndex = (TeamIndex)4;
				forcedTeamYet = true;
			}
		}

		public void OnIncomingDamageServer(DamageInfo damageInfo)
		{
			damageInfo.rejected = true;
			float damage = damageInfo.damage;
			accumulatedDamage += damage;
			float num = SCurveAccumulatedDamage(accumulatedDamage * damageMultiplier, 30f, 0.01f, 45f);
			float num2 = SCurveAccumulatedDamage(accumulatedDamage * damageToRadiusMultiplier, 150f, 0.01f, 45f);
			((ProjectileExplosion)projectileImpactExplosion).blastDamageCoefficient = baseDamageCoeff + num;
			((ProjectileExplosion)projectileImpactExplosion).blastRadius = baseRadius + num2;
		}

		private float SCurveAccumulatedDamage(float x, float L, float k, float s)
		{
			float num = L / (1f + Mathf.Exp((0f - k) * (x - s)));
			float num2 = L / (1f + Mathf.Exp(k * s));
			return num - num2;
		}
	}
	internal class DroneDisplaySpoofer : MonoBehaviour
	{
		private class soundEffect
		{
			public string soundName;

			public float timeToPlay;

			public uint playbackID;

			public bool hasID;

			public soundEffect(string name, float timeToPlay)
			{
				soundName = name;
				this.timeToPlay = timeToPlay;
				playbackID = 0u;
				hasID = false;
			}
		}

		private class vfxEffect
		{
			public GameObject effect;

			public float timeToPlay;

			public vfxEffect(GameObject effect, float timeToPlay)
			{
				this.effect = effect;
				this.timeToPlay = timeToPlay;
			}
		}

		private vfxEffect[] effects;

		private soundEffect[] soundEffects;

		private Vector3 targetDronePosition;

		private Vector3 currentDronePosition;

		private Vector3 hoverCycleOffset;

		private const float hoverCycleDistanceY = 0.08f;

		private const float hoverCycleDistanceXZ = 0.04f;

		private void Awake()
		{
			//IL_00e9: 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_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			effects = new vfxEffect[2]
			{
				new vfxEffect(Resources.Load<GameObject>("prefabs/effects/impacteffects/CharacterLandImpact"), 0.2f),
				new vfxEffect(Resources.Load<GameObject>("Prefabs/effects/impacteffects/BootShockwave"), 0.35f)
			};
			soundEffects = new soundEffect[3]
			{
				new soundEffect("Play_drone_repair", 0.35f),
				new soundEffect("Play_drone_active_loop", 0.35f),
				new soundEffect("Play_engi_R_turret_spawn", 0.1f)
			};
			vfxEffect[] array = effects;
			foreach (vfxEffect effect in array)
			{
				((MonoBehaviour)this).StartCoroutine(DelayEffect(effect));
			}
			soundEffect[] array2 = soundEffects;
			foreach (soundEffect effect2 in array2)
			{
				((MonoBehaviour)this).StartCoroutine(DelaySound(effect2));
			}
			Object.Destroy((Object)(object)((Component)this).GetComponent<AimAnimator>());
			Object.Destroy((Object)(object)((Component)this).GetComponent<Animator>());
			targetDronePosition = ((Component)this).transform.position + new Vector3(0f, 1.25f, 0f);
			currentDronePosition = ((Component)this).transform.position + new Vector3(3f, 5f, 0f);
		}

		private void Update()
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: 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)
			hoverCycleOffset = new Vector3(Mathf.Sin(Time.time) * 0.04f, Mathf.Sin(Time.time * 2f) * 0.08f, Mathf.Sin(Time.time * 0.75f) * 0.04f);
			Vector3 val = targetDronePosition - currentDronePosition;
			if (((Vector3)(ref val)).magnitude > 0.05f)
			{
				currentDronePosition = Vector3.Lerp(currentDronePosition, targetDronePosition, 0.985f * Time.deltaTime);
			}
			((Component)this).transform.position = currentDronePosition + hoverCycleOffset;
		}

		private IEnumerator DelayEffect(vfxEffect effect)
		{
			yield return (object)new WaitForSeconds(effect.timeToPlay);
			EffectManager.SpawnEffect(effect.effect, new EffectData
			{
				origin = ((Component)this).transform.position,
				scale = 1f
			}, true);
		}

		private IEnumerator DelaySound(soundEffect effect)
		{
			yield return (object)new WaitForSeconds(effect.timeToPlay);
			effect.playbackID = Util.PlaySound(effect.soundName, ((Component)this).gameObject);
			effect.hasID = true;
		}

		private void OnDestroy()
		{
			soundEffect[] array = soundEffects;
			for (int i = 0; i < array.Length; i++)
			{
				AkSoundEngine.StopPlayingID(array[i].playbackID);
			}
		}
	}
	public class DronePassiveSkill : MonoBehaviour
	{
		private CharacterBody body;

		private KillCounterComponent killCounter;

		private InputBankTest inputBank;

		private RigidbodyMotor motor;

		public float radiusToCheckEntrance = 5f;

		public float radiusToCheckExit = 8f;

		public GenericSkill utilitySkill;

		public SkillDef utilitySkillDef;

		private int boostsDone;

		private bool _isBoosting;

		private Transform jetEffectLeft;

		private Transform jetEffectRight;

		private GameObject jetEffect;

		private float boostEffectSize = 1f;

		public static string boostEffectString = "prefabs/effects/impacteffects/CharacterLandImpact";

		private static GameObject boostEffect = null;

		private LayerMask layerMask;

		private bool isSprinting;

		private float verticalMoveSpeed = 10f;

		private bool _isNukeInWorld;

		public GenericSkill packHoundsSkill;

		private int _packHoundCount;

		public Transform mostRecentNuke;

		public bool isBoosting
		{
			get
			{
				return _isBoosting;
			}
			private set
			{
				_isBoosting = value;
			}
		}

		public bool isNukeInWorld
		{
			get
			{
				return _isNukeInWorld;
			}
			private set
			{
				_isNukeInWorld = value;
			}
		}

		public int packHoundCount
		{
			get
			{
				return _packHoundCount;
			}
			set
			{
				_packHoundCount = value;
			}
		}

		public void Awake()
		{
			//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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: 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_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			body = ((Component)this).GetComponent<CharacterBody>();
			inputBank = ((Component)body).GetComponent<InputBankTest>();
			motor = ((Component)body).GetComponent<RigidbodyMotor>();
			killCounter = ((Component)body).GetComponent<KillCounterComponent>();
			if (!Object.op_Implicit((Object)(object)killCounter))
			{
				killCounter = ((Component)body).gameObject.AddComponent<KillCounterComponent>();
			}
			layerMask = LayerMask.op_Implicit(1 << LayerMask.NameToLayer("World"));
			isSprinting = false;
			GameObject val = new GameObject("empty");
			Transform val2 = ((Component)body).GetComponent<ModelLocator>().modelBaseTransform.Find("mdlMissileDrone").Find("MissileDroneArmature").Find("ROOT")
				.Find("Body");
			if ((Object)(object)jetEffect == (Object)null)
			{
				jetEffect = DodgeState.jetEffect;
			}
			boostEffect = Resources.Load<GameObject>(boostEffectString);
			jetEffectLeft = Object.Instantiate<GameObject>(val, val2).transform;
			jetEffectLeft.SetParent(val2);
			((Component)jetEffectLeft).transform.localPosition = new Vector3(-0.61f, 0f, -0.769f);
			((Object)jetEffectLeft).name = "jetEffectLeft";
			jetEffectLeft.LookAt(val2.position + -3f * val2.forward + -0.9f * val2.right, Vector3.up);
			jetEffectRight = Object.Instantiate<GameObject>(val, val2).transform;
			jetEffectRight.SetParent(val2);
			((Component)jetEffectRight).transform.localPosition = new Vector3(0.61f, 0f, -0.769f);
			((Object)jetEffectRight).name = "jetEffectRight";
			jetEffectRight.LookAt(val2.position + -3f * val2.forward + 0.9f * val2.right, Vector3.up);
			if (Object.op_Implicit((Object)(object)body.inventory))
			{
				utilitySkillDef.baseMaxStock = body.baseJumpCount + body.inventory.GetItemCount(Items.Feather) + body.inventory.GetItemCount(Items.UtilitySkillMagazine);
			}
			else
			{
				utilitySkillDef.baseMaxStock = body.baseJumpCount;
			}
			utilitySkill.stock = utilitySkillDef.baseMaxStock;
			packHoundsSkill.stock = 0;
		}

		public void FixedUpdate()
		{
			//IL_0011: 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_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: 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_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			if (!isBoosting)
			{
				if (Physics.CheckSphere(body.corePosition, isSprinting ? radiusToCheckExit : radiusToCheckEntrance, LayerMask.op_Implicit(layerMask), (QueryTriggerInteraction)1))
				{
					if (!isSprinting)
					{
						isSprinting = true;
						body.isSprinting = isSprinting;
						utilitySkillDef.baseMaxStock = body.baseJumpCount + body.inventory.GetItemCount(Items.Feather) + body.inventory.GetItemCount(Items.UtilitySkillMagazine);
						if (utilitySkill.stock < utilitySkillDef.baseMaxStock)
						{
							utilitySkill.stock = utilitySkillDef.baseMaxStock;
						}
					}
				}
				else if (isSprinting)
				{
					isSprinting = false;
					body.isSprinting = isSprinting;
				}
			}
			if (inputBank.jump.down)
			{
				RigidbodyMotor obj = motor;
				obj.moveVector += new Vector3(0f, verticalMoveSpeed, 0f);
			}
			if (LocalUserManager.GetFirstLocalUser().inputPlayer.GetButton("sprint"))
			{
				RigidbodyMotor obj2 = motor;
				obj2.moveVector -= new Vector3(0f, verticalMoveSpeed, 0f);
			}
			motor.moveVector.y = Mathf.Clamp(motor.moveVector.y, 0f - verticalMoveSpeed, verticalMoveSpeed);
			if (utilitySkill.stock > utilitySkillDef.baseMaxStock)
			{
				utilitySkill.stock = utilitySkillDef.baseMaxStock;
			}
			if (packHoundsSkill.stock != packHoundCount)
			{
				packHoundsSkill.stock = packHoundCount;
			}
		}

		public void AddKill()
		{
			packHoundCount++;
			packHoundCount = Mathf.Min(packHoundCount, packHoundsSkill.maxStock);
			packHoundsSkill.stock = packHoundCount;
		}

		public void OnPackHoundsUsed()
		{
			packHoundsSkill.stock = 0;
			packHoundCount = 0;
		}

		public void OnDroneBoost(DroneBoostAbility boostAbility)
		{
			//IL_00ad: 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_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Expected O, but got Unknown
			utilitySkillDef.baseMaxStock = body.baseJumpCount + body.inventory.GetItemCount(Items.Feather) + body.inventory.GetItemCount(Items.UtilitySkillMagazine);
			boostAbility.quailsOwned = body.inventory.GetItemCount(Items.JumpBoost);
			if (Object.op_Implicit((Object)(object)jetEffect))
			{
				if (Object.op_Implicit((Object)(object)jetEffectLeft))
				{
					Object.Instantiate<GameObject>(jetEffect, jetEffectLeft);
				}
				if (Object.op_Implicit((Object)(object)jetEffectRight))
				{
					Object.Instantiate<GameObject>(jetEffect, jetEffectRight);
				}
			}
			EffectManager.SpawnEffect(boostEffect, new EffectData
			{
				origin = body.transform.position,
				scale = boostEffectSize
			}, true);
			isBoosting = true;
		}

		public void OnDroneBoostExit(DroneBoostAbility boostAbility)
		{
			boostAbility.quailsOwned = body.inventory.GetItemCount(Items.JumpBoost);
			utilitySkillDef.baseMaxStock = body.baseJumpCount + body.inventory.GetItemCount(Items.Feather) + body.inventory.GetItemCount(Items.UtilitySkillMagazine);
			if (isSprinting)
			{
				utilitySkill.stock = utilitySkill.maxStock;
			}
			isBoosting = false;
		}
	}
	public class MasterKillCounter : MonoBehaviour
	{
		private int _killCount;

		public int killCount
		{
			get
			{
				return _killCount;
			}
			private set
			{
				_killCount = value;
			}
		}

		public void AddKill(DronePassiveSkill passiveSkill)
		{
			killCount++;
			if (Object.op_Implicit((Object)(object)passiveSkill))
			{
				passiveSkill.AddKill();
			}
		}
	}
	public class SyncSomething : INetMessage, ISerializableObject
	{
		private NetworkInstanceId netID;

		private Vector3 position;

		private int number;

		public SyncSomething()
		{
		}

		public SyncSomething(NetworkInstanceId netID, Vector3 position, int num)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			this.netID = netID;
			this.position = position;
			number = num;
		}

		public void Deserialize(NetworkReader reader)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			netID = reader.ReadNetworkId();
			position = reader.ReadVector3();
			number = reader.ReadInt32();
		}

		public void OnReceived()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active)
			{
				Debug.Log((object)"SyncSomething: Host ran the OnReceived; skipping.");
				return;
			}
			GameObject val = Util.FindNetworkObject(netID);
			if (!Object.op_Implicit((Object)(object)val))
			{
				Debug.LogWarning((object)"SyncSomething: bodyObject is null");
				return;
			}
			CharacterBody component = val.GetComponent<CharacterBody>();
			DronePassiveSkill component2 = val.GetComponent<DronePassiveSkill>();
			MasterKillCounter masterKillCounter = ((Component)component.master).GetComponent<MasterKillCounter>();
			if (!Object.op_Implicit((Object)(object)masterKillCounter))
			{
				masterKillCounter = ((Component)component.master).gameObject.AddComponent<MasterKillCounter>();
			}
			masterKillCounter?.AddKill(component2);
		}

		public void Serialize(NetworkWriter writer)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			writer.Write(netID);
			writer.Write(position);
			writer.Write(number);
		}
	}
	public class KillCounterComponent : MonoBehaviour, IOnKilledOtherServerReceiver
	{
		private CharacterBody body;

		private DronePassiveSkill passiveSkill;

		public MasterKillCounter masterKillCounter;

		private int lastHashCode = -1;

		public void OnHostKill()
		{
			Debug.Log((object)$"OnKilledOtherServer: OnHostKill() called on host :) ({((object)((Component)this).gameObject).GetHashCode()})");
			body = ((Component)this).GetComponent<CharacterBody>();
			if (!Object.op_Implicit((Object)(object)passiveSkill))
			{
				passiveSkill = ((Component)body).GetComponent<DronePassiveSkill>();
			}
			masterKillCounter = ((Component)body.master).GetComponent<MasterKillCounter>();
			if (!Object.op_Implicit((Object)(object)masterKillCounter))
			{
				masterKillCounter = ((Component)body.master).gameObject.AddComponent<MasterKillCounter>();
			}
			((Component)body.master).GetComponent<MasterKillCounter>()?.AddKill(passiveSkill);
		}

		public void OnKilledOtherServer(DamageReport report)
		{
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)report.victim) || !Object.op_Implicit((Object)(object)report.attackerMaster))
			{
				Debug.LogWarning((object)"OnKilledOtherServer: DamageReport did not have both victim and attackerMaster");
			}
			else
			{
				if (((object)report.victim).GetHashCode() == lastHashCode)
				{
					return;
				}
				lastHashCode = ((object)report.victim).GetHashCode();
				if (!report.attackerMaster.hasEffectiveAuthority)
				{
					Debug.Log((object)"OnKilledOtherServer: Getting network identity component from attackerBody");
					NetworkIdentity component = ((Component)report.attackerBody).GetComponent<NetworkIdentity>();
					if (!Object.op_Implicit((Object)(object)component))
					{
						Debug.LogWarning((object)"OnKilledOtherServer: The attackerBody did not have a NetworkIdentity component!");
						return;
					}
					Debug.Log((object)"OnKilledOtherServer: Creating new SyncSomething and sending it");
					NetMessageExtensions.Send((INetMessage)(object)new SyncSomething(component.netId, report.attackerBody.transform.position, 9000), (NetworkDestination)1);
				}
				else
				{
					Debug.Log((object)"OnKilledOtherServer: Calling OnReceived on the host");
					OnHostKill();
				}
			}
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.hogynmelyn.msisle", "Ms Isle", "2.0.0")]
	public class MsIsle : BaseUnityPlugin
	{
		public const string PluginGUID = "com.hogynmelyn.msisle";

		public const string PluginName = "Ms Isle";

		public const string PluginVersion = "2.0.0";

		public SkillLocator skillLocator;

		public static GameObject msIsleCharacter;

		public static CharacterBody bodyComponent;

		private DronePassiveSkill dronePassiveManager;

		private const int numRocketsBase = 4;

		private const float rocketFireIntervalBase = 0.5f;

		private const float missileRecharge = 2f;

		private GameObject missilePrefab;

		public void Awake()
		{
			Debug.Log((object)">|Loaded Ms. Isle survivor mod! :)");
			RegisterStates();
			SetupCharacterBody();
			SetupPreSkills();
			SetupPassive();
			SetupPrimary();
			SetupSecondary();
			SetupUtility();
			SetupSpecial();
			Skins.RegisterSkins();
		}

		private void RegisterStates()
		{
			NetworkingAPI.RegisterMessageType<SyncSomething>();
			LoadoutAPI.AddSkill(typeof(MissileBarrage));
			LoadoutAPI.AddSkill(typeof(PackHounds));
			LoadoutAPI.AddSkill(typeof(DroneBoostAbility));
			LoadoutAPI.AddSkill(typeof(NukeAbility));
			LoadoutAPI.AddSkill(typeof(TestPrimarySkill));
			Debug.Log((object)"    >|Registered networked skill states with LoadoutAPI!");
		}

		private void SetupCharacterBody()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02af: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Expected O, but got Unknown
			msIsleCharacter = PrefabAPI.InstantiateClone(Resources.Load<GameObject>("Prefabs/CharacterBodies/MissileDroneBody"), "MissileDroneSurvivor");
			msIsleCharacter.GetComponent<NetworkIdentity>().localPlayerAuthority = true;
			msIsleCharacter.GetComponent<CharacterBody>().aimOriginTransform.Translate(new Vector3(0f, 0.5f, 0f));
			msIsleCharacter.AddComponent<EquipmentSlot>();
			bodyComponent = msIsleCharacter.GetComponent<CharacterBody>();
			bodyComponent.baseDamage = 10f;
			bodyComponent.levelDamage = 1f;
			bodyComponent.baseCrit = 1f;
			bodyComponent.levelCrit = 0f;
			bodyComponent.baseMaxHealth = 50f;
			bodyComponent.levelMaxHealth = 15f;
			bodyComponent.baseArmor = 0f;
			bodyComponent.baseRegen = 1.5f;
			bodyComponent.levelRegen = 0.25f;
			bodyComponent.baseMoveSpeed = 10f;
			bodyComponent.levelMoveSpeed = 0.1f;
			bodyComponent.baseAttackSpeed = 1f;
			bodyComponent.levelAttackSpeed = 0f;
			bodyComponent.baseMaxShield = 0f;
			bodyComponent.levelMaxShield = 0f;
			((Object)bodyComponent).name = "Ms. Isle";
			bodyComponent.portraitIcon = Resources.Load<Texture>("Textures/Bodyicons/texMissileDroneIcon");
			bodyComponent.baseJumpCount = 1;
			bodyComponent.bodyFlags = (BodyFlags)(bodyComponent.bodyFlags | 0x20);
			dronePassiveManager = msIsleCharacter.AddComponent<DronePassiveSkill>();
			msIsleCharacter.GetComponent<CharacterBody>().preferredPodPrefab = Resources.Load<GameObject>("Prefabs/CharacterBodies/toolbotbody").GetComponent<CharacterBody>().preferredPodPrefab;
			LanguageAPI.Add("MSISLECHAR_DESCRIPTION", "Ms. Isle is a glass-cannon Missile Drone, capable of <i>extremely</i> high damage output and unique evasive flight-based movement, but with minimal health. <style=cSub>\r\n\r\n< ! > Fly-By serves as Ms Isle’s sprint mechanism – use it to navigate stages more quickly, and then take to the skies to evade enemy attacks!\r\n\r\n< ! > Missile Barrage always fires its swarm of rockets over <i>1 second</i>, but the number of rockets it fires is determined by Ms Isle’s overall fire-rate.\r\n\r\n< ! > Cumulative Warhead absorbs all damage dealt to it by you and your allies! Fire it into a group of enemies from a distance and focus your fire to increase its damage multiplier up to <style=cIsDamage>many times its base damage</style>!\r\n\r\n< ! > Pack Hound missiles will target whatever is closest, <i>including</i> your Cumulative Warhead!</style>");
			LanguageAPI.Add("MSISLECHAR_NAME", "Ms. Isle");
			LanguageAPI.Add("MSISLECHAR_DISPLAYNAME", "Ms. Isle");
			LanguageAPI.Add("MSISLE_SUBTITLE", "Missile Drone");
			GameObject val = PrefabAPI.InstantiateClone(((Component)((Component)bodyComponent).GetComponent<ModelLocator>().modelBaseTransform).gameObject, "MissileDroneSurvivorDisplay");
			val.AddComponent<NetworkIdentity>();
			Transform transform = val.transform;
			transform.localScale *= 0.75f;
			val.transform.Find("mdlMissileDrone").Find("MissileDroneArmature");
			((Component)val.transform.Find("mdlMissileDrone")).gameObject.AddComponent<DroneDisplaySpoofer>();
			SurvivorDef val2 = new SurvivorDef
			{
				cachedName = "MSISLECHAR_NAME",
				bodyPrefab = msIsleCharacter,
				displayPrefab = val,
				unlockableName = "",
				displayNameToken = "MSISLECHAR_DISPLAYNAME",
				descriptionToken = "MSISLECHAR_DESCRIPTION",
				primaryColor = new Color(41f / 51f, 41f / 85f, 43f / 51f),
				outroFlavorToken = "MSISLE_SUBTITLE"
			};
			Debug.Log((object)"    >|Created survivor definition!");
			ContentAddition.AddSurvivorDef(val2);
			Debug.Log((object)"    >|Added survivor to API!");
			Debug.Log((object)"    >|Adding msIsleCharacter GameObject to the body catalogue...");
			ContentAddition.AddBody(msIsleCharacter);
			Debug.Log((object)"    >|Finished setting up character body!");
		}

		private void SetupPreSkills()
		{
			Debug.Log((object)"        >|Setting up skills...");
			Debug.Log((object)"        >|Setting the global SkillLocator var to the SkillLocator component on the CharacterBody!");
			skillLocator = msIsleCharacter.GetComponent<SkillLocator>();
			Debug.Log((object)"        >|Deleting existing GenericSkill components attached...");
			GenericSkill[] components = msIsleCharacter.GetComponents<GenericSkill>();
			for (int i = 0; i < components.Length; i++)
			{
				Object.Destroy((Object)(object)components[i]);
				Debug.Log((object)"            >|Deleted a GenericSkill component!");
			}
			skillLocator.primary = ((Component)bodyComponent).gameObject.AddComponent<GenericSkill>();
			Debug.Log((object)"        >|Added primary skill slot!");
			SkillFamily val = ScriptableObject.CreateInstance<SkillFamily>();
			Reflection.SetFieldValue<SkillFamily>((object)skillLocator.primary, "_skillFamily", val);
			Debug.Log((object)"        >|Added the primary skill family!");
			skillLocator.secondary = ((Component)bodyComponent).gameObject.AddComponent<GenericSkill>();
			Debug.Log((object)"        >|Added secondary skill slot!");
			SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
			Reflection.SetFieldValue<SkillFamily>((object)skillLocator.secondary, "_skillFamily", val2);
			Debug.Log((object)"        >|Added the secondary skill family!");
			skillLocator.utility = ((Component)bodyComponent).gameObject.AddComponent<GenericSkill>();
			Debug.Log((object)"        >|Added utility skill slot!");
			SkillFamily val3 = ScriptableObject.CreateInstance<SkillFamily>();
			Reflection.SetFieldValue<SkillFamily>((object)skillLocator.utility, "_skillFamily", val3);
			Debug.Log((object)"        >|Added the utility skill family!");
			skillLocator.special = ((Component)bodyComponent).gameObject.AddComponent<GenericSkill>();
			Debug.Log((object)"        >|Added special skill slot!");
			SkillFamily val4 = ScriptableObject.CreateInstance<SkillFamily>();
			Reflection.SetFieldValue<SkillFamily>((object)skillLocator.special, "_skillFamily", val4);
			Debug.Log((object)"        >|Added the special skill family!");
			LoadoutAPI.AddSkillFamily(val);
			LoadoutAPI.AddSkillFamily(val2);
			LoadoutAPI.AddSkillFamily(val3);
			LoadoutAPI.AddSkillFamily(val4);
			Debug.Log((object)"        >|Registered all Skill Families with the API!");
		}

		private void SetupPassive()
		{
			LanguageAPI.Add("MSISLE_PASSIVE_NAME", "Fly-by");
			LanguageAPI.Add("MSISLE_PASSIVE_DESCRIPTION", "Ms. Isle can <style=cIsUtility>fly</style> in any direction, and <style=cIsUtility>sprints</style> automatically when close to terrain. <style=cIsUtility>Jumping</style> is replaced with <style=cIsUtility>Overclocked Drives.</style>");
			skillLocator.passiveSkill.enabled = true;
			skillLocator.passiveSkill.skillNameToken = "MSISLE_PASSIVE_NAME";
			skillLocator.passiveSkill.skillDescriptionToken = "MSISLE_PASSIVE_DESCRIPTION";
			skillLocator.passiveSkill.icon = Resources.Load<Sprite>("textures/miscicons/texDroneIconOutlined");
			Debug.Log((object)"    >|Passive ability set up successfuly!");
		}

		private void SetupPrimary()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: 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_0374: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a2: Expected O, but got Unknown
			//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"    >|Adding Primary ability...");
			LanguageAPI.Add("MSISLE_1_MISSILEBARRAGE_NAME", "AtG Misike Mk.II");
			LanguageAPI.Add("MSISLE_1_MISSILEBARRAGE_DESCRIPTION", "<style=cIsUtility>Agile</style>. Fire a barrage of missiles for <style=cIsDamage>6x150% Damage</style>. Each missile explodes in a small radius. Fire-rate bonuses increase the number of missiles in the barrage.");
			Debug.Log((object)"        >|Creating primary skill definition...");
			SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
			val.activationState = new SerializableEntityStateType(typeof(MissileBarrage));
			val.activationStateMachineName = "Weapon";
			val.baseMaxStock = 1;
			val.baseRechargeInterval = 2f;
			val.beginSkillCooldownOnSkillEnd = false;
			val.canceledFromSprinting = false;
			val.cancelSprintingOnActivation = false;
			val.fullRestockOnAssign = true;
			val.interruptPriority = (InterruptPriority)0;
			val.isCombatSkill = true;
			val.mustKeyPress = false;
			val.rechargeStock = 1;
			val.requiredStock = 1;
			val.stockToConsume = 1;
			val.icon = Resources.Load<Sprite>("Textures/Achievementicons/texEngiClearTeleporterWithZeroMonstersIcon");
			val.skillDescriptionToken = "MSISLE_1_MISSILEBARRAGE_DESCRIPTION";
			val.skillName = "MSISLE_1_MISSILEBARRAGE_NAME";
			val.skillNameToken = "MSISLE_1_MISSILEBARRAGE_NAME";
			val.keywordTokens = new string[1] { "KEYWORD_AGILE" };
			Debug.Log((object)"        >|Registering skill definition with the API...");
			LoadoutAPI.AddSkillDef(val);
			Debug.Log((object)"        >|Setting up the projectile...");
			missilePrefab = Resources.Load<GameObject>("Prefabs/Projectiles/MissileProjectile");
			missilePrefab = PrefabAPI.InstantiateClone(missilePrefab, "Prefabs/MissileDroneMod/MissilePrefab");
			if ((Object)(object)missilePrefab != (Object)null)
			{
				MissileController component = missilePrefab.GetComponent<MissileController>();
				missilePrefab.GetComponent<ProjectileDamage>().force = 10f;
				missilePrefab.GetComponent<ProjectileController>().procCoefficient = 0.4f;
				Object.Destroy((Object)(object)missilePrefab.GetComponent<ProjectileSingleTargetImpact>());
				ProjectileImpactExplosion obj = missilePrefab.AddComponent<ProjectileImpactExplosion>();
				obj.impactEffect = Resources.Load<GameObject>("Prefabs/Effects/Omnieffect/OmniExplosionVFXCommandoGrenade");
				obj.destroyOnEnemy = true;
				obj.destroyOnWorld = true;
				obj.timerAfterImpact = false;
				((ProjectileExplosion)obj).falloffModel = (FalloffModel)1;
				obj.lifetime = 10f;
				obj.lifetimeAfterImpact = 0f;
				obj.lifetimeRandomOffset = 0f;
				((ProjectileExplosion)obj).blastRadius = 8f;
				((ProjectileExplosion)obj).blastDamageCoefficient = 1.5f;
				((ProjectileExplosion)obj).blastProcCoefficient = 0.9f;
				((ProjectileExplosion)obj).blastAttackerFiltering = (AttackerFiltering)0;
				((ProjectileExplosion)obj).bonusBlastForce = new Vector3(0f, 0f, 750f);
				((ProjectileExplosion)obj).fireChildren = false;
				((ProjectileExplosion)obj).childrenCount = 0;
				((ProjectileExplosion)obj).childrenDamageCoefficient = 0f;
				((ProjectileExplosion)obj).minAngleOffset = Vector3.zero;
				((ProjectileExplosion)obj).maxAngleOffset = Vector3.zero;
				obj.transformSpace = (TransformSpace)0;
				if ((Object)(object)missilePrefab != (Object)null)
				{
					MissileBarrage.projectilePrefab = missilePrefab;
				}
				MissileBarrage.baseFireInterval = bodyComponent.baseAttackSpeed;
				Debug.Log((object)"    >|Adding MsIsleMissileController component and setting/copying properties...");
				MsIsleMissileController msIsleMissileController = missilePrefab.AddComponent<MsIsleMissileController>();
				msIsleMissileController.acceleration = 9f;
				msIsleMissileController.deathTimer = component.deathTimer;
				msIsleMissileController.delayTimer = component.delayTimer;
				msIsleMissileController.giveupTimer = component.giveupTimer;
				msIsleMissileController.maxSeekDistance = component.maxSeekDistance;
				msIsleMissileController.maxVelocity = 50f;
				msIsleMissileController.rollVelocity = component.rollVelocity;
				((Component)msIsleMissileController).tag = ((Component)component).tag;
				msIsleMissileController.turbulence = 0.05f;
				Object.Destroy((Object)(object)component);
				if (!Object.op_Implicit((Object)(object)missilePrefab.GetComponent<NetworkIdentity>()))
				{
					missilePrefab.AddComponent<NetworkIdentity>();
				}
				ProjectileCatalog.getAdditionalEntries += delegate(List<GameObject> list)
				{
					list.Add(missilePrefab);
				};
				PrefabAPI.RegisterNetworkPrefab(missilePrefab, "Prefabs/MissileDroneMod/MissilePrefab", "SetupPrimary", 412);
			}
			Debug.Log((object)"        >|Adding skill variant to the primary family...");
			SkillFamily skillFamily = skillLocator.primary.skillFamily;
			Variant[] array = new Variant[1];
			Variant val2 = new Variant
			{
				skillDef = val,
				unlockableName = ""
			};
			((Variant)(ref val2)).viewableNode = new Node(val.skillNameToken, false, (Node)null);
			array[0] = val2;
			skillFamily.variants = (Variant[])(object)array;
			Debug.Log((object)"    >|Added primary ability!");
		}

		private void SetupSecondary()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Expected O, but got Unknown
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"    >|Adding Secondary ability...");
			LanguageAPI.Add("MSISLE_2_BARRAGE_NAME", "Pack Hounds");
			LanguageAPI.Add("MSISLE_2_BARRAGE_DESCRIPTION", "<style=cIsUtility>Agile.</style> Fire a salvo of auto-targeting pack-hound missiles for <style=cIsDamage>4x90% damage</style>. <i><b><style=cIsUtility>Charges for this skill are gained by kills</style></b></i>.");
			SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
			val.activationState = new SerializableEntityStateType(typeof(PackHounds));
			val.activationStateMachineName = "Weapon";
			val.baseMaxStock = 4;
			val.baseRechargeInterval = 0f;
			val.beginSkillCooldownOnSkillEnd = true;
			val.canceledFromSprinting = false;
			val.cancelSprintingOnActivation = false;
			val.dontAllowPastMaxStocks = true;
			val.fullRestockOnAssign = false;
			val.interruptPriority = (InterruptPriority)0;
			val.isCombatSkill = true;
			val.mustKeyPress = true;
			val.rechargeStock = 0;
			val.requiredStock = 1;
			val.stockToConsume = 1;
			val.icon = Resources.Load<Sprite>("Textures/itemicons/texMissileRackIcon");
			val.skillDescriptionToken = "MSISLE_2_BARRAGE_DESCRIPTION";
			val.skillName = "MSISLE_2_BARRAGE_NAME";
			val.skillNameToken = "MSISLE_2_BARRAGE_NAME";
			val.keywordTokens = new string[1] { "KEYWORD_AGILE" };
			LoadoutAPI.AddSkillDef(val);
			skillLocator.secondary.skillFamily.variants = (Variant[])(object)new Variant[1];
			Variant[] variants = skillLocator.secondary.skillFamily.variants;
			Variant val2 = new Variant
			{
				skillDef = val,
				unlockableName = ""
			};
			((Variant)(ref val2)).viewableNode = new Node(val.skillNameToken, false, (Node)null);
			variants[0] = val2;
			PackHounds.projectilePrefab = PrefabAPI.InstantiateClone(Resources.Load<GameObject>("Prefabs/Projectiles/MissileProjectile"), "Prefabs/MissileDroneMod/PackHoundMissile");
			PackHounds.projectilePrefab.AddComponent<MissileControllerNotFucked>().CannibaliseFucked();
			PackHounds.projectilePrefab.GetComponent<ProjectileController>().procCoefficient = 0.7f;
			PackHounds.projectilePrefab.GetComponent<ProjectileSingleTargetImpact>().destroyOnWorld = false;
			if (!Object.op_Implicit((Object)(object)PackHounds.projectilePrefab.GetComponent<NetworkIdentity>()))
			{
				PackHounds.projectilePrefab.AddComponent<NetworkIdentity>();
			}
			ProjectileCatalog.getAdditionalEntries += delegate(List<GameObject> list)
			{
				list.Add(PackHounds.projectilePrefab);
			};
			PrefabAPI.RegisterNetworkPrefab(PackHounds.projectilePrefab, "Prefabs/MissileDroneMod/PackHoundMissile", "SetupSecondary", 517);
			skillLocator.secondary.stock = 0;
			dronePassiveManager.packHoundsSkill = skillLocator.secondary;
			Debug.Log((object)"    >|Added secondary ability!");
		}

		private void SetupUtility()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: 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_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Expected O, but got Unknown
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"    >|Adding Utility ability...");
			LanguageAPI.Add("MSISLE_3_DRONEBOOST_NAME", "Overclocked Drives");
			LanguageAPI.Add("MSISLE_3_DRONEBOOST_DESCRIPTION", "Enter a brief <style=cIsUtility>omnidirectional boost</style>. <style=cIsUtility>Replenishes all charges</style> when near terrain. <b>Bonuses to jump stats affect this ability instead!</b>");
			SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
			val.activationState = new SerializableEntityStateType(typeof(DroneBoostAbility));
			val.activationStateMachineName = "Weapon";
			val.baseMaxStock = 1;
			val.baseRechargeInterval = 0f;
			val.beginSkillCooldownOnSkillEnd = true;
			val.canceledFromSprinting = false;
			val.fullRestockOnAssign = false;
			val.interruptPriority = (InterruptPriority)0;
			val.isCombatSkill = false;
			val.mustKeyPress = true;
			val.cancelSprintingOnActivation = false;
			val.rechargeStock = 0;
			val.requiredStock = 1;
			val.dontAllowPastMaxStocks = true;
			val.stockToConsume = 1;
			val.icon = Resources.Load<Sprite>("Textures/achievementicons/texDiscover5EquipmentIcon");
			val.skillDescriptionToken = "MSISLE_3_DRONEBOOST_DESCRIPTION";
			val.skillName = "MSISLE_3_DRONEBOOST_NAME";
			val.skillNameToken = "MSISLE_3_DRONEBOOST_NAME";
			LoadoutAPI.AddSkillDef(val);
			skillLocator.utility.skillFamily.variants = (Variant[])(object)new Variant[1];
			Variant[] variants = skillLocator.utility.skillFamily.variants;
			Variant val2 = new Variant
			{
				skillDef = val,
				unlockableName = ""
			};
			((Variant)(ref val2)).viewableNode = new Node(val.skillNameToken, false, (Node)null);
			variants[0] = val2;
			dronePassiveManager.utilitySkill = skillLocator.utility;
			dronePassiveManager.utilitySkillDef = val;
			Debug.Log((object)"    >|Added secondary ability!");
		}

		private void SetupSpecial()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: 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_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Expected O, but got Unknown
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"    >|Adding Special ability...");
			LanguageAPI.Add("MSISLE_4_NUKE_NAME", "Cumulative Warhead");
			LanguageAPI.Add("MSISLE_4_NUKE_DESCRIPTION", "<style=cIsUtility>Stunning</style>. Fire a slow-moving rocket for <style=cIsDamage>500% damage</style> that <style=cIsDamage>absorbs damage</style> and releases it in a <style=cIsDamage>huge detonation</style> on impact.");
			SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
			val.activationState = new SerializableEntityStateType(typeof(NukeAbility));
			val.activationStateMachineName = "Weapon";
			val.baseMaxStock = 1;
			val.baseRechargeInterval = 35f;
			val.beginSkillCooldownOnSkillEnd = true;
			val.canceledFromSprinting = false;
			val.fullRestockOnAssign = true;
			val.interruptPriority = (InterruptPriority)0;
			val.isCombatSkill = false;
			val.mustKeyPress = true;
			val.cancelSprintingOnActivation = false;
			val.rechargeStock = 1;
			val.requiredStock = 1;
			val.stockToConsume = 1;
			val.icon = Resources.Load<Sprite>("Textures/Achievementicons/texObtainArtifactBombIcon");
			val.skillDescriptionToken = "MSISLE_4_NUKE_DESCRIPTION";
			val.skillName = "MSISLE_4_NUKE_NAME";
			val.skillNameToken = "MSISLE_4_NUKE_NAME";
			val.keywordTokens = new string[1] { "KEYWORD_STUNNING" };
			SetupNukeProjectile();
			LoadoutAPI.AddSkillDef(val);
			skillLocator.special.skillFamily.variants = (Variant[])(object)new Variant[1];
			Variant[] variants = skillLocator.special.skillFamily.variants;
			Variant val2 = new Variant
			{
				skillDef = val,
				unlockableName = ""
			};
			((Variant)(ref val2)).viewableNode = new Node(val.skillNameToken, false, (Node)null);
			variants[0] = val2;
			Debug.Log((object)"    >|Added special ability!");
		}

		private void SetupNukeProjectile()
		{
			//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_00da: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = PrefabAPI.InstantiateClone(Resources.Load<GameObject>("Prefabs/Projectiles/VagrantTrackingBomb"), "Prefabs/MissileDroneMod/NukePrefabTestVagrant");
			HealthComponent component = val.GetComponent<HealthComponent>();
			component.health = 1000f;
			component.body.baseMaxHealth = 1000f;
			ProjectileController component2 = val.GetComponent<ProjectileController>();
			GameObject val2 = PrefabAPI.InstantiateClone(Resources.Load<GameObject>("Prefabs/projectileghosts/EngiHarpoonGhost"), "Prefabs/MissileDroneMod/MsIsleNukeGhost");
			if (!Object.op_Implicit((Object)(object)val2.GetComponent<NetworkIdentity>()))
			{
				val2.AddComponent<NetworkIdentity>();
			}
			PrefabAPI.RegisterNetworkPrefab(val2, "Prefabs/MissileDroneMod/MsIsleNukeGhost", "SetupNukeProjectile", 654);
			Transform transform = val2.transform;
			transform.localScale *= 7.5f;
			component2.ghostPrefab = val2;
			ProjectileSimple component3 = val.GetComponent<ProjectileSimple>();
			component3.lifetime = 128f;
			component3.desiredForwardSpeed = 12f;
			val.AddComponent<DamageAccumulatorFixed>();
			ProjectileImpactExplosion component4 = val.GetComponent<ProjectileImpactExplosion>();
			((ProjectileExplosion)component4).blastRadius = 5f;
			((ProjectileExplosion)component4).blastDamageCoefficient = 0.5f;
			((ProjectileExplosion)component4).falloffModel = (FalloffModel)1;
			component4.impactEffect = Resources.Load<GameObject>("Prefabs/effects/impacteffects/BootShockwave");
			Object.Destroy((Object)(object)val.GetComponent<ProjectileSteerTowardTarget>());
			Object.Destroy((Object)(object)val.GetComponent<ProjectileDirectionalTargetFinder>());
			val.GetComponent<SphereCollider>().radius = 2f;
			NukeAbility.projectilePrefabNuke = val;
			if (!Object.op_Implicit((Object)(object)val.GetComponent<NetworkIdentity>()))
			{
				val.AddComponent<NetworkIdentity>();
			}
			ContentAddition.AddProjectile(val);
			ContentAddition.AddBody(val);
			PrefabAPI.RegisterNetworkPrefab(val, "Prefabs/MissileDroneMod/NukePrefabTestVagrant", "SetupNukeProjectile", 709);
			Debug.Log((object)"    >|\"Nuke\" projectile set up and assigned!");
		}

		public static float GetICBMDamageMult(CharacterBody body)
		{
			float num = 1f;
			if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory))
			{
				int itemCount = body.inventory.GetItemCount(Items.MoreMissile);
				int num2 = itemCount - 1;
				if (num2 > 0)
				{
					num += (float)num2 * 0.5f;
				}
				if (itemCount > 0)
				{
					num *= 0.5f;
				}
			}
			return num;
		}
	}
	public static class Skins
	{
		public static void RegisterSkins()
		{
			//IL_005e: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: 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)
			GameObject gameObject = ((Component)MsIsle.msIsleCharacter.GetComponentInChildren<ModelLocator>().modelTransform).gameObject;
			CharacterModel component = gameObject.GetComponent<CharacterModel>();
			if (Object.op_Implicit((Object)(object)gameObject.GetComponent<ModelSkinController>()))
			{
				Object.Destroy((Object)(object)gameObject.GetComponent<ModelSkinController>());
			}
			ModelSkinController obj = gameObject.AddComponent<ModelSkinController>();
			gameObject.GetComponent<ChildLocator>();
			Reflection.GetFieldValue<SkinnedMeshRenderer>((object)component, "mainSkinnedMeshRenderer");
			LanguageAPI.Add("MSISLE_DEFAULT_SKIN_NAME", "Stock");
			SkinDef val = LoadoutAPI.CreateNewSkinDef(new SkinDefInfo
			{
				BaseSkins = Array.Empty<SkinDef>(),
				GameObjectActivations = Array.Empty<GameObjectActivation>(),
				Icon = LoadoutAPI.CreateSkinIcon(new Color(4f / 15f, 0.57254905f, 0.40784314f), new Color(0f, 0.18039216f, 31f / 85f), new Color(1f, 1f, 0.9372549f), new Color(0f, 0.03137255f, 0.0627451f)),
				MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0],
				Name = "MSISLE_DEFAULT_SKIN_NAME",
				NameToken = "MSISLE_DEFAULT_SKIN_NAME",
				RendererInfos = component.baseRendererInfos,
				RootObject = gameObject,
				UnlockableDef = null,
				MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0],
				ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0]
			});
			obj.skins = (SkinDef[])(object)new SkinDef[1] { val };
		}
	}
	internal class SpawnState : FlyState
	{
		public override void OnEnter()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			((FlyState)this).OnEnter();
			TeleportHelper.TeleportBody(((EntityState)this).characterBody, new Vector3(((EntityState)this).characterBody.footPosition.x, ((EntityState)this).characterBody.footPosition.y + 2f, ((EntityState)this).characterBody.footPosition.z));
		}
	}
}
namespace MissileDroneSurvivor.Projectiles
{
	[RequireComponent(typeof(ProjectileTargetComponent))]
	[RequireComponent(typeof(Rigidbody))]
	public class MissileControllerNotFucked : MonoBehaviour
	{
		private Transform transform;

		private Rigidbody rigidbody;

		private TeamFilter teamFilter;

		private ProjectileTargetComponent targetComponent;

		public float maxVelocity;

		public float rollVelocity;

		public float acceleration;

		public float delayTimer;

		public float giveupTimer = 8f;

		public float deathTimer = 10f;

		private float timer;

		private QuaternionPID torquePID;

		public float turbulence;

		public float maxTurbulence;

		public float turbulenceMaxDist = 17f;

		public float turbulenceMinDist = 4f;

		public float maxSeekDistance = 40f;

		private BullseyeSearch search = new BullseyeSearch();

		private ProjectileController controller;

		private Transform overrideTarget;

		public void CannibaliseFucked()
		{
			MissileController component = ((Component)this).GetComponent<MissileController>();
			if (Object.op_Implicit((Object)(object)component))
			{
				acceleration = component.acceleration;
				deathTimer = component.deathTimer;
				giveupTimer = component.giveupTimer;
				maxSeekDistance = component.maxSeekDistance;
				maxVelocity = component.maxVelocity;
				rollVelocity = component.rollVelocity;
				Object.Destroy((Object)(object)component);
			}
		}

		private void Start()
		{
			float num = 5f;
			float num2 = 3f;
			maxTurbulence = (turbulence = num + (Random.value - 0.5f) * 2f * num2);
			float num3 = 0.3f;
			float num4 = 0.125f;
			delayTimer = num3 + (Random.value * 2f - 1f) * num4;
		}

		private void Awake()
		{
			transform = ((Component)this).transform;
			rigidbody = ((Component)this).GetComponent<Rigidbody>();
			torquePID = ((Component)this).GetComponent<QuaternionPID>();
			teamFilter = ((Component)this).GetComponent<TeamFilter>();
			targetComponent = ((Component)this).GetComponent<ProjectileTargetComponent>();
			controller = ((Component)this).GetComponent<ProjectileController>();
		}

		private void FixedUpdate()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_00cb: 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_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: 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_00e6: 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_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: 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_010c: 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_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			timer += Time.fixedDeltaTime;
			if (timer < giveupTimer)
			{
				rigidbody.velocity = transform.forward * maxVelocity;
				if (Object.op_Implicit((Object)(object)targetComponent.target) && timer >= delayTimer)
				{
					rigidbody.velocity = transform.forward * (maxVelocity + timer * acceleration);
					turbulence = CalculateTurbulence(targetComponent.target);
					Vector3 val = targetComponent.target.position + Random.insideUnitSphere * turbulence - transform.position;
					if (val != Vector3.zero)
					{
						Quaternion rotation = transform.rotation;
						Quaternion targetQuat = Util.QuaternionSafeLookRotation(val);
						torquePID.inputQuat = rotation;
						torquePID.targetQuat = targetQuat;
						rigidbody.angularVelocity = torquePID.UpdatePID();
					}
				}
			}
			if (!Object.op_Implicit((Object)(object)targetComponent.target))
			{
				targetComponent.target = FindTarget();
			}
			else
			{
				HealthComponent component = ((Component)targetComponent.target).GetComponent<HealthComponent>();
				if (Object.op_Implicit((Object)(object)component) && !component.alive)
				{
					targetComponent.target = FindTarget();
				}
			}
			if (timer > deathTimer)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}

		private Transform FindTarget()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			search.searchOrigin = transform.position;
			search.searchDirection = transform.forward;
			((TeamMask)(ref search.teamMaskFilter)).RemoveTeam(teamFilter.teamIndex);
			search.RefreshCandidates();
			search.sortMode = (SortMode)1;
			IEnumerable<HurtBox> results = search.GetResults();
			int num = results.Count();
			if (num < 1)
			{
				return null;
			}
			int index = Random.RandomRangeInt(0, Mathf.Min(4, num));
			HurtBox val = results.ElementAt(index);
			if ((Object)(object)val == (Object)null)
			{
				return null;
			}
			return ((Component)val).transform;
		}

		private float CalculateTurbulence(Transform target)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			return RemapValueClamped(Vector3.Distance(target.position, transform.position), turbulenceMinDist, turbulenceMaxDist, 0f, maxTurbulence);
		}

		public static float RemapValueClamped(float value, float low1, float high1, float low2, float high2)
		{
			return Mathf.Clamp(low2 + (value - low1) * (high2 - low2) / (high1 - low1), low2, high2);
		}
	}
	[RequireComponent(typeof(ProjectileTargetComponent))]
	[RequireComponent(typeof(Rigidbody))]
	public class MsIsleMissileController : MonoBehaviour
	{
		private Transform transform;

		private Rigidbody rigidbody;

		private TeamFilter teamFilter;

		private ProjectileTargetComponent targetComponent;

		public float maxVelocity;

		public float rollVelocity;

		public float acceleration;

		public float delayTimer;

		public float giveupTimer = 8f;

		public float deathTimer = 10f;

		private float timer;

		private QuaternionPID torquePID;

		public float turbulence;

		public float maxTurbulence;

		private float turbulenceMaxDist = 18f;

		private float turbulenceMinDist = 4f;

		public float maxSeekDistance = 40f;

		private BullseyeSearch search = new BullseyeSearch();

		public void Start()
		{
			float num = 7f;
			float num2 = 3f;
			turbulence = (maxTurbulence = num + (Random.value - 0.5f) * 2f * num2);
			float num3 = 0.2f;
			float num4 = 0.125f;
			delayTimer = num3 + (Random.value * 2f - 1f) * num4;
		}

		public void Awake()
		{
			transform = ((Component)this).transform;
			rigidbody = ((Component)this).GetComponent<Rigidbody>();
			torquePID = ((Component)this).GetComponent<QuaternionPID>();
			teamFilter = ((Component)this).GetComponent<TeamFilter>();
			targetComponent = ((Component)this).GetComponent<ProjectileTargetComponent>();
		}

		public void FixedUpdate()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_00cb: 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_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: 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_00e6: 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_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: 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_010c: 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_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			timer += Time.fixedDeltaTime;
			if (timer < giveupTimer)
			{
				rigidbody.velocity = transform.forward * maxVelocity;
				if (Object.op_Implicit((Object)(object)targetComponent.target) && timer >= delayTimer)
				{
					turbulence = CalculateTurbulence(targetComponent.target);
					rigidbody.velocity = transform.forward * (maxVelocity + timer * acceleration);
					Vector3 val = targetComponent.target.position + Random.insideUnitSphere * turbulence - transform.position;
					if (val != Vector3.zero)
					{
						Quaternion rotation = transform.rotation;
						Quaternion targetQuat = Util.QuaternionSafeLookRotation(val);
						torquePID.inputQuat = rotation;
						torquePID.targetQuat = targetQuat;
						rigidbody.angularVelocity = torquePID.UpdatePID();
					}
				}
			}
			if (!Object.op_Implicit((Object)(object)targetComponent.target))
			{
				targetComponent.target = FindTarget();
			}
			else
			{
				HealthComponent component = ((Component)targetComponent.target).GetComponent<HealthComponent>();
				if (Object.op_Implicit((Object)(object)component) && !component.alive)
				{
					targetComponent.target = FindTarget();
				}
			}
			if (timer > deathTimer)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}

		private Transform FindTarget()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: 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)
			search.searchOrigin = transform.position;
			search.searchDirection = transform.forward;
			search.maxAngleFilter = 20f;
			((TeamMask)(ref search.teamMaskFilter)).RemoveTeam(teamFilter.teamIndex);
			search.sortMode = (SortMode)2;
			search.RefreshCandidates();
			HurtBox val = search.GetResults().FirstOrDefault();
			if ((Object)(object)val == (Object)null)
			{
				return null;
			}
			return ((Component)val).transform;
		}

		private float CalculateTurbulence(Transform target)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			return MissileControllerNotFucked.RemapValueClamped(Vector3.Distance(target.position, transform.position), turbulenceMinDist, turbulenceMaxDist, 0f, maxTurbulence);
		}
	}
}
namespace MissileDroneSurvivor.MsIsleEntityStates
{
	public class MissileBarrage : BaseState
	{
		private const int numRocketsBase = 6;

		private const float rocketFireIntervalBase = 0.5f;

		private const float missileRecharge = 2f;

		public static GameObject effectPrefab;

		public static GameObject projectilePrefab;

		public static float damageCoefficient = 1.5f;

		public static float baseFireInterval = 1f;

		public static float minSpread = 0.5f;

		public static float maxSpread = 1.5f;

		public static int maxMissileCount;

		private float fireTimer;

		private float fireInterval;

		private Transform modelTransform;

		private AimAnimator aimAnimator;

		private int missileCount;

		private int ICBMCount;

		private void FireMissile(string targetMuzzle)
		{
			//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_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: 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_00da: 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_00ed: 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_0107: 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)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: 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_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_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			missileCount++;
			((EntityState)this).PlayAnimation("Gesture, Additive", "FireMissile");
			Ray aimRay = ((BaseState)this).GetAimRay();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					Transform val = component.FindChild(targetMuzzle);
					if (Object.op_Implicit((Object)(object)val))
					{
						((Ray)(ref aimRay)).origin = val.position;
					}
				}
			}
			if (Object.op_Implicit((Object)(object)effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, targetMuzzle, false);
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(2f);
			}
			if (((EntityState)this).isAuthority)
			{
				float num = Random.Range(minSpread, maxSpread);
				float num2 = Random.Range(0f, 360f);
				Vector3 up = Vector3.up;
				Vector3 val2 = Vector3.Cross(up, ((Ray)(ref aimRay)).direction);
				Vector3 val3 = Quaternion.Euler(0f, 0f, num2) * (Quaternion.Euler(num, 0f, 0f) * Vector3.forward);
				float y = val3.y;
				val3.y = 0f;
				float num3 = Mathf.Atan2(val3.z, val3.x) * 57.29578f - 90f;
				float num4 = Mathf.Atan2(y, ((Vector3)(ref val3)).magnitude) * 57.29578f;
				Vector3 val4 = Quaternion.AngleAxis(num3, up) * (Quaternion.AngleAxis(num4, val2) * ((Ray)(ref aimRay)).direction);
				float iCBMDamageMult = MsIsle.GetICBMDamageMult(((EntityState)this).characterBody);
				ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(val4), ((EntityState)this).gameObject, base.damageStat * damageCoefficient * iCBMDamageMult, 0f, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
				if (ICBMCount > 0)
				{
					Vector3 val5 = Vector3.Cross(Vector3.up, ((Ray)(ref aimRay)).direction);
					Vector3 val6 = Vector3.Cross(((Ray)(ref aimRay)).direction, val5);
					Quaternion val7 = Quaternion.AngleAxis(5f, val6);
					Quaternion val8 = Quaternion.AngleAxis(-5f, val6);
					Vector3 val9 = val7 * val4;
					Vector3 val10 = val8 * val4;
					ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(val9), ((EntityState)this).gameObject, base.damageStat * damageCoefficient * iCBMDamageMult, 0f, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
					ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(val10), ((EntityState)this).gameObject, base.damageStat * damageCoefficient * iCBMDamageMult, 0f, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
				}
			}
		}

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory))
			{
				ICBMCount = ((EntityState)this).characterBody.inventory.GetItemCount(Items.MoreMissile);
			}
			modelTransform = ((EntityState)this).GetModelTransform();
			float num = (base.attackSpeedStat / baseFireInterval - 1f) / 0.3f;
			int num2 = Mathf.RoundToInt(num);
			int num3 = 6 + num2;
			float num4 = 2f / (2f * (6f + num));
			fireInterval = num4;
			float num5 = 1f + (num - (float)num2) * 0.25f;
			((EntityState)this).skillLocator.secondary.cooldownScale = 1f / num5;
			maxMissileCount = num3;
			FireMissileBarrage.minSpread = 0f;
			FireMissileBarrage.maxSpread = 3.5f;
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			fireTimer -= Time.fixedDeltaTime;
			if (fireTimer <= 0f)
			{
				FireMissile("Muzzle");
				fireTimer += fireInterval;
			}
			if (missileCount >= maxMissileCount && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
	public class DroneBoostAbility : BaseState
	{
		public float boostDuration = 2f;

		private float stopwatch;

		public float boostBaseStrength = 2f;

		public float boostStrengthPerUpgrade = 0.15f;

		public int quailsOwned;

		private bool isSprinting;

		private const float kNonSprintBonus = 1.6f;

		private float storedBaseSpeed;

		private DronePassiveSkill passiveManager;

		private CharacterBody body;

		public static float dodgeFOV;

		public override void OnEnter()
		{
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: 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_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			if (!Object.op_Implicit((Object)(object)body))
			{
				body = ((EntityState)this).gameObject.GetComponent<CharacterBody>();
			}
			if (!Object.op_Implicit((Object)(object)passiveManager))
			{
				passiveManager = ((EntityState)this).gameObject.GetComponent<DronePassiveSkill>();
			}
			isSprinting = body.isSprinting;
			stopwatch = 0f;
			passiveManager.OnDroneBoost(this);
			Util.PlaySound("Play_drone_repair", ((EntityState)this).gameObject);
			Util.PlaySound("Play_loader_m2_launch", ((EntityState)this).gameObject);
			storedBaseSpeed = base.moveSpeedStat * (boostBaseStrength + boostStrengthPerUpgrade * (float)quailsOwned) * (isSprinting ? 1f : 1.6f);
			Vector3 val;
			if (((Vector3)(ref ((EntityState)this).rigidbodyMotor.moveVector)).magnitude > 0.01f)
			{
				val = ((Vector3)(ref ((EntityState)this).rigidbodyMotor.moveVector)).normalized;
			}
			else
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				val = ((Ray)(ref aimRay)).direction;
			}
			((EntityState)this).rigidbodyMotor.rigid.AddForce(val * storedBaseSpeed, (ForceMode)2);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= boostDuration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)6;
		}

		public override void OnExit()
		{
			passiveManager.OnDroneBoostExit(this);
			((EntityState)this).OnExit();
		}
	}
	public class NukeAbility : BaseState
	{
		public static GameObject effectPrefab;

		public static GameObject projectilePrefabNuke;

		public static float damageCoefficient = 5f;

		public static float baseFireDelay = 0.2f;

		private bool hasFired;

		private float fireTimer;

		public static float minSpread = 0f;

		public static float maxSpread = 5f;

		private Transform modelTransform;

		private AimAnimator aimAnimator;

		private void FireMissile(string targetMuzzle)
		{
			//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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: 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_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: 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_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: 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_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).PlayAnimation("Gesture, Additive", "FireMissile");
			Ray aimRay = ((BaseState)this).GetAimRay();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					Transform val = component.FindChild(targetMuzzle);
					if (Object.op_Implicit((Object)(object)val))
					{
						((Ray)(ref aimRay)).origin = val.position;
					}
				}
			}
			if (Object.op_Implicit((Object)(object)effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, targetMuzzle, false);
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(2f);
			}
			if (((EntityState)this).isAuthority)
			{
				float num = Random.Range(minSpread, maxSpread);
				float num2 = Random.Range(0f, 360f);
				Vector3 up = Vector3.up;
				Vector3 val2 = Vector3.Cross(up, ((Ray)(ref aimRay)).direction);
				Vector3 val3 = Quaternion.Euler(0f, 0f, num2) * (Quaternion.Euler(num, 0f, 0f) * Vector3.forward);
				float y = val3.y;
				val3.y = 0f;
				float num3 = Mathf.Atan2(val3.z, val3.x) * 57.29578f - 90f;
				float num4 = Mathf.Atan2(y, ((Vector3)(ref val3)).magnitude) * 57.29578f;
				Vector3 val4 = Quaternion.AngleAxis(num3, up) * (Quaternion.AngleAxis(num4, val2) * ((Ray)(ref aimRay)).direction);
				ProjectileManager.instance.FireProjectile(projectilePrefabNuke, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(val4), ((EntityState)this).gameObject, base.damageStat * damageCoefficient, 100f, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
				Util.PlaySound("Play_engi_seekerMissile_shoot", ((EntityState)this).gameObject);
				hasFired = true;
			}
		}

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			modelTransform = ((EntityState)this).GetModelTransform();
			hasFired = false;
			fireTimer = baseFireDelay;
			Util.PlaySound("Play_engi_seekerMissile_lockOn", ((EntityState)this).gameObject);
			Util.PlaySound("Play_engi_seekerMissile_HUD_open", ((EntityState)this).gameObject);
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			fireTimer -= Time.fixedDeltaTime;
			if (!hasFired && fireTimer <= 0f)
			{
				FireMissile("Muzzle");
				if (((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
	public class PackHounds : BaseState
	{
		public static GameObject effectPrefab;

		public static GameObject projectilePrefab;

		public static float damageCoefficient = 0.9f;

		public static float baseFireInterval = 0.1f;

		public static float minSpread = 0f;

		public static float maxSpread = 5f;

		public static int maxSalvoCount;

		private float fireTimer;

		private float fireInterval;

		private Transform modelTransform;

		private AimAnimator aimAnimator;

		private int missileCount;

		private int ICBMCount;

		private const int kSalvoSize = 4;

		public static float kSalvoIntermissionDelay = 0.35f;

		private int salvoIdx;

		private int salvoMissileIdx;

		private void FireMissile()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: 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_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			missileCount++;
			if (((EntityState)this).isAuthority)
			{
				bool flag = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master);
				Vector3 val = (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) ? ((EntityState)this).inputBank.aimOrigin : ((EntityState)this).transform.position);
				if (!Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
				{
					_ = ((EntityState)this).transform.forward;
				}
				else
				{
					_ = ((EntityState)this).inputBank.aimDirection;
				}
				Vector3 val2 = Vector3.up + Random.insideUnitSphere * 0.1f;
				GameObject val3 = null;
				DronePassiveSkill component = ((Component)((EntityState)this).characterBody).GetComponent<DronePassiveSkill>();
				if ((Object)(object)component != (Object)null && (Object)(object)component.mostRecentNuke != (Object)null)
				{
					val3 = ((Component)component.mostRecentNuke).gameObject;
				}
				ProjectileManager.instance.FireProjectile(projectilePrefab, val, Util.QuaternionSafeLookRotation(val2 + Random.insideUnitSphere * 0f), ((EntityState)this).gameObject, ((EntityState)this).characterBody.damage * damageCoefficient, 200f, flag, (DamageColorIndex)3, val3, -1f);
			}
		}

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			Util.PlaySound("Play_engi_seekerMissile_lockOn", ((EntityState)this).gameObject);
			modelTransform = ((EntityState)this).GetModelTransform();
			fireInterval = baseFireInterval / base.attackSpeedStat;
			DronePassiveSkill component = ((EntityState)this).gameObject.GetComponent<DronePassiveSkill>();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory))
			{
				ICBMCount = ((EntityState)this).characterBody.inventory.GetItemCount(Items.MoreMissile);
			}
			maxSalvoCount = component.packHoundCount + ((ICBMCount > 0) ? 2 : 0);
			component.OnPackHoundsUsed();
			salvoIdx = 0;
			salvoMissileIdx = 0;
		}

		public override void OnExit()
		{
			int packHoundCount = Mathf.Max(maxSalvoCount - 1 - (salvoIdx - 1), 0);
			((EntityState)this).gameObject.GetComponent<DronePassiveSkill>().packHoundCount = packHoundCount;
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (salvoIdx >= maxSalvoCount)
			{
				((EntityState)this).outer.SetNextStateToMain();
				return;
			}
			fireTimer -= Time.fixedDeltaTime;
			if (fireTimer <= 0f)
			{
				FireMissile();
				salvoMissileIdx++;
				if (salvoMissileIdx >= 4 + ((ICBMCount > 0) ? 2 : 0))
				{
					salvoMissileIdx = 0;
					salvoIdx++;
					fireTimer += kSalvoIntermissionDelay;
				}
				else
				{
					fireTimer += fireInterval;
				}
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)6;
		}
	}
	public class TestPrimarySkill : BaseSkillState
	{
		public float baseDuration = 0.5f;

		private float duration;

		public GameObject effectPrefab = Resources.Load<GameObject>("prefabs/effects/impacteffects/Hitspark");

		public GameObject hitEffectPrefab = Resources.Load<GameObject>("prefabs/effects/impacteffects/critspark");

		public GameObject tracerEffectPrefab = Resources.Load<GameObject>("prefabs/effects/tracers/tracerbanditshotgun");

		public override void OnEnter()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: 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_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_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: 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)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_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_010f: 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_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: 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)
			((BaseState)this).OnEnter();
			Chat.AddMessage("YOOOO we just entered the Ms. Isle primary skill state!");
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 2f, false);
			((EntityState)this).PlayAnimation("Gesture, Override", "FireShotgun", "FireShotgun.playbackRate", duration * 1.1f);
			if (((EntityState)this).isAuthority)
			{
				new BulletAttack
				{
					owner = ((EntityState)this).gameObject,
					weapon = ((EntityState)this).gameObject,
					origin = ((Ray)(ref aimRay)).origin,
					aimVector = ((Ray)(ref aimRay)).direction,
					minSpread = 0f,
					maxSpread = ((EntityState)this).characterBody.spreadBloomAngle,
					bulletCount = 1u,
					procCoefficient = 1f,
					damage = ((EntityState)this).characterBody.damage,
					force = 3f,
					falloffModel = (FalloffModel)1,
					tracerEffectPrefab = tracerEffectPrefab,
					hitEffectPrefab = hitEffectPrefab,
					isCrit = ((BaseState)this).RollCrit(),
					HitEffectNormal = false,
					stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask,
					smartCollision = true,
					maxDistance = 300f
				}.Fire();
			}
		}

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

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
}