Decompiled source of Broly v1.0.1

PlayableBroly.dll

Decompiled 16 hours ago
using System;
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 On.RoR2;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.CharacterAI;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.Networking;

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

public static class BrolyAssets
{
	public static AssetBundle LocalAssetBundle;

	public static Sprite OmegaBlaster_Tex;

	public static Sprite BrolyIcon;

	public static Material COL_Black;

	public static Material COL_Blue;

	public static Material COL_Brown;

	public static Material COL_Eye;

	public static Material COL_Eye_Green;

	public static Material COL_Gold;

	public static Material COL_Green;

	public static Material COL_Magenta;

	public static Material COL_Pink;

	public static Material COL_Red;

	public static Material COL_Skin;

	public static Material COL_Skin_Pale;

	public static Material COL_White;

	public static Material OmegaBlaster_Mat;

	public static Material BrolyEnergyShieldFX_Core;

	public static Material BrolyEnergyShieldFX_EffectFire;

	public static Material BrolyEnergyShieldFX_FireScroll;

	public static Material BrolyEnergyShieldFX_glow12;

	public static Material BrolyEnergyShieldFX_glow15;

	public static Material BrolyKiChargeFX_KiChargeMat;

	public static Material BrolyKiChargeFX_shockwave17;

	public static Material EraserCannonChargeFX_GiganticMeteorChargeFX_Core;

	public static Material EraserCannonChargeFX_GiganticMeteorChargeFX_FireScroll;

	public static Material EraserCannonChargeFX_GiganticMeteorChargeFX_glow12;

	public static Material EraserCannonExplosionFX_dust05;

	public static Material EraserCannonExplosionFX_FireScroll;

	public static Material EraserCannonExplosionFX_glow12;

	public static Material EraserCannonExplosionFX_glow14;

	public static Material EraserCannonExplosionFX_glow15;

	public static Material EraserCannonExplosionFX_ring01;

	public static Material EraserCannonExplosionFX_ring10;

	public static Material EraserCannonProjectileFX_Partex_00;

	public static Material EraserShotVolleyPartex00;

	public static Material EraserShotVolleyPartex01;

	public static Material EraserShotVolleyShockwave;

	public static Material ExplosiveWaveChargeFX_dust05;

	public static Material ExplosiveWaveChargeFX_FireScroll;

	public static Material ExplosiveWaveChargeFX_glow12;

	public static Material ExplosiveWaveChargeFX_glow15;

	public static Material ExplosiveWaveChargeFX_Line6;

	public static Material ExplosiveWaveFX_dust05;

	public static Material ExplosiveWaveFX_FireScroll;

	public static Material ExplosiveWaveFX_glow14;

	public static Material ExplosiveWaveFX_glow16;

	public static Material GiganticMeteorBeamFX_Core;

	public static Material GiganticMeteorBeamFX_Core2;

	public static Material GiganticMeteorBeamFX_line14_distort3;

	public static Material GiganticMeteorBeamFX_line14_distort4;

	public static Material GiganticMeteorBeamFX_ring14;

	public static Material GiganticMeteorBeamFX_ring16;

	public static Material GiganticMeteorBeamFX_shockwaveup01;

	public static Material GiganticMeteorBeamFX_Wave;

	public static Material GiganticMeteorChargeFX_Core;

	public static Material GiganticMeteorChargeFX_FireScroll;

	public static Material GiganticMeteorChargeFX_glow12;

	public static Material GiganticMeteorProjectileExplosionFX_EffectFire;

	public static Material GiganticMeteorProjectileExplosionFX_EraserShotVolleyPartex00;

	public static Material GiganticMeteorProjectileExplosionFX_EraserShotVolleyPartex01;

	public static Material GiganticMeteorProjectileFX_EraserShotVolleyPartex00;

	public static GameObject broly_obj;

	public static GameObject LSSJ_Cutscene_start;

	public static GameObject BrolyEnergyShieldFX;

	public static GameObject BrolyKiChargeEndFX;

	public static GameObject BrolyKiChargeEnd_LSSJ_FX;

	public static GameObject BrolyKiChargeFX;

	public static GameObject BrolyKiCharge_LSSJ_FX;

	public static GameObject EraserCannonChargeFX;

	public static GameObject EraserCannonExplosionFX;

	public static GameObject EraserCannonProjectileFX;

	public static GameObject EraserShotVolleyExplosionFX;

	public static GameObject EraserShotVolleyFireFX;

	public static GameObject EraserShotVolleyFX;

	public static GameObject ExplosiveWaveChargeFX;

	public static GameObject ExplosiveWaveFX;

	public static GameObject GiganticCharge_Dash_FX;

	public static GameObject GiganticCharge_Start_FX;

	public static GameObject GiganticClusterExplosionFX;

	public static GameObject GiganticClusterProjectileFX;

	public static GameObject GiganticMeteorBeamFX;

	public static GameObject GiganticMeteorChargeFX;

	public static GameObject GiganticMeteorProjectileExplosionFX;

	public static GameObject GiganticMeteorProjectileFX;

	public static GameObject OmegaBlasterChargeFX;

	public static GameObject OmegaBlasterExplosionFX;

	public static GameObject OmegaBlasterProjectileFX;

	public static GameObject CustomHairHolder;

	public static GameObject LSSJ_Transformation_Explosion_FX;

	public static void PopulateAssets()
	{
		MainPlugin.DebugLog("BrolyAssets::PopulateAssets() Started!");
		AssetLoader.LoadAssetBundle("PlayableBroly.broly_assetbundle", ref LocalAssetBundle);
		AssetLoader.LoadSoundBank("PlayableBroly.broly_soundbank.bnk");
		LoadAllAssetsFromAssetBundle();
		MainPlugin.DebugLog("BrolyAssets::PopulateAssets() Complete!");
	}

