Decompiled source of Goku v2.12.2

PlayableGoku.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using EntityStates;
using KinematicCharacterController;
using NS_KingModUtilities;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.CharacterAI;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;
using Xft;

[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("PlayableGoku")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyProduct("PlayableGoku")]
[assembly: AssemblyTitle("PlayableGoku")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace NS_Goku;

public class GokuCharacterModelSwap : CharacterModelSwapBase
{
	protected override GameObject GetCharacterAssetPrefab()
	{
		return GokuAssets.LocalAssetBundle.LoadAsset<GameObject>(GokuCharacterRegistration.CharacterAssetPrefabName);
	}

	private void Start()
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		base.m_skinCount = 3;
		((CharacterModelSwapBase)this).InitCharacterModel(CharacterModDataManager.GetCharacterNameData(GokuCharacterRegistration.CharacterName));
	}

	protected override void OnDisplayModelEnter()
	{
		((CharacterModelSwapBase)this).OnDisplayModelEnter();
		MainPlugin.PlayVoiceSoundEvent(((Component)this).gameObject, GokuSounds.goku_select, 100);
	}

	private void UNetVersion()
	{
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		bool flag = ((CharacterModelSwapBase)this).OnSerialize(writer, forceAll);
		bool flag2 = default(bool);
		return flag2 || flag;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
		((CharacterModelSwapBase)this).OnDeserialize(reader, initialState);
	}
}
public class GokuDuoSkillHandler : DuoSkillHandler
{
	protected override uint GetRequestSoundID()
	{
		return GokuSounds.request_voice;
	}

	private void UNetVersion()
	{
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		bool flag = ((DuoSkillHandler)this).OnSerialize(writer, forceAll);
		bool flag2 = default(bool);
		return flag2 || flag;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
		((DuoSkillHandler)this).OnDeserialize(reader, initialState);
	}
}
public class GokuNetworkHandler : NetworkComponent
{
	private static int kCmdCmdSpawnSpiritBombExplosionFX;

	private static int kRpcRpcSpawnSpiritBombExplosionFX;

	private static int kCmdCmdSetLatestSpiritBombScale;

	private static int kRpcRpcSetLatestSpiritBombScale;

	[Command]
	private void CmdSpawnSpiritBombExplosionFX(string fxName, Vector3 pos, Quaternion rotation, float lifetime, float scaleValue)
	{
		//IL_0017: 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_000a: 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)
		if (!((NetworkComponent)this).IsAuthority())
		{
			InternalSpawnSpiritBombExplosion(fxName, pos, rotation, lifetime, scaleValue);
		}
		CallRpcSpawnSpiritBombExplosionFX(fxName, pos, rotation, lifetime, scaleValue);
	}

	[ClientRpc]
	private void RpcSpawnSpiritBombExplosionFX(string fxName, Vector3 pos, Quaternion rotation, float lifetime, float scaleValue)
	{
		//IL_000b: 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)
		if (!((NetworkComponent)this).IsServer())
		{
			InternalSpawnSpiritBombExplosion(fxName, pos, rotation, lifetime, scaleValue);
		}
	}

	private void InternalSpawnSpiritBombExplosion(string fxName, Vector3 pos, Quaternion rotation, float lifetime, float scaleValue)
	{
		//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_0045: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = GokuAssets.LocalAssetBundle.LoadAsset<GameObject>(fxName);
		SpiritbombSkill.ScaleSpiritBombFx(((Component)val.transform.Find("ElectricBall_Exp")).gameObject, scaleValue - 0.5f, scaleXffectComponent: true, scaleXffectLayer: false, scaleTransform: false);
		if ((Object)(object)val != (Object)null)
		{
			MainPlugin.SpawnFX(val, pos, rotation, lifetime);
			SpiritBombProjectile.DoCameraShake(pos, scaleValue);
		}
	}

	public void SpawnSpiritBombExplosionNetworked(GameObject fx, Vector3 pos, Quaternion rotation, float lifetime, float scaleValue)
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//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)
		if (((NetworkComponent)this).IsServer())
		{
			CallRpcSpawnSpiritBombExplosionFX(((Object)fx).name, pos, rotation, lifetime, scaleValue);
		}
		else
		{
			CallCmdSpawnSpiritBombExplosionFX(((Object)fx).name, pos, rotation, lifetime, scaleValue);
		}
	}

	[Command]
	private void CmdSetLatestSpiritBombScale(GameObject characterGO, float sbScaleValue)
	{
		if (!((NetworkComponent)this).IsAuthority())
		{
			characterGO.GetComponent<SpiritbombHandler>().m_latestScaleValue = sbScaleValue;
			CallRpcSetLatestSpiritBombScale(characterGO, sbScaleValue);
		}
	}

	[ClientRpc]
	private void RpcSetLatestSpiritBombScale(GameObject characterGO, float sbScaleValue)
	{
		if (!((NetworkComponent)this).IsAuthority())
		{
			characterGO.GetComponent<SpiritbombHandler>().m_latestScaleValue = sbScaleValue;
		}
	}

	public void SendLatestSpiritBombScale(GameObject characterGO, float sbScaleValue)
	{
		if (((NetworkComponent)this).IsServer())
		{
			CallRpcSetLatestSpiritBombScale(characterGO, sbScaleValue);
		}
		else
		{
			CallCmdSetLatestSpiritBombScale(characterGO, sbScaleValue);
		}
	}

	private void UNetVersion()
	{
	}

	protected static void InvokeCmdCmdSpawnSpiritBombExplosionFX(NetworkBehaviour obj, NetworkReader reader)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"Command CmdSpawnSpiritBombExplosionFX called on client.");
		}
		else
		{
			((GokuNetworkHandler)(object)obj).CmdSpawnSpiritBombExplosionFX(reader.ReadString(), reader.ReadVector3(), reader.ReadQuaternion(), reader.ReadSingle(), reader.ReadSingle());
		}
	}

	protected static void InvokeCmdCmdSetLatestSpiritBombScale(NetworkBehaviour obj, NetworkReader reader)
	{
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"Command CmdSetLatestSpiritBombScale called on client.");
		}
		else
		{
			((GokuNetworkHandler)(object)obj).CmdSetLatestSpiritBombScale(reader.ReadGameObject(), reader.ReadSingle());
		}
	}

	public void CallCmdSpawnSpiritBombExplosionFX(string fxName, Vector3 pos, Quaternion rotation, float lifetime, float scaleValue)
	{
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Expected O, but got Unknown
		//IL_0068: 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_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"Command function CmdSpawnSpiritBombExplosionFX called on server.");
			return;
		}
		if (((NetworkBehaviour)this).isServer)
		{
			CmdSpawnSpiritBombExplosionFX(fxName, pos, rotation, lifetime, scaleValue);
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)5);
		val.WritePackedUInt32((uint)kCmdCmdSpawnSpiritBombExplosionFX);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		val.Write(fxName);
		val.Write(pos);
		val.Write(rotation);
		val.Write(lifetime);
		val.Write(scaleValue);
		((NetworkBehaviour)this).SendCommandInternal(val, 0, "CmdSpawnSpiritBombExplosionFX");
	}

	public void CallCmdSetLatestSpiritBombScale(GameObject characterGO, float sbScaleValue)
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Expected O, but got Unknown
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"Command function CmdSetLatestSpiritBombScale called on server.");
			return;
		}
		if (((NetworkBehaviour)this).isServer)
		{
			CmdSetLatestSpiritBombScale(characterGO, sbScaleValue);
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)5);
		val.WritePackedUInt32((uint)kCmdCmdSetLatestSpiritBombScale);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		val.Write(characterGO);
		val.Write(sbScaleValue);
		((NetworkBehaviour)this).SendCommandInternal(val, 0, "CmdSetLatestSpiritBombScale");
	}

	protected static void InvokeRpcRpcSpawnSpiritBombExplosionFX(NetworkBehaviour obj, NetworkReader reader)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"RPC RpcSpawnSpiritBombExplosionFX called on server.");
		}
		else
		{
			((GokuNetworkHandler)(object)obj).RpcSpawnSpiritBombExplosionFX(reader.ReadString(), reader.ReadVector3(), reader.ReadQuaternion(), reader.ReadSingle(), reader.ReadSingle());
		}
	}

	protected static void InvokeRpcRpcSetLatestSpiritBombScale(NetworkBehaviour obj, NetworkReader reader)
	{
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"RPC RpcSetLatestSpiritBombScale called on server.");
		}
		else
		{
			((GokuNetworkHandler)(object)obj).RpcSetLatestSpiritBombScale(reader.ReadGameObject(), reader.ReadSingle());
		}
	}

	public void CallRpcSpawnSpiritBombExplosionFX(string fxName, Vector3 pos, Quaternion rotation, float lifetime, float scaleValue)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"RPC Function RpcSpawnSpiritBombExplosionFX called on client.");
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)2);
		val.WritePackedUInt32((uint)kRpcRpcSpawnSpiritBombExplosionFX);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		val.Write(fxName);
		val.Write(pos);
		val.Write(rotation);
		val.Write(lifetime);
		val.Write(scaleValue);
		((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcSpawnSpiritBombExplosionFX");
	}

	public void CallRpcSetLatestSpiritBombScale(GameObject characterGO, float sbScaleValue)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"RPC Function RpcSetLatestSpiritBombScale called on client.");
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)2);
		val.WritePackedUInt32((uint)kRpcRpcSetLatestSpiritBombScale);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		val.Write(characterGO);
		val.Write(sbScaleValue);
		((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcSetLatestSpiritBombScale");
	}

	static GokuNetworkHandler()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Expected O, but got Unknown
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Expected O, but got Unknown
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Expected O, but got Unknown
		kCmdCmdSpawnSpiritBombExplosionFX = -1821499929;
		NetworkBehaviour.RegisterCommandDelegate(typeof(GokuNetworkHandler), kCmdCmdSpawnSpiritBombExplosionFX, new CmdDelegate(InvokeCmdCmdSpawnSpiritBombExplosionFX));
		kCmdCmdSetLatestSpiritBombScale = -347630404;
		NetworkBehaviour.RegisterCommandDelegate(typeof(GokuNetworkHandler), kCmdCmdSetLatestSpiritBombScale, new CmdDelegate(InvokeCmdCmdSetLatestSpiritBombScale));
		kRpcRpcSpawnSpiritBombExplosionFX = 2072674877;
		NetworkBehaviour.RegisterRpcDelegate(typeof(GokuNetworkHandler), kRpcRpcSpawnSpiritBombExplosionFX, new CmdDelegate(InvokeRpcRpcSpawnSpiritBombExplosionFX));
		kRpcRpcSetLatestSpiritBombScale = -625142126;
		NetworkBehaviour.RegisterRpcDelegate(typeof(GokuNetworkHandler), kRpcRpcSetLatestSpiritBombScale, new CmdDelegate(InvokeRpcRpcSetLatestSpiritBombScale));
		NetworkCRC.RegisterBehaviour("GokuNetworkHandler", 0);
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		bool flag = ((NetworkComponent)this).OnSerialize(writer, forceAll);
		bool flag2 = default(bool);
		return flag2 || flag;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
		((NetworkComponent)this).OnDeserialize(reader, initialState);
	}
}
public class GokuTransformationData : CharacterTransformationData
{
	public override string GetTransformationSkillName(string transformationSkillNameID)
	{
		return transformationSkillNameID switch
		{
			"TSuperSaiyan" => "Angry Kamehameha", 
			"TSuperSaiyan2" => "Ki Blast Barrage", 
			"TSuperSaiyan3" => "Dragon Fist", 
			"TSuperSaiyanGod" => "God Bind", 
			"TSuperSaiyanBlue" => GodFistKamehamehaSkill.SkillName, 
			"TUltraInstinct" => "Godly Display", 
			"TSuperSaiyanGod3" => "Dragon Fist", 
			"TSuperSaiyanBlue3" => GodFistKamehamehaSkill.SkillName, 
			"TSuperSaiyanRose" => "Black Kamehameha", 
			"TSuperSaiyan4" => "Kamehameha x10", 
			"TSuperSaiyan5" => "White Dragon Fist", 
			_ => "None", 
		};
	}

