Decompiled source of Jack Broton v1.0.3

UMM/BroMaker_Storage/Jack Broton/Jack Broton.dll

Decompiled 4 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BroMakerLib;
using BroMakerLib.CustomObjects.Bros;
using UnityEngine;

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

[HeroPreset(/*Could not decode attribute arguments.*/)]
public class JackBroton : CustomHero
{
	public class ProjectileData
	{
		public int bulletCount;

		public int maxBulletCount = 3;
	}

	[CompilerGenerated]
	private sealed class <FlashAvatarRoutine>d__83 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public float totalDuration;

		public JackBroton <>4__this;

		public float interval;

		private float <endTime>5__2;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <FlashAvatarRoutine>d__83(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Expected O, but got Unknown
			int num = <>1__state;
			JackBroton jackBroton = <>4__this;
			switch (num)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<endTime>5__2 = Time.time + totalDuration;
				break;
			case 1:
				<>1__state = -1;
				break;
			}
			if (Time.time < <endTime>5__2)
			{
				HeroController.FlashAvatar(((NetworkedUnit)jackBroton).playerNum, interval * 2f, ((TestVanDammeAnim)jackBroton).usePrimaryAvatar);
				<>2__current = (object)new WaitForSeconds(interval);
				<>1__state = 1;
				return true;
			}
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <FlashCharacterSpriteRoutine>d__82 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public JackBroton <>4__this;

		public float totalDuration;

		public float interval;

		private Color <playerColor>5__2;

		private float <endTime>5__3;

		private bool <usePlayerClr>5__4;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <FlashCharacterSpriteRoutine>d__82(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: 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_00ce: Expected O, but got Unknown
			int num = <>1__state;
			JackBroton jackBroton = <>4__this;
			switch (num)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<playerColor>5__2 = HeroController.GetHeroColor(((NetworkedUnit)jackBroton).playerNum);
				<endTime>5__3 = Time.time + totalDuration;
				<usePlayerClr>5__4 = true;
				break;
			case 1:
				<>1__state = -1;
				break;
			}
			if (Time.time < <endTime>5__3)
			{
				Color val = (<usePlayerClr>5__4 ? <playerColor>5__2 : jackBroton.defaultTintColor);
				jackBroton.normalMaterial.SetColor("_TintColor", val);
				((TestVanDammeAnim)jackBroton).gunSprite.meshRender.material.SetColor("_TintColor", val);
				((TestVanDammeAnim)jackBroton).sprite.meshRender.material.SetColor("_TintColor", val);
				<usePlayerClr>5__4 = !<usePlayerClr>5__4;
				<>2__current = (object)new WaitForSeconds(interval);
				<>1__state = 1;
				return true;
			}
			jackBroton.normalMaterial.SetColor("_TintColor", jackBroton.defaultTintColor);
			((TestVanDammeAnim)jackBroton).gunSprite.meshRender.material.SetColor("_TintColor", jackBroton.defaultTintColor);
			((TestVanDammeAnim)jackBroton).sprite.meshRender.material.SetColor("_TintColor", jackBroton.defaultTintColor);
			jackBroton.spriteFlashCoroutine = null;
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private Projectile[] projectiles;

	private Projectile primaryProjectile;

	private Projectile specialProjectile;

	private ProjectileData specialProjectileData;

	private Material normalMaterial;

	private Material normalGunMaterial;

	private Material normalAvatarMaterial;

	private float primaryAttackRange = 15f;

	private float primaryAttackSpeed = 380f;

	private float primaryProjectileLifetime = 0.12f;

	public static AudioClip[] Tec9GunSounds;

	public static AudioClip[] BootKnifeSounds;

	public static AudioClip[] DashingMeleeSounds;

	public static AudioClip[] BrotonSmack;

	public static AudioClip[] Questions;

	public static AudioClip[] InvulSounds;

	private AudioClip emptyGunSound;

	private int specialAmmo = 3;

	public bool hitDeadUnits = true;

	private bool wasInvulnerable;

	private bool hasThrownProjectile;

	private bool UsingSpecial;

	private bool isUsingSecondSpecial;

	protected bool specialActive;

	private int usingSpecialFrame;

	private bool specialSoundPlayed;

	public AudioSource specialAudioSource;

	private float specialAnimationTimer;

	private bool isReversingSpecial;

	private bool isDelayingPrimaryFire;

	private float primaryFireDelayTimer;

	public float muzzleFlashOffsetXOnZiplineLeft = 8f;

	public float muzzleFlashOffsetYOnZiplineLeft = 2.5f;

	public float muzzleFlashOffsetXOnZiplineRight = -9f;

	public float muzzleFlashOffsetYOnZiplineRight = 2f;

	public float muzzleFlashPrimaryOffsetXOnZiplineLeft = 9.5f;

	public float muzzleFlashPrimaryOffsetYOnZiplineLeft = 1.5f;

	public float muzzleFlashPrimaryOffsetXOnZiplineRight = -8f;

	public float muzzleFlashPrimaryOffsetYOnZiplineRight = 1f;

	private bool wasRunning;

	private bool skipNextMelee;

	private bool shouldThrowMook;

	private Mook mookToThrow;

	private int preDecrementAmmo;

	private bool invulnerabilityMode;

	private float invulnerabilityTime;

	private bool isInvulnerable;

	private float sweatInterval = 0.1f;

	private float sweatTimer;

	private bool invulnerabilityMode_WasActive;

	private bool isFinishingSpecial;

	private int specialStartAmmo;

	private Coroutine spriteFlashCoroutine;

	private Color defaultTintColor;

	private bool soundPlayed;

	private int lastQuestionIndex = -1;

	private BootKnife bootknifePrefab;

	private List<int> questionPool;

	protected bool wallMelee;

	private bool _invulCoroutineStarted;

	public override bool invulnerable
	{
		get
		{
			return ((Unit)this).invulnerable;
		}
		set
		{
			((Unit)this).invulnerable = value;
		}
	}

	protected override void Awake()
	{
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		((CustomHero)this).Awake();
		InitializeResources();
		InitializeProjectiles();
		InitializeAudioClips();
		((TestVanDammeAnim)this).gunSpriteHangingFrame = 9;
		Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
		((Unit)this).projectile = (Projectile)(object)new GameObject("BootKnife", new Type[5]
		{
			typeof(Transform),
			typeof(MeshFilter),
			typeof(MeshRenderer),
			typeof(SpriteSM),
			typeof(BootKnife)
		}).GetComponent<BootKnife>();
		bootknifePrefab = ((Component)((Unit)this).projectile).GetComponent<BootKnife>();
		((Behaviour)bootknifePrefab).enabled = false;
		defaultTintColor = normalMaterial.GetColor("_TintColor");
		sweatTimer = sweatInterval;
		questionPool = new List<int>(Questions.Length);
		RefillQuestionPool();
	}

	private void InitializeResources()
	{
		string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
		normalMaterial = ((TestVanDammeAnim)this).material;
		normalGunMaterial = ((TestVanDammeAnim)this).gunSprite.meshRender.material;
		normalAvatarMaterial = ResourcesController.GetMaterial(directoryName, "avatar.png");
	}

	public override void AfterPrefabSetup()
	{
		((CustomHero)this).AfterPrefabSetup();
		specialAudioSource = ((Component)this).gameObject.AddComponent<AudioSource>();
	}