	private static void LoadAllAssetsFromAssetBundle()
	{
		AssetLoader.LoadAsset(ref OmegaBlaster_Tex, "OmegaBlaster_Tex", LocalAssetBundle);
		AssetLoader.LoadAsset(ref BrolyIcon, "BrolyIcon", LocalAssetBundle);
		AssetLoader.LoadAsset(ref COL_Black, "COL_Black", LocalAssetBundle);
		AssetLoader.LoadAsset(ref COL_Blue, "COL_Blue", LocalAssetBundle);
		AssetLoader.LoadAsset(ref COL_Brown, "COL_Brown", LocalAssetBundle);
		AssetLoader.LoadAsset(ref COL_Eye, "COL_Eye", LocalAssetBundle);
		AssetLoader.LoadAsset(ref COL_Eye_Green, "COL_Eye_Green", LocalAssetBundle);
		AssetLoader.LoadAsset(ref COL_Gold, "COL_Gold", LocalAssetBundle);
		AssetLoader.LoadAsset(ref COL_Green, "COL_Green", LocalAssetBundle);
		AssetLoader.LoadAsset(ref COL_Magenta, "COL_Magenta", LocalAssetBundle);
		AssetLoader.LoadAsset(ref COL_Pink, "COL_Pink", LocalAssetBundle);
		AssetLoader.LoadAsset(ref COL_Red, "COL_Red", LocalAssetBundle);
		AssetLoader.LoadAsset(ref COL_Skin, "COL_Skin", LocalAssetBundle);
		AssetLoader.LoadAsset(ref COL_Skin_Pale, "COL_Skin_Pale", LocalAssetBundle);
		AssetLoader.LoadAsset(ref COL_White, "COL_White", LocalAssetBundle);
		AssetLoader.LoadAsset(ref OmegaBlaster_Mat, "OmegaBlaster_Mat", LocalAssetBundle);
		AssetLoader.LoadAsset(ref BrolyEnergyShieldFX_Core, "BrolyEnergyShieldFX_Core", LocalAssetBundle);
		AssetLoader.LoadAsset(ref BrolyEnergyShieldFX_EffectFire, "BrolyEnergyShieldFX_EffectFire", LocalAssetBundle);
		AssetLoader.LoadAsset(ref BrolyEnergyShieldFX_FireScroll, "BrolyEnergyShieldFX_FireScroll", LocalAssetBundle);
		AssetLoader.LoadAsset(ref BrolyEnergyShieldFX_glow12, "BrolyEnergyShieldFX_glow12", LocalAssetBundle);
		AssetLoader.LoadAsset(ref BrolyEnergyShieldFX_glow15, "BrolyEnergyShieldFX_glow15", LocalAssetBundle);
		AssetLoader.LoadAsset(ref BrolyKiChargeFX_KiChargeMat, "BrolyKiChargeFX_KiChargeMat", LocalAssetBundle);
		AssetLoader.LoadAsset(ref BrolyKiChargeFX_shockwave17, "BrolyKiChargeFX_shockwave17", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserCannonChargeFX_GiganticMeteorChargeFX_Core, "EraserCannonChargeFX_GiganticMeteorChargeFX_Core", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserCannonChargeFX_GiganticMeteorChargeFX_FireScroll, "EraserCannonChargeFX_GiganticMeteorChargeFX_FireScroll", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserCannonChargeFX_GiganticMeteorChargeFX_glow12, "EraserCannonChargeFX_GiganticMeteorChargeFX_glow12", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserCannonExplosionFX_dust05, "EraserCannonExplosionFX_dust05", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserCannonExplosionFX_FireScroll, "EraserCannonExplosionFX_FireScroll", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserCannonExplosionFX_glow12, "EraserCannonExplosionFX_glow12", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserCannonExplosionFX_glow14, "EraserCannonExplosionFX_glow14", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserCannonExplosionFX_glow15, "EraserCannonExplosionFX_glow15", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserCannonExplosionFX_ring01, "EraserCannonExplosionFX_ring01", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserCannonExplosionFX_ring10, "EraserCannonExplosionFX_ring10", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserCannonProjectileFX_Partex_00, "EraserCannonProjectileFX_Partex_00", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserShotVolleyPartex00, "EraserShotVolleyPartex00", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserShotVolleyPartex01, "EraserShotVolleyPartex01", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserShotVolleyShockwave, "EraserShotVolleyShockwave", LocalAssetBundle);
		AssetLoader.LoadAsset(ref ExplosiveWaveChargeFX_dust05, "ExplosiveWaveChargeFX_dust05", LocalAssetBundle);
		AssetLoader.LoadAsset(ref ExplosiveWaveChargeFX_FireScroll, "ExplosiveWaveChargeFX_FireScroll", LocalAssetBundle);
		AssetLoader.LoadAsset(ref ExplosiveWaveChargeFX_glow12, "ExplosiveWaveChargeFX_glow12", LocalAssetBundle);
		AssetLoader.LoadAsset(ref ExplosiveWaveChargeFX_glow15, "ExplosiveWaveChargeFX_glow15", LocalAssetBundle);
		AssetLoader.LoadAsset(ref ExplosiveWaveChargeFX_Line6, "ExplosiveWaveChargeFX_Line6", LocalAssetBundle);
		AssetLoader.LoadAsset(ref ExplosiveWaveFX_dust05, "ExplosiveWaveFX_dust05", LocalAssetBundle);
		AssetLoader.LoadAsset(ref ExplosiveWaveFX_FireScroll, "ExplosiveWaveFX_FireScroll", LocalAssetBundle);
		AssetLoader.LoadAsset(ref ExplosiveWaveFX_glow14, "ExplosiveWaveFX_glow14", LocalAssetBundle);
		AssetLoader.LoadAsset(ref ExplosiveWaveFX_glow16, "ExplosiveWaveFX_glow16", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorBeamFX_Core, "GiganticMeteorBeamFX_Core", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorBeamFX_Core2, "GiganticMeteorBeamFX_Core2", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorBeamFX_line14_distort3, "GiganticMeteorBeamFX_line14_distort3", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorBeamFX_line14_distort4, "GiganticMeteorBeamFX_line14_distort4", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorBeamFX_ring14, "GiganticMeteorBeamFX_ring14", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorBeamFX_ring16, "GiganticMeteorBeamFX_ring16", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorBeamFX_shockwaveup01, "GiganticMeteorBeamFX_shockwaveup01", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorBeamFX_Wave, "GiganticMeteorBeamFX_Wave", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorChargeFX_Core, "GiganticMeteorChargeFX_Core", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorChargeFX_FireScroll, "GiganticMeteorChargeFX_FireScroll", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorChargeFX_glow12, "GiganticMeteorChargeFX_glow12", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorProjectileExplosionFX_EffectFire, "GiganticMeteorProjectileExplosionFX_EffectFire", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorProjectileExplosionFX_EraserShotVolleyPartex00, "GiganticMeteorProjectileExplosionFX_EraserShotVolleyPartex00", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorProjectileExplosionFX_EraserShotVolleyPartex01, "GiganticMeteorProjectileExplosionFX_EraserShotVolleyPartex01", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorProjectileFX_EraserShotVolleyPartex00, "GiganticMeteorProjectileFX_EraserShotVolleyPartex00", LocalAssetBundle);
		AssetLoader.LoadAsset(ref broly_obj, "broly_obj", LocalAssetBundle);
		AssetLoader.LoadAsset(ref LSSJ_Cutscene_start, "LSSJ_Cutscene_start", LocalAssetBundle);
		AssetLoader.LoadAsset(ref BrolyEnergyShieldFX, "BrolyEnergyShieldFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref BrolyKiChargeEndFX, "BrolyKiChargeEndFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref BrolyKiChargeEnd_LSSJ_FX, "BrolyKiChargeEnd_LSSJ_FX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref BrolyKiChargeFX, "BrolyKiChargeFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref BrolyKiCharge_LSSJ_FX, "BrolyKiCharge_LSSJ_FX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserCannonChargeFX, "EraserCannonChargeFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserCannonExplosionFX, "EraserCannonExplosionFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserCannonProjectileFX, "EraserCannonProjectileFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserShotVolleyExplosionFX, "EraserShotVolleyExplosionFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserShotVolleyFireFX, "EraserShotVolleyFireFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref EraserShotVolleyFX, "EraserShotVolleyFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref ExplosiveWaveChargeFX, "ExplosiveWaveChargeFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref ExplosiveWaveFX, "ExplosiveWaveFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticCharge_Dash_FX, "GiganticCharge_Dash_FX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticCharge_Start_FX, "GiganticCharge_Start_FX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticClusterExplosionFX, "GiganticClusterExplosionFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticClusterProjectileFX, "GiganticClusterProjectileFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorBeamFX, "GiganticMeteorBeamFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorChargeFX, "GiganticMeteorChargeFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorProjectileExplosionFX, "GiganticMeteorProjectileExplosionFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref GiganticMeteorProjectileFX, "GiganticMeteorProjectileFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref OmegaBlasterChargeFX, "OmegaBlasterChargeFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref OmegaBlasterExplosionFX, "OmegaBlasterExplosionFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref OmegaBlasterProjectileFX, "OmegaBlasterProjectileFX", LocalAssetBundle);
		AssetLoader.LoadAsset(ref CustomHairHolder, "CustomHairHolder", LocalAssetBundle);
		AssetLoader.LoadAsset(ref LSSJ_Transformation_Explosion_FX, "LSSJ_Transformation_Explosion_FX", LocalAssetBundle);
	}
}
[BepInPlugin("com.Kingpinush.BrolyZMod", "BrolyZMod", "1.0.1")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class BrolyCharacterMainPlugin : BaseUnityPlugin
{
	public const string MOD_NAME = "BrolyZMod";

	public const string MOD_UID = "com.Kingpinush.BrolyZMod";

	private BrolyCharacterRegistration m_characterRegistration;

	private void Awake()
	{
		EnergyShieldBuff.Register();
		m_characterRegistration = new BrolyCharacterRegistration();
	}
}
public class BrolyCharacterRegistration : CharacterRegistrationBase
{
	public static string CharacterName = "Broly";

	public static string CharacterAssetPrefabName = "broly_obj";

	public static string CharacterPrefabName = "BrolyBody";

	public BrolyCharacterRegistration()
	{
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Expected O, but got Unknown
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Expected O, but got Unknown
		MainPlugin.DebugLog("BrolyCharacterRegistration Constructed!");
		BrolyAssets.PopulateAssets();
		GameObject val = BrolyAssets.broly_obj;
		if ((Object)(object)val == (Object)null && (Object)(object)BrolyAssets.LocalAssetBundle != (Object)null)
		{
			val = BrolyAssets.LocalAssetBundle.LoadAsset<GameObject>(CharacterAssetPrefabName);
		}
		if ((Object)(object)val == (Object)null)
		{
			MainPlugin.DebugLog("PlayableBroly: broly_assetbundle / broly_obj missing. Skipping character registration.");
			return;
		}
		CharacterModDataManager.AddCharacterNameData(CharacterName, CharacterAssetPrefabName, CharacterPrefabName);
		base.m_cachedCharacterName = CharacterName;
		Texture texture = (Texture)(object)BrolyAssets.BrolyIcon.texture;
		((CharacterRegistrationBase)this).RegisterCharacter(CharacterName, typeof(BrolyCharacterModelSwap), texture, val, 1, 1, 1, 2, 1);
		((CharacterRegistrationBase)this).SetupProjectiles();
		TransformationBank.SetupDefaultRuntimeTransformationIndexes_Delegate = (SetupDefaultRuntimeTransformationIndexes_DelegateDeclaration)Delegate.Combine((Delegate?)(object)TransformationBank.SetupDefaultRuntimeTransformationIndexes_Delegate, (Delegate?)new SetupDefaultRuntimeTransformationIndexes_DelegateDeclaration(SetupDefaultRuntimeTransformationIndexes_Hook));
		((CharacterRegistrationBase)this).SetupValidTransformationIndexes(ref CharacterModDataManager.GetCharacterNameData(base.m_cachedCharacterName));
	}

	protected override CharacterSkinDefinition[] GetSkinDefinitions()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		return (CharacterSkinDefinition[])(object)new CharacterSkinDefinition[1]
		{
			new CharacterSkinDefinition("Default", CustomColors.LegendaryGreen)
		};
	}

	protected override void RegisterComponents(GameObject mainBody, GameObject displayBody, CharacterModData cmd)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		((CharacterRegistrationBase)this).RegisterComponents(mainBody, displayBody, cmd);
		mainBody.AddComponent<BrolyTransformationData>();
		displayBody.AddComponent<BrolyTransformationData>();
		mainBody.AddComponent<BrolyTransformationHandler>();
		mainBody.AddComponent<BrolyDuoSkillHandler>();
		mainBody.AddComponent<PoweredShellPassive>();
	}

	protected override void RegisterKiHandler(GameObject mainBody)
	{
		mainBody.AddComponent<BrolyKiHandler>();
	}

	protected override Animator GetStartingModelAnimator(ref GameObject characterPrefab)
	{
		return ((Component)MainPlugin.FindTransformRecursive(characterPrefab.transform, "BrolyModel")).GetComponent<Animator>();
	}

	protected override Transform FindPrimarySkinHost(Transform modelRoot)
	{
		if ((Object)(object)modelRoot == (Object)null)
		{
			return null;
		}
		Transform val = MainPlugin.FindTransformRecursive(modelRoot, "BrolyModel");
		if ((Object)(object)val != (Object)null && (Object)(object)val.Find("Skin_0") != (Object)null)
		{
			return val;
		}
		return ((CharacterRegistrationBase)this).FindPrimarySkinHost(modelRoot);
	}

	protected override void SetupHurtboxes(Transform bodyRoot, Transform visualRoot, HealthComponent healthComponent)
	{
		MainPlugin.DebugLog("SetupHurtboxes() for Broly!");
		Transform val = MainPlugin.FindTransformRecursive(visualRoot, "BrolyModel");
		Transform val2 = MainPlugin.FindTransformRecursive(visualRoot, "BrolyModel_LSSJ");
		((CharacterRegistrationBase)this).BindHurtBoxes(bodyRoot, healthComponent, (Transform[])(object)new Transform[2] { val, val2 });
	}