	private void UNetVersion()
	{
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		bool flag = ((CharacterTransformationData)this).OnSerialize(writer, forceAll);
		bool flag2 = default(bool);
		return flag2 || flag;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
		((CharacterTransformationData)this).OnDeserialize(reader, initialState);
	}
}
public class GokuTransformationHandler : TransformationHandler
{
	public override void Init()
	{
		((TransformationHandler)this).Init();
		base.m_kaiokenEnabled = true;
	}

	protected override void OnTransformedFirstTime(MainTransformationState mTState)
	{
		if (mTState != null)
		{
			uint num = 0u;
			switch (((TransformationState)mTState).GetName())
			{
			case "Super Saiyan":
				num = GokuSounds.first_ssj;
				break;
			case "Super Saiyan 2":
				num = GokuSounds.first_ssj2;
				break;
			case "Super Saiyan 3":
				num = GokuSounds.first_ssj3;
				break;
			case "Super Saiyan God":
				num = GokuSounds.first_ssg;
				break;
			case "Super Saiyan Blue":
				num = GokuSounds.first_ssb;
				break;
			case "Ultra Instinct":
				num = GokuSounds.first_ui;
				break;
			case "Super Saiyan 4":
				num = GokuSounds.first_ssj4;
				break;
			}
			((CharacterModComponent)this).GetNetworkHandler().PlaySoundNetworked(((Component)this).gameObject, num, 100, true);
		}
	}

	protected override void OnStartTransforming(MainTransformationState mTState)
	{
		((CharacterModComponent)this).GetNetworkHandler().PlaySoundNetworked(((Component)this).gameObject, GokuSounds.medium_yell_voices, 100, true);
	}

	protected override void PlayTransformingKaiokenVoiceLine(KaiokenTransformationState kTState)
	{
		if (kTState != null)
		{
			uint num = 0u;
			switch (((TransformationState)kTState).GetName())
			{
			case "Kaioken":
				num = GokuSounds.kaioken_voice;
				break;
			case "Kaioken x3":
				num = GokuSounds.kaiokenx3_voice;
				break;
			case "Kaioken x10":
				num = ((!(((TransformationHandler)this).GetCurrentTransformationState((ETransformationType)0).GetName() == "Super Saiyan Blue")) ? GokuSounds.kaiokenx10_voice2 : GokuSounds.kaiokenx10_voice);
				break;
			case "Kaioken x20":
				num = GokuSounds.kaioken_scream_voice;
				break;
			}
			((CharacterModComponent)this).GetNetworkHandler().PlaySoundNetworked(((Component)this).gameObject, num, 100, true);
		}
	}

	private void UNetVersion()
	{
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		bool flag = ((TransformationHandler)this).OnSerialize(writer, forceAll);
		bool flag2 = default(bool);
		return flag2 || flag;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
		((TransformationHandler)this).OnDeserialize(reader, initialState);
	}
}
public class KaiokenHandler : CharacterModComponent
{
	private TransformationHandler m_transformationHandler;

	private KiHandler m_kiHandler;

	private float m_currentStrain;

	private float m_maxStrain = 8f;

	private const float m_baseMaxStrain = 0.5f;

	private const float m_maxStrainPerLevel = 1f;

	private float m_strainStunAttemptTimer;

	private const float m_strainStunAttemptInterval = 1f;

	private const float m_strainStunChance = 0.33f;

	public float GetCurrentStrain()
	{
		return m_currentStrain;
	}

	public float GetMaxStrain()
	{
		return m_maxStrain;
	}

	public float GetStrainRatio()
	{
		return m_currentStrain / m_maxStrain;
	}

	public float GetStrainPerSecondBasedOnCurrentTransformations()
	{
		float result = 0f;
		TransformationState currentTransformationState = m_transformationHandler.GetCurrentTransformationState((ETransformationType)0);
		MainTransformationState val = (MainTransformationState)(object)((currentTransformationState is MainTransformationState) ? currentTransformationState : null);
		TransformationState currentTransformationState2 = m_transformationHandler.GetCurrentTransformationState((ETransformationType)1);
		KaiokenTransformationState val2 = (KaiokenTransformationState)(object)((currentTransformationState2 is KaiokenTransformationState) ? currentTransformationState2 : null);
		if (val != null && val2 != null)
		{
			result = val2.GetStrainPerSecond() * val.GetStrainMult();
		}
		return result;
	}

	public void RecalculateMaxStrain()
	{
		MainPlugin.DebugLog("Max Strain Recalculated!");
		m_maxStrain = 0.5f + 1f * (float)(((RuntimeTransformationValues)(ref TransformationBank.GetRuntimeTransformationState(0).RuntimeValues)).GetCurrentLevel() - 1);
	}

	public void SetCurrentStrain(float val)
	{
		m_currentStrain = val;
		m_currentStrain = Mathf.Clamp(m_currentStrain, 0f, m_maxStrain);
	}

	public void AddCurrentStrain(float val)
	{
		SetCurrentStrain(m_currentStrain + val);
	}

	protected override bool InitUI()
	{
		if (UIManager.Get().FindHUDUIElement("UI_Kaioken") is UI_Kaioken uI_Kaioken && uI_Kaioken.Init(this))
		{
			return true;
		}
		return false;
	}

	public override void Init()
	{
		((CharacterModComponent)this).Init();
		m_transformationHandler = ((Component)this).GetComponent<TransformationHandler>();
		m_kiHandler = ((Component)this).GetComponent<KiHandler>();
	}

	protected override void OnFirstUpdate()
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Expected O, but got Unknown
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Expected O, but got Unknown
		((CharacterModComponent)this).OnFirstUpdate();
		if (((NetworkComponent)this).IsAuthority())
		{
			RecalculateMaxStrain();
			TransformationHandler transformationHandler = m_transformationHandler;
			transformationHandler.OnTransformationMasteryLevelUp_Delegate = (OnTransformationMasteryLevelUp_DelegateDeclaration)Delegate.Combine((Delegate?)(object)transformationHandler.OnTransformationMasteryLevelUp_Delegate, (Delegate?)new OnTransformationMasteryLevelUp_DelegateDeclaration(RecalculateMaxStrain));
		}
	}

	private void OnDestroy()
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Expected O, but got Unknown
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Expected O, but got Unknown
		if (((NetworkComponent)this).IsAuthority())
		{
			TransformationHandler transformationHandler = m_transformationHandler;
			transformationHandler.OnTransformationMasteryLevelUp_Delegate = (OnTransformationMasteryLevelUp_DelegateDeclaration)Delegate.Remove((Delegate?)(object)transformationHandler.OnTransformationMasteryLevelUp_Delegate, (Delegate?)new OnTransformationMasteryLevelUp_DelegateDeclaration(RecalculateMaxStrain));
		}
	}

	protected override void InternalUpdate()
	{
		if (((NetworkComponent)this).IsAuthority())
		{
			if (m_transformationHandler.IsTransformationActive((ETransformationType)1, false))
			{
				OnUpdateKaiokenTransformations();
			}
			else
			{
				AddCurrentStrain(0f - Time.deltaTime);
			}
		}
	}

	private void OnUpdateKaiokenTransformations()
	{
		float strainPerSecondBasedOnCurrentTransformations = GetStrainPerSecondBasedOnCurrentTransformations();
		TransformationState currentTransformationState = m_transformationHandler.GetCurrentTransformationState((ETransformationType)1);
		KaiokenTransformationState val = (KaiokenTransformationState)(object)((currentTransformationState is KaiokenTransformationState) ? currentTransformationState : null);
		if (val == null)
		{
			return;
		}
		if (!((CharacterModComponent)this).IsInTransformingCutscene())
		{
			if (GetCurrentStrain() >= m_maxStrain)
			{
				if (m_strainStunAttemptTimer > 1f)
				{
					m_strainStunAttemptTimer = 0f;
					if (Random.Range(0f, 1f) < 0.33f && ((CharacterModComponent)this).CanBeStunned())
					{
						SetCurrentStrain(0f);
						((CharacterModComponent)this).StunSelf(strainPerSecondBasedOnCurrentTransformations);
						m_transformationHandler.ResetTransformations(true, true, true, true);
					}
				}
				else
				{
					m_strainStunAttemptTimer += Time.deltaTime;
				}
			}
			else
			{
				AddCurrentStrain(strainPerSecondBasedOnCurrentTransformations * Time.deltaTime);
			}
		}
		if ((Object)(object)m_kiHandler != (Object)null)
		{
			m_kiHandler.AddCurrentKi(val.GetBonusKiRegenPerSecond() * Time.deltaTime);
		}
	}

	private void UNetVersion()
	{
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		bool flag = ((CharacterModComponent)this).OnSerialize(writer, forceAll);
		bool flag2 = default(bool);
		return flag2 || flag;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
		((CharacterModComponent)this).OnDeserialize(reader, initialState);
	}
}
public class SpiritbombHandler : CharacterModComponent
{
	public float m_latestScaleValue = 1f;

	public override void Init()
	{
		((CharacterModComponent)this).Init();
	}

	protected override void InternalUpdate()
	{
		((NetworkComponent)this).IsAuthority();
	}

	private void UNetVersion()
	{
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		bool flag = ((CharacterModComponent)this).OnSerialize(writer, forceAll);
		bool flag2 = default(bool);
		return flag2 || flag;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
		((CharacterModComponent)this).OnDeserialize(reader, initialState);
	}
}
public class DuoFinalKamehamehaSkill_Goku : DuoFinalKamehamehaSkill
{
	private GameObject currentChargeFX;

	private bool m_spawnedChargeFX;