	private void InitializeAudioClips()
	{
		string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
		if (Tec9GunSounds == null)
		{
			Tec9GunSounds = (AudioClip[])(object)new AudioClip[3];
			Tec9GunSounds[0] = ResourcesController.GetAudioClip(Path.Combine(directoryName, "sounds"), "Tec9_1.wav");
			Tec9GunSounds[1] = ResourcesController.GetAudioClip(Path.Combine(directoryName, "sounds"), "Tec9_2.wav");
			Tec9GunSounds[2] = ResourcesController.GetAudioClip(Path.Combine(directoryName, "sounds"), "Tec9_3.wav");
		}
		if (BootKnifeSounds == null)
		{
			BootKnifeSounds = (AudioClip[])(object)new AudioClip[2];
			BootKnifeSounds[0] = ResourcesController.GetAudioClip(Path.Combine(directoryName, "sounds"), "BootKnife_1.wav");
			BootKnifeSounds[1] = ResourcesController.GetAudioClip(Path.Combine(directoryName, "sounds"), "BootKnife_2.wav");
		}
		if (InvulSounds == null)
		{
			InvulSounds = (AudioClip[])(object)new AudioClip[1];
			InvulSounds[0] = ResourcesController.GetAudioClip(Path.Combine(directoryName, "sounds"), "Potion.wav");
		}
		if (DashingMeleeSounds == null)
		{
			DashingMeleeSounds = (AudioClip[])(object)new AudioClip[2];
			DashingMeleeSounds[0] = ResourcesController.GetAudioClip(Path.Combine(directoryName, "sounds"), "BrotonSmack.wav");
			DashingMeleeSounds[1] = ResourcesController.GetAudioClip(Path.Combine(directoryName, "sounds"), "BrotonSmack2.wav");
		}
		if (Questions == null)
		{
			Questions = (AudioClip[])(object)new AudioClip[7];
			Questions[0] = ResourcesController.GetAudioClip(Path.Combine(directoryName, "sounds"), "question1.wav");
			Questions[1] = ResourcesController.GetAudioClip(Path.Combine(directoryName, "sounds"), "question2.wav");
			Questions[2] = ResourcesController.GetAudioClip(Path.Combine(directoryName, "sounds"), "question3.wav");
			Questions[3] = ResourcesController.GetAudioClip(Path.Combine(directoryName, "sounds"), "question4.wav");
			Questions[4] = ResourcesController.GetAudioClip(Path.Combine(directoryName, "sounds"), "question5.wav");
			Questions[5] = ResourcesController.GetAudioClip(Path.Combine(directoryName, "sounds"), "question6.wav");
			Questions[6] = ResourcesController.GetAudioClip(Path.Combine(directoryName, "sounds"), "question7.wav");
		}
	}

	private void RefillQuestionPool()
	{
		questionPool.Clear();
		for (int i = 0; i < Questions.Length; i++)
		{
			questionPool.Add(i);
		}
	}

	protected override void Update()
	{
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_019f: Unknown result type (might be due to invalid IL or missing references)
		((BroBase)this).Update();
		if (((TestVanDammeAnim)this).usingSpecial && !((TestVanDammeAnim)this).doingMelee)
		{
			int num = Mathf.FloorToInt(specialAnimationTimer / ((TestVanDammeAnim)this).frameRate);
			if (((TestVanDammeAnim)this).fire && !hasThrownProjectile)
			{
				CancelSpecial();
			}
			else if (((TestVanDammeAnim)this).fire && hasThrownProjectile && preDecrementAmmo == 1 && num < 6)
			{
				invulnerabilityMode = false;
				((Unit)this).invulnerable = false;
				CancelSpecial();
			}
			else if (((BroforceObject)this).health <= 0)
			{
				ResetSpecialState();
			}
			else
			{
				((TestVanDammeAnim)this).AnimateSpecial();
			}
			return;
		}
		if (skipNextMelee && !((TestVanDammeAnim)this).doingMelee)
		{
			skipNextMelee = false;
		}
		if (((Unit)this).invulnerable)
		{
			wasInvulnerable = true;
		}
		else if (wasInvulnerable)
		{
			normalMaterial.SetColor("_TintColor", Color.gray);
			((TestVanDammeAnim)this).gunSprite.meshRender.material.SetColor("_TintColor", Color.gray);
			wasInvulnerable = false;
		}
		if (invulnerabilityMode)
		{
			sweatTimer -= ((Unit)this).t;
			if (sweatTimer <= 0f)
			{
				((BroBase)this).CreateSweatParticle();
				sweatTimer = sweatInterval;
			}
			invulnerabilityTime -= ((Unit)this).t;
			if (invulnerabilityTime <= 0f)
			{
				invulnerabilityMode = false;
			}
		}
		else
		{
			sweatTimer = sweatInterval;
		}
		if (invulnerabilityMode_WasActive && !invulnerabilityMode)
		{
			normalMaterial.SetColor("_TintColor", defaultTintColor);
			((TestVanDammeAnim)this).gunSprite.meshRender.material.SetColor("_TintColor", defaultTintColor);
			OnInvulnerabilityEnd();
		}
		invulnerabilityMode_WasActive = invulnerabilityMode;
	}

	private void CancelSpecial()
	{
		invulnerabilityMode = false;
		((Unit)this).invulnerable = false;
		((TestVanDammeAnim)this).usingSpecial = false;
		specialActive = false;
		hasThrownProjectile = false;
		specialAnimationTimer = 0f;
		if (((TestVanDammeAnim)this).SpecialAmmo < specialStartAmmo)
		{
			((TestVanDammeAnim)this).SpecialAmmo = specialStartAmmo;
		}
	}

	private void InitializeProjectiles()
	{
		ref Projectile reference = ref primaryProjectile;
		TestVanDammeAnim heroPrefab = HeroController.GetHeroPrefab((HeroType)11);
		reference = ((Unit)((heroPrefab is SnakeBroskin) ? heroPrefab : null)).projectile;
		ref Projectile reference2 = ref specialProjectile;
		TestVanDammeAnim heroPrefab2 = HeroController.GetHeroPrefab((HeroType)17);
		reference2 = ((Unit)((heroPrefab2 is Brochete) ? heroPrefab2 : null)).projectile;
		specialProjectileData = new ProjectileData
		{
			bulletCount = 0,
			maxBulletCount = 3
		};
	}

	private bool CanUseSpecial()
	{
		if (!((TestVanDammeAnim)this).hasBeenCoverInAcid && !UsingSpecial && ((BroforceObject)this).health > 0)
		{
			return ((TestVanDammeAnim)this).SpecialAmmo > 0;
		}
		return false;
	}

	private void UseSpecialAmmo()
	{
		if (((TestVanDammeAnim)this).SpecialAmmo > 0)
		{
			int num = ((TestVanDammeAnim)this).SpecialAmmo;
			((TestVanDammeAnim)this).SpecialAmmo = num - 1;
		}
	}

	protected override void UseFire()
	{
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: 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_019d: Unknown result type (might be due to invalid IL or missing references)
		if (((TestVanDammeAnim)this).doingMelee)
		{
			((TestVanDammeAnim)this).CancelMelee();
		}
		else
		{
			if (((TestVanDammeAnim)this).usingSpecial || specialActive)
			{
				return;
			}
			if ((Object)(object)((Unit)this).attachedToZipline == (Object)null)
			{
				FirePrimaryWeapon();
				return;
			}
			float num = ((Component)this).transform.localScale.x * primaryAttackRange;
			float num2 = 8f;
			float num3 = ((Component)this).transform.localScale.x * primaryAttackSpeed;
			float num4 = Random.Range(-50, 50);
			((TestVanDammeAnim)this).gunFrame = 3;
			((TestVanDammeAnim)this).SetGunSprite(((TestVanDammeAnim)this).gunFrame, 0);
			ProjectileController.SpawnProjectileLocally(primaryProjectile, (MonoBehaviour)(object)this, ((BroforceObject)this).X + num, ((BroforceObject)this).Y + num2, num3, num4 - 10f + Random.value * 60f, ((NetworkedUnit)this).playerNum).life = primaryProjectileLifetime;
			Map.DisturbWildLife(((BroforceObject)this).X, ((BroforceObject)this).Y, 60f, ((NetworkedUnit)this).playerNum);
			float num5 = ((BroforceObject)this).X + ((((Component)this).transform.localScale.x > 0f) ? 11f : (-11f));
			float num6 = ((BroforceObject)this).Y + 8.5f;
			if (((Component)this).transform.localScale.x > 0f)
			{
				num5 += muzzleFlashPrimaryOffsetXOnZiplineRight;
				num6 += muzzleFlashPrimaryOffsetYOnZiplineRight;
			}
			else
			{
				num5 += muzzleFlashPrimaryOffsetXOnZiplineLeft;
				num6 += muzzleFlashPrimaryOffsetYOnZiplineLeft;
			}
			EffectsController.CreateMuzzleFlashEffect(num5, num6, -21f, num3 * 0.15f, num4 * 0.15f, ((Component)this).transform);
			Sound.GetInstance().PlaySoundEffectAt(Tec9GunSounds, 0.7f, ((Component)this).transform.position, 1f + ((TestVanDammeAnim)this).pitchShiftAmount, true, false, false, 0f);
		}
	}