	protected override void SetupAIDrivers(ref GameObject characterMasterGO)
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		((CharacterRegistrationBase)this).SetupAIDrivers(ref characterMasterGO);
		((AISkillDriver)((CharacterRegistrationBase)this).CreateRangedAISkillDriver(ref characterMasterGO, (SkillSlot)1, EraserShotVolleySkill.m_skillName)).minDistance = 10f;
		((AISkillDriver)((CharacterRegistrationBase)this).CreateMeleeAISkillDriver(ref characterMasterGO, (SkillSlot)1, "Bloody Smash")).buttonPressType = (ButtonPressType)0;
		((AISkillDriver)((CharacterRegistrationBase)this).CreateMeleeAISkillDriver(ref characterMasterGO, (SkillSlot)1, "Gigantic Strike")).buttonPressType = (ButtonPressType)0;
		((CharacterRegistrationBase)this).CreateKiChargeAISkillDriver(ref characterMasterGO, (SkillSlot)2, "Ki Charge");
		ModAISkillDriver obj = ((CharacterRegistrationBase)this).CreateMeleeAISkillDriver(ref characterMasterGO, (SkillSlot)2, "Gigantic Charge");
		((AISkillDriver)obj).buttonPressType = (ButtonPressType)0;
		((AISkillDriver)obj).minDistance = 6f;
		((AISkillDriver)obj).maxDistance = 22f;
		ModAISkillDriver obj2 = ((CharacterRegistrationBase)this).CreateRangedAISkillDriver(ref characterMasterGO, (SkillSlot)3, "Gigantic Meteor");
		((AISkillDriver)obj2).maxDistance = 60f;
		((AISkillDriver)obj2).movementType = (MovementType)2;
		ModAISkillDriver obj3 = ((CharacterRegistrationBase)this).CreateRangedAISkillDriver(ref characterMasterGO, (SkillSlot)3, "Eraser Cannon");
		((AISkillDriver)obj3).maxDistance = 60f;
		((AISkillDriver)obj3).movementType = (MovementType)2;
	}

	protected override void RegisterSkills(GameObject characterPrefab, SkillLocator locator)
	{
		((CharacterRegistrationBase)this).RegisterSkills(characterPrefab, locator);
		SkillFamily skillFamily = locator.primary.skillFamily;
		SkillFamily skillFamily2 = locator.secondary.skillFamily;
		SkillFamily skillFamily3 = locator.utility.skillFamily;
		SkillFamily skillFamily4 = locator.special.skillFamily;
		((CharacterRegistrationBase)this).Register_Skill<BrolyMeleeStrikeSkill>(skillFamily, typeof(BrolyMeleeStrikeSkill), "Gigantic Strike", BrolyMeleeStrikeSkill.GetSkillDescription(), BaseAssets.MeleeStrikeSkillIcon, false, 0f, 0f, 0, 1f);
		((CharacterRegistrationBase)this).Register_Skill<BloodySmash_GrabStart>(skillFamily2, typeof(BloodySmash_GrabStart), "Bloody Smash", BloodySmash_GrabStart.GetSkillDescription(), BaseAssets.MeleeSkillIcon, false, 20f, 0f, 1, 5f);
		((CharacterRegistrationBase)this).Register_Skill<GiganticStrike_GrabStart>(skillFamily2, typeof(GiganticStrike_GrabStart), "Gigantic Strike", GiganticStrike_GrabStart.GetSkillDescription(), BaseAssets.MeleeSkillIcon, false, 20f, 0f, 1, 5f);
		((CharacterRegistrationBase)this).Register_Skill<EraserShotVolleySkill>(skillFamily2, typeof(EraserShotVolleySkill), EraserShotVolleySkill.m_skillName, EraserShotVolleySkill.GetSkillDescription(), BaseAssets.EnergySkillIcon, false, 15f, 0f, 1, 5f);
		((CharacterRegistrationBase)this).Register_Skill<GiganticChargeSkill>(skillFamily3, typeof(GiganticChargeSkill), "Gigantic Charge", GiganticChargeSkill.GetSkillDescription(), BaseAssets.MeleeSkillIcon, false, 20f, 0f, 1, 6f);
		((CharacterRegistrationBase)this).Register_Skill<BrolyKichargeSkill>(skillFamily3, typeof(BrolyKichargeSkill), "Ki Charge", BrolyKichargeSkill.GetSkillDescription(), BaseAssets.KiChargeSkillIcon, false, 0f, 0f, 1, 8f);
		((CharacterRegistrationBase)this).Register_Skill<EraserCannonSkill>(skillFamily4, typeof(EraserCannonSkill), "Eraser Cannon", EraserCannonSkill.GetSkillDescription(), BaseAssets.EnergySkillIcon, true, 80f, 0f, 1, 10f);
		((CharacterRegistrationBase)this).Register_Skill<GiganticMeteorSkill>(skillFamily4, typeof(GiganticMeteorSkill), "Gigantic Meteor", GiganticMeteorSkill.GetSkillDescription(), BaseAssets.EnergySkillIcon, true, 100f, 0f, 1, 10f);
		CharacterModSkillsHandler component = characterPrefab.GetComponent<CharacterModSkillsHandler>();
		((CharacterRegistrationBase)this).Register_Skill<GiganticClusterSkill>(component.ultimate.skillFamily, typeof(GiganticClusterSkill), "Gigantic Cluster", GiganticClusterSkill.GetSkillDescription(), BaseAssets.EnergySkillIcon, true, 60f, 0f, 1, 10f);
		((CharacterRegistrationBase)this).Register_Skill<ExplosiveWaveSkill>(component.ultimate.skillFamily, typeof(ExplosiveWaveSkill), ExplosiveWaveSkill.SkillName, ExplosiveWaveSkill.GetSkillDescription(), BaseAssets.EnergySkillIcon, true, 200f, 0f, 1, 10f);
		((CharacterRegistrationBase)this).Register_Skill<OmegaBlasterSkill>(component.ultimate.skillFamily, typeof(OmegaBlasterSkill), "Omega Blaster", OmegaBlasterSkill.GetSkillDescription(), BaseAssets.EnergySkillIcon, true, 400f, 0f, 1, 10f);
		((CharacterRegistrationBase)this).Register_Skill<DoubleEraserCannonSkill>(component.ultimate.skillFamily, typeof(DoubleEraserCannonSkill), "Double Eraser Cannon", DoubleEraserCannonSkill.GetSkillDescription(), BaseAssets.EnergySkillIcon, true, 80f, 0f, 1, 10f);
	}

	protected override void OnCharacterDeath(GameObject characterGO)
	{
		MainPlugin.PlayVoiceSoundEvent(characterGO, BrolySounds.brl_death_voices, 100);
	}

	protected override void OnCharacterReadyUp(GameObject sourceGo)
	{
		MainPlugin.PlayVoiceSoundEvent(sourceGo, BrolySounds.brl_readyup_voice, 100);
	}

	protected override void SetupProjectiles()
	{
		EraserShotVolleySkill.SetupProjectiles();
		GiganticMeteorSkill.SetupProjectiles();
		EraserCannonSkill.SetupProjectiles();
		GiganticClusterSkill.SetupProjectiles();
		OmegaBlasterSkill.SetupProjectiles();
	}

	protected override void RegisterOtherStates()
	{
		((CharacterRegistrationBase)this).RegisterOtherStates();
		MainPlugin.RegisterEntityStateUnique<GiganticMeteorChargeSkill>();
		MainPlugin.RegisterEntityStateUnique<EraserCannonFireSkill>();
		MainPlugin.RegisterEntityStateUnique<BloodySmash_GrabSlam>();
		MainPlugin.RegisterEntityStateUnique<BloodySmash_Attack>();
		MainPlugin.RegisterEntityStateUnique<GiganticStrike_Throw>();
		MainPlugin.RegisterEntityStateUnique<LegendarySuperSaiyanTransformationCutsceneState>();
	}

	protected override void RegisterPassiveSkillInfo(SkillLocator locator)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		locator.passiveSkill.skillDescriptionToken = ((CharacterRegistrationBase)this).CreateBasePassiveDescription() + "\nBroly's Ki can " + MainPlugin.ColorText("Overflow", MainPlugin.ColorToHex(CustomColors.LegendaryGreen)) + " generating a " + MainPlugin.ColorText("Powered Shell", "#097CFF") + " that grants projectile immunity and reduces incoming damage!";
		locator.passiveSkill.skillNameToken = "Legendary Saiyan Blood";
		locator.passiveSkill.icon = BaseAssets.TransformationSkillIcon;
	}

	private void SetupDefaultRuntimeTransformationIndexes_Hook(string characterName)
	{
		if (base.m_cachedCharacterName == characterName)
		{
			TransformationBank.AddChosenRuntimeTransformationIndex_Unsorted(TransformationBank.FindLoadedTransformationIndex("Base Form"));
			TransformationBank.AddChosenRuntimeTransformationIndex_Unsorted(TransformationBank.FindLoadedTransformationIndex("Super Saiyan A Type"));
			TransformationBank.AddChosenRuntimeTransformationIndex_Unsorted(TransformationBank.FindLoadedTransformationIndex("Super Saiyan C Type"));
			TransformationBank.AddChosenRuntimeTransformationIndex_Unsorted(TransformationBank.FindLoadedTransformationIndex("Legendary Super Saiyan"));
			TransformationBank.AddChosenRuntimeTransformationIndex_Unsorted(TransformationBank.FindLoadedTransformationIndex("Kaioken None"));
		}
	}

	protected override void SetupValidTransformationIndexes(ref CharacterModData cmd)
	{
		cmd.ValidMainTransformationsIndexes.Add(TransformationBank.FindLoadedTransformationIndex("Super Saiyan A Type"));
		cmd.ValidMainTransformationsIndexes.Add(TransformationBank.FindLoadedTransformationIndex("Super Saiyan C Type"));
		cmd.ValidMainTransformationsIndexes.Add(TransformationBank.FindLoadedTransformationIndex("Legendary Super Saiyan"));
		cmd.ValidMainTransformationsIndexes.Add(TransformationBank.FindLoadedTransformationIndex("Legendary Super Saiyan 3"));
	}

	protected override void RegisterStats(CharacterBody characterBody)
	{
		characterBody.baseJumpPower = 20f;
		characterBody.baseJumpCount = 2;
		characterBody.baseMaxHealth = 240f;
		characterBody.levelMaxHealth = 28f;
		characterBody.baseRegen = 2f;
		characterBody.levelRegen = 0.22f;
		characterBody.baseArmor = 16f;
		characterBody.baseDamage = 13f;
		characterBody.levelDamage = 2f;
		characterBody.baseMoveSpeed = 9f;
	}

	protected override void CallSpawnCharacterMenuDisplay()
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)BrolyAssets.LocalAssetBundle == (Object)null))
		{
			CharacterRegistrationBase.SpawnCharacterMenuDisplay(BrolyAssets.LocalAssetBundle.LoadAsset<GameObject>(CharacterAssetPrefabName), new Vector3(10f, 1.2f, 0f));
		}
	}

	protected override string CreateOutroText()
	{
		return "KAAAAAAKAAAAAAROOOOOOOOOT!";
	}

	protected override void SetupHooks()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		((CharacterRegistrationBase)this).SetupHooks();
		CharacterDirection.Start += new hook_Start(CharacterDirection_Start_Hook);
	}

	private void CharacterDirection_Start_Hook(orig_Start orig, CharacterDirection self)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		CharacterModData characterNameData = CharacterModDataManager.GetCharacterNameData(base.m_cachedCharacterName);
		CharacterBody component = ((Component)self).GetComponent<CharacterBody>();
		if (!Object.op_Implicit((Object)(object)component))
		{
			orig.Invoke(self);
		}
		else if (((Object)component.master.bodyPrefab).name != characterNameData.CharacterPrefabName)
		{
			orig.Invoke(self);
		}
		else
		{
			Reflection.InvokeMethod((object)self, "UpdateAuthority");
		}
	}
}
public static class BrolySounds
{
	public static readonly uint brl_blaster_meteor = 3665521272u;

	public static readonly uint brl_broly_select = 1731100115u;

	public static readonly uint brl_broly_select2 = 1093669659u;

	public static readonly uint brl_charge_voices = 1568073960u;

	public static readonly uint brl_death_voices = 1549040066u;

	public static readonly uint brl_eraser_cannon_charge = 1428461865u;

	public static readonly uint brl_eraser_cannon_fire = 4288917597u;

	public static readonly uint brl_eraser_cannon_fire_voice = 431216774u;

	public static readonly uint brl_gigantic_charge_dash = 2439716822u;

	public static readonly uint brl_gigantic_charge_start = 626531630u;

	public static readonly uint brl_gigantic_cluster_explosion = 2715837467u;

	public static readonly uint brl_gigantic_cluster_fire = 1672680006u;

	public static readonly uint brl_gigantic_strike_throw = 162316912u;

	public static readonly uint brl_grab_success = 1785347304u;

	public static readonly uint brl_kiblast_fire = 3535989775u;

	public static readonly uint brl_laughs = 1579557304u;

	public static readonly uint brl_medium_yell_voices = 3746616478u;

	public static readonly uint brl_omega_blaster_charge = 3909460716u;

	public static readonly uint brl_omega_blaster_fire = 295764116u;

	public static readonly uint brl_omega_blaster_laugh_voices = 1845461615u;

	public static readonly uint brl_omega_blaster_start_voices = 283630838u;

	public static readonly uint brl_powered_shell_passive_start = 1952662270u;