	public override void OnEnter()
	{
		((DuoFinalKamehamehaSkill)this).OnEnter();
		_ = ((EntityState)this).isAuthority;
	}

	private void SpawnChargeFX()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		currentChargeFX = MainPlugin.SpawnFX(GokuAssets.GodFistKamehamehaChargeFX, Vector3.zero, Quaternion.identity, -1f);
	}

	protected override Vector3 GetMoveToPositionOffset()
	{
		//IL_0001: 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)
		return ((DuoFinalKamehamehaSkill)this).GetMoveToPositionOffset() * -1f;
	}

	public override void Update()
	{
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		((DuoFinalKamehamehaSkill)this).Update();
		if (!m_spawnedChargeFX && ((EntityState)this).fixedAge > 3f)
		{
			m_spawnedChargeFX = true;
			SpawnChargeFX();
		}
		if (Object.op_Implicit((Object)(object)currentChargeFX) && ((CharacterModSkillState)this).HasValidHandBones())
		{
			currentChargeFX.transform.position = ((CharacterModSkillState)this).GetCentreHandsPosition();
		}
		_ = ((EntityState)this).isAuthority;
	}

	public override void OnExit()
	{
		((DuoFinalKamehamehaSkill)this).OnExit();
		if (Object.op_Implicit((Object)(object)currentChargeFX))
		{
			EntityState.Destroy((Object)(object)currentChargeFX);
		}
		currentChargeFX = null;
		_ = ((EntityState)this).isAuthority;
	}
}
public class GokuMeleeStrikeSkill : MeleeStrikeSkill
{
	public static string GetSkillDescription()
	{
		return MeleeStrikeSkill.GetBaseSkillDescription() + "\n" + string.Format(MainPlugin.ColorText("Teleports instead if ", "#03f4fc") + MainPlugin.ColorText("Kaioken", "#FF5400") + MainPlugin.ColorText(" is active!", "#03f4fc"));
	}

	public override void OnEnter()
	{
		((MeleeStrikeSkill)this).OnEnter();
		((CharacterModSkillState)this).m_animationSpeedMulti = 0.75f;
	}

	protected override string ConstructMeleeAttackAnimName(int num)
	{
		if (num < 10)
		{
			return $"GOK_BAS_BONE|GOK_BAS_BONE|GOK_ATC_00{num}|GOK_ATC_00{num}_Layer0";
		}
		return $"GOK_BAS_BONE|GOK_BAS_BONE|GOK_ATC_0{num}|GOK_ATC_0{num}_Layer0";
	}

	protected override uint GetSwingVoiceSoundID(int voiceIdx)
	{
		uint result = 0u;
		switch (voiceIdx)
		{
		case 0:
			result = GokuSounds.primary_swing_voice_0;
			break;
		case 1:
			result = GokuSounds.primary_swing_voice_1;
			break;
		case 2:
			result = GokuSounds.primary_swing_voice_2;
			break;
		}
		return result;
	}

	protected override void InitMeleeAttackData()
	{
		//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_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//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_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_0138: Unknown result type (might be due to invalid IL or missing references)
		base.m_meleeAttacks = (NewMeleeAttackData[])(object)new NewMeleeAttackData[7]
		{
			new NewMeleeAttackData(((MeleeStrikeSkill)this).ConstructMeleeAttackAnimStateName(0), ((MeleeStrikeSkill)this).ConstructMeleeAttackAnimName(0), 0, BaseSounds.primary_swing_0, 0, 0.21f, 0.25f, true),
			new NewMeleeAttackData(((MeleeStrikeSkill)this).ConstructMeleeAttackAnimStateName(1), ((MeleeStrikeSkill)this).ConstructMeleeAttackAnimName(1), 0, BaseSounds.primary_swing_0, 1, 0.25f, 0.25f, false),
			new NewMeleeAttackData(((MeleeStrikeSkill)this).ConstructMeleeAttackAnimStateName(2), ((MeleeStrikeSkill)this).ConstructMeleeAttackAnimName(2), 0, BaseSounds.primary_swing_0, 0, 0.29f, 0.25f, true),
			new NewMeleeAttackData(((MeleeStrikeSkill)this).ConstructMeleeAttackAnimStateName(3), ((MeleeStrikeSkill)this).ConstructMeleeAttackAnimName(3), 0, BaseSounds.primary_swing_0, 1, 0.16f, 0.25f, false),
			new NewMeleeAttackData(((MeleeStrikeSkill)this).ConstructMeleeAttackAnimStateName(4), ((MeleeStrikeSkill)this).ConstructMeleeAttackAnimName(7), 0, BaseSounds.primary_swing_0, 0, 0.31f, 0.25f, true),
			new NewMeleeAttackData(((MeleeStrikeSkill)this).ConstructMeleeAttackAnimStateName(5), ((MeleeStrikeSkill)this).ConstructMeleeAttackAnimName(12), 0, BaseSounds.primary_swing_0, 1, 0.28f, 0.25f, false),
			new NewMeleeAttackData(((MeleeStrikeSkill)this).ConstructMeleeAttackAnimStateName(6), ((MeleeStrikeSkill)this).ConstructMeleeAttackAnimName(13), 0, BaseSounds.primary_swing_0, 2, 0.28f, 0.25f, false)
		};
	}

	protected override void LockHipPosition()
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		((CharacterModSkillState)this).m_characterModelSwap.SetLockHipPosition(true, new Vector3(0f, 1.2f, 0f), true);
	}
}
internal struct MeleeAttackData
{
	public string AnimStateName;

	public string AnimName;

	public uint SwingSoundID;

	public uint SwingVoiceSoundID;

	public float AnimTimeUntilHit;

	public int AnimLayer;

	public MeleeAttackData(string NewAnimStateName, string NewAnimName, int NewAnimLayer, uint NewSwingSoundID, uint NewSwingVoiceSoundID, float NewAnimTimeUntilHit)
	{
		AnimStateName = NewAnimStateName;
		AnimName = NewAnimName;
		AnimLayer = NewAnimLayer;
		SwingSoundID = NewSwingSoundID;
		SwingVoiceSoundID = NewSwingVoiceSoundID;
		AnimTimeUntilHit = NewAnimTimeUntilHit;
	}
}
public class TripleKickSkill : CharacterModSkillState
{
	public const string m_skillName = "Triple Kick (Legacy)";

	private MeleeAttackData[] m_meleeAttacks;

	private float groundedForwardOffset = 1f;

	private float groundedRadius = 3.2f;

	private float groundedMaxYDiff = 3f;

	private static float groundedDamage = 2.6f;

	private float groundedCoef = 1f;

	private float m_attackTimer;

	private int m_attackIndex;

	private bool m_nextAttackAvailable = true;

	private bool m_damageApplied;

	private const float m_kiGainPercentPerHit = 0.05f;

	private const int m_swingVoiceChance = 33;

	private float currentAnimDuration;

	public override void OnEnter()
	{
		((CharacterModSkillState)this).OnEnter();
		if (((EntityState)this).isAuthority)
		{
			if (m_meleeAttacks == null)
			{
				m_meleeAttacks = new MeleeAttackData[3]
				{
					new MeleeAttackData("Primary_Ability_0", "RMidKick", 0, BaseSounds.primary_swing_0, 0u, 0.32f),
					new MeleeAttackData("Primary_Ability_1", "RhiKick", 0, BaseSounds.primary_swing_1, 0u, 0.3f),
					new MeleeAttackData("Primary_Ability_2", "HMAWAK", 0, BaseSounds.primary_swing_2, 0u, 0.35f)
				};
			}
			base.m_animationSpeedMulti = 0.92f;
			base.m_skillAttackSpeedCap = 3f;
			m_attackIndex = 0;
			base.m_allowHover = true;
			DoAttack();
		}
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			((CharacterModSkillState)this).ProcessMainStateMovement(true);
			if (m_attackTimer >= currentAnimDuration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}
	}

	public override void Update()
	{
		((EntityState)this).Update();
		if (!((EntityState)this).isAuthority)
		{
			return;
		}
		if (m_nextAttackAvailable && ((EntityState)this).inputBank.skill1.down)
		{
			DoAttack();
		}
		if (m_attackIndex < m_meleeAttacks.Length)
		{
			if (!m_damageApplied)
			{
				if (m_attackTimer > currentAnimDuration * m_meleeAttacks[m_attackIndex].AnimTimeUntilHit)
				{
					ApplyDamage();
				}
			}
			else if (!m_nextAttackAvailable && m_attackTimer > currentAnimDuration * (m_meleeAttacks[m_attackIndex].AnimTimeUntilHit + currentAnimDuration * 0.25f))
			{
				m_nextAttackAvailable = true;
				m_attackIndex++;
				if ((Object)(object)((CharacterModSkillState)this).GetTransformationHandler() != (Object)null && ((CharacterModSkillState)this).GetTransformationHandler().IsTransformationActive((ETransformationType)1, false) && m_attackIndex == m_meleeAttacks.Length)
				{
					m_attackIndex = 0;
				}
			}
		}
		m_attackTimer += Time.deltaTime;
	}

	public static string GetDisplayBaseDamage()
	{
		return (groundedDamage * 100f).ToString();
	}

	public static string GetSkillDescription()
	{
		return string.Format("Unleashes a trio of kicks! \nDealing " + MainPlugin.CreateDamageDescription(GetDisplayBaseDamage()) + " each!\nGain " + MainPlugin.ColorText(5f + "% Ki", "#03bcff") + " Per Hit!");
	}