	protected override void PressSpecial()
	{
		if (((TestVanDammeAnim)this).usingSpecial || specialActive)
		{
			return;
		}
		if (((TestVanDammeAnim)this).SpecialAmmo <= 0)
		{
			HeroController.FlashSpecialAmmo(((NetworkedUnit)this).playerNum);
			return;
		}
		specialStartAmmo = ((TestVanDammeAnim)this).SpecialAmmo;
		if (CanUseSpecial())
		{
			ResetSpecialState();
			preDecrementAmmo = ((TestVanDammeAnim)this).SpecialAmmo;
			UseSpecialAmmo();
			((TestVanDammeAnim)this).usingSpecial = true;
			specialAnimationTimer = 0f;
			hasThrownProjectile = false;
			if (preDecrementAmmo > 1)
			{
				PlaySpecialSound();
			}
			if (specialStartAmmo == 1)
			{
				invulnerabilityMode = true;
				invulnerabilityTime = 7.5f;
			}
		}
	}

	protected override void AnimateSpecial()
	{
		((TestVanDammeAnim)this).frameRate = 0.0667f;
		if (wasRunning)
		{
			ResetSpecialState();
		}
		else
		{
			if (!((TestVanDammeAnim)this).usingSpecial)
			{
				return;
			}
			((TestVanDammeAnim)this).DeactivateGun();
			int num;
			int num2;
			int num3;
			int num4;
			int num5;
			if (((TestVanDammeAnim)this).wallClimbing || ((TestVanDammeAnim)this).wallDrag)
			{
				if (preDecrementAmmo > 1)
				{
					num = 15;
					num2 = 4;
					num3 = 12;
					num4 = 9;
				}
				else
				{
					num = 16;
					num2 = 17;
					num3 = 14;
					num4 = 8;
				}
				PlaySpecialSound();
				specialAnimationTimer += Time.deltaTime;
				num5 = Mathf.Clamp((int)(specialAnimationTimer / ((TestVanDammeAnim)this).frameRate), 0, num3);
				((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)((num2 + num5) * ((TestVanDammeAnim)this).spritePixelWidth), (float)(num * ((TestVanDammeAnim)this).spritePixelHeight));
				if (num5 == num4 && !hasThrownProjectile)
				{
					if (preDecrementAmmo > 1)
					{
						ThrowProjectile();
						((TestVanDammeAnim)this).avatarGunFireTime = 0.6f;
						HeroController.SetAvatarAngry(((NetworkedUnit)this).playerNum, ((TestVanDammeAnim)this).usePrimaryAvatar);
					}
					else
					{
						((Unit)this).invulnerable = true;
						((TestVanDammeAnim)this).invulnerableTime = 7.5f;
						ColorShiftController.SlowTimeEffect(invulnerabilityTime);
					}
					hasThrownProjectile = true;
				}
				if (specialAnimationTimer >= ((TestVanDammeAnim)this).frameRate * (float)num3)
				{
					ResetSpecialState();
				}
				return;
			}
			if (preDecrementAmmo == 1)
			{
				num = 9;
				num2 = 17;
				num3 = 14;
				num4 = 8;
			}
			else
			{
				if (preDecrementAmmo <= 1)
				{
					ResetSpecialState();
					return;
				}
				num = 10;
				num2 = 18;
				num3 = 13;
				num4 = 11;
			}
			num5 = Mathf.Clamp((int)(specialAnimationTimer / ((TestVanDammeAnim)this).frameRate), 0, num3);
			((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)((num2 + num5) * ((TestVanDammeAnim)this).spritePixelWidth), (float)(num * ((TestVanDammeAnim)this).spritePixelHeight));
			if (preDecrementAmmo == 1 && num5 == num4)
			{
				PlaySpecialSound(invulSounds: true);
			}
			if (num5 >= num4 && !hasThrownProjectile)
			{
				if (preDecrementAmmo > 1)
				{
					ThrowProjectile();
					((TestVanDammeAnim)this).avatarGunFireTime = 0.6f;
					HeroController.SetAvatarAngry(((NetworkedUnit)this).playerNum, ((TestVanDammeAnim)this).usePrimaryAvatar);
				}
				else if (preDecrementAmmo == 1)
				{
					((Unit)this).invulnerable = true;
					((TestVanDammeAnim)this).invulnerableTime = 7.5f;
					ColorShiftController.SlowTimeEffect(invulnerabilityTime);
				}
				hasThrownProjectile = true;
				isFinishingSpecial = true;
			}
			if (((BroforceObject)this).health <= 0)
			{
				ResetSpecialState();
				((TestVanDammeAnim)this).usingSpecial = false;
				return;
			}
			specialAnimationTimer += Time.deltaTime;
			if (specialAnimationTimer >= ((TestVanDammeAnim)this).frameRate * (float)num3)
			{
				ResetSpecialState();
				hasThrownProjectile = false;
				isFinishingSpecial = false;
			}
			if (preDecrementAmmo > 1 && num5 > num4)
			{
				((Unit)this).invulnerable = false;
			}
		}
	}