	public static readonly uint brl_powered_shell_start = 633396800u;

	public static readonly uint brl_primary_swing_voice_0 = 2234514589u;

	public static readonly uint brl_primary_swing_voice_1 = 2234514588u;

	public static readonly uint brl_primary_swing_voice_2 = 2234514591u;

	public static readonly uint brl_primary_swing_voice_3 = 2234514590u;

	public static readonly uint brl_primary_swing_voice_4 = 2234514585u;

	public static readonly uint brl_primary_swing_voice_5 = 2234514584u;

	public static readonly uint brl_primary_swing_voice_6 = 2234514587u;

	public static readonly uint brl_primary_swing_voice_7 = 2234514586u;

	public static readonly uint brl_primary_swing_voices = 764932243u;

	public static readonly uint brl_readyup_voice = 1533696335u;

	public static readonly uint brl_request_voice = 3987671486u;

	public static readonly uint brl_transform_lssj_cutscene_fast_start = 356542508u;

	public static readonly uint brl_transform_lssj_cutscene_start = 469058221u;

	public static readonly uint brl_transform_lssj_start = 1194107724u;

	public static readonly uint brl_transform_ssja_voice = 2933322743u;
}
public class BrolyCharacterModelSwap : CharacterModelSwapBase
{
	protected override GameObject GetCharacterAssetPrefab()
	{
		return BrolyAssets.LocalAssetBundle.LoadAsset<GameObject>(BrolyCharacterRegistration.CharacterAssetPrefabName);
	}

	public override Vector3 GetFlightHipRotationVector(Vector3 moveDir)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		return Vector3.zero;
	}

	protected override void ApplyChestBoneLookAt()
	{
	}

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

	protected override void RegisterModelDatas(Transform rootAssetModel, int skinCount)
	{
		((CharacterModelSwapBase)this).RegisterModelData(MainPlugin.FindTransformRecursive(rootAssetModel, "BrolyModel"), skinCount);
		((CharacterModelSwapBase)this).RegisterModelData(MainPlugin.FindTransformRecursive(rootAssetModel, "BrolyModel_LSSJ"), 1);
	}

	protected override Animator DetermineAnimator(Transform ModelGo)
	{
		return ((Component)ModelGo).GetComponent<Animator>();
	}

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

	protected override void SetEyebrowMaterial(Material newMat)
	{
	}

	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 BrolyDuoSkillHandler : DuoSkillHandler
{
	protected override uint GetRequestSoundID()
	{
		return BrolySounds.brl_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 BrolyKiHandler : KiHandler, IOnTakeDamageServerReceiver
{
	private float m_percentKiToGainOnDamageTaken = 2f;

	private bool m_takeDamageReceiverRegistered;

	private bool m_listeningForClientDamage;

	public override Color GetKiBarOverflowColour()
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		return CustomColors.LegendaryGreen;
	}

	public override void Init()
	{
		RegisterDamageTakenHook();
		((KiHandler)this).Init();
	}

	protected override void OnMaxKiSet()
	{
		((KiHandler)this).OnMaxKiSet();
		((KiHandler)this).SetKiCap(((KiHandler)this).GetMaxKi() * 2f);
	}

	private void RegisterDamageTakenHook()
	{
		if (!((NetworkComponent)this).IsAuthority() && !((CharacterModComponent)this).IsServerDoppelganger())
		{
			return;
		}
		CharacterBody characterBody = ((CharacterModComponent)this).GetCharacterBody();
		if (!((Object)(object)characterBody == (Object)null) && !((Object)(object)characterBody.healthComponent == (Object)null))
		{
			if (NetworkServer.active && !m_takeDamageReceiverRegistered)
			{
				characterBody.healthComponent.AddOnTakeDamageServerReceiver((IOnTakeDamageServerReceiver)(object)this);
				m_takeDamageReceiverRegistered = true;
			}
			else if (!m_listeningForClientDamage)
			{
				GlobalEventManager.onClientDamageNotified += OnClientDamageNotified;
				m_listeningForClientDamage = true;
			}
		}
	}

	public void OnTakeDamageServer(DamageReport damageReport)
	{
		if (damageReport != null && !(damageReport.damageDealt <= 0f) && (damageReport.damageInfo == null || !damageReport.damageInfo.rejected))
		{
			GainKiFromDamageTaken();
		}
	}

	private void OnClientDamageNotified(DamageDealtMessage damageDealtMessage)
	{
		if (damageDealtMessage != null && !((Object)(object)damageDealtMessage.victim == (Object)null) && !(damageDealtMessage.damage <= 0f))
		{
			CharacterBody characterBody = ((CharacterModComponent)this).GetCharacterBody();
			if (!((Object)(object)characterBody == (Object)null) && !((Object)(object)damageDealtMessage.victim != (Object)(object)((Component)characterBody).gameObject))
			{
				GainKiFromDamageTaken();
			}
		}
	}

	private void GainKiFromDamageTaken()
	{
		((KiHandler)this).RefillKi(m_percentKiToGainOnDamageTaken);
	}

	private void OnDestroy()
	{
		if (m_listeningForClientDamage)
		{
			GlobalEventManager.onClientDamageNotified -= OnClientDamageNotified;
			m_listeningForClientDamage = false;
		}
		if (m_takeDamageReceiverRegistered)
		{
			CharacterBody characterBody = ((CharacterModComponent)this).GetCharacterBody();
			if ((Object)(object)characterBody != (Object)null && (Object)(object)characterBody.healthComponent != (Object)null)
			{
				characterBody.healthComponent.RemoveOnTakeDamageServerReceiver((IOnTakeDamageServerReceiver)(object)this);
			}
			m_takeDamageReceiverRegistered = false;
		}
	}

	private void UNetVersion()
	{
	}

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

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
		((KiHandler)this).OnDeserialize(reader, initialState);
	}
}
public class BrolyTransformationData : CharacterTransformationData
{
	public override string GetTransformationSkillName(string transformationSkillNameID)
	{
		return transformationSkillNameID switch
		{
			"TSuperSaiyanAType" => "Gigantic Cluster", 
			"TSuperSaiyanCType" => ExplosiveWaveSkill.SkillName, 
			"TLegendarySuperSaiyan" => "Omega Blaster", 
			"TLegendarySuperSaiyan3" => "Double Eraser Cannon", 
			_ => "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 BrolyTransformationHandler : TransformationHandler
{
	public static bool IsLegendarySuperSaiyan(TransformationState tState)
	{
		if (!(tState is TLegendarySuperSaiyan))
		{
			return tState is TLegendarySuperSaiyan3;
		}
		return true;
	}

	public override void OnStartTransforming(TransformationState tState)
	{
		if (!(tState is TSuperSaiyanAType) && !IsLegendarySuperSaiyan(tState))
		{
			((CharacterModComponent)this).GetNetworkHandler().PlaySoundNetworked(((Component)this).gameObject, BrolySounds.brl_medium_yell_voices, 100, true);
		}
	}

	protected override void TriggerCutsceneTransformation(MainTransformationState mTState, int nextETransformationStateIdx)
	{
		if (mTState is TSuperSaiyanAType)
		{
			TriggerSuperSaiyanACutscene(mTState, nextETransformationStateIdx);
		}
		else if (IsLegendarySuperSaiyan((TransformationState)(object)mTState))
		{
			if (((TransformationState)mTState).RuntimeValues.HasBeenUsed)
			{
				TriggerLegendarySuperSaiyanCutscene_Fast(mTState, nextETransformationStateIdx);
			}
			else
			{
				TriggerLegendarySuperSaiyanCutscene(mTState, nextETransformationStateIdx);
			}
		}
		else
		{
			((TransformationHandler)this).TriggerCutsceneTransformation(mTState, nextETransformationStateIdx);
		}
	}

	private void TriggerSuperSaiyanACutscene(MainTransformationState mTState, int tIndex)
	{
		((CharacterModComponent)this).GetNetworkHandler().PlaySoundNetworked(((Component)this).gameObject, BrolySounds.brl_transform_ssja_voice, 100, true);
		((TransformationHandler)this).DoCutsceneGenericTransformation(tIndex, 2f, 0.8f, "SSJA_Transform", true);
	}

	private void TriggerLegendarySuperSaiyanCutscene(MainTransformationState mTState, int tIndex)
	{
		LegendarySuperSaiyanTransformationCutsceneState legendarySuperSaiyanTransformationCutsceneState = new LegendarySuperSaiyanTransformationCutsceneState();
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).m_transformationTime = 8f;
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).m_transformationStateIndex = tIndex;
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).m_shakeCamera = false;
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).cutsceneTime = 9f;
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).forceToGround = false;
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).instantZoomCam = false;
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).lerpingZoomCam = false;
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).AnimationStateToPlay = "LSSJ_Transform";
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).AnimationStateToPlayLayer = ((!((CharacterModComponent)this).GetCharacterMotor().isGrounded) ? 1 : 0);
		((CharacterModComponent)this).GetEntityStateMachine().SetState((EntityState)(object)legendarySuperSaiyanTransformationCutsceneState);
	}

	private void TriggerLegendarySuperSaiyanCutscene_Fast(MainTransformationState mTState, int tIndex)
	{
		LegendarySuperSaiyanTransformationCutsceneState legendarySuperSaiyanTransformationCutsceneState = new LegendarySuperSaiyanTransformationCutsceneState();
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).m_transformationTime = 1f;
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).m_transformationStateIndex = tIndex;
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).m_shakeCamera = false;
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).cutsceneTime = 1.5f;
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).forceToGround = false;
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).instantZoomCam = false;
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).lerpingZoomCam = false;
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).AnimationStateToPlay = "LSSJ_Transform";
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).AnimationStateToPlayLayer = ((!((CharacterModComponent)this).GetCharacterMotor().isGrounded) ? 1 : 0);
		legendarySuperSaiyanTransformationCutsceneState.STARTING_EFFECT_TIME = 0.1f;
		legendarySuperSaiyanTransformationCutsceneState.STARTING_EXPLOSION_TIME = 0.2f;
		legendarySuperSaiyanTransformationCutsceneState.SOUND_ID_TO_PLAY = BrolySounds.brl_transform_lssj_cutscene_fast_start;
		((TransformationCutsceneState)legendarySuperSaiyanTransformationCutsceneState).m_invulnerableForMainTransformation = false;
		legendarySuperSaiyanTransformationCutsceneState.m_dealDamage = false;
		((CharacterModComponent)this).GetEntityStateMachine().SetState((EntityState)(object)legendarySuperSaiyanTransformationCutsceneState);
	}

	protected override void OnTransformedFirstTime(MainTransformationState mTState)
	{
		((TransformationHandler)this).OnTransformedFirstTime(mTState);
		if (mTState is TSuperSaiyanAType)
		{
			((CharacterModComponent)this).GetNetworkHandler().PlaySoundNetworked(((Component)this).gameObject, BaseSounds.transformation, 100, false);
			((TransformationHandler)this).CreateStartAura(((TransformationState)mTState).GetStartAura(), 10f);
		}
		if (IsLegendarySuperSaiyan((TransformationState)(object)mTState))
		{
			((CharacterModComponent)this).GetNetworkHandler().PlaySoundNetworked(((Component)this).gameObject, BrolySounds.brl_transform_lssj_start, 100, true);
		}
	}

	public override bool IsMainTransformationAvailable(MainTransformationState mTState, bool includeHidden = true)
	{
		if (IsLegendarySuperSaiyan((TransformationState)(object)mTState) && !((TransformationHandler)this).GetKiHandler().IsKiOverflowing())
		{
			return false;
		}
		return ((TransformationHandler)this).IsMainTransformationAvailable(mTState, includeHidden);
	}

	protected override bool CanPerformInstantTransformation(MainTransformationState mTState)
	{
		if (IsLegendarySuperSaiyan((TransformationState)(object)mTState))
		{
			return false;
		}
		return ((TransformationHandler)this).CanPerformInstantTransformation(mTState);
	}

	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 PoweredShellPassive : CharacterModComponent
{
	public const string SkillName = "Powered Shell";

	private BrolyKiHandler m_kiHandler;

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

	protected override void InternalUpdate()
	{
		if (!NetworkServer.active)
		{
			return;
		}
		CharacterBody characterBody = ((CharacterModComponent)this).GetCharacterBody();
		if ((Object)(object)characterBody == (Object)null || (Object)(object)m_kiHandler == (Object)null)
		{
			return;
		}
		bool num = ((KiHandler)m_kiHandler).IsKiOverflowing();
		bool flag = characterBody.HasBuff(EnergyShieldBuff.s_buffDef);
		if (num)
		{
			if (!flag)
			{
				characterBody.AddBuff(EnergyShieldBuff.s_buffDef);
			}
		}
		else if (flag)
		{
			characterBody.RemoveBuff(EnergyShieldBuff.s_buffDef);
		}
	}

	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 static class EnergyShieldBuff
{
	public const string BuffName = "BrolyEnergyShield";

	public const float DamageReduction = 0.2f;

	public static BuffDef s_buffDef;

	private static readonly Dictionary<CharacterBody, GameObject> s_activeShieldFX = new Dictionary<CharacterBody, GameObject>();

	public static void Register()
	{
		//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_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Expected O, but got Unknown
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Expected O, but got Unknown
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Expected O, but got Unknown
		s_buffDef = ScriptableObject.CreateInstance<BuffDef>();
		((Object)s_buffDef).name = "BrolyEnergyShield";
		s_buffDef.canStack = false;
		s_buffDef.isDebuff = false;
		s_buffDef.iconSprite = BaseAssets.UtilitySkillIcon;
		s_buffDef.buffColor = Color.white;
		ContentAddition.AddBuffDef(s_buffDef);
		HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage_Hook);
		CharacterBody.OnBuffFirstStackGained += new hook_OnBuffFirstStackGained(CharacterBody_OnBuffFirstStackGained);
		CharacterBody.OnBuffFinalStackLost += new hook_OnBuffFinalStackLost(CharacterBody_OnBuffFinalStackLost);
	}

	private static void CharacterBody_OnBuffFirstStackGained(orig_OnBuffFirstStackGained orig, CharacterBody self, BuffDef buffDef)
	{
		orig.Invoke(self, buffDef);
		if (!((Object)(object)buffDef != (Object)(object)s_buffDef) && !((Object)(object)self == (Object)null))
		{
			((Component)self).GetComponent<NetworkHandler>().PlaySoundNetworked(((Component)self).gameObject, BrolySounds.brl_powered_shell_passive_start, 100, false);
			SpawnShieldFX(self);
		}
	}

	private static void CharacterBody_OnBuffFinalStackLost(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef)
	{
		orig.Invoke(self, buffDef);
		if (!((Object)(object)buffDef != (Object)(object)s_buffDef) && !((Object)(object)self == (Object)null))
		{
			DestroyShieldFX(self);
		}
	}

	private static void SpawnShieldFX(CharacterBody body)
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		if (!s_activeShieldFX.TryGetValue(body, out var value) || !((Object)(object)value != (Object)null))
		{
			GameObject val = MainPlugin.SpawnFX(BrolyAssets.BrolyEnergyShieldFX, ((Component)body).transform.position, Quaternion.identity, -1f);
			if (!((Object)(object)val == (Object)null))
			{
				val.transform.SetParent(((Component)body).transform);
				val.transform.localPosition = Vector3.up * 0.7f;
				s_activeShieldFX[body] = val;
			}
		}
	}

	private static void DestroyShieldFX(CharacterBody body)
	{
		if (s_activeShieldFX.TryGetValue(body, out var value))
		{
			s_activeShieldFX.Remove(body);
			if ((Object)(object)value != (Object)null)
			{
				Object.Destroy((Object)(object)value);
			}
		}
	}

	private static void HealthComponent_TakeDamage_Hook(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
	{
		if (NetworkServer.active && (Object)(object)self != (Object)null && (Object)(object)self.body != (Object)null && (Object)(object)s_buffDef != (Object)null && self.body.HasBuff(s_buffDef) && damageInfo != null && !damageInfo.rejected)
		{
			if ((Object)(object)damageInfo.inflictor != (Object)null && (Object)(object)damageInfo.inflictor.GetComponent<ProjectileController>() != (Object)null)
			{
				damageInfo.rejected = true;
			}
			else
			{
				damageInfo.damage *= 0.8f;
			}
		}
		orig.Invoke(self, damageInfo);
	}
}
public class LegendarySuperSaiyanTransformationCutsceneState : TransformationCutsceneState
{
	private Timer m_cameraTimer;