	private void DoAttack()
	{
		if (m_nextAttackAvailable && m_attackIndex < m_meleeAttacks.Length)
		{
			MeleeAttackData meleeAttackData = m_meleeAttacks[m_attackIndex];
			currentAnimDuration = ((CharacterModSkillState)this).GetAnimationTime(meleeAttackData.AnimName);
			((BaseState)this).StartAimMode(currentAnimDuration, false);
			((CharacterModSkillState)this).PlaySkillAnimation(meleeAttackData.AnimStateName, 0.15f, meleeAttackData.AnimLayer, true, true);
			((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((Component)((EntityState)this).characterBody).gameObject, meleeAttackData.SwingSoundID, 100, false);
			((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((Component)((EntityState)this).characterBody).gameObject, meleeAttackData.SwingVoiceSoundID, 33, true);
			m_nextAttackAvailable = false;
			m_damageApplied = false;
			m_attackTimer = 0f;
		}
	}

	private void ApplyDamage(bool lastHit = false)
	{
		//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_0030: 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_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: 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_0091: 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_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		bool flag = m_attackIndex != 0 && m_attackIndex % 2 != 0;
		Vector3 aimRayDirection = ((CharacterModSkillState)this).GetAimRayDirection();
		aimRayDirection.y = 0f;
		Vector3 val = ((EntityState)this).transform.position + (Vector3)(flag ? new Vector3(0f, 1f, 0f) : Vector3.zero);
		Quaternion val2 = Quaternion.LookRotation(aimRayDirection, Vector3.up) * Quaternion.Euler(0f, 0f, (float)(flag ? 180 : 0));
		((CharacterModSkillState)this).GetNetworkHandler().SpawnFXNetworked(BaseAssets.PrimaryAttackFX, val, val2, 2f, -1f, false);
		MainPlugin.SpawnFX(BaseAssets.PrimaryAttackFX, val, val2, 2f).transform.SetParent(((EntityState)this).transform);
		Collider[] array = CollectEnemies(groundedRadius, ((EntityState)this).transform.position + ((EntityState)this).characterDirection.forward * groundedForwardOffset, groundedMaxYDiff);
		if (ColliderDamage(array, groundedDamage, groundedCoef))
		{
			MainPlugin.PlaySoundEvent(((Component)((EntityState)this).characterBody).gameObject, BaseSounds.melee_hit, 100);
			((CharacterModSkillState)this).GetKiHandler().AddCurrentKi(0.05f * ((CharacterModSkillState)this).GetKiHandler().GetMaxKi());
		}
		m_damageApplied = true;
	}

	private Collider[] CollectEnemies(float radius, Vector3 position, float maxYDiff)
	{
		//IL_0014: 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_001e: Unknown result type (might be due to invalid IL or missing references)
		LayerIndex entityPrecise = LayerIndex.entityPrecise;
		return (from x in Physics.OverlapSphere(position, radius, LayerMask.op_Implicit(((LayerIndex)(ref entityPrecise)).mask))
			where Mathf.Abs(x.ClosestPoint(((EntityState)this).transform.position).y - ((EntityState)this).transform.position.y) <= maxYDiff
			select x).ToArray();
	}

	private bool ColliderDamage(Collider[] array, float damageMulti, float coeff)
	{
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Expected O, but got Unknown
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		IEnumerable<Collider> enumerable = array.Where((Collider x) => (Object)(object)((Component)x).GetComponent<HurtBox>() != (Object)null);
		List<HurtBoxGroup> list = new List<HurtBoxGroup>();
		foreach (Collider item in enumerable)
		{
			HurtBox hurtBox2 = ((Component)item).GetComponentInChildren<HurtBox>();
			if (!((Object)(object)hurtBox2 == (Object)null) && !((Object)(object)hurtBox2.healthComponent == (Object)(object)((EntityState)this).healthComponent) && list.Where((HurtBoxGroup x) => (Object)(object)x == (Object)(object)hurtBox2.hurtBoxGroup).Count() <= 0 && (hurtBox2.teamIndex != ((EntityState)this).teamComponent.teamIndex || (int)FriendlyFireManager.friendlyFireMode != 0))
			{
				_ = hurtBox2;
				list.Add(hurtBox2.hurtBoxGroup);
				DamageInfo val = new DamageInfo();
				val.damage = ((BaseState)this).damageStat * damageMulti;
				val.attacker = ((EntityState)this).gameObject;
				val.procCoefficient = coeff;
				val.position = ((Component)hurtBox2).transform.position;
				val.crit = ((BaseState)this).RollCrit();
				((CharacterModSkillState)this).GetNetworkHandler().ApplyDamageNetworked(val, ((Component)hurtBox2.healthComponent).gameObject);
				Vector3 val2 = hurtBox2.collider.ClosestPoint(((EntityState)this).transform.position);
				MainPlugin.SpawnFX(BaseAssets.HitFX, val2, Quaternion.identity, 1f);
			}
		}
		if (list == null)
		{
			return false;
		}
		return list.Count() > 0;
	}

	public override void OnExit()
	{
		if (((EntityState)this).isAuthority)
		{
			((CharacterModSkillState)this).PlaySkillAnimation("Idle", 0.15f, 0, true, true);
			MainPlugin.DebugLog("TripleKick OnExit()!");
		}
		((CharacterModSkillState)this).ResetMainStateMovement();
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		return (InterruptPriority)3;
	}
}
public class KiblastSkill : CharacterModSkillState
{
	public static string m_skillName = "Ki Blast";

	private GokuCharacterModelSwap thisCharacter;

	private string animationName_kiblast = "KiBlastSingleAnim";

	public const string KiblastProjectileName = "KiBlastProjectile";

	public const float kibastCollisionRadius = 0.8f;

	public const float kiblastBaseDamageMult = 2.5f;

	public float kiblastProjectileSpeed = 110f;

	public float kiblastCoeff = 1f;

	private Transform m_handRightBone;

	private Transform m_handLeftBone;

	private float m_currentAnimDuration = 999.9f;

	private float m_currentDirectionY = 90f;

	private float m_targetRotationY = 90f;

	private bool HasValidHandBones()
	{
		if ((Object)(object)m_handRightBone != (Object)null)
		{
			return (Object)(object)m_handLeftBone != (Object)null;
		}
		return false;
	}

	public static string GetSkillDescription()
	{
		return string.Format(MainPlugin.CreateKiCostDescription("6") + "\nFire off a speedy Ki Blast! \n" + MainPlugin.ColorText("Holding this skill fires an additional blast ", "#03f4fc") + "\nDealing " + MainPlugin.CreateDamageDescription(GetDisplayBaseDamage()) + " for each one!\n");
	}

	public static string GetDisplayBaseDamage()
	{
		return 250f.ToString();
	}

	public override void OnEnter()
	{
		((CharacterModSkillState)this).OnEnter();
		if (((EntityState)this).isAuthority)
		{
			base.m_animationSpeedMulti = 0.35f;
			base.m_skillAttackSpeedCap = 8f;
			m_currentAnimDuration = ((CharacterModSkillState)this).GetAnimationTime(animationName_kiblast);
			((CharacterModSkillState)this).PlaySkillAnimation("Kiblast_Skill_0", 0f, 1, true, true);
			((BaseState)this).StartAimMode(1f, false);
			m_handRightBone = ((EntityState)this).characterDirection.modelAnimator.GetBoneTransform((HumanBodyBones)18);
			m_handLeftBone = ((EntityState)this).characterDirection.modelAnimator.GetBoneTransform((HumanBodyBones)17);
			thisCharacter = ((EntityState)this).gameObject.GetComponentInChildren<GokuCharacterModelSwap>();
			((MonoBehaviour)thisCharacter).StartCoroutine(MainCoroutine());
			base.m_allowHover = true;
		}
	}

	public override void FixedUpdate()
	{
		//IL_0011: 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_002c: 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_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_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			Vector3 val = MainPlugin.RotateAroundPoint(Vector3.zero, ((CharacterModSkillState)this).GetAimRayDirection(), Quaternion.Euler(0f, m_currentDirectionY, 0f));
			base.m_characterModelSwap.SetChestTargetLookAt(((EntityState)this).transform.position + val * 10f);
			((CharacterModSkillState)this).ProcessMainStateMovement(true);
			if (((EntityState)this).fixedAge >= m_currentAnimDuration * 1f)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
			else
			{
				m_currentDirectionY = Mathf.Lerp(m_currentDirectionY, m_targetRotationY, Time.deltaTime * 10f);
			}
		}
	}

	private IEnumerator MainCoroutine()
	{
		yield return (object)new WaitForSeconds(m_currentAnimDuration * 0.21f);
		FireKiblast(isRight: true);
		yield return (object)new WaitForSeconds(m_currentAnimDuration * 0.15f);
		bool flag = false;
		if (((EntityState)this).inputBank.skill2.down)
		{
			flag = true;
		}
		if (flag)
		{
			m_currentAnimDuration += m_currentAnimDuration;
			m_targetRotationY = 270f;
			((CharacterModSkillState)this).PlaySkillAnimation("Kiblast_Skill_1", 0.25f, 1, true, true);
			yield return (object)new WaitForSeconds(m_currentAnimDuration * 0.21f);
			FireKiblast(isRight: false);
		}
	}

	private void FireKiblast(bool isRight)
	{
		//IL_0000: 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)
		//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_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: 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_0115: 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_011a: 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_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: 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_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0166: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = Vector3.zero;
		if ((Object)(object)((EntityState)this).transform.Find("ModelBase") != (Object)null)
		{
			val = ((EntityState)this).transform.position + new Vector3(0f, 1f, 0f) + ((EntityState)this).characterDirection.forward / 2f;
		}
		Quaternion val2 = Util.QuaternionSafeLookRotation(((CharacterModSkillState)this).GetAimRayDirection());
		GameObject projectilePrefab = ProjectileCatalog.GetProjectilePrefab(ProjectileCatalog.FindProjectileIndex("KiBlastProjectile"));
		if ((Object)(object)projectilePrefab != (Object)null)
		{
			ProjectileManager.instance.FireProjectile(projectilePrefab, val, val2, ((EntityState)this).gameObject, ((BaseState)this).damageStat * 2.5f, 1f, Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, kiblastProjectileSpeed, (DamageTypeCombo?)null);
			((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((Component)((EntityState)this).characterBody).gameObject, BaseSounds.kiblast_fire, 100, false);
		}
		Vector3 aimRayDirection = ((CharacterModSkillState)this).GetAimRayDirection();
		aimRayDirection.y = 0f;
		Vector3 val3 = (isRight ? m_handRightBone.position : m_handLeftBone.position);
		Quaternion val4 = Quaternion.LookRotation(aimRayDirection, Vector3.up) * Quaternion.Euler(0f, 0f, 0f);
		((CharacterModSkillState)this).GetNetworkHandler().SpawnFXNetworked(GokuAssets.KiBlastFireFX, val3, val4, 1f, -1f, false);
		MainPlugin.SpawnFX(GokuAssets.KiBlastFireFX, val3, val4, 1f).transform.SetParent(((EntityState)this).transform);
	}

	public override void OnExit()
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		if (((EntityState)this).isAuthority)
		{
			((CharacterModSkillState)this).ResetMainStateMovement();
			((CharacterModSkillState)this).PlaySkillAnimation("UpperIdle", 0f, 1, true, true);
			base.m_characterModelSwap.SetChestTargetLookAt(Vector3.zero);
		}
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		return (InterruptPriority)7;
	}
}
public class MeteorCrashSkill : CharacterModSkillState
{
	public static string m_skillName = "Meteor Crash";

	private static float m_damagePerHitPercent = KingUtil.PercentToMult(340);

	private float groundedForwardOffset = 1f;

	private float groundedRadius = 2.5f;

	private float groundedMaxYDiff = 3f;

	private float groundedCoef = 0.75f;

	private float m_skillMovementSpeed = 15.5f;

	private float m_minTimeExecuting = 1f;

	private string m_startAnimName = "MeteorCrash_0";

	private string m_endAnimName = "MeteorCrash_End";

	private float m_attackTimerMax = 0.22f;

	private float m_attackTimer;

	public static float m_kiCostPercentPerSecond = 0.1f;

	public static float m_startKiCost = 20f;

	private GameObject m_loopingFX;