	public void PlaySpecialSound(bool invulSounds = false)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		if (!specialSoundPlayed)
		{
			if (invulSounds)
			{
				Sound.GetInstance().PlaySoundEffectAt(InvulSounds[0], 0.45f, ((Component)this).transform.position, 1f + ((TestVanDammeAnim)this).pitchShiftAmount, true, false, false, 0f);
			}
			else
			{
				int num = Random.Range(0, BootKnifeSounds.Length);
				specialAudioSource.clip = BootKnifeSounds[num];
				specialAudioSource.Stop();
				specialAudioSource.time = 0f;
				specialAudioSource.volume = 0.45f;
				specialAudioSource.pitch = 1f + ((TestVanDammeAnim)this).pitchShiftAmount;
				specialAudioSource.bypassReverbZones = true;
				specialAudioSource.rolloffMode = (AudioRolloffMode)1;
				specialAudioSource.minDistance = 550f;
				specialAudioSource.maxDistance = 600f;
				specialAudioSource.spatialBlend = 1f;
				specialAudioSource.dopplerLevel = 0f;
				specialAudioSource.Play();
			}
			specialSoundPlayed = true;
		}
	}

	public override void Damage(int damage, DamageType damageType, float xI, float yI, int direction, MonoBehaviour damageSender, float hitX, float hitY)
	{
		//IL_000a: 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_0055: Expected O, but got Unknown
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Expected O, but got Unknown
		if (!invulnerabilityMode)
		{
			((BroBase)this).Damage(damage, damageType, xI, yI, direction, damageSender, hitX, hitY);
			return;
		}
		Helicopter val = (Helicopter)(object)((damageSender is Helicopter) ? damageSender : null);
		if (Object.op_Implicit((Object)(object)val))
		{
			val.Damage(new DamageObject(((BroforceObject)val).health, (DamageType)2, 0f, 0f, ((BroforceObject)this).X, ((BroforceObject)this).Y, (MonoBehaviour)(object)this));
		}
		SawBlade val2 = (SawBlade)(object)((damageSender is SawBlade) ? damageSender : null);
		if ((Object)(object)val2 != (Object)null)
		{
			((Doodad)val2).Damage(new DamageObject(((BroforceObject)val2).health, (DamageType)2, 0f, 0f, ((BroforceObject)this).X, ((BroforceObject)this).Y, (MonoBehaviour)(object)this));
		}
		MookDog val3 = (MookDog)(object)((damageSender is MookDog) ? damageSender : null);
		if ((Object)(object)val3 != (Object)null)
		{
			((Unit)val3).Panic((int)Mathf.Sign(xI) * -1, 2f, true);
		}
		((TestVanDammeAnim)this).xIBlast = ((TestVanDammeAnim)this).xIBlast + (xI * 0.1f + (float)damage * 0.03f);
		((BroforceObject)this).yI = ((BroforceObject)this).yI + (yI * 0.1f + (float)damage * 0.03f);
	}

	private void ResetSpecialState()
	{
		specialAnimationTimer = 0f;
		((Unit)this).frame = 0;
		((TestVanDammeAnim)this).usingSpecial = false;
		specialActive = false;
		hasThrownProjectile = false;
		specialSoundPlayed = false;
	}

	protected override void SetGunPosition(float xOffset, float yOffset)
	{
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		if (specialActive)
		{
			return;
		}
		if ((Object)(object)((Unit)this).attachedToZipline != (Object)null)
		{
			if (((TestVanDammeAnim)this).right && (((Unit)this).attachedToZipline.Direction.x < 0f || ((Unit)this).attachedToZipline.IsHorizontalZipline))
			{
				((Component)((TestVanDammeAnim)this).gunSprite).transform.localPosition = new Vector3(xOffset + 2f, yOffset + 1f, -1f);
			}
			else if (((TestVanDammeAnim)this).left && (((Unit)this).attachedToZipline.Direction.x > 0f || ((Unit)this).attachedToZipline.IsHorizontalZipline))
			{
				((Component)((TestVanDammeAnim)this).gunSprite).transform.localPosition = new Vector3(xOffset - 2f, yOffset + 1f, -1f);
			}
		}
		else
		{
			((Component)((TestVanDammeAnim)this).gunSprite).transform.localPosition = new Vector3(xOffset + 0f, yOffset, -1f);
		}
	}

	private void OnInvulnerabilityEnd()
	{
		HeroController.FlashAvatar(((NetworkedUnit)this).playerNum, 0.5f, ((TestVanDammeAnim)this).usePrimaryAvatar);
		if (spriteFlashCoroutine != null)
		{
			((MonoBehaviour)this).StopCoroutine(spriteFlashCoroutine);
		}
		spriteFlashCoroutine = ((MonoBehaviour)this).StartCoroutine(FlashCharacterSpriteRoutine(0.5f, 0.1f));
	}

	private IEnumerator FlashCharacterSpriteRoutine(float totalDuration, float interval)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <FlashCharacterSpriteRoutine>d__82(0)
		{
			<>4__this = this,
			totalDuration = totalDuration,
			interval = interval
		};
	}

	private IEnumerator FlashAvatarRoutine(float totalDuration, float interval)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <FlashAvatarRoutine>d__83(0)
		{
			<>4__this = this,
			totalDuration = totalDuration,
			interval = interval
		};
	}

	protected override void FireFlashAvatar()
	{
		if (!isReversingSpecial && !isDelayingPrimaryFire)
		{
			((TestVanDammeAnim)this).FireFlashAvatar();
		}
	}

	private void ThrowProjectile()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		float x = ((Component)this).transform.position.x;
		float y = ((Component)this).transform.position.y;
		float num = 15f * ((Component)this).transform.localScale.x;
		float num2 = 0f;
		((TestVanDammeAnim)this).TriggerBroFireEvent();
		(ProjectileController.SpawnProjectileLocally(((Unit)this).projectile, (MonoBehaviour)(object)this, x, y, num, num2, ((NetworkedUnit)this).playerNum) as BootKnife).Setup();
	}

	private void FirePrimaryWeapon()
	{
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_013f: Unknown result type (might be due to invalid IL or missing references)
		if (!((TestVanDammeAnim)this).usingSpecial && !specialActive && !isDelayingPrimaryFire)
		{
			float num = ((Component)this).transform.localScale.x * primaryAttackRange;
			float num2 = 8f;
			float num3;
			float num4;
			if (((Component)this).transform.localScale.x > 0f)
			{
				num3 = 11f;
				num4 = 8.5f;
			}
			else
			{
				num3 = -11f;
				num4 = 8.5f;
			}
			float num5 = ((Component)this).transform.localScale.x * primaryAttackSpeed;
			float num6 = (invulnerabilityMode ? 130f : 50f);
			float num7 = Random.Range(0f - num6, num6);
			((TestVanDammeAnim)this).gunFrame = 3;
			((TestVanDammeAnim)this).SetGunSprite(((TestVanDammeAnim)this).gunFrame, 0);
			ProjectileController.SpawnProjectileLocally(primaryProjectile, (MonoBehaviour)(object)this, ((BroforceObject)this).X + num, ((BroforceObject)this).Y + num2, num5, num7 - 10f + Random.value * 60f, ((NetworkedUnit)this).playerNum).life = primaryProjectileLifetime;
			EffectsController.CreateMuzzleFlashEffect(((BroforceObject)this).X + num3, ((BroforceObject)this).Y + num4, -21f, num5 * 0.15f, num7 * 0.15f, ((Component)this).transform);
			Sound.GetInstance().PlaySoundEffectAt(Tec9GunSounds, 0.6f, ((Component)this).transform.position, 1f + ((TestVanDammeAnim)this).pitchShiftAmount, true, false, false, 0f);
		}
	}

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

	protected override void StartCustomMelee()
	{
		if (!((TestVanDammeAnim)this).right && !((TestVanDammeAnim)this).left && !Object.op_Implicit((Object)(object)((Unit)this).attachedToZipline) && !((TestVanDammeAnim)this).wallClimbing && !((TestVanDammeAnim)this).wallDrag && !((TestVanDammeAnim)this).jumpingMelee && (Object)(object)((TestVanDammeAnim)this).nearbyMook != (Object)null && ((Unit)((TestVanDammeAnim)this).nearbyMook).CanBeThrown())
		{
			((Unit)this).frame = 0;
			((TestVanDammeAnim)this).counter = 0f;
			((TestVanDammeAnim)this).CancelMelee();
			((TestVanDammeAnim)this).ThrowBackMook(((TestVanDammeAnim)this).nearbyMook);
			((TestVanDammeAnim)this).nearbyMook = null;
			return;
		}
		if (!Object.op_Implicit((Object)(object)((Unit)this).attachedToZipline) && ((BroBase)this).CanStartNewMelee())
		{
			((Unit)this).frame = 0;
			((TestVanDammeAnim)this).counter = ((TestVanDammeAnim)this).counter - 0.0667f;
			((TestVanDammeAnim)this).AnimateMelee();
		}
		else if (((BroBase)this).CanStartMeleeFollowUp())
		{
			((TestVanDammeAnim)this).meleeFollowUp = true;
		}
		((BroforceObject)this).xI = (((BroforceObject)this).yI = 0f);
		((BroBase)this).StartMeleeCommon();
	}

	protected override void StartMeleeCommon()
	{
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		if (!((TestVanDammeAnim)this).meleeFollowUp && ((BroBase)this).CanStartNewMelee())
		{
			((Unit)this).frame = 0;
			((TestVanDammeAnim)this).counter = ((TestVanDammeAnim)this).counter - 0.0667f;
			((BroBase)this).ResetMeleeValues();
			((BroBase)this).lerpToMeleeTargetPos = 0f;
			((TestVanDammeAnim)this).doingMelee = true;
			((TestVanDammeAnim)this).showHighFiveAfterMeleeTimer = 0f;
			((TestVanDammeAnim)this).SetMeleeType();
			((TestVanDammeAnim)this).DeactivateGun();
			((BroBase)this).meleeStartPos = ((Component)this).transform.position;
			((TestVanDammeAnim)this).AnimateMelee();
		}
	}

	protected override void RunKnifeMeleeMovement()
	{
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		if (((TestVanDammeAnim)this).wallClimbing || ((TestVanDammeAnim)this).wallDrag)
		{
			return;
		}
		if (((TestVanDammeAnim)this).dashingMelee)
		{
			if (((Unit)this).frame <= 1)
			{
				((BroforceObject)this).xI = 0f;
				((BroforceObject)this).yI = 0f;
			}
			else if (((Unit)this).frame <= 3)
			{
				if (!((TestVanDammeAnim)this).isInQuicksand)
				{
					((BroforceObject)this).xI = ((TestVanDammeAnim)this).speed * 1f * ((Component)this).transform.localScale.x;
				}
			}
			else
			{
				((TestVanDammeAnim)this).ApplyFallingGravity();
			}
		}
		else if (((BroforceObject)this).xI != 0f || ((BroforceObject)this).yI != 0f)
		{
			((TestVanDammeAnim)this).CancelMelee();
		}
	}

	protected override void SetMeleeType()
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Invalid comparison between Unknown and I4
		if (!((TestVanDammeAnim)this).useNewKnifingFrames)
		{
			((TestVanDammeAnim)this).standingMelee = true;
			((TestVanDammeAnim)this).jumpingMelee = false;
			((TestVanDammeAnim)this).dashingMelee = false;
			wallMelee = false;
		}
		else if ((int)((Unit)this).actionState == 3 || ((BroforceObject)this).Y > ((TestVanDammeAnim)this).groundHeight + 1f)
		{
			((TestVanDammeAnim)this).standingMelee = false;
			((TestVanDammeAnim)this).jumpingMelee = true;
			((TestVanDammeAnim)this).dashingMelee = false;
			wallMelee = false;
		}
		else if (((TestVanDammeAnim)this).wallClimbing || ((TestVanDammeAnim)this).wallDrag)
		{
			((TestVanDammeAnim)this).standingMelee = false;
			((TestVanDammeAnim)this).jumpingMelee = false;
			((TestVanDammeAnim)this).dashingMelee = false;
			wallMelee = true;
		}
		else if (((TestVanDammeAnim)this).right || ((TestVanDammeAnim)this).left)
		{
			((TestVanDammeAnim)this).standingMelee = false;
			((TestVanDammeAnim)this).jumpingMelee = false;
			((TestVanDammeAnim)this).dashingMelee = true;
			wallMelee = false;
		}
		else
		{
			((TestVanDammeAnim)this).standingMelee = true;
			((TestVanDammeAnim)this).jumpingMelee = false;
			((TestVanDammeAnim)this).dashingMelee = false;
			wallMelee = false;
		}
	}

	protected override void AnimateMelee()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Invalid comparison between Unknown and I4
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_032d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0470: Unknown result type (might be due to invalid IL or missing references)
		((TestVanDammeAnim)this).SetMeleeType();
		if ((int)((Unit)this).actionState == 3 || ((BroforceObject)this).Y > ((TestVanDammeAnim)this).groundHeight + 1f)
		{
			if (!soundPlayed)
			{
				if (questionPool.Count == 0)
				{
					RefillQuestionPool();
				}
				int index = Random.Range(0, questionPool.Count);
				int num = questionPool[index];
				questionPool.RemoveAt(index);
				AudioClip val = Questions[num];
				if ((Object)(object)val != (Object)null)
				{
					AudioSource obj = Sound.GetInstance().PlaySoundEffectAt(val, 0.25f, ((Component)this).transform.position, 1f + ((TestVanDammeAnim)this).pitchShiftAmount, true, false, false, 0f);
					obj.rolloffMode = (AudioRolloffMode)1;
					obj.minDistance = 550f;
					obj.maxDistance = 600f;
					obj.spatialBlend = 1f;
					obj.dopplerLevel = 0f;
				}
				soundPlayed = true;
			}
			((Unit)this).frame = 0;
			((TestVanDammeAnim)this).CancelMelee();
			return;
		}
		if (!((TestVanDammeAnim)this).dashingMelee && ((TestVanDammeAnim)this).standingMelee && ((Unit)this).frame == 2 && (Object)(object)((TestVanDammeAnim)this).nearbyMook != (Object)null && ((Unit)((TestVanDammeAnim)this).nearbyMook).CanBeThrown())
		{
			((TestVanDammeAnim)this).ThrowBackMook(((TestVanDammeAnim)this).nearbyMook);
			((TestVanDammeAnim)this).nearbyMook = null;
			((Unit)this).frame = 0;
			((TestVanDammeAnim)this).counter = 0f;
			((TestVanDammeAnim)this).CancelMelee();
			return;
		}
		((BroforceObject)this).xI = (((BroforceObject)this).yI = 0f);
		((TestVanDammeAnim)this).frameRate = (((TestVanDammeAnim)this).dashingMelee ? 0.0769f : 0.0667f);
		((TestVanDammeAnim)this).counter = ((TestVanDammeAnim)this).counter + Time.deltaTime;
		if (((TestVanDammeAnim)this).counter >= ((TestVanDammeAnim)this).frameRate)
		{
			int frame = ((Unit)this).frame;
			((Unit)this).frame = frame + 1;
			((TestVanDammeAnim)this).counter = 0f;
		}
		if (((TestVanDammeAnim)this).dashingMelee)
		{
			if (((Unit)this).frame == 3 && !((TestVanDammeAnim)this).meleeHasHit)
			{
				((BroBase)this).PerformKnifeMeleeAttack(true, true);
				((TestVanDammeAnim)this).meleeHasHit = true;
			}
			int num2 = 6;
			int num3 = 17;
			int num4 = 7;
			int num5 = Mathf.Clamp(((Unit)this).frame, 0, num4);
			((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)((num3 + num5) * ((TestVanDammeAnim)this).spritePixelWidth), (float)(num2 * ((TestVanDammeAnim)this).spritePixelHeight));
			((TestVanDammeAnim)this).avatarGunFireTime = 0.2f;
			HeroController.SetAvatarAngry(((NetworkedUnit)this).playerNum, ((TestVanDammeAnim)this).usePrimaryAvatar);
			if (((Unit)this).frame >= num4)
			{
				((Unit)this).frame = 0;
				((TestVanDammeAnim)this).CancelMelee();
			}
			return;
		}
		if (((TestVanDammeAnim)this).wallClimbing || ((TestVanDammeAnim)this).wallDrag)
		{
			int num6 = 14;
			int num7 = 7;
			int num8 = 8;
			int num9 = Mathf.Clamp(((Unit)this).frame, 0, num8);
			((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)((num7 + num9) * ((TestVanDammeAnim)this).spritePixelWidth), (float)(num6 * ((TestVanDammeAnim)this).spritePixelHeight));
			if (((Unit)this).frame == 3 && !soundPlayed)
			{
				if (questionPool.Count == 0)
				{
					RefillQuestionPool();
				}
				int index2 = Random.Range(0, questionPool.Count);
				int num10 = questionPool[index2];
				questionPool.RemoveAt(index2);
				AudioClip val2 = Questions[num10];
				if ((Object)(object)val2 != (Object)null)
				{
					AudioSource obj2 = Sound.GetInstance().PlaySoundEffectAt(val2, 0.25f, ((Component)this).transform.position, 1f + ((TestVanDammeAnim)this).pitchShiftAmount, true, false, false, 0f);
					obj2.rolloffMode = (AudioRolloffMode)1;
					obj2.minDistance = 550f;
					obj2.maxDistance = 600f;
					obj2.spatialBlend = 1f;
					obj2.dopplerLevel = 0f;
				}
				soundPlayed = true;
			}
			if (((Unit)this).frame >= num8)
			{
				((Unit)this).frame = 0;
				((TestVanDammeAnim)this).CancelMelee();
			}
			return;
		}
		int num11 = 1;
		int num12 = 23;
		int num13 = 8;
		int num14 = Mathf.Clamp(((Unit)this).frame, 0, num13);
		((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)((num12 + num14) * ((TestVanDammeAnim)this).spritePixelWidth), (float)(num11 * ((TestVanDammeAnim)this).spritePixelHeight));
		if (!((TestVanDammeAnim)this).dashingMelee && ((TestVanDammeAnim)this).standingMelee && ((Unit)this).frame == 3 && !soundPlayed)
		{
			if (questionPool.Count == 0)
			{
				RefillQuestionPool();
			}
			int index3 = Random.Range(0, questionPool.Count);
			int num15 = questionPool[index3];
			questionPool.RemoveAt(index3);
			AudioClip val3 = Questions[num15];
			if ((Object)(object)val3 != (Object)null)
			{
				AudioSource obj3 = Sound.GetInstance().PlaySoundEffectAt(val3, 0.25f, ((Component)this).transform.position, 1f + ((TestVanDammeAnim)this).pitchShiftAmount, true, false, false, 0f);
				obj3.rolloffMode = (AudioRolloffMode)1;
				obj3.minDistance = 550f;
				obj3.maxDistance = 600f;
				obj3.spatialBlend = 1f;
				obj3.dopplerLevel = 0f;
			}
			soundPlayed = true;
		}
		if (((Unit)this).frame >= num13)
		{
			((Unit)this).frame = 0;
			((TestVanDammeAnim)this).CancelMelee();
		}
	}

	protected override void CancelMelee()
	{
		((BroBase)this).CancelMelee();
		soundPlayed = false;
		((TestVanDammeAnim)this).meleeHasHit = false;
		wallMelee = false;
	}

	protected override bool MustIgnoreHighFiveMeleePress()
	{
		if (!((Object)(object)((TestVanDammeAnim)this).heldGrenade != (Object)null) && !((Object)(object)((TestVanDammeAnim)this).heldMook != (Object)null) && !((TestVanDammeAnim)this).usingSpecial && !Object.op_Implicit((Object)(object)((Unit)this).attachedToZipline))
		{
			return ((TestVanDammeAnim)this).doingMelee;
		}
		return true;
	}

	protected override void PerformKnifeMeleeAttack(bool shouldTryHitTerrain, bool playMissSound)
	{
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: 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)
		bool flag = default(bool);
		Map.DamageDoodads(3, (DamageType)14, ((BroforceObject)this).X + (float)(((NetworkedUnit)this).Direction * 4), ((BroforceObject)this).Y, 0f, 0f, 6f, ((NetworkedUnit)this).playerNum, ref flag, (MonoBehaviour)null);
		((BroBase)this).KickDoors(24f);
		AudioClip val = ((!((Object)(object)((TestVanDammeAnim)this).gunSprite.meshRender.material == (Object)(object)normalGunMaterial)) ? DashingMeleeSounds[1] : DashingMeleeSounds[0]);
		if (Object.op_Implicit((Object)(object)Map.HitClosestUnit((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, 4, (DamageType)14, 14f, 24f, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 8f, ((BroforceObject)this).Y + 8f, ((Component)this).transform.localScale.x * 200f, 500f, true, false, ((NetworkObject)this).IsMine, false, true)))
		{
			if ((Object)(object)val != (Object)null)
			{
				((TestVanDammeAnim)this).sound.PlaySoundEffectAt(val, 0.7f, ((Component)this).transform.position, 1f, true, false, false, 0f);
			}
			((TestVanDammeAnim)this).meleeHasHit = true;
		}
		else if (playMissSound)
		{
			((TestVanDammeAnim)this).sound.PlaySoundEffectAt(((TestVanDammeAnim)this).soundHolder.missSounds, 0.7f, ((Component)this).transform.position, 1f, true, false, false, 0f);
		}
		((TestVanDammeAnim)this).meleeChosenUnit = null;
		if (shouldTryHitTerrain && ((BroBase)this).TryMeleeTerrain(0, 2))
		{
			((TestVanDammeAnim)this).meleeHasHit = true;
		}
	}

	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_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_017c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
		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)(16 + offset), LayerMask.op_Implicit(((TestVanDammeAnim)this).groundLayer)))
		{
			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;
			}
			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 ((int)((BroBase)this).currentMeleeType == 0)
			{
				((TestVanDammeAnim)this).sound.PlaySoundEffectAt(((TestVanDammeAnim)this).soundHolder.alternateMeleeHitSound, 0.3f, ((Component)this).transform.position, 1f, true, false, false, 0f);
			}
			else
			{
				((TestVanDammeAnim)this).sound.PlaySoundEffectAt(((TestVanDammeAnim)this).soundHolder.alternateMeleeHitSound, 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;
		}
		return false;
	}

	protected override void OnDestroy()
	{
		((BroBase)this).OnDestroy();
	}
}
internal class BootKnife : Projectile
{
	public static Material storedMat;