	private Timer m_firstEffectTimer;

	private Timer m_explosionTime;

	private Timer m_ppTime;

	private float m_currentCameraScale = 1f;

	private float m_currentExplosionScale = 1f;

	public float STARTING_EFFECT_TIME = 1.9f;

	public float STARTING_EXPLOSION_TIME = 6.6f;

	public float EXPLOSION_SCALING_PER_SECOND = 1f;

	public float COLOR_GRADE_TIME = 2f;

	public float EXPLOSION_DAMAGE_MULT = 10f;

	public float EXPLOSION_DAMAGE_RADIUS = 35f;

	public bool m_dealDamage = true;

	public uint SOUND_ID_TO_PLAY = BrolySounds.brl_transform_lssj_cutscene_start;

	private GameObject m_explosionFX;

	public override void OnEnter()
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Expected O, but got Unknown
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Expected O, but got Unknown
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Expected O, but got Unknown
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Expected O, but got Unknown
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_011e: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		((TransformationCutsceneState)this).OnEnter();
		if (((EntityState)this).isAuthority)
		{
			((CharacterModSkillState)this).GetKiHandler().SetLockCurrentKi(true);
			m_cameraTimer = new Timer(0.2f, (Action)ZoomOutCamera, (Action)null, (Action)null, true);
			m_cameraTimer.Restart();
			m_firstEffectTimer = new Timer(STARTING_EFFECT_TIME, (Action)PlayFirstEffect, (Action)null, (Action)null, false);
			m_firstEffectTimer.Restart();
			m_explosionTime = new Timer(STARTING_EXPLOSION_TIME, (Action)PlayFirstExplosionEffect, (Action)null, (Action)null, false);
			m_explosionTime.Restart();
			m_ppTime = new Timer(COLOR_GRADE_TIME, (Action)null, (Action)null, (Action)UpdatePPEffects, false);
			((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((EntityState)this).gameObject, SOUND_ID_TO_PLAY, 100, true);
			bool flag = default(bool);
			((CharacterModSkillState)this).AddCameraPositionOverride(((CharacterModSkillState)this).GetCalculatedOriginalCameraPosition(ref flag) * 2f, "LegendarySuperSaiyanTransformationCutsceneState");
			Wave val = new Wave
			{
				amplitude = 0.05f,
				frequency = 90f,
				cycleOffset = 0f
			};
			ShakeEmitter.CreateSimpleShakeEmitter(((EntityState)this).transform.position, val, STARTING_EFFECT_TIME, 1000f, false);
		}
	}

	public override void Update()
	{
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		((TransformationCutsceneState)this).Update();
		if (((EntityState)this).isAuthority)
		{
			FullscreenColorGrade.Tick();
			m_cameraTimer.Update(Time.deltaTime);
			m_firstEffectTimer.Update(Time.deltaTime);
			m_explosionTime.Update(Time.deltaTime);
			m_ppTime.Update(Time.deltaTime);
			if (m_explosionTime.HasElapsed() && (Object)(object)m_explosionFX != (Object)null)
			{
				CharacterModSkillState.ScaleFxViaParticleEffectScaler(m_explosionFX, m_currentExplosionScale);
				m_currentExplosionScale += EXPLOSION_SCALING_PER_SECOND * Time.deltaTime;
			}
			if (((EntityState)this).fixedAge <= base.m_transformationTime)
			{
				bool flag = default(bool);
				((CharacterModSkillState)this).AddCameraPositionOverride(((CharacterModSkillState)this).GetCalculatedOriginalCameraPosition(ref flag) * m_currentCameraScale, "LegendarySuperSaiyanTransformationCutsceneState");
			}
		}
	}

	public override void OnExit()
	{
		((TransformationCutsceneState)this).OnExit();
		((CharacterModSkillState)this).GetKiHandler().SetLockCurrentKi(false);
		FullscreenColorGrade.End();
	}

	private void UpdatePPEffects()
	{
		if (!((Object)(object)m_explosionFX == (Object)null))
		{
			float ratioInverse = m_ppTime.GetRatioInverse();
			float num = 33f;
			float num2 = 0f;
			float num3 = 0f;
			float num4 = 0f;
			if (ratioInverse < 0.5f)
			{
				float num5 = ratioInverse / 0.5f;
				num4 = 1f;
				num2 = 0f;
				num3 = Mathf.Lerp(0f, 80f, num5);
			}
			else
			{
				float num6 = (ratioInverse - 0.5f) / 0.5f;
				num2 = Mathf.Lerp(0f, -75f, num6);
				num3 = Mathf.Lerp(80f, 0f, num6);
				num4 = Mathf.Lerp(1f, 0f, num6);
			}
			FullscreenColorGrade.Apply(m_explosionFX, num, num2, num3, num4);
		}
	}

	private void ZoomOutCamera()
	{
		m_currentCameraScale += 0.05f;
	}

	private void PlayFirstEffect()
	{
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: 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_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		((CharacterModSkillState)this).GetTransformationHandler().CreateStartAura(BrolyAssets.LSSJ_Cutscene_start, base.cutsceneTime - ((EntityState)this).fixedAge);
		((CharacterModSkillState)this).GetNetworkHandler().SpawnFXNetworked(BrolyAssets.LSSJ_Cutscene_start, ((EntityState)this).transform.position, Quaternion.identity, base.cutsceneTime - ((EntityState)this).fixedAge, -1f, false);
		Wave val = new Wave
		{
			amplitude = 0.1f,
			frequency = 180f,
			cycleOffset = 0f
		};
		ShakeEmitter.CreateSimpleShakeEmitter(((EntityState)this).transform.position, val, base.cutsceneTime - ((EntityState)this).fixedAge, 1000f, false);
	}