	private bool m_shouldFinish;

	private float m_timeFinished;

	private Vector3 m_directionFinished = Vector3.zero;

	public const string m_bsbName = "MeteorCrashBonus";

	private const float m_baseArmorAdd = 40f;

	private float currentAnimDuration;

	private void ResetAttackTimer()
	{
		m_attackTimer = m_attackTimerMax;
	}

	public override void OnEnter()
	{
		//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_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_0074: Unknown result type (might be due to invalid IL or missing references)
		((CharacterModSkillState)this).OnEnter();
		base.m_animationSpeedMulti = 1f;
		base.m_skillAttackSpeedCap = 3f;
		if (((EntityState)this).isAuthority)
		{
			((CharacterModSkillState)this).PlaySkillAnimation(m_startAnimName, 0f, 0, true, true);
			((CharacterModSkillState)this).AddGravityDisableCounter();
			BonusStatBundle val = default(BonusStatBundle);
			((BonusStatBundle)(ref val))..ctor("MeteorCrashBonus", (GameObject)null, 0f);
			BonusStat val2 = new BonusStat("armor", 40f, 0f);
			((BonusStatBundle)(ref val)).AddBonusStat(ref val2);
			((CharacterModSkillState)this).GetBonusStatHandler().AddBonusStatBundle(val);
		}
		MainPlugin.PlayVoiceSoundEvent(((EntityState)this).gameObject, GokuSounds.meteorcrash_voices, 70);
		m_loopingFX = MainPlugin.SpawnFX(GokuAssets.MeteorCrashFX, ((EntityState)this).transform.position, Quaternion.identity, -1f);
	}

	private float GetAttackSpeedScale()
	{
		return 1f + (((EntityState)this).characterBody.attackSpeed - 1f) * 0.5f;
	}

	public override void Update()
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_021c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0221: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0262: Unknown result type (might be due to invalid IL or missing references)
		//IL_0267: Unknown result type (might be due to invalid IL or missing references)
		//IL_0271: Unknown result type (might be due to invalid IL or missing references)
		//IL_0281: Unknown result type (might be due to invalid IL or missing references)
		//IL_0286: Unknown result type (might be due to invalid IL or missing references)
		//IL_028b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).Update();
		if (!m_shouldFinish)
		{
			if ((Object)(object)m_loopingFX != (Object)null)
			{
				m_loopingFX.transform.position = ((EntityState)this).transform.position + ((CharacterModSkillState)this).GetAimRayDirectionXZ();
				m_loopingFX.transform.rotation = Quaternion.LookRotation(((CharacterModSkillState)this).GetAimRayDirectionXZ(), Vector3.up);
			}
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).characterMotor.velocity = ((CharacterModSkillState)this).GetAimRayDirection() * (ShouldStopMoving() ? 0f : Mathf.Max(m_skillMovementSpeed, ((EntityState)this).characterBody.moveSpeed));
				if (m_attackTimer > 0f)
				{
					m_attackTimer -= Time.deltaTime * GetAttackSpeedScale();
				}
				else
				{
					ApplyDamage();
					ResetAttackTimer();
					((CharacterModSkillState)this).GetAnimationTime(((Object)((AnimatorClipInfo)(ref ((EntityState)this).characterDirection.modelAnimator.GetCurrentAnimatorClipInfo(0)[0])).clip).name);
					((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((EntityState)this).gameObject, BaseSounds.swings, 100, false);
				}
				((BaseState)this).StartAimMode(1f, true);
				if (((EntityState)this).characterMotor.isGrounded)
				{
					((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
				}
				if (((EntityState)this).fixedAge >= m_minTimeExecuting)
				{
					float num = ((CharacterModSkillState)this).GetKiHandler().GetMaxKi() * m_kiCostPercentPerSecond * ((BaseSkillState)this).activatorSkillSlot.cooldownScale * Time.deltaTime;
					((CharacterModSkillState)this).GetKiHandler().AddCurrentKi(0f - num);
				}
				if (((CharacterModSkillState)this).GetKiHandler().GetCurrentKi() <= 0f || (!((EntityState)this).inputBank.skill2.down && ((EntityState)this).fixedAge >= m_minTimeExecuting))
				{
					OnMeteorCrashFinish();
				}
			}
		}
		else
		{
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			float num2 = 0.8f;
			float num3 = m_timeFinished + num2 - Time.time;
			num3 = Mathf.Clamp(num3, 0f, num3);
			if (Time.time > m_timeFinished + num2)
			{
				((EntityState)this).outer.SetNextStateToMain();
				return;
			}
			((EntityState)this).characterDirection.moveVector = m_directionFinished;
			if (((EntityState)this).characterMotor.isGrounded)
			{
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
			}
			float num4 = Mathf.Lerp(-20f, 20f, num3 / num2);
			((EntityState)this).characterMotor.velocity = -m_directionFinished * 15f + new Vector3(0f, num4, 0f);
		}
	}

	public static string GetDisplayBaseDamage()
	{
		return (m_damagePerHitPercent * 100f).ToString();
	}

	public static string GetSkillDescription()
	{
		return string.Format(MainPlugin.CreateKiCostDescription(m_startKiCost.ToString()) + "\nRapidly unleash a barrage of strikes! \nDealing " + MainPlugin.CreateDamageDescription((m_damagePerHitPercent * 100f).ToString()) + " for each one!\n" + MainPlugin.ColorText("Holding this skill drains ", "#03f4fc") + MainPlugin.ColorText(KingUtil.MultToPercent(m_kiCostPercentPerSecond) + "% Ki ", "#03bcff") + MainPlugin.ColorText("per second.", "#03f4fc"));
	}

	private void OnMeteorCrashFinish()
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		m_shouldFinish = true;
		m_timeFinished = Time.time;
		m_directionFinished = ((CharacterModSkillState)this).GetAimRayDirectionXZ();
		if ((Object)(object)m_loopingFX != (Object)null)
		{
			EntityState.Destroy((Object)(object)m_loopingFX);
		}
		((CharacterModSkillState)this).PlaySkillAnimation(m_endAnimName, 0f, 0, true, true);
		MainPlugin.PlaySoundEvent(((EntityState)this).gameObject, BaseSounds.jump, 100);
	}

	private bool ShouldStopMoving()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		Collider[] source = CollectEnemies(1f, ((EntityState)this).transform.position, groundedMaxYDiff);
		source.Where((Collider x) => (Object)(object)((Component)x).GetComponent<HurtBox>() != (Object)null);
		return source.Where((Collider x) => ((Component)x).GetComponent<HurtBox>().teamIndex != ((EntityState)this).teamComponent.teamIndex).Count() > 0;
	}

	private bool ApplyDamage()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: 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_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: 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_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		bool result = false;
		Vector3 aimRayDirection = ((CharacterModSkillState)this).GetAimRayDirection();
		aimRayDirection.y = 0f;
		Vector3 position = ((EntityState)this).transform.position;
		Quaternion val = Quaternion.LookRotation(aimRayDirection, Vector3.up) * Quaternion.Euler(0f, 0f, (float)Random.Range(0, 360));
		MainPlugin.SpawnFX(BaseAssets.PrimaryAttackFX, position, val, 2f).transform.SetParent(((EntityState)this).transform);
		Collider[] array = CollectEnemies(groundedRadius, ((EntityState)this).transform.position + ((EntityState)this).characterDirection.forward * groundedForwardOffset, groundedMaxYDiff);
		if (ColliderDamage(array, m_damagePerHitPercent, groundedCoef))
		{
			MainPlugin.PlaySoundEvent(((Component)((EntityState)this).characterBody).gameObject, BaseSounds.melee_hit, 100);
			result = true;
		}
		return result;
	}

	private Collider[] CollectEnemies(float radius, Vector3 position, float maxYDiff)
	{
		//IL_0014: 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_001e: Unknown result type (might be due to invalid IL or missing references)
		LayerIndex entityPrecise = LayerIndex.entityPrecise;
		return (from x in Physics.OverlapSphere(position, radius, LayerMask.op_Implicit(((LayerIndex)(ref entityPrecise)).mask))
			where Mathf.Abs(x.ClosestPoint(((EntityState)this).transform.position).y - ((EntityState)this).transform.position.y) <= maxYDiff
			select x).ToArray();
	}

	private bool ColliderDamage(Collider[] array, float damageMulti, float coeff)
	{
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Expected O, but got Unknown
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		IEnumerable<Collider> enumerable = array.Where((Collider x) => (Object)(object)((Component)x).GetComponent<HurtBox>() != (Object)null);
		List<HurtBoxGroup> list = new List<HurtBoxGroup>();
		foreach (Collider item in enumerable)
		{
			HurtBox hurtBox2 = ((Component)item).GetComponentInChildren<HurtBox>();
			if (!((Object)(object)hurtBox2 == (Object)null) && !((Object)(object)hurtBox2.healthComponent == (Object)(object)((EntityState)this).healthComponent) && list.Where((HurtBoxGroup x) => (Object)(object)x == (Object)(object)hurtBox2.hurtBoxGroup).Count() <= 0 && (hurtBox2.teamIndex != ((EntityState)this).teamComponent.teamIndex || (int)FriendlyFireManager.friendlyFireMode != 0))
			{
				_ = hurtBox2;
				list.Add(hurtBox2.hurtBoxGroup);
				DamageInfo val = new DamageInfo();
				val.damage = ((BaseState)this).damageStat * damageMulti;
				val.attacker = ((EntityState)this).gameObject;
				val.procCoefficient = coeff;
				val.position = ((Component)hurtBox2).transform.position;
				val.crit = ((BaseState)this).RollCrit();
				((CharacterModSkillState)this).GetNetworkHandler().ApplyDamageNetworked(val, ((Component)hurtBox2.healthComponent).gameObject);
				Vector3 val2 = hurtBox2.collider.ClosestPoint(((EntityState)this).transform.position);
				MainPlugin.SpawnFX(BaseAssets.HitFX, val2, Quaternion.identity, 1f);
			}
		}
		if (list == null)
		{
			return false;
		}
		return list.Count() > 0;
	}

	public override void OnExit()
	{
		if (((EntityState)this).isAuthority)
		{
			((CharacterModSkillState)this).PlaySkillAnimation("Idle", 0.15f, 0, true, true);
			((CharacterModSkillState)this).RemoveGravityDisableCounter();
			BonusStatHandler bonusStatHandler = ((CharacterModSkillState)this).GetBonusStatHandler();
			string text = "MeteorCrashBonus";
			bonusStatHandler.RemoveBonusStatBundle(ref text);
		}
		if ((Object)(object)m_loopingFX != (Object)null)
		{
			EntityState.Destroy((Object)(object)m_loopingFX);
		}
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		return (InterruptPriority)3;
	}
}
public class KamehamehaSkill : BaseBeamChargeSkillState
{
	public const string SkillName = "Kamehameha";

