Decompiled source of RJBrocready v1.1.0

UMM/BroMaker_Storage/RJBrocready/RJBrocready.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
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 HarmonyLib;
using RocketLib.CustomTriggers;
using Rogueforce;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("RJBrocready")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RJBrocready")]
[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 RJBrocready;

public class Dynamite : CustomGrenade
{
	protected float flashCounter;

	protected float flashRate = 0.03f;

	protected int flashFrame;

	protected bool flashReversing;

	private Rigidbody rigidbody;

	public AudioClip explosionSound;

	protected override void Awake()
	{
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)base.DefaultSoundHolder == (Object)null)
		{
			base.DefaultSoundHolder = ((Unit)HeroController.GetHeroPrefab((HeroType)5)).projectile.soundHolder;
			base.SpritePixelDimensions = new Vector2(16f, 16f);
			((Shrapnel)this).spriteWidth = 18f;
			((Shrapnel)this).spriteHeight = 22f;
		}
		((CustomGrenade)this).Awake();
		((Shrapnel)this).bounceM = 0.3f;
		((Grenade)this).disabledAtStart = false;
		((Shrapnel)this).shrink = false;
		((Grenade)this).trailType = (TrailType)0;
		((Shrapnel)this).lifeLossOnBounce = false;
		((Shrapnel)this).deathOnBounce = false;
		((Shrapnel)this).destroyInsideWalls = false;
		((Shrapnel)this).rotateAtRightAngles = false;
		((Shrapnel)this).fades = false;
		((Shrapnel)this).fadeUVs = false;
		((Grenade)this).useAngularFriction = true;
		((Shrapnel)this).shrapnelControlsMotion = false;
	}

	public override void PrefabSetup()
	{
		explosionSound = ResourcesController.GetAudioClip(base.SoundPath, "dynamiteExplosion.wav");
	}

	public override void ThrowGrenade(float XI, float YI, float newX, float newY, int _playerNum)
	{
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		((Behaviour)this).enabled = true;
		((Component)this).transform.parent = null;
		((BroforceObject)this).SetXY(newX, newY);
		if (Mathf.Abs(XI) > 100f)
		{
			((BroforceObject)this).xI = Mathf.Sign(XI) * 300f;
			((BroforceObject)this).yI = 250f;
		}
		else
		{
			((BroforceObject)this).xI = XI;
			((BroforceObject)this).yI = YI;
		}
		((Grenade)this).playerNum = _playerNum;
		rigidbody.position = new Vector3(newX, newY);
		if (Mathf.Abs(((BroforceObject)this).xI) > 100f)
		{
			((Shrapnel)this).rI = (0f - Mathf.Sign(((BroforceObject)this).xI)) * (float)Random.Range(20, 25);
		}
		else
		{
			((Shrapnel)this).rI = (0f - Mathf.Sign(((BroforceObject)this).xI)) * (float)Random.Range(10, 15);
		}
		rigidbody.AddForce(new Vector3(((BroforceObject)this).xI, ((BroforceObject)this).yI, 0f), (ForceMode)2);
		rigidbody.AddTorque(new Vector3(0f, 0f, ((Shrapnel)this).rI), (ForceMode)2);
		((Grenade)this).SetMinLife(0.7f);
	}

	public override void Launch(float newX, float newY, float xI, float yI)
	{
		//IL_03df: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a0: 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_01e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0208: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)this == (Object)null)
		{
			return;
		}
		((BroforceObject)this).SetXY(newX, newY);
		((BroforceObject)this).xI = xI;
		((BroforceObject)this).yI = yI;
		((Shrapnel)this).r = 0f;
		((Shrapnel)this).life = 2f;
		((Shrapnel)this).startLife = ((Shrapnel)this).life;
		if ((Object)(object)((Shrapnel)this).sprite != (Object)null)
		{
			((Shrapnel)this).spriteWidth = ((SpriteBase)((Shrapnel)this).sprite).width;
			((Shrapnel)this).spriteHeight = ((SpriteBase)((Shrapnel)this).sprite).height;
		}
		((Shrapnel)this).spriteWidthI = (0f - ((Shrapnel)this).spriteWidth) / ((Shrapnel)this).life * 1f;
		((Shrapnel)this).spriteHeightI = (0f - ((Shrapnel)this).spriteHeight) / ((Shrapnel)this).life * 1f;
		if (Mathf.Abs(xI) > 100f)
		{
			((Shrapnel)this).rI = (0f - Mathf.Sign(xI)) * (float)Random.Range(20, 25);
		}
		else
		{
			((Shrapnel)this).rI = (0f - Mathf.Sign(xI)) * (float)Random.Range(10, 15);
		}
		((Shrapnel)this).SetPosition();
		if (!((Shrapnel)this).shrapnelControlsMotion && (Object)(object)((Component)this).GetComponent<Rigidbody>() == (Object)null)
		{
			BoxCollider val = ((Component)this).gameObject.GetComponent<BoxCollider>();
			if ((Object)(object)val == (Object)null)
			{
				val = ((Component)this).gameObject.AddComponent<BoxCollider>();
			}
			val.size = new Vector3(20f, 6f, 6f);
			rigidbody = ((Component)this).gameObject.AddComponent<Rigidbody>();
			rigidbody.AddForce(new Vector3(xI, yI, 0f), (ForceMode)2);
			rigidbody.constraints = (RigidbodyConstraints)56;
			rigidbody.maxAngularVelocity = float.MaxValue;
			rigidbody.AddTorque(new Vector3(0f, 0f, ((Shrapnel)this).rI), (ForceMode)2);
			rigidbody.drag = 0.8f;
			rigidbody.angularDrag = 0.1f;
			rigidbody.mass = 200f;
			Quaternion rotation = rigidbody.rotation;
			((Quaternion)(ref rotation)).eulerAngles = new Vector3(0f, 0f, 90f);
			rigidbody.rotation = rotation;
		}
		((Behaviour)this).enabled = true;
		((Grenade)this).lastTrailX = newX;
		((Grenade)this).lastTrailY = newY;
		if (Map.InsideWall(newX, newY, ((Shrapnel)this).size, false))
		{
			if (xI > 0f && !Map.InsideWall(newX - 8f, newY, ((Shrapnel)this).size, false))
			{
				float num = 8f;
				float num2 = 0f;
				bool flag = false;
				bool flag2 = false;
				if (Map.ConstrainToBlocks((MonoBehaviour)(object)this, newX - 8f, newY, ((Shrapnel)this).size, ref num, ref num2, ref flag, ref flag2, false))
				{
					newX = newX - 8f + num;
					newY += num2;
				}
				xI = (0f - xI) * 0.6f;
			}
			else if (xI > 0f)
			{
				float num3 = xI * 0.03f;
				float num4 = yI * 0.03f;
				bool flag3 = false;
				bool flag4 = false;
				if (Map.ConstrainToBlocks((MonoBehaviour)(object)this, newX, newY, ((Shrapnel)this).size, ref num3, ref num4, ref flag3, ref flag4, false))
				{
					((Shrapnel)this).Bounce(flag3, flag4);
				}
				newX += num3;
				newY += num4;
				xI = (0f - xI) * 0.6f;
			}
			if (xI < 0f && !Map.InsideWall(newX + 8f, newY, ((Shrapnel)this).size, false))
			{
				float num5 = -8f;
				float num6 = 0f;
				bool flag5 = false;
				bool flag6 = false;
				if (Map.ConstrainToBlocks((MonoBehaviour)(object)this, newX + 8f, newY, ((Shrapnel)this).size, ref num5, ref num6, ref flag5, ref flag6, false))
				{
					newX = newX + 8f + num5;
					newY += num6;
				}
				xI = (0f - xI) * 0.6f;
			}
			else if (xI < 0f)
			{
				float num7 = xI * 0.03f;
				float num8 = yI * 0.03f;
				bool flag7 = false;
				bool flag8 = false;
				if (Map.ConstrainToBlocks((MonoBehaviour)(object)this, newX, newY, ((Shrapnel)this).size, ref num7, ref num8, ref flag7, ref flag8, false))
				{
					((Shrapnel)this).Bounce(flag7, flag8);
				}
				newX += num7;
				newY += num8;
				xI = (0f - xI) * 0.6f;
			}
		}
		((Shrapnel)this).SetPosition();
		((SpriteBase)((Shrapnel)this).sprite).offset = new Vector3(0f, -0.5f, 0f);
	}

	protected override bool Update()
	{
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		bool result = ((Grenade)this).Update();
		flashCounter += ((Shrapnel)this).t;
		if (flashCounter > flashRate)
		{
			flashCounter -= flashRate;
			if (!flashReversing)
			{
				flashFrame++;
			}
			else
			{
				flashFrame--;
			}
			if (flashFrame > 9)
			{
				flashFrame = 8;
				flashReversing = true;
			}
			else if (flashFrame < 0)
			{
				flashFrame = 1;
				flashReversing = false;
			}
			((Shrapnel)this).sprite.SetLowerLeftPixel((float)(flashFrame * 16), 16f);
		}
		((BroforceObject)this).X = rigidbody.position.x;
		((BroforceObject)this).Y = rigidbody.position.y;
		return result;
	}

	public override void Death()
	{
		((Grenade)this).MakeEffects();
		((Grenade)this).DestroyGrenade();
	}

	protected override void RunWarnings()
	{
	}

	public static int ExplodeUnits(MonoBehaviour damageSender, int damage, DamageType damageType, float range, float killRange, float x, float y, float force, float yI, int playerNum, bool forceTumble, bool knockSelf, bool knockFriendlies = true)
	{
		//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02db: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0302: Unknown result type (might be due to invalid IL or missing references)
		//IL_0307: Unknown result type (might be due to invalid IL or missing references)
		//IL_0318: Unknown result type (might be due to invalid IL or missing references)
		//IL_031d: Unknown result type (might be due to invalid IL or missing references)
		//IL_032e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0333: Unknown result type (might be due to invalid IL or missing references)
		//IL_0344: Unknown result type (might be due to invalid IL or missing references)
		//IL_0349: Unknown result type (might be due to invalid IL or missing references)
		//IL_035a: Unknown result type (might be due to invalid IL or missing references)
		//IL_035f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_022d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0265: Unknown result type (might be due to invalid IL or missing references)
		int num = 0;
		if (Worm.worms != null)
		{
			for (int i = 0; i < Worm.worms.Count; i++)
			{
				Worm val = Worm.worms[i];
				if ((Object)(object)val != (Object)null)
				{
					int num2 = (int)Mathf.Abs(x - ((BroforceObject)val).X);
					int num3 = (int)Mathf.Abs(y - ((BroforceObject)val).Y);
					if ((float)num2 < range && (float)num3 < range)
					{
						((Shrapnel)val).Death();
					}
				}
			}
		}
		if (Map.units == null)
		{
			return 0;
		}
		for (int num4 = Map.units.Count - 1; num4 >= 0; num4--)
		{
			if (num4 < Map.units.Count)
			{
				Unit val2 = Map.units[num4];
				if ((Object)(object)val2 != (Object)null && !val2.invulnerable)
				{
					float num5 = ((BroforceObject)val2).X - x;
					if (Mathf.Abs(num5) < range)
					{
						float num6 = ((BroforceObject)val2).Y + val2.height / 2f - y;
						if (Mathf.Abs(num6) < range)
						{
							float num7 = num5 * num5 + num6 * num6;
							if (num7 < killRange * killRange)
							{
								num7 = Mathf.Sqrt(num7);
								if (((NetworkedUnit)val2).playerNum < 0 || GameModeController.DoesPlayerNumDamage(playerNum, ((NetworkedUnit)val2).playerNum))
								{
									if (Mathf.Abs(num5) < range * 0.4f)
									{
										num5 *= 0.66f;
										yI *= 1.5f;
									}
									bool num8 = ((BroforceObject)val2).health > 0;
									Map.KnockAndDamageUnit(damageSender, val2, damage, damageType, num5 / num7 * force, num6 / num7 * force + yI, (int)Mathf.Sign(num5), false, x, y, false);
									if ((num8 && (Object)(object)val2 == (Object)null) || ((BroforceObject)val2).health <= 0)
									{
										num++;
									}
								}
								else if (((Object)(object)damageSender != (Object)(object)val2 || knockSelf) && knockFriendlies)
								{
									val2.Knock((DamageType)18, num5 / num7 * force * 2f, (num6 / num7 * force + yI) * 0.5f, forceTumble);
								}
							}
							else if (num7 < range * range)
							{
								num7 = Mathf.Sqrt(num7);
								if (num7 < 65f)
								{
									num7 = 65f;
								}
								if ((Object)(object)damageSender != (Object)(object)val2 || GameModeController.DoesPlayerNumDamage(playerNum, ((NetworkedUnit)val2).playerNum))
								{
									val2.Knock(damageType, num5 / num7 * force, num6 / num7 * force + yI, true);
									bool num9 = ((BroforceObject)val2).health > 0;
									if (GameModeController.DoesPlayerNumDamage(playerNum, ((NetworkedUnit)val2).playerNum))
									{
										Map.KnockAndDamageUnit(damageSender, val2, 0, damageType, num5 / num7 * force, num6 / num7 * force + yI, 0, forceTumble, x, y, false);
									}
									if ((num9 && (Object)(object)val2 == (Object)null) || ((BroforceObject)val2).health <= 0)
									{
										num++;
									}
								}
							}
						}
					}
				}
			}
		}
		_ = new Vector2[8]
		{
			new Vector2(1f, 0f),
			new Vector2(0f, 1f),
			new Vector2(-1f, 0f),
			new Vector2(0f, -1f),
			new Vector2(1f, 1f),
			new Vector2(-1f, 1f),
			new Vector2(1f, -1f),
			new Vector2(-1f, -1f)
		};
		return num;
	}

	protected override void MakeEffects()
	{
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)((Grenade)this).sound == (Object)null)
		{
			((Grenade)this).sound = Sound.GetInstance();
		}
		if ((Object)(object)((Grenade)this).sound != (Object)null)
		{
			((Grenade)this).sound.PlaySoundEffectAt(explosionSound, 0.4f, ((Component)this).transform.position, 1f, true, false, false, 0f);
		}
		EffectsController.CreateNuclearExplosion(((BroforceObject)this).X, ((BroforceObject)this).Y - 6f, 0f);
		MapController.DamageGround((MonoBehaviour)(object)this, 100, (DamageType)2, 128f, ((BroforceObject)this).X, ((BroforceObject)this).Y, (Collider[])null, false);
		ExplodeUnits((MonoBehaviour)(object)this, 40, (DamageType)2, 144f, 96f, ((BroforceObject)this).X, ((BroforceObject)this).Y - 10f, 360f, 400f, ((Grenade)this).playerNum, forceTumble: true, knockSelf: true);
		ExplodeUnits((MonoBehaviour)(object)this, 60, (DamageType)4, 96f, 96f, ((BroforceObject)this).X, ((BroforceObject)this).Y - 10f, 360f, 400f, ((Grenade)this).playerNum, forceTumble: true, knockSelf: true);
		MapController.BurnUnitsAround_NotNetworked((MonoBehaviour)(object)this, -15, 5, 160f, ((BroforceObject)this).X, ((BroforceObject)this).Y, true, true);
		Map.HitProjectiles(((Grenade)this).playerNum, 15, (DamageType)2, 80f, ((BroforceObject)this).X, ((BroforceObject)this).Y, 0f, 0f, 0.25f);
		Map.ShakeTrees(((BroforceObject)this).X, ((BroforceObject)this).Y, 320f, 64f, 160f);
	}
}
internal class HarmonyPatches
{
	[HarmonyPatch(typeof(ZipLine), "ShouldUnitAttach")]
	private static class ZipLine_ShouldUnitAttach_Patch
	{
		public static bool Prefix(ref Unit unit, ref bool __result)
		{
			if (unit is RJBrocready && (unit as RJBrocready).currentState > RJBrocready.ThingState.HumanForm)
			{
				__result = false;
				return false;
			}
			return true;
		}
	}