	private void PlayFirstExplosionEffect()
	{
		//IL_0002: 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_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_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_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		Wave val = new Wave
		{
			amplitude = 2f,
			frequency = 180f,
			cycleOffset = 0f
		};
		ShakeEmitter.CreateSimpleShakeEmitter(((EntityState)this).transform.position, val, 2f, 1000f, true);
		m_explosionFX = MainPlugin.SpawnFX(BrolyAssets.LSSJ_Transformation_Explosion_FX, ((EntityState)this).transform.position, Quaternion.identity, 5f);
		((CharacterModSkillState)this).GetNetworkHandler().SpawnFXNetworked(BrolyAssets.LSSJ_Transformation_Explosion_FX, ((EntityState)this).transform.position, Quaternion.identity, 5f, -1f, false);
		FullscreenColorGrade.Begin(m_explosionFX);
		((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((EntityState)this).gameObject, BaseSounds.explosion_1, 100, false);
		m_ppTime.Restart();
		bool flag = default(bool);
		((CharacterModSkillState)this).AddCameraPositionOverride(((CharacterModSkillState)this).GetCalculatedOriginalCameraPosition(ref flag) * 4f, "LegendarySuperSaiyanTransformationCutsceneState");
		if (m_dealDamage)
		{
			Vector3 position = ((EntityState)this).transform.position;
			float eXPLOSION_DAMAGE_RADIUS = EXPLOSION_DAMAGE_RADIUS;
			LayerIndex entityPrecise = LayerIndex.entityPrecise;
			Collider[] array = Physics.OverlapSphere(position, eXPLOSION_DAMAGE_RADIUS, LayerMask.op_Implicit(((LayerIndex)(ref entityPrecise)).mask));
			((CharacterModSkillState)this).ColliderDamage(array, EXPLOSION_DAMAGE_MULT, 1f, 0f, (DamageType)0, default(Vector3), (GameObject)null, (List<HurtBoxGroup>)null);
		}
	}

	protected override void OnTransformed()
	{
		((TransformationCutsceneState)this).OnTransformed();
		((CharacterModSkillState)this).ResetCameraPosition();
	}
}
public class BrolyMeleeStrikeSkill : MeleeStrikeSkill
{
	public const float SkillCooldown = 1f;

	public const string m_skillName = "Gigantic Strike";

	public static string GetSkillDescription()
	{
		return MeleeStrikeSkill.GetBaseSkillDescription();
	}

	protected override string ConstructMeleeAttackAnimName(int num)
	{
		if (num < 10)
		{
			return $"EIB_ATC_00{num}";
		}
		return $"EIB_ATC_0{num}";
	}

	protected override uint GetSwingVoiceSoundID(int voiceIdx)
	{
		return BrolySounds.brl_primary_swing_voices;
	}

	protected override void InitMeleeAttackData()
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Unknown result type (might be due to invalid IL or missing references)
		base.m_meleeAttacks = (MeleeAttackData[])(object)new MeleeAttackData[7]
		{
			new MeleeAttackData(((MeleeStrikeSkill)this).ConstructMeleeAttackAnimStateName(0), ((MeleeStrikeSkill)this).ConstructMeleeAttackAnimName(10), 0, BaseSounds.primary_swing_0, 0, 0.21f, 0.25f, true),
			new MeleeAttackData(((MeleeStrikeSkill)this).ConstructMeleeAttackAnimStateName(1), ((MeleeStrikeSkill)this).ConstructMeleeAttackAnimName(1), 0, BaseSounds.primary_swing_0, 1, 0.25f, 0.25f, false),
			new MeleeAttackData(((MeleeStrikeSkill)this).ConstructMeleeAttackAnimStateName(2), ((MeleeStrikeSkill)this).ConstructMeleeAttackAnimName(2), 0, BaseSounds.primary_swing_0, 0, 0.29f, 0.25f, true),
			new MeleeAttackData(((MeleeStrikeSkill)this).ConstructMeleeAttackAnimStateName(3), ((MeleeStrikeSkill)this).ConstructMeleeAttackAnimName(3), 0, BaseSounds.primary_swing_0, 1, 0.16f, 0.25f, false),
			new MeleeAttackData(((MeleeStrikeSkill)this).ConstructMeleeAttackAnimStateName(4), ((MeleeStrikeSkill)this).ConstructMeleeAttackAnimName(4), 0, BaseSounds.primary_swing_0, 0, 0.31f, 0.25f, true),
			new MeleeAttackData(((MeleeStrikeSkill)this).ConstructMeleeAttackAnimStateName(5), ((MeleeStrikeSkill)this).ConstructMeleeAttackAnimName(5), 0, BaseSounds.primary_swing_0, 1, 0.28f, 0.25f, false),
			new MeleeAttackData(((MeleeStrikeSkill)this).ConstructMeleeAttackAnimStateName(6), ((MeleeStrikeSkill)this).ConstructMeleeAttackAnimName(8), 0, BaseSounds.primary_swing_1, 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, 0f, 0f), true);
	}
}
public class BloodySmash_Attack : CharacterModSkillState
{
	public const string AttackAnimStateName = "Bloody_Smash_Skill_Attack";

	public const string AttackAnimClipName = "BRL_Grab_Attack";

	public const float AttackHitTimeScaled = 0.15f;

	private float m_animDuration;

	private bool m_hasDamaged;