	public const float kamehamehaBaseDamageMult = 12f;

	public const float kamehamehaDamageChargeAddMult = 10f;

	public const float BaseKiCost = 30f;

	protected override void InitSkillValues()
	{
		base.m_beamChargeValues.chargeAnimationStateName = "Kamehameha_Skill_0";
		base.m_beamChargeValues.beamMinChargeTime = 0.75f;
		base.m_beamChargeValues.addBSB = true;
		base.m_beamChargeValues.bsb_baseArmorAdd = 25f;
		base.m_beamChargeValues.bsb_multMovementSpeed = 0.5f;
		base.m_beamChargeValues.beamChargeSoundEventID = BaseSounds.kamehameha_charge;
		base.m_beamChargeValues.beamChargeVoiceSoundEventID = GokuSounds.kamehameha_charge_voice;
		base.m_beamChargeValues.chargeFX = GokuAssets.KamehamehaChargeFX;
		base.m_beamChargeValues.baseKiDrainPerSecond = 15f;
		base.m_beamChargeValues.addKiDrainPerSecond = 30f;
		base.m_beamFireValuesToSend.beamDuration = 1.5f;
		base.m_beamFireValuesToSend.beamBaseRange = 60f;
		base.m_beamFireValuesToSend.beamRangePerCharge = 30f;
		base.m_beamFireValuesToSend.beamBaseRadius = 1.2f;
		base.m_beamFireValuesToSend.beamRadiusChargeAdd = 0.33f;
		base.m_beamFireValuesToSend.beamBaseDamageMult = 12f;
		base.m_beamFireValuesToSend.beamDamageChargeAddMult = 10f;
		base.m_beamFireValuesToSend.beamCoeff = 1f;
		base.m_beamFireValuesToSend.beamFX = GokuAssets.KamehamehaFX;
		base.m_beamFireValuesToSend.beamFireSoundID = BaseSounds.kamehameha_fire;
		base.m_beamFireValuesToSend.beamFireVoiceSoundID = GokuSounds.kamehameha_fire_voice;
		base.m_beamFireValuesToSend.fireAnimationStateName = "Kamehameha_Skill_1";
	}

	protected override bool ChildCanFireBeam()
	{
		return !((EntityState)this).inputBank.skill4.down;
	}

	public static string GetSkillDescription()
	{
		return string.Format(MainPlugin.CreateKiCostDescription(30f.ToString("n0")) + "\nCharge and unleash a Kamehameha, Dealing " + MainPlugin.CreateDamageDescription(GetDisplayBaseDamage()) + " per second whilst the blast is active! \nConsume additional Ki and increase damage by " + MainPlugin.CreateDamageDescription(GetDisplayDamagePerCharge()) + " per second of charging!\n" + MainPlugin.ColorText("Ki consumption gradually increases the longer you charge!", "#03f4fc"));
	}

	public static string GetDisplayBaseDamage()
	{
		return 1200f.ToString();
	}

	public static string GetDisplayDamagePerCharge()
	{
		return 1000f.ToString();
	}

	public override void OnEnter()
	{
		((BaseBeamChargeSkillState)this).OnEnter();
		if (((EntityState)this).isAuthority && ((CharacterModSkillState)this).HasSkill("Instant Transmission"))
		{
			base.m_canInstantTransmission = 1;
		}
	}

	public override void Update()
	{
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_005e: 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_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: 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_008b: Unknown result type (might be due to invalid IL or missing references)
		((BaseBeamChargeSkillState)this).Update();
		if (((EntityState)this).isAuthority && base.m_canInstantTransmission > 0 && ((ButtonState)(ref ((EntityState)this).inputBank.skill3)).justPressed && ((CharacterModSkillState)this).GetKiHandler().GetCurrentKi() >= 25f)
		{
			Vector3 val = Vector3.zero;
			bool flag = false;
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 origin = ((Ray)(ref aimRay)).origin;
			Vector3 aimRayDirection = ((CharacterModSkillState)this).GetAimRayDirection();
			LayerIndex world = LayerIndex.world;
			RaycastHit val2 = default(RaycastHit);
			if (Physics.Raycast(origin, aimRayDirection, ref val2, 50f, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask)))
			{
				val = ((RaycastHit)(ref val2)).point;
				flag = true;
			}
			((CharacterModSkillState)this).DoTeleport(((CharacterModSkillState)this).GetAimRayDirection(), val, flag ? 0f : 50f);
			((MonoBehaviour)((CharacterModSkillState)this).m_characterModelSwap).Invoke("RemoveHideBodyCounter", 0.1f);
			base.m_canInstantTransmission--;
			((CharacterModSkillState)this).GetKiHandler().AddCurrentKi(-25f);
		}
	}

	public override void FixedUpdate()
	{
		((BaseBeamChargeSkillState)this).FixedUpdate();
	}

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

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		return (InterruptPriority)7;
	}
}
public class SpiritbombSkill : CharacterModSkillState
{
	public const string SkillName = "Spirit Bomb";

	private SpiritbombHandler m_spiritbombHandler;

	private string m_chargeAnimName = "Spiritbomb_Skill_0";

	private string m_fireAnimName = "Spiritbomb_Skill_1";

	public const string SpiritbombProjectileName = "SpiritbombProjectile";

	public const float BaseKiCost = 200f;

	public const float spiritbombMinChargeTime = 3f;

	public const float spiritbombMaxChargeTime = 1000f;

	public const float spiritbombLifetime = 60f;

	public const float spiritbombBaseCollisionRadius = 4f;

	public const float spiritbombBaseExplosionRadius = 28f;

	public const float spiritbombBaseDamageMult = 40f;

	public const float spiritbombDamageChargeAddMult = 12f;

	public const float spiritbombMinSpeed = 5f;

	public const float spiritbombMaxSpeed = 11f;

	public const float cameraPosIncreaseMult = 1.25f;

	public const float m_proximityDamageFrequency = 0.25f;

	public static float m_proximityDamageMult = 0.1f;

	public const float m_proximityRangeMult = 1.75f;

	public const float baseKiDrainPerSecond = 30f;

	public const float addKiDrainPerSecond = 40f;

	private Vector3 m_currentSpiritBombHoldPosition;

	private const float m_baseHoldPositionY = 6f;

	private GameObject m_currentChargeFX;

	private const string m_chargingBsbName = "SpiritBombCharge_Bonus";

	private int m_canInstantTransmission;

	private bool m_hasSpiritbombFired;

	private bool m_hasSpiritbombFinished;

	private bool m_saidSpiritBombReadyVoiceLine;

	private bool m_saidSpiritBombPleaVoiceLine;

	private bool m_saidSpiritBombPleaLongVoiceLine;

	private uint m_spiritbombChargeSoundEventID;

	private uint m_spiritbombPleaSoundEventID;

	private float m_timeSpiritBombFired = float.MaxValue;

	public static string GetSkillDescription()
	{
		return string.Format(MainPlugin.CreateKiCostDescription(200f.ToString("n0")) + "\nCharge and unleash a Spirit Bomb, Dealing " + MainPlugin.CreateDamageDescription(GetDisplayProximityDamage()) + " per " + 0.25f.ToString("n1") + " seconds to enemies within it! \nConsume additional Ki and increase overall damage by " + MainPlugin.CreateDamageDescription(GetDisplayDamagePerCharge()) + " per second of charging!\n" + MainPlugin.ColorText("Ki consumption gradually increases the longer you charge!", "#03f4fc") + "\n\n" + MainPlugin.ColorText("If the Spirit Bomb collides with a boss or the ground, it will explode, Dealing ", "#03f4fc") + MainPlugin.CreateDamageDescription(GetDisplayBaseDamage()) + "\n" + MainPlugin.ColorText("Gain Bonus Armor whilst standing still.", "#999999") + "\n" + MainPlugin.ColorText("Whilst moving the Spirit Bomb will not charge!", "#FF0000"));
	}

	public static string GetDisplayBaseDamage()
	{
		return 4000f.ToString();
	}

	public static string GetDisplayDamagePerCharge()
	{
		return 1200f.ToString();
	}

	public static string GetDisplayProximityDamage()
	{
		return (40f * m_proximityDamageMult * 100f).ToString();
	}

	private float GetTotalSpiritbombDamageMult()
	{
		return 40f + 12f * (((CharacterModSkillState)this).GetChargeMult() - 1f);
	}

	private bool CanFireSpiritbomb()
	{
		if (((EntityState)this).fixedAge >= 3f)
		{
			if (((EntityState)this).characterBody.inputBank.skill4.down && !(((EntityState)this).fixedAge >= 1000f))
			{
				return ((CharacterModSkillState)this).GetKiHandler().GetCurrentKi() <= 0f;
			}
			return true;
		}
		return false;
	}

	private float GetScaleValue()
	{
		return 1f + ((CharacterModSkillState)this).GetChargeMult() * 0.5f;
	}

	public override void OnEnter()
	{
		((CharacterModSkillState)this).OnEnter();
		m_spiritbombHandler = ((EntityState)this).GetComponent<SpiritbombHandler>();
		m_spiritbombChargeSoundEventID = MainPlugin.PlaySoundEvent(((Component)((EntityState)this).characterBody).gameObject, GokuSounds.spiritbomb_charge_loop, 100);
		MainPlugin.PlaySoundEvent(((Component)((EntityState)this).characterBody).gameObject, GokuSounds.spiritbomb_ready, 100);
		if (((EntityState)this).isAuthority)
		{
			base.m_allowHover = true;
			if (((CharacterModSkillState)this).HasSkill("Instant Transmission"))
			{
				m_canInstantTransmission = 1;
			}
			((CharacterModSkillState)this).PlaySkillAnimation(m_chargeAnimName, 0.2f, 1, true, true);
			if ((Object)(object)((CharacterModSkillState)this).GetKiHandler() != (Object)null && ((CharacterModSkillState)this).GetKiHandler().GetCurrentKi() > 30f + 1120f * ((BaseSkillState)this).activatorSkillSlot.cooldownScale)
			{
				m_spiritbombPleaSoundEventID = MainPlugin.PlayVoiceSoundEvent(((Component)((EntityState)this).characterBody).gameObject, GokuSounds.spiritbomb_plealong_voice, 50);
				if (m_spiritbombPleaSoundEventID != 0)
				{
					m_saidSpiritBombPleaLongVoiceLine = true;
				}
			}
			if (!m_saidSpiritBombPleaLongVoiceLine)
			{
				m_spiritbombPleaSoundEventID = MainPlugin.PlayVoiceSoundEvent(((Component)((EntityState)this).characterBody).gameObject, GokuSounds.spiritbomb_plea_voice, 30);
				if (m_spiritbombPleaSoundEventID != 0)
				{
					m_saidSpiritBombPleaVoiceLine = true;
				}
			}
			((EntityState)this).characterBody.isSprinting = false;
		}
		SpawnSpiritbombChargeFX();
	}