	[HarmonyPatch(typeof(SaveSlotsMenu), "SelectSlot")]
	private static class SaveSlotsMenu_SelectSlot_Patch
	{
		public static void Prefix(SaveSlotsMenu __instance, ref int slot)
		{
			if (!SaveSlotsMenu.createNewGame)
			{
				return;
			}
			try
			{
				CustomHero.LoadSettings<RJBrocready>();
				if (RJBrocready.previouslyDiedInIronBro.Count() != 5)
				{
					RJBrocready.previouslyDiedInIronBro = new List<bool> { false, false, false, false, false };
				}
				RJBrocready.previouslyDiedInIronBro[slot] = false;
				CustomHero.SaveSettings<RJBrocready>();
			}
			catch (Exception ex)
			{
				BMLogger.ExceptionLog((object)ex, true);
			}
		}
	}
}
[HeroPreset(/*Could not decode attribute arguments.*/)]
public class RJBrocready : CustomHero
{
	public enum ThingState
	{
		Human,
		FakeDeath,
		HumanForm,
		EnteringMonsterForm,
		MonsterForm,
		Reforming
	}

	public enum TentacleState
	{
		Inactive,
		Extending,
		Attached,
		Retracting,
		ReadyToEat
	}

	private Projectile[] projectiles;

	public AudioSource flameSource;

	public AudioClip flameStart;

	public AudioClip flameLoop;

	public AudioClip flameBurst;

	protected float fireFlashCounter;

	protected float burstCooldown;

	protected int burstCount;

	protected const float originalFirerate = 0.2f;

	private Dynamite dynamitePrefab;

	protected bool spawnedDynamite;

	protected bool throwingMook;

	public AudioClip[] fireAxeSound;

	public AudioClip[] axeHitSound;

	protected bool playedAxeSound;

	protected bool meleeBufferedPress;

	protected bool meleeHasHitTerrain;

	protected bool gibbed;

	protected bool canBecomeThing = true;

	protected bool theThing;

	public ThingState currentState;

	protected float fakeDeathTime;

	protected const float fakeDeathMaxTime = 1.25f;

	private Material thingMaterial;

	private Material thingGunMaterial;

	private Material thingSpecialIconMaterial;

	private Material thingArmlessMaterial;

	private Material thingAvatarMaterial;

	private Material thingMonsterFormMaterial;

	protected float MonsterFormCounter;

	protected const float MaxMonsterFormTime = 3f;

	protected const float MaxMonsterFormTimeReduced = 0.2f;

	protected float SpriteOffsetX;

	protected float SpriteOffsetY;

	protected bool wasAnticipatingWallClimb;

	protected bool currentlyAnticipatingWallClimb;

	public AudioClip[] thingTransformSounds;

	public AudioClip reformSound;

	protected float scareDelay;

	protected List<Unit> alreadyHitUnits;

	protected bool hasHitTerrain;

	protected bool releasedFire;

	protected bool firedOnce;

	protected float firePressed;

	protected bool playedHitSound;

	protected bool playedMissSound;

	public AudioClip[] whipStartSounds;

	public AudioClip whipStartSound;

	public AudioClip[] tentacleHitSounds;

	public AudioClip[] tentacleHitTerrainSounds;

	public AudioClip[] whipHitSounds;

	public AudioClip[] whipHitSounds2;

	public AudioClip[] whipMissSounds;

	public AudioClip[] biteSound;

	private SpriteSM tentacleWhipSprite;

	private LineRenderer tentacleLine;

	protected bool tentacleHitUnit;

	protected bool tentacleHitGround;

	protected Unit unitHit;

	protected RaycastHit groundHit;

	protected Vector3 tentacleHitPoint;

	protected Vector3 tentacleDirection;

	protected Vector3 tentacleOffset = new Vector3(0f, 13f, 0f);

	protected float tentacleMaterialScale = 0.25f;

	protected float tentacleMaterialOffset = -0.125f;

	protected TentacleState currentTentacleState;

	protected float tentacleExtendTime;

	protected float tentacleRange = 128f;

	protected LayerMask fragileGroundLayer;

	protected int tentacleDamage = 10;

	protected bool impaled;

	protected Transform tentacleImpaler;

	protected float tentacleRetractTimer;

	protected bool actuallyUsingSpecial;

	public AudioClip[] tentacleImpaleSounds;

	protected const float OriginalSpeed = 130f;

	protected const float MonsterFormSpeed = 100f;

	protected const float AttackingMonsterFormSpeed = 50f;

	protected bool acceptedDeath;

	protected bool wasInvulnerable;

	protected bool startAsTheThing;

	public static bool jsonLoaded = false;

	[SaveableSetting(null)]
	public static List<bool> previouslyDiedInIronBro = new List<bool> { false, false, false, false, false };

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

	public override void PreloadAssets()
	{
		CustomHero.PreloadSprites(((CustomHero)this).DirectoryPath, new List<string> { "tentacle.png", "tentacleLine.png", "thingSprite.png", "thingGunSprite.png", "thingSpecial.png", "armlessSprite.png", "thingAvatar.png", "thingMonsterSprite.png" });
		CustomHero.PreloadSprites(((CustomHero)this).ProjectilePath, new List<string> { "Dynamite.png" });
		CustomHero.PreloadSounds(((CustomHero)this).SoundPath, new List<string> { "dynamiteExplosion.wav", "flameStart.wav", "flameLoop.wav", "fireAxe1.wav", "fireAxe2.wav", "fireAxe3.wav", "axeHit1.wav", "axeHit2.wav", "axeHit3.wav" });
		CustomHero.PreloadSounds(Path.Combine(((CustomHero)this).SoundPath, "ThingSounds"), new List<string>
		{
			"transform1.wav", "transform2.wav", "transform3.wav", "transformBack.wav", "whipStart1.wav", "whipStart2.wav", "whipStart3.wav", "KnifeStab2.wav", "tentacleHit1.wav", "tentacleHit2.wav",
			"tentacleHit3.wav", "tentacleHitTerrain1.wav", "tentacleHitTerrain2.wav", "whipHit11.wav", "whipHit12.wav", "whipHit13.wav", "whipHit21.wav", "whipHit22.wav", "whipHit23.wav", "whipMiss1.wav",
			"whipMiss2.wav", "whipMiss3.wav", "bite.wav", "bite2.wav", "bite3.wav", "tentacleImpale1.wav", "tentacleImpale2.wav", "tentacleImpale3.wav"
		});
	}

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

	public override void RegisterCustomTriggers()
	{
		((CustomHero)this).RegisterCustomTriggers();
		CustomTriggerManager.RegisterCustomTrigger(typeof(RJBrocreadyAction), typeof(RJBrocreadyActionInfo), "R.J. Brocready - Disable The Thing", "Custom Bros", 0);
	}