	public override void OnEnter()
	{
		((CharacterModSkillState)this).OnEnter();
		base.m_canBeStunned = false;
		m_animDuration = ((CharacterModSkillState)this).GetAnimationTime("BRL_Grab_Attack");
		((CharacterModSkillState)this).PlaySkillAnimation("Bloody_Smash_Skill_Attack", 0f, 0, true, true);
		if (((EntityState)this).isAuthority)
		{
			((CharacterModSkillState)this).SetCharacterCollisionEnabled(false);
			((CharacterModSkillState)this).AddGravityDisableCounter();
			((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((EntityState)this).gameObject, BaseSounds.transmission, 100, false);
			TeleportAboveTallestGrabbedEnemy();
		}
	}

	private void TeleportAboveTallestGrabbedEnemy()
	{
		//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_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		BrolyGrabUtil.RemoveDeadGrabbedBodies(((EntityState)this).characterBody.master);
		CharacterBody val = null;
		float num = 0f;
		List<CharacterBody> grabbedBodies = BrolyGrabUtil.GetGrabbedBodies(((EntityState)this).characterBody.master);
		for (int i = 0; i < grabbedBodies.Count; i++)
		{
			CharacterBody val2 = grabbedBodies[i];
			if (!((Object)(object)val2 == (Object)null))
			{
				float bodyHeight = GetBodyHeight(val2);
				if ((Object)(object)val == (Object)null || bodyHeight > num)
				{
					val = val2;
					num = bodyHeight;
				}
			}
		}
		if (!((Object)(object)val == (Object)null))
		{
			Vector3 position = ((EntityState)this).transform.position;
			position.y += num * 0.75f;
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.SetPosition(position, true);
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
			((EntityState)this).characterMotor.velocity = Vector3.zero;
		}
	}

	private static float GetBodyHeight(CharacterBody body)
	{
		if ((Object)(object)body.characterMotor != (Object)null)
		{
			return body.characterMotor.capsuleHeight;
		}
		CapsuleCollider component = ((Component)body).GetComponent<CapsuleCollider>();
		if ((Object)(object)component != (Object)null)
		{
			return component.height;
		}
		return body.radius;
	}

	public override void FixedUpdate()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			((EntityState)this).characterMotor.velocity = Vector3.zero;
			((EntityState)this).characterDirection.moveVector = ((CharacterModSkillState)this).GetAimRayDirectionXZ();
			if (!m_hasDamaged && ((EntityState)this).fixedAge >= m_animDuration * 0.15f)
			{
				BrolyGrabUtil.RemoveDeadGrabbedBodies(((EntityState)this).characterBody.master);
				BrolyGrabUtil.DamageGrabbedBodies(((EntityState)this).characterBody.master, ((CharacterModSkillState)this).GetNetworkHandler(), ((EntityState)this).gameObject, ((BaseState)this).damageStat, ((BaseState)this).RollCrit(), 6f);
				((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((EntityState)this).gameObject, BaseSounds.hits_medium, 100, false);
				m_hasDamaged = true;
			}
			if (((EntityState)this).fixedAge >= m_animDuration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}
	}

	public override void OnExit()
	{
		if (((EntityState)this).isAuthority)
		{
			((CharacterModSkillState)this).RemoveGravityDisableCounter();
			BrolyGrabUtil.ClearGrabbedBodies(((EntityState)this).characterBody.master);
			((CharacterModSkillState)this).PlaySkillAnimation("UpperIdle", 0f, 1, true, true);
			((CharacterModSkillState)this).PlaySkillAnimation("Idle", 0.15f, 0, true, true);
			((CharacterModSkillState)this).SetCharacterCollisionEnabled(true);
		}
		((CharacterModSkillState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		return (InterruptPriority)2;
	}
}
public class BloodySmash_GrabSlam : CharacterModSkillState
{
	public const string SlamAnimStateName = "Bloody_Smash_Skill_Slam";

	public const string SlamClipName = "BRL_Grab_Slam";

	public const float SlamHitTimeScaled = 0.3f;

	public const float SlamRadius = 6f;

	private float m_animDuration;

	private bool m_hasDamaged;

	private bool m_wantsFollowUp;

	private bool m_transitioningToAttack;

	public override void OnEnter()
	{
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		((CharacterModSkillState)this).OnEnter();
		base.m_canBeStunned = false;
		m_animDuration = ((CharacterModSkillState)this).GetAnimationTime("BRL_Grab_Slam");
		((CharacterModSkillState)this).PlaySkillAnimation("Bloody_Smash_Skill_Slam", 0f, 0, true, true);
		if (((EntityState)this).isAuthority)
		{
			((CharacterModSkillState)this).AddGravityDisableCounter();
			((BaseState)this).StartAimMode(m_animDuration, true);
			base.m_characterModelSwap.SetLockHipPosition(true, new Vector3(0f, 0f, 0f), true);
			((CharacterModSkillState)this).SetCharacterCollisionEnabled(false);
			((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((EntityState)this).gameObject, BrolySounds.brl_laughs, 50, true);
		}
	}

	public override void Update()
	{
		//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_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).Update();
		if (!((EntityState)this).isAuthority)
		{
			return;
		}
		float num = Mathf.Lerp(-50f, 200f, ((EntityState)this).fixedAge / m_animDuration);
		if (((EntityState)this).inputBank.skill2.down)
		{
			m_wantsFollowUp = true;
		}
		if (!m_hasDamaged)
		{
			((EntityState)this).characterMotor.velocity = new Vector3(0f, 0f - num, 0f) + ((CharacterModSkillState)this).GetAimRayDirectionXZ();
			((EntityState)this).characterDirection.moveVector = ((Vector3)(ref ((EntityState)this).characterMotor.velocity)).normalized;
			BrolyGrabUtil.FollowGrabbedBodiesToHand(((EntityState)this).characterBody.master, ((CharacterModSkillState)this).GetNetworkHandler(), ((CharacterModSkillState)this).GetRightHandBone(), ((EntityState)this).transform.position.y);
			if (((EntityState)this).fixedAge >= m_animDuration * 0.3f && ((EntityState)this).characterMotor.isGrounded)
			{
				DealSlamDamage();
			}
		}
		else
		{
			((EntityState)this).characterMotor.velocity = Vector3.zero;
			((EntityState)this).characterDirection.moveVector = Vector3.zero;
		}
		if (((EntityState)this).fixedAge >= m_animDuration * 0.75f && BrolyGrabUtil.IsGrabbingAliveBodies(((EntityState)this).characterBody.master) && m_wantsFollowUp)
		{
			m_transitioningToAttack = true;
			((EntityState)this).outer.SetNextState((EntityState)(object)new BloodySmash_Attack());
		}
		if (((EntityState)this).fixedAge >= m_animDuration)
		{
			if (m_wantsFollowUp && BrolyGrabUtil.IsGrabbingAliveBodies(((EntityState)this).characterBody.master))
			{
				m_transitioningToAttack = true;
				((EntityState)this).outer.SetNextState((EntityState)(object)new BloodySmash_Attack());
			}
			else
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}
	}

	private void DealSlamDamage()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Expected O, but got Unknown
		Vector3 footPosition = ((EntityState)this).characterBody.footPosition;
		BrolyGrabUtil.RemoveDeadGrabbedBodies(((EntityState)this).characterBody.master);
		List<HurtBoxGroup> list = BrolyGrabUtil.GetGrabbedBodies(((EntityState)this).characterBody.master).ConvertAll((CharacterBody x) => ((Object)(object)x == (Object)null) ? null : x.hurtBoxGroup);
		BrolyGrabUtil.DamageGrabbedBodies(((EntityState)this).characterBody.master, ((CharacterModSkillState)this).GetNetworkHandler(), ((EntityState)this).gameObject, ((BaseState)this).damageStat, ((BaseState)this).RollCrit(), 8f, playAttackFx: false);
		LayerIndex entityPrecise = LayerIndex.entityPrecise;
		Collider[] array = Physics.OverlapSphere(footPosition, 6f, LayerMask.op_Implicit(((LayerIndex)(ref entityPrecise)).mask));
		((CharacterModSkillState)this).ColliderDamage(array, 8f, 1f, 0f, (DamageType)32, Vector3.down * 2000f, (GameObject)null, list);
		EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/BeetleGuardGroundSlam"), new EffectData
		{
			origin = footPosition,
			scale = ((EntityState)this).characterBody.radius
		}, true);
		((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((EntityState)this).gameObject, BaseSounds.hits_large, 100, false);
		m_hasDamaged = true;
	}

	public override void OnExit()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		if (((EntityState)this).isAuthority)
		{
			((CharacterModSkillState)this).RemoveGravityDisableCounter();
			base.m_characterModelSwap.SetLockHipPosition(false, default(Vector3), true);
			if (!m_transitioningToAttack)
			{
				BrolyGrabUtil.ClearGrabbedBodies(((EntityState)this).characterBody.master);
				((CharacterModSkillState)this).PlaySkillAnimation("UpperIdle", 0f, 1, true, true);
				((CharacterModSkillState)this).PlaySkillAnimation("Idle", 0.15f, 0, true, true);
			}
			((CharacterModSkillState)this).SetCharacterCollisionEnabled(true);
		}
		((CharacterModSkillState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		return (InterruptPriority)2;
	}
}
public class BloodySmash_GrabStart : CharacterModSkillState
{
	public const float SkillCooldown = 5f;

	public const string m_skillName = "Bloody Smash";

	public const float BaseKiCost = 20f;

	public const string StartAnimStateName = "Bloody_Smash_Skill_Start";

	public const string StartClipName = "BRL_Grab_Start";

	public const float MaxLungeSpeed = 55f;

	public const float GrabRadius = 3.2f;

	public const float GrabForwardOffset = 2f;

	public const float GrabMaxYDiff = 3f;

	private float m_animDuration;

	private bool m_transitioningToFollowUp;

	private readonly List<HurtBoxGroup> m_grabbedGroups = new List<HurtBoxGroup>();

	private readonly List<CharacterBody> m_newGrabbedBodies = new List<CharacterBody>();

	private Vector3 m_grabDirection = Vector3.zero;

	public static string GetSkillDescription()
	{
		return MainPlugin.CreateKiCostDescription(20f.ToString("n0")) + "\nLunge forward and grab enemies, then slam them into the ground, dealing " + MainPlugin.CreateDamageDescription(GetDisplaySlamDamage()) + "!\nHold the skill to follow up with another attack, dealing " + MainPlugin.CreateDamageDescription(GetDisplayAttackDamage()) + "!\n";
	}

	public static string GetDisplaySlamDamage()
	{
		return 800f.ToString();
	}

	public static string GetDisplayAttackDamage()
	{
		return 600f.ToString();
	}

	public override void OnEnter()
	{
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		((CharacterModSkillState)this).OnEnter();
		BrolyGrabUtil.ClearGrabbedBodies(((EntityState)this).characterBody.master);
		m_grabbedGroups.Clear();
		base.m_canBeStunned = false;
		m_animDuration = ((CharacterModSkillState)this).GetAnimationTime("BRL_Grab_Start");
		((CharacterModSkillState)this).PlaySkillAnimation(GetGrabStartAnimStateName(), 0.1f, 0, true, true);
		if (((EntityState)this).isAuthority)
		{
			((CharacterModSkillState)this).AddGravityDisableCounter();
			((BaseState)this).StartAimMode(m_animDuration, true);
			((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((EntityState)this).gameObject, BaseSounds.primary_swing_0, 100, false);
			((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((EntityState)this).gameObject, BrolySounds.brl_primary_swing_voices, 80, true);
			((CharacterModSkillState)this).SetCharacterCollisionEnabled(false);
			m_grabDirection = ((CharacterModSkillState)this).GetAimRayDirection();
			if (m_grabDirection == Vector3.zero)
			{
				m_grabDirection = ((EntityState)this).characterDirection.forward;
			}
			((Vector3)(ref m_grabDirection)).Normalize();
		}
	}

	public override void Update()
	{
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: 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_0064: 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_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0113: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).Update();
		if (!((EntityState)this).isAuthority)
		{
			return;
		}
		if (((EntityState)this).fixedAge >= m_animDuration * 0.25f && ((EntityState)this).fixedAge < m_animDuration * 0.6f)
		{
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
			((EntityState)this).characterDirection.moveVector = m_grabDirection;
			((EntityState)this).characterMotor.velocity = m_grabDirection * Mathf.Lerp(55f, 0f, ((CharacterModSkillState)this).GetStateDurationRatio(m_animDuration));
			TryGrabEnemiesInFront();
		}
		else
		{
			((EntityState)this).characterMotor.velocity = Vector3.Lerp(((EntityState)this).characterMotor.velocity, Vector3.zero, ((CharacterModSkillState)this).GetStateDurationRatio(m_animDuration * 0.25f));
		}
		BrolyGrabUtil.FollowGrabbedBodiesToHand(((EntityState)this).characterBody.master, ((CharacterModSkillState)this).GetNetworkHandler(), ((CharacterModSkillState)this).GetRightHandBone(), ((EntityState)this).transform.position.y);
		if (((EntityState)this).fixedAge >= m_animDuration * 0.6f)
		{
			((EntityState)this).characterMotor.velocity = Vector3.zero;
			if (BrolyGrabUtil.IsGrabbingAliveBodies(((EntityState)this).characterBody.master))
			{
				m_transitioningToFollowUp = true;
				((EntityState)this).outer.SetNextState(CreateFollowUpState());
			}
		}
		if (((EntityState)this).fixedAge >= m_animDuration)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	private void TryGrabEnemiesInFront()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_0186: Unknown result type (might be due to invalid IL or missing references)
		//IL_0188: 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_0196: Unknown result type (might be due to invalid IL or missing references)
		//IL_019b: Unknown result type (might be due to invalid IL or missing references)
		m_newGrabbedBodies.Clear();
		Vector3 val = ((EntityState)this).transform.position + ((EntityState)this).characterDirection.forward * 2f + Vector3.up;
		LayerIndex entityPrecise = LayerIndex.entityPrecise;
		Collider[] source = Physics.OverlapSphere(val, 3.2f, LayerMask.op_Implicit(((LayerIndex)(ref entityPrecise)).mask));
		source = source.Where((Collider x) => Mathf.Abs(x.ClosestPoint(((EntityState)this).transform.position).y - ((EntityState)this).transform.position.y) <= 3f).ToArray();
		Vector3 forward = ((EntityState)this).characterDirection.forward;
		for (int num = 0; num < source.Length; num++)
		{
			HurtBox hurtBox = ((Component)source[num]).GetComponent<HurtBox>();
			if ((Object)(object)hurtBox == (Object)null)
			{
				hurtBox = ((Component)source[num]).GetComponentInChildren<HurtBox>();
			}
			if ((Object)(object)hurtBox == (Object)null || (Object)(object)hurtBox.healthComponent == (Object)(object)((EntityState)this).healthComponent || (Object)(object)hurtBox.healthComponent == (Object)null || !hurtBox.healthComponent.alive || m_grabbedGroups.Where((HurtBoxGroup x) => (Object)(object)x == (Object)(object)hurtBox.hurtBoxGroup).Count() > 0 || (hurtBox.teamIndex == ((EntityState)this).teamComponent.teamIndex && (int)FriendlyFireManager.friendlyFireMode == 0))
			{
				continue;
			}
			Vector3 val2 = ((Component)hurtBox).transform.position - ((EntityState)this).transform.position;
			val2.y = 0f;
			if (val2 != Vector3.zero && Vector3.Dot(((Vector3)(ref val2)).normalized, forward) < 0f)
			{
				continue;
			}
			CharacterBody body = hurtBox.healthComponent.body;
			if (!((Object)(object)body == (Object)null) && !BrolyGrabUtil.IsWormBody(body) && !BrolyGrabUtil.IsSolusDistributor(body) && ((!body.isBoss && !body.isChampion) || BrolyTransformationHandler.IsLegendarySuperSaiyan(((CharacterModSkillState)this).GetTransformationHandler().GetCurrentTransformationState((ETransformationType)0))))
			{
				m_grabbedGroups.Add(hurtBox.hurtBoxGroup);
				m_newGrabbedBodies.Add(body);
				((CharacterModSkillState)this).GetNetworkHandler().PlaySoundNetworked(((EntityState)this).gameObject, BrolySounds.brl_grab_success, 100, false);
				SetStateOnHurt component = ((Component)body).GetComponent<SetStateOnHurt>();
				if ((Object)(object)component != (Object)null)
				{
					component.SetStun(2f);
				}
			}
		}
		BrolyGrabUtil.AddGrabbedBodies(((EntityState)this).characterBody.master, m_newGrabbedBodies);
	}

	public override void OnExit()
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		if (((EntityState)this).isAuthority)
		{
			((CharacterModSkillState)this).PlaySkillAnimation("Idle", 0.1f, 0, true, true);
			((EntityState)this).characterMotor.velocity = Vector3.zero;
			((CharacterModSkillState)this).RemoveGravityDisableCounter();
			if (!m_transitioningToFollowUp)
			{
				BrolyGrabUtil.ClearGrabbedBodies(((EntityState)this).characterBody.master);
			}
			((CharacterModSkillState)this).SetCharacterCollisionEnabled(true);
		}
		((CharacterModSkillState)this).OnExit();
	}

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

	protected virtual string GetGrabStartAnimStateName()
	{
		return "Bloody_Smash_Skill_Start";
	}

	protected virtual EntityState CreateFollowUpState()
	{
		return (EntityState)(object)new BloodySmash_GrabSlam();
	}
}
public static class BrolyGrabUtil
{
	public const float SlamDamageMult = 8f;

	public const float AttackDamageMult = 6f;

	public const float GrabStunDuration = 2f;

	public static readonly Dictionary<CharacterMaster, List<CharacterBody>> GrabbedBodies = new Dictionary<CharacterMaster, List<CharacterBody>>();

	private static readonly List<CharacterBody> s_noGrabbedBodies = new List<CharacterBody>();

	public static void AddGrabbedBodies(CharacterMaster owner, List<CharacterBody> bodies)
	{
		if ((Object)(object)owner == (Object)null || bodies == null || bodies.Count == 0)
		{
			return;
		}
		if (!GrabbedBodies.TryGetValue(owner, out var value))
		{
			value = new List<CharacterBody>();
			GrabbedBodies[owner] = value;
		}
		for (int i = 0; i < bodies.Count; i++)
		{
			CharacterBody val = bodies[i];
			if (!((Object)(object)val == (Object)null) && !value.Contains(val))
			{
				value.Add(val);
			}
		}
	}

	public static List<CharacterBody> GetGrabbedBodies(CharacterMaster owner)
	{
		if ((Object)(object)owner != (Object)null && GrabbedBodies.TryGetValue(owner, out var value))
		{
			return value;
		}
		return s_noGrabbedBodies;
	}

	public static void ClearGrabbedBodies(CharacterMaster owner)
	{
		if (!((Object)(object)owner == (Object)null))
		{
			GrabbedBodies.Remove(owner);
		}
	}

	public static void RemoveDeadGrabbedBodies(CharacterMaster owner)
	{
		List<CharacterBody> grabbedBodies = GetGrabbedBodies(owner);
		if (grabbedBodies != s_noGrabbedBodies)
		{
			grabbedBodies.RemoveAll((CharacterBody body) => (Object)(object)body == (Object)null || (Object)(object)body.healthComponent == (Object)null || !body.healthComponent.alive);
		}
	}

	public static bool IsGrabbingAliveBodies(CharacterMaster owner)
	{
		RemoveDeadGrabbedBodies(owner);
		return GetGrabbedBodies(owner).Count > 0;
	}

	public static bool IsWormBody(CharacterBody body)
	{
		if ((Object)(object)body == (Object)null)
		{
			return false;
		}
		Transform root = ((Component)body).transform.root;
		if (!((Object)(object)((Component)root).GetComponentInChildren<WormBodyPositions>(true) != (Object)null) && !((Object)(object)((Component)root).GetComponentInChildren<WormBodyPositions2>(true) != (Object)null))
		{
			return (Object)(object)((Component)root).GetComponentInChildren<WormBodyPositionsDriver>(true) != (Object)null;
		}
		return true;
	}

	public static bool IsSolusDistributor(CharacterBody body)
	{
		//IL_001b: 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)
		if ((Object)(object)body == (Object)null)
		{
			return false;
		}
		if ((Object)(object)BodyPrefabs.MinePodBody == (Object)null)
		{
			return false;
		}
		return body.bodyIndex == BodyPrefabs.MinePodBody.bodyIndex;
	}

	public static void FollowGrabbedBodiesToHand(CharacterMaster owner, NetworkHandler networkHandler, Transform grabHand, float minimumY)
	{
		//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_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		RemoveDeadGrabbedBodies(owner);
		List<CharacterBody> grabbedBodies = GetGrabbedBodies(owner);
		if (!((Object)(object)grabHand == (Object)null) && grabbedBodies.Count != 0)
		{
			Vector3 position = grabHand.position;
			position.y = Mathf.Clamp(position.y, minimumY, position.y);
			GameObject[] array = grabbedBodies.ConvertAll((CharacterBody cb) => ((Component)cb).gameObject).ToArray();
			if ((Object)(object)networkHandler != (Object)null)
			{
				networkHandler.CmdSetGrabbedMotorPositions(array, position);
			}
		}
	}

	public static void DamageGrabbedBodies(CharacterMaster owner, NetworkHandler networkHandler, GameObject attacker, float damageStatValue, bool isCrit, float damageMult, bool playAttackFx = true)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Expected O, but got Unknown
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: 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_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)
		RemoveDeadGrabbedBodies(owner);
		List<CharacterBody> grabbedBodies = GetGrabbedBodies(owner);
		Vector3 force = Vector3.down * 2000f;
		for (int i = 0; i < grabbedBodies.Count; i++)
		{
			CharacterBody val = grabbedBodies[i];
			if (!((Object)(object)val == (Object)null) && !((Object)(object)val.healthComponent == (Object)null))
			{
				DamageInfo val2 = new DamageInfo();
				val2.damage = damageStatValue * damageMult;
				val2.attacker = attacker;
				val2.procCoefficient = 1f;
				val2.position = val.corePosition;
				val2.crit = isCrit;
				val2.damageType = DamageTypeCombo.op_Implicit((DamageType)32);
				val2.force = force;
				networkHandler.ApplyDamageNetworked(val2, ((Component)val.healthComponent).gameObject);
				MainPlugin.SpawnFX(BaseAssets.HitFX, val.corePosition, Quaternion.identity, 1f);
			}
		}
		if (playAttackFx)
		{
			networkHandler.PlaySoundNetworked(attacker, BaseSounds.primary_swing_0, 100, false);
			networkHandler.PlaySoundNetworked(attacker, BrolySounds.brl_primary_swing_voices, 80, true);
			networkHandler.SpawnFXNetworked(BaseAssets.PrimaryAttackFX, attacker.transform.position, Quaternion.identity, 2f, -1f, false);
		}
	}
}
public struct ShootTimerData
{
	public float ShootTime;

	public bool RightHand;

	public ShootTimerData(float shootTime, bool rightHand)
	{
		ShootTime = shootTime;
		RightHand = rightHand;
	}
}
public class EraserShotVolleySkill : CharacterModSkillState
{
	public const float SkillCooldown = 5f;

	public static string m_skillName = "Eraser Shot Volley";

	private string animationName_kiblast = "BRL_SPA_ERC_C";

	public const string KiblastProjectileName = "EraserShotVolleyProjectile";

	public const float kibastCollisionRadius = 1f;

	public const float kiblastBaseDamageMult = 4f;

	public const float BaseKiCost = 15f;

	public float kiblastProjectileSpeed = 80f;

	public float kiblastCoeff = 1f;

	private Transform m_handRightBone;

	private Transform m_handLeftBone;

	private float m_currentAnimDuration = 999.9f;

	private List<ShootTimerData> m_shootTimerDatas = new List<ShootTimerData>();

	public static string GetSkillDescription()
	{
		return string.Format(MainPlugin.CreateKiCostDescription(15f.ToString()) + "\nFire a volley of energy blasts!\nDealing " + MainPlugin.CreateDamageDescription(GetDisplayBaseDamage()) + " for each one!\n");
	}

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

	public override void OnEnter()
	{
		((CharacterModSkillState)this).OnEnter();
		if (((EntityState)this).isAuthority)
		{
			base.m_skillAttackSpeedCap = 8f;
			base.m_allowHover = true;
			m_currentAnimDuration = ((CharacterModSkillState)this).GetAnimationTime(animationName_kiblast);
			MainPlugin.DebugLog($"Duration of {m_skillName} : {m_currentAnimDuration}");
			m_shootTimerDatas.Clear();
			m_shootTimerDatas.Add(new ShootTimerData(m_currentAnimDuration * 0.19f, rightHand: true));
			m_shootTimerDatas.Add(new ShootTimerData(m_currentAnimDuration * 0.32f, rightHand: false));
			m_shootTimerDatas.Add(new ShootTimerData(m_currentAnimDuration * 0.468f, rightHand: true));
			m_shootTimerDatas.Add(new ShootTimerData(m_currentAnimDuration * 0.619f, rightHand: false));
			m_shootTimerDatas.Add(new ShootTimerData(m_currentAnimDuration * 0.755f, rightHand: true));
			((CharacterModSkillState)this).PlaySkillAnimation("Kiblast_Skill_0", 0f, 1, true, true);
			((BaseState)this).StartAimMode(m_currentAnimDuration, true);
			m_handRightBone = ((EntityState)this).characterDirection.modelAnimator.GetBoneTransform((HumanBodyBones)18);
			m_handLeftBone = ((EntityState)this).characterDirection.modelAnimator.GetBoneTransform((HumanBodyBones)17);
		}
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (!((EntityState)this).isAuthority)
		{
			return;
		}
		((CharacterModSkillState)this).ProcessMainStateMovement(true);
		if (m_shootTimerDatas.Count > 0)
		{
			MainPlugin.DebugLog($"fixedAge = {((EntityState)this).fixedAge} : nextShootTime= {m_shootTimerDatas[0].ShootTime}");
			if (((EntityState)this).fixedAge > m_shootTimerDatas[0].ShootTime)
			{
				FireKiblast(m_shootTimerDatas[0].RightHand);
				m_shootTimerDatas.RemoveAt(0);
			}
		}
		if (((EntityState)this).fixedAge >= m_currentAnimDuration)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	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_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: 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_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_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_0161: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Unknown result type (might be due to invalid IL or missing references)
		//IL_0169: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_0180: Unknown result type (might be due to invalid IL or missing references)
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_0199: Unknown result type (might be due to invalid IL or missing references)
		//IL_019b: 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("EraserShotVolleyProjectile"));
		if ((Object)(object)projectilePrefab != (Object)null)
		{
			ProjectileManager.instance.FireProjectile(projectilePrefab, val, val2, ((EntityState)this).gameObject, ((BaseState)this).damageStat * 4f, 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, BrolySounds.brl_kiblast_fire, 100, false);
		}
		Vector3 aimRayDirection = ((CharacterModSkillState)this).GetAimRayDirection();
		aimRayDirection.y = 0f;
		Vector3 val3 = ((EntityState)this).transform.position + Vector3.up;
		if (isRight && (Object)(object)m_handRightBone != (Object)null)
		{
			val3 = m_handRightBone.position;
		}
		else if (!isRight && (Object)(object)m_handLeftBone != (Object)null)
		{
			val3 = m_handLeftBone.position;
		}
		Quaternion val4 = Quaternion.LookRotation((aimRayDirection == Vector3.zero) ? Vector3.forward : aimRayDirection, Vector3.up);
		((CharacterModSkillState)this).GetNetworkHandler().SpawnFXNetworked(BrolyAssets.EraserShotVolleyFireFX, val3, val4, 1f, -1f, false);
		GameObject val5 = MainPlugin.SpawnFX(BrolyAssets.EraserShotVolleyFireFX, val3, val4, 1f);
		if ((Object)(object)val5 != (Object)null)
		{
			val5.transform.SetParent(((EntityState)this).transform);
		}
	}

	public override void OnExit()
	{
		if (((EntityState)this).isAuthority)
		{
			((CharacterModSkillState)this).ResetMainSta