	public static void ScaleSpiritBombFx(GameObject spiritBombFX, float scaleValue, bool scaleXffectComponent, bool scaleXffectLayer, bool scaleTransform)
	{
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		if (scaleXffectComponent)
		{
			XffectComponent component = spiritBombFX.GetComponent<XffectComponent>();
			if ((Object)(object)component != (Object)null)
			{
				component.Scale = scaleValue;
			}
		}
		if (scaleXffectLayer)
		{
			EffectLayer[] componentsInChildren = spiritBombFX.GetComponentsInChildren<EffectLayer>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				componentsInChildren[i].MaxScaleCalue = scaleValue;
			}
		}
		if (scaleTransform)
		{
			Transform val = MainPlugin.FindTransformRecursive(spiritBombFX.transform.root, "ps_ball");
			if ((Object)(object)val != (Object)null)
			{
				val.localScale = new Vector3(scaleValue, scaleValue, scaleValue);
			}
		}
	}

	private void GrantStandingStillBonus()
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: 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)
		BonusStatBundle val = default(BonusStatBundle);
		((BonusStatBundle)(ref val))..ctor("SpiritBombCharge_Bonus", (GameObject)null, 0f);
		BonusStat val2 = new BonusStat("armor", 100f, 0f);
		((BonusStatBundle)(ref val)).AddBonusStat(ref val2);
		((CharacterModSkillState)this).GetBonusStatHandler().AddBonusStatBundle(val);
	}

	private void GrantMovingBonus()
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: 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_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		BonusStatBundle val = default(BonusStatBundle);
		((BonusStatBundle)(ref val))..ctor("SpiritBombCharge_Bonus", (GameObject)null, 0f);
		BonusStat val2 = new BonusStat("armor", 50f, 0f);
		((BonusStatBundle)(ref val)).AddBonusStat(ref val2);
		val2 = new BonusStat("moveSpeed", 0f, -0.6f);
		((BonusStatBundle)(ref val)).AddBonusStat(ref val2);
		((CharacterModSkillState)this).GetBonusStatHandler().AddBonusStatBundle(val);
	}

	private bool IsStandingStill()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		Vector3 velocity = ((EntityState)this).characterMotor.velocity;
		velocity.y = 0f;
		if (((Vector3)(ref velocity)).magnitude < 0.2f)
		{
			return Mathf.Abs(((EntityState)this).characterMotor.velocity.y) < 1f;
		}
		return false;
	}

	public override void Update()
	{
		//IL_029f: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0235: Unknown result type (might be due to invalid IL or missing references)
		//IL_025c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0261: Unknown result type (might be due to invalid IL or missing references)
		//IL_0266: Unknown result type (might be due to invalid IL or missing references)
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0078: 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_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_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: 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)
		((EntityState)this).Update();
		if (!m_hasSpiritbombFired)
		{
			float num = 1f;
			if (!IsStandingStill())
			{
				num = 0f;
			}
			if (((EntityState)this).isAuthority)
			{
				if (m_canInstantTransmission > 0 && ((ButtonState)(ref ((EntityState)this).inputBank.skill3)).justPressed && ((CharacterModSkillState)this).GetKiHandler().GetCurrentKi() >= 25f)
				{
					Vector3 val = Vector3.zero;
					bool flag = false;
					Ray aimRay = ((BaseState)this).GetAimRay();
					Vector3 origin = ((Ray)(ref aimRay)).origin;
					Vector3 aimRayDirection = ((CharacterModSkillState)this).GetAimRayDirection();
					LayerIndex world = LayerIndex.world;
					RaycastHit val2 = default(RaycastHit);
					if (Physics.Raycast(origin, aimRayDirection, ref val2, 50f, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask)))
					{
						val = ((RaycastHit)(ref val2)).point;
						flag = true;
					}
					((CharacterModSkillState)this).DoTeleport(((CharacterModSkillState)this).GetAimRayDirection(), val, flag ? 0f : 50f);
					((MonoBehaviour)base.m_characterModelSwap).Invoke("RemoveHideBodyCounter", 0.1f);
					m_canInstantTransmission--;
					((CharacterModSkillState)this).GetKiHandler().AddCurrentKi(-25f);
				}
				if (!m_saidSpiritBombReadyVoiceLine && ((EntityState)this).fixedAge >= 3f && ((EntityState)this).characterBody.inputBank.skill4.down && !m_saidSpiritBombPleaVoiceLine && !m_saidSpiritBombPleaLongVoiceLine)
				{
					((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((Component)((EntityState)this).characterBody).gameObject, GokuSounds.spiritbomb_ready_voice, 100, true);
					m_saidSpiritBombReadyVoiceLine = true;
				}
				float num2 = 30f + 40f * (((CharacterModSkillState)this).GetChargeMult() - 1f) * ((BaseSkillState)this).activatorSkillSlot.cooldownScale;
				((CharacterModSkillState)this).UpdateChargeMult(3f, num2, num);
				if (CanFireSpiritbomb())
				{
					FireSpiritbomb();
				}
				if (IsStandingStill())
				{
					GrantStandingStillBonus();
				}
				else
				{
					GrantMovingBonus();
				}
			}
			else
			{
				((CharacterModSkillState)this).UpdateChargeMult(3f, 0f, num);
			}
			if (Object.op_Implicit((Object)(object)m_currentChargeFX))
			{
				GameObject gameObject = ((Component)m_currentChargeFX.transform.Find("ElectricBall")).gameObject;
				float scaleValue = GetScaleValue();
				if (((EntityState)this).fixedAge < 3f)
				{
					scaleValue = Mathf.Lerp(0f, GetScaleValue(), ((EntityState)this).fixedAge / 3f);
				}
				ScaleSpiritBombFx(gameObject, scaleValue, scaleXffectComponent: false, scaleXffectLayer: true, scaleTransform: true);
				m_currentSpiritBombHoldPosition = ((EntityState)this).transform.position + new Vector3(0f, 6f + 4f * (GetScaleValue() - 1f), 0f);
				m_currentChargeFX.transform.position = m_currentSpiritBombHoldPosition;
			}
		}
		if (((EntityState)this).isAuthority)
		{
			((CharacterModSkillState)this).ProcessMainStateMovement(true);
			if (IsStandingStill())
			{
				((EntityState)this).characterDirection.moveVector = ((CharacterModSkillState)this).GetAimRayDirectionXZ();
			}
			if (m_hasSpiritbombFinished && ((EntityState)this).fixedAge > m_timeSpiritBombFired + 0.6f)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}
	}

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

	private void SpawnSpiritbombChargeFX()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: 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)
		m_currentSpiritBombHoldPosition = ((EntityState)this).transform.position + new Vector3(0f, 6f, 0f);
		m_currentChargeFX = MainPlugin.SpawnFX(GokuAssets.SpiritbombChargeFX, m_currentSpiritBombHoldPosition, Quaternion.identity, -1f);
		m_currentChargeFX.transform.SetParent((Transform)null);
	}

	private void FireSpiritbomb()
	{
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		m_hasSpiritbombFired = true;
		((CharacterModSkillState)this).PlaySkillAnimation(m_fireAnimName, 0.2f, 1, true, true);
		m_spiritbombHandler.m_latestScaleValue = GetScaleValue();
		((EntityState)this).GetComponent<GokuNetworkHandler>().SendLatestSpiritBombScale(((EntityState)this).gameObject, GetScaleValue());
		float num = Mathf.Lerp(11f, 5f, (((CharacterModSkillState)this).GetChargeMult() - 1f) * 0.2f);
		Quaternion val = Util.QuaternionSafeLookRotation(((CharacterModSkillState)this).GetAimRayDirection());
		GameObject projectilePrefab = ProjectileCatalog.GetProjectilePrefab(ProjectileCatalog.FindProjectileIndex("SpiritbombProjectile"));
		if ((Object)(object)projectilePrefab != (Object)null)
		{
			ProjectileManager.instance.FireProjectile(projectilePrefab, m_currentSpiritBombHoldPosition, val, ((EntityState)this).gameObject, ((BaseState)this).damageStat * GetTotalSpiritbombDamageMult(), 1f, Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, num, (DamageTypeCombo?)null);
		}
		MainPlugin.StopSoundEvent(ref m_spiritbombPleaSoundEventID);
		MainPlugin.StopSoundEvent(ref m_spiritbombChargeSoundEventID);
		((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((Component)((EntityState)this).characterBody).gameObject, GokuSounds.spiritbomb_fire, 100, false);
		if (!m_saidSpiritBombReadyVoiceLine || (m_saidSpiritBombReadyVoiceLine && ((EntityState)this).fixedAge > 4.2f))
		{
			((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((Component)((EntityState)this).characterBody).gameObject, GokuSounds.spiritbomb_fire_voices, 100, true);
		}
		if ((Object)(object)m_currentChargeFX != (Object)null)
		{
			EntityState.Destroy((Object)(object)m_currentChargeFX);
			m_currentChargeFX = null;
		}
		m_timeSpiritBombFired = ((EntityState)this).fixedAge;
		m_hasSpiritbombFinished = true;
		BonusStatHandler bonusStatHandler = ((CharacterModSkillState)this).GetBonusStatHandler();
		string text = "SpiritBombCharge_Bonus";
		bonusStatHandler.RemoveBonusStatBundle(ref text);
	}

	public override void OnExit()
	{
		((EntityState)this).OnExit();
		if ((Object)(object)m_currentChargeFX != (Object)null)
		{
			EntityState.Destroy((Object)(object)m_currentChargeFX);
			m_currentChargeFX = null;
		}
		MainPlugin.StopSoundEvent(ref m_spiritbombChargeSoundEventID);
		MainPlugin.StopSoundEvent(ref m_spiritbombPleaSoundEventID);
		if (((EntityState)this).isAuthority)
		{
			BonusStatHandler bonusStatHandler = ((CharacterModSkillState)this).GetBonusStatHandler();
			string text = "SpiritBombCharge_Bonus";
			bonusStatHandler.RemoveBonusStatBundle(ref text);
		}
	}

	public static void SetupSpiritBombProjectile()
	{
		GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("prefabs/projectiles/MageLightningBombProjectile"), "SpiritbombProjectile");
		val.AddComponent<SpiritBombProjectile>();
		MainPlugin.s_projectileRegistrationManager.InitProjectileImpactData(ref val, false, 4f, 28f, false, true);
		MainPlugin.s_projectileRegistrationManager.CreateNewProjectile("SpiritbombProjectile", (DamageType)0, val, GokuAssets.SpiritbombGO, BaseAssets.BlankGO);
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		return (InterruptPriority)7;
	}
}
public class AngryKamehamehaSkill : BaseBeamChargeSkillState
{
	public const string SkillName = "Angry Kamehameha";

	public const float kamehamehaBaseDamageMult = 15.5f;

	public static float BaseKiCost = 60f;