	protected override void Start()
	{
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0192: 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_01ff: 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_0215: Unknown result type (might be due to invalid IL or missing references)
		//IL_021a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0221: Unknown result type (might be due to invalid IL or missing references)
		//IL_0228: Unknown result type (might be due to invalid IL or missing references)
		((CustomHero)this).Start();
		TestVanDammeAnim heroPrefab = HeroController.GetHeroPrefab((HeroType)2);
		BaBroracus val = (BaBroracus)(object)((heroPrefab is BaBroracus) ? heroPrefab : null);
		projectiles = (Projectile[])(object)new Projectile[3]
		{
			((Unit)val).projectile,
			val.projectile2,
			val.projectile3
		};
		flameBurst = val.flameSoundEnd;
		dynamitePrefab = CustomGrenade.CreatePrefab<Dynamite>();
		tentacleWhipSprite = new GameObject("TentacleWhip", new Type[3]
		{
			typeof(MeshRenderer),
			typeof(MeshFilter),
			typeof(SpriteSM)
		}).GetComponent<SpriteSM>();
		MeshRenderer component = ((Component)tentacleWhipSprite).GetComponent<MeshRenderer>();
		((Renderer)component).material = ResourcesController.GetMaterial(((CustomHero)this).DirectoryPath, "tentacle.png");
		((Renderer)component).material.mainTexture.wrapMode = (TextureWrapMode)1;
		((Component)tentacleWhipSprite).transform.parent = ((Component)this).transform;
		tentacleWhipSprite.lowerLeftPixel = new Vector2(0f, 16f);
		tentacleWhipSprite.pixelDimensions = new Vector2(128f, 16f);
		((SpriteBase)tentacleWhipSprite).plane = (SPRITE_PLANE)0;
		((SpriteBase)tentacleWhipSprite).width = 128f;
		((SpriteBase)tentacleWhipSprite).height = 8f;
		((Component)tentacleWhipSprite).transform.localPosition = new Vector3(65f, 12f, -2f);
		tentacleWhipSprite.SetTextureDefaults();
		((Component)tentacleWhipSprite).gameObject.SetActive(false);
		tentacleLine = new GameObject("TentacleLine", new Type[1] { typeof(LineRenderer) }).GetComponent<LineRenderer>();
		((Component)tentacleLine).transform.parent = ((Component)this).transform;
		((Renderer)tentacleLine).material = ResourcesController.GetMaterial(((CustomHero)this).DirectoryPath, "tentacleLine.png");
		((Renderer)tentacleLine).material.mainTexture.wrapMode = (TextureWrapMode)0;
		tentacleImpaler = new GameObject("TentacleImpaler").transform;
		fragileGroundLayer = LayerMask.op_Implicit(LayerMask.op_Implicit(((TestVanDammeAnim)this).fragileLayer) | LayerMask.op_Implicit(((TestVanDammeAnim)this).groundLayer));
		((BroBase)this).currentMeleeType = (MeleeType)2;
		((BroBase)this).meleeType = (MeleeType)2;
		thingMaterial = ResourcesController.GetMaterial(((CustomHero)this).DirectoryPath, "thingSprite.png");
		thingGunMaterial = ResourcesController.GetMaterial(((CustomHero)this).DirectoryPath, "thingGunSprite.png");
		thingSpecialIconMaterial = ResourcesController.GetMaterial(((CustomHero)this).DirectoryPath, "thingSpecial.png");
		thingArmlessMaterial = ResourcesController.GetMaterial(((CustomHero)this).DirectoryPath, "armlessSprite.png");
		thingAvatarMaterial = ResourcesController.GetMaterial(((CustomHero)this).DirectoryPath, "thingAvatar.png");
		thingMonsterFormMaterial = ResourcesController.GetMaterial(((CustomHero)this).DirectoryPath, "thingMonsterSprite.png");
		flameSource = ((Component)this).gameObject.AddComponent<AudioSource>();
		flameSource.rolloffMode = (AudioRolloffMode)1;
		flameSource.maxDistance = 500f;
		flameSource.spatialBlend = 1f;
		flameSource.volume = 0.4f;
		flameSource.playOnAwake = false;
		flameSource.Stop();
		if (GameModeController.IsHardcoreMode && permanentlyBecomeThingInIronBro)
		{
			startAsTheThing = previouslyDiedInIronBro[PlayerProgress.currentWorldMapSaveSlot];
		}
		if (startAsTheThing)
		{
			theThing = true;
			BecomeTheThing();
		}
	}

