Decompiled source of Drunken Broster v1.0.1

UMM/BroMaker_Storage/Drunken Broster/Drunken Broster.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BroMakerLib;
using BroMakerLib.CustomObjects.Bros;
using BroMakerLib.CustomObjects.Projectiles;
using BroMakerLib.Loggers;
using Drunken_Broster.MeleeItems;
using Drunken_Broster.Triggers;
using HarmonyLib;
using RocketLib;
using RocketLib.CustomTriggers;
using Rogueforce;
using TFBGames.Management.Asset;
using UnityEngine;
using Utility;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("Drunken Broster")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Drunken Broster")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("f637a9e4-6c18-40e6-834a-0a75c00103c5")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Drunken_Broster
{
	[HeroPreset(/*Could not decode attribute arguments.*/)]
	public class DrunkenBroster : CustomHero
	{
		public enum MeleeItem
		{
			Tire,
			AcidEgg,
			Beehive,
			Bottle,
			Crate,
			Coconut,
			ExplosiveBarrel,
			SoccerBall,
			AlienEgg,
			Skull,
			None
		}

		protected bool acceptedDeath;

		private bool wasInvulnerable;

		private Traverse setRumbleTraverse;

		protected Material normalSprite;

		protected Material drunkSprite;

		protected float postAttackHitPauseTime;

		protected bool hasHitThisAttack;

		protected float faderTrailDelay;

		protected float lastSoundTime;

		protected int attackSpriteRow;

		protected List<Unit> alreadyHit = new List<Unit>();

		protected float hitClearCounter;

		protected bool hasHitWithWall;

		protected bool hasHitWithFists;

		protected bool hasMadeEffects;

		protected bool attackStationary;

		public bool attackUpwards;

		public bool attackDownwards;

		public bool attackForwards;

		protected int stationaryAttackCounter = -1;

		protected int attackDirection;

		protected bool hasAttackedUpwards;

		protected bool hasAttackedDownwards;

		protected bool hasAttackedForwards;

		protected int attackFrames;

		protected int attackStationaryStrikeFrame = 4;

		protected int attackUpwardsStrikeFrame = 2;

		protected int attackDownwardsStrikeFrame = 3;

		protected int attackForwardsStrikeFrame = 2;

		protected bool attackHasHit;

		protected const int soberEnemyFistDamage = 10;

		protected const int soberGroundFistDamage = 10;

		protected const int drunkEnemyFistDamage = 15;

		protected const int drunkGroundFistDamage = 15;

		protected int enemyFistDamage = 10;

		protected int groundFistDamage = 10;

		public Shrapnel shrapnelSpark;

		public FlickerFader hitPuff;

		protected float lastAttackingTime;

		protected bool startNewAttack;

		public float fistVolume = 0.7f;

		public float wallHitVolume = 0.25f;

		protected bool playedWallHit;

		protected MeleeItem lastThrownItem = MeleeItem.None;

		protected MeleeItem chosenItem = MeleeItem.None;

		protected MeleeItem heldItem = MeleeItem.None;

		protected bool holdingItem;

		public CustomGrenade tireProjectile;

		public CustomProjectile acidEggProjectile;

		public CustomProjectile beehiveProjectile;

		public CustomGrenade bottleProjectile;

		public CustomProjectile crateProjectile;

		public CustomGrenade coconutProjectile;

		public CustomGrenade explosiveBarrelProjectile;

		public CustomGrenade soccerBallProjectile;

		public CustomProjectile alienEggProjectile;

		public SkullProjectile skullProjectile;

		public MeshRenderer gunSpriteMelee;

		public SpriteSM gunSpriteMeleeSprite;

		public SpriteSM originalGunSprite;

		public Material meleeSpriteGrabThrowing;

		protected bool throwingHeldItem;

		protected bool thrownItem;

		protected bool hitSpecialDoodad;

		protected bool progressedFarEnough;

		protected float explosionCounter = -1f;

		protected float flameCounter;

		protected float warningCounter;

		protected bool warningOn;

		public FlickerFader fire1;

		public FlickerFader fire2;

		public FlickerFader fire3;

		public AudioClip[] barrelExplodeSounds;

		public AudioClip[] soccerKickSounds;

		[SaveableSetting(null)]
		public static List<MeleeItem> EnabledMeleeItems = new List<MeleeItem>
		{
			MeleeItem.Tire,
			MeleeItem.AcidEgg,
			MeleeItem.Beehive,
			MeleeItem.Bottle,
			MeleeItem.Crate,
			MeleeItem.Coconut,
			MeleeItem.ExplosiveBarrel,
			MeleeItem.SoccerBall,
			MeleeItem.AlienEgg,
			MeleeItem.Skull
		};

		[SaveableSetting(null)]
		public static bool CompletelyRandomMeleeItems = false;

		public AudioClip slurp;

		public bool wasDrunk;

		public bool drunk;

		protected const float maxDrunkTime = 12f;

		public float drunkCounter;

		protected int usingSpecialFrame;

		protected float originalSpeed;

		[SaveableSetting(null)]
		public static bool enableCameraTilt = true;

		[SaveableSetting(null)]
		public static bool lowIntensityMode = false;

		protected bool usedSpecial;

		protected bool playedSpecialSound;

		protected bool bufferedSpecial;

		[SaveableSetting(null)]
		public static bool doubleTapDashToRoll = true;

		[SaveableSetting(null)]
		public static bool pressKeybindToRoll = false;

		public static KeyBindingForPlayers rollKey = AllModKeyBindings.LoadKeyBinding("Drunken Broster", "Roll Key");

		protected float slideExtraSpeed;

		protected bool isSlideRoll;

		protected float dashSlideCooldown;

		protected float lastDashTime = -1f;

		protected float doubleTapWindow = 0.3f;

		protected bool bufferedSlideRoll;

		protected float bufferedSlideRollTime;

		protected AudioSource rollSound;

		public bool IsDoingMelee => ((TestVanDammeAnim)this).doingMelee;

		protected override void Start()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: 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_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			((CustomHero)this).Start();
			((BroBase)this).meleeType = (MeleeType)2;
			((BroBase)this).currentMeleeType = ((BroBase)this).meleeType;
			originalSpeed = ((TestVanDammeAnim)this).speed;
			TestVanDammeAnim heroPrefab = HeroController.GetHeroPrefab((HeroType)42);
			BroLee val = (BroLee)(object)((heroPrefab is BroLee) ? heroPrefab : null);
			((TestVanDammeAnim)this).faderSpritePrefab = ((TestVanDammeAnim)val).faderSpritePrefab;
			shrapnelSpark = ((BrocSnipes)val).shrapnelSpark;
			hitPuff = ((BrocSnipes)val).hitPuff;
			normalSprite = ((Component)this).GetComponent<Renderer>().material;
			drunkSprite = ResourcesController.GetMaterial(((CustomHero)this).DirectoryPath, "drunkSprite.png");
			gunSpriteMelee = new GameObject("GunSpriteMelee", new Type[3]
			{
				typeof(MeshFilter),
				typeof(MeshRenderer),
				typeof(SpriteSM)
			}).GetComponent<MeshRenderer>();
			((Component)gunSpriteMelee).transform.parent = ((Component)this).transform;
			((Component)gunSpriteMelee).gameObject.SetActive(false);
			((Renderer)gunSpriteMelee).material = ResourcesController.GetMaterial(((CustomHero)this).DirectoryPath, "gunSpriteMelee.png");
			gunSpriteMeleeSprite = ((Component)gunSpriteMelee).gameObject.GetComponent<SpriteSM>();
			((SpriteBase)gunSpriteMeleeSprite).RecalcTexture();
			gunSpriteMeleeSprite.SetTextureDefaults();
			gunSpriteMeleeSprite.lowerLeftPixel = new Vector2(0f, 32f);
			gunSpriteMeleeSprite.pixelDimensions = new Vector2(32f, 32f);
			((SpriteBase)gunSpriteMeleeSprite).plane = (SPRITE_PLANE)0;
			((SpriteBase)gunSpriteMeleeSprite).width = 32f;
			((SpriteBase)gunSpriteMeleeSprite).height = 32f;
			((Component)gunSpriteMeleeSprite).transform.localPosition = new Vector3(0f, 0f, -0.9f);
			((SpriteBase)gunSpriteMeleeSprite).CalcUVs();
			((SpriteBase)gunSpriteMeleeSprite).UpdateUVs();
			((SpriteBase)gunSpriteMeleeSprite).offset = new Vector3(0f, 15f, 0f);
			originalGunSprite = ((TestVanDammeAnim)this).gunSprite;
			meleeSpriteGrabThrowing = ResourcesController.GetMaterial(((CustomHero)this).DirectoryPath, "meleeSpriteGrabThrowing.png");
			tireProjectile = (CustomGrenade)(object)CustomGrenade.CreatePrefab<TireProjectile>();
			acidEggProjectile = (CustomProjectile)(object)CustomProjectile.CreatePrefab<AcidEggProjectile>();
			beehiveProjectile = (CustomProjectile)(object)CustomProjectile.CreatePrefab<BeehiveProjectile>();
			bottleProjectile = (CustomGrenade)(object)CustomGrenade.CreatePrefab<BottleProjectile>();
			crateProjectile = (CustomProjectile)(object)CustomProjectile.CreatePrefab<CrateProjectile>();
			coconutProjectile = (CustomGrenade)(object)CustomGrenade.CreatePrefab<CoconutProjectile>();
			explosiveBarrelProjectile = (CustomGrenade)(object)CustomGrenade.CreatePrefab<ExplosiveBarrelProjectile>();
			soccerBallProjectile = (CustomGrenade)(object)CustomGrenade.CreatePrefab<SoccerBallProjectile>();
			alienEggProjectile = (CustomProjectile)(object)CustomProjectile.CreatePrefab<AlienEggProjectile>();
			skullProjectile = SkullProjectile.CreatePrefab();
			if ((Object)(object)((TestVanDammeAnim)this).player != (Object)null)
			{
				setRumbleTraverse = Traverse.Create((object)((TestVanDammeAnim)this).player).Method("SetRumble", new Type[1] { typeof(float) }, (object[])null);
			}
			if (CustomTriggerStateManager.Get<bool>("DrunkenBroster_InfiniteDrunk", false))
			{
				BecomeDrunk();
			}
		}

		protected override void Update()
		{
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Invalid comparison between Unknown and I4
			//IL_0058: 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_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			((BroBase)this).Update();
			if (acceptedDeath)
			{
				if (((BroforceObject)this).health <= 0 && !((TestVanDammeAnim)this).WillReviveAlready)
				{
					return;
				}
				acceptedDeath = false;
			}
			if (((Unit)this).invulnerable)
			{
				wasInvulnerable = true;
			}
			if (wasInvulnerable && !((Unit)this).invulnerable)
			{
				wasInvulnerable = false;
				normalSprite.SetColor("_TintColor", Color.gray);
				drunkSprite.SetColor("_TintColor", Color.gray);
				meleeSpriteGrabThrowing.SetColor("_TintColor", Color.gray);
				((Renderer)gunSpriteMelee).material.SetColor("_TintColor", Color.gray);
			}
			if ((int)((Unit)this).actionState == 5 && !acceptedDeath && !((TestVanDammeAnim)this).WillReviveAlready)
			{
				acceptedDeath = true;
			}
			if (drunk)
			{
				if (!CustomTriggerStateManager.Get<bool>("DrunkenBroster_InfiniteDrunk", false))
				{
					drunkCounter -= ((Unit)this).t;
				}
				if (drunkCounter <= 0f)
				{
					TryToBecomeSober();
				}
			}
			DrunkenCameraManager.UpdateCameraTilt();
			postAttackHitPauseTime -= ((Unit)this).t;
			if ((attackForwards || attackUpwards || attackDownwards) && ((TestVanDammeAnim)this).xIAttackExtra != 0f)
			{
				faderTrailDelay -= ((Unit)this).t / Time.timeScale;
				if (faderTrailDelay < 0f)
				{
					((TestVanDammeAnim)this).CreateFaderTrailInstance();
					faderTrailDelay = 0.034f;
				}
			}
			if ((Object)(object)((TestVanDammeAnim)this).heldGrenade != (Object)null && !((TestVanDammeAnim)this).throwingHeldObject)
			{
				((TestVanDammeAnim)this).ReleaseHeldObject(false);
			}
			if (holdingItem && heldItem == MeleeItem.ExplosiveBarrel)
			{
				RunBarrelEffects();
			}
			RunRolling();
		}

		public override void UIOptions()
		{
			GUILayout.Space(5f);
			bool flag = enableCameraTilt;
			enableCameraTilt = GUILayout.Toggle(enableCameraTilt, "Enable Camera Tilt", (GUILayoutOption[])(object)new GUILayoutOption[0]);
			GUILayout.Space(5f);
			bool flag2 = lowIntensityMode;
			if (enableCameraTilt)
			{
				lowIntensityMode = GUILayout.Toggle(lowIntensityMode, "Low Intensity Mode", (GUILayoutOption[])(object)new GUILayoutOption[0]);
			}
			if (flag != enableCameraTilt || flag2 != lowIntensityMode)
			{
				DrunkenCameraManager.OnSettingsChanged();
			}
			GUILayout.Space(25f);
			int num = default(int);
			if (rollKey.OnGUI(ref num, GUI.tooltip == string.Empty))
			{
				pressKeybindToRoll = true;
			}
			GUILayout.Space(10f);
			if (doubleTapDashToRoll != (doubleTapDashToRoll = GUILayout.Toggle(doubleTapDashToRoll, "Double tap dash to perform slide roll", (GUILayoutOption[])(object)new GUILayoutOption[0])))
			{
				((CustomHero)this).SaveSettings();
			}
			if (pressKeybindToRoll != (pressKeybindToRoll = GUILayout.Toggle(pressKeybindToRoll, "Press custom keybinding to perform slide roll", (GUILayoutOption[])(object)new GUILayoutOption[0])))
			{
				((CustomHero)this).SaveSettings();
			}
			GUILayout.Space(20f);
			GUILayout.Label("Enabled Items:", (GUILayoutOption[])(object)new GUILayoutOption[0]);
			foreach (MeleeItem value in Enum.GetValues(typeof(MeleeItem)))
			{
				if (value == MeleeItem.None)
				{
					continue;
				}
				bool flag3 = EnabledMeleeItems.Contains(value);
				bool flag4 = GUILayout.Toggle(flag3, value.ToString(), (GUILayoutOption[])(object)new GUILayoutOption[0]);
				if (flag3 != flag4)
				{
					if (flag4)
					{
						EnabledMeleeItems.Add(value);
					}
					else
					{
						EnabledMeleeItems.Remove(value);
					}
					((CustomHero)this).SaveSettings();
				}
			}
			GUILayout.Space(10f);
			CompletelyRandomMeleeItems = GUILayout.Toggle(CompletelyRandomMeleeItems, "Allow all enabled melee items to be pulled on any level, and use equal weights", (GUILayoutOption[])(object)new GUILayoutOption[0]);
		}

		public override void HarmonyPatches(Harmony harmony)
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			harmony.PatchAll(executingAssembly);
		}

		public override void PreloadAssets()
		{
			CustomHero.PreloadSprites(((CustomHero)this).DirectoryPath, new List<string> { "drunkSprite.png", "gunSpriteMelee.png", "meleeSpriteGrabThrowing.png" });
			CustomHero.PreloadSprites(((CustomHero)this).ProjectilePath, new List<string> { "AcidEggProjectile.png", "AlienEggProjectile.png", "BeehiveProjectile.png", "BottleProjectile.png", "CoconutProjectile.png", "CrateProjectile.png", "ExplosiveBarrelProjectile.png", "ExplosiveBarrelProjectileWarning.png", "SoccerBallProjectile.png", "TireProjectile.png" });
			CustomHero.PreloadSounds(((CustomHero)this).SoundPath, new List<string>
			{
				"barrelBounce0.wav", "beeHiveSmash0.wav", "beeHiveSmash1.wav", "beeHiveSmash2.wav", "coconutDeath1.wav", "coconutDeath2.wav", "coconutHit1.wav", "coconutHit2.wav", "coconutHit3.wav", "coconutHit4.wav",
				"coconutHit5.wav", "egg_burst0.wav", "egg_burst1.wav", "egg_burst2.wav", "egg_pulse0.wav", "egg_pulse1.wav", "kungFu0.wav", "kungFu1.wav", "kungFu10.wav", "kungFu11.wav",
				"kungFu12.wav", "kungFu2.wav", "kungFu3.wav", "kungFu4.wav", "kungFu5.wav", "kungFu6.wav", "kungFu7.wav", "kungFu8.wav", "kungFu9.wav", "meleeHitBlunt0.wav",
				"meleeHitBlunt1.wav", "slide_0.wav", "slide_1.wav", "slurp.wav", "soccerBounce1.wav", "soccerBounce2.wav", "soccerBounce3.wav", "tireDeath.wav"
			});
		}

		public override void RegisterCustomTriggers()
		{
			CustomTriggerManager.RegisterCustomTrigger(typeof(DrunkenBrosterMeleePoolAction), typeof(DrunkenBrosterMeleePoolActionInfo), "Drunken Broster - Set Melee Item Pool", "Custom Bros", 0);
			CustomTriggerManager.RegisterCustomTrigger(typeof(DrunkenBrosterBecomeDrunkAction), typeof(DrunkenBrosterBecomeDrunkActionInfo), "Drunken Broster - Become Drunk", "Custom Bros", 0);
		}

		public override void BeforePrefabSetup()
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			base.SoundHolderHeroType = (HeroType)42;
		}

		public override void AfterPrefabSetup()
		{
			BarrelBlock component = ((Component)AssetBundleReference<ThemeHolder>.op_Implicit((AssetBundleReference<ThemeHolder>)(object)Map.Instance.jungleThemeReference).blockPrefabBarrels[1]).GetComponent<BarrelBlock>();
			fire1 = component.fire1;
			fire2 = component.fire2;
			fire3 = component.fire3;
			barrelExplodeSounds = ((Block)component).soundHolder.deathSounds;
			((TestVanDammeAnim)this).soundHolder.attack3Sounds = ResourcesController.GetAudioClipArray(((CustomHero)this).SoundPath, "kungFu", 13, 0, ".wav");
			((TestVanDammeAnim)this).soundHolder.attack4Sounds = ResourcesController.GetAudioClipArray(((CustomHero)this).SoundPath, "slide_", 2, 0, ".wav");
			slurp = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "slurp.wav");
			((TestVanDammeAnim)this).soundHolder.meleeHitSound = ResourcesController.GetAudioClipArray(((CustomHero)this).SoundPath, "meleeHitBlunt", 2, 0, ".wav");
			soccerKickSounds = ResourcesController.GetAudioClipArray(((CustomHero)this).SoundPath, "soccerBounce", 2, 2, ".wav");
		}

		protected override void RunGun()
		{
			if (((TestVanDammeAnim)this).WallDrag || ((TestVanDammeAnim)this).gunFrame <= 0)
			{
				return;
			}
			((TestVanDammeAnim)this).gunCounter = ((TestVanDammeAnim)this).gunCounter + ((Unit)this).t;
			if (((TestVanDammeAnim)this).gunCounter > 0.015f)
			{
				((TestVanDammeAnim)this).gunCounter = ((TestVanDammeAnim)this).gunCounter - 0.015f;
				((TestVanDammeAnim)this).gunFrame = ((TestVanDammeAnim)this).gunFrame - 1;
				if (((TestVanDammeAnim)this).gunFrame < 0)
				{
					((TestVanDammeAnim)this).gunFrame = 0;
				}
				((TestVanDammeAnim)this).SetGunSprite(0, 0);
			}
		}

		protected override void SetGunSprite(int spriteFrame, int spriteRow)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Invalid comparison between Unknown and I4
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Invalid comparison between Unknown and I4
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Invalid comparison between Unknown and I4
			if (holdingItem)
			{
				spriteRow += (int)heldItem * 2;
				if (heldItem == MeleeItem.ExplosiveBarrel && warningOn)
				{
					spriteRow += 8;
				}
			}
			if ((int)((Unit)this).actionState == 11)
			{
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)(((TestVanDammeAnim)this).gunSpritePixelWidth * (((TestVanDammeAnim)this).gunSpriteHangingFrame + spriteFrame)), (float)(((TestVanDammeAnim)this).gunSpritePixelHeight * (1 + spriteRow)));
			}
			else if ((int)((Unit)this).actionState == 6 && ((TestVanDammeAnim)this).hangingOneArmed)
			{
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)(((TestVanDammeAnim)this).gunSpritePixelWidth * (((TestVanDammeAnim)this).gunSpriteHangingFrame + spriteFrame)), (float)(((TestVanDammeAnim)this).gunSpritePixelHeight * (1 + spriteRow)));
			}
			else if ((Object)(object)((Unit)this).attachedToZipline != (Object)null && (int)((Unit)this).actionState == 3)
			{
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)(((TestVanDammeAnim)this).gunSpritePixelWidth * (((TestVanDammeAnim)this).gunSpriteHangingFrame + spriteFrame)), (float)(((TestVanDammeAnim)this).gunSpritePixelHeight * (1 + spriteRow)));
			}
			else
			{
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)(((TestVanDammeAnim)this).gunSpritePixelWidth * spriteFrame), (float)(((TestVanDammeAnim)this).gunSpritePixelHeight * (1 + spriteRow)));
			}
		}

		protected override void StartFiring()
		{
			if (((TestVanDammeAnim)this).rollingFrames > 11)
			{
				((TestVanDammeAnim)this).fire = (((TestVanDammeAnim)this).wasFire = false);
				return;
			}
			if (((TestVanDammeAnim)this).usingSpecial || ((TestVanDammeAnim)this).doingMelee)
			{
				((TestVanDammeAnim)this).fire = (((TestVanDammeAnim)this).wasFire = false);
				return;
			}
			if (holdingItem)
			{
				StartThrowingItem();
				return;
			}
			if (((TestVanDammeAnim)this).throwingHeldObject)
			{
				((TestVanDammeAnim)this).ReleaseHeldObject(false);
				((TestVanDammeAnim)this).throwingHeldObject = false;
			}
			startNewAttack = false;
			hasHitWithWall = false;
			hasHitWithFists = false;
			hasMadeEffects = false;
			if (attackForwards || attackDownwards || attackUpwards || attackStationary)
			{
				startNewAttack = true;
			}
			else if (((TestVanDammeAnim)this).up && !hasAttackedUpwards)
			{
				StartAttackUpwards();
			}
			else if (((TestVanDammeAnim)this).down && !hasAttackedDownwards)
			{
				StartAttackDownwards();
			}
			else if (((TestVanDammeAnim)this).left && !hasAttackedForwards)
			{
				StartAttackForwards(right: false);
			}
			else if (((TestVanDammeAnim)this).right && !hasAttackedForwards)
			{
				StartAttackForwards(right: true);
			}
			else if (!((TestVanDammeAnim)this).up && !((TestVanDammeAnim)this).down && !((TestVanDammeAnim)this).left && !((TestVanDammeAnim)this).right)
			{
				StartAttackStationary();
			}
		}

		protected void StartAttackUpwards()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			if ((int)((Unit)this).actionState == 6)
			{
				((Unit)this).actionState = (ActionState)3;
			}
			((TestVanDammeAnim)this).FireFlashAvatar();
			MakeKungfuSound();
			StopAttack();
			if (((BroforceObject)this).yI > 50f)
			{
				((BroforceObject)this).yI = 50f;
			}
			((TestVanDammeAnim)this).jumpTime = 0f;
			hasAttackedUpwards = true;
			attackFrames = 0;
			attackUpwards = true;
			((TestVanDammeAnim)this).ChangeFrame();
			((TestVanDammeAnim)this).airdashDirection = (DirectionEnum)2;
			ClearCurrentAttackVariables();
		}

		protected void StartAttackDownwards()
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			((Unit)this).actionState = (ActionState)3;
			StopAttack();
			((TestVanDammeAnim)this).FireFlashAvatar();
			if (!drunk)
			{
				((BroforceObject)this).yI = 150f;
				((BroforceObject)this).xI = ((Component)this).transform.localScale.x * 80f;
			}
			else
			{
				((BroforceObject)this).yI = 200f;
				((BroforceObject)this).xI = ((Component)this).transform.localScale.x * 80f;
				((TestVanDammeAnim)this).canWallClimb = false;
			}
			MakeKungfuSound();
			hasAttackedDownwards = true;
			attackFrames = 0;
			attackDownwards = true;
			((TestVanDammeAnim)this).jumpTime = 0f;
			((TestVanDammeAnim)this).ChangeFrame();
			((TestVanDammeAnim)this).airdashDirection = (DirectionEnum)3;
			ClearCurrentAttackVariables();
		}

		protected void StartAttackForwards(bool right)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Invalid comparison between Unknown and I4
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			((TestVanDammeAnim)this).FireFlashAvatar();
			attackSpriteRow = (attackSpriteRow + 1) % 2;
			if ((int)((Unit)this).actionState == 6)
			{
				((Unit)this).actionState = (ActionState)3;
			}
			if ((attackForwards || attackUpwards || attackDownwards) && !hasHitThisAttack)
			{
				StopAttack();
				if (!drunk)
				{
					((TestVanDammeAnim)this).xIAttackExtra = (right ? (-20f) : 20f);
				}
			}
			else if ((attackForwards || attackUpwards || attackDownwards) && hasHitThisAttack)
			{
				StopAttack();
				if (!drunk)
				{
					((TestVanDammeAnim)this).xIAttackExtra = (right ? 300f : (-300f));
				}
				MakeKungfuSound();
			}
			else
			{
				StopAttack();
				if (!drunk)
				{
					((TestVanDammeAnim)this).xIAttackExtra = (right ? 200f : (-200f));
				}
				MakeKungfuSound();
			}
			postAttackHitPauseTime = 0f;
			hasAttackedForwards = true;
			attackFrames = 0;
			((BroforceObject)this).yI = 0f;
			attackForwards = true;
			attackDirection = (right ? 1 : (-1));
			((Component)this).transform.localScale = new Vector3(right ? 1f : (-1f), ((TestVanDammeAnim)this).yScale, 1f);
			((TestVanDammeAnim)this).jumpTime = 0f;
			((TestVanDammeAnim)this).ChangeFrame();
			((TestVanDammeAnim)this).CreateFaderTrailInstance();
			((TestVanDammeAnim)this).airdashDirection = (DirectionEnum)(right ? 5 : 4);
			ClearCurrentAttackVariables();
		}

		protected void StartAttackStationary()
		{
			((TestVanDammeAnim)this).FireFlashAvatar();
			StopAttack();
			MakeKungfuSound();
			postAttackHitPauseTime = 0f;
			attackFrames = 0;
			attackStationary = true;
			((TestVanDammeAnim)this).jumpTime = 0f;
			stationaryAttackCounter++;
			if (stationaryAttackCounter % 2 == 0)
			{
				attackStationaryStrikeFrame = 4;
			}
			attackStationaryStrikeFrame = 2;
			((TestVanDammeAnim)this).ChangeFrame();
			ClearCurrentAttackVariables();
		}

		protected override void RunFiring()
		{
			if (((TestVanDammeAnim)this).fire)
			{
				((TestVanDammeAnim)this).rollingFrames = 0;
			}
			if (!attackStationary && !attackUpwards && !attackForwards && !attackDownwards)
			{
				return;
			}
			if (!attackHasHit || drunk)
			{
				if (attackStationary && attackFrames >= attackStationaryStrikeFrame - 1)
				{
					DeflectProjectiles();
				}
				else if (attackForwards && attackFrames >= attackForwardsStrikeFrame - 1)
				{
					DeflectProjectiles();
				}
				else if (attackUpwards && attackFrames >= attackUpwardsStrikeFrame - 1)
				{
					DeflectProjectiles();
				}
				else if (attackDownwards && attackFrames >= attackDownwardsStrikeFrame - 1)
				{
					DeflectProjectiles();
				}
			}
			if (attackStationary && attackFrames >= attackStationaryStrikeFrame && attackFrames <= 5)
			{
				PerformAttackStationary();
			}
			else if (attackForwards && attackFrames >= attackForwardsStrikeFrame - 1 && attackFrames <= 5)
			{
				PerformAttackForwards();
			}
			else if (attackUpwards && attackFrames >= attackUpwardsStrikeFrame && attackFrames <= 5)
			{
				PerformAttackUpwards();
			}
			else if (attackDownwards && attackFrames >= attackDownwardsStrikeFrame && attackFrames <= 6)
			{
				PerformAttackDownwards();
			}
		}

		protected void PerformAttackStationary()
		{
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0412: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			//IL_0465: Unknown result type (might be due to invalid IL or missing references)
			//IL_0488: Unknown result type (might be due to invalid IL or missing references)
			//IL_049c: Unknown result type (might be due to invalid IL or missing references)
			lastAttackingTime = Time.time;
			bool hitImpenetrableDoodad;
			if (stationaryAttackCounter % 2 == 0)
			{
				DamageDoodads(3, (DamageType)9, ((BroforceObject)this).X + (float)(((NetworkedUnit)this).Direction * 4), ((BroforceObject)this).Y + 7f, 10f * ((Component)this).transform.localScale.x, 950f, 6f, ((NetworkedUnit)this).playerNum, out hitImpenetrableDoodad, (MonoBehaviour)(object)this);
				if (HitUnitsStationaryAttack((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, enemyFistDamage + 2, 1, (DamageType)21, 13f, 13f, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 7f, ((BroforceObject)this).Y + 7f, 10f * ((Component)this).transform.localScale.x, 950f, penetrates: true, knock: true, canGib: false, alreadyHit))
				{
					if (!hasHitWithFists)
					{
						PlayPrimaryHitSound();
					}
					hasHitWithFists = true;
					attackHasHit = true;
					hasAttackedDownwards = false;
					hasAttackedUpwards = false;
					hasAttackedForwards = false;
					hasHitThisAttack = true;
					TimeBump();
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
					postAttackHitPauseTime = 0.2f;
					((BroforceObject)this).xI = 0f;
					((BroforceObject)this).yI = 0f;
					for (int i = 0; i < alreadyHit.Count; i++)
					{
						alreadyHit[i].FrontSomersault();
					}
				}
				else if (hitSpecialDoodad && !hasHitThisAttack)
				{
					if (!hasHitWithFists)
					{
						PlayWallSound();
					}
					hasHitWithFists = true;
					attackHasHit = true;
					hasAttackedDownwards = false;
					hasAttackedUpwards = false;
					hasAttackedForwards = false;
					hasHitThisAttack = true;
					TimeBump();
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
					postAttackHitPauseTime = 0.1f;
					((BroforceObject)this).xI = 0f;
					((BroforceObject)this).yI = 0f;
				}
			}
			else
			{
				DamageDoodads(3, (DamageType)9, ((BroforceObject)this).X + (float)(((NetworkedUnit)this).Direction * 4), ((BroforceObject)this).Y + 7f, 700f * ((Component)this).transform.localScale.x, 250f, 6f, ((NetworkedUnit)this).playerNum, out hitImpenetrableDoodad, (MonoBehaviour)(object)this);
				if (HitUnitsStationaryAttack((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, enemyFistDamage + 2, 1, (DamageType)21, 13f, 8f, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 7f, ((BroforceObject)this).Y + 5f, 700f * ((Component)this).transform.localScale.x, 250f, penetrates: true, knock: true, canGib: false, alreadyHit))
				{
					if (!hasHitWithFists)
					{
						PlayPrimaryHitSound();
					}
					hasHitWithFists = true;
					attackHasHit = true;
					hasAttackedDownwards = false;
					hasAttackedUpwards = false;
					hasAttackedForwards = false;
					hasHitThisAttack = true;
					TimeBump();
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
					postAttackHitPauseTime = 0.2f;
					((BroforceObject)this).xI = 0f;
					((BroforceObject)this).yI = 0f;
					for (int j = 0; j < alreadyHit.Count; j++)
					{
						alreadyHit[j].FrontSomersault();
					}
				}
				else if (hitSpecialDoodad && !hasHitThisAttack)
				{
					if (!hasHitWithFists)
					{
						PlayWallSound();
					}
					hasHitWithFists = true;
					attackHasHit = true;
					hasAttackedDownwards = false;
					hasAttackedUpwards = false;
					hasAttackedForwards = false;
					hasHitThisAttack = true;
					TimeBump();
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
					postAttackHitPauseTime = 0.1f;
					((BroforceObject)this).xI = 0f;
					((BroforceObject)this).yI = 0f;
				}
			}
			if (!attackHasHit || drunk)
			{
				DeflectProjectiles();
			}
			if (!attackHasHit)
			{
				FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 3f, ((BroforceObject)this).Y + 6f, new Vector3(((Component)this).transform.localScale.x, 0f, 0f), 9f);
				FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 3f, ((BroforceObject)this).Y + 12f, new Vector3(((Component)this).transform.localScale.x, 0f, 0f), 9f);
			}
		}

		protected void PerformAttackForwards()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0424: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c9: 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_05bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_05de: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_060e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0631: Unknown result type (might be due to invalid IL or missing references)
			//IL_0645: Unknown result type (might be due to invalid IL or missing references)
			lastAttackingTime = Time.time;
			bool hitImpenetrableDoodad;
			if (!drunk)
			{
				DamageDoodads(3, (DamageType)9, ((BroforceObject)this).X + (float)(((NetworkedUnit)this).Direction * 4), ((BroforceObject)this).Y + 7f, ((Component)this).transform.localScale.x * 250f + ((BroforceObject)this).xI, 200f, 6f, ((NetworkedUnit)this).playerNum, out hitImpenetrableDoodad, (MonoBehaviour)(object)this);
				if (HitUnits((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, enemyFistDamage, 1, (DamageType)21, 7f, 13f, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * ((3f + (float)attackSpriteRow == 0f) ? 1f : 0f), ((BroforceObject)this).Y + 7f, ((Component)this).transform.localScale.x * 520f, 225f, penetrates: true, knock: true, canGib: true, alreadyHit, hitDead: false))
				{
					if (!hasHitWithFists)
					{
						PlayPrimaryHitSound();
					}
					hasHitWithFists = true;
					attackHasHit = true;
					hasAttackedDownwards = false;
					hasAttackedUpwards = false;
					hasAttackedForwards = false;
					hasHitThisAttack = true;
					TimeBump();
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
					postAttackHitPauseTime = 0.2f;
					((BroforceObject)this).xI = 0f;
					((BroforceObject)this).yI = 0f;
					for (int i = 0; i < alreadyHit.Count; i++)
					{
						alreadyHit[i].BackSomersault(false);
					}
				}
				else if (hitSpecialDoodad && !hasHitThisAttack)
				{
					if (!hasHitWithFists)
					{
						PlayWallSound();
					}
					hasHitWithFists = true;
					attackHasHit = true;
					hasAttackedDownwards = false;
					hasAttackedUpwards = false;
					hasAttackedForwards = false;
					hasHitThisAttack = true;
					TimeBump();
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
					postAttackHitPauseTime = 0.1f;
					((BroforceObject)this).xI = 0f;
					((BroforceObject)this).yI = 0f;
				}
			}
			else if (attackSpriteRow == 0)
			{
				DamageDoodads(3, (DamageType)9, ((BroforceObject)this).X + (float)(((NetworkedUnit)this).Direction * 4), ((BroforceObject)this).Y + 7f, ((Component)this).transform.localScale.x * 220f, 450f, 6f, ((NetworkedUnit)this).playerNum, out hitImpenetrableDoodad, (MonoBehaviour)(object)this);
				if (HitUnits((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, enemyFistDamage, 1, (DamageType)21, 4f, 10f, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 7f, ((BroforceObject)this).Y + 7f, ((Component)this).transform.localScale.x * 220f, 450f, penetrates: true, knock: true, canGib: false, alreadyHit, hitDead: true))
				{
					if (!hasHitWithFists)
					{
						PlayPrimaryHitSound();
					}
					hasHitWithFists = true;
					attackHasHit = true;
					hasAttackedDownwards = false;
					hasAttackedUpwards = false;
					hasAttackedForwards = false;
					hasHitThisAttack = true;
					for (int j = 0; j < alreadyHit.Count; j++)
					{
						alreadyHit[j].BackSomersault(false);
					}
				}
				else if (hitSpecialDoodad && !hasHitThisAttack)
				{
					if (!hasHitWithFists)
					{
						PlayWallSound();
					}
					hasHitWithFists = true;
					attackHasHit = true;
					hasAttackedDownwards = false;
					hasAttackedUpwards = false;
					hasAttackedForwards = false;
					hasHitThisAttack = true;
				}
			}
			else
			{
				DamageDoodads(3, (DamageType)9, ((BroforceObject)this).X + (float)(((NetworkedUnit)this).Direction * 4), ((BroforceObject)this).Y + 7f, ((Component)this).transform.localScale.x * 520f, 200f, 6f, ((NetworkedUnit)this).playerNum, out hitImpenetrableDoodad, (MonoBehaviour)(object)this);
				if (HitUnits((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, enemyFistDamage + 8, 3, (DamageType)21, 5f, 8f, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 7f, ((BroforceObject)this).Y + 7f, ((Component)this).transform.localScale.x * 700f, 250f, penetrates: true, knock: true, canGib: false, alreadyHit, hitDead: false))
				{
					if (!hasHitWithFists)
					{
						PlayPrimaryHitSound();
					}
					hasHitWithFists = true;
					attackHasHit = true;
					hasAttackedDownwards = false;
					hasAttackedUpwards = false;
					hasAttackedForwards = false;
					hasHitThisAttack = true;
					TimeBump(0.4f);
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
					postAttackHitPauseTime = 0.25f;
					((BroforceObject)this).xI = 0f;
					((BroforceObject)this).yI = 0f;
					for (int k = 0; k < alreadyHit.Count; k++)
					{
						alreadyHit[k].BackSomersault(false);
					}
				}
				else if (hitSpecialDoodad && !hasHitThisAttack)
				{
					if (!hasHitWithFists)
					{
						PlayWallSound();
					}
					hasHitWithFists = true;
					attackHasHit = true;
					hasAttackedDownwards = false;
					hasAttackedUpwards = false;
					hasAttackedForwards = false;
					hasHitThisAttack = true;
					TimeBump();
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
					postAttackHitPauseTime = 0.1f;
					((BroforceObject)this).xI = 0f;
					((BroforceObject)this).yI = 0f;
				}
			}
			if (!attackHasHit || drunk)
			{
				DeflectProjectiles();
			}
			if (!attackHasHit)
			{
				FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 3f, ((BroforceObject)this).Y + 6f, new Vector3(((Component)this).transform.localScale.x, 0f, 0f), 9f);
				FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 3f, ((BroforceObject)this).Y + 12f, new Vector3(((Component)this).transform.localScale.x, 0f, 0f), 9f);
			}
		}

		protected void PerformAttackUpwards()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_003b: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			if ((int)((Unit)this).actionState == 6)
			{
				((Unit)this).actionState = (ActionState)3;
			}
			DamageDoodads(3, (DamageType)9, ((BroforceObject)this).X + (float)((NetworkedUnit)this).Direction * 6f, ((BroforceObject)this).Y + 12f, ((Component)this).transform.localScale.x * 80f, 1100f, 7f, ((NetworkedUnit)this).playerNum, out var _, (MonoBehaviour)(object)this);
			lastAttackingTime = Time.time;
			if (HitUnits((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, enemyFistDamage, 1, (DamageType)21, 13f, 13f, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 6f, ((BroforceObject)this).Y + 12f, ((Component)this).transform.localScale.x * 80f, 1100f, penetrates: true, knock: true, canGib: true, alreadyHit, hitDead: true))
			{
				if (!hasHitWithFists)
				{
					PlayPrimaryHitSound();
				}
				hasHitWithFists = true;
				attackHasHit = true;
				hasAttackedDownwards = false;
				hasAttackedForwards = false;
				hasHitThisAttack = true;
				if (drunk)
				{
					TimeBump(0.1f);
				}
				else
				{
					TimeBump();
				}
			}
			else if (hitSpecialDoodad && !hasHitThisAttack)
			{
				if (!hasHitWithFists)
				{
					PlayWallSound();
				}
				hasHitWithFists = true;
				attackHasHit = true;
				hasAttackedDownwards = false;
				hasAttackedForwards = false;
				hasHitThisAttack = true;
				TimeBump();
			}
			if (!attackHasHit || drunk)
			{
				DeflectProjectiles();
			}
			if (!attackHasHit)
			{
				FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 3f, ((BroforceObject)this).Y + 6f, new Vector3(((Component)this).transform.localScale.x * 0.5f, 1f, 0f), 12f);
				FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 3f, ((BroforceObject)this).Y + 6f, new Vector3(((Component)this).transform.localScale.x, 0.5f, 0f), 12f);
			}
		}

		protected void PerformAttackDownwards()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			if ((int)((Unit)this).actionState == 6)
			{
				((Unit)this).actionState = (ActionState)3;
			}
			bool hitImpenetrableDoodad;
			if (!drunk)
			{
				DamageDoodads(3, (DamageType)9, ((BroforceObject)this).X + (float)(((NetworkedUnit)this).Direction * 4), ((BroforceObject)this).Y + 2f, ((Component)this).transform.localScale.x * 120f, 100f, 6f, ((NetworkedUnit)this).playerNum, out hitImpenetrableDoodad, (MonoBehaviour)(object)this);
				lastAttackingTime = Time.time;
				if (HitUnits((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, enemyFistDamage + 2, 1, (DamageType)21, 9f, 4f, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 7f, ((BroforceObject)this).Y + 3f, ((Component)this).transform.localScale.x * 120f, 100f, penetrates: true, knock: true, canGib: true, alreadyHit, hitDead: true))
				{
					if (!hasHitWithFists)
					{
						PlayPrimaryHitSound();
					}
					hasHitWithFists = true;
					attackHasHit = true;
					hasAttackedForwards = false;
					hasAttackedUpwards = false;
					hasHitThisAttack = true;
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
					TimeBump();
					postAttackHitPauseTime = 0.08f;
					((BroforceObject)this).xI = 0f;
					((BroforceObject)this).yI = 0f;
				}
				else if (hitSpecialDoodad && !hasHitThisAttack)
				{
					if (!hasHitWithFists)
					{
						PlayWallSound();
					}
					hasHitWithFists = true;
					attackHasHit = true;
					hasAttackedForwards = false;
					hasAttackedUpwards = false;
					hasHitThisAttack = true;
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
					TimeBump();
					postAttackHitPauseTime = 0.1f;
					((BroforceObject)this).xI = 0f;
					((BroforceObject)this).yI = 0f;
				}
				if (!attackHasHit)
				{
					DeflectProjectiles();
				}
				if (!attackHasHit)
				{
					FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 3f, ((BroforceObject)this).Y + 6f, new Vector3(((Component)this).transform.localScale.x * 0.4f, -1f, 0f), 14f);
					FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 3f, ((BroforceObject)this).Y + 6f, new Vector3(((Component)this).transform.localScale.x * 0.8f, -0.2f, 0f), 12f);
				}
			}
			else
			{
				DamageDoodads(3, (DamageType)9, ((BroforceObject)this).X + (float)(((NetworkedUnit)this).Direction * 4), ((BroforceObject)this).Y, ((Component)this).transform.localScale.x * 120f, 100f, 6f, ((NetworkedUnit)this).playerNum, out hitImpenetrableDoodad, (MonoBehaviour)(object)this);
				lastAttackingTime = Time.time;
				DeflectProjectiles();
			}
		}

		protected override void UseFire()
		{
		}

		protected override void FireWeapon(float x, float y, float xSpeed, float ySpeed)
		{
		}

		protected void DownwardHitGround()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			if (!attackHasHit && attackFrames < 7)
			{
				FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 16.5f, ((BroforceObject)this).Y + 16.5f, Vector3.down, 18f + Mathf.Abs(((BroforceObject)this).yI * ((Unit)this).t));
			}
			if (!attackHasHit && attackFrames < 7)
			{
				FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 5.5f, ((BroforceObject)this).Y + 16.5f, Vector3.down, 18f + Mathf.Abs(((BroforceObject)this).yI * ((Unit)this).t));
			}
			attackDownwards = false;
			attackFrames = 0;
		}

		protected void DownwardHitGroundDrunk()
		{
			if (attackFrames < 5)
			{
				attackFrames = 5;
				((TestVanDammeAnim)this).ChangeFrame();
			}
			attackHasHit = true;
			hasHitThisAttack = true;
			((TestVanDammeAnim)this).canWallClimb = true;
			ExplosionGroundWave obj = EffectsController.CreateShockWave(((BroforceObject)this).X, ((BroforceObject)this).Y + 4f, 50f);
			obj.playerNum = ((NetworkedUnit)this).playerNum;
			obj.avoidObject = (MonoBehaviour)(object)this;
			obj.origins = (MonoBehaviour)(object)this;
			if (Map.HitUnits((MonoBehaviour)(object)this, (MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, 20, (DamageType)4, 30f, 10f, ((BroforceObject)this).X, ((BroforceObject)this).Y - 4f, 0f, ((BroforceObject)this).yI, true, false, true, false))
			{
				PlayPrimaryHitSound();
				TimeBump(0.3f);
			}
			MapController.DamageGround((MonoBehaviour)(object)this, 35, (DamageType)4, 50f, ((BroforceObject)this).X, ((BroforceObject)this).Y + 8f, (Collider[])null, false);
			((BroforceObject)this).xI = (((TestVanDammeAnim)this).xIBlast = 0f);
		}

		protected void FireWeaponGround(float x, float y, Vector3 raycastDirection, float distance)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			if (Physics.Raycast(new Vector3(x, y, 0f), raycastDirection, ref ((TestVanDammeAnim)this).raycastHit, distance, LayerMask.op_Implicit(((TestVanDammeAnim)this).groundLayer)))
			{
				if (!hasHitWithWall)
				{
					SortOfFollow.Shake(0.15f);
					MakeEffects();
				}
				int num = groundFistDamage;
				if (((Component)((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).collider).gameObject.layer == 30)
				{
					num = ((!drunk) ? (num + 7) : (num + 12));
				}
				MapController.Damage_Networked((MonoBehaviour)(object)this, ((Component)((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).collider).gameObject, num, (DamageType)21, ((BroforceObject)this).xI, 0f, ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).point.x, ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).point.y);
				if (BroMakerUtilities.IsBoss(((Component)((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).collider).gameObject) || ((Component)((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).collider).gameObject.layer == 30)
				{
					hasHitWithWall = true;
					attackHasHit = true;
				}
				else if (drunk && (Object)(object)((Component)((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).collider).gameObject.GetComponent<SteelBlock>() != (Object)null)
				{
					hasHitWithWall = true;
					attackHasHit = true;
				}
				else if (!drunk)
				{
					hasHitWithWall = true;
					attackHasHit = true;
				}
				PlayWallSound();
			}
		}

		protected virtual void MakeEffects(float x, float y, float xI, float yI)
		{
			if (!hasMadeEffects)
			{
				hasMadeEffects = true;
				EffectsController.CreateShrapnel(shrapnelSpark, x, y, 4f, 30f, 3f, xI, yI);
				EffectsController.CreateEffect(hitPuff, x, y, 0f);
			}
		}

		protected virtual void MakeEffects()
		{
			//IL_001c: 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_0043: 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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			if (!hasMadeEffects)
			{
				hasMadeEffects = true;
				EffectsController.CreateShrapnel(shrapnelSpark, ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).point.x + ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).normal.x * 3f, ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).point.y + ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).normal.y * 3f, 4f, 30f, 3f, ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).normal.x * 60f, ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).normal.y * 30f);
				EffectsController.CreateEffect(hitPuff, ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).point.x + ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).normal.x * 3f, ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).point.y + ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).normal.y * 3f);
			}
		}

		protected override void SetGunPosition(float xOffset, float yOffset)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			((Component)((TestVanDammeAnim)this).gunSprite).transform.localPosition = new Vector3(xOffset, yOffset - 1f, -1f);
		}

		public bool HitUnitsStationaryAttack(MonoBehaviour damageSender, int playerNum, int damage, int corpseDamage, DamageType damageType, float xRange, float yRange, float x, float y, float xI, float yI, bool penetrates, bool knock, bool canGib, List<Unit> alreadyHitUnits)
		{
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			if (Map.units == null)
			{
				return false;
			}
			bool result = false;
			bool flag = false;
			int num = 999999;
			for (int num2 = Map.units.Count - 1; num2 >= 0; num2--)
			{
				Unit val = Map.units[num2];
				if ((Object)(object)val != (Object)null && GameModeController.DoesPlayerNumDamage(playerNum, ((NetworkedUnit)val).playerNum) && !val.invulnerable && ((BroforceObject)val).health <= num && Mathf.Abs(((BroforceObject)val).X - x) - xRange < val.width && Mathf.Abs(((BroforceObject)val).Y + val.height / 2f + 3f - y) - yRange < val.height && !alreadyHitUnits.Contains(val))
				{
					alreadyHitUnits.Add(val);
					if (!penetrates && ((BroforceObject)val).health > 0)
					{
						num = 0;
						flag = true;
					}
					if (!val.IsOnGround() && (drunk || ((BroforceObject)val).health <= 0))
					{
						xI *= (drunk ? 1.75f : 1.25f);
						yI *= (drunk ? 1.75f : 1.25f);
					}
					else
					{
						xI *= (drunk ? 1.7f : 1.2f);
						yI *= (drunk ? 1.7f : 1.2f);
					}
					xI = Mathf.Clamp(xI, -1400f, 1400f);
					yI = Mathf.Clamp(yI, -1400f, 1400f);
					if (!canGib && ((BroforceObject)val).health <= 0)
					{
						Map.KnockAndDamageUnit(damageSender, val, 0, damageType, xI, 1.25f * yI, (int)Mathf.Sign(xI), knock, x, y, false);
					}
					else if (((BroforceObject)val).health <= 0)
					{
						Map.KnockAndDamageUnit(damageSender, val, ValueOrchestrator.GetModifiedDamage(corpseDamage, playerNum), damageType, xI, 1.25f * yI, (int)Mathf.Sign(xI), knock, x, y, false);
					}
					else
					{
						damage = ValueOrchestrator.GetModifiedDamage(damage, playerNum);
						if (damage > ((BroforceObject)val).health)
						{
							damage = ((BroforceObject)val).health;
						}
						Map.KnockAndDamageUnit(damageSender, val, damage, damageType, xI, yI, (int)Mathf.Sign(xI), knock, x, y, false);
					}
					result = true;
					if (flag)
					{
						return result;
					}
				}
			}
			return result;
		}

		public bool HitUnits(MonoBehaviour damageSender, int playerNum, int damage, int corpseDamage, DamageType damageType, float xRange, float yRange, float x, float y, float xI, float yI, bool penetrates, bool knock, bool canGib, List<Unit> alreadyHitUnits, bool hitDead)
		{
			//IL_01b9: 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_01fb: Unknown result type (might be due to invalid IL or missing references)
			if (Map.units == null)
			{
				return false;
			}
			bool result = false;
			bool flag = false;
			int num = 999999;
			for (int num2 = Map.units.Count - 1; num2 >= 0; num2--)
			{
				Unit val = Map.units[num2];
				if ((Object)(object)val != (Object)null && GameModeController.DoesPlayerNumDamage(playerNum, ((NetworkedUnit)val).playerNum) && !val.invulnerable && ((BroforceObject)val).health <= num && (hitDead || ((BroforceObject)val).health > 0 || !val.IsOnGround()) && Mathf.Abs(((BroforceObject)val).X - x) - xRange < val.width && Mathf.Abs(((BroforceObject)val).Y + val.height / 2f + 3f - y) - yRange < val.height && !alreadyHitUnits.Contains(val))
				{
					alreadyHitUnits.Add(val);
					if (!penetrates && ((BroforceObject)val).health > 0)
					{
						num = 0;
						flag = true;
					}
					if (!val.IsOnGround() && (drunk || ((BroforceObject)val).health <= 0))
					{
						xI *= (drunk ? 3f : 2.5f);
						yI *= (drunk ? 1.5f : 1.25f);
					}
					xI = Mathf.Clamp(xI, -1400f, 1400f);
					yI = Mathf.Clamp(yI, -1400f, 1400f);
					if (!canGib && ((BroforceObject)val).health <= 0)
					{
						Map.KnockAndDamageUnit(damageSender, val, 0, damageType, xI, 1.25f * yI, (int)Mathf.Sign(xI), knock, x, y, false);
					}
					else if (((BroforceObject)val).health <= 0)
					{
						Map.KnockAndDamageUnit(damageSender, val, ValueOrchestrator.GetModifiedDamage(corpseDamage, playerNum), damageType, xI, 1.25f * yI, (int)Mathf.Sign(xI), knock, x, y, false);
					}
					else
					{
						damage = ValueOrchestrator.GetModifiedDamage(damage, playerNum);
						if (damage > ((BroforceObject)val).health)
						{
							damage = ((BroforceObject)val).health;
						}
						Map.KnockAndDamageUnit(damageSender, val, damage, damageType, xI, yI, (int)Mathf.Sign(xI), knock, x, y, false);
					}
					result = true;
					if (flag)
					{
						return result;
					}
				}
			}
			return result;
		}

		public bool DamageDoodads(int damage, DamageType damageType, float x, float y, float xI, float yI, float range, int playerNum, out bool hitImpenetrableDoodad, MonoBehaviour sender)
		{
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			hitImpenetrableDoodad = false;
			hitSpecialDoodad = false;
			bool result = false;
			Vector2 val3 = default(Vector2);
			for (int num = Map.destroyableDoodads.Count - 1; num >= 0; num--)
			{
				Doodad val = Map.destroyableDoodads[num];
				if ((Object)(object)val == (Object)null || (playerNum < 0 && !val.CanBeDamagedByMooks) || (playerNum >= 0 && val.immuneToHeroDamage) || !val.IsPointInRange(x, y, range))
				{
					continue;
				}
				bool flag = false;
				if (val is ShootableCircularDoodad shootableCircularDoodad)
				{
					if (hasHitThisAttack)
					{
						continue;
					}
					hitSpecialDoodad = true;
					Vector2 val2 = new Vector2(x, y);
					((Vector2)(ref val3))..ctor(((Doodad)shootableCircularDoodad).centerX, ((Doodad)shootableCircularDoodad).centerY);
					float num2 = Vector2.Distance(val2, val3) - shootableCircularDoodad.radius;
					Vector2 val4 = Vector2.MoveTowards(val2, val3, num2 + 0.5f);
					MakeEffects(val4.x, val4.y, xI, yI);
				}
				val.DamageOptional(new DamageObject(damage, damageType, xI, yI, x, y, sender), ref flag);
				if (flag)
				{
					result = true;
					if (val.isImpenetrable)
					{
						hitImpenetrableDoodad = true;
					}
				}
			}
			return result;
		}

		protected void DeflectProjectiles()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			if (Map.DeflectProjectiles((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, 10f, ((BroforceObject)this).X + Mathf.Sign(((Component)this).transform.localScale.x) * 6f, ((BroforceObject)this).Y + 6f, Mathf.Sign(((Component)this).transform.localScale.x) * 200f, true))
			{
				if (!hasHitWithWall)
				{
					PlayWallSound();
				}
				hasHitWithWall = true;
				attackHasHit = true;
			}
		}

		protected override void HitCeiling(RaycastHit ceilingHit)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			if (!drunk)
			{
				((TestVanDammeAnim)this).HitCeiling(ceilingHit);
				if (attackUpwards)
				{
					if (!attackHasHit && attackFrames < 7)
					{
						FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 16.5f, ((BroforceObject)this).Y + 2f, Vector3.up, ((Unit)this).headHeight + Mathf.Abs(((BroforceObject)this).yI * ((Unit)this).t));
					}
					if (!attackHasHit && attackFrames < 7)
					{
						FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 4.5f, ((BroforceObject)this).Y + 2f, Vector3.up, ((Unit)this).headHeight + Mathf.Abs(((BroforceObject)this).yI * ((Unit)this).t));
					}
					attackUpwards = false;
					attackFrames = 0;
				}
				return;
			}
			if (attackUpwards)
			{
				if (!attackHasHit && attackFrames < 7)
				{
					FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 16.5f, ((BroforceObject)this).Y + 2f, Vector3.up, ((Unit)this).headHeight + Mathf.Abs(((BroforceObject)this).yI * ((Unit)this).t));
				}
				if (!attackHasHit && attackFrames < 7)
				{
					FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 4.5f, ((BroforceObject)this).Y + 2f, Vector3.up, ((Unit)this).headHeight + Mathf.Abs(((BroforceObject)this).yI * ((Unit)this).t));
				}
			}
			HitCeilingDrunk(ceilingHit);
		}

		protected virtual void HitCeilingDrunk(RaycastHit ceilingHit)
		{
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			if (((TestVanDammeAnim)this).up || ((TestVanDammeAnim)this).buttonJump)
			{
				((Component)((RaycastHit)(ref ceilingHit)).collider).SendMessage("StepOn", (object)this, (SendMessageOptions)1);
			}
			if (!((TestVanDammeAnim)this).chimneyFlip && ((BroforceObject)this).yI > 100f && (Object)(object)((RaycastHit)(ref ceilingHit)).collider != (Object)null)
			{
				((TestVanDammeAnim)this).currentFootStepGroundType = ((Component)((RaycastHit)(ref ceilingHit)).collider).tag;
				((TestVanDammeAnim)this).PlayFootStepSound(0.2f, 0.6f);
			}
			BroforceObject component = ((Component)((RaycastHit)(ref ceilingHit)).collider).gameObject.GetComponent<BroforceObject>();
			if ((Object)(object)component != (Object)null && component.health > 0)
			{
				((TestVanDammeAnim)this).yIT = ((RaycastHit)(ref ceilingHit)).point.y - ((Unit)this).headHeight - ((BroforceObject)this).Y;
				((BroforceObject)this).yI = 0f;
				((TestVanDammeAnim)this).jumpTime = 0f;
			}
			if ((((TestVanDammeAnim)this).canCeilingHang && ((TestVanDammeAnim)this).CanCheckClimbAlongCeiling() && (((TestVanDammeAnim)this).up || ((TestVanDammeAnim)this).buttonJump)) || ((TestVanDammeAnim)this).hangGrace > 0f)
			{
				((TestVanDammeAnim)this).StartHanging();
			}
		}

		protected void StopAttack(bool allowBuffering = true)
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Invalid comparison between Unknown and I4
			hasHitThisAttack = false;
			attackStationary = (attackUpwards = (attackDownwards = (attackForwards = false)));
			playedWallHit = false;
			hasMadeEffects = false;
			attackFrames = 0;
			((Unit)this).frame = 0;
			((TestVanDammeAnim)this).xIAttackExtra = 0f;
			if (((BroforceObject)this).Y > ((TestVanDammeAnim)this).groundHeight + 1f)
			{
				if ((int)((Unit)this).actionState != 6)
				{
					((Unit)this).actionState = (ActionState)3;
				}
			}
			else if (((TestVanDammeAnim)this).right || ((TestVanDammeAnim)this).left)
			{
				((Unit)this).actionState = (ActionState)1;
			}
			else
			{
				((Unit)this).actionState = (ActionState)0;
			}
			if (allowBuffering)
			{
				if (bufferedSpecial)
				{
					bufferedSpecial = false;
					((TestVanDammeAnim)this).PressSpecial();
				}
				else if (startNewAttack)
				{
					startNewAttack = false;
					((TestVanDammeAnim)this).StartFiring();
				}
			}
			if (((BroforceObject)this).Y < ((TestVanDammeAnim)this).groundHeight + 1f)
			{
				((TestVanDammeAnim)this).StopAirDashing();
			}
			((TestVanDammeAnim)this).canWallClimb = true;
		}

		protected void AnimateAttackStationary()
		{
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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_00bf: Unknown result type (might be due to invalid IL or missing references)
			if (stationaryAttackCounter % 2 == 0)
			{
				((TestVanDammeAnim)this).DeactivateGun();
				if (attackFrames < attackStationaryStrikeFrame)
				{
					((TestVanDammeAnim)this).frameRate = 0.0667f;
				}
				else if (attackFrames < 5)
				{
					((TestVanDammeAnim)this).frameRate = 0.055f;
				}
				else
				{
					((TestVanDammeAnim)this).frameRate = 0.055f;
				}
				if (attackFrames == 8 && startNewAttack)
				{
					startNewAttack = false;
					((TestVanDammeAnim)this).StartFiring();
				}
				if (attackFrames == attackStationaryStrikeFrame)
				{
					FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 9f, ((BroforceObject)this).Y + 6f, new Vector3(((Component)this).transform.localScale.x, 0f, 0f), 8f);
					((TestVanDammeAnim)this).PlayAttackSound();
				}
				if (attackFrames == attackStationaryStrikeFrame + 1)
				{
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
				}
				if (attackFrames >= 8)
				{
					StopAttack();
					return;
				}
				int num = 24 + Mathf.Clamp(attackFrames, 0, 7);
				((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)(num * ((TestVanDammeAnim)this).spritePixelWidth), (float)(((TestVanDammeAnim)this).spritePixelHeight * 6));
			}
			else
			{
				((TestVanDammeAnim)this).DeactivateGun();
				if (attackFrames < attackStationaryStrikeFrame)
				{
					((TestVanDammeAnim)this).frameRate = 0.075f;
				}
				else if (attackFrames < 5)
				{
					((TestVanDammeAnim)this).frameRate = 0.055f;
				}
				else
				{
					((TestVanDammeAnim)this).frameRate = 0.055f;
				}
				if (attackFrames == 8 && startNewAttack)
				{
					startNewAttack = false;
					((TestVanDammeAnim)this).StartFiring();
				}
				if (attackFrames == attackStationaryStrikeFrame)
				{
					FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 9f, ((BroforceObject)this).Y + 6f, new Vector3(((Component)this).transform.localScale.x, 0f, 0f), 8f);
					((TestVanDammeAnim)this).PlayAttackSound();
				}
				if (attackFrames == attackStationaryStrikeFrame + 1)
				{
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
				}
				if (attackFrames >= 8)
				{
					StopAttack();
					return;
				}
				int num2 = 24 + Mathf.Clamp(attackFrames, 0, 7);
				((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)(num2 * ((TestVanDammeAnim)this).spritePixelWidth), (float)(((TestVanDammeAnim)this).spritePixelHeight * 7));
			}
		}

		protected void AnimateAttackForwards()
		{
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			if (!drunk)
			{
				((TestVanDammeAnim)this).DeactivateGun();
				if (attackFrames < attackForwardsStrikeFrame)
				{
					((TestVanDammeAnim)this).frameRate = 0.055f;
				}
				else if (attackFrames < 5)
				{
					((TestVanDammeAnim)this).frameRate = 0.065f;
				}
				else
				{
					((TestVanDammeAnim)this).frameRate = 0.055f;
				}
				if (attackFrames < attackForwardsStrikeFrame + 1)
				{
					((TestVanDammeAnim)this).CreateFaderTrailInstance();
				}
				else if (attackFrames == 8 && startNewAttack)
				{
					startNewAttack = false;
					((TestVanDammeAnim)this).StartFiring();
				}
				if (attackFrames == attackForwardsStrikeFrame)
				{
					FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 9f, ((BroforceObject)this).Y + 6f, new Vector3(((Component)this).transform.localScale.x, 0f, 0f), 8f);
					((TestVanDammeAnim)this).PlayAttackSound();
				}
				else if (attackFrames == attackForwardsStrikeFrame + 1)
				{
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
				}
				if (attackFrames >= 8)
				{
					StopAttack();
					return;
				}
				int num = 24 + Mathf.Clamp(attackFrames, 0, 7);
				((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)(num * ((TestVanDammeAnim)this).spritePixelWidth), (float)(((TestVanDammeAnim)this).spritePixelHeight * (8 + attackSpriteRow)));
				return;
			}
			((TestVanDammeAnim)this).DeactivateGun();
			if (attackFrames < attackForwardsStrikeFrame)
			{
				((TestVanDammeAnim)this).frameRate = 0.1f;
			}
			else if (attackFrames < 5)
			{
				((TestVanDammeAnim)this).frameRate = 0.075f;
			}
			else
			{
				((TestVanDammeAnim)this).frameRate = 0.075f;
			}
			if (attackFrames < attackForwardsStrikeFrame + 1)
			{
				((TestVanDammeAnim)this).CreateFaderTrailInstance();
			}
			else if (attackFrames == 8 && startNewAttack)
			{
				startNewAttack = false;
				((TestVanDammeAnim)this).StartFiring();
			}
			if (attackSpriteRow == 0)
			{
				if (attackFrames > 2 && attackFrames < 8)
				{
					((TestVanDammeAnim)this).xIAttackExtra = (float)attackDirection * 275f;
				}
				else
				{
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
				}
			}
			else if (attackFrames > 1 && attackFrames < 7 && !attackHasHit)
			{
				((TestVanDammeAnim)this).xIAttackExtra = (float)attackDirection * 275f;
			}
			else
			{
				((TestVanDammeAnim)this).xIAttackExtra = 0f;
			}
			if (attackFrames == attackForwardsStrikeFrame)
			{
				FireWeaponGround(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 9f, ((BroforceObject)this).Y + 6f, new Vector3(((Component)this).transform.localScale.x, 0f, 0f), 3f);
				((TestVanDammeAnim)this).PlayAttackSound();
			}
			if (attackFrames >= 8)
			{
				StopAttack();
				return;
			}
			int num2 = 24 + Mathf.Clamp(attackFrames, 0, 7);
			((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)(num2 * ((TestVanDammeAnim)this).spritePixelWidth), (float)(((TestVanDammeAnim)this).spritePixelHeight * (8 + attackSpriteRow)));
		}

		protected void AnimateAttackUpwards()
		{
			//IL_01b0: 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)
			if (!drunk)
			{
				((TestVanDammeAnim)this).DeactivateGun();
				if (attackFrames < attackUpwardsStrikeFrame)
				{
					((TestVanDammeAnim)this).frameRate = 0.075f;
				}
				else if (attackFrames < 5)
				{
					((TestVanDammeAnim)this).frameRate = 0.065f;
				}
				else
				{
					((TestVanDammeAnim)this).frameRate = 0.065f;
				}
				if (attackFrames == attackUpwardsStrikeFrame)
				{
					((BroforceObject)this).xI = ((Component)this).transform.localScale.x * 50f;
					((BroforceObject)this).yI = 240f;
					((TestVanDammeAnim)this).PlayAttackSound();
				}
				if (attackFrames < attackUpwardsStrikeFrame + 2)
				{
					((TestVanDammeAnim)this).CreateFaderTrailInstance();
				}
				if (startNewAttack && attackFrames == attackUpwardsStrikeFrame + 1)
				{
					startNewAttack = false;
					((TestVanDammeAnim)this).StartFiring();
				}
				if (hasHitThisAttack && attackFrames == 6)
				{
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
					postAttackHitPauseTime = 0.25f;
					((BroforceObject)this).xI = 0f;
					((BroforceObject)this).yI = 0f;
				}
				if (attackFrames >= 10 || (attackFrames == 8 && startNewAttack))
				{
					StopAttack();
					((TestVanDammeAnim)this).ChangeFrame();
				}
				else
				{
					int num = 24 + Mathf.Clamp(attackFrames, 0, 7);
					((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)(num * ((TestVanDammeAnim)this).spritePixelWidth), (float)(((TestVanDammeAnim)this).spritePixelHeight * 10));
				}
			}
			else
			{
				((TestVanDammeAnim)this).DeactivateGun();
				if (attackFrames < attackUpwardsStrikeFrame)
				{
					((TestVanDammeAnim)this).frameRate = 0.1f;
				}
				else if (attackFrames < 5)
				{
					((TestVanDammeAnim)this).frameRate = 0.11f;
				}
				else
				{
					((TestVanDammeAnim)this).frameRate = 0.075f;
				}
				if (attackFrames == attackUpwardsStrikeFrame)
				{
					((BroforceObject)this).xI = ((Component)this).transform.localScale.x * 50f;
					((BroforceObject)this).yI = 325f;
					((TestVanDammeAnim)this).PlayAttackSound();
				}
				if (attackFrames < attackUpwardsStrikeFrame + 2)
				{
					((TestVanDammeAnim)this).CreateFaderTrailInstance();
				}
				if (startNewAttack && attackFrames == attackUpwardsStrikeFrame + 1)
				{
					startNewAttack = false;
					((TestVanDammeAnim)this).StartFiring();
				}
				if (hasHitThisAttack && attackFrames == 6)
				{
					((TestVanDammeAnim)this).xIAttackExtra = 0f;
					postAttackHitPauseTime = 0.25f;
					((BroforceObject)this).xI = 0f;
					((BroforceObject)this).yI = 0f;
				}
				if (attackFrames >= 10 || (attackFrames == 8 && startNewAttack))
				{
					StopAttack();
					((TestVanDammeAnim)this).ChangeFrame();
				}
				else
				{
					int num2 = 24 + Mathf.Clamp(attackFrames, 0, 7);
					((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)(num2 * ((TestVanDammeAnim)this).spritePixelWidth), (float)(((TestVanDammeAnim)this).spritePixelHeight * 10));
				}
			}
		}

		protected void AnimateAttackDownwards()
		{
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			if (!drunk)
			{
				((TestVanDammeAnim)this).DeactivateGun();
				if (attackFrames < attackDownwardsStrikeFrame)
				{
					((TestVanDammeAnim)this).frameRate = 0.0767f;
				}
				else if (attackFrames <= 5)
				{
					((TestVanDammeAnim)this).frameRate = 0.0767f;
				}
				else
				{
					((TestVanDammeAnim)this).frameRate = 0.06f;
				}
				if (attackFrames < attackDownwardsStrikeFrame + 2)
				{
					((TestVanDammeAnim)this).CreateFaderTrailInstance();
				}
				if (startNewAttack && attackFrames == attackDownwardsStrikeFrame + 1)
				{
					startNewAttack = false;
					((TestVanDammeAnim)this).StartFiring();
				}
				if (attackFrames == attackDownwardsStrikeFrame)
				{
					if (!((TestVanDammeAnim)this).usingSpecial || !hasHitThisAttack)
					{
						((BroforceObject)this).yI = -250f;
					}
					((BroforceObject)this).xI = ((Component)this).transform.localScale.x * 60f;
					((TestVanDammeAnim)this).PlayAttackSound();
				}
				if (attackFrames >= 9 || (attackFrames == 6 && startNewAttack))
				{
					StopAttack();
					((TestVanDammeAnim)this).ChangeFrame();
				}
				else
				{
					int num = 24 + Mathf.Clamp(attackFrames, 0, 7);
					((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)(num * ((TestVanDammeAnim)this).spritePixelWidth), (float)(((TestVanDammeAnim)this).spritePixelHeight * 11));
				}
				if (attackFrames == 7 && ((TestVanDammeAnim)this).usingSpecial)
				{
					if (!hasHitThisAttack)
					{
						((TestVanDammeAnim)this).usingSpecial = false;
					}
					if (((TestVanDammeAnim)this).usingSpecial)
					{
						((TestVanDammeAnim)this).UseSpecial();
					}
				}
				return;
			}
			((TestVanDammeAnim)this).DeactivateGun();
			if (attackFrames < attackDownwardsStrikeFrame)
			{
				((TestVanDammeAnim)this).frameRate = 0.19f;
			}
			else if (attackFrames <= 5)
			{
				((TestVanDammeAnim)this).frameRate = 0.08f;
			}
			else
			{
				((TestVanDammeAnim)this).frameRate = 0.08f;
			}
			if (attackFrames < attackDownwardsStrikeFrame + 2)
			{
				((TestVanDammeAnim)this).CreateFaderTrailInstance();
			}
			if (!hasHitThisAttack && attackFrames > 5)
			{
				attackFrames = 5;
			}
			if (attackFrames == attackDownwardsStrikeFrame)
			{
				if (!((TestVanDammeAnim)this).usingSpecial || !hasHitThisAttack)
				{
					((BroforceObject)this).yI = -300f;
				}
				((BroforceObject)this).xI = ((Component)this).transform.localScale.x * 60f;
				((TestVanDammeAnim)this).PlayAttackSound();
			}
			if (attackFrames >= 9)
			{
				StopAttack();
				((TestVanDammeAnim)this).ChangeFrame();
			}
			else
			{
				int num2 = 24 + Mathf.Clamp(attackFrames, 0, 7);
				((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)(num2 * ((TestVanDammeAnim)this).spritePixelWidth), (float)(((TestVanDammeAnim)this).spritePixelHeight * 11));
			}
		}

		protected override void IncreaseFrame()
		{
			((BroBase)this).IncreaseFrame();
			if (attackStationary || attackUpwards || attackDownwards || attackForwards)
			{
				attackFrames++;
			}
			else if (((TestVanDammeAnim)this).usingSpecial)
			{
				usingSpecialFrame++;
			}
		}

		protected override void ChangeFrame()
		{
			if (((BroforceObject)this).health <= 0 || ((TestVanDammeAnim)this).chimneyFlip)
			{
				((TestVanDammeAnim)this).ChangeFrame();
			}
			else if (attackStationary)
			{
				AnimateAttackStationary();
			}
			else if (attackUpwards)
			{
				AnimateAttackUpwards();
			}
			else if (attackDownwards)
			{
				AnimateAttackDownwards();
			}
			else if (attackForwards)
			{
				AnimateAttackForwards();
			}
			else
			{
				((TestVanDammeAnim)this).ChangeFrame();
			}
		}

		protected override void AnimateZipline()
		{
			((TestVanDammeAnim)this).AnimateZipline();
			((TestVanDammeAnim)this).SetGunSprite(((TestVanDammeAnim)this).gunFrame, 0);
		}

		protected override void CreateFaderTrailInstance()
		{
			//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_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			Object obj = EffectsController.InstantiateEffect((Object)(object)((Component)((TestVanDammeAnim)this).faderSpritePrefab).GetComponent<FaderSprite>(), ((Component)this).transform.position, ((Component)this).transform.rotation);
			FaderSprite val = (FaderSprite)(object)((obj is FaderSprite) ? obj : null);
			if ((Object)(object)val != (Object)null)
			{
				((Component)val).transform.localScale = ((Component)this).transform.localScale;
				val.SetMaterial(((Component)this).GetComponent<Renderer>().material, ((TestVanDammeAnim)this).sprite.lowerLeftPixel, ((TestVanDammeAnim)this).sprite.pixelDimensions, ((SpriteBase)((TestVanDammeAnim)this).sprite).offset);
				val.fadeM = 0.15f;
				val.maxLife = 0.15f;
				val.moveForwards = true;
			}
		}

		protected override void FireFlashAvatar()
		{
			if (drunk)
			{
				((TestVanDammeAnim)this).avatarGunFireTime = 0.25f;
				HeroController.SetAvatarFireFrame(((NetworkedUnit)this).playerNum, Random.Range(5, 8));
			}
			if ((Object)(object)((TestVanDammeAnim)this).player != (Object)null && setRumbleTraverse != null)
			{
				setRumbleTraverse.GetValue(new object[1] { ((TestVanDammeAnim)this).rumbleAmountPerShot });
			}
		}

		protected override void RunAvatarFiring()
		{
			if (((BroforceObject)this).health <= 0)
			{
				return;
			}
			if (((TestVanDammeAnim)this).avatarGunFireTime > 0f)
			{
				((TestVanDammeAnim)this).avatarGunFireTime = ((TestVanDammeAnim)this).avatarGunFireTime - ((Unit)this).t;
				if (((TestVanDammeAnim)this).avatarGunFireTime <= 0f)
				{
					if (((TestVanDammeAnim)this).avatarAngryTime > 0f)
					{
						HeroController.SetAvatarAngry(((NetworkedUnit)this).playerNum, ((TestVanDammeAnim)this).usePrimaryAvatar);
					}
					else
					{
						HeroController.SetAvatarCalm(((NetworkedUnit)this).playerNum, ((TestVanDammeAnim)this).usePrimaryAvatar);
					}
				}
			}
			if (((TestVanDammeAnim)this).fire && !drunk)
			{
				if (!((TestVanDammeAnim)this).wasFire && ((TestVanDammeAnim)this).avatarGunFireTime <= 0f)
				{
					HeroController.SetAvatarAngry(((NetworkedUnit)this).playerNum, ((TestVanDammeAnim)this).usePrimaryAvatar);
				}
				if (attackStationary || attackForwards || attackUpwards || attackDownwards)
				{
					((TestVanDammeAnim)this).avatarAngryTime = 0.15f;
					return;
				}
				((TestVanDammeAnim)this).avatarAngryTime = 0f;
				HeroController.SetAvatarCalm(((NetworkedUnit)this).playerNum, ((TestVanDammeAnim)this).usePrimaryAvatar);
			}
			else if (((TestVanDammeAnim)this).avatarAngryTime > 0f)
			{
				((TestVanDammeAnim)this).avatarAngryTime = ((TestVanDammeAnim)this).avatarAngryTime - ((Unit)this).t;
				if (((TestVanDammeAnim)this).avatarAngryTime <= 0f)
				{
					HeroController.SetAvatarCalm(((NetworkedUnit)this).playerNum, ((TestVanDammeAnim)this).usePrimaryAvatar);
				}
			}
		}

		protected void ClearCurrentAttackVariables()
		{
			alreadyHit.Clear();
			hasHitWithFists = false;
			attackHasHit = false;
			hasHitWithWall = false;
		}

		private void TimeBump(float timeStop = 0.025f)
		{
			TimeController.StopTime(timeStop, 0.1f, 0f, false, false, false);
		}

		private void MakeKungfuSound()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			if (Time.time - lastSoundTime > 0.3f)
			{
				lastSoundTime = Time.time;
				Sound.GetInstance().PlaySoundEffectAt(((TestVanDammeAnim)this).soundHolder.attack3Sounds, 0.6f, ((Component)this).transform.position, drunk ? 0.85f : 1f, true, false, false, 0f);
			}
		}

		protected override void PlayAttackSound()
		{
			((TestVanDammeAnim)this).PlayAttackSound();
		}

		protected void PlayPrimaryHitSound(float volume = 0.6f)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)((TestVanDammeAnim)this).sound == (Object)null)
			{
				((TestVanDammeAnim)this).sound = Sound.GetInstance();
			}
			Sound sound = ((TestVanDammeAnim)this).sound;
			if (sound != null)
			{
				sound.PlaySoundEffectAt(((TestVanDammeAnim)this).soundHolder.special2Sounds, volume, ((Component)this).transform.position, 1f, true, false, false, 0f);
			}
		}

		public void PlayWallSound()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			if (!playedWallHit)
			{
				playedWallHit = true;
				if ((Object)(object)((TestVanDammeAnim)this).sound == (Object)null)
				{
					((TestVanDammeAnim)this).sound = Sound.GetInstance();
				}
				Sound sound = ((TestVanDammeAnim)this).sound;
				if (sound != null)
				{
					sound.PlaySoundEffectAt(((TestVanDammeAnim)this).soundHolder.attack2Sounds, wallHitVolume, ((Component)this).transform.position, 1f, true, false, false, 0f);
				}
			}
		}

		protected override void PlayAidDashSound()
		{
			((TestVanDammeAnim)this).PlaySpecialAttackSound(0.5f);
		}

		protected bool IsAttacking()
		{
			if ((!((TestVanDammeAnim)this).fire || ((TestVanDammeAnim)this).gunFrame <= 1) && !(Time.time - lastAttackingTime < 0.0445f))
			{
				if ((attackDownwards || attackForwards || attackUpwards) && attackFrames > 1)
				{
					return attackFrames < attackForwardsStrikeFrame + 2;
				}
				return false;
			}
			return true;
		}

		public override void Damage(int damage, DamageType damageType, float xI, float yI, int direction, MonoBehaviour damageSender, float hitX, float hitY)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_0042: 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_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Invalid comparison between Unknown and I4
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Invalid comparison between Unknown and I4
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Invalid comparison between Unknown and I4
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Invalid comparison between Unknown and I4
			if (((int)damageType != 15 && (int)damageType != 7 && (int)damageType != 9 && (int)damageType != 2 && (int)damageType != 1) || !IsAttacking() || (Mathf.Sign(((Component)this).transform.localScale.x) == Mathf.Sign(xI) && (int)damageType != 15))
			{
				((BroBase)this).Damage(damage, damageType, xI, yI, direction, damageSender, hitX, hitY);
			}
		}

		protected override void PressHighFiveMelee(bool forceHighFive = false)
		{
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Invalid comparison between Unknown and I4
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			if (((BroforceObject)this).health <= 0 || ((TestVanDammeAnim)this).MustIgnoreHighFiveMeleePress())
			{
				return;
			}
			((TestVanDammeAnim)this).SetGestureAnimation((Gestures)0);
			Grenade nearbyGrenade = Map.GetNearbyGrenade(20f, ((BroforceObject)this).X, ((BroforceObject)this).Y + ((TestVanDammeAnim)this).waistHeight);
			((TestVanDammeAnim)this).FindNearbyMook();
			TeleportDoor nearbyTeleportDoor = Map.GetNearbyTeleportDoor(((BroforceObject)this).X, ((BroforceObject)this).Y);
			if ((Object)(object)nearbyTeleportDoor != (Object)null && ((TestVanDammeAnim)this).CanUseSwitch() && nearbyTeleportDoor.Activate((TestVanDammeAnim)(object)this))
			{
				return;
			}
			Switch nearbySwitch = Map.GetNearbySwitch(((BroforceObject)this).X, ((BroforceObject)this).Y);
			if (GameModeController.IsDeathMatchMode || (int)GameModeController.GameMode == 3)
			{
				if ((Object)(object)nearbySwitch != (Object)null && ((TestVanDammeAnim)this).CanUseSwitch())
				{
					nearbySwitch.Activate((Unit)(object)this);
				}
				else
				{
					bool flag = false;
					for (int i = -1; i < 4; i++)
					{
						if (i != ((NetworkedUnit)this).playerNum && Map.IsUnitNearby(i, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 16f, ((BroforceObject)this).Y + 8f, 28f, 14f, true, ref ((TestVanDammeAnim)this).meleeChosenUnit))
						{
							((TestVanDammeAnim)this).StartMelee();
							flag = true;
						}
					}
					if (!flag && (Object)(object)nearbySwitch != (Object)null && ((TestVanDammeAnim)this).CanUseSwitch())
					{
						nearbySwitch.Activate((Unit)(object)this);
					}
				}
			}
			if ((Object)(object)nearbyGrenade != (Object)null && !((TestVanDammeAnim)this).doingMelee && !attackForwards && !attackDownwards && !attackUpwards && !attackStationary && ((TestVanDammeAnim)this).rollingFrames <= 0)
			{
				((TestVanDammeAnim)this).ThrowBackGrenade(nearbyGrenade);
			}
			else
			{
				if (GameModeController.IsDeathMatchMode && ((TestVanDammeAnim)this).doingMelee)
				{
					return;
				}
				if (Map.IsCitizenNearby(((BroforceObject)this).X, ((BroforceObject)this).Y, 32, 32))
				{
					if (!((TestVanDammeAnim)this).doingMelee)
					{
						((TestVanDammeAnim)this).StartHighFive();
					}
				}
				else if (forceHighFive && !((TestVanDammeAnim)this).doingMelee)
				{
					((TestVanDammeAnim)this).StartHighFive();
				}
				else if ((Object)(object)nearbySwitch != (Object)null && ((TestVanDammeAnim)this).CanUseSwitch())
				{
					nearbySwitch.Activate((Unit)(object)this);
				}
				else if ((Object)(object)((TestVanDammeAnim)this).meleeChosenUnit == (Object)null && Map.IsUnitNearby(-1, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 16f, ((BroforceObject)this).Y + 8f, 28f, 14f, false, ref ((TestVanDammeAnim)this).meleeChosenUnit))
				{
					((TestVanDammeAnim)this).StartMelee();
				}
				else if (((TestVanDammeAnim)this).CheckBustCage())
				{
					((TestVanDammeAnim)this).StartMelee();
				}
				else if (HeroController.IsAnotherPlayerNearby(((NetworkedUnit)this).playerNum, ((BroforceObject)this).X, ((BroforceObject)this).Y, 32f, 32f))
				{
					if (!((TestVanDammeAnim)this).doingMelee)
					{
						((TestVanDammeAnim)this).StartHighFive();
					}
				}
				else
				{
					((TestVanDammeAnim)this).StartMelee();
				}
			}
		}

		protected override void StartMelee()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Expected I4, but got Unknown
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			((BroBase)this).currentMeleeType = ((BroBase)this).meleeType;
			RaycastHit val = default(RaycastHit);
			if ((Physics.Raycast(new Vector3(((BroforceObject)this).X, ((BroforceObject)this).Y + 5f, 0f), Vector3.down, ref val, 16f, LayerMask.op_Implicit(((TestVanDammeAnim)this).platformLayer)) || Physics.Raycast(new Vector3(((BroforceObject)this).X + 4f, ((BroforceObject)this).Y + 5f, 0f), Vector3.down, ref val, 16f, LayerMask.op_Implicit(((TestVanDammeAnim)this).platformLayer)) || Physics.Raycast(new Vector3(((BroforceObject)this).X - 4f, ((BroforceObject)this).Y + 5f, 0f), Vector3.down, ref val, 16f, LayerMask.op_Implicit(((TestVanDammeAnim)this).platformLayer))) && (Object)(object)((Component)((RaycastHit)(ref val)).collider).GetComponentInParent<Animal>() != (Object)null)
			{
				((BroBase)this).currentMeleeType = (MeleeType)0;
			}
			MeleeType currentMeleeType = ((BroBase)this).currentMeleeType;
			switch ((int)currentMeleeType)
			{
			case 0:
				((TestVanDammeAnim)this).counter = 0f;
				((BroBase)this).StartKnifeMelee();
				break;
			case 1:
			case 15:
				((BroBase)this).StartPunch();
				break;
			case 2:
			case 3:
			case 4:
			case 5:
			case 6:
			case 7:
			case 8:
			case 9:
			case 10:
			case 11:
			case 12:
			case 13:
			case 14:
				((BroBase)this).StartCustomMelee();
				break;
			}
		}

		protected override void StartCustomMelee()
		{
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			if (((TestVanDammeAnim)this).doingMelee)
			{
				return;
			}
			if (holdingItem)
			{
				StartThrowingItem();
				return;
			}
			if (((TestVanDammeAnim)this).throwingHeldObject && (Object)(object)((TestVanDammeAnim)this).heldGrenade == (Object)null && (Object)(object)((TestVanDammeAnim)this).heldMook == (Object)null)
			{
				((TestVanDammeAnim)this).throwingHeldObject = false;
			}
			StopAttack(allowBuffering: false);
			((Unit)this).frame = 0;
			((TestVanDammeAnim)this).counter = -0.05f;
			((BroBase)this).ResetMeleeValues();
			((BroBase)this).lerpToMeleeTargetPos = 0f;
			((TestVanDammeAnim)this).doingMelee = true;
			((TestVanDammeAnim)this).showHighFiveAfterMeleeTimer = 0f;
			((TestVanDammeAnim)this).DeactivateGun();
			((TestVanDammeAnim)this).SetMeleeType();
			((BroBase)this).meleeStartPos = ((Component)this).transform.position;
			progressedFarEnough = false;
			((TestVanDammeAnim)this).canWallClimb = false;
			((Component)this).GetComponent<Renderer>().material = meleeSpriteGrabThrowing;
			chosenItem = ChooseItem();
			((TestVanDammeAnim)this).AnimateMelee();
		}

		protected MeleeItem ChooseItem()
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Invalid comparison between Unknown and I4
			//IL_0080: 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_0079: Invalid comparison between Unknown and I4
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Invalid comparison between Unknown and I4
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Invalid comparison between Unknown and I4
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Expected I4, but got Unknown
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			List<MeleeItem> list = CustomTriggerStateManager.Get<List<MeleeItem>>("DrunkenBroster_MeleePool", (List<MeleeItem>)null);
			if (list != null && list.Count > 0)
			{
				return list[Random.Range(0, list.Count)];
			}
			if (CompletelyRandomMeleeItems)
			{
				if (EnabledMeleeItems.Count > 0)
				{
					int index = Random.Range(0, EnabledMeleeItems.Count);
					return EnabledMeleeItems[index];
				}
				return MeleeItem.Crate;
			}
			LevelTheme val = Map.MapData.theme;
			bool hasAliens = Map.hasAliens;
			int num = 0;
			if ((int)val == 2 || (int)val == 3 || (int)val == 6)
			{
				val = (LevelTheme)0;
				num += 5;
			}
			else if ((int)val == 5)
			{
				val = (LevelTheme)1;
				num += 5;
			}
			if (lastThrownItem == MeleeItem.Crate || lastThrownItem == MeleeItem.Bottle)
			{
				num += 5;
			}
			List<KeyValuePair<MeleeItem, int>> list2 = new List<KeyValuePair<MeleeItem, int>>
			{
				new KeyValuePair<MeleeItem, int>(MeleeItem.Crate, 110),
				new KeyValuePair<MeleeItem, int>(MeleeItem.Bottle, 90)
			};
			switch ((int)val)
			{
			case 0:
				if (!hasAliens)
				{
					list2.Add(new KeyValuePair<MeleeItem, int>(MeleeItem.Coconut, 25 + num));
					list2.Add(new KeyValuePair<MeleeItem, int>(MeleeItem.Beehive, 20 + num));
				}
				list2.Add(new KeyValuePair<MeleeItem, int>(MeleeItem.ExplosiveBarrel, 12 + num));
				break;
			case 1:
				list2.Add(new KeyValuePair<MeleeItem, int>(MeleeItem.SoccerBall, 25 + num));
				list2.Add(new KeyValuePair<MeleeItem, int>(MeleeItem.Tire, 13 + num));
				list2.Add(new KeyValuePair<MeleeItem, int>(MeleeItem.ExplosiveBarrel, 11 + num));
				break;
			case 4:
				list2.Add(new KeyValuePair<MeleeItem, int>(MeleeItem.ExplosiveBarrel, 15 + num));
				list2.Add(new KeyValuePair<MeleeItem, int>(MeleeItem.Skull, 10 + num));
				break;
			}
			if (hasAliens)
			{
				list2.Add(new KeyValuePair<MeleeItem, int>(MeleeItem.AlienEgg, 10 + num));
				list2.Add(new KeyValuePair<MeleeItem, int>(MeleeItem.AcidEgg, 20 + num));
			}
			for (int i = 0; i < list2.Count; i++)
			{
				if (list2[i].Key == lastThrownItem)
				{
					list2[i] = new KeyValuePair<MeleeItem, int>(list2[i].Key, list2[i].Value / 8);
					break;
				}
			}
			list2.RemoveAll((KeyValuePair<MeleeItem, int> item) => !EnabledMeleeItems.Contains(item.Key));
			if (list2.Count == 0)
			{
				return MeleeItem.Crate;
			}
			int num2 = 0;
			foreach (KeyValuePair<MeleeItem, int> item in list2)
			{
				num2 += item.Value;
			}
			int num3 = Random.Range(0, num2);
			int num4 = 0;
			foreach (KeyValuePair<MeleeItem, int> item2 in list2)
			{
				num4 += item2.Value;
				if (num3 < num4)
				{
					return item2.Key;
				}
			}
			return MeleeItem.Crate;
		}

		protected override void AnimateCustomMelee()
		{
			((TestVanDammeAnim)this).SetSpriteOffset(0f, 0f);
			((TestVanDammeAnim)this).rollingFrames = 0;
			if (!throwingHeldItem)
			{
				AnimatePullingOutItem();
			}
			else
			{
				AnimateThrowingHeldItem();
			}
		}

		protected void AnimatePullingOutItem()
		{
			if (((Unit)this).frame == 2 && (Object)(object)((TestVanDammeAnim)this).nearbyMook != (Object)null && ((Unit)((TestVanDammeAnim)this).nearbyMook).CanBeThrown() && ((TestVanDammeAnim)this).highFive)
			{
				((TestVanDammeAnim)this).CancelMelee();
				((TestVanDammeAnim)this).ThrowBackMook(((TestVanDammeAnim)this).nearbyMook);
				((TestVanDammeAnim)this).nearbyMook = null;
				return;
			}
			if (((Unit)this).frame < 4)
			{
				((TestVanDammeAnim)this).frameRate = 0.075f;
			}
			else
			{
				((TestVanDammeAnim)this).frameRate = 0.06f;
			}
			int num = (int)(chosenItem + 1);
			((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)(((Unit)this).frame * ((TestVanDammeAnim)this).spritePixelWidth), (float)(num * ((TestVanDammeAnim)this).spritePixelHeight));
			if (((Unit)this).frame == 3)
			{
				PerformMeleeAttack(shouldTryHitTerrain: true, playMissSound: true);
			}
			else if (((Unit)this).frame == 4 && !((TestVanDammeAnim)this).meleeHasHit)
			{
				PerformMeleeAttack(shouldTryHitTerrain: true, playMissSound: false);
			}
			if (((Unit)this).frame >= 3)
			{
				progressedFarEnough = true;
			}
			if (((Unit)this).frame >= 11)
			{
				((Unit)this).frame = 0;
				((TestVanDammeAnim)this).CancelMelee();
			}
		}

		protected void AnimateThrowingHeldItem()
		{
			((TestVanDammeAnim)this).frameRate = 0.09f;
			int num = (int)(heldItem + 1);
			int num2 = 11;
			((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)((((Unit)this).frame + num2) * ((TestVanDammeAnim)this).spritePixelWidth), (float)(num * ((TestVanDammeAnim)this).spritePixelHeight));
			if (((Unit)this).frame == 4 && !thrownItem)
			{
				ThrowHeldItem();
			}
			if (((Unit)this).frame >= 8)
			{
				((Unit)this).frame = 0;
				((TestVanDammeAnim)this).CancelMelee();
			}
		}

		protected void RunBarrelEffects()
		{
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: 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_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			if (((TestVanDammeAnim)this).doingMelee || !(explosionCounter > 0f))
			{
				return;
			}
			explosionCounter -= ((Unit)this).t;
			if (!(explosionCounter < 3f))
			{
				return;
			}
			flameCounter += ((Unit)this).t;
			if (flameCounter > 0f && explosionCounter > 0.2f)
			{
				if (explosionCounter < 1f)
				{
					flameCounter -= 0.09f;
				}
				else if (explosionCounter < 2f)
				{
					flameCounter -= 0.12f;
				}
				else
				{
					flameCounter -= 0.2f;
				}
				Vector3 val = Vector2.op_Implicit(Random.insideUnitCircle);
				switch (Random.Range(0, 3))
				{
				case 0:
					EffectsController.CreateEffect(fire1, ((BroforceObject)this).X + val.x * 3f, ((BroforceObject)this).Y + val.y * 3f + 8f, Random.value * 0.0434f, Vector3.zero);
					break;
				case 1:
					EffectsController.CreateEffect(fire2, ((BroforceObject)this).X + val.x * 3f, ((BroforceObject)this).Y + val.y * 3f + 8f, Random.value * 0.0434f, Vector3.zero);
					break;
				case 2:
					EffectsController.CreateEffect(fire3, ((BroforceObject)this).X + val.x * 3f, ((BroforceObject)this).Y + val.y * 3f + 8f, Random.value * 0.0434f, Vector3.zero);
					break;
				}
			}
			RunBarrelWarning(((Unit)this).t, explosionCounter);
			if (explosionCounter <= 0.1f)
			{
				ExplodeBarrelInHands();
			}
		}

		protected void RunBarrelWarning(float t, float explosionTime)
		{
			if (explosionTime < 2f)
			{
				warningCounter += t;
				if (warningOn && warningCounter > 0.0667f)
				{
					warningOn = false;
					warningCounter -= 0.0667f;
				}
				else if (warningCounter > 0.0667f && explosionTime < 0.75f)
				{
					warningOn = true;
					warningCounter -= 0.0667f;
				}
				else if (warningCounter > 0.175f && explosionTime < 1.25f)
				{
					warningOn = true;
					warningCounter -= 0.175f;
				}
				else if (warningCounter > 0.2f)
				{
					warningOn = true;
					warningCounter -= 0.2f;
				}
				((TestVanDammeAnim)this).SetGunSprite(0, 0);
			}
		}

		protected void ExplodeBarrelInHands()
		{
			//IL_0093: Unknown result type (might be