	private SpriteSM storedSprite;

	public bool hitDeadUnits = true;

	protected float waistHeight = 10f;

	public bool penetrateWalls;

	public int maxPenetrations = 19;

	public int maxWallPenetrations = 14;

	protected int penetrateCount;

	private int wallPenetrateCount;

	private bool hasHitWithWall;

	private bool attackHasHit;

	protected override void Awake()
	{
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		((Projectile)this).Awake();
		Rigidbody component = ((Component)this).GetComponent<Rigidbody>();
		if ((Object)(object)component != (Object)null)
		{
			component.collisionDetectionMode = (CollisionDetectionMode)1;
		}
		MeshRenderer component2 = ((Component)this).gameObject.GetComponent<MeshRenderer>();
		if ((Object)(object)storedMat == (Object)null)
		{
			storedMat = ResourcesController.GetMaterial(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "BootKnife.png");
		}
		((Renderer)component2).material = storedMat;
		SpriteSM component3 = ((Component)this).gameObject.GetComponent<SpriteSM>();
		component3.lowerLeftPixel = new Vector2(0f, 16f);
		component3.pixelDimensions = new Vector2(34f, 16f);
		((SpriteBase)component3).plane = (SPRITE_PLANE)0;
		((SpriteBase)component3).width = 23f;
		((SpriteBase)component3).height = 11f;
		((SpriteBase)component3).offset = Vector3.zero;
		storedSprite = component3;
		base.damageType = (DamageType)3;
		base.damage = 8;
		base.damageInternal = base.damage;
		base.fullDamage = base.damage;
		base.life = 9f;
	}