	public override void AfterPrefabSetup()
	{
		string text = Path.Combine(((CustomHero)this).SoundPath, "ThingSounds");
		flameStart = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "flameStart.wav");
		flameLoop = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "flameLoop.wav");
		fireAxeSound = (AudioClip[])(object)new AudioClip[3];
		fireAxeSound[0] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "fireAxe1.wav");
		fireAxeSound[1] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "fireAxe2.wav");
		fireAxeSound[2] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "fireAxe3.wav");
		axeHitSound = (AudioClip[])(object)new AudioClip[3];
		axeHitSound[0] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "axeHit1.wav");
		axeHitSound[1] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "axeHit2.wav");
		axeHitSound[2] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "axeHit3.wav");
		thingTransformSounds = (AudioClip[])(object)new AudioClip[3];
		thingTransformSounds[0] = ResourcesController.GetAudioClip(text, "transform1.wav");
		thingTransformSounds[1] = ResourcesController.GetAudioClip(text, "transform2.wav");
		thingTransformSounds[2] = ResourcesController.GetAudioClip(text, "transform3.wav");
		reformSound = ResourcesController.GetAudioClip(text, "transformBack.wav");
		whipStartSounds = (AudioClip[])(object)new AudioClip[3];
		whipStartSounds[0] = ResourcesController.GetAudioClip(text, "whipStart1.wav");
		whipStartSounds[1] = ResourcesController.GetAudioClip(text, "whipStart2.wav");
		whipStartSounds[2] = ResourcesController.GetAudioClip(text, "whipStart3.wav");
		whipStartSound = ResourcesController.GetAudioClip(text, "KnifeStab2.wav");
		tentacleHitSounds = (AudioClip[])(object)new AudioClip[3];
		tentacleHitSounds[0] = ResourcesController.GetAudioClip(text, "tentacleHit1.wav");
		tentacleHitSounds[1] = ResourcesController.GetAudioClip(text, "tentacleHit2.wav");
		tentacleHitSounds[2] = ResourcesController.GetAudioClip(text, "tentacleHit3.wav");
		tentacleHitTerrainSounds = (AudioClip[])(object)new AudioClip[2];
		tentacleHitTerrainSounds[0] = ResourcesController.GetAudioClip(text, "tentacleHitTerrain1.wav");
		tentacleHitTerrainSounds[1] = ResourcesController.GetAudioClip(text, "tentacleHitTerrain2.wav");
		whipHitSounds = (AudioClip[])(object)new AudioClip[3];
		whipHitSounds[0] = ResourcesController.GetAudioClip(text, "whipHit11.wav");
		whipHitSounds[1] = ResourcesController.GetAudioClip(text, "whipHit12.wav");
		whipHitSounds[2] = ResourcesController.GetAudioClip(text, "whipHit13.wav");
		whipHitSounds2 = (AudioClip[])(object)new AudioClip[3];
		whipHitSounds2[0] = ResourcesController.GetAudioClip(text, "whipHit21.wav");
		whipHitSounds2[1] = ResourcesController.GetAudioClip(text, "whipHit22.wav");
		whipHitSounds2[2] = ResourcesController.GetAudioClip(text, "whipHit23.wav");
		whipMissSounds = (AudioClip[])(object)new AudioClip[3];
		whipMissSounds[0] = ResourcesController.GetAudioClip(text, "whipMiss1.wav");
		whipMissSounds[1] = ResourcesController.GetAudioClip(text, "whipMiss2.wav");
		whipMissSounds[2] = ResourcesController.GetAudioClip(text, "whipMiss3.wav");
		biteSound = (AudioClip[])(object)new AudioClip[3];
		biteSound[0] = ResourcesController.GetAudioClip(text, "bite.wav");
		biteSound[1] = ResourcesController.GetAudioClip(text, "bite2.wav");
		biteSound[2] = ResourcesController.GetAudioClip(text, "bite3.wav");
		tentacleImpaleSounds = (AudioClip[])(object)new AudioClip[3];
		tentacleImpaleSounds[0] = ResourcesController.GetAudioClip(text, "tentacleImpale1.wav");
		tentacleImpaleSounds[1] = ResourcesController.GetAudioClip(text, "tentacleImpale2.wav");
		tentacleImpaleSounds[2] = ResourcesController.GetAudioClip(text, "tentacleImpale3.wav");
	}

	public override int GetVariant()
	{
		return 0;
	}

	protected override void Update()
	{
		//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_033b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0341: Invalid comparison between Unknown and I4
		//IL_0264: Unknown result type (might be due to invalid IL or missing references)
		//IL_0269: Unknown result type (might be due to invalid IL or missing references)
		//IL_030b: Unknown result type (might be due to invalid IL or missing references)
		if (((Unit)this).invulnerable)
		{
			wasInvulnerable = true;
		}
		if (currentState != ThingState.FakeDeath)
		{
			((BroBase)this).Update();
		}
		else
		{
			((TestVanDammeAnim)this).SetDeltaTime();
			((TestVanDammeAnim)this).RunMovement();
			((TestVanDammeAnim)this).counter = ((TestVanDammeAnim)this).counter + ((Unit)this).t;
			if (((TestVanDammeAnim)this).counter > ((TestVanDammeAnim)this).frameRate)
			{
				((TestVanDammeAnim)this).counter = ((TestVanDammeAnim)this).counter - ((TestVanDammeAnim)this).frameRate;
				((TestVanDammeAnim)this).IncreaseFrame();
				AnimateFakeDeath();
			}
			if (fakeDeathTime < 1.25f)
			{
				fakeDeathTime += ((Unit)this).t;
				if (fakeDeathTime >= 1.25f)
				{
					((Unit)this).frame = 0;
				}
			}
			else
			{
				scareDelay -= ((Unit)this).t;
				if (scareDelay <= 0f && ((Unit)this).frame > 4)
				{
					scareDelay = 0.0667f;
					Map.PanicUnits(((BroforceObject)this).X, ((BroforceObject)this).Y, 100f, 6f, 2f, true, false);
				}
			}
			((TestVanDammeAnim)this).CheckFacingDirection();
		}
		if (acceptedDeath)
		{
			if (((BroforceObject)this).health <= 0 && !((TestVanDammeAnim)this).WillReviveAlready)
			{
				return;
			}
			acceptedDeath = false;
		}
		if (((TestVanDammeAnim)this).isOnHelicopter)
		{
			((Behaviour)flameSource).enabled = false;
			((Renderer)tentacleLine).enabled = false;
			((Component)tentacleWhipSprite).gameObject.SetActive(false);
			if ((Object)(object)unitHit != (Object)null)
			{
				unitHit.Unimpale(3, (DamageType)21, 0f, 0f, (MonoBehaviour)(object)this);
				if (unitHit is Mook)
				{
					unitHit.useImpaledFrames = false;
				}
			}
		}
		if (wasInvulnerable && !((Unit)this).invulnerable)
		{
			((Component)this).GetComponent<Renderer>().material.SetColor("_TintColor", Color.gray);
			((TestVanDammeAnim)this).gunSprite.meshRender.material.SetColor("_TintColor", Color.gray);
		}
		if (MonsterFormCounter > 0f)
		{
			if (((TestVanDammeAnim)this).down && ((TestVanDammeAnim)this).ducking)
			{
				MonsterFormCounter = Mathf.Min(MonsterFormCounter, 0.2f);
			}
			MonsterFormCounter -= ((Unit)this).t;
			if (MonsterFormCounter <= 0f)
			{
				currentState = ThingState.Reforming;
				((TestVanDammeAnim)this).gunFrame = 0;
				((Component)this).GetComponent<Renderer>().material = thingArmlessMaterial;
				((TestVanDammeAnim)this).sprite.pixelDimensions = new Vector2(32f, 32f);
				((SpriteBase)((TestVanDammeAnim)this).sprite).SetSize(32f, 32f);
				((SpriteBase)((TestVanDammeAnim)this).sprite).RecalcTexture();
				((TestVanDammeAnim)this).spritePixelHeight = 32;
				((TestVanDammeAnim)this).spritePixelWidth = 32;
				SpriteOffsetX = 0f;
				SpriteOffsetY = 0f;
				((TestVanDammeAnim)this).sprite.SetLowerLeftPixel(0f, 32f);
				((TestVanDammeAnim)this).ActivateGun();
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)(((TestVanDammeAnim)this).gunFrame + 12) * 64f, 64f);
				((TestVanDammeAnim)this).ChangeFrame();
				Sound.GetInstance().PlaySoundEffectAt(reformSound, 1f, ((Component)this).transform.position, 1f, true, false, false, 0f);
			}
		}
		if (((TestVanDammeAnim)this).usingSpecial && currentTentacleState > TentacleState.Inactive)
		{
			UpdateTentacle();
		}
		if ((int)((Unit)this).actionState == 5 && !acceptedDeath && !((TestVanDammeAnim)this).WillReviveAlready)
		{
			acceptedDeath = true;
		}
	}

	public override void UIOptions()
	{
		permanentlyBecomeThingInIronBro = GUILayout.Toggle(permanentlyBecomeThingInIronBro, "Carry over death between levels in IronBro", (GUILayoutOption[])(object)new GUILayoutOption[0]);
	}

	protected override void StartFiring()
	{
		if (!theThing)
		{
			((TestVanDammeAnim)this).StartFiring();
			flameSource.loop = false;
			flameSource.clip = flameStart;
			flameSource.Play();
			fireFlashCounter = 0f;
			burstCooldown = Random.Range(1f, 2f);
			burstCount = 0;
			((TestVanDammeAnim)this).fireRate = 0.2f;
		}
		else
		{
			ThingStartFiring();
		}
	}

	protected override void StopFiring()
	{
		if (!theThing)
		{
			((TestVanDammeAnim)this).StopFiring();
			flameSource.Stop();
		}
		else
		{
			ThingStopFiring();
		}
	}

	protected override void RunFiring()
	{
		//IL_00d3: 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_024a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02df: Unknown result type (might be due to invalid IL or missing references)
		if (((BroforceObject)this).health <= 0)
		{
			return;
		}
		if (!theThing)
		{
			((TestVanDammeAnim)this).fireDelay = ((TestVanDammeAnim)this).fireDelay - ((Unit)this).t;
			if (((TestVanDammeAnim)this).fire)
			{
				((TestVanDammeAnim)this).StopRolling();
			}
			if (((TestVanDammeAnim)this).fire && ((TestVanDammeAnim)this).fireDelay <= 0f)
			{
				((TestVanDammeAnim)this).fireCounter = ((TestVanDammeAnim)this).fireCounter + ((Unit)this).t;
				fireFlashCounter += ((Unit)this).t;
				if (((TestVanDammeAnim)this).fireCounter >= ((TestVanDammeAnim)this).fireRate)
				{
					((TestVanDammeAnim)this).fireCounter = ((TestVanDammeAnim)this).fireCounter - ((TestVanDammeAnim)this).fireRate;
					((TestVanDammeAnim)this).UseFire();
					((TestVanDammeAnim)this).SetGestureAnimation((Gestures)0);
				}
				if (fireFlashCounter >= 0.1f)
				{
					fireFlashCounter -= 0.1f;
					EffectsController.CreateMuzzleFlashEffect(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 11f, ((BroforceObject)this).Y + 10f, -25f, (((Component)this).transform.localScale.x * 60f + ((BroforceObject)this).xI) * 0.01f, (Random.value * 60f - 30f) * 0.01f, ((Component)this).transform);
					((TestVanDammeAnim)this).FireFlashAvatar();
				}
			}
			((TestVanDammeAnim)this).fireDelay = ((TestVanDammeAnim)this).fireDelay - ((Unit)this).t;
			if (!((TestVanDammeAnim)this).fire)
			{
				return;
			}
			if (!flameSource.loop && flameSource.clip.length - flameSource.time <= 0.02f)
			{
				flameSource.clip = flameLoop;
				flameSource.loop = true;
				flameSource.Play();
			}
			if (!(((TestVanDammeAnim)this).fireDelay <= 0f))
			{
				return;
			}
			((TestVanDammeAnim)this).fireCounter = ((TestVanDammeAnim)this).fireCounter + ((Unit)this).t;
			fireFlashCounter += ((Unit)this).t;
			if (burstCooldown > 0f)
			{
				burstCooldown -= ((Unit)this).t;
				if (burstCooldown < 0f)
				{
					((TestVanDammeAnim)this).fireRate = 0.1f;
					burstCount = Random.Range(12, 20);
					((TestVanDammeAnim)this).sound.PlaySoundEffectAt(flameBurst, 0.5f, ((Component)this).transform.position, 1f, true, false, false, 0f);
				}
			}
			if (((TestVanDammeAnim)this).fireCounter >= ((TestVanDammeAnim)this).fireRate)
			{
				((TestVanDammeAnim)this).fireCounter = ((TestVanDammeAnim)this).fireCounter - ((TestVanDammeAnim)this).fireRate;
				((TestVanDammeAnim)this).UseFire();
			}
			if (fireFlashCounter >= 0.1f)
			{
				fireFlashCounter -= 0.1f;
				EffectsController.CreateMuzzleFlashEffect(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 11f, ((BroforceObject)this).Y + 10f, -25f, (((Component)this).transform.localScale.x * 60f + ((BroforceObject)this).xI) * 0.01f, (Random.value * 60f - 30f) * 0.01f, ((Component)this).transform);
				((TestVanDammeAnim)this).FireFlashAvatar();
			}
		}
		else
		{
			ThingRunFiring();
		}
	}

	protected override void UseFire()
	{
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_017e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a1: 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_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		if (!theThing)
		{
			if (burstCooldown <= 0f)
			{
				((TestVanDammeAnim)this).FireWeapon(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 11f, ((BroforceObject)this).Y + 10f, ((Component)this).transform.localScale.x * 180f + ((BroforceObject)this).xI, Random.value * 30f - 15f);
				((TestVanDammeAnim)this).FireWeapon(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 11f, ((BroforceObject)this).Y + 11f, ((Component)this).transform.localScale.x * 210f + ((BroforceObject)this).xI, Random.value * 40f - 20f);
				burstCount--;
				if (burstCount <= 0)
				{
					((TestVanDammeAnim)this).fireRate = 0.2f;
					burstCooldown = Random.Range(0.5f, 2f);
				}
			}
			else
			{
				((TestVanDammeAnim)this).FireWeapon(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 11f, ((BroforceObject)this).Y + 10f, ((Component)this).transform.localScale.x * 30f + ((BroforceObject)this).xI, Random.value * 20f - 15f);
				((TestVanDammeAnim)this).FireWeapon(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 11f, ((BroforceObject)this).Y + 11f, ((Component)this).transform.localScale.x * 40f + ((BroforceObject)this).xI, Random.value * 30f - 20f);
			}
			Map.DisturbWildLife(((BroforceObject)this).X, ((BroforceObject)this).Y, 60f, ((NetworkedUnit)this).playerNum);
		}
		else
		{
			ThingUseFire();
		}
	}

	protected override void FireWeapon(float x, float y, float xSpeed, float ySpeed)
	{
		((TestVanDammeAnim)this).gunFrame = 3;
		((TestVanDammeAnim)this).SetGunSprite(((TestVanDammeAnim)this).gunFrame, 0);
		ProjectileController.SpawnProjectileLocally(projectiles[Random.Range(0, 3)], (MonoBehaviour)(object)this, x, y, xSpeed, ySpeed, ((NetworkedUnit)this).playerNum);
	}

	protected override void RunGun()
	{
		if (!theThing)
		{
			if (((TestVanDammeAnim)this).fire)
			{
				((TestVanDammeAnim)this).gunFrame = 3;
				((TestVanDammeAnim)this).SetGunSprite(((TestVanDammeAnim)this).gunFrame, 0);
			}
			else if (((TestVanDammeAnim)this).gunFrame > 0)
			{
				((TestVanDammeAnim)this).gunCounter = ((TestVanDammeAnim)this).gunCounter + ((Unit)this).t;
				if (((TestVanDammeAnim)this).gunCounter > 0.05f)
				{
					((TestVanDammeAnim)this).gunCounter = ((TestVanDammeAnim)this).gunCounter - 0.05f;
					((TestVanDammeAnim)this).gunFrame = ((TestVanDammeAnim)this).gunFrame - 1;
					((TestVanDammeAnim)this).SetGunSprite(((TestVanDammeAnim)this).gunFrame, 0);
				}
			}
		}
		else
		{
			ThingRunGun();
		}
	}

	protected override void SetGunSprite(int spriteFrame, int spriteRow)
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Invalid comparison between Unknown and I4
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Invalid comparison between Unknown and I4
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Invalid comparison between Unknown and I4
		if (!theThing)
		{
			((TestVanDammeAnim)this).SetGunSprite(spriteFrame, spriteRow);
		}
		else if (currentState == ThingState.HumanForm)
		{
			if ((int)((Unit)this).actionState == 11)
			{
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel(64f, 128f);
			}
			else if ((int)((Unit)this).actionState == 6 && ((TestVanDammeAnim)this).hangingOneArmed)
			{
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel(64f, 128f);
			}
			else if ((Object)(object)((Unit)this).attachedToZipline != (Object)null && (int)((Unit)this).actionState == 3)
			{
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel(64f, 128f);
			}
			else
			{
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel(64f * (float)spriteFrame, 128f);
			}
		}
	}

	protected override void PressSpecial()
	{
		if (!theThing)
		{
			spawnedDynamite = false;
			((TestVanDammeAnim)this).PressSpecial();
		}
		else
		{
			ThingPressSpecial();
		}
	}

	protected override void UseSpecial()
	{
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		if (((TestVanDammeAnim)this).SpecialAmmo > 0)
		{
			if (!theThing)
			{
				if (!spawnedDynamite)
				{
					if (((TestVanDammeAnim)this).down && ((Unit)this).IsOnGround() && ((TestVanDammeAnim)this).ducking)
					{
						((CustomGrenade)dynamitePrefab).SpawnGrenadeLocally((MonoBehaviour)(object)this, ((BroforceObject)this).X + Mathf.Sign(((Component)this).transform.localScale.x) * 6f, ((BroforceObject)this).Y + 10f, 0.001f, 0.011f, Mathf.Sign(((Component)this).transform.localScale.x) * 30f, 70f, ((NetworkedUnit)this).playerNum, 0);
					}
					else
					{
						((CustomGrenade)dynamitePrefab).SpawnGrenadeLocally((MonoBehaviour)(object)this, ((BroforceObject)this).X + Mathf.Sign(((Component)this).transform.localScale.x) * 6f, ((BroforceObject)this).Y + 10f, 0.001f, 0.011f, Mathf.Sign(((Component)this).transform.localScale.x) * 300f, 250f, ((NetworkedUnit)this).playerNum, 0);
					}
					int specialAmmo = ((TestVanDammeAnim)this).SpecialAmmo - 1;
					((TestVanDammeAnim)this).SpecialAmmo = specialAmmo;
					spawnedDynamite = true;
				}
			}
			else
			{
				ThingUseSpecial();
			}
		}
		else
		{
			((TestVanDammeAnim)this).UseSpecial();
		}
	}

	protected override void AnimateSpecial()
	{
		if (!theThing)
		{
			((TestVanDammeAnim)this).AnimateSpecial();
		}
		else
		{
			ThingAnimateSpecial();
		}
	}

	public override void Knock(DamageType damageType, float xI, float yI, bool forceTumble)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Invalid comparison between Unknown and I4
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		if ((int)damageType == 18)
		{
			((TestVanDammeAnim)this).impaledBy = null;
			((TestVanDammeAnim)this).impaledByTransform = null;
			if (!(((TestVanDammeAnim)this).frozenTime > 0f))
			{
				((BroforceObject)this).xI = Mathf.Clamp(((BroforceObject)this).xI + xI / 2f, -1200f, 1200f);
				((TestVanDammeAnim)this).xIBlast = Mathf.Clamp(((TestVanDammeAnim)this).xIBlast + xI / 2f, -1200f, 1200f);
				((BroforceObject)this).yI = ((BroforceObject)this).yI + yI;
				if (((Unit)this).IsParachuteActive && yI > 0f)
				{
					((Unit)this).IsParachuteActive = false;
					((TestVanDammeAnim)this).Tumble();
				}
			}
		}
		else
		{
			((TestVanDammeAnim)this).Knock(damageType, xI, yI, forceTumble);
		}
	}

	protected void MeleeAttack(bool shouldTryHitTerrain, bool playMissSound)
	{
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: 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_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
		bool flag = default(bool);
		Map.DamageDoodads(3, (DamageType)1, ((BroforceObject)this).X + (float)(((NetworkedUnit)this).Direction * 4), ((BroforceObject)this).Y, 0f, 0f, 8f, ((NetworkedUnit)this).playerNum, ref flag, (MonoBehaviour)null);
		((BroBase)this).KickDoors(24f);
		Unit val;
		if (Object.op_Implicit((Object)(object)(val = Map.HitClosestUnit((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, 2, (DamageType)21, 12f, 24f, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 8f, ((BroforceObject)this).Y + 8f, ((Component)this).transform.localScale.x * 100f, 100f, true, true, ((NetworkObject)this).IsMine, false, true))))
		{
			if (((BroforceObject)val).health > 30)
			{
				val.Damage(7, (DamageType)1, ((Component)this).transform.localScale.x * 100f, 100f, (int)((Component)this).transform.localScale.x, (MonoBehaviour)(object)this, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 8f, ((BroforceObject)this).Y + 8f);
			}
			else
			{
				val.Damage(5, (DamageType)1, ((Component)this).transform.localScale.x * 100f, 100f, (int)((Component)this).transform.localScale.x, (MonoBehaviour)(object)this, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 8f, ((BroforceObject)this).Y + 8f);
			}
			if (!((TestVanDammeAnim)this).meleeHasHit)
			{
				if (((Component)val).gameObject.CompareTag("Metal"))
				{
					((TestVanDammeAnim)this).sound.PlaySoundEffectAt(((TestVanDammeAnim)this).soundHolder.meleeHitTerrainSound, 0.5f, ((Component)this).transform.position, 1f, true, false, false, 0f);
				}
				else
				{
					((TestVanDammeAnim)this).sound.PlaySoundEffectAt(axeHitSound, 0.8f, ((Component)this).transform.position, 1f, true, false, false, 0f);
				}
			}
			((TestVanDammeAnim)this).meleeHasHit = true;
		}
		((TestVanDammeAnim)this).meleeChosenUnit = null;
		if (shouldTryHitTerrain && ((BroBase)this).TryMeleeTerrain(0, 20))
		{
			((TestVanDammeAnim)this).meleeHasHit = true;
		}
		((TestVanDammeAnim)this).TriggerBroMeleeEvent();
	}

	protected override bool TryMeleeTerrain(int offset = 0, int meleeDamage = 2)
	{
		//IL_000c: 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_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: 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_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0210: Unknown result type (might be due to invalid IL or missing references)
		//IL_023a: Unknown result type (might be due to invalid IL or missing references)
		if (!Physics.Raycast(new Vector3(((BroforceObject)this).X - ((Component)this).transform.localScale.x * 4f, ((BroforceObject)this).Y + 4f, 0f), new Vector3(((Component)this).transform.localScale.x, 0f, 0f), ref ((TestVanDammeAnim)this).raycastHit, (float)(22 + offset), LayerMask.op_Implicit(((TestVanDammeAnim)this).groundLayer)) && !Physics.Raycast(new Vector3(((BroforceObject)this).X - ((Component)this).transform.localScale.x * 4f, ((BroforceObject)this).Y + 12f, 0f), new Vector3(((Component)this).transform.localScale.x, 0f, 0f), ref ((TestVanDammeAnim)this).raycastHit, (float)(22 + offset), LayerMask.op_Implicit(((TestVanDammeAnim)this).groundLayer)))
		{
			return false;
		}
		Cage component = ((Component)((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).collider).GetComponent<Cage>();
		if ((Object)(object)component == (Object)null && (Object)(object)((Component)((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).collider).transform.parent != (Object)null)
		{
			component = ((Component)((Component)((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).collider).transform.parent).GetComponent<Cage>();
		}
		if ((Object)(object)component != (Object)null)
		{
			MapController.Damage_Networked((MonoBehaviour)(object)this, ((Component)((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).collider).gameObject, ((BroforceObject)component).health, (DamageType)7, 0f, 40f, ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).point.x, ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).point.y);
			return true;
		}
		if ((Object)(object)((Component)((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).collider).GetComponent<Block>() != (Object)null)
		{
			meleeDamage *= 4;
		}
		else
		{
			meleeHasHitTerrain = true;
		}
		MapController.Damage_Networked((MonoBehaviour)(object)this, ((Component)((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).collider).gameObject, meleeDamage, (DamageType)7, 0f, 40f, ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).point.x, ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).point.y);
		if (!((TestVanDammeAnim)this).meleeHasHit)
		{
			((TestVanDammeAnim)this).sound.PlaySoundEffectAt(((TestVanDammeAnim)this).soundHolder.meleeHitTerrainSound, 0.3f, ((Component)this).transform.position, 1f, true, false, false, 0f);
			EffectsController.CreateProjectilePopWhiteEffect(((BroforceObject)this).X + ((Unit)this).width * ((Component)this).transform.localScale.x, ((BroforceObject)this).Y + ((Unit)this).height + 4f);
		}
		return true;
	}

	protected override void StartMelee()
	{
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		if (!((TestVanDammeAnim)this).doingMelee && theThing && (((TestVanDammeAnim)this).wallDrag || currentlyAnticipatingWallClimb))
		{
			((BroBase)this).meleeType = (MeleeType)0;
		}
		else if (((TestVanDammeAnim)this).doingMelee)
		{
			((BroBase)this).meleeType = ((BroBase)this).currentMeleeType;
		}
		((BroBase)this).StartMelee();
		((BroBase)this).meleeType = (MeleeType)2;
	}

	protected override void StartCustomMelee()
	{
		if (!((TestVanDammeAnim)this).IsInseminated() && !((TestVanDammeAnim)this).HasFaceHugger())
		{
			if (((BroBase)this).CanStartNewMelee())
			{
				((Unit)this).frame = 1;
				((TestVanDammeAnim)this).counter = -0.05f;
				((TestVanDammeAnim)this).AnimateMelee();
				throwingMook = (Object)(object)((TestVanDammeAnim)this).nearbyMook != (Object)null && ((Unit)((TestVanDammeAnim)this).nearbyMook).CanBeThrown();
				playedAxeSound = false;
				meleeBufferedPress = false;
			}
			else if (((BroBase)this).CanStartMeleeFollowUp())
			{
				meleeBufferedPress = true;
			}
			((BroBase)this).StartMeleeCommon();
		}
	}

	protected override void SetMeleeType()
	{
		((TestVanDammeAnim)this).SetMeleeType();
		if (((TestVanDammeAnim)this).jumpingMelee && (((TestVanDammeAnim)this).right || ((TestVanDammeAnim)this).left))
		{
			((TestVanDammeAnim)this).dashingMelee = true;
		}
	}

	protected override void StartMeleeCommon()
	{
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		if (!((TestVanDammeAnim)this).meleeFollowUp && ((BroBase)this).CanStartNewMelee())
		{
			if (theThing)
			{
				((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).SetMeleeType();
				((BroBase)this).meleeStartPos = ((Component)this).transform.position;
				ThingStartMelee();
				((TestVanDammeAnim)this).AnimateMelee();
			}
			else
			{
				((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;
				((TestVanDammeAnim)this).AnimateMelee();
			}
		}
	}

	protected override void ResetMeleeValues()
	{
		((BroBase)this).ResetMeleeValues();
		meleeHasHitTerrain = false;
	}

	protected override bool CanStartNewMelee()
	{
		if (!((TestVanDammeAnim)this).doingMelee)
		{
			return !((TestVanDammeAnim)this).usingSpecial;
		}
		return false;
	}

	protected override bool CanStartMeleeFollowUp()
	{
		return true;
	}

	protected override void AnimateCustomMelee()
	{
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		((TestVanDammeAnim)this).SetSpriteOffset(0f, 0f);
		((TestVanDammeAnim)this).rollingFrames = 0;
		if (((Unit)this).frame == 1)
		{
			((TestVanDammeAnim)this).counter = ((TestVanDammeAnim)this).counter - 0.0334f;
		}
		if (((Unit)this).frame == 6 && ((TestVanDammeAnim)this).meleeFollowUp)
		{
			((TestVanDammeAnim)this).counter = ((TestVanDammeAnim)this).counter - 0.08f;
			((Unit)this).frame = 1;
			((TestVanDammeAnim)this).meleeFollowUp = false;
			((BroBase)this).ResetMeleeValues();
		}
		((TestVanDammeAnim)this).frameRate = 0.025f;
		if (!theThing && ((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;
		}
		if (!theThing)
		{
			if (!throwingMook)
			{
				((TestVanDammeAnim)this).frameRate = 0.06f;
			}
			int num = 24 + Mathf.Clamp(((Unit)this).frame, 0, 7);
			int num2 = 10;
			((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)(num * ((TestVanDammeAnim)this).spritePixelWidth), (float)(num2 * ((TestVanDammeAnim)this).spritePixelHeight));
			if (!throwingMook && (((Unit)this).frame == 0 || ((Unit)this).frame == 1) && !playedAxeSound)
			{
				((TestVanDammeAnim)this).sound.PlaySoundEffectAt(fireAxeSound, 1f, ((Component)this).transform.position, 1f, true, false, false, 0f);
				playedAxeSound = true;
			}
			else if (((Unit)this).frame == 3)
			{
				((TestVanDammeAnim)this).counter = ((TestVanDammeAnim)this).counter - 0.066f;
				MeleeAttack(shouldTryHitTerrain: true, playMissSound: true);
			}
			else if (((Unit)this).frame > 3 && ((Unit)this).frame < 6)
			{
				if (!((TestVanDammeAnim)this).meleeHasHit)
				{
					MeleeAttack(shouldTryHitTerrain: false, playMissSound: false);
				}
				else if (!meleeHasHitTerrain)
				{
					((BroBase)this).TryMeleeTerrain(0, 15);
				}
			}
			if (((Unit)this).frame >= 8)
			{
				((Unit)this).frame = 0;
				((TestVanDammeAnim)this).CancelMelee();
				if (meleeBufferedPress)
				{
					meleeBufferedPress = false;
					((BroBase)this).StartCustomMelee();
				}
			}
		}
		else
		{
			ThingAnimateMelee();
		}
	}

	protected override void RunCustomMeleeMovement()
	{
		//IL_011f: 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_0097: Unknown result type (might be due to invalid IL or missing references)
		if (!theThing)
		{
			if (((TestVanDammeAnim)this).jumpingMelee)
			{
				((TestVanDammeAnim)this).ApplyFallingGravity();
				if (((BroforceObject)this).yI < ((TestVanDammeAnim)this).maxFallSpeed)
				{
					((BroforceObject)this).yI = ((TestVanDammeAnim)this).maxFallSpeed;
				}
			}
			else if (((TestVanDammeAnim)this).dashingMelee)
			{
				if (((Unit)this).frame <= 1)
				{
					((BroforceObject)this).xI = 0f;
					((BroforceObject)this).yI = 0f;
				}
				else if (((Unit)this).frame <= 3)
				{
					if ((Object)(object)((TestVanDammeAnim)this).meleeChosenUnit == (Object)null)
					{
						if (!((TestVanDammeAnim)this).isInQuicksand)
						{
							((BroforceObject)this).xI = ((TestVanDammeAnim)this).speed * 1f * ((Component)this).transform.localScale.x;
						}
						((BroforceObject)this).yI = 0f;
					}
					else if (!((TestVanDammeAnim)this).isInQuicksand)
					{
						((BroforceObject)this).xI = ((TestVanDammeAnim)this).speed * 0.5f * ((Component)this).transform.localScale.x + (((BroforceObject)((TestVanDammeAnim)this).meleeChosenUnit).X - ((BroforceObject)this).X) * 6f;
					}
				}
				else if (((Unit)this).frame <= 7)
				{
					if (!((TestVanDammeAnim)this).isInQuicksand)
					{
						((BroforceObject)this).xI = ((TestVanDammeAnim)this).speed * 0.3f * ((Component)this).transform.localScale.x;
					}
					((TestVanDammeAnim)this).ApplyFallingGravity();
				}
				else
				{
					((TestVanDammeAnim)this).ApplyFallingGravity();
				}
			}
			else if (((BroforceObject)this).Y > ((TestVanDammeAnim)this).groundHeight + 1f)
			{
				((TestVanDammeAnim)this).CancelMelee();
			}
		}
		else
		{
			ThingRunMeleeMovement();
		}
	}

	protected override void CancelMelee()
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		if (theThing && (int)((BroBase)this).currentMeleeType != 0)
		{
			ThingCancelMelee();
		}
		playedAxeSound = false;
		((BroBase)this).CancelMelee();
	}

	protected override void HitLeftWall()
	{
	}

	protected override void HitRightWall()
	{
	}

	public void SetCanBecomeThing(bool enabled)
	{
		canBecomeThing = enabled;
	}

	protected override void Gib(DamageType damageType, float xI, float yI)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		gibbed = true;
		if (currentState == ThingState.FakeDeath)
		{
			currentState = ThingState.Human;
		}
		((TestVanDammeAnim)this).Gib(damageType, xI, yI);
	}

	public override void Death(float xI, float yI, DamageObject damage)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Invalid comparison between Unknown and I4
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: 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_002a: Invalid comparison between Unknown and I4
		if (!theThing && canBecomeThing && !gibbed && (int)damage.damageType != 22 && (int)damage.damageType != 10)
		{
			if (((TestVanDammeAnim)this).IsInseminated() || ((TestVanDammeAnim)this).HasFaceHugger())
			{
				((TestVanDammeAnim)this).DisConnectFaceHugger();
				((TestVanDammeAnim)this).inseminatedCounter = 0f;
			}
			FakeDeath(xI, yI, damage);
		}
		else if (theThing)
		{
			ThingState num = currentState;
			ExitMonsterForm();
			if (num > ThingState.HumanForm && !((TestVanDammeAnim)this).willComeBackToLife)
			{
				damage.damageType = (DamageType)4;
				((Unit)this).Gib(damage.damageType, Mathf.Sign(xI) * 50f, yI);
				EffectsController.CreateSlimeExplosion(((BroforceObject)this).X, ((BroforceObject)this).Y + 5f, 10f, 10f, 140f, 0f, 0f, 0f, 0.5f, 0, 20, 120f, 0f, Vector3.up, (BloodColor)0);
			}
			((BroBase)this).Death(xI, yI, damage);
		}
		else
		{
			((BroBase)this).Death(xI, yI, damage);
		}
		flameSource.Stop();
	}

	public void FakeDeath(float xI, float yI, DamageObject damage)
	{
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Invalid comparison between Unknown and I4
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Invalid comparison between Unknown and I4
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0175: Invalid comparison between Unknown and I4
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Invalid comparison between Unknown and I4
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Invalid comparison between Unknown and I4
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Invalid comparison between Unknown and I4
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Invalid comparison between Unknown and I4
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Invalid comparison between Unknown and I4
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Invalid comparison between Unknown and I4
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Invalid comparison between Unknown and I4
		//IL_018c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Invalid comparison between Unknown and I4
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Invalid comparison between Unknown and I4
		//IL_0196: Unknown result type (might be due to invalid IL or missing references)
		//IL_019d: Invalid comparison between Unknown and I4
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Invalid comparison between Unknown and I4
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Invalid comparison between Unknown and I4
		//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Invalid comparison between Unknown and I4
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_014b: Invalid comparison between Unknown and I4
		flameSource.Stop();
		((TestVanDammeAnim)this).DeactivateGun();
		((BroforceObject)this).health = 1;
		currentState = ThingState.FakeDeath;
		((TestVanDammeAnim)this).CancelMelee();
		((TestVanDammeAnim)this).rollingFrames = 0;
		((TestVanDammeAnim)this).doRollOnLand = false;
		((TestVanDammeAnim)this).canWallClimb = false;
		((TestVanDammeAnim)this).canChimneyFlip = false;
		theThing = true;
		if (damage != null && (int)damage.damageType != 12 && (int)damage.damageType != 28 && (int)damage.damageType != 20 && (int)damage.damageType != 29 && (int)damage.damageType != 22)
		{
			((BroforceObject)this).xI = xI * 0.3f;
			if (yI < 0f)
			{
				yI = 0f;
			}
			if ((int)damage.damageType != 7)
			{
				((BroforceObject)this).yI = yI * 0.3f;
			}
			else
			{
				((BroforceObject)this).yI = yI * 0.5f;
			}
		}
		if ((Object)(object)((TestVanDammeAnim)this).impaledByTransform == (Object)null && !((TestVanDammeAnim)this).isInQuicksand && damage != null && (int)damage.damageType != 22 && (int)damage.damageType != 20 && (int)damage.damageType != 29 && (int)damage.damageType != 28)
		{
			((BroforceObject)this).yI = ((BroforceObject)this).yI + 25f;
			float num = ((TestVanDammeAnim)this).CalculateCeilingHeight();
			if (((BroforceObject)this).Y + ((Unit)this).headHeight < num - 5f && damage != null && (int)damage.damageType != 8 && (int)damage.damageType != 27 && !((TestVanDammeAnim)this).isInQuicksand)
			{
				((BroforceObject)this).Y = ((BroforceObject)this).Y + 5f;
			}
		}
		if (damage != null && (int)damage.damageType != 18 && (int)damage.damageType != 20 && (int)damage.damageType != 29 && (int)damage.damageType != 22 && (int)damage.damageType != 27 && ((TestVanDammeAnim)this).frozenTime <= 0f)
		{
			EffectsController.CreateBloodParticles(((Unit)this).bloodColor, ((BroforceObject)this).X, ((BroforceObject)this).Y + 6f, 10, 4f, 5f, 60f, ((BroforceObject)this).xI * 0.5f, ((BroforceObject)this).yI * 0.5f);
		}
		((TestVanDammeAnim)this).ReleaseHeldObject(false);
		if ((Object)(object)((Component)this).GetComponent<Collider>() != (Object)null)
		{
			((Component)this).GetComponent<Collider>().enabled = false;
		}
		Map.ForgetPlayer(((NetworkedUnit)this).playerNum, false, false);
		((Component)this).GetComponent<Renderer>().material = thingMaterial;
		((Unit)this).frame = 0;
		((TestVanDammeAnim)this).up = (((TestVanDammeAnim)this).down = (((TestVanDammeAnim)this).left = (((TestVanDammeAnim)this).right = (((TestVanDammeAnim)this).wasUp = (((TestVanDammeAnim)this).wasDown = (((TestVanDammeAnim)this).wasLeft = (((TestVanDammeAnim)this).wasRight = (((TestVanDammeAnim)this).dashing = false))))))));
		((TestVanDammeAnim)this).throwingHeldObject = (throwingMook = false);
		((Unit)this).actionState = (ActionState)0;
		HeroController.SetAvatarCalm(((NetworkedUnit)this).playerNum, ((TestVanDammeAnim)this).usePrimaryAvatar);
		((TestVanDammeAnim)this).SetGestureAnimation((Gestures)0);
		if (GameModeController.IsHardcoreMode && permanentlyBecomeThingInIronBro)
		{
			previouslyDiedInIronBro[PlayerProgress.currentWorldMapSaveSlot] = true;
			((CustomHero)this).SaveSettings();
		}
		((Behaviour)((Component)this).GetComponent<InvulnerabilityFlash>()).enabled = false;
		((Unit)this).invulnerable = true;
		AnimateFakeDeath();
	}

	public override void Damage(int damage, DamageType damageType, float xI, float yI, int direction, MonoBehaviour damageSender, float hitX, float hitY)
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		if (currentState != ThingState.FakeDeath && (!theThing || !((TestVanDammeAnim)this).usingSpecial))
		{
			((BroBase)this).Damage(damage, damageType, xI, yI, direction, damageSender, hitX, hitY);
		}
	}

	public override bool IsInStealthMode()
	{
		if (currentState != ThingState.FakeDeath)
		{
			return ((TestVanDammeAnim)this).IsInStealthMode();
		}
		return true;
	}

	protected override void AlertNearbyMooks()
	{
		if (currentState != ThingState.FakeDeath)
		{
			((BroBase)this).AlertNearbyMooks();
		}
	}

	protected override void RunMovement()
	{
		//IL_0011: 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_0025: Unknown result type (might be due to invalid IL or missing references)
		if (currentState != ThingState.FakeDeath)
		{
			((TestVanDammeAnim)this).RunMovement();
			return;
		}
		ActionState actionState = ((Unit)this).actionState;
		((Unit)this).actionState = (ActionState)5;
		((TestVanDammeAnim)this).RunMovement();
		((Unit)this).actionState = actionState;
	}

	protected void AnimateFakeDeath()
	{
		((TestVanDammeAnim)this).frameRate = 0.0334f;
		if (fakeDeathTime >= 1.25f)
		{
			((TestVanDammeAnim)this).frameRate = 0.12f;
			((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)((((Unit)this).frame - 1) * ((TestVanDammeAnim)this).spritePixelWidth), (float)(10 * ((TestVanDammeAnim)this).spritePixelHeight));
			if (((Unit)this).frame == 11)
			{
				((Behaviour)((Component)this).GetComponent<InvulnerabilityFlash>()).enabled = true;
				((Unit)this).invulnerable = false;
				BecomeTheThing();
			}
		}
		else if (((BroforceObject)this).Y > ((TestVanDammeAnim)this).groundHeight + 0.2f && (Object)(object)((TestVanDammeAnim)this).impaledByTransform == (Object)null)
		{
			((TestVanDammeAnim)this).AnimateFallingDeath();
		}
		else
		{
			((TestVanDammeAnim)this).AnimateActualDeath();
		}
	}

	protected void BecomeTheThing()
	{
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)((Component)this).GetComponent<Collider>() != (Object)null)
		{
			((Component)this).GetComponent<Collider>().enabled = true;
		}
		((CustomHero)this).SwitchVariant(1);
		((Unit)this).headHeight = ((TestVanDammeAnim)this).standingHeadHeight;
		((TestVanDammeAnim)this).waistHeight = ((TestVanDammeAnim)this).standingWaistHeight;
		((TestVanDammeAnim)this).doRollOnLand = true;
		((TestVanDammeAnim)this).canWallClimb = true;
		((TestVanDammeAnim)this).canChimneyFlip = true;
		currentState = ThingState.HumanForm;
		((BroforceObject)this).xI = 0f;
		((TestVanDammeAnim)this).xIBlast = 0f;
		((TestVanDammeAnim)this).counter = 1f;
		((TestVanDammeAnim)this).lastParentedToTransform = null;
		((TestVanDammeAnim)this).gunFrame = 0;
		((TestVanDammeAnim)this).gunSprite.meshRender.material = thingGunMaterial;
		((TestVanDammeAnim)this).gunSprite.pixelDimensions = new Vector2(64f, 64f);
		((SpriteBase)((TestVanDammeAnim)this).gunSprite).SetSize(64f, 64f);
		((SpriteBase)((TestVanDammeAnim)this).gunSprite).RecalcTexture();
		((TestVanDammeAnim)this).SpecialAmmo = 2;
		((TestVanDammeAnim)this).originalSpecialAmmo = 2;
	}

	protected void EnterMonsterForm()
	{
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0147: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		if (((TestVanDammeAnim)this).hasBeenCoverInAcid)
		{
			return;
		}
		if (currentState < ThingState.EnteringMonsterForm)
		{
			currentState = ThingState.EnteringMonsterForm;
			((TestVanDammeAnim)this).gunFrame = 0;
			Sound.GetInstance().PlaySoundEffectAt(thingTransformSounds, 1f, ((Component)this).transform.position, 1f, true, false, false, 0f);
		}
		else if (currentState == ThingState.Reforming)
		{
			if (((TestVanDammeAnim)this).gunFrame < 2)
			{
				currentState = ThingState.MonsterForm;
			}
			else
			{
				((TestVanDammeAnim)this).gunFrame = 0;
				currentState = ThingState.EnteringMonsterForm;
			}
			Sound.GetInstance().PlaySoundEffectAt(thingTransformSounds, 1f, ((Component)this).transform.position, 1f, true, false, false, 0f);
		}
		releasedFire = false;
		firedOnce = false;
		if ((Object)(object)((Unit)this).attachedToZipline != (Object)null)
		{
			((Unit)this).attachedToZipline.DetachUnit((Unit)(object)this);
		}
		MonsterFormCounter = -1f;
		((TestVanDammeAnim)this).speed = 100f;
		((TestVanDammeAnim)this).doRollOnLand = false;
		((TestVanDammeAnim)this).canWallClimb = false;
		((TestVanDammeAnim)this).canChimneyFlip = false;
		((TestVanDammeAnim)this).canCeilingHang = false;
		((TestVanDammeAnim)this).SetGestureAnimation((Gestures)0);
		((TestVanDammeAnim)this).ActivateGun();
		if ((Object)(object)((Component)this).GetComponent<Renderer>().material != (Object)(object)thingArmlessMaterial)
		{
			((Component)this).GetComponent<Renderer>().material = thingArmlessMaterial;
			((TestVanDammeAnim)this).sprite.pixelDimensions = new Vector2(32f, 32f);
			((SpriteBase)((TestVanDammeAnim)this).sprite).SetSize(32f, 32f);
			((SpriteBase)((TestVanDammeAnim)this).sprite).RecalcTexture();
			((TestVanDammeAnim)this).spritePixelHeight = 32;
			((TestVanDammeAnim)this).spritePixelWidth = 32;
			SpriteOffsetX = 0f;
			SpriteOffsetY = 0f;
		}
		((TestVanDammeAnim)this).sprite.SetLowerLeftPixel(0f, 32f);
		((TestVanDammeAnim)this).ChangeFrame();
		((TestVanDammeAnim)this).gunCounter = 1f;
		ThingRunGun();
		((TestVanDammeAnim)this).gunCounter = 0f;
	}

	protected void EnterMonsterFormIdle()
	{
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		if (!((TestVanDammeAnim)this).hasBeenCoverInAcid)
		{
			releasedFire = false;
			firedOnce = false;
			if ((Object)(object)((Unit)this).attachedToZipline != (Object)null)
			{
				((Unit)this).attachedToZipline.DetachUnit((Unit)(object)this);
			}
			((TestVanDammeAnim)this).speed = 100f;
			currentState = ThingState.MonsterForm;
			MonsterFormCounter = 3f;
			((TestVanDammeAnim)this).doRollOnLand = false;
			((TestVanDammeAnim)this).canWallClimb = false;
			((TestVanDammeAnim)this).canChimneyFlip = false;
			((TestVanDammeAnim)this).SetGestureAnimation((Gestures)0);
			((TestVanDammeAnim)this).gunFrame = 0;
			((TestVanDammeAnim)this).DeactivateGun();
			if ((Object)(object)((Component)this).GetComponent<Renderer>().material != (Object)(object)thingMonsterFormMaterial)
			{
				((Component)this).GetComponent<Renderer>().material = thingMonsterFormMaterial;
				((TestVanDammeAnim)this).sprite.pixelDimensions = new Vector2(64f, 64f);
				((SpriteBase)((TestVanDammeAnim)this).sprite).SetSize(64f, 64f);
				((SpriteBase)((TestVanDammeAnim)this).sprite).RecalcTexture();
				((TestVanDammeAnim)this).spritePixelHeight = 64;
				((TestVanDammeAnim)this).spritePixelWidth = 64;
				SpriteOffsetX = 16f;
				SpriteOffsetY = 16f;
			}
			((TestVanDammeAnim)this).ChangeFrame();
		}
	}

	protected void ExitMonsterForm()
	{
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		MonsterFormCounter = -1f;
		((TestVanDammeAnim)this).speed = 130f;
		currentState = ThingState.HumanForm;
		((TestVanDammeAnim)this).doRollOnLand = true;
		((TestVanDammeAnim)this).canWallClimb = true;
		((TestVanDammeAnim)this).canChimneyFlip = true;
		((TestVanDammeAnim)this).canCeilingHang = true;
		((TestVanDammeAnim)this).SetGunPosition(0f, 0f);
		((CustomHero)this).CurrentGunSpriteOffset = new Vector2(-2f, 0f);
		((TestVanDammeAnim)this).SetGunSprite(0, 0);
		((Component)this).GetComponent<Renderer>().material = thingMaterial;
		((TestVanDammeAnim)this).sprite.pixelDimensions = new Vector2(32f, 32f);
		((SpriteBase)((TestVanDammeAnim)this).sprite).SetSize(32f, 32f);
		((SpriteBase)((TestVanDammeAnim)this).sprite).RecalcTexture();
		((TestVanDammeAnim)this).spritePixelHeight = 32;
		((TestVanDammeAnim)this).spritePixelWidth = 32;
		SpriteOffsetX = 0f;
		SpriteOffsetY = 0f;
		((TestVanDammeAnim)this).ChangeFrame();
	}

	protected void AnimateBecomingMonster()
	{
		if (((TestVanDammeAnim)this).gunFrame >= 6)
		{
			currentState = ThingState.MonsterForm;
		}
		((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)((TestVanDammeAnim)this).gunFrame * 64f, 64f);
	}

	protected void AnimateBecomingHuman()
	{
		((TestVanDammeAnim)this).gunCounter = ((TestVanDammeAnim)this).gunCounter + ((Unit)this).t;
		if (((TestVanDammeAnim)this).gunCounter > 0.08f)
		{
			((TestVanDammeAnim)this).gunCounter = ((TestVanDammeAnim)this).gunCounter - 0.08f;
			((TestVanDammeAnim)this).gunFrame = ((TestVanDammeAnim)this).gunFrame + 1;
			if (((TestVanDammeAnim)this).gunFrame > 5)
			{
				ExitMonsterForm();
			}
			else
			{
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)(((TestVanDammeAnim)this).gunFrame + 12) * 64f, 64f);
			}
		}
	}

	protected override void SetSpriteOffset(float xOffset, float yOffset)
	{
		((TestVanDammeAnim)this).SetSpriteOffset(SpriteOffsetX + xOffset, SpriteOffsetY + yOffset);
	}

	protected override void AnimateWallAnticipation()
	{
		if (currentState <= ThingState.HumanForm)
		{
			((TestVanDammeAnim)this).AnimateWallAnticipation();
		}
		else
		{
			((TestVanDammeAnim)this).AnimateJumping();
			MonsterFormCounter = Mathf.Min(MonsterFormCounter, 0.2f);
		}
		wasAnticipatingWallClimb = true;
	}

	protected override void Jump(bool wallJump)
	{
		if (!(currentState > ThingState.HumanForm && wallJump))
		{
			((BroBase)this).Jump(wallJump);
		}
	}

	protected override void ChangeFrame()
	{
		((TestVanDammeAnim)this).ChangeFrame();
		if (theThing && !((TestVanDammeAnim)this).usingSpecial && !((TestVanDammeAnim)this).doingMelee && currentState == ThingState.MonsterForm)
		{
			((TestVanDammeAnim)this).frameRate = Mathf.Max(0.0334f, ((TestVanDammeAnim)this).frameRate);
		}
		if (wasAnticipatingWallClimb)
		{
			currentlyAnticipatingWallClimb = true;
		}
		else
		{
			currentlyAnticipatingWallClimb = false;
		}
		wasAnticipatingWallClimb = false;
	}

	public override void SetGestureAnimation(Gestures gesture)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		if (!((TestVanDammeAnim)this).doingMelee && ((int)gesture == 0 || !theThing || currentState <= ThingState.HumanForm))
		{
			((BroBase)this).SetGestureAnimation(gesture);
		}
		else
		{
			MonsterFormCounter = Mathf.Min(MonsterFormCounter, 0.2f);
		}
	}

	protected override void CoverInAcidRPC()
	{
		if (currentState > ThingState.HumanForm)
		{
			ExitMonsterForm();
		}
		((TestVanDammeAnim)this).CoverInAcidRPC();
	}

	public override bool Inseminate(AlienFaceHugger unit, float xForce, float yForce)
	{
		if (theThing)
		{
			ExitMonsterForm();
		}
		return ((TestVanDammeAnim)this).Inseminate(unit, xForce, yForce);
	}

	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_01db: 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 && currentState <= ThingState.HumanForm)
		{
			((TestVanDammeAnim)this).doingMelee = (((TestVanDammeAnim)this).dashingMelee = false);
			((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 void ThingStartFiring()
	{
		if (!((TestVanDammeAnim)this).IsInseminated() && !((TestVanDammeAnim)this).HasFaceHugger() && !((TestVanDammeAnim)this).hasBeenCoverInAcid && !releasedFire && !((TestVanDammeAnim)this).usingSpecial && !((TestVanDammeAnim)this).doingMelee)
		{
			EnterMonsterForm();
		}
		else if (releasedFire)
		{
			firedOnce = false;
		}
		firePressed = 0f;
	}

	protected void ThingStopFiring()
	{
		if (!((TestVanDammeAnim)this).usingSpecial && !((TestVanDammeAnim)this).doingMelee && (currentState == ThingState.EnteringMonsterForm || currentState == ThingState.MonsterForm))
		{
			releasedFire = true;
		}
	}

	protected void ThingRunFiring()
	{
	}

	protected void ThingUseFire()
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		ThingFireWeapon(((BroforceObject)this).X, ((BroforceObject)this).Y + 8f, ((Component)this).transform.localScale.x * 300f, 600f);
		Map.DisturbWildLife(((BroforceObject)this).X, ((BroforceObject)this).Y, 60f, ((NetworkedUnit)this).playerNum);
	}

	public static bool HitUnits(MonoBehaviour damageSender, int playerNum, int damage, DamageType damageType, float xRange, float yRange, float x, float y, float xI, float yI, bool penetrates, bool knock, bool canGib, bool canHeadShot, List<Unit> hitUnits, bool onlyDamageInRadius = false)
	{
		//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		if (Map.units == null)
		{
			return false;
		}
		bool result = false;
		int num = 999999;
		bool flag = false;
		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) || (((NetworkedUnit)val).playerNum < 0 && val.CatchFriendlyBullets())) && !val.invulnerable && ((BroforceObject)val).health <= num)
			{
				float num3 = ((BroforceObject)val).X - x;
				if (Mathf.Abs(num3) - xRange < val.width)
				{
					float num4 = ((BroforceObject)val).Y + val.height / 2f + 4f - y;
					if (Mathf.Abs(num4) - yRange < val.height && (!onlyDamageInRadius || Mathf.Sqrt(num3 * num3 + num4 * num4) <= xRange + val.width) && !hitUnits.Contains(val))
					{
						hitUnits?.Add(val);
						if (!penetrates && ((BroforceObject)val).health > 0)
						{
							num = 0;
							flag = true;
						}
						if (((BroforceObject)val).health > 30)
						{
							damage += 3;
						}
						if (!canGib && ((BroforceObject)val).health <= 0)
						{
							Map.KnockAndDamageUnit(damageSender, val, 0, damageType, xI, yI, (int)Mathf.Sign(xI), knock, x, y, false);
						}
						else if (num4 < 0f - val.height && canHeadShot && val.CanHeadShot())
						{
							Map.HeadShotUnit(damageSender, val, ValueOrchestrator.GetModifiedDamage(damage, playerNum), damageType, xI, yI, (int)Mathf.Sign(xI), knock, x, y);
						}
						else
						{
							Map.KnockAndDamageUnit(damageSender, val, ValueOrchestrator.GetModifiedDamage(damage, playerNum), damageType, xI, yI, (int)Mathf.Sign(xI), knock, x, y, false);
						}
						result = true;
						if (flag)
						{
							return result;
						}
					}
				}
			}
		}
		return result;
	}

	protected void ThingFireWeapon(float x, float y, float xSpeed, float ySpeed)
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: 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_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		bool flag = default(bool);
		Map.DamageDoodads(5, (DamageType)21, x, y, xSpeed, ySpeed, 14f, ((NetworkedUnit)this).playerNum, ref flag, (MonoBehaviour)null);
		if (Physics.Raycast(new Vector3(((BroforceObject)this).X - 6f * ((Component)this).transform.localScale.x, ((BroforceObject)this).Y + ((TestVanDammeAnim)this).waistHeight, 0f), new Vector3(((Component)this).transform.localScale.x, 0f, 0f), ref ((TestVanDammeAnim)this).raycastHit, 33f, LayerMask.op_Implicit(((TestVanDammeAnim)this).fragileLayer)) && (Object)(object)((Component)((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).collider).gameObject.GetComponent<Parachute>() == (Object)null)
		{
			((Component)((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).collider).gameObject.SendMessage("Open", (object)(int)((Component)this).transform.localScale.x);
			MapController.Damage_Networked((MonoBehaviour)(object)this, ((Component)((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).collider).gameObject, 1, (DamageType)4, ((Component)this).transform.localScale.x * 500f, 50f, ((BroforceObject)this).X, ((BroforceObject)this).Y);
		}
		HitUnits((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, 9, (DamageType)21, 20f, 24f, x + ((Component)this).transform.localScale.x * 5f, y, xSpeed, ySpeed, penetrates: true, knock: true, canGib: true, canHeadShot: false, alreadyHitUnits);
		if (!hasHitTerrain)
		{
			hasHitTerrain = ThingHitTerrain(33f, 4f, 0, 14f, 5, playSound: false);
		}
	}

	protected override void ClearFireInput()
	{
		if (theThing && ((TestVanDammeAnim)this).fire)
		{
			releasedFire = true;
		}
		((TestVanDammeAnim)this).ClearFireInput();
	}

	public override void ClearAllInput()
	{
		if (theThing && ((TestVanDammeAnim)this).fire)
		{
			releasedFire = true;
		}
		((TestVanDammeAnim)this).ClearAllInput();
	}

	protected void ThingRunGun()
	{
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Invalid comparison between Unknown and I4
		//IL_018d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0212: Unknown result type (might be due to invalid IL or missing references)
		//IL_0263: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
		firePressed += ((Unit)this).t;
		if (((TestVanDammeAnim)this).hasBeenCoverInAcid || ((TestVanDammeAnim)this).doingMelee || ((TestVanDammeAnim)this).usingSpecial || (int)((Unit)this).actionState == 7)
		{
			return;
		}
		if (currentState == ThingState.EnteringMonsterForm)
		{
			((TestVanDammeAnim)this).gunCounter = ((TestVanDammeAnim)this).gunCounter + ((Unit)this).t;
			if (((TestVanDammeAnim)this).gunCounter > 0.08f)
			{
				((TestVanDammeAnim)this).gunCounter = ((TestVanDammeAnim)this).gunCounter - 0.08f;
				((TestVanDammeAnim)this).gunFrame = ((TestVanDammeAnim)this).gunFrame + 1;
				AnimateBecomingMonster();
			}
			if (currentState == ThingState.MonsterForm)
			{
				((TestVanDammeAnim)this).gunFrame = 0;
			}
		}
		else if (currentState == ThingState.Reforming)
		{
			AnimateBecomingHuman();
		}
		else if (currentState == ThingState.HumanForm)
		{
			((TestVanDammeAnim)this).gunFrame = 0;
			((TestVanDammeAnim)this).SetGunSprite(0, 0);
		}
		else if (((TestVanDammeAnim)this).fire || (releasedFire && !firedOnce))
		{
			((TestVanDammeAnim)this).gunCounter = ((TestVanDammeAnim)this).gunCounter + ((Unit)this).t;
			if (!(((TestVanDammeAnim)this).gunCounter > 0.065f))
			{
				return;
			}
			((TestVanDammeAnim)this).gunCounter = ((TestVanDammeAnim)this).gunCounter - 0.065f;
			((TestVanDammeAnim)this).gunFrame = ((TestVanDammeAnim)this).gunFrame + 1;
			if (((TestVanDammeAnim)this).gunFrame < 2)
			{
				((TestVanDammeAnim)this).gunFrame = 2;
			}
			if (((TestVanDammeAnim)this).gunFrame > 11)
			{
				((TestVanDammeAnim)this).gunFrame = 5;
			}
			if (((TestVanDammeAnim)this).gunFrame == 5)
			{
				alreadyHitUnits = new List<Unit>();
				hasHitTerrain = false;
				playedHitSound = false;
				playedMissSound = false;
				Sound.GetInstance().PlaySoundEffectAt(whipStartSounds, 0.4f, ((Component)this).transform.position, 1f + ((TestVanDammeAnim)this).pitchShiftAmount, true, false, false, 0f);
			}
			if (((TestVanDammeAnim)this).gunFrame > 8 && ((TestVanDammeAnim)this).gunFrame < 11)
			{
				ThingUseFire();
			}
			if (((TestVanDammeAnim)this).gunFrame >= 9 && ((TestVanDammeAnim)this).gunFrame < 11)
			{
				if (!playedHitSound && alreadyHitUnits.Count > 0)
				{
					playedHitSound = true;
					Sound.GetInstance().PlaySoundEffectAt(tentacleHitSounds, 0.7f, ((Component)this).transform.position, 1f + ((TestVanDammeAnim)this).pitchShiftAmount, true, false, false, 0f);
				}
				else if (!playedHitSound && hasHitTerrain)
				{
					playedHitSound = true;
					Sound.GetInstance().PlaySoundEffectAt(tentacleHitTerrainSounds, 0.4f, ((Component)this).transform.position, 1f + ((TestVanDammeAnim)this).pitchShiftAmount, true, false, false, 0f);
				}
				else if (!playedMissSound && !playedHitSound)
				{
					playedMissSound = true;
					Sound.GetInstance().PlaySoundEffectAt(whipMissSounds, 0.2f, ((Component)this).transform.position, 1f + ((TestVanDammeAnim)this).pitchShiftAmount, true, false, false, 0f);
				}
			}
			else if (((TestVanDammeAnim)this).gunFrame == 11 && firePressed > 0.3f)
			{
				firedOnce = true;
			}
			((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)((TestVanDammeAnim)this).gunFrame * 64f, 192f);
		}
		else if (releasedFire)
		{
			if (((TestVanDammeAnim)this).gunFrame > 4)
			{
				((TestVanDammeAnim)this).gunFrame = 4;
			}
			((TestVanDammeAnim)this).gunCounter = ((TestVanDammeAnim)this).gunCounter + ((Unit)this).t;
			if (((TestVanDammeAnim)this).gunCounter > 0.07f)
			{
				((TestVanDammeAnim)this).gunCounter = ((TestVanDammeAnim)this).gunCounter - 0.07f;
				((TestVanDammeAnim)this).gunFrame = ((TestVanDammeAnim)this).gunFrame - 1;
			}
			if (((TestVanDammeAnim)this).gunFrame > 1)
			{
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)((TestVanDammeAnim)this).gunFrame * 64f, 192f);
				return;
			}
			releasedFire = false;
			EnterMonsterFormIdle();
		}
		else if (currentState == ThingState.MonsterForm)
		{
			((TestVanDammeAnim)this).gunFrame = 0;
			((TestVanDammeAnim)this).DeactivateGun();
		}
	}

	protected override void SetGunPosition(float xOffset, float yOffset)
	{
		if (theThing)
		{
			((CustomHero)this).SetGunPosition(16f + xOffset, 16f + yOffset);
		}
		else
		{
			((CustomHero)this).SetGunPosition(xOffset, yOffset);
		}
	}

	protected override void StartPockettedSpecial()
	{
		if (!theThing || currentState == ThingState.HumanForm)
		{
			((BroBase)this).StartPockettedSpecial();
		}
		else
		{
			MonsterFormCounter = Mathf.Min(MonsterFormCounter, 0.2f);
		}
	}

	protected void ThingPressSpecial()
	{
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		if (!((TestVanDammeAnim)this).usingSpecial && ((TestVanDammeAnim)this).SpecialAmmo > 0 && !((TestVanDammeAnim)this).hasBeenCoverInAcid && !((TestVanDammeAnim)this).doingMelee && !acceptedDeath && !((TestVanDammeAnim)this).IsInseminated() && !((TestVanDammeAnim)this).HasFaceHugger())
		{
			((TestVanDammeAnim)this).SetGestureAnimation((Gestures)0);
			((TestVanDammeAnim)this).usingSpecial = true;
			actuallyUsingSpecial = true;
			((TestVanDammeAnim)this).canDuck = false;
			((TestVanDammeAnim)this).ducking = false;
			((TestVanDammeAnim)this).pressSpecialFacingDirection = (int)((Component)this).transform.localScale.x;
			currentTentacleState = TentacleState.Inactive;
			tentacleHitUnit = false;
			EnterMonsterForm();
			((TestVanDammeAnim)this).gunFrame = -1;
			((TestVanDammeAnim)this).speed = 50f;
			int specialAmmo = ((TestVanDammeAnim)this).SpecialAmmo - 1;
			((TestVanDammeAnim)this).SpecialAmmo = specialAmmo;
			((Behaviour)((Component)this).GetComponent<InvulnerabilityFlash>()).enabled = false;
			((Unit)this).invulnerable = true;
		}
		else if (((TestVanDammeAnim)this).SpecialAmmo <= 0)
		{
			HeroController.FlashSpecialAmmo(((NetworkedUnit)this).playerNum);
		}
	}

	protected void ThingUseSpecial()
	{
	}

	protected void ThingAnimateSpecial()
	{
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		((TestVanDammeAnim)this).gunFrame = ((TestVanDammeAnim)this).gunFrame + 1;
		((TestVanDammeAnim)this).usingSpecial = false;
		((TestVanDammeAnim)this).ChangeFrame();
		((TestVanDammeAnim)this).usingSpecial = true;
		((TestVanDammeAnim)this).ActivateGun();
		if (currentState == ThingState.EnteringMonsterForm)
		{
			((TestVanDammeAnim)this).frameRate = 0.08f;
			AnimateBecomingMonster();
			if (currentState == ThingState.MonsterForm)
			{
				((TestVanDammeAnim)this).gunFrame = 0;
			}
			return;
		}
		((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)((TestVanDammeAnim)this).gunFrame * 64f, 256f);
		((TestVanDammeAnim)this).frameRate = 0.08f;
		if (((TestVanDammeAnim)this).gunFrame == 5)
		{
			Sound.GetInstance().PlaySoundEffectAt(whipStartSounds, 0.4f, ((Component)this).transform.position, 1f + ((TestVanDammeAnim)this).pitchShiftAmount, true, false, false, 0f);
		}
		else if (((TestVanDammeAnim)this).gunFrame == 7 && currentTentacleState == TentacleState.Inactive)
		{
			StartTentacleWhip();
		}
		else if (currentTentacleState > TentacleState.Inactive && currentTentacleState < TentacleState.ReadyToEat && ((TestVanDammeAnim)this).gunFrame > 8)
		{
			((TestVanDammeAnim)this).gunFrame = 8;
		}
		else if (((TestVanDammeAnim)this).gunFrame == 10)
		{
			((TestVanDammeAnim)this).sound.PlaySoundEffectAt(biteSound, 0.45f, ((Component)this).transform.position, 1f, true, false, false, 0f);
		}
		else if (((TestVanDammeAnim)this).gunFrame == 12)
		{
			EatMook();
		}
		else if (((TestVanDammeAnim)this).gunFrame > 15)
		{
			((TestVanDammeAnim)this).usingSpecial = (((TestVanDammeAnim)this).usingPockettedSpecial = false);
			actuallyUsingSpecial = false;
			((TestVanDammeAnim)this).canDuck = true;
			((Unit)this).invulnerable = false;
			((Behaviour)((Component)this).GetComponent<InvulnerabilityFlash>()).enabled = true;
			EnterMonsterFormIdle();
		}
		if (currentTentacleState == TentacleState.ReadyToEat)
		{
			((TestVanDammeAnim)this).frameRate = 0.07f;
		}
	}

	protected void EatMook()
	{
		//IL_0077: 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_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_014b: Unknown result type (might be due to invalid IL or missing references)
		ThingMeleeAttack(shouldTryHitTerrain: true, playMissSound: true);
		((Renderer)tentacleLine).enabled = false;
		currentTentacleState = TentacleState.Inactive;
		if (((BroforceObject)unitHit).health > 0)
		{
			unitHit.Unimpale(3, (DamageType)21, 0f, 0f, (MonoBehaviour)(object)this);
			if (unitHit is Mook)
			{
				unitHit.useImpaledFrames = false;
			}
		}
		else
		{
			float num = 25f;
			float num2 = 15f;
			EffectsController.CreateExplosionRangePop(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 3f, ((BroforceObject)this).Y + 3f, -1f, num * 2f);
			Map.ExplodeUnits((MonoBehaviour)(object)this, 13, (DamageType)2, num, num, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 3f, ((BroforceObject)this).Y + 3f, num2 * 40f, num2 * 15f, ((NetworkedUnit)this).playerNum, false, false, true);
			EffectsController.CreateSlimeExplosion(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 3f, ((BroforceObject)this).Y + 3f, 15f, 15f, 140f, 0f, 0f, 0f, 0f, 0, 20, 120f, 0f, Vector3.up, (BloodColor)0);
			Map.DisturbWildLife(((BroforceObject)this).X, ((BroforceObject)this).Y, 80f, ((NetworkedUnit)this).playerNum);
			bool flag = default(bool);
			Map.DamageDoodads(20, (DamageType)2, ((BroforceObject)this).X, ((BroforceObject)this).Y, 0f, 0f, num, ((NetworkedUnit)this).playerNum, ref flag, (MonoBehaviour)null);
		}
	}

	protected void StartTentacleWhip()
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		currentTentacleState = TentacleState.Extending;
		tentacleExtendTime = 0.02f;
		tentacleRetractTimer = 0f;
		tentacleDirection = new Vector3(((Component)this).transform.localScale.x, 0f, 0f);
		((Vector3)(ref tentacleDirection)).Normalize();
		((Component)tentacleWhipSprite).gameObject.SetActive(true);
		impaled = false;
		tentacleHitGround = false;
		tentacleHitUnit = false;
	}

	protected void UpdateTentacle()
	{
		DrawTentacle();
	}

	public Unit HitClosestUnit(MonoBehaviour damageSender, int playerNum, float xRange, float yRange, float x, float y, int direction, Vector3 startPoint, bool haveHitGround, Vector3 groundVector)
	{
		//IL_011a: Unknown result type (might be due to invalid IL or missing references)
		if (Map.units == null)
		{
			return null;
		}
		int num = 999999;
		float num2 = Mathf.Max(xRange, yRange);
		Unit val = null;
		for (int num3 = Map.units.Count - 1; num3 >= 0; num3--)
		{
			Unit val2 = Map.units[num3];
			if ((Object)(object)val2 != (Object)null && !val2.invulnerable && ((BroforceObject)val2).health <= num && GameModeController.DoesPlayerNumDamage(playerNum, ((NetworkedUnit)val2).playerNum))
			{
				float num4 = ((BroforceObject)val2).X - x;
				if (Mathf.Abs(num4) - xRange < val2.width && Mathf.Sign(num4) == (float)direction)
				{
					float num5 = ((BroforceObject)val2).Y + val2.height / 2f + 3f - y;
					if (Mathf.Abs(num5) - yRange < val2.height)
					{
						float num6 = Mathf.Abs(num4) + Mathf.Abs(num5);
						if (num6 < num2 && ((BroforceObject)val2).health > 0)
						{
							val = val2;