Decompiled source of Marian v1.2.7

MarianMod.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Commando;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.Engi.EngiMissilePainter;
using EntityStates.Engi.EngiWeapon;
using EntityStates.EngiTurret.EngiTurretWeapon;
using EntityStates.GolemMonster;
using HG;
using HG.BlendableTypes;
using KinematicCharacterController;
using MarianMod.Achievements;
using MarianMod.Modules;
using MarianMod.Modules.Characters;
using MarianMod.Modules.CustomScripts;
using MarianMod.Modules.Survivors;
using MarianMod.SkillStates;
using MarianMod.SkillStates.BaseStates;
using On.RoR2;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("MarianMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MarianMod")]
[assembly: AssemblyTitle("MarianMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: UnverifiableCode]
namespace MarianMod
{
	internal static class Log
	{
		internal static ManualLogSource _logSource;

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

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

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

		internal static void 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);
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.uninvitedcalamity.MarianMod", "UninvitedCalamity_MarianMod", "1.2.7")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[R2APISubmoduleDependency(new string[] { "PrefabAPI", "LanguageAPI", "SoundAPI", "UnlockableAPI" })]
	public class MarianPlugin : BaseUnityPlugin
	{
		public const string MODUID = "com.uninvitedcalamity.MarianMod";

		public const string MODNAME = "UninvitedCalamity_MarianMod";

		public const string MODVERSION = "1.2.7";

		public const string DEVELOPER_PREFIX = "UninvitedCalamity";

		public static MarianPlugin instance;

		private int DisplaysEnabled = 1;

		private static ConfigFile CustomConfigFile { get; set; }

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

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

		private void Awake()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			CustomConfigFile = new ConfigFile(Paths.ConfigPath + "\\com-uninvitedCalamity-Marian.cfg", true);
			MyConfigEntry = CustomConfigFile.Bind<int>("ColourBlindness Section", "ColourBlindMode, default 0: set to 1 for Red-Green Blindness, 2 for Blue-Yellow Blindness", 0, "1 for Red-Green Blindness, 2 for Blue-Yellow Blindness");
			MyConfigEntry = CustomConfigFile.Bind<int>("DisplaySection", "DisplayItems, default 1: Set to 1 for True, 0 for False", 1, "Set to 1 for True, 0 for False");
			if (Chainloader.PluginInfos.ContainsKey("com.johnedwa.RTAutoSprintEx"))
			{
				((Component)this).SendMessage("RT_SprintDisableMessage", (object)"MarianMod.SkillStates.PrimaryFire");
				((Component)this).SendMessage("RT_SprintDisableMessage", (object)"MarianMod.SkillStates.MarianFlare");
			}
			instance = this;
			Log.Init(((BaseUnityPlugin)this).Logger);
			Assets.Initialize();
			Config.ReadConfig();
			States.RegisterStates();
			Buffs.RegisterBuffs();
			Projectiles.RegisterProjectiles();
			Tokens.AddTokens();
			ItemDisplays.PopulateDisplays();
			new MyMarian().Initialize();
			new ContentPacks().Initialize();
			Hook();
		}

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

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)self))
			{
			}
		}
	}
}
namespace MarianMod.SkillStates
{
	public class Roll : BaseSkillState
	{
		public static float duration = 0.5f;

		public static float initialSpeedCoefficient = 5f;

		public static float finalSpeedCoefficient = 2.5f;

		public static string dodgeSoundString = "MarianRoll";

		public static float dodgeFOV = DodgeState.dodgeFOV;

		private float rollSpeed;

		private Vector3 forwardDirection;

		private Animator animator;

		private Vector3 previousPosition;