	protected override void Update()
	{
		DeflectEnemyProjectiles();
		base.life -= Time.deltaTime;
		if (base.life <= 0f)
		{
			((Projectile)this).DeregisterProjectile();
			Object.Destroy((Object)(object)((Component)this).gameObject);
			return;
		}
		SetPosition(((BroforceObject)this).X + ((BroforceObject)this).xI * Time.deltaTime, ((BroforceObject)this).Y + ((BroforceObject)this).yI * Time.deltaTime);
		((Projectile)this).HitUnits();
		Map.DisturbWildLife(((BroforceObject)this).X, ((BroforceObject)this).Y, 60f, base.playerNum);
		Map.HurtWildLife(((BroforceObject)this).X, ((BroforceObject)this).Y, base.projectileSize / 2f);
		Map.ShakeTrees(((BroforceObject)this).X, ((BroforceObject)this).Y, 24f, 20f, 60f);
		Map.DisturbAlienEggs(((BroforceObject)this).X, ((BroforceObject)this).Y, base.playerNum);
		Map.JiggleDoodads(((BroforceObject)this).X, ((BroforceObject)this).Y, 24f, 16f, 60f);
		float num = 0f;
		float num2 = 0f;
		Map.HitGrenades(base.playerNum, 12f, ((BroforceObject)this).X, ((BroforceObject)this).Y, ((BroforceObject)this).xI, ((BroforceObject)this).yI, ref num, ref num2);
	}

