plugins/AmpMod.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AmpMod.Modules;
using AmpMod.Modules.Survivors;
using AmpMod.SkillStates;
using AmpMod.SkillStates.Amp;
using AmpMod.SkillStates.Amp.BaseStates;
using AmpMod.SkillStates.BaseStates;
using AmpMod.SkillStates.Nemesis_Amp;
using AmpMod.SkillStates.Nemesis_Amp.Components;
using AmpMod.SkillStates.Nemesis_Amp.Orbs;
using AmpMod.SkillStates.SkillComponents;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.BrotherMonster.Weapon;
using EntityStates.Huntress;
using EntityStates.Mage;
using EntityStates.Mage.Weapon;
using EntityStates.MagmaWorm;
using HG;
using HG.Reflection;
using IL.RoR2;
using JetBrains.Annotations;
using KinematicCharacterController;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using On.RoR2.CharacterSpeech;
using On.RoR2.Stats;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.CharacterSpeech;
using RoR2.ContentManagement;
using RoR2.HudOverlay;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.Stats;
using RoR2.UI;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.SceneManagement;
using UnityEngine.Serialization;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("AmpMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AmpMod")]
[assembly: AssemblyTitle("AmpMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: UnverifiableCode]
internal class BodyInfo
{
	internal string bodyName = "";

	internal string bodyNameToken = "";

	internal string subtitleNameToken = "";

	internal string bodyNameToClone = "Commando";

	internal Texture characterPortrait = null;

	internal GameObject crosshair = null;

	internal GameObject podPrefab = null;

	internal float maxHealth = 100f;

	internal float healthGrowth = 2f;

	internal float healthRegen = 0f;

	internal float shield = 0f;

	internal float shieldGrowth = 0f;

	internal float moveSpeed = 7f;

	internal float moveSpeedGrowth = 0f;

	internal float acceleration = 80f;

	internal float jumpPower = 15f;

	internal float jumpPowerGrowth = 0f;

	internal float damage = 12f;

	internal float attackSpeed = 1f;

	internal float attackSpeedGrowth = 0f;

	internal float armor = 0f;

	internal float armorGrowth = 0f;

	internal float crit = 1f;

	internal float critGrowth = 0f;

	internal int jumpCount = 1;

	internal Color bodyColor = Color.grey;

	internal Vector3 aimOriginPosition = new Vector3(0f, 1.8f, 0f);

	internal Vector3 modelBasePosition = new Vector3(0f, -0.92f, 0f);

	internal Vector3 cameraPivotPosition = new Vector3(0f, 1.6f, 0f);
}
internal class CustomRendererInfo
{
	internal string childName;

	internal Material material;

	internal bool ignoreOverlays;
}
internal class SkillDefInfo
{
	public string skillName;

	public string skillNameToken;

	public string skillDescriptionToken;

	public Sprite skillIcon;

	public SerializableEntityStateType activationState;

	public string activationStateMachineName;

	public int baseMaxStock;

	public float baseRechargeInterval;

	public bool beginSkillCooldownOnSkillEnd;

	public bool canceledFromSprinting;

	public bool forceSprintDuringState;

	public bool fullRestockOnAssign;

	public InterruptPriority interruptPriority;

	public bool resetCooldownTimerOnUse;

	public bool isCombatSkill;

	public bool mustKeyPress;

	public bool cancelSprintingOnActivation;

	public int rechargeStock;

	public int requiredStock;

	public int stockToConsume;

	public string[] keywordTokens;
}
namespace AmpMod.SkillStates
{
	internal class AltPulseLeap : BaseSkillState
	{
		private BlastAttack boostBlast;

		private string launchSound = "PlayBoltExit";

		private float launchDamage = 2.5f;

		private GameObject launchEffect;

		private ChildLocator childLocator;

		private float smallHopVelocity = 12f;

		private AmpLightningController lightningController;

		private Vector3 lungeVelocity;

		private Vector3 initialLaunchVelocity;

		private float blastRadius = 11f;

		private float flyDuration = 0.15f;

		private float exitAnimDuration = 0.65f;

		private float exitDuration = 1.2f;

		private Transform modelTransform;

		private bool hasResetRot;

		private bool hasFlown;

		private float speedCoefficient = 20f;

		private bool hasFired = false;

		public static AnimationCurve speedCoefficientCurve = FlyUpState.speedCoefficientCurve;

		private Vector3 aimDirection;

		private Transform leftMuzzleTransform;

		private Transform swordTipTransform;

		private bool isFlying;

		private Animator animator;

		private Vector3 flyDirection;

		private float upSpeed;

		private Transform inputSpace;

		private GameObject muzzlePrefab;

		private Rotator rotator;

		private GameObject blinkPrefab;

		private float lungeSpeed = 40f;

		public override void OnEnter()
		{
			//IL_012c: 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_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			lightningController = ((EntityState)this).GetComponent<AmpLightningController>();
			blinkPrefab = lightningController.pulseLeapEffect;
			muzzlePrefab = lightningController.pulseMuzzleEffect;
			if (((EntityState)this).isAuthority)
			{
				FireLaunchBlast();
				modelTransform = ((EntityState)this).GetModelTransform();
				animator = ((EntityState)this).GetModelAnimator();
				childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
				if (!Object.op_Implicit((Object)(object)childLocator))
				{
					Debug.Log((object)"No ChildLocator found");
				}
				if (Object.op_Implicit((Object)(object)modelTransform) && Object.op_Implicit((Object)(object)childLocator))
				{
					Transform val = childLocator.FindChild("HandL");
					Transform val2 = childLocator.FindChild("SwordTip");
					leftMuzzleTransform = Object.Instantiate<GameObject>(muzzlePrefab, val).transform;
					swordTipTransform = Object.Instantiate<GameObject>(muzzlePrefab, val2).transform;
				}
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground();
				((EntityState)this).characterMotor.disableAirControlUntilCollision = true;
				CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject));
				inputSpace = new GameObject("inputSpace").transform;
				inputSpace.position = Vector3.zero;
				inputSpace.rotation = Quaternion.identity;
				inputSpace.localScale = Vector3.one;
				upSpeed = animator.GetFloat("upSpeed");
				animator.SetBool("isFlying", true);
				rotator = ((Component)modelTransform.Find("metarig")).GetComponent<Rotator>();
				if (!Object.op_Implicit((Object)(object)rotator))
				{
					rotator = ((Component)modelTransform.Find("metarig")).gameObject.AddComponent<Rotator>();
				}
				rotator.ResetRotation(0f);
				Ray aimRay = ((BaseState)this).GetAimRay();
				aimDirection = ((Ray)(ref aimRay)).direction;
				rotator.SetRotation(Quaternion.LookRotation(CreateForwardRotation(), Vector3.up), flyDuration);
				((EntityState)this).PlayAnimation("FullBody, Override", "PulseLeap", "BaseSkill.playbackRate", flyDuration);
			}
			Transform val3 = ((EntityState)this).GetModelTransform();
			childLocator = ((Component)val3).GetComponent<ChildLocator>();
			Util.PlaySound(launchSound, ((EntityState)this).gameObject);
		}

		public void AltHandleMovements(Vector3 flyVector)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).characterMotor.velocity = Vector3.zero;
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.rootMotion += flyVector * (((BaseState)this).moveSpeedStat * speedCoefficient * Time.fixedDeltaTime);
		}

		public static Vector3 CalculateLungeVelocity(Vector3 currentVelocity, Vector3 aimDirection, float lungeSpeed)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: 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)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: 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_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			currentVelocity = ((Vector3.Dot(currentVelocity, aimDirection) < 0f) ? Vector3.zero : Vector3.Project(currentVelocity, aimDirection));
			return currentVelocity + aimDirection * lungeSpeed;
		}

		public void FireLaunchBlast()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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_004b: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: 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_007d: 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_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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_00cc: Expected O, but got Unknown
			//IL_00d2: 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)
			if (((EntityState)this).isAuthority)
			{
				boostBlast = new BlastAttack
				{
					attacker = ((EntityState)this).gameObject,
					baseDamage = launchDamage * ((EntityState)this).characterBody.damage,
					baseForce = 0f,
					attackerFiltering = (AttackerFiltering)2,
					crit = ((EntityState)this).characterBody.RollCrit(),
					damageColorIndex = (DamageColorIndex)3,
					damageType = (DamageType)0,
					falloffModel = (FalloffModel)0,
					inflictor = ((EntityState)this).gameObject,
					position = ((EntityState)this).transform.position,
					procChainMask = default(ProcChainMask),
					procCoefficient = 1f,
					radius = blastRadius,
					teamIndex = ((EntityState)this).characterBody.teamComponent.teamIndex
				};
				DamageAPI.AddModdedDamageType(boostBlast, DamageTypes.applyCharge);
				boostBlast.Fire();
			}
		}

		private void CreateBlinkEffect(Vector3 origin)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			EffectData val = new EffectData();
			val.rotation = Util.QuaternionSafeLookRotation(aimDirection);
			val.origin = origin;
			val.scale = 0.3f;
			EffectManager.SpawnEffect(blinkPrefab, val, false);
		}

		private Vector3 CreateForwardRotation()
		{
			//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_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)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: 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_0066: 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_006c: 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_0098: 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_00a5: 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_00ab: 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_00af: 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)
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 direction = ((Ray)(ref aimRay)).direction;
			Vector3 moveVector = ((EntityState)this).inputBank.moveVector;
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(direction.x, 0f, direction.z);
			val = Vector3.Normalize(val);
			inputSpace.rotation = Quaternion.LookRotation(val, Vector3.up);
			direction = inputSpace.InverseTransformDirection(direction);
			moveVector = inputSpace.InverseTransformDirection(moveVector);
			Vector3 val2 = direction;
			val2.y += (((EntityState)this).inputBank.jump.down ? 2f : 0f);
			val2 = Vector3.Normalize(val2);
			return inputSpace.TransformDirection(val2);
		}

		public override void FixedUpdate()
		{
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: 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_00d3: 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_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority)
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !hasFired)
				{
					hasFired = true;
					((EntityState)this).characterMotor.velocity = Vector3.zero;
					((BaseState)this).SmallHop(((EntityState)this).characterMotor, smallHopVelocity);
				}
				if (((EntityState)this).fixedAge <= flyDuration)
				{
					AltHandleMovements(aimDirection);
				}
			}
			if (((EntityState)this).fixedAge >= flyDuration && NetworkServer.active && !((Enum)((EntityState)this).characterBody.bodyFlags).HasFlag((Enum)(object)(BodyFlags)1))
			{
				CharacterBody characterBody = ((EntityState)this).characterBody;
				characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
				((EntityState)this).characterMotor.onHitGroundServer += new HitGroundDelegate(CharacterMotor_onHitGround);
			}
			if (((EntityState)this).isAuthority && ((((EntityState)this).fixedAge >= flyDuration) & !hasFlown))
			{
				if (Object.op_Implicit((Object)(object)inputSpace))
				{
					Object.Destroy((Object)(object)((Component)inputSpace).gameObject);
				}
				((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
				rotator.ResetRotation(0.3f);
				hasResetRot = true;
				((EntityState)this).characterMotor.velocity.y = 0f;
				((EntityState)this).PlayAnimation("FullBody, Override", "PulseExit", "BaseSkill.playbackRate", exitAnimDuration);
				hasFlown = true;
				animator.SetBool("isMoving", false);
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= flyDuration + exitDuration && hasFlown)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void CharacterMotor_onHitGround(ref HitGroundInfo hitGroundInfo)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: 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)
			if (((Enum)((EntityState)this).characterBody.bodyFlags).HasFlag((Enum)(object)(BodyFlags)1))
			{
				CharacterBody characterBody = ((EntityState)this).characterBody;
				characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2);
			}
			((EntityState)this).characterMotor.onHitGroundServer -= new HitGroundDelegate(CharacterMotor_onHitGround);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			if (!hasResetRot)
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
				}
				if (Object.op_Implicit((Object)(object)rotator))
				{
					rotator.ResetRotation(0.5f);
				}
				hasResetRot = true;
				((EntityState)this).PlayAnimation("FullBody, Override", "PulseExit", "BaseSkill.playbackRate", exitAnimDuration);
				animator.SetBool("isMoving", false);
			}
			animator.SetBool("isFlying", false);
		}
	}
	public abstract class BaseChannelWurm : BaseSkillState
	{
		private ChildLocator childLocator;

		private Animator animator;

		private float baseChannelDuration = 3f;

		private float channelDuration;

		private bool hasBegunChannelling;

		private bool hasChannelled;

		private string chargeSoundString = "PlayWormCharge";

		private uint stopChargeID;

		protected abstract SummonWurm GetNextState();

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			animator.SetBool("IsChannelling", true);
			channelDuration = baseChannelDuration / ((BaseState)this).attackSpeedStat;
			((EntityState)this).PlayAnimation("Worm, Override", "WormChannelStart", "LorentzCannon.Playbackrate", 1.4f);
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.Slow50);
			}
			stopChargeID = Util.PlaySound(chargeSoundString, ((EntityState)this).gameObject);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (animator.GetBool("attacking"))
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
			if (!hasBegunChannelling)
			{
				hasBegunChannelling = true;
				((EntityState)this).PlayAnimation("Worm, Override", "WormChannel", "LorentzCannon.Playbackrate", baseChannelDuration);
			}
			if (((ButtonState)(ref ((EntityState)this).inputBank.skill1)).justPressed && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
			if (((EntityState)this).fixedAge >= channelDuration && ((EntityState)this).isAuthority)
			{
				SummonWurm nextState = GetNextState();
				animator.SetBool("HasChannelled", true);
				((EntityState)this).outer.SetNextState((EntityState)(object)nextState);
				hasBegunChannelling = false;
				hasChannelled = true;
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			animator.SetBool("IsChannelling", false);
			AkSoundEngine.StopPlayingID(stopChargeID, 0);
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.Slow50);
			}
			if (!hasChannelled)
			{
				RefundCooldown();
			}
		}

		private void RefundCooldown()
		{
			((BaseSkillState)this).activatorSkillSlot.rechargeStopwatch = 0.9f * ((BaseSkillState)this).activatorSkillSlot.finalRechargeInterval;
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)0;
		}
	}
	internal class CancelSkill : BaseSkillState
	{
		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (!((EntityState)this).isAuthority)
			{
			}
		}
	}
	internal class CancelWurm : BaseSkillState
	{
		private GenericSkill specialSlot;

		public static SkillDef cancelSkillDef;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			if (Object.op_Implicit((Object)(object)SummonWurm.wormMaster))
			{
				SummonWurm.wormMaster.TrueKill();
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			cancelSkillDef = SummonWurm.cancelSkillDef;
			specialSlot = ((EntityState)this).skillLocator.special;
			if (Object.op_Implicit((Object)(object)specialSlot) && Object.op_Implicit((Object)(object)cancelSkillDef))
			{
				specialSlot.UnsetSkillOverride(SummonWurm.src, cancelSkillDef, (SkillOverridePriority)4);
			}
			Debug.Log((object)"Exiting");
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			((EntityState)this).outer.SetNextStateToMain();
		}
	}
	public class ChannelWurm : BaseChannelWurm
	{
		public override void OnEnter()
		{
			base.OnEnter();
		}

		protected override SummonWurm GetNextState()
		{
			return new SummonWurm();
		}

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

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	public class Ferroshot : BaseSkillState
	{
		public static float damageCoefficient = 1.4f;

		public static float procCoefficient = 1f;

		public static float baseDuration = 1f;

		public static float force = 10f;

		public static float recoil = 0f;

		private AmpLightningController lightningController;

		public static float range = 600f;

		private GameObject bulletPrefab;

		public static float launchForce = 150f;

		private static int numOfBullets = 6;

		private const float FIRE_TIME_PERCENTAGE = 0.25f;

		private string launchString = "PlayFerroshotLaunchAlter";

		private string prepString = "PlayFerroshotCreateAlter";

		private uint stopPrepID;

		private Animator animator;

		private ChildLocator childLocator;

		private Transform leftMuzzleTransform;

		public static GameObject ferroshotPrefabBasic = Assets.bulletPrepItem;

		private float totalDuration;

		private float fireDuration;

		private float chargeDuration;

		private bool hasFired;

		private float distanceFromHead = 0.5f;

		private GameObject[] bullets = (GameObject[])(object)new GameObject[numOfBullets];

		private bool hasMuzzleEffect;

		private GameObject muzzleEffectPrefab = Assets.ampBulletMuzzleEffect;

		private Transform fireMuzzleTransform;

		public override void OnEnter()
		{
			//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)
			((BaseState)this).OnEnter();
			totalDuration = baseDuration / ((BaseState)this).attackSpeedStat;
			fireDuration = 0.25f * totalDuration;
			chargeDuration = totalDuration - fireDuration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			lightningController = ((EntityState)this).GetComponent<AmpLightningController>();
			bulletPrefab = lightningController.lorentzProjectile;
			Ray aimRay = ((BaseState)this).GetAimRay();
			((EntityState)this).PlayAnimation("Worm, Override", "ShootProjectile", "LorentzCannon.playbackRate", 1.2f * totalDuration);
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
				leftMuzzleTransform = childLocator.FindChild("LowerArmL");
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)fireMuzzleTransform))
			{
				EntityState.Destroy((Object)(object)((Component)fireMuzzleTransform).gameObject);
			}
			((EntityState)this).OnExit();
		}

		private Vector3 getLoc(float yDir, float angle)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Cos(yDir) * Mathf.Cos(angle);
			float num2 = Mathf.Sin(angle);
			float num3 = (0f - Mathf.Sin(yDir)) * Mathf.Cos(angle);
			return new Vector3(num, num2, num3) * distanceFromHead;
		}

		private void updateRotAndLoc()
		{
			//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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((BaseState)this).GetAimRay();
			float num = MathF.PI / (float)(numOfBullets - 1);
			for (int i = 0; i < numOfBullets; i++)
			{
				if ((Object)(object)bullets[i] != (Object)null)
				{
					bullets[i].transform.position = ((Ray)(ref aimRay)).origin + getLoc(((EntityState)this).modelLocator.modelTransform.eulerAngles.y * (MathF.PI / 180f), num * (float)i);
					bullets[i].transform.rotation = Quaternion.LookRotation(((Ray)(ref aimRay)).direction);
				}
			}
		}

		private IEnumerator Fire()
		{
			hasFired = true;
			if (!((EntityState)this).isAuthority)
			{
				yield break;
			}
			float angle = MathF.PI / (float)(numOfBullets - 1);
			Ray aimRay;
			for (int j = 0; j < numOfBullets; j++)
			{
				aimRay = ((BaseState)this).GetAimRay();
				stopPrepID = Util.PlaySound(prepString, ((EntityState)this).gameObject);
				bullets[j] = Object.Instantiate<GameObject>(ferroshotPrefabBasic, ((Ray)(ref aimRay)).origin + getLoc(((EntityState)this).modelLocator.modelTransform.eulerAngles.y * (MathF.PI / 180f), angle * (float)j), Quaternion.LookRotation(((Ray)(ref aimRay)).direction));
				bullets[j].transform.parent = ((EntityState)this).characterBody.transform;
				yield return (object)new WaitForSeconds((totalDuration - fireDuration) / (float)numOfBullets);
			}
			aimRay = ((BaseState)this).GetAimRay();
			RaycastHit hit = default(RaycastHit);
			bool somethingHit = Physics.Raycast(((Ray)(ref aimRay)).origin, ((Ray)(ref aimRay)).direction, ref hit);
			for (int i = 0; i < numOfBullets; i++)
			{
				Vector3 direction;
				if (somethingHit && ((RaycastHit)(ref hit)).distance > 2.5f)
				{
					Vector3 val = ((RaycastHit)(ref hit)).point - bullets[i].transform.position;
					direction = ((Vector3)(ref val)).normalized;
				}
				else
				{
					direction = ((Ray)(ref aimRay)).direction;
				}
				ProjectileManager.instance.FireProjectile(bulletPrefab, bullets[i].transform.position, Quaternion.LookRotation(direction), ((EntityState)this).gameObject, damageCoefficient * ((BaseState)this).damageStat, launchForce, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, launchForce);
				Util.PlaySound(launchString, ((EntityState)this).gameObject);
				EntityState.Destroy((Object)(object)bullets[i]);
				yield return (object)new WaitForSeconds(fireDuration / (float)numOfBullets);
			}
			AkSoundEngine.StopPlayingID(stopPrepID);
			hit = default(RaycastHit);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (!hasMuzzleEffect)
			{
				hasMuzzleEffect = true;
				if (!Object.op_Implicit((Object)(object)childLocator))
				{
				}
			}
			if (((EntityState)this).fixedAge < totalDuration)
			{
				if (!hasFired)
				{
					((MonoBehaviour)((EntityState)this).characterBody).StartCoroutine(Fire());
				}
				updateRotAndLoc();
			}
			else if (((EntityState)this).fixedAge >= totalDuration && ((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 Fulmination : BaseSkillState
	{
		[Header("Effect/Animation Variables")]
		public GameObject lightningEffectPrefab;

		public static GameObject impactEffectPrefab;

		public EffectData fulminationData;

		private AmpLightningController lightningController;

		private Transform fulminationTransform;

		private Transform muzzleTransform;

		private Transform handLTransform;

		private ChildLocator childLocator;

		private bool hasMuzzleEffect;

		private Animator animator;

		[Header("Attack Variables")]
		public static float radius = 1f;

		public static float basetickFrequency = 6f;

		public static float tickFrequency;

		public static float force = 20f;

		private float tickDamageCoefficient;

		public static float procCoefficientPerTick;

		public static float totalDamageCoefficient = 16f;

		public static float minimumDuration = 1f;

		public static float baseticktotal;

		[Header("Sounds")]
		public string enterSoundString = "PlayFulminationEnter";

		public string attackSoundString = "PlayFulminationState";

		public string endSoundString = "PlayFulminationExitAlter";

		public uint stopSoundID;

		[Header("Duration/Timer Variables")]
		public static float delayTime = 0.2f;

		public static float baseEntryDuration = 0.5f;

		public static float baseFulminationDuration = 3f;

		private float fulminationStopwatch;

		private float stopwatch;

		public float entryDuration;

		private float fulminationDuration;

		private bool hasBegunFulmination;

		private GenericSkill specialSlot;

		public static SkillDef cancelSkillDef;

		private string prefix = "NT";

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			lightningController = ((EntityState)this).GetComponent<AmpLightningController>();
			lightningEffectPrefab = lightningController.fulminationEffect;
			impactEffectPrefab = lightningController.fulminationHitEffect;
			stopwatch = 0f;
			entryDuration = baseEntryDuration / ((BaseState)this).attackSpeedStat;
			fulminationDuration = baseFulminationDuration;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			animator = ((EntityState)this).GetModelAnimator();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(entryDuration + fulminationDuration + 1f);
				childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
				handLTransform = childLocator.FindChild("HandL");
			}
			Util.PlaySound("PlayFulminationEnter", ((EntityState)this).gameObject);
			tickFrequency = basetickFrequency * ((BaseState)this).attackSpeedStat;
			baseticktotal = Mathf.CeilToInt(basetickFrequency * fulminationDuration);
			tickDamageCoefficient = totalDamageCoefficient / baseticktotal;
			animator.SetBool("isUsingIndependentSkill", true);
			((EntityState)this).PlayAnimation("Fulminate, Override", "FulminateStart", "BaseSkill.playbackRate", entryDuration);
			animator.SetBool("isFulminating", true);
			cancelSkillDef = Skills.fulminationCancelSkillDef;
			specialSlot = ((EntityState)this).skillLocator.special;
			if (Object.op_Implicit((Object)(object)specialSlot) && Object.op_Implicit((Object)(object)cancelSkillDef))
			{
				specialSlot.SetSkillOverride((object)this, cancelSkillDef, (SkillOverridePriority)4);
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)specialSlot) && Object.op_Implicit((Object)(object)cancelSkillDef))
			{
				specialSlot.UnsetSkillOverride((object)this, cancelSkillDef, (SkillOverridePriority)4);
			}
			Util.PlaySound(endSoundString, ((EntityState)this).gameObject);
			AkSoundEngine.StopPlayingID(stopSoundID, 0);
			if (Object.op_Implicit((Object)(object)fulminationTransform))
			{
				EntityState.Destroy((Object)(object)((Component)fulminationTransform).gameObject);
			}
			animator.SetBool("isFulminating", false);
			animator.SetBool("isUsingIndependentSkill", false);
			((EntityState)this).PlayCrossfade("Fulminate, Override", "FulminateEnd", 0.1f);
		}

		private void FireLightning(string muzzleString)
		{
			//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_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: 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_007c: 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_008e: 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_00aa: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Expected O, but got Unknown
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((BaseState)this).GetAimRay();
			if (((EntityState)this).isAuthority)
			{
				BulletAttack val = new BulletAttack
				{
					owner = ((EntityState)this).gameObject,
					weapon = ((EntityState)this).gameObject,
					origin = ((Ray)(ref aimRay)).origin,
					aimVector = ((Ray)(ref aimRay)).direction,
					minSpread = 0f,
					damage = tickDamageCoefficient * ((EntityState)this).characterBody.damage,
					force = 2f,
					muzzleName = muzzleString,
					hitEffectPrefab = impactEffectPrefab,
					isCrit = ((EntityState)this).characterBody.RollCrit(),
					radius = radius,
					falloffModel = (FalloffModel)0,
					stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask,
					procCoefficient = 1f,
					maxDistance = 20f,
					smartCollision = true,
					damageType = (DamageType)0
				};
				DamageAPI.AddModdedDamageType(val, DamageTypes.fulminationChain);
				if (Util.CheckRoll(15f, ((EntityState)this).characterBody.master))
				{
					DamageAPI.AddModdedDamageType(val, DamageTypes.applyCharge);
				}
				val.Fire();
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= entryDuration && !hasBegunFulmination)
			{
				hasBegunFulmination = true;
				animator.SetBool("isUsingIndependentSkill", false);
				if (Object.op_Implicit((Object)(object)childLocator))
				{
					Transform val = childLocator.FindChild("HandL");
					if (Object.op_Implicit((Object)(object)val))
					{
						fulminationTransform = Object.Instantiate<GameObject>(lightningEffectPrefab, val).transform;
					}
				}
				stopSoundID = Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
				FireLightning("HandL");
			}
			if (hasBegunFulmination)
			{
				fulminationStopwatch += Time.deltaTime;
				if (fulminationStopwatch > 1f / tickFrequency)
				{
					fulminationStopwatch -= 1f / tickFrequency;
					FireLightning("HandL");
				}
				UpdateFulminationEffect();
			}
			if (stopwatch >= fulminationDuration + entryDuration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void UpdateFulminationEffect()
		{
			//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)
			//IL_000f: 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)
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 direction = ((Ray)(ref aimRay)).direction;
			if (Object.op_Implicit((Object)(object)fulminationTransform))
			{
				fulminationTransform.forward = direction;
			}
		}
	}
	internal class PlasmaSlash : BaseSkillState
	{
		private float baseTotalDuration = 0.75f;

		private float baseChargeDuration = 0.5f;

		protected string hitboxName = "SpinSlash";

		private float chargeDuration;

		private float totalDuration;

		public OverlapAttack attack;

		protected DamageType damageType = (DamageType)0;

		protected float damageCoefficient = 7f;

		protected float procCoefficient = 1f;

		protected GameObject swingEffectPrefab = Assets.heatSwing;

		protected GameObject hitEffectPrefab = Assets.heatHit;

		protected float stopwatch;

		private ChildLocator childLocator;

		protected Animator animator;

		private bool hasMuzzleEffect;

		private GameObject muzzleEffectPrefab = Assets.plasmaMuzzle;

		protected float pushForce = 300f;

		protected Vector3 bonusForce = Vector3.zero;

		protected NetworkSoundEventIndex impactSound = Assets.heatShockHitSoundEvent.index;

		private bool hasFired = false;

		private string chargeSoundString = "PlayHeatShockCharge";

		public uint stopChargeSound;

		protected string swingSoundString = "PlayHeatShockSwing";

		private string muzzleString = "HeatSwing";

		private bool inGroundedState;

		private Transform swordMuzzle;

		public static float shortHopVelocity;

		private GameObject fireBeamPrefab = Projectiles.fireBeamPrefab;

		private float fireBeamDamage = 5f;

		public override void OnEnter()
		{
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Expected O, but got Unknown
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: 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_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			chargeDuration = baseChargeDuration / ((BaseState)this).attackSpeedStat;
			totalDuration = baseTotalDuration / ((BaseState)this).attackSpeedStat;
			animator.SetBool("isUsingIndependentSkill", true);
			hasMuzzleEffect = false;
			((EntityState)this).characterBody.SetAimTimer(totalDuration);
			HitBoxGroup hitBoxGroup = null;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName);
				childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
				swordMuzzle = childLocator.FindChild("SwordPlace");
			}
			if (((BaseState)this).isGrounded)
			{
				inGroundedState = true;
				((EntityState)this).PlayAnimation("FullBody, Override", "SpinningSlash", "BaseSkill.playbackRate", totalDuration);
				stopChargeSound = Util.PlaySound(chargeSoundString, ((EntityState)this).gameObject);
				attack = new OverlapAttack();
				attack.damageType = damageType;
				attack.attacker = ((EntityState)this).gameObject;
				attack.inflictor = ((EntityState)this).gameObject;
				attack.teamIndex = ((BaseState)this).GetTeam();
				attack.damage = damageCoefficient * ((EntityState)this).characterBody.damage;
				attack.procCoefficient = procCoefficient;
				attack.hitEffectPrefab = hitEffectPrefab;
				attack.forceVector = bonusForce;
				attack.pushAwayForce = pushForce;
				attack.hitBoxGroup = hitBoxGroup;
				attack.isCrit = ((BaseState)this).RollCrit();
				attack.impactSound = impactSound;
				DamageAPI.AddModdedDamageType(attack, DamageTypes.strongBurnIfCharged);
			}
			else if (!((BaseState)this).isGrounded)
			{
				stopChargeSound = Util.PlaySound(chargeSoundString, ((EntityState)this).gameObject);
				inGroundedState = false;
				((EntityState)this).PlayAnimation("FullBody, Override", "SpinningSlash", "BaseSkill.playbackRate", totalDuration);
			}
		}

		protected virtual void ModifyProjectile(ref FireProjectileInfo projectileInfo)
		{
		}

		private void FireAerialAttack()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: 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_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)
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				AkSoundEngine.StopPlayingID(stopChargeSound, 0);
				if (Object.op_Implicit((Object)(object)fireBeamPrefab))
				{
					Util.PlaySound(swingSoundString, ((EntityState)this).gameObject);
					FireProjectileInfo val = default(FireProjectileInfo);
					val.projectilePrefab = fireBeamPrefab;
					val.position = ((Ray)(ref aimRay)).origin;
					val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction);
					val.owner = ((EntityState)this).gameObject;
					val.damage = fireBeamDamage * ((EntityState)this).characterBody.damage;
					val.crit = ((BaseState)this).RollCrit();
					FireProjectileInfo projectileInfo = val;
					ModifyProjectile(ref projectileInfo);
					ProjectileManager.instance.FireProjectile(projectileInfo);
				}
			}
		}

		private void FireGroundAttack()
		{
			if (!hasFired)
			{
				hasFired = true;
				AkSoundEngine.StopPlayingID(stopChargeSound, 0);
				Util.PlaySound(swingSoundString, ((EntityState)this).gameObject);
				if (((EntityState)this).isAuthority)
				{
					PlaySwingEffect();
				}
			}
			if (((EntityState)this).isAuthority)
			{
				attack.Fire((List<HurtBox>)null);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (!hasMuzzleEffect)
			{
				hasMuzzleEffect = true;
				swordMuzzle = Object.Instantiate<GameObject>(muzzleEffectPrefab, swordMuzzle).transform;
				Debug.Log((object)"spawning muzzle");
			}
			if (inGroundedState)
			{
				if (((EntityState)this).fixedAge > chargeDuration && !hasFired)
				{
					FireGroundAttack();
					hasFired = true;
					if (Object.op_Implicit((Object)(object)swordMuzzle))
					{
						EntityState.Destroy((Object)(object)((Component)swordMuzzle).gameObject);
					}
				}
				if (((EntityState)this).fixedAge >= totalDuration)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
			else
			{
				if (inGroundedState || !Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					return;
				}
				if (!hasFired)
				{
					((EntityState)this).characterMotor.velocity.y = shortHopVelocity;
				}
				if (((EntityState)this).fixedAge > chargeDuration && !hasFired)
				{
					FireAerialAttack();
					hasFired = true;
					if (Object.op_Implicit((Object)(object)swordMuzzle))
					{
						EntityState.Destroy((Object)(object)((Component)swordMuzzle).gameObject);
					}
				}
				if (((EntityState)this).fixedAge >= totalDuration)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		protected void PlaySwingEffect()
		{
			EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, true);
		}

		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()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)swordMuzzle))
			{
				EntityState.Destroy((Object)(object)((Component)swordMuzzle).gameObject);
			}
			if (!hasFired)
			{
				AkSoundEngine.StopPlayingID(stopChargeSound, 0);
			}
			animator.SetBool("isUsingIndependentSkill", false);
		}
	}
	internal class PulseLeap : BaseSkillState
	{
		private BlastAttack boostBlast;

		private string launchSound = "PlayBoltExit";

		private float launchDamage = 2.5f;

		private GameObject launchEffect;

		private float aerialBoostCoefficient = 50f;

		private float groundXZBoostCoefficient = 50f;

		private float groundYBoostCoefficient = 30f;

		private float initialGroundedHopCoefficient = 10f;

		private ChildLocator childLocator;

		private Vector3 boostVelocity;

		private float charge = 1f;

		public float minLungeSpeed = 30f;

		public float maxLungeSpeed = 100f;

		public override void OnEnter()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
			if (!((EntityState)this).characterMotor.isGrounded)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				if ((double)((Ray)(ref aimRay)).direction.y < 0.5)
				{
					((EntityState)this).PlayAnimation("FullBody, Override", "BoostAerial", "ShootGun.playbackRate", 0.1f);
					goto IL_008a;
				}
			}
			((EntityState)this).PlayAnimation("Fulminate, Override", "BoostGrounded", "ShootGun.playbackRate", 0.1f);
			goto IL_008a;
			IL_008a:
			Util.PlaySound(launchSound, ((EntityState)this).gameObject);
		}

		public void FireLaunchBlast()
		{
			//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_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: 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_0070: 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_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Expected O, but got Unknown
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: 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_0108: Expected O, but got Unknown
			boostBlast = new BlastAttack
			{
				attacker = ((EntityState)this).gameObject,
				baseDamage = launchDamage * ((EntityState)this).characterBody.damage,
				baseForce = 0f,
				attackerFiltering = (AttackerFiltering)2,
				crit = ((EntityState)this).characterBody.RollCrit(),
				damageColorIndex = (DamageColorIndex)3,
				damageType = (DamageType)32,
				falloffModel = (FalloffModel)0,
				inflictor = ((EntityState)this).gameObject,
				position = ((EntityState)this).characterBody.corePosition,
				procChainMask = default(ProcChainMask),
				procCoefficient = 1f,
				radius = 6f,
				teamIndex = ((EntityState)this).characterBody.teamComponent.teamIndex
			};
			DamageAPI.AddModdedDamageType(boostBlast, DamageTypes.applyCharge);
			boostBlast.Fire();
			EffectData val = new EffectData
			{
				origin = childLocator.FindChild("FootL").position,
				scale = 1.5f
			};
			launchEffect = Assets.boltExitEffect;
			EffectManager.SpawnEffect(launchEffect, val, true);
		}

		private void DoBoost()
		{
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: 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_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: 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_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_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: 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)
			Ray aimRay;
			if (((EntityState)this).characterMotor.isGrounded)
			{
				((EntityState)this).characterMotor.velocity.y = initialGroundedHopCoefficient;
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground();
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				Vector3 velocity = characterMotor.velocity;
				aimRay = ((BaseState)this).GetAimRay();
				float num = ((Ray)(ref aimRay)).direction.x * groundXZBoostCoefficient;
				aimRay = ((BaseState)this).GetAimRay();
				float num2 = Math.Abs(((Ray)(ref aimRay)).direction.y) * groundYBoostCoefficient;
				aimRay = ((BaseState)this).GetAimRay();
				characterMotor.velocity = velocity + new Vector3(num, num2, ((Ray)(ref aimRay)).direction.z * groundXZBoostCoefficient);
			}
			else
			{
				((EntityState)this).characterMotor.velocity.y = 0f;
				CharacterMotor characterMotor2 = ((EntityState)this).characterMotor;
				Vector3 velocity2 = characterMotor2.velocity;
				aimRay = ((BaseState)this).GetAimRay();
				characterMotor2.velocity = velocity2 + ((Ray)(ref aimRay)).direction * aerialBoostCoefficient;
			}
		}

		public static Vector3 CalculateLungeVelocity(Vector3 currentVelocity, Vector3 aimDirection, float charge, float lungeSpeed)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: 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)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: 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_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			currentVelocity = ((Vector3.Dot(currentVelocity, aimDirection) < 0f) ? Vector3.zero : Vector3.Project(currentVelocity, aimDirection));
			return currentVelocity + aimDirection * lungeSpeed;
		}

		public override void FixedUpdate()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((EntityState)this).characterMotor.velocity = boostVelocity;
				FireLaunchBlast();
			}
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void CharacterMotor_onHitGround(ref HitGroundInfo hitGroundInfo)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: 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)
			if (((Enum)((EntityState)this).characterBody.bodyFlags).HasFlag((Enum)(object)(BodyFlags)1))
			{
				CharacterBody characterBody = ((EntityState)this).characterBody;
				characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2);
			}
			((EntityState)this).characterMotor.onHitGroundServer -= new HitGroundDelegate(CharacterMotor_onHitGround);
		}

		public override void OnExit()
		{
			//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_003b: 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_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			if (NetworkServer.active && !((Enum)((EntityState)this).characterBody.bodyFlags).HasFlag((Enum)(object)(BodyFlags)1))
			{
				CharacterBody characterBody = ((EntityState)this).characterBody;
				characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
				((EntityState)this).characterMotor.onHitGroundServer += new HitGroundDelegate(CharacterMotor_onHitGround);
			}
			((EntityState)this).OnExit();
		}
	}
	public class AmpChargeTracker : MonoBehaviour
	{
		public class SyncOrbs : INetMessage, ISerializableObject
		{
			public enum METHOD
			{
				EnableSecondOrb,
				DisableSecondOrb
			}

			private NetworkInstanceId netId;

			private METHOD method;

			public SyncOrbs()
			{
			}

			public SyncOrbs(NetworkInstanceId netId, METHOD method)
			{
				//IL_0009: 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)
				this.netId = netId;
				this.method = method;
			}

			void ISerializableObject.Deserialize(NetworkReader reader)
			{
				//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)
				netId = reader.ReadNetworkId();
				method = (METHOD)reader.ReadInt32();
			}

			void INetMessage.OnReceived()
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				GameObject val = Util.FindNetworkObject(netId);
				if (!Object.op_Implicit((Object)(object)val))
				{
					Debug.LogWarning((object)"SyncOrbs: Given network id associates with no known gameobject");
					return;
				}
				switch (method)
				{
				case METHOD.EnableSecondOrb:
					EnableSecondOrb(val);
					break;
				case METHOD.DisableSecondOrb:
					DisableSecondOrb(val);
					break;
				default:
					Debug.LogError((object)"SyncOrbs: Invalid method sent to client");
					break;
				}
			}

			void ISerializableObject.Serialize(NetworkWriter writer)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				writer.Write(netId);
				writer.Write((int)method);
			}

			private void EnableSecondOrb(GameObject go)
			{
				((Component)go.GetComponent<ChildLocator>().FindChild("Orb2Location")).gameObject.SetActive(true);
			}

			private void DisableSecondOrb(GameObject go)
			{
				((Component)go.GetComponent<ChildLocator>().FindChild("Orb2Location")).gameObject.SetActive(false);
			}
		}

		public GameObject owner;

		public GameObject victim;

		public CharacterBody ownerBody;

		public CharacterBody victimBody;

		private bool makeOrbs;

		private GameObject orbPrefab;

		private GameObject orbPrefabFull;

		private GameObject orbPair;

		private bool secondOrbActive;

		private void Start()
		{
			orbPrefab = owner.gameObject.GetComponent<AmpLightningController>().chargeOrb;
			orbPrefabFull = owner.gameObject.GetComponent<AmpLightningController>().chargeOrbFull;
			GameObject obj = owner;
			ownerBody = ((obj != null) ? obj.GetComponent<CharacterBody>() : null);
			GameObject obj2 = victim;
			victimBody = ((obj2 != null) ? obj2.GetComponent<CharacterBody>() : null);
			makeOrbs = Config.chargeOrbsEnable.Value;
		}

		[Server]
		private void CheckOrbDraw()
		{
			//IL_010c: 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)
			if (!makeOrbs)
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)victimBody) && victimBody.healthComponent.health <= 0f)
			{
				DestroyOrbs();
				return;
			}
			int buffCount = victimBody.GetBuffCount(Buffs.chargeBuildup);
			if (buffCount >= 1 && !Object.op_Implicit((Object)(object)orbPair))
			{
				if (buffCount == 2)
				{
					orbPair = Object.Instantiate<GameObject>(orbPrefabFull, victim.transform);
					secondOrbActive = true;
				}
				else
				{
					orbPair = Object.Instantiate<GameObject>(orbPrefab, victim.transform);
				}
				NetworkedBodyAttachment component = orbPair.GetComponent<NetworkedBodyAttachment>();
				component.AttachToGameObjectAndSpawn(victim, (string)null);
			}
			else if (buffCount == 2 && !secondOrbActive)
			{
				NetMessageExtensions.Send((INetMessage)(object)new SyncOrbs(orbPair.GetComponent<NetworkIdentity>().netId, SyncOrbs.METHOD.EnableSecondOrb), (NetworkDestination)1);
				secondOrbActive = true;
			}
			else if (buffCount == 1 && secondOrbActive)
			{
				NetMessageExtensions.Send((INetMessage)(object)new SyncOrbs(orbPair.GetComponent<NetworkIdentity>().netId, SyncOrbs.METHOD.DisableSecondOrb), (NetworkDestination)1);
			}
			else if (buffCount == 0 && Object.op_Implicit((Object)(object)orbPair))
			{
				DestroyOrbs();
			}
		}

		private void FixedUpdate()
		{
			CheckOrbDraw();
		}

		private void DestroyOrbs()
		{
			if (Object.op_Implicit((Object)(object)orbPair))
			{
				Object.Destroy((Object)(object)orbPair);
				orbPair = null;
				secondOrbActive = false;
			}
		}
	}
	[RequireComponent(typeof(VehicleSeat))]
	[RequireComponent(typeof(Rigidbody))]
	public class BoltVehicle : MonoBehaviour, ICameraStateProvider
	{
		[Header("Vehicle Parameters")]
		public float duration = 1.5f;

		public float initialSpeed = 50f;

		private AmpLightningController lightningController;

		public float targetSpeed = 50f;

		public float acceleration = 1000f;

		public string stateSoundString = "PlayBoltStateWind";

		public float cameraLerpTime = 0.25f;

		public GameObject enterEffectPrefab;

		public string enterSoundString = "PlayBoltEnter";

		public bool exitAllowed;

		public uint stopID;

		[Header("Blast Parameters")]
		public GameObject exitEffectPrefab;

		public string exitSoundString = "PlayBoltExit";

		public float blastRadius = 1f;

		private BlastAttack boltBlast;

		[Header("Overlap Parameters")]
		public float overlapDamageCoefficient = 1.5f;

		public float overlapProcCoefficient = 1f;

		public float overlapForce = 0.5f;

		public float overlapFireFrequency = 30f;

		public float overlapResetFrequency = 1f;

		public float overlapVehicleDurationBonusPerHit;

		public GameObject overlapHitEffectPrefab = Assets.electricImpactEffect;

		[Header("Misc. Variables")]
		private float age;

		public bool hasDetonatedServer;

		private VehicleSeat vehicleSeat;

		private Rigidbody rigidbody;

		private OverlapAttack overlapAttack;

		private float overlapFireAge;

		private float overlapResetAge;

		private float blastDamageCoefficient = StaticValues.boltBlastDamageCoefficient;

		public void Awake()
		{
			hasDetonatedServer = false;
			vehicleSeat = ((Component)this).GetComponent<VehicleSeat>();
			rigidbody = ((Component)this).GetComponent<Rigidbody>();
			vehicleSeat.onPassengerEnter += OnPassengerEnter;
			vehicleSeat.onPassengerExit += OnPassengerExit;
			vehicleSeat.exitVehicleAllowedCheck.AddCallback((CallbackDelegate<Interactability, CharacterBody>)CheckExitAllowed);
		}

		private void CheckExitAllowed(CharacterBody characterBody, ref Interactability? resultOverride)
		{
			resultOverride = (Interactability)(exitAllowed ? 2 : 0);
		}

		private void OnPassengerExit(GameObject passenger)
		{
			AkSoundEngine.StopPlayingID(stopID, 0);
			Util.PlaySound(exitSoundString, ((Component)this).gameObject);
			if (NetworkServer.active)
			{
				DetonateServer();
			}
			foreach (CameraRigController readOnlyInstances in CameraRigController.readOnlyInstancesList)
			{
				if ((Object)(object)readOnlyInstances.target == (Object)(object)passenger)
				{
					readOnlyInstances.SetOverrideCam((ICameraStateProvider)(object)this, 0.5f);
					readOnlyInstances.SetOverrideCam((ICameraStateProvider)null, 0.5f);
				}
			}
		}

		public void OnPassengerEnter(GameObject passenger)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: 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_0047: 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_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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//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_00fc: 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_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: 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_0140: 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_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: 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_0184: Expected O, but got Unknown
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)vehicleSeat.currentPassengerInputBank))
			{
				Vector3 aimDirection = vehicleSeat.currentPassengerInputBank.aimDirection;
				rigidbody.rotation = Quaternion.LookRotation(aimDirection);
				rigidbody.velocity = aimDirection * initialSpeed;
				CharacterBody currentPassengerBody = vehicleSeat.currentPassengerBody;
				if (Object.op_Implicit((Object)(object)currentPassengerBody))
				{
					lightningController = ((Component)currentPassengerBody).gameObject.GetComponent<AmpLightningController>();
				}
				EffectData val = new EffectData
				{
					origin = currentPassengerBody.corePosition,
					scale = 10f
				};
				enterEffectPrefab = lightningController.surgeEnter;
				EffectManager.SpawnEffect(enterEffectPrefab, val, true);
				Util.PlaySound(enterSoundString, ((Component)this).gameObject);
				if (NetworkServer.active)
				{
					currentPassengerBody.AddBuff(Buffs.HiddenInvincibility);
				}
				overlapAttack = new OverlapAttack
				{
					attacker = ((Component)currentPassengerBody).gameObject,
					damage = overlapDamageCoefficient * currentPassengerBody.damage,
					pushAwayForce = overlapForce,
					isCrit = currentPassengerBody.RollCrit(),
					damageColorIndex = (DamageColorIndex)3,
					inflictor = ((Component)this).gameObject,
					procChainMask = default(ProcChainMask),
					procCoefficient = 1f,
					teamIndex = currentPassengerBody.teamComponent.teamIndex,
					hitBoxGroup = ((Component)this).gameObject.GetComponent<HitBoxGroup>(),
					hitEffectPrefab = overlapHitEffectPrefab
				};
				DamageAPI.AddModdedDamageType(overlapAttack, DamageTypes.applyCharge);
				stopID = Util.PlaySound(stateSoundString, ((Component)this).gameObject);
			}
		}

		public void DetonateServer()
		{
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: 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_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_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: 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_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: 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_0137: Expected O, but got Unknown
			//IL_013d: 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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Expected O, but got Unknown
			if (!hasDetonatedServer)
			{
				hasDetonatedServer = true;
				CharacterBody currentPassengerBody = vehicleSeat.currentPassengerBody;
				if (NetworkServer.active)
				{
					currentPassengerBody.RemoveBuff(Buffs.HiddenInvincibility);
				}
				if (Object.op_Implicit((Object)(object)currentPassengerBody))
				{
					EffectData val = new EffectData
					{
						origin = ((Component)this).transform.position,
						scale = 1.5f
					};
					exitEffectPrefab = lightningController.surgeExitEffect;
					EffectManager.SpawnEffect(exitEffectPrefab, val, true);
				}
				boltBlast = new BlastAttack
				{
					attacker = ((Component)currentPassengerBody).gameObject,
					baseDamage = blastDamageCoefficient * currentPassengerBody.damage,
					baseForce = 0f,
					attackerFiltering = (AttackerFiltering)2,
					crit = currentPassengerBody.RollCrit(),
					damageColorIndex = (DamageColorIndex)3,
					damageType = (DamageType)32,
					falloffModel = (FalloffModel)1,
					inflictor = ((Component)this).gameObject,
					position = ((Component)this).transform.position,
					procChainMask = default(ProcChainMask),
					procCoefficient = 1f,
					radius = 10f,
					teamIndex = currentPassengerBody.teamComponent.teamIndex
				};
				DamageAPI.AddModdedDamageType(boltBlast, DamageTypes.applyCharge);
				boltBlast.Fire();
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}

		private void FixedUpdate()
		{
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: 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_011a: 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_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: 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_0150: 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)
			if (!Object.op_Implicit((Object)(object)vehicleSeat) || !Object.op_Implicit((Object)(object)vehicleSeat.currentPassengerInputBank))
			{
				return;
			}
			age += Time.fixedDeltaTime;
			overlapFireAge += Time.fixedDeltaTime;
			overlapResetAge += Time.fixedDeltaTime;
			if (NetworkServer.active)
			{
				if (overlapFireAge > 1f / overlapFireFrequency)
				{
					overlapAttack.Fire((List<HurtBox>)null);
				}
				if (overlapResetAge >= 1f / overlapResetFrequency)
				{
					overlapAttack.ResetIgnoredHealthComponents();
					overlapResetAge = 0f;
				}
			}
			Ray val = vehicleSeat.currentPassengerInputBank.GetAimRay();
			float num = default(float);
			val = CameraRigController.ModifyAimRayIfApplicable(val, ((Component)this).gameObject, ref num);
			Vector3 velocity = rigidbody.velocity;
			Vector3 val2 = ((Ray)(ref val)).direction * targetSpeed;
			Vector3 val3 = Vector3.MoveTowards(velocity, val2, acceleration * Time.fixedDeltaTime);
			rigidbody.MoveRotation(Quaternion.LookRotation(((Ray)(ref val)).direction));
			rigidbody.AddForce(val3 - velocity, (ForceMode)2);
		}

		public void GetCameraState(CameraRigController cameraRigController, ref CameraState cameraState)
		{
		}

		public bool IsUserLookAllowed(CameraRigController cameraRigController)
		{
			return true;
		}

		public bool IsUserControlAllowed(CameraRigController cameraRigController)
		{
			return true;
		}

		public bool IsHudAllowed(CameraRigController cameraRigController)
		{
			return true;
		}
	}
	[RequireComponent(typeof(ProjectileDamage))]
	public class RadialDamage : MonoBehaviour
	{
		[Header("Damage Tick Parameters")]
		public float tickDamageCoefficient = 1.5f;

		private float interval = 1f;

		private float damageTimer;

		private string hitboxName = "VortexHitbox";

		public DamageInfo damageInfo = new DamageInfo();

		public GameObject explosionEffect;

		private OverlapAttack attack;

		private float resetStopwatch;

		private float fireStopwatch;

		public float resetFrequency = 1f;

		public float fireFrequency = 1f;

		[Header("Damaging Object Parameters")]
		protected Transform transform;

		protected TeamFilter teamFilter;

		[Header("Final Blast Parameters")]
		public BlastAttack radialBlast;

		public float finalBlastDamageCoefficient = 4f;

		private float timer;

		private string explosionString = "PlayVortexExplosion";

		private string loopString = "PlayVortexLoop";

		[Header("Damage Owner/Positional Parameters")]
		public ProjectileDamage projectileDamage;

		public ProjectileController projectileController;

		private ChildLocator childLocator;

		private HitBoxGroup vortexHitbox;

		private bool hasSetAttacker;

		public GameObject attacker;

		public CharacterBody charBody;

		public Vector3 position;

		public float radius = 10f;

		private SphereSearch sphereSearch;

		public float duration = 3f;

		private string spawnSound = "PlayVortexSpawn";

		private void Awake()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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)
			projectileDamage = ((Component)this).GetComponent<ProjectileDamage>();
			projectileController = ((Component)this).GetComponent<ProjectileController>();
			transform = ((Component)this).GetComponent<Transform>();
			teamFilter = ((Component)this).GetComponent<TeamFilter>();
			sphereSearch = new SphereSearch();
			PointSoundManager.EmitSoundServer(Assets.vortexSpawnSoundEvent.index, transform.position);
			PointSoundManager.EmitSoundServer(Assets.vortexLoopSoundEvent.index, transform.position);
		}

		private void Start()
		{
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: 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_00b5: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: 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_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_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Expected O, but got Unknown
			attacker = (Object.op_Implicit((Object)(object)projectileController.owner) ? projectileController.owner.gameObject : null);
			charBody = (Object.op_Implicit((Object)(object)attacker) ? attacker.GetComponent<CharacterBody>() : null);
			ResetOverlap();
			explosionEffect = Assets.vortexExplosionEffect;
			radialBlast = new BlastAttack
			{
				attacker = attacker,
				baseDamage = finalBlastDamageCoefficient * charBody.damage,
				baseForce = 0f,
				attackerFiltering = (AttackerFiltering)2,
				crit = charBody.RollCrit(),
				damageColorIndex = (DamageColorIndex)3,
				damageType = (DamageType)0,
				falloffModel = (FalloffModel)0,
				inflictor = ((Component)this).gameObject,
				position = transform.position,
				procChainMask = default(ProcChainMask),
				procCoefficient = 1f,
				radius = radius,
				teamIndex = teamFilter.teamIndex
			};
		}

		private void ResetOverlap()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0045: 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_0079: 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_00a0: 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)
			attack = new OverlapAttack();
			attack.procCoefficient = 1f;
			attack.attacker = attacker;
			attack.inflictor = ((Component)this).gameObject;
			attack.teamIndex = (TeamIndex)1;
			attack.attackerFiltering = (AttackerFiltering)2;
			attack.damage = tickDamageCoefficient * charBody.damage;
			attack.forceVector = Vector3.zero;
			attack.isCrit = charBody.RollCrit();
			attack.damageColorIndex = (DamageColorIndex)0;
			attack.damageType = (DamageType)0;
			attack.hitBoxGroup = Array.Find(((Component)this).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName);
		}

		private void FixedUpdate()
		{
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: 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_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Expected O, but got Unknown
			if (NetworkServer.active)
			{
				timer += Time.fixedDeltaTime;
				damageTimer -= Time.fixedDeltaTime;
				if (damageTimer <= 0f)
				{
					damageTimer = interval;
					ResetOverlap();
					attack.Fire((List<HurtBox>)null);
				}
			}
			if (timer >= duration - Time.fixedDeltaTime)
			{
				radialBlast.Fire();
				EffectData val = new EffectData
				{
					origin = transform.position,
					scale = 1.5f
				};
				EffectManager.SpawnEffect(explosionEffect, val, true);
				timer = 0f;
			}
		}
	}
	public class SlashCombo : BaseMeleeAttack
	{
		private new float chargeProc = 100f;

		public override void OnEnter()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			AmpLightningController component = ((EntityState)this).GetComponent<AmpLightningController>();
			hitboxName = "Sword";
			damageType = (DamageType)0;
			damageCoefficient = 1.5f;
			procCoefficient = 0.1f;
			pushForce = 300f;
			bonusForce = Vector3.zero;
			baseDuration = 0.8f;
			attackStartTime = 0.2f;
			attackEndTime = 0.4f;
			baseEarlyExitTime = 0.4f;
			hitStopDuration = 0.012f;
			attackRecoil = 0.5f;
			hitHopVelocity = 4f;
			swingSoundString = "PlayStormbladeSwing1";
			hitSoundString = "";
			muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight");
			swingEffectPrefab = component.swingEffect;
			hitEffectPrefab = component.swingHitEffect;
			impactSound = Assets.stormbladeHitSoundEvent.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();
		}
	}
	public class SummonWurm : BaseSkillState
	{
		private string prefix = "NT";

		private GenericSkill specialSlot;

		public static SkillDef cancelSkillDef;

		public static CharacterMaster wormMaster;

		public CharacterBody wormBody;

		public static GameObject wormExplosion;

		public static object src = new SummonWurm();

		private bool hasSpawned;

		private float wormLifeDuration = 30f;

		private Animator animator;

		private string summonSoundString = "PlayWormSummon";

		public override void OnEnter()
		{
			//IL_00a2: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			((EntityState)this).PlayAnimation("Worm, Override", "WormChannelRelease", "BaseSkill.playbackRate", 0.5f);
			animator = ((EntityState)this).GetModelAnimator();
			SkillDefInfo skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = prefix + "_AMP_BODY_SPECIAL_WORMCANCEL_NAME";
			skillDefInfo.skillNameToken = prefix + "_AMP_BODY_SPECIAL_WORMCANCEL_NAME";
			skillDefInfo.skillDescriptionToken = prefix + "_AMP_BODY_SPECIAL_WORMCANCEL_DESCRIPTION";
			skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset<Sprite>("texReturn");
			skillDefInfo.activationStateMachineName = "Slide";
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(CancelWurm));
			skillDefInfo.baseMaxStock = 0;
			skillDefInfo.baseRechargeInterval = 0f;
			skillDefInfo.beginSkillCooldownOnSkillEnd = false;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.forceSprintDuringState = false;
			skillDefInfo.fullRestockOnAssign = false;
			skillDefInfo.interruptPriority = (InterruptPriority)0;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.isCombatSkill = false;
			skillDefInfo.mustKeyPress = true;
			skillDefInfo.cancelSprintingOnActivation = false;
			skillDefInfo.rechargeStock = 0;
			skillDefInfo.requiredStock = 0;
			skillDefInfo.stockToConsume = 0;
			cancelSkillDef = Skills.CreateSkillDef(skillDefInfo);
			specialSlot = ((EntityState)this).skillLocator.special;
			if (Object.op_Implicit((Object)(object)specialSlot) && (Object)(object)cancelSkillDef != (Object)null)
			{
				specialSlot.SetSkillOverride(src, cancelSkillDef, (SkillOverridePriority)4);
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				SpawnWorm(((EntityState)this).characterBody);
			}
			animator.SetBool("HasChannelled", false);
		}

		private void SpawnWorm(CharacterBody characterBody)
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: 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_0068: 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_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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: 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_00d0: Expected O, but got Unknown
			//IL_0185: 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_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			GameObject melvinPrefab = Assets.melvinPrefab;
			Util.PlaySound(summonSoundString, ((EntityState)this).gameObject);
			EffectManager.SimpleMuzzleFlash(FireLunarShards.muzzleFlashEffectPrefab, ((EntityState)this).gameObject, "HandL", false);
			if (NetworkServer.active)
			{
				MasterSummon val = new MasterSummon
				{
					masterPrefab = melvinPrefab,
					ignoreTeamMemberLimit = false,
					teamIndexOverride = (TeamIndex)1,
					summonerBodyObject = ((Component)characterBody).gameObject,
					position = characterBody.corePosition + new Vector3(0f, 0f, 2f),
					rotation = characterBody.transform.rotation,
					inventoryToCopy = characterBody.inventory,
					inventoryItemCopyFilter = (ItemIndex index) => index != Items.ExtraLife.itemIndex && index != Items.ExtraLifeVoid.itemIndex
				};
				val.preSpawnSetupCallback = delegate(CharacterMaster master)
				{
					master.inventory.GiveItem(Assets.wormHealth, 1);
				};
				wormMaster = val.Perform();
			}
			if (!Object.op_Implicit((Object)(object)wormMaster))
			{
				return;
			}
			wormBody = wormMaster.GetBody();
			((Component)wormMaster).gameObject.AddComponent<MasterSuicideOnTimer>().lifeTimer = wormLifeDuration;
			if (NetworkServer.active)
			{
				for (int i = -1; i <= wormMaster.inventory.GetItemCount(Items.ExtraLife.itemIndex) + 1; i++)
				{
					wormMaster.inventory.RemoveItem(Items.ExtraLife.itemIndex, 1);
				}
				for (int j = 0; j <= wormMaster.inventory.GetItemCount(Items.ExtraLifeVoid.itemIndex) + 1; j++)
				{
					wormMaster.inventory.RemoveItem(Items.ExtraLifeVoid.itemIndex, 1);
				}
			}
			if (Object.op_Implicit((Object)(object)wormMaster.GetBody()))
			{
				GameObject bodyObject = wormMaster.GetBodyObject();
				WormHealthTracker wormHealthTracker = bodyObject.AddComponent<WormHealthTracker>();
				wormHealthTracker.owner = ((EntityState)this).gameObject;
				wormHealthTracker.wormSkill = src;
				wormHealthTracker.wormMaster = wormMaster;
				wormHealthTracker.cancelSkillDef = cancelSkillDef;
				wormHealthTracker.specialSlot = ((EntityState)this).skillLocator.special;
			}
		}

		private void SetupWorm(CharacterBody body)
		{
			body.statsDirty = true;
		}

		private void recalcWorm(CharacterBody body, StatHookEventArgs args)
		{
			//IL_0002: 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)
			if (body.bodyIndex == wormBody.bodyIndex)
			{
				args.baseHealthAdd -= wormBody.baseMaxHealth - ((EntityState)this).characterBody.baseMaxHealth * 3f;
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			specialSlot.UnsetSkillOverride((object)this, cancelSkillDef, (SkillOverridePriority)4);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}
	}
	public class Surge : BaseSkillState
	{
		private float duration = 1.5f;

		private float delay = 0.2f;

		public GameObject boltObject;

		public InputBankTest inputBank;

		public CharacterMaster master;

		public bool naturalEnd;

		private bool hasEffectiveAuthority;

		private GameObject boltVehicle;

		private VehicleSeat boltSeat;

		private GenericSkill utilitySlot;

		private NetworkBehaviour networkBehaviour;

		private float ageCheck;

		private AmpLightningController lightningController;

		private bool exitedEarly;

		public static SkillDef cancelSkillDef;

		private string prefix = "NT";

		private void UpdateAuthority()
		{
			hasEffectiveAuthority = Util.HasEffectiveAuthority(((EntityState)this).gameObject);
		}

		public override void OnEnter()
		{
			//IL_008b: 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_009f: 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_00ab: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			if (!NetworkServer.active)
			{
				return;
			}
			UpdateAuthority();
			lightningController = ((EntityState)this).GetComponent<AmpLightningController>();
			networkBehaviour = ((EntityState)this).GetComponent<NetworkBehaviour>();
			cancelSkillDef = Skills.surgeCancelSkillDef;
			utilitySlot = ((EntityState)this).skillLocator.utility;
			if (Object.op_Implicit((Object)(object)utilitySlot) && Object.op_Implicit((Object)(object)cancelSkillDef))
			{
				utilitySlot.SetSkillOverride((object)this, cancelSkillDef, (SkillOverridePriority)4);
			}
			Ray aimRay = ((BaseState)this).GetAimRay();
			boltObject = Object.Instantiate<GameObject>(lightningController.surgeVehicle, ((Ray)(ref aimRay)).origin, Quaternion.LookRotation(((Ray)(ref aimRay)).direction));
			boltObject.GetComponent<VehicleSeat>().AssignPassenger(((EntityState)this).gameObject);
			CharacterBody characterBody = ((EntityState)this).characterBody;
			NetworkUser val;
			if ((Object)(object)characterBody == (Object)null)
			{
				val = null;
			}
			else
			{
				CharacterMaster val2 = characterBody.master;
				if ((Object)(object)val2 == (Object)null)
				{
					val = null;
				}
				else
				{
					PlayerCharacterMasterController playerCharacterMasterCo