		public override void OnEnter()
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: 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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: 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_013e: 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)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector);
				forwardDirection = ((Vector3)(ref val)).normalized;
			}
			Vector3 val2 = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : forwardDirection);
			Vector3 val3 = Vector3.Cross(Vector3.up, val2);
			float num = Vector3.Dot(forwardDirection, val2);
			float num2 = Vector3.Dot(forwardDirection, val3);
			RecalculateRollSpeed();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterMotor.velocity.y = 0f;
				((EntityState)this).characterMotor.velocity = forwardDirection * rollSpeed;
			}
			Vector3 val4 = (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) ? ((EntityState)this).characterMotor.velocity : Vector3.zero);
			previousPosition = ((EntityState)this).transform.position - val4;
			((EntityState)this).PlayAnimation("FullBody, Override", "Roll", "Roll.playbackRate", duration, 0f);
			Util.PlaySound(dodgeSoundString, ((EntityState)this).gameObject);
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.MissileBuff, 3f * duration);
				((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.5f * duration);
			}
		}

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

		public override void FixedUpdate()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: 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_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: 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_00c4: 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_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: 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)
			((EntityState)this).FixedUpdate();
			RecalculateRollSpeed();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = forwardDirection;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				((EntityState)this).cameraTargetParams.fovOverride = Mathf.Lerp(dodgeFOV, 60f, ((EntityState)this).fixedAge / duration);
			}
			Vector3 val = ((EntityState)this).transform.position - previousPosition;
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && normalized != Vector3.zero)
			{
				Vector3 val2 = normalized * rollSpeed;
				float num = Mathf.Max(Vector3.Dot(val2, forwardDirection), 0f);
				val2 = forwardDirection * num;
				val2.y = 0f;
				((EntityState)this).characterMotor.velocity = val2;
			}
			previousPosition = ((EntityState)this).transform.position;
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

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

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

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

		public static float procCoefficient = 1f;

		public static float baseDuration = 0.6f;

		public static float force = 800f;

		public static float recoil = 3f;

		public static float range = 256f;

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

		private float duration;

		private float fireTime;

		private bool hasFired;

		private string muzzleString;

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

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

		private void Fire()
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: 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_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				((EntityState)this).characterBody.AddSpreadBloom(1.5f);
				EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false);
				Util.PlaySound("MarianShootPistol", ((EntityState)this).gameObject);
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil);
					new BulletAttack
					{
						bulletCount = 1u,
						aimVector = ((Ray)(ref aimRay)).direction,
						origin = ((Ray)(ref aimRay)).origin,
						damage = damageCoefficient * ((BaseState)this).damageStat,
						damageColorIndex = (DamageColorIndex)0,
						damageType = DamageTypeCombo.op_Implicit((DamageType)0),
						falloffModel = (FalloffModel)1,
						maxDistance = range,
						force = force,
						hitMask = CommonMasks.bullet,
						minSpread = 0f,
						maxSpread = 0f,
						isCrit = ((BaseState)this).RollCrit(),
						owner = ((EntityState)this).gameObject,
						muzzleName = muzzleString,
						smartCollision = false,
						procChainMask = default(ProcChainMask),
						procCoefficient = procCoefficient,
						radius = 0.75f,
						sniper = false,
						stopperMask = CommonMasks.bullet,
						weapon = null,
						tracerEffectPrefab = tracerEffectPrefab,
						spreadPitchScale = 0f,
						spreadYawScale = 0f,
						queryTriggerInteraction = (QueryTriggerInteraction)0,
						hitEffectPrefab = FirePistol2.hitEffectPrefab
					}.Fire();
				}
			}
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class SlashCombo : BaseMeleeAttack
	{
		public override void OnEnter()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			hitboxName = "Sword";
			damageType = (DamageType)0;
			damageCoefficient = 2.8f;
			procCoefficient = 1f;
			pushForce = 300f;
			bonusForce = Vector3.zero;
			baseDuration = 1f;
			attackStartTime = 0.2f;
			attackEndTime = 0.4f;
			baseEarlyExitTime = 0.4f;
			hitStopDuration = 0.012f;
			attackRecoil = 0.5f;
			hitHopVelocity = 4f;
			swingSoundString = "MarianSwordSwing";
			hitSoundString = "";
			muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight");
			swingEffectPrefab = Assets.swordSwingEffect;
			hitEffectPrefab = Assets.swordHitImpactEffect;
			impactSound = Assets.swordHitSoundEvent.index;
			base.OnEnter();
		}

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

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

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

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

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	internal class EverGreen_PierceScatter : BaseSkillState
	{
		public Ray modifiedAimRay;

		public float duration = 0.3f;

		public float distanceTrack = 0f;

		public int tick;

		public List<HealthComponent> Friends = new List<HealthComponent>();

		public int healCount;

		public float windup;

		private Animator animator;

		private Transform modelTransform;

		private ChildLocator locator;

		private float healStore;

		private bool hasHealed = false;

		private HealthComponent PreviousVictim = null;

		private HealthComponent CurrentVictim = null;

		private GenericSkill overriddenSkill;

		private SkillDef primaryOverride;

		public bool hasfired = false;

		private float currentCount = 0f;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			tick = 0;
			duration /= ((BaseState)this).attackSpeedStat;
			windup = duration * 0.25f;
			((EntityState)this).characterBody.SetAimTimer(2f);
			animator = ((EntityState)this).GetModelAnimator();
			modelTransform = ((EntityState)this).GetModelTransform();
			locator = ((Component)modelTransform).GetComponent<ChildLocator>();
			float num = 1f / windup * ((BaseState)this).attackSpeedStat;
			animator.SetFloat("Firerate", num);
			((EntityState)this).PlayAnimation("Gesture, Override", "ShootGun", "Firerate", windup, 0f);
		}

		public void recoil()
		{
			Log.Debug(duration - windup);
			float num = 1f / (duration - windup) * ((BaseState)this).attackSpeedStat;
			animator.SetFloat("Firerate", num);
			((EntityState)this).PlayAnimation("Gesture, Override", "BowFire", "Firerate", duration - windup, 0f);
		}

		public Vector3 Fire(Vector3 input, float distance, Vector3 Direction)
		{
			//IL_0003: 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_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: 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_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: 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_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: 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_0236: 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_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			modifiedAimRay = ((BaseState)this).GetAimRay();
			((Ray)(ref modifiedAimRay)).origin = input;
			((Ray)(ref modifiedAimRay)).direction = Direction;
			Vector3 zero = Vector3.zero;
			Transform val = ((EntityState)this).GetModelTransform();
			string text = "MuzzleLaser";
			((EntityState)this).PlayAnimation("Gesture", "FireLaser", "FireLaser.playbackRate", duration, 0f);
			if (Object.op_Implicit((Object)(object)FireLaser.effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(FireLaser.effectPrefab, ((EntityState)this).gameObject, text, false);
			}
			Vector3 val2 = ((Ray)(ref modifiedAimRay)).origin + ((Ray)(ref modifiedAimRay)).direction * distance;
			RaycastHit val3 = default(RaycastHit);
			if (Physics.Raycast(modifiedAimRay, ref val3, distance, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.defaultLayer)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)))
			{
				val2 = ((RaycastHit)(ref val3)).point;
				distanceTrack = distance - ((RaycastHit)(ref val3)).distance;
				PreviousVictim = CurrentVictim;
				CurrentVictim = ((Component)((RaycastHit)(ref val3)).collider).GetComponent<HealthComponent>();
			}
			else
			{
				CurrentVictim = null;
				distanceTrack = distance - distance;
			}
			zero = val2;
			new BlastAttack
			{
				attacker = ((EntityState)this).gameObject,
				inflictor = ((EntityState)this).gameObject,
				teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject),
				baseDamage = ((BaseState)this).damageStat * 10f * healStore,
				baseForce = 0.1f,
				position = val2,
				radius = 3f,
				falloffModel = (FalloffModel)2,
				bonusForce = 0.5f * ((Ray)(ref modifiedAimRay)).direction,
				damageType = DamageTypeCombo.op_Implicit((DamageType)1048576)
			}.Fire();
			Vector3 origin = ((Ray)(ref modifiedAimRay)).origin;
			string[] obj = new string[6] { "Output = ", null, null, null, null, null };
			Vector3 val4 = zero;
			obj[1] = ((object)(Vector3)(ref val4)).ToString();
			obj[2] = " BasAimARay = ";
			Ray aimRay = ((BaseState)this).GetAimRay();
			val4 = ((Ray)(ref aimRay)).origin;
			obj[3] = ((object)(Vector3)(ref val4)).ToString();
			obj[4] = " Input = ";
			val4 = input;
			obj[5] = ((object)(Vector3)(ref val4)).ToString();
			Log.Debug(string.Concat(obj));
			return zero;
		}

		public void Fire()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00b6: 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_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: 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_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: 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_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: 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_0151: 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_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_016d: 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_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: 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_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: 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_02e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0303: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Expected O, but got Unknown
			float num = 0.2f;
			if (currentCount == 0f)
			{
				num = 0f;
			}
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 val = ((EntityState)this).gameObject.transform.position;
			val += ((Ray)(ref aimRay)).direction;
			val += new Vector3(Random.Range(0f - num, num), Random.Range(0f - num, num), Random.Range(0f - num, num));
			val -= ((EntityState)this).gameObject.transform.position;
			val = ((Vector3)(ref val)).normalized;
			float distance = 40f;
			Log.Debug("Start-----------------------------------------");
			Ray aimRay2 = ((BaseState)this).GetAimRay();
			Vector3 val2 = ((Ray)(ref aimRay2)).direction;
			Vector3 normalized = ((Vector3)(ref val2)).normalized;
			aimRay2 = ((BaseState)this).GetAimRay();
			Vector3 val3 = Fire(((Ray)(ref aimRay2)).origin, distance, val);
			val2 = val3;
			Log.Debug("Returned Origin = " + ((object)(Vector3)(ref val2)).ToString());
			if (distanceTrack > 0f)
			{
				val3 = Fire(val3 + normalized, distanceTrack, val);
				val2 = val3;
				Log.Debug("Returned Origin = " + ((object)(Vector3)(ref val2)).ToString());
			}
			if (distanceTrack > 0f)
			{
				val3 = Fire(val3 + normalized, distanceTrack, val);
				val2 = val3;
				Log.Debug("Returned Origin = " + ((object)(Vector3)(ref val2)).ToString());
			}
			aimRay2 = ((BaseState)this).GetAimRay();
			distance = Vector3.Distance(((Ray)(ref aimRay2)).origin, val3);
			modifiedAimRay = ((BaseState)this).GetAimRay();
			((Ray)(ref modifiedAimRay)).direction = val;
			Vector3 zero = Vector3.zero;
			Transform val4 = ((EntityState)this).GetModelTransform();
			string text = "MuzzleLaser";
			((EntityState)this).PlayAnimation("Gesture", "FireLaser", "FireLaser.playbackRate", duration, 0f);
			if (Object.op_Implicit((Object)(object)FireLaser.effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(FireLaser.effectPrefab, ((EntityState)this).gameObject, text, false);
			}
			float num2 = distance;
			Vector3 val5 = ((Ray)(ref modifiedAimRay)).origin + ((Ray)(ref modifiedAimRay)).direction * num2;
			RaycastHit val6 = default(RaycastHit);
			if (Physics.Raycast(modifiedAimRay, ref val6, num2, 0))
			{
				val5 = ((RaycastHit)(ref val6)).point;
				distanceTrack = distance - ((RaycastHit)(ref val6)).distance;
				PreviousVictim = CurrentVictim;
				CurrentVictim = ((Component)((RaycastHit)(ref val6)).collider).GetComponent<HealthComponent>();
			}
			else
			{
				CurrentVictim = null;
				distanceTrack = distance - num2;
			}
			zero = val5;
			if (Object.op_Implicit((Object)(object)val4))
			{
				ChildLocator component = ((Component)val4).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					int num3 = component.FindChildIndex(text);
					if (Object.op_Implicit((Object)(object)FireLaser.tracerEffectPrefab))
					{
						EffectData val7 = new EffectData
						{
							origin = val5,
							start = ((Ray)(ref modifiedAimRay)).origin
						};
						val7.SetChildLocatorTransformReference(((EntityState)this).gameObject, num3);
						EffectManager.SpawnEffect(FireLaser.tracerEffectPrefab, val7, true);
						EffectManager.SpawnEffect(FireLaser.hitEffectPrefab, val7, true);
					}
				}
			}
			Log.Debug("End------------------------------------------");
			currentCount += 1f;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && !hasfired)
			{
				if (currentCount <= 5f)
				{
					Fire();
				}
				else if (!hasfired)
				{
					hasfired = true;
					Util.PlaySound(FireLaser.attackSoundString, ((EntityState)this).gameObject);
				}
				recoil();
			}
			if (((EntityState)this).fixedAge >= duration && hasfired)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			animator.SetBool("DrawBow", false);
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)3;
		}
	}
	internal class GrappleSwitch : BaseSkillState
	{
		public GenericSkill overriddenSkill;

		public SkillDef primaryOverride;

		public float duration = 0.3f;

		public float windup;

		private bool m1Pressed = false;

		private bool skill3Released = false;

		public static GameObject crosshairOverridePrefab;

		private OverrideRequest crosshairOverrideRequest;

		private OverrideRequest crosshairOverrideRequestSprint;

		private Ray BaseRay;

		public Transform Target;

		private Vector3 HitPoint = new Vector3(0f, 0f, 0f);

		private static Vector3 Largest = new Vector3(0.005f, 0.005f, 0.005f);

		private Vector3 Smallest = Largest / 3.25f;

		private GameObject Camera;

		private float Size = 0f;

		private const float scale = 0.25f;

		private Vector3 BaseScale = new Vector3(0.25f, 0.25f, 0.25f);

		private bool shrink = false;

		private Color defaultClose = Color.HSVToRGB(0.3f, 1f, 0.85f);

		private Color defaultFar = Color.HSVToRGB(0f, 1f, 2f);

		private bool outOfRange = false;

		private bool LowerGun = false;

		private bool Inbounds = false;

		private bool animating = false;

		private bool skill3released = false;

		private float exitDelayTimer = 0f;

		private float exitDelay = 0.5f;

		private bool pro = false;

		private bool EXIT = false;

		private bool TimerAssigned = false;

		private float timer = 0.3f;

		private float timeAtExit;

		private float yOffset = 0.061875f;

		private float xOffset = 0.075f;

		public void exitAnimation()
		{
			if (!Inbounds || LowerGun)
			{
				((EntityState)this).PlayAnimation("GrappleUpperbody", "GrappleReadyV2Return");
				if (((BaseSkillState)this).activatorSkillSlot.stock < ((BaseSkillState)this).activatorSkillSlot.maxStock)
				{
					((BaseSkillState)this).activatorSkillSlot.AddOneStock();
				}
			}
			else
			{
				((EntityState)this).PlayAnimation("GrappleUpperbody", "Empty");
			}
		}

		public override void OnEnter()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: 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_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: 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_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			((EntityState)this).GetComponent<CharacterDataStore>().kicked = false;
			((EntityState)this).GetComponent<CharacterDataStore>().exitSwitch = false;
			BaseScale *= ((EntityState)this).GetComponent<CharacterDataStore>().UIScale;
			primaryOverride = Skills.CreateSkillDef(new SkillDefInfo
			{
				skillName = "UninvitedCalamity_Marian_BODY_GRAPPLE",
				skillNameToken = "UninvitedCalamity_Marian_BODY_GRAPPLE",
				skillDescriptionToken = "UninvitedCalamity_Marian_BODY_GRAPPLE",
				skillIcon = Assets.mainAssetBundle.LoadAsset<Sprite>("GrappleIcon"),
				activationState = new SerializableEntityStateType(typeof(Marian_Grapple_simple)),
				activationStateMachineName = "Body",
				baseMaxStock = 0,
				baseRechargeInterval = 0.25f,
				beginSkillCooldownOnSkillEnd = false,
				canceledFromSprinting = false,
				forceSprintDuringState = false,
				fullRestockOnAssign = true,
				interruptPriority = (InterruptPriority)0,
				resetCooldownTimerOnUse = false,
				isCombatSkill = false,
				mustKeyPress = true,
				cancelSprintingOnActivation = false,
				rechargeStock = 0,
				requiredStock = 0,
				stockToConsume = 0,
				keywordTokens = new string[1] { "KEYWORD_AGILE" }
			});
			SkillLocator skillLocator = ((EntityState)this).skillLocator;
			GenericSkill primary = skillLocator.primary;
			if (Object.op_Implicit((Object)(object)primary))
			{
				TryOverrideSkill(primary);
				primary.onSkillChanged += TryOverrideSkill;
			}
			Camera = GameObject.Find("Main Camera(Clone)");
			if (((EntityState)this).isAuthority && ((EntityState)this).characterBody.isPlayerControlled)
			{
				if ((Object)(object)Target == (Object)null && !m1Pressed)
				{
					Target = Object.Instantiate<GameObject>(Assets.GrappleSprite, Camera.transform.position, Quaternion.identity).transform;
				}
				((Component)Target).transform.parent = Camera.transform;
				((Component)Target).transform.rotation = Camera.transform.rotation;
				((Component)Target).transform.localScale = BaseScale * Size;
				Target.localPosition = new Vector3(0f, 0f, 0.05f);
			}
			((EntityState)this).PlayAnimation("GrappleUpperbody", "GrappleReadyV2Enter");
			int colourBlindMode = ((EntityState)this).GetComponent<CharacterDataStore>().ColourBlindMode;
			Log.Debug("ColourBlind mode = " + colourBlindMode);
			switch (colourBlindMode)
			{
			case 1:
				defaultClose = Color.HSVToRGB(0.6f, 1f, 0.85f);
				defaultFar = Color.HSVToRGB(1f, 1f, 1f);
				break;
			case 2:
				defaultClose = Color.HSVToRGB(0.6f, 1f, 0.85f);
				defaultFar = Color.HSVToRGB(0.3f, 1f, 1f);
				break;
			}
		}

		public void exitdelay()
		{
			if (!pro)
			{
				exitAnimation();
				pro = true;
			}
			if (exitDelayTimer >= exitDelay && Size <= 0f)
			{
				releaseGui();
				((EntityState)this).outer.SetNextStateToMain();
			}
			exitDelayTimer += Time.fixedDeltaTime;
		}

		public override void OnExit()
		{
			if (Size >= 0f)
			{
				Inbounds = true;
				LowerGun = false;
				exitAnimation();
				releaseGui();
				UnAssign();
			}
			if (!((EntityState)this).isAuthority)
			{
				((EntityState)this).PlayAnimation("GrappleUpperbody", "GrappleReadyV2Return");
			}
			((EntityState)this).OnExit();
		}

		public void releaseGui()
		{
			if ((Object)(object)Target != (Object)null)
			{
				EntityState.Destroy((Object)(object)((Component)Target).gameObject);
				Target = null;
			}
		}

		public override void FixedUpdate()
		{
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: 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_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0706: Unknown result type (might be due to invalid IL or missing references)
			//IL_0710: Unknown result type (might be due to invalid IL or missing references)
			//IL_072c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0737: Unknown result type (might be due to invalid IL or missing references)
			//IL_0741: Unknown result type (might be due to invalid IL or missing references)
			//IL_075d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0769: Unknown result type (might be due to invalid IL or missing references)
			//IL_0773: Unknown result type (might be due to invalid IL or missing references)
			//IL_078f: Unknown result type (might be due to invalid IL or missing references)
			//IL_079b: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: 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_0518: Unknown result type (might be due to invalid IL or missing references)
			//IL_0523: Unknown result type (might be due to invalid IL or missing references)
			//IL_052a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0546: Unknown result type (might be due to invalid IL or missing references)
			//IL_0551: Unknown result type (might be due to invalid IL or missing references)
			//IL_0558: Unknown result type (might be due to invalid IL or missing references)
			//IL_0574: Unknown result type (might be due to invalid IL or missing references)
			//IL_0580: Unknown result type (might be due to invalid IL or missing references)
			//IL_0587: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05af: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_0327: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			//IL_033e: Unknown result type (might be due to invalid IL or missing references)
			//IL_035a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0361: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_0378: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0419: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if ((((ButtonState)(ref ((EntityState)this).inputBank.skill1)).justReleased || ((ButtonState)(ref ((EntityState)this).inputBank.jump)).justPressed) && m1Pressed)
			{
				EXIT = true;
				shrink = true;
				if (!animating)
				{
					exitAnimation();
					animating = true;
				}
			}
			if (((ButtonState)(ref ((EntityState)this).inputBank.skill1)).justPressed)
			{
				m1Pressed = true;
				shrink = true;
			}
			if (((ButtonState)(ref ((EntityState)this).inputBank.skill3)).justReleased)
			{
				skill3Released = true;
			}
			if (skill3Released && ((ButtonState)(ref ((EntityState)this).inputBank.skill3)).justPressed)
			{
				EXIT = true;
				LowerGun = true;
			}
			if (((EntityState)this).GetComponent<CharacterDataStore>().kicked)
			{
				EXIT = true;
			}
			if (((EntityState)this).GetComponent<CharacterDataStore>().exitSwitch)
			{
				EXIT = true;
				LowerGun = true;
			}
			if (shrink)
			{
				Size = Mathf.Clamp(Size - Time.fixedDeltaTime * 3.3333333f, 0f, 1f);
			}
			((EntityState)this).characterBody.SetAimTimer(2f);
			if (((EntityState)this).isAuthority && (Object)(object)Target != (Object)null)
			{
				((Component)Target).transform.localScale = BaseScale * Size;
			}
			if (!shrink)
			{
				Size = Mathf.Clamp(Size + Time.deltaTime * 3.3333333f, 0f, 1f);
			}
			if (EXIT)
			{
				shrink = true;
				exitdelay();
				if (((EntityState)this).isAuthority)
				{
					UnAssign();
				}
			}
			else
			{
				if (!((EntityState)this).isAuthority)
				{
					return;
				}
				BaseRay = ((BaseState)this).GetAimRay();
				ref Ray baseRay = ref BaseRay;
				((Ray)(ref baseRay)).origin = ((Ray)(ref baseRay)).origin + ((Ray)(ref BaseRay)).direction * 0.5f;
				RaycastHit val = default(RaycastHit);
				if (Physics.Raycast(BaseRay, ref val, float.PositiveInfinity, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.defaultLayer)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)))
				{
					HitPoint = ((RaycastHit)(ref val)).point;
					float distance = Marian_Grapple_simple.distance;
					if (!((Object)(object)Target != (Object)null))
					{
						return;
					}
					float num = Vector3.Distance(((Ray)(ref BaseRay)).origin, ((RaycastHit)(ref val)).point);
					if (num <= Marian_Grapple_simple.distance)
					{
						float num2 = num / Marian_Grapple_simple.distance;
						float num3 = 1f - num2;
						((Component)Target.GetChild(1)).transform.localPosition = Vector3.zero * num3 + Vector3.up * yOffset * num2;
						((Component)Target.GetChild(2)).transform.localPosition = Vector3.zero * num3 + Vector3.down * yOffset * num2;
						((Component)Target.GetChild(3)).transform.localPosition = Vector3.zero * num3 + Vector3.left * (0f - xOffset) * num2;
						((Component)Target.GetChild(4)).transform.localPosition = Vector3.zero * num3 + Vector3.right * (0f - xOffset) * num2;
						((Component)Target.GetChild(1)).transform.localScale = Vector3.zero;
						((Component)Target.GetChild(2)).transform.localScale = Vector3.zero;
						recolourRenderer(((Component)((Component)Target).transform.GetChild(0)).gameObject, num2);
						recolourRenderer(((Component)((Component)Target).transform.GetChild(1)).gameObject, num2);
						recolourRenderer(((Component)((Component)Target).transform.GetChild(2)).gameObject, num2);
						recolourRenderer(((Component)((Component)Target).transform.GetChild(3)).gameObject, num2);
						recolourRenderer(((Component)((Component)Target).transform.GetChild(4)).gameObject, num2);
						if (!m1Pressed)
						{
							Inbounds = true;
						}
						return;
					}
					float num4 = num / Marian_Grapple_simple.distance;
					((Component)Target.GetChild(1)).transform.localPosition = Vector3.up * yOffset * num4;
					((Component)Target.GetChild(2)).transform.localPosition = Vector3.down * yOffset * num4;
					((Component)Target.GetChild(3)).transform.localPosition = Vector3.left * (0f - xOffset) * num4;
					((Component)Target.GetChild(4)).transform.localPosition = Vector3.right * (0f - xOffset) * num4;
					((Component)Target.GetChild(1)).transform.localScale = Vector3.zero;
					((Component)Target.GetChild(2)).transform.localScale = Vector3.zero;
					recolourRenderer(((Component)((Component)Target).transform.GetChild(0)).gameObject, 1f, outOfBounds: true);
					recolourRenderer(((Component)((Component)Target).transform.GetChild(1)).gameObject, 1f, outOfBounds: true);
					recolourRenderer(((Component)((Component)Target).transform.GetChild(2)).gameObject, 1f, outOfBounds: true);
					recolourRenderer(((Component)((Component)Target).transform.GetChild(3)).gameObject, 1f, outOfBounds: true);
					recolourRenderer(((Component)((Component)Target).transform.GetChild(4)).gameObject, 1f, outOfBounds: true);
					if (m1Pressed)
					{
						Inbounds = false;
						LowerGun = true;
						EXIT = true;
					}
				}
				else if ((Object)(object)Target != (Object)null)
				{
					((Component)Target.GetChild(1)).transform.localPosition = Vector3.up * yOffset * 100f;
					((Component)Target.GetChild(2)).transform.localPosition = Vector3.down * yOffset * 100f;
					((Component)Target.GetChild(3)).transform.localPosition = Vector3.left * (0f - xOffset) * 100f;
					((Component)Target.GetChild(4)).transform.localPosition = Vector3.right * (0f - xOffset) * 100f;
					((Component)Target.GetChild(1)).transform.localScale = Vector3.zero;
					((Component)Target.GetChild(2)).transform.localScale = Vector3.zero;
					recolourRenderer(((Component)((Component)Target).transform.GetChild(0)).gameObject, 1f, outOfBounds: true);
					recolourRenderer(((Component)((Component)Target).transform.GetChild(1)).gameObject, 1f, outOfBounds: true);
					recolourRenderer(((Component)((Component)Target).transform.GetChild(2)).gameObject, 1f, outOfBounds: true);
					recolourRenderer(((Component)((Component)Target).transform.GetChild(3)).gameObject, 1f, outOfBounds: true);
					recolourRenderer(((Component)((Component)Target).transform.GetChild(4)).gameObject, 1f, outOfBounds: true);
					outOfRange = true;
					if (m1Pressed)
					{
						Inbounds = false;
						EXIT = true;
					}
				}
			}
		}

		public void recolourRenderer(GameObject uiCom, float percent1, bool outOfBounds = false)
		{
			//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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			float num = 2f;
			Color color = Color.Lerp(defaultClose, defaultFar, percent1);
			if (outOfBounds)
			{
				color = Color.Lerp(defaultClose, Color.HSVToRGB(0f, 1f, num), percent1);
			}
			SpriteRenderer component = uiCom.GetComponent<SpriteRenderer>();
			((Renderer)component).material.color = color;
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)5;
		}

		private void TryOverrideSkill(GenericSkill skill)
		{
			if (Object.op_Implicit((Object)(object)skill) && !Object.op_Implicit((Object)(object)overriddenSkill) && !skill.HasSkillOverrideOfPriority((SkillOverridePriority)4))
			{
				overriddenSkill = skill;
				overriddenSkill.SetSkillOverride((object)this, primaryOverride, (SkillOverridePriority)4);
				overriddenSkill.stock = ((EntityState)this).skillLocator.primary.stock;
			}
		}

		public void UnAssign()
		{
			SkillLocator skillLocator = ((EntityState)this).skillLocator;
			GenericSkill val = (((Object)(object)skillLocator != (Object)null) ? skillLocator.primary : null);
			if (Object.op_Implicit((Object)(object)val))
			{
				val.onSkillChanged -= TryOverrideSkill;
			}
			if (Object.op_Implicit((Object)(object)overriddenSkill))
			{
				overriddenSkill.UnsetSkillOverride((object)this, primaryOverride, (SkillOverridePriority)4);
			}
		}
	}
	internal class IceMissile : MarianFlare
	{
		public override void OnEnter()
		{
			base.OnEnter();
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//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_000a: Unknown result type (might be due to invalid IL or missing references)
			return base.GetMinimumInterruptPriority();
		}

		public override GameObject setProj()
		{
			return Projectiles.IceMissile;
		}
	}
	internal class MarianFlare : BaseSkillState
	{
		private ChildLocator locator;

		private Transform modelTransform;

		private float baseDuration = 0.25f;

		private float coolDown = 0.8f;

		private float windup = 0.1f;

		private float scatter = 0f;

		private float duration;

		private float windUp;

		private float fireTime;

		private bool hasFired = false;

		private Animator animator;

		private bool hasReleased = false;

		private GameObject bombPrefab;

		private float missileDelay = 0.055f;

		public float currentCount = 0f;

		private BullseyeSearch search;

		private int missileCount = 5;

		private int TargetCount;

		private int onTarget = 0;

		private Transform Target;

		private Ray AimRayCopy;

		public static float DamageCoef = 2.5f;

		private float targetRefresh = 0.1f;

		private GameObject Camera;

		public const float Range = 150f;

		private float IterDelay = 0.9f;

		private float IterTimer = 0f;

		private int charge = 1;

		private int pingCount = 0;

		private GameObject Ping;

		private GameObject Ping2;

		private GameObject Ping3;

		private bool FinalPing = false;

		private bool CoolingDown = false;

		private int firingcount = 0;

		private GameObject Missile;

		private SpriteManager SM;

		private bool Refunded = false;

		private float counter = 0f;

		private float timer = 0f;

		public override void OnEnter()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Expected O, but got Unknown
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			search = new BullseyeSearch();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			windUp = windup / ((BaseState)this).attackSpeedStat;
			missileDelay /= ((BaseState)this).attackSpeedStat;
			coolDown /= ((BaseState)this).attackSpeedStat;
			counter = missileDelay;
			fireTime = 0.35f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			animator = ((EntityState)this).GetModelAnimator();
			modelTransform = ((EntityState)this).GetModelTransform();
			locator = ((Component)modelTransform).GetComponent<ChildLocator>();
			SM = ((Component)((EntityState)this).characterBody).GetComponent<SpriteManager>();
			bombPrefab = Projectiles.Missile;
			float num = 1f / windUp * ((BaseState)this).attackSpeedStat;
			AimRayCopy = ((BaseState)this).GetAimRay();
			GetCurrentTargetInfo();
			Camera = GameObject.Find("Main Camera(Clone)");
			Ping = Assets.MissileChargePing;
			Ping2 = Assets.MissileChargePing2;
			Ping3 = Assets.MissileChargePing3;
			Missile = setProj();
		}

		public virtual GameObject setProj()
		{
			return Projectiles.Missile;
		}

		public void ScatterFire(Vector3 newDir)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			float num = 0.04f;
			if (currentCount == 0f)
			{
				num = 0f;
			}
			newDir += new Vector3(Random.Range(0f - num, num), Random.Range(0f - num, num), Random.Range(0f - num, num));
			newDir = ((Vector3)(ref newDir)).normalized;
			Fire(newDir);
			Transform val = ((EntityState)this).GetModelTransform();
		}

		public bool upwardSearch(GameObject observing, GameObject parent, bool searching)
		{
			bool result = false;
			do
			{
				if ((Object)(object)observing.transform.parent == (Object)(object)parent || (Object)(object)observing == (Object)(object)parent)
				{
					result = true;
					searching = false;
				}
				else if ((Object)(object)observing.transform.parent != (Object)null)
				{
					observing = ((Component)observing.transform.parent).gameObject;
				}
				else
				{
					searching = false;
				}
			}
			while (searching);
			return result;
		}

		private void GetCurrentTargetInfo()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_030c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_0335: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Unknown result type (might be due to invalid IL or missing references)
			//IL_0346: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Unknown result type (might be due to invalid IL or missing references)
			//IL_035a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_037c: Unknown result type (might be due to invalid IL or missing references)
			//IL_038b: Unknown result type (might be due to invalid IL or missing references)
			//IL_039b: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < SM.Targets.Length; i++)
			{
				if ((Object)(object)SM.Targets[i] != (Object)null)
				{
					SM.Targets[i] = null;
				}
			}
			Ray aimRay = ((BaseState)this).GetAimRay();
			search.filterByDistinctEntity = true;
			search.filterByLoS = true;
			search.minDistanceFilter = 0f;
			search.maxDistanceFilter = 150f;
			search.minAngleFilter = 0f;
			search.maxAngleFilter = 45f;
			search.viewer = ((EntityState)this).characterBody;
			search.searchOrigin = ((Ray)(ref aimRay)).origin;
			search.searchDirection = ((Ray)(ref aimRay)).direction;
			search.sortMode = (SortMode)2;
			search.teamMaskFilter = TeamMask.GetUnprotectedTeams(((BaseState)this).GetTeam());
			search.RefreshCandidates();
			search.FilterOutGameObject(((EntityState)this).gameObject);
			foreach (HurtBox result in search.GetResults())
			{
				if (!Object.op_Implicit((Object)(object)result.healthComponent) || !result.healthComponent.alive)
				{
					continue;
				}
				if (TargetCount >= missileCount)
				{
					break;
				}
				bool flag = false;
				RaycastHit val = default(RaycastHit);
				Ray aimRay2 = ((BaseState)this).GetAimRay();
				float num = Vector3.Distance(((Ray)(ref aimRay2)).origin, ((Component)result).transform.position);
				((Ray)(ref aimRay2)).direction = ((Ray)(ref aimRay2)).origin - ((Component)result).transform.position;
				((Ray)(ref aimRay2)).direction = -((Ray)(ref aimRay2)).direction;
				if (Physics.Raycast(aimRay2, ref val, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.defaultLayer)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)))
				{
					GameObject gameObject = ((Component)result.healthComponent).gameObject;
					bool flag2 = false;
					GameObject gameObject2 = ((Component)((RaycastHit)(ref val)).collider).gameObject;
					bool flag3 = true;
					HurtBox component;
					if (Object.op_Implicit((Object)(object)(component = ((Component)((RaycastHit)(ref val)).collider).GetComponent<HurtBox>())) && (Object)(object)component.healthComponent == (Object)(object)result.healthComponent)
					{
						flag2 = true;
						flag3 = false;
					}
					do
					{
						if ((Object)(object)gameObject2.transform.parent == (Object)(object)gameObject || (Object)(object)gameObject2 == (Object)(object)gameObject)
						{
							flag2 = true;
							flag3 = false;
						}
						else if ((Object)(object)gameObject2.transform.parent != (Object)null)
						{
							gameObject2 = ((Component)gameObject2.transform.parent).gameObject;
						}
						else
						{
							flag3 = false;
						}
					}
					while (flag3);
					flag = !flag2;
				}
				((Ray)(ref aimRay2)).origin = locator.FindChild("MissilePoint").position;
				num = Vector3.Distance(((Ray)(ref aimRay2)).origin, ((Component)result).transform.position);
				((Ray)(ref aimRay2)).direction = ((Ray)(ref aimRay2)).origin - ((Component)result).transform.position;
				((Ray)(ref aimRay2)).direction = -((Ray)(ref aimRay2)).direction;
				if (flag && Physics.Raycast(aimRay2, ref val, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.defaultLayer)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)))
				{
					GameObject gameObject3 = ((Component)result.healthComponent).gameObject;
					bool flag4 = false;
					GameObject gameObject4 = ((Component)((RaycastHit)(ref val)).collider).gameObject;
					bool flag5 = true;
					HurtBox component2;
					if (Object.op_Implicit((Object)(object)(component2 = ((Component)((RaycastHit)(ref val)).collider).GetComponent<HurtBox>())) && (Object)(object)component2.healthComponent == (Object)(object)result.healthComponent)
					{
						flag4 = true;
						flag5 = false;
					}
					do
					{
						if ((Object)(object)gameObject4.transform.parent == (Object)(object)gameObject3 || (Object)(object)gameObject4 == (Object)(object)gameObject3)
						{
							flag4 = true;
							flag5 = false;
						}
						else if ((Object)(object)gameObject4.transform.parent != (Object)null)
						{
							gameObject4 = ((Component)gameObject4.transform.parent).gameObject;
						}
						else
						{
							flag5 = false;
						}
					}
					while (flag5);
					flag = !flag4;
				}
				if (!flag)
				{
					SM.Targets[TargetCount] = ((Component)result).transform;
					TargetCount++;
				}
			}
		}

		public Vector3 setPostion(Transform TargetObject, Vector3 FarPosition)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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_006d: 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_0073: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_010d: 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_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: 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_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)Camera != (Object)null)
			{
				float num = Vector3.Distance(FarPosition, Camera.transform.position);
				float num2 = 0.1f / num;
				Vector3 position = Camera.transform.position * (1f - num2) + FarPosition * num2;
				Vector3 val = Camera.transform.position - FarPosition;
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				Vector3 val2 = new Vector3(0.002f, 0.002f, 0.002f) * ((EntityState)this).GetComponent<CharacterDataStore>().UIScale;
				Vector3 val3 = new Vector3(0.001f, 0.001f, 0.001f) * ((EntityState)this).GetComponent<CharacterDataStore>().UIScale;
				float num3 = num / 150f;
				if ((Object)(object)TargetObject != (Object)null)
				{
					SpriteRenderer component = ((Component)TargetObject.GetChild(0)).gameObject.GetComponent<SpriteRenderer>();
					((Renderer)component).material.color = Color.HSVToRGB(0.3f, 1f, 1f);
					TargetObject.position = position;
					TargetObject.LookAt(Camera.transform.position);
					Vector3 val4 = val2 * (1f - num3);
					Vector3 val5 = val3 * num3;
					TargetObject.localScale = val4 + val5;
				}
			}
			else
			{
				Log.Debug("Camera is Null");
			}
			return Vector3.zero;
		}

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

		public void Fire(Vector3 newDir)
		{
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).PlayAnimation("Gesture, Override", "ShootGun", "Firerate", windup, 0f);
			if ((Object)(object)SM.Targets[onTarget] != (Object)null)
			{
				Target = SM.Targets[onTarget];
				onTarget++;
			}
			if (onTarget >= TargetCount)
			{
				onTarget = 0;
			}
			if ((Object)(object)Target != (Object)null)
			{
				MissileUtils.FireMissile(locator.FindChild("FirePoint").position, ((EntityState)this).characterBody, default(ProcChainMask), ((Component)Target).gameObject, ((BaseState)this).damageStat * DamageCoef, ((BaseState)this).RollCrit(), Missile, (DamageColorIndex)0, newDir, 0f, false);
				string text = "FirePoint";
				if (Object.op_Implicit((Object)(object)FireGrenades.effectPrefab))
				{
					EffectManager.SimpleMuzzleFlash(FireGrenades.effectPrefab, ((EntityState)this).gameObject, text, true);
				}
				currentCount += 1f;
			}
			else if (!Refunded)
			{
				Refunded = true;
				if (((BaseSkillState)this).activatorSkillSlot.stock < ((BaseSkillState)this).activatorSkillSlot.maxStock)
				{
					((BaseSkillState)this).activatorSkillSlot.AddOneStock();
				}
				EffectManager.SimpleMuzzleFlash(FireGauss.effectPrefab, ((EntityState)this).gameObject, "MissilePoint", true);
			}
		}

		public override void FixedUpdate()
		{
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: 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_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04de: 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)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0479: Unknown result type (might be due to invalid IL or missing references)
			//IL_0492: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Unknown result type (might be due to invalid IL or missing references)
			//IL_0450: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			((EntityState)this).characterBody.SetAimTimer(2f);
			if (!((EntityState)this).inputBank.skill2.down && !hasReleased)
			{
				hasReleased = true;
			}
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			if (((EntityState)this).fixedAge >= windup && hasReleased && !CoolingDown)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				Vector3 val = ((EntityState)this).gameObject.transform.position;
				val += ((Ray)(ref aimRay)).direction;
				scatter = 0f;
				val += new Vector3(Random.Range(0f - scatter, scatter), Random.Range(0f - scatter, scatter), Random.Range(0f - scatter, scatter));
				val -= ((EntityState)this).gameObject.transform.position;
				val = ((Vector3)(ref val)).normalized;
				if (counter >= missileDelay && !Refunded)
				{
					if (currentCount < (float)missileCount)
					{
						ScatterFire(val);
						ProjectileManager.instance.FireProjectile(Projectiles.AddMissiles, locator.FindChild("FirePoint").position, Util.QuaternionSafeLookRotation(Vector3.zero), ((EntityState)this).gameObject, (float)missileCount - currentCount, 0f, false, (DamageColorIndex)0, (GameObject)null, -1f);
					}
					if (!Refunded)
					{
						counter = 0f;
						hasFired = true;
					}
				}
				counter += Time.fixedDeltaTime;
			}
			if (!CoolingDown && currentCount < (float)missileCount && !Refunded)
			{
				duration = ((EntityState)this).fixedAge + coolDown;
			}
			if (!CoolingDown)
			{
				if (currentCount >= (float)missileCount)
				{
					CoolingDown = true;
				}
				if (!hasReleased)
				{
					if (((EntityState)this).fixedAge >= windup)
					{
						if (IterTimer >= IterDelay / ((BaseState)this).attackSpeedStat && TargetCount >= 1)
						{
							if (charge < 3)
							{
								pingCount = 0;
								if (((EntityState)this).isAuthority && !CoolingDown)
								{
									missileCount = Mathf.Clamp(missileCount + 3, 5, SM.Targets.Length);
								}
							}
							IterTimer = 0f;
							charge++;
						}
						else if (TargetCount <= 0)
						{
							missileCount = 5;
							charge = 1;
							pingCount = 0;
							IterTimer = 0f;
							FinalPing = false;
						}
						IterTimer += Time.fixedDeltaTime;
					}
					if (pingCount < charge && TargetCount > 0 && !FinalPing)
					{
						pingCount = charge;
						if (charge == 3)
						{
							FinalPing = true;
							EffectManager.SimpleEffect(Ping3, ((Component)locator.FindChild("MissilePoint")).transform.position, new Quaternion(0f, 0f, 0f, 0f), true);
						}
						else if (charge == 2)
						{
							EffectManager.SimpleEffect(Ping2, ((Component)locator.FindChild("MissilePoint")).transform.position, new Quaternion(0f, 0f, 0f, 0f), true);
						}
						else
						{
							EffectManager.SimpleEffect(Ping, ((Component)locator.FindChild("MissilePoint")).transform.position, new Quaternion(0f, 0f, 0f, 0f), true);
						}
					}
				}
			}
			firingcount = (int)((float)missileCount - currentCount);
			ProjectileManager.instance.FireProjectile(Projectiles.AddMissiles, Vector3.down * 100f, Util.QuaternionSafeLookRotation(Vector3.down * 100f), ((EntityState)this).gameObject, (float)firingcount, 0f, false, (DamageColorIndex)0, (GameObject)null, -1f);
			if (((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
				return;
			}
			if (timer >= targetRefresh && !hasReleased)
			{
				TargetCount = 0;
				GetCurrentTargetInfo();
				timer = 0f;
			}
			timer += Time.fixedDeltaTime;
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}

		public override void OnExit()
		{
			for (int i = 0; i < SM.Targets.Length; i++)
			{
				if ((Object)(object)SM.Targets[i] != (Object)null)
				{
					SM.Targets[i] = null;
				}
			}
			if (((EntityState)this).isAuthority && !hasFired && ((BaseSkillState)this).activatorSkillSlot.stock < ((BaseSkillState)this).activatorSkillSlot.maxStock)
			{
				((BaseSkillState)this).activatorSkillSlot.AddOneStock();
			}
			((EntityState)this).characterBody.ClearTimedBuffs(Buffs.MissileBuff);
			((EntityState)this).OnExit();
		}
	}
	internal class MarianIceBomb : BaseSkillState
	{
		private ChildLocator locator;

		private Transform modelTransform;

		private float baseDuration = 0.25f;

		private float windup = 0.2f;

		private float scatter = 0f;

		private float duration;

		private float windUp;

		private bool hasFired;

		private Animator animator;

		private bool hasReleased = false;

		private GameObject Icebomb;

		public float currentCount = 0f;

		private float base_desired_speed = 10f;

		private float max_multiplier = 500f;

		public static float DamageCoef = 0.1f;

		public float damage_mult = 1f;

		private bool released = false;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration;
			windUp = windup;
			((EntityState)this).characterBody.SetAimTimer(2f);
			animator = ((EntityState)this).GetModelAnimator();
			modelTransform = ((EntityState)this).GetModelTransform();
			locator = ((Component)modelTransform).GetComponent<ChildLocator>();
			Icebomb = setPrefab();
			float num = 1f / windUp * ((BaseState)this).attackSpeedStat;
			damage_mult = setMult();
		}

		public virtual float setMult()
		{
			return 1f;
		}

		public virtual GameObject setPrefab()
		{
			return Projectiles.IceBomb;
		}

		public void ScatterFire(Vector3 newDir)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			float num = 0.08f;
			if (currentCount == 0f)
			{
				num = 0f;
			}
			currentCount += 1f;
			newDir += new Vector3(Random.Range(0f - num, num), Random.Range(0f - num, num), Random.Range(0f - num, num));
			newDir = ((Vector3)(ref newDir)).normalized;
			Fire(newDir);
			Transform val = ((EntityState)this).GetModelTransform();
		}

		public void Fire(Vector3 newDir)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				ProjectileManager.instance.FireProjectile(Icebomb, locator.FindChild("FirePoint").position, Util.QuaternionSafeLookRotation(newDir), ((EntityState)this).gameObject, DamageCoef * ((BaseState)this).damageStat * damage_mult, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f);
			}
			catch (NullReferenceException data)
			{
				Log.Debug(data);
			}
		}

		public void StartFire()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00cd: 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_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasReleased = true;
				hasFired = true;
				base_desired_speed *= Mathf.Clamp(((EntityState)this).fixedAge / windup, 0f, max_multiplier);
				Ray aimRay = ((BaseState)this).GetAimRay();
				Vector3 val = ((EntityState)this).gameObject.transform.position;
				val.y += 0.1f;
				val += ((Ray)(ref aimRay)).direction;
				scatter = 0f;
				val += new Vector3(Random.Range(0f - scatter, scatter), Random.Range(0f - scatter, scatter), Random.Range(0f - scatter, scatter));
				val -= ((EntityState)this).gameObject.transform.position;
				val = ((Vector3)(ref val)).normalized;
				if (!((EntityState)this).characterMotor.isGrounded)
				{
					CharacterMotor characterMotor = ((EntityState)this).characterMotor;
					characterMotor.velocity += -val * Mathf.Clamp(((EntityState)this).fixedAge / windup, 0f, max_multiplier);
				}
				ScatterFire(val);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= windUp && !hasFired)
			{
				((EntityState)this).PlayAnimation("Gesture, Override", "ThrowBomb");
				if (!((EntityState)this).isAuthority)
				{
					hasFired = true;
				}
			}
			if (((EntityState)this).isAuthority)
			{
				if (!hasFired && ((EntityState)this).fixedAge >= windup)
				{
					StartFire();
				}
				if (((EntityState)this).fixedAge >= duration && hasFired)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

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

		public override void OnExit()
		{
			((EntityState)this).OnExit();
		}
	}
	internal class Marian_Grapple : BaseSkillState
	{
		private Vector3 targetOffset;

		private Transform targetPoint;

		private Ray BaseRay;

		private ChildLocator locator;

		private Transform modelTransform;

		private float initialBoost = 0.1f;

		private float interpolateBoost = 1f;

		private float maxVelocity = 25f;

		private float distance;

		private float minDistance = 1f;

		private float delay = 0.25f;

		private bool lunge = false;

		private Vector3 GrapplePos;

		private Transform grapple;

		private Vector3 preVel = new Vector3(0f, 0f, 0f);

		private float duration = 0.25f;

		private Vector3 hitPoint;

		public override void OnEnter()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: 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_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			distance = float.PositiveInfinity;
			BaseRay = ((BaseState)this).GetAimRay();
			float num = 500f;
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
			modelTransform = ((EntityState)this).GetModelTransform();
			locator = ((Component)modelTransform).GetComponent<ChildLocator>();
			ref Ray baseRay = ref BaseRay;
			((Ray)(ref baseRay)).origin = ((Ray)(ref baseRay)).origin + ((Ray)(ref BaseRay)).direction * 0.5f;
			Vector3 zero = Vector3.zero;
			grapple = ((Component)locator.FindChild("LeftGrapple")).transform;
			GrapplePos = grapple.localPosition;
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(BaseRay, ref val, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.defaultLayer)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)))
			{
				zero = ((RaycastHit)(ref val)).point;
				Log.Debug(((Object)((RaycastHit)(ref val)).collider).name);
				targetPoint = ((Component)((RaycastHit)(ref val)).collider).transform;
				targetOffset = targetPoint.InverseTransformPoint(((RaycastHit)(ref val)).point);
				hitPoint = ((RaycastHit)(ref val)).point;
				EffectManager.SimpleEffect(FireLaser.hitEffectPrefab, ((RaycastHit)(ref val)).point, new Quaternion(0f, 0f, 0f, 0f), true);
				grapple.position = hitPoint;
			}
			else
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
			Log.Debug("Grapple start");
		}

		public override void OnExit()
		{
			Log.Debug("Grapple Exit");
			((EntityState)this).OnExit();
		}

		public void swingGrapple()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: 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_0068: 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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: 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_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: 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_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0492: Unknown result type (might be due to invalid IL or missing references)
			//IL_0497: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to