	public override void Fire(float newX, float newY, float xI, float yI, float _zOffset, int playerNum, MonoBehaviour FiredBy)
	{
		float num = 19f * Mathf.Sign(xI);
		newX += num;
		newY += 13f;
		xI *= 22f;
		((Projectile)this).Fire(newX, newY, xI, yI, _zOffset, playerNum, FiredBy);
	}

	private void SetPosition(float newX, float newY)
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		((BroforceObject)this).X = newX;
		((BroforceObject)this).Y = newY;
		((Component)this).transform.position = new Vector3(((BroforceObject)this).X, ((BroforceObject)this).Y, ((Component)this).transform.position.z);
	}

	protected void DeflectEnemyProjectiles()
	{
		float num = 16f;
		float num2 = ((BroforceObject)this).X + Mathf.Sign(((BroforceObject)this).xI) * 6f;
		float num3 = ((BroforceObject)this).Y + 6f;
		float num4 = Mathf.Sign(((BroforceObject)this).xI) * 200f;
		bool flag = true;
		if (Map.DeflectProjectiles((MonoBehaviour)(object)this, base.playerNum, num, num2, num3, num4, flag))
		{
			hasHitWithWall = true;
		}
	}

	protected override void HitUnits()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Expected O, but got Unknown
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Expected O, but got Unknown
		//IL_017c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0187: Unknown result type (might be due to invalid IL or missing references)
		float x = ((BroforceObject)this).X;
		float y = ((BroforceObject)this).Y;
		Vector3 val = ((((BroforceObject)this).xI > 0f) ? Vector3.right : Vector3.left);
		float num = Mathf.Abs(((BroforceObject)this).xI * Time.deltaTime + base.projectileSize);
		if (Physics.Raycast(new Vector3(x, y, 0f), val, ref base.raycastHit, num, (1 << LayerMask.NameToLayer("Ground")) | (1 << LayerMask.NameToLayer("IndestructibleGround")) | (1 << LayerMask.NameToLayer("Parachute")) | (1 << LayerMask.NameToLayer("LargeObjects"))))
		{
			MapController.DamageGround((MonoBehaviour)(object)this, 2, (DamageType)8, 10f, ((RaycastHit)(ref base.raycastHit)).point.x, ((RaycastHit)(ref base.raycastHit)).point.y, (Collider[])null, true);
			penetrateCount++;
			if (penetrateCount >= maxPenetrations)
			{
				((Projectile)this).DeregisterProjectile();
				Object.Destroy((Object)(object)((Component)this).gameObject);
				return;
			}
			if (((Component)((RaycastHit)(ref base.raycastHit)).collider).gameObject.layer == 30)
			{
				((Component)((RaycastHit)(ref base.raycastHit)).collider).gameObject.SendMessage("Damage", (object)new DamageObject(60, (DamageType)3, ((BroforceObject)this).xI, ((BroforceObject)this).yI, ((RaycastHit)(ref base.raycastHit)).point.x, ((RaycastHit)(ref base.raycastHit)).point.y, (MonoBehaviour)(object)this));
				((Projectile)this).MakeEffects(true, ((BroforceObject)this).X, ((BroforceObject)this).Y, false, ((RaycastHit)(ref base.raycastHit)).normal, ((RaycastHit)(ref base.raycastHit)).point);
				((Projectile)this).DeregisterProjectile();
				Object.Destroy((Object)(object)((Component)this).gameObject);
				return;
			}
			((Component)((RaycastHit)(ref base.raycastHit)).collider).gameObject.SendMessage("Damage", (object)new DamageObject(2, (DamageType)8, ((BroforceObject)this).xI, ((BroforceObject)this).yI, ((RaycastHit)(ref base.raycastHit)).point.x, ((RaycastHit)(ref base.raycastHit)).point.y, (MonoBehaviour)(object)this));
		}
		if (Map.HitLivingUnits((MonoBehaviour)(object)this, base.playerNum, base.damageInternal, base.damageType, base.projectileSize, base.projectileSize / 2f, x, y, ((BroforceObject)this).xI, ((BroforceObject)this).yI, true, true, true, true))
		{
			penetrateCount++;
			if (penetrateCount >= maxPenetrations)
			{
				((Projectile)this).DeregisterProjectile();
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
			return;
		}
		JackBroton jackBroton = base.firedBy as JackBroton;
		bool hitImpenetrableDoodad;
		if ((Object)(object)jackBroton != (Object)null && jackBroton.hitDeadUnits && Map.HitDeadUnits((MonoBehaviour)(object)this, 2, (DamageType)8, base.projectileSize, x, y, ((BroforceObject)this).xI, ((BroforceObject)this).yI, false, true))
		{
			penetrateCount++;
			if (penetrateCount >= maxPenetrations)
			{
				((Projectile)this).DeregisterProjectile();
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
		else if (DamageDoodads(base.damage, base.damageType, x, y, ((BroforceObject)this).xI, ((BroforceObject)this).yI, 5f, base.playerNum, out hitImpenetrableDoodad) && hitImpenetrableDoodad)
		{
			((Projectile)this).DeregisterProjectile();
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	protected override void TryHitUnitsAtSpawn()
	{
		//IL_0024: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
		if (hitDeadUnits)
		{
			((Projectile)this).TryHitUnitsAtSpawn();
		}
		else if (Map.HitLivingUnits(base.firedBy, base.playerNum, base.damageInternal * 2, base.damageType, (base.playerNum < 0) ? 0f : (base.projectileSize * 0.5f), ((BroforceObject)this).X - ((base.playerNum < 0) ? 0f : (base.projectileSize * 0.5f)) * (float)(int)Mathf.Sign(((BroforceObject)this).xI), ((BroforceObject)this).Y, ((BroforceObject)this).xI, ((BroforceObject)this).yI, false, false, true, false))
		{
			((Projectile)this).MakeEffects(false, ((BroforceObject)this).X, ((BroforceObject)this).Y, false, ((RaycastHit)(ref base.raycastHit)).normal, ((RaycastHit)(ref base.raycastHit)).point);
			Object.Destroy((Object)(object)((Component)this).gameObject);
			base.hasHit = true;
		}
	}

	protected void KickDoors(float range)
	{
		//IL_0011: 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_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		if (Physics.Raycast(new Vector3(((BroforceObject)this).X - 6f * ((Component)this).transform.localScale.x, ((BroforceObject)this).Y + waistHeight, 0f), new Vector3(((Component)this).transform.localScale.x, 1f, 1f), ref base.raycastHit, 6f + range, LayerMask.op_Implicit(base.fragileLayer)) && (Object)(object)((Component)((RaycastHit)(ref base.raycastHit)).collider).gameObject.GetComponent<Parachute>() == (Object)null)
		{
			((Component)((RaycastHit)(ref base.raycastHit)).collider).gameObject.SendMessage("Open", (object)(int)((Component)this).transform.localScale.x);
			MapController.Damage_Networked((MonoBehaviour)(object)this, ((Component)((RaycastHit)(ref base.raycastHit)).collider).gameObject, 1, (DamageType)4, ((Component)this).transform.localScale.x * 500f, 50f, ((BroforceObject)this).X, ((BroforceObject)this).Y);
		}
	}

	protected override void Bounce(RaycastHit raycastHit)
	{
		//IL_0004: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: 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_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		((Projectile)this).MakeEffects(true, ((RaycastHit)(ref raycastHit)).point.x + ((RaycastHit)(ref raycastHit)).normal.x * 3f, ((RaycastHit)(ref raycastHit)).point.y + ((RaycastHit)(ref raycastHit)).normal.y * 3f, true, ((RaycastHit)(ref raycastHit)).normal, ((RaycastHit)(ref raycastHit)).point);
		((Projectile)this).ProjectileApplyDamageToBlock(((Component)((RaycastHit)(ref raycastHit)).collider).gameObject, base.damageInternal, base.damageType, ((BroforceObject)this).xI, ((BroforceObject)this).yI);
		if (penetrateWalls && wallPenetrateCount < maxWallPenetrations)
		{
			wallPenetrateCount++;
			return;
		}
		((Projectile)this).DeregisterProjectile();
		Object.Destroy((Object)(object)((Component)this).gameObject);
	}

	protected override void HitProjectiles()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		if (Map.HitProjectiles(base.playerNum, base.damageInternal, base.damageType, base.projectileSize, ((BroforceObject)this).X, ((BroforceObject)this).Y, ((BroforceObject)this).xI, ((BroforceObject)this).yI, 0.1f))
		{
			((Projectile)this).MakeEffects(false, ((BroforceObject)this).X, ((BroforceObject)this).Y, false, ((RaycastHit)(ref base.raycastHit)).normal, ((RaycastHit)(ref base.raycastHit)).point);
		}
	}

	public static bool DamageStaticDoodads(float x, float y, float xI, float yI, float range, MonoBehaviour sender = null)
	{
		bool result = false;
		for (int num = Map.staticDoodads.Count - 1; num >= 0; num--)
		{
			Doodad val = Map.staticDoodads[num];
			if (!((Object)(object)val == (Object)null) && val.IsPointInRange(x, y, range))
			{
				result = true;
				val.Collapse();
			}
		}
		return result;
	}

	public static bool DamageDoodads(int damage, DamageType damageType, float x, float y, float xI, float yI, float range, int playerNum, out bool hitImpenetrableDoodad, MonoBehaviour sender = null)
	{
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Expected O, but got Unknown
		hitImpenetrableDoodad = false;
		bool result = false;
		for (int num = Map.destroyableDoodads.Count - 1; num >= 0; num--)
		{
			Doodad val = Map.destroyableDoodads[num];
			if (!((Object)(object)val == (Object)null) && (playerNum >= 0 || val.CanBeDamagedByMooks) && (playerNum < 0 || !val.immuneToHeroDamage) && val.IsPointInRange(x, y, range))
			{
				bool flag = false;
				val.DamageOptional(new DamageObject(damage, damageType, xI, yI, x, y, sender), ref flag);
				if (flag)
				{
					result = true;
					if (val.isImpenetrable)
					{
						hitImpenetrableDoodad = true;
					}
				}
			}
		}
		return result;
	}

	public static void DamageBlock(MonoBehaviour damageSender, Block b, int damage, DamageType damageType, float forceX, float forceY)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		MapController.Damage_Networked(damageSender, ((Component)b).gameObject, damage, damageType, forceX, forceY, ((BroforceObject)b).X, ((BroforceObject)b).Y);
	}

	protected override bool CheckWallsAtSpawnPoint()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		Collider[] array = Physics.OverlapSphere(new Vector3(((BroforceObject)this).X, ((BroforceObject)this).Y, 0f), 5f, LayerMask.op_Implicit(base.groundLayer));
		bool flag = false;
		if (array.Length != 0)
		{
			for (int i = 0; i < array.Length; i++)
			{
				Collider val = null;
				if ((Object)(object)base.firedBy != (Object)null)
				{
					val = ((Component)base.firedBy).GetComponent<Collider>();
				}
				if ((Object)(object)base.firedBy == (Object)null || (Object)(object)array[i] != (Object)(object)val)
				{
					((Projectile)this).ProjectileApplyDamageToBlock(((Component)array[i]).gameObject, base.damageInternal, base.damageType, ((BroforceObject)this).xI, ((BroforceObject)this).yI);
					flag = true;
				}
			}
			if (flag)
			{
				((Projectile)this).MakeEffects(false, ((BroforceObject)this).X, ((BroforceObject)this).Y, false, ((RaycastHit)(ref base.raycastHit)).normal, ((RaycastHit)(ref base.raycastHit)).point);
				base.hasHit = true;
			}
		}
		return flag;
	}

	protected override void CheckSpawnPoint()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: 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_0166: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0211: Unknown result type (might be due to invalid IL or missing references)
		//IL_0227: Unknown result type (might be due to invalid IL or missing references)
		//IL_0247: Unknown result type (might be due to invalid IL or missing references)
		//IL_0268: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
		bool num = ((Projectile)this).CheckWallsAtSpawnPoint();
		Debug.DrawRay(new Vector3(((BroforceObject)this).X, ((BroforceObject)this).Y, 0f), Random.onUnitSphere * 5f, Color.cyan, 10f);
		bool flag = default(bool);
		Map.DamageDoodads(base.damageInternal, base.damageType, ((BroforceObject)this).X, ((BroforceObject)this).Y, ((BroforceObject)this).xI, ((BroforceObject)this).yI, base.projectileSize, base.playerNum, ref flag, (MonoBehaviour)(object)this);
		if (!num)
		{
			((Projectile)this).RegisterProjectile();
		}
		((Projectile)this).CheckReturnZones();
		if ((base.canReflect && base.playerNum >= 0 && base.horizontalProjectile && Physics.Raycast(new Vector3(((BroforceObject)this).X - Mathf.Sign(((BroforceObject)this).xI) * base.projectileSize * 2f, ((BroforceObject)this).Y, 0f), new Vector3(((BroforceObject)this).xI, ((BroforceObject)this).yI, 0f), ref base.raycastHit, base.projectileSize * 3f, LayerMask.op_Implicit(base.barrierLayer))) || (!base.horizontalProjectile && Physics.Raycast(new Vector3(((BroforceObject)this).X, ((BroforceObject)this).Y, 0f), new Vector3(((BroforceObject)this).xI, ((BroforceObject)this).yI, 0f), ref base.raycastHit, base.projectileSize + base.startProjectileSpeed * base.t, LayerMask.op_Implicit(base.barrierLayer))))
		{
			((Projectile)this).ReflectProjectile(base.raycastHit);
		}
		else if ((base.canReflect && base.playerNum < 0 && base.horizontalProjectile && Physics.Raycast(new Vector3(((BroforceObject)this).X - Mathf.Sign(((BroforceObject)this).xI) * base.projectileSize * 2f, ((BroforceObject)this).Y, 0f), new Vector3(((BroforceObject)this).xI, ((BroforceObject)this).yI, 0f), ref base.raycastHit, base.projectileSize * 3f, LayerMask.op_Implicit(base.friendlyBarrierLayer))) || (!base.horizontalProjectile && Physics.Raycast(new Vector3(((BroforceObject)this).X, ((BroforceObject)this).Y, 0f), new Vector3(((BroforceObject)this).xI, ((BroforceObject)this).yI, 0f), ref base.raycastHit, base.projectileSize + base.startProjectileSpeed * base.t, LayerMask.op_Implicit(base.friendlyBarrierLayer))))
		{
			base.playerNum = 5;
			base.firedBy = null;
			((Projectile)this).ReflectProjectile(base.raycastHit);
		}
		else
		{
			((Projectile)this).TryHitUnitsAtSpawn();
		}
		((Projectile)this).CheckSpawnPointFragile();
	}

	public void Setup()
	{
		((Behaviour)this).enabled = true;
	}
}