	protected override void InitSkillValues()
	{
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		base.m_beamChargeValues.addBSB = false;
		base.m_beamChargeValues.beamMinChargeTime = 0f;
		base.m_beamFireValuesToSend.beamDuration = 1.6f;
		base.m_beamFireValuesToSend.beamBaseRange = 150f;
		base.m_beamFireValuesToSend.beamBaseRadius = 1f;
		base.m_beamFireValuesToSend.beamBaseDamageMult = 15.5f;
		base.m_beamFireValuesToSend.fireAnimationStateName = "AngryKamehameha_Skill_0";
		base.m_beamFireValuesToSend.beamFX = GokuAssets.AngryKamehamehaFX;
		base.m_beamFireValuesToSend.fireBeamLocation = (EFireBeamLocation)1;
		base.m_beamFireValuesToSend.beamFireSoundID = BaseSounds.kamehameha_fire;
	}

	protected override bool ChildCanFireBeam()
	{
		return true;
	}

	public static string GetSkillDescription()
	{
		return string.Format(MainPlugin.CreateKiCostDescription(BaseKiCost.ToString("n0")) + "\nUnleash an Angry Kamehameha, Dealing " + MainPlugin.CreateDamageDescription(GetDisplayBaseDamage()) + " per second whilst the blast is active!");
	}

	public static string GetDisplayBaseDamage()
	{
		return 1550f.ToString();
	}

	public static string GetDisplayMaxDamage()
	{
		return 1550f.ToString();
	}

	private bool CanFireKamehameha()
	{
		return true;
	}

	public override void OnEnter()
	{
		((BaseBeamChargeSkillState)this).OnEnter();
		if (MainPlugin.PlayVoiceSoundEvent(((Component)((EntityState)this).characterBody).gameObject, GokuSounds.angry_voices, 50) == 0)
		{
			MainPlugin.PlayVoiceSoundEvent(((Component)((EntityState)this).characterBody).gameObject, GokuSounds.short_yell_voices, 100);
		}
	}

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

	public override void FixedUpdate()
	{
		((BaseBeamChargeSkillState)this).FixedUpdate();
	}

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

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		return (InterruptPriority)7;
	}
}
public class BlackKamehamehaSkill : BaseBeamChargeSkillState
{
	public const string SkillName = "Black Kamehameha";

	public const float kamehamehaBaseDamageMult = 17f;

	public const float kamehamehaDamageChargeAddMult = 10f;

	public const float BaseKiCost = 70f;

	protected override void InitSkillValues()
	{
		base.m_beamChargeValues.chargeAnimationStateName = "Kamehameha_Skill_0";
		base.m_beamChargeValues.beamMinChargeTime = 0.75f;
		base.m_beamChargeValues.addBSB = true;
		base.m_beamChargeValues.bsb_baseArmorAdd = 45f;
		base.m_beamChargeValues.bsb_multMovementSpeed = 0.5f;
		base.m_beamChargeValues.beamChargeSoundEventID = BaseSounds.kamehamehax10_charge;
		base.m_beamChargeValues.beamChargeVoiceSoundEventID = GokuSounds.kamehameha_charge_voice;
		base.m_beamChargeValues.chargeFX = GokuAssets.BlackKamehamehaChargeFX;
		base.m_beamChargeValues.baseKiDrainPerSecond = 28f;
		base.m_beamChargeValues.addKiDrainPerSecond = 38f;
		base.m_beamFireValuesToSend.beamDuration = 1.5f;
		base.m_beamFireValuesToSend.beamBaseRange = 100f;
		base.m_beamFireValuesToSend.beamRangePerCharge = 48f;
		base.m_beamFireValuesToSend.beamBaseRadius = 1f;
		base.m_beamFireValuesToSend.beamRadiusChargeAdd = 0.25f;
		base.m_beamFireValuesToSend.beamBaseDamageMult = 17f;
		base.m_beamFireValuesToSend.beamDamageChargeAddMult = 10f;
		base.m_beamFireValuesToSend.beamCoeff = 1f;
		base.m_beamFireValuesToSend.beamFX = GokuAssets.BlackKamehamehaFX;
		base.m_beamFireValuesToSend.beamFireSoundID = BaseSounds.kamehamehax10_fire;
		base.m_beamFireValuesToSend.beamFireVoiceSoundID = GokuSounds.kamehameha_fire_voice;
		base.m_beamFireValuesToSend.fireAnimationStateName = "Kamehameha_Skill_1";
	}

	protected override bool ChildCanFireBeam()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return !Input.GetKey(MainPlugin.Config_UniqueSkillKey.Value);
	}

	public static string GetSkillDescription()
	{
		return string.Format(MainPlugin.CreateKiCostDescription(70f.ToString("n0")) + "\nCharge and unleash a godly Black Kamehameha, Dealing " + MainPlugin.CreateDamageDescription(GetDisplayBaseDamage()) + " per second whilst the blast is active! \nConsume additional Ki and increase damage by " + MainPlugin.CreateDamageDescription(GetDisplayDamagePerCharge()) + " per second of charging!\n" + MainPlugin.ColorText("Ki consumption gradually increases the longer you charge!", "#03f4fc"));
	}

	public static string GetDisplayBaseDamage()
	{
		return 1700f.ToString();
	}

	private float GetTotalKamehamehaDamageMult()
	{
		return 17f + 10f * (((CharacterModSkillState)this).GetChargeMult() - 1f);
	}

	public static string GetDisplayDamagePerCharge()
	{
		return 1000f.ToString();
	}

	public override void OnEnter()
	{
		((BaseBeamChargeSkillState)this).OnEnter();
	}

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

	public override void FixedUpdate()
	{
		((BaseBeamChargeSkillState)this).FixedUpdate();
	}

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

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		return (InterruptPriority)7;
	}
}
public class DragonFistSkill : CharacterModSkillState
{
	private string AnimationStateName = "DragonFist_Skill_0";

	public const string SkillName = "Dragon Fist";

	public const float SkillDamageMult = 24f;

	public const float SkillDuration = 2.5f;

	public const float BaseMovementMult = 40f;

	public const float SkillCollisionRadius = 4f;

	public static float BaseKiCost = 225f;

	private Vector3 m_calculatedVelocity = Vector3.zero;

	private Vector3 m_startingDirection = Vector3.zero;

	private const float DragonAppearTime = 0.7f;

	private GameObject m_fx;

	private float m_currentDragonModelAlpha;

	private MeshRenderer[] m_fxRenderers;

	private bool m_endingSkill;

	private bool m_launched;

	private string m_bsbName = "DragonFistBONUS";

	private float m_baseArmorAdd = 50f;

	private List<HurtBoxGroup> m_alreadyDamaged = new List<HurtBoxGroup>();

	public static string GetSkillDescription()
	{
		return CreateSkillDescription(24f, BaseKiCost);
	}

	public static string CreateSkillDescription(float damageMult, float kiCost)
	{
		return string.Format(MainPlugin.CreateKiCostDescription(kiCost.ToString("n0")) + "\nCharge forward and unleash a Fiery Dragon Fist, Dealing " + MainPlugin.CreateDamageDescription((damageMult * 100f).ToString()) + " to every enemy hit!\n" + MainPlugin.ColorText("Deals bonus damage to low health targets!", "#03f4fc"));
	}

	private void StartLaunch()
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: 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_005f: 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_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_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_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		if (!m_launched)
		{
			m_launched = true;
			m_startingDirection = ((CharacterModSkillState)this).GetAimRayDirection();
			m_calculatedVelocity = m_startingDirection * (40f + ((EntityState)this).characterBody.moveSpeed * 0.5f);
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).characterDirection.forward = ((Vector3)(ref ((EntityState)this).characterMotor.velocity)).normalized;
			}
			if (((EntityState)this).isAuthority)
			{
				Vector3 val = Vector3.Cross(Vector3.up, m_startingDirection);
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				Vector3 val2 = Quaternion.AngleAxis(90f, normalized) * m_startingDirection;
				base.m_characterModelSwap.SetHipRotationVector(val2, m_startingDirection.y < 0f);
			}
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).characterBody.isSprinting = false;
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
			}
			Wave val3 = default(Wave);
			val3.amplitude = 0.4f;
			val3.frequency = 50f;
			val3.cycleOffset = 0f;
			Wave val4 = val3;
			ShakeEmitter.CreateSimpleShakeEmitter(((EntityState)this).transform.position, val4, 1.8f, 100f, true);
		}
	}

	protected virtual GameObject GetDragonFistFX()
	{
		return GokuAssets.DragonFistFX;
	}

	public override void OnEnter()
	{
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: 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)
		((CharacterModSkillState)this).OnEnter();
		if (((EntityState)this).isAuthority)
		{
			((CharacterModSkillState)this).PlaySkillAnimation(AnimationStateName, 0.2f, 0, true, true);
			((CharacterModSkillState)this).AddGravityDisableCounter();
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.disableAirControlUntilCollision = characterMotor.disableAirControlUntilCollision || true;
			base.m_canBeStunned = false;
			BonusStatBundle val = default(BonusStatBundle);
			((BonusStatBundle)(ref val))..ctor(m_bsbName, (GameObject)null, 0f);
			BonusStat val2 = new BonusStat("armor", m_baseArmorAdd, 0f);
			((BonusStatBundle)(ref val)).AddBonusStat(ref val2);
			((CharacterModSkillState)this).GetBonusStatHandler().AddBonusStatBundle(val);
		}
		if ((Object)(object)m_fx == (Object)null)
		{
			m_fx = MainPlugin.SpawnFX(GetDragonFistFX(), Vector3.zero, Quaternion.Euler(((Vector3)(ref m_calculatedVelocity)).normalized), -1f);
			m_fxRenderers = m_fx.GetComponentsInChildren<MeshRenderer>();
			MeshRenderer[] fxRenderers = m_fxRenderers;
			for (int i = 0; i < fxRenderers.Length; i++)
			{
				((Renderer)fxRenderers[i]).materials[0].color = new Color(1f, 1f, 0f, 0f);
			}
		}
		MainPlugin.PlaySoundEvent(((EntityState)this).gameObject, GokuSounds.dragonfist, 100);
		MainPlugin.PlaySoundEvent(((EntityState)this).gameObject, GokuSounds.dragonfist_voice, 75);
	}

	public override void Update()
	{
		//IL_00b4: 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_00e0: 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: 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_0109: 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)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_012f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: 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_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_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0291: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02df: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_024e: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).Update();
		if (((EntityState)this).fixedAge > 0.7f)
		{
			if (!m_launched)
			{
				StartLaunch();
			}
			else if (((EntityState)this).isAuthority)
			{
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
				if (m_endingSkill)
				{
					((EntityState)this).characterMotor.velocity = Vector3.Lerp(((EntityState)this).characterMotor.velocity, Vector3.zero, Time.deltaTime);
				}
				else
				{
					((EntityState)this).characterMotor.velocity = m_c