Decompiled source of Captain Ameribro v1.1.0

UMM/BroMaker_Storage/Captain Ameribro/Captain Ameribro.dll

Decompiled 2 weeks ago
using System;
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 BroMakerLib.CustomObjects.Projectiles;
using RocketLib.CustomTriggers;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("Bromaker - Captain Ameribro Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Bromaker - Captain Ameribro Mod")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("ad2d94ac-3409-4923-8ee7-e200c9395628")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Captain_Ameribro;

[HeroPreset(/*Could not decode attribute arguments.*/)]
internal class CaptainAmeribro : SwordHero
{
	public Material materialNormal;

	public Material materialNormalShield;

	public Material materialNormalNoShield;

	public Material materialArmless;

	public Material gunMaterialNormal;

	public Material gunMaterialNoShield;

	protected bool wasInvulnerable;

	public AudioClip shieldChargeShing;

	public AudioClip[] shieldMeleeSwing;

	public AudioClip[] shieldMeleeHit;

	public AudioClip[] shieldMeleeTerrain;

	public AudioClip airDashSound;

	public AudioClip[] effortSounds;

	public AudioClip[] ricochetSounds;

	public AudioClip[] pistolSounds;

	public int currentMeleeSound;

	public float sliceVolume = 0.7f;

	public float wallHitVolume = 0.6f;

	protected Shield shield;

	protected Shield thrownShield;

	public const float shieldSpeed = 400f;

	protected bool grabbingShield;

	protected int grabbingFrame;

	protected int specialFrame;

	protected float specialFrameRate = 0.0334f;

	protected float specialFrameCounter;

	protected bool animateSpecial;

	protected float specialAttackDashCounter;

	protected bool isHoldingSpecial;

	protected float maxSpecialCharge = 1f;

	public float currentSpecialCharge;

	public bool playedShingNoise;

	public bool finishedStartup;

	public bool caughtShieldFromPrevious;

	protected int punchingIndex;

	protected const int normalAttackDamage = 7;

	protected bool heldGunFrame;

	protected const int meleeAttackDamage = 8;

	public float specialAttackDashTime;

	protected float airdashFadeCounter;

	public float airdashFadeRate = 0.1f;

	protected bool usingShieldMelee;

	protected Projectile pistolBullet;

	protected float airDashCooldown;

	protected bool alreadySpawnedBullet;

	protected bool chargedAirDash;

	protected List<Unit> currentlyHitting;

	protected const int defaultSpeed = 130;

	protected bool acceptedDeath;

	protected InvulnerabilityFlash invulnerabilityFlash;

	public override int SpecialAmmo
	{
		get
		{
			return ((BroBase)this).SpecialAmmo;
		}
		set
		{
			if (((TestVanDammeAnim)this)._specialAmmo != value)
			{
				if (value > 0)
				{
					SwitchToWithShieldMats();
				}
				else
				{
					SwitchToNoShieldMats();
				}
			}
			((BroBase)this).SpecialAmmo = value;
		}
	}

	protected override void Awake()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		shield = CustomProjectile.CreatePrefab<Shield>(new List<Type> { typeof(SphereCollider) });
		((BroBase)this).currentMeleeType = (MeleeType)2;
		((BroBase)this).meleeType = (MeleeType)2;
		ref Projectile reference = ref pistolBullet;
		TestVanDammeAnim heroPrefab = HeroController.GetHeroPrefab((HeroType)33);
		reference = ((Unit)((heroPrefab is DoubleBroSeven) ? heroPrefab : null)).projectile;
		((SwordHero)this).Awake();
	}

	public override void PreloadAssets()
	{
		CustomHero.PreloadSprites(((CustomHero)this).DirectoryPath, new List<string> { "captainAmeribroArmless.png", "captainAmeribroGunNoShield.png", "captainAmeribroMainNoShield.png" });
		CustomHero.PreloadSprites(((CustomHero)this).ProjectilePath, new List<string> { "Shield.png" });
		CustomHero.PreloadSounds(((CustomHero)this).SoundPath, new List<string>
		{
			"grunt1.wav", "grunt2.wav", "grunt3.wav", "grunt4.wav", "grunt5.wav", "melee1part1.wav", "melee1part2.wav", "melee3part1.wav", "melee3part2.wav", "meleeterrainhit1.wav",
			"meleeterrainhit2.wav", "pistol1.wav", "pistol2.wav", "pistol3.wav", "pistol4.wav", "ricochet1.wav", "ricochet2.wav", "ricochet3.wav", "ricochet4.wav", "ShieldShing.wav",
			"special1.wav", "special2.wav", "special3.wav", "swish.wav"
		});
	}

	public override void BeforePrefabSetup()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		((CustomHero)this).SoundHolderVoiceType = (SoundHolderVoiceTypes)1;
	}

	public override void AfterPrefabSetup()
	{
		shieldChargeShing = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "ShieldShing.wav");
		shieldMeleeSwing = (AudioClip[])(object)new AudioClip[2];
		shieldMeleeSwing[0] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "melee1part1.wav");
		shieldMeleeSwing[1] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "melee3part1.wav");
		shieldMeleeHit = (AudioClip[])(object)new AudioClip[2];
		shieldMeleeHit[0] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "melee1part2.wav");
		shieldMeleeHit[1] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "melee3part2.wav");
		shieldMeleeTerrain = (AudioClip[])(object)new AudioClip[2];
		shieldMeleeTerrain[0] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "meleeterrainhit1.wav");
		shieldMeleeTerrain[1] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "meleeterrainhit2.wav");
		airDashSound = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "swish.wav");
		effortSounds = (AudioClip[])(object)new AudioClip[5];
		effortSounds[0] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "grunt1.wav");
		effortSounds[1] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "grunt2.wav");
		effortSounds[2] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "grunt3.wav");
		effortSounds[3] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "grunt4.wav");
		effortSounds[4] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "grunt5.wav");
		ricochetSounds = (AudioClip[])(object)new AudioClip[4];
		ricochetSounds[0] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "ricochet1.wav");
		ricochetSounds[1] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "ricochet2.wav");
		ricochetSounds[2] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "ricochet3.wav");
		ricochetSounds[3] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "ricochet4.wav");
		pistolSounds = (AudioClip[])(object)new AudioClip[4];
		pistolSounds[0] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "pistol1.wav");
		pistolSounds[1] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "pistol2.wav");
		pistolSounds[2] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "pistol3.wav");
		pistolSounds[3] = ResourcesController.GetAudioClip(((CustomHero)this).SoundPath, "pistol4.wav");
	}

	public override void RegisterCustomTriggers()
	{
		CustomTriggerManager.RegisterCustomTrigger(typeof(CaptainAmeribroAction), typeof(CaptainAmeribroActionInfo), "Captain Ameribro - Spawn Shield", "Custom Bros", 0);
	}

	protected override void Start()
	{
		((CustomHero)this).Start();
		materialNormal = ((TestVanDammeAnim)this).material;
		materialNormalShield = materialNormal;
		materialNormalNoShield = ResourcesController.GetMaterial(((CustomHero)this).DirectoryPath, "captainAmeribroMainNoShield.png");
		materialArmless = ResourcesController.GetMaterial(((CustomHero)this).DirectoryPath, "captainAmeribroArmless.png");
		gunMaterialNormal = ((TestVanDammeAnim)this).gunMaterial;
		gunMaterialNoShield = ResourcesController.GetMaterial(((CustomHero)this).DirectoryPath, "captainAmeribroGunNoShield.png");
		finishedStartup = true;
		if (caughtShieldFromPrevious)
		{
			caughtShieldFromPrevious = false;
			int specialAmmo = ((TestVanDammeAnim)this).SpecialAmmo + 1;
			((TestVanDammeAnim)this).SpecialAmmo = specialAmmo;
		}
		if (CustomTriggerStateManager.Get<bool>("Captain Ameribro Grant Shield", false) && ((TestVanDammeAnim)this).SpecialAmmo == 0)
		{
			((TestVanDammeAnim)this).SpecialAmmo = 1;
		}
		if (((TestVanDammeAnim)this).SpecialAmmo == 0)
		{
			SwitchToNoShieldMats();
		}
	}

	protected override void Update()
	{
		//IL_0071: 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_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: 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_0270: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0222: Unknown result type (might be due to invalid IL or missing references)
		//IL_0319: Unknown result type (might be due to invalid IL or missing references)
		if (((Unit)this).invulnerable)
		{
			wasInvulnerable = true;
		}
		((BroBase)this).Update();
		if (acceptedDeath)
		{
			if (((BroforceObject)this).health <= 0 && !((TestVanDammeAnim)this).WillReviveAlready)
			{
				return;
			}
			if ((Object)(object)thrownShield != (Object)null)
			{
				thrownShield.ReturnShieldSilent();
			}
			((TestVanDammeAnim)this).SpecialAmmo = 1;
			acceptedDeath = false;
		}
		if (wasInvulnerable && !((Unit)this).invulnerable)
		{
			materialNormalShield.SetColor("_TintColor", Color.gray);
			materialNormalNoShield.SetColor("_TintColor", Color.gray);
			materialArmless.SetColor("_TintColor", Color.gray);
			gunMaterialNormal.SetColor("_TintColor", Color.gray);
			gunMaterialNoShield.SetColor("_TintColor", Color.gray);
		}
		if (isHoldingSpecial)
		{
			currentSpecialCharge += ((Unit)this).t;
		}
		((TestVanDammeAnim)this).specialCounter = ((TestVanDammeAnim)this).specialCounter + ((Unit)this).t;
		if (((TestVanDammeAnim)this).specialCounter > specialFrameRate)
		{
			if (animateSpecial)
			{
				((TestVanDammeAnim)this).AnimateSpecial();
			}
			((TestVanDammeAnim)this).specialCounter = ((TestVanDammeAnim)this).specialCounter - specialFrameRate;
			specialFrame++;
		}
		if ((int)((Unit)this).actionState == 5 && !acceptedDeath && !((TestVanDammeAnim)this).WillReviveAlready)
		{
			if ((Object)(object)thrownShield != (Object)null && !thrownShield.dropping)
			{
				thrownShield.StartDropping();
			}
			((TestVanDammeAnim)this).gunFrame = 0;
			currentSpecialCharge = 0f;
			animateSpecial = (((TestVanDammeAnim)this).usingSpecial = (isHoldingSpecial = (((TestVanDammeAnim)this).doingMelee = (usingShieldMelee = false))));
			acceptedDeath = true;
		}
		if (((TestVanDammeAnim)this).doingMelee && usingShieldMelee && ((Unit)this).frame > 0 && Map.DeflectProjectiles((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, 10f, ((BroforceObject)this).X, ((BroforceObject)this).Y, ((Component)this).transform.localScale.x * 300f, true))
		{
			Sound.GetInstance().PlaySoundEffectAt(ricochetSounds, 0.6f, ((Component)this).transform.position, 1f, true, false, false, 0f);
		}
		if (((TestVanDammeAnim)this).airdashTime > 0f)
		{
			if (chargedAirDash)
			{
				if (Map.DeflectProjectiles((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, 8f, ((BroforceObject)this).X, ((BroforceObject)this).Y, ((Component)this).transform.localScale.x * 300f, true))
				{
					Sound.GetInstance().PlaySoundEffectAt(ricochetSounds, 0.6f, ((Component)this).transform.position, 1f, true, false, false, 0f);
				}
			}
			else if ((double)((TestVanDammeAnim)this).airdashTime < 0.27 && Map.DeflectProjectiles((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, 8f, ((BroforceObject)this).X, ((BroforceObject)this).Y, ((Component)this).transform.localScale.x * 300f, true))
			{
				Sound.GetInstance().PlaySoundEffectAt(ricochetSounds, 0.6f, ((Component)this).transform.position, 1f, true, false, false, 0f);
			}
		}
		if (airDashCooldown > 0f)
		{
			airDashCooldown -= ((Unit)this).t;
		}
	}

	protected override void ChangeFrame()
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Invalid comparison between Unknown and I4
		if (animateSpecial && (((TestVanDammeAnim)this).chimneyFlip || ((TestVanDammeAnim)this).wallClimbing || ((TestVanDammeAnim)this).WallDrag || (int)((Unit)this).actionState == 5 || (Object)(object)((TestVanDammeAnim)this).inseminatorUnit != (Object)null || ((Object)(object)((TestVanDammeAnim)this).impaledByTransform != (Object)null && ((Unit)this).useImpaledFrames) || (Object)(object)((Unit)this).attachedToZipline != (Object)null))
		{
			CancelSpecial();
		}
		((TestVanDammeAnim)this).ChangeFrame();
		if (((TestVanDammeAnim)this).doingMelee && !usingShieldMelee)
		{
			((TestVanDammeAnim)this).frameRate = 0.05f;
		}
	}

	protected override void AnimateInseminationFrames()
	{
		int num = 24 + ((TestVanDammeAnim)this).CalculateInseminationFrame();
		((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)(num * ((TestVanDammeAnim)this).spritePixelWidth), (float)(((TestVanDammeAnim)this).spritePixelHeight * 8));
	}

	protected override void CheckFacingDirection()
	{
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		if (!((TestVanDammeAnim)this).chimneyFlip && ((TestVanDammeAnim)this).holdStillTime <= 0f && ((TestVanDammeAnim)this).airdashTime <= 0f)
		{
			if (((TestVanDammeAnim)this).usingSpecial && !((TestVanDammeAnim)this).turnAroundWhhileUsingSpecials && ((TestVanDammeAnim)this).pressSpecialFacingDirection != 0)
			{
				((Component)this).transform.localScale = new Vector3((float)((TestVanDammeAnim)this).pressSpecialFacingDirection, ((TestVanDammeAnim)this).yScale, 1f);
			}
			else if (((BroforceObject)this).xI < 0f || (((TestVanDammeAnim)this).left && ((BroforceObject)this).health > 0))
			{
				((Component)this).transform.localScale = new Vector3(-1f, ((TestVanDammeAnim)this).yScale, 1f);
			}
			else if (((BroforceObject)this).xI > 0f || (((TestVanDammeAnim)this).right && ((BroforceObject)this).health > 0))
			{
				((Component)this).transform.localScale = new Vector3(1f, ((TestVanDammeAnim)this).yScale, 1f);
			}
		}
	}

	protected override void SetGunSprite(int spriteFrame, int spriteRow)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Invalid comparison between Unknown and I4
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Invalid comparison between Unknown and I4
		if (!animateSpecial)
		{
			if ((int)((Unit)this).actionState == 6 && ((TestVanDammeAnim)this).hangingOneArmed)
			{
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)(((TestVanDammeAnim)this).gunSpritePixelWidth * (11 + spriteFrame)), (float)(((TestVanDammeAnim)this).gunSpritePixelHeight * (1 + spriteRow)));
			}
			else if ((Object)(object)((Unit)this).attachedToZipline != (Object)null && (int)((Unit)this).actionState == 3)
			{
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)(((TestVanDammeAnim)this).gunSpritePixelWidth * 11), (float)(((TestVanDammeAnim)this).gunSpritePixelHeight * 2));
			}
			else
			{
				((TestVanDammeAnim)this).SetGunSprite(spriteFrame, spriteRow);
			}
		}
	}

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

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

	protected override void UseFire()
	{
		if (!animateSpecial && ((TestVanDammeAnim)this).airdashTime <= 0f)
		{
			((SwordHero)this).UseFire();
			((TestVanDammeAnim)this).fireDelay = 0.25f;
		}
	}

	protected override void FireWeapon(float x, float y, float xSpeed, float ySpeed)
	{
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0204: Unknown result type (might be due to invalid IL or missing references)
		//IL_023e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: 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_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)((Unit)this).attachedToZipline != (Object)null)
		{
			if (((Component)this).transform.localScale.x > 0f)
			{
				((TestVanDammeAnim)this).AirDashRight();
			}
			else
			{
				((TestVanDammeAnim)this).AirDashLeft();
			}
			return;
		}
		Map.HurtWildLife(x + ((Component)this).transform.localScale.x * 13f, y + 5f, 12f);
		((TestVanDammeAnim)this).gunFrame = 1;
		punchingIndex++;
		((TestVanDammeAnim)this).gunCounter = 0f;
		SetGunFrame();
		currentlyHitting = new List<Unit>();
		float num = ((Component)this).transform.localScale.x * 12f;
		((TestVanDammeAnim)this).ConstrainToFragileBarriers(ref num, 16f);
		if (Physics.Raycast(new Vector3(x - Mathf.Sign(((Component)this).transform.localScale.x) * 12f, y + 5.5f, 0f), new Vector3(((Component)this).transform.localScale.x, 0f, 0f), ref ((TestVanDammeAnim)this).raycastHit, 18f, LayerMask.op_Implicit(((TestVanDammeAnim)this).groundLayer) | (1 << LayerMask.NameToLayer("FLUI"))) || Physics.Raycast(new Vector3(x - Mathf.Sign(((Component)this).transform.localScale.x) * 12f, y + 10.5f, 0f), new Vector3(((Component)this).transform.localScale.x, 0f, 0f), ref ((TestVanDammeAnim)this).raycastHit, 19f, LayerMask.op_Implicit(((TestVanDammeAnim)this).groundLayer) | (1 << LayerMask.NameToLayer("FLUI"))))
		{
			((SwordHero)this).MakeEffects(((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).point.x + ((Component)this).transform.localScale.x * 4f, ((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).point.y);
			MapController.Damage_Local((MonoBehaviour)(object)this, ((Component)((RaycastHit)(ref ((TestVanDammeAnim)this).raycastHit)).collider).gameObject, 7, (DamageType)0, ((BroforceObject)this).xI + ((Component)this).transform.localScale.x * 200f, 0f, x, y);
			base.hasHitWithWall = true;
			if (Map.HitUnits((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, 7, (DamageType)7, 12f, x, y, ((Component)this).transform.localScale.x * 250f, 100f, false, true, false, base.alreadyHit, false, false))
			{
				base.hasHitWithSlice = true;
			}
			else
			{
				base.hasHitWithSlice = false;
			}
			Map.DisturbWildLife(x, y, 80f, ((NetworkedUnit)this).playerNum);
		}
		else
		{
			base.hasHitWithWall = false;
			if (Map.HitUnits((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, 7, (DamageType)7, 10f, x + ((Component)this).transform.localScale.x * 0f, y, ((Component)this).transform.localScale.x * 250f, 100f, false, true, false, base.alreadyHit, false, false))
			{
				base.hasHitWithSlice = true;
			}
			else
			{
				base.hasHitWithSlice = false;
			}
		}
	}

	protected void NormalAttackDamage(float x, float y, float xSpeed, float ySpeed)
	{
		//IL_0006: 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_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: 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_00fa: 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_014f: Unknown result type (might be due to invalid IL or missing references)
		float num = ((Component)this).transform.localScale.x * 12f;
		((TestVanDammeAnim)this).ConstrainToFragileBarriers(ref num, 16f);
		if (!Physics.Raycast(new Vector3(x - Mathf.Sign(((Component)this).transform.localScale.x) * 12f, y + 5.5f, 0f), new Vector3(((Component)this).transform.localScale.x, 0f, 0f), ref ((TestVanDammeAnim)this).raycastHit, 18f, LayerMask.op_Implicit(((TestVanDammeAnim)this).groundLayer) | (1 << LayerMask.NameToLayer("FLUI"))) && !Physics.Raycast(new Vector3(x - Mathf.Sign(((Component)this).transform.localScale.x) * 12f, y + 10.5f, 0f), new Vector3(((Component)this).transform.localScale.x, 0f, 0f), ref ((TestVanDammeAnim)this).raycastHit, 19f, LayerMask.op_Implicit(((TestVanDammeAnim)this).groundLayer) | (1 << LayerMask.NameToLayer("FLUI"))))
		{
			base.hasHitWithWall = false;
			if (Map.HitUnits((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, 7, (DamageType)7, 10f, x + ((Component)this).transform.localScale.x * 0f, y, ((Component)this).transform.localScale.x * 250f, 100f, false, true, false, base.alreadyHit, false, false))
			{
				base.hasHitWithSlice = true;
			}
			else
			{
				base.hasHitWithSlice = false;
			}
		}
	}

	protected override void RunGun()
	{
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		if (specialAttackDashTime > 0f)
		{
			((TestVanDammeAnim)this).gunFrame = 11;
			SetGunFrame();
		}
		else if (!((TestVanDammeAnim)this).WallDrag && !animateSpecial && ((TestVanDammeAnim)this).gunFrame > 0)
		{
			if (!((TestVanDammeAnim)this).hasBeenCoverInAcid)
			{
				((Component)this).GetComponent<Renderer>().material = materialArmless;
			}
			((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;
				if (((TestVanDammeAnim)this).gunFrame > 4 && !heldGunFrame)
				{
					NormalAttackDamage(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 10f, ((BroforceObject)this).Y + 6.5f, ((Component)this).transform.localScale.x * 400f, Random.Range(-20, 20));
					if (base.hasHitWithSlice)
					{
						((SwordHero)this).PlaySliceSound();
						base.hasHitWithSlice = false;
					}
					else if (base.hasHitWithWall)
					{
						((SwordHero)this).PlayWallSound();
						base.hasHitWithWall = false;
					}
					((TestVanDammeAnim)this).gunFrame = 4;
					heldGunFrame = true;
				}
				if (((TestVanDammeAnim)this).gunFrame >= 6 && heldGunFrame)
				{
					((TestVanDammeAnim)this).gunFrame = 0;
				}
				if (((TestVanDammeAnim)this).gunFrame == 0 && punchingIndex % 2 == 1)
				{
					((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)(32 * ((TestVanDammeAnim)this).gunFrame), 32f);
				}
				else
				{
					SetGunFrame();
				}
				if (((TestVanDammeAnim)this).gunFrame == 2)
				{
					if (base.hasHitWithSlice)
					{
						((SwordHero)this).PlaySliceSound();
						base.hasHitWithSlice = false;
					}
					else if (base.hasHitWithWall)
					{
						((SwordHero)this).PlayWallSound();
						base.hasHitWithWall = false;
					}
				}
			}
		}
		if (!animateSpecial && (!((Component)((TestVanDammeAnim)this).gunSprite).gameObject.activeSelf || ((TestVanDammeAnim)this).gunFrame == 0) && !((TestVanDammeAnim)this).hasBeenCoverInAcid)
		{
			((Component)this).GetComponent<Renderer>().material = materialNormal;
			heldGunFrame = false;
		}
	}

	protected void SetGunFrame()
	{
		if (!((TestVanDammeAnim)this).ducking)
		{
			switch (punchingIndex % 2)
			{
			case 1:
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)(32 * (5 + ((TestVanDammeAnim)this).gunFrame)), 32f);
				break;
			case 0:
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)(32 * ((TestVanDammeAnim)this).gunFrame), 32f);
				break;
			}
		}
		else
		{
			switch (punchingIndex % 2)
			{
			case 1:
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)(32 * (15 + ((TestVanDammeAnim)this).gunFrame)), 32f);
				break;
			case 0:
				((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)(32 * (10 + ((TestVanDammeAnim)this).gunFrame)), 32f);
				break;
			}
		}
	}

	protected override void PressHighFiveMelee(bool forceHighFive = false)
	{
		if (((TestVanDammeAnim)this).right && ((TestVanDammeAnim)this).CanAirDash((DirectionEnum)5) && ((TestVanDammeAnim)this).SpecialAmmo > 0)
		{
			if (!((TestVanDammeAnim)this).wasHighFive)
			{
				((TestVanDammeAnim)this).Airdash(true);
			}
		}
		else if (((TestVanDammeAnim)this).left && ((TestVanDammeAnim)this).CanAirDash((DirectionEnum)4) && ((TestVanDammeAnim)this).SpecialAmmo > 0)
		{
			if (!((TestVanDammeAnim)this).wasHighFive)
			{
				((TestVanDammeAnim)this).Airdash(true);
			}
		}
		else if (((TestVanDammeAnim)this).airdashTime <= 0f)
		{
			((TestVanDammeAnim)this).PressHighFiveMelee(forceHighFive);
		}
	}

	protected void MeleeAttack(bool shouldTryHitTerrain, bool playMissSound)
	{
		//IL_0062: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		bool flag = default(bool);
		Map.DamageDoodads(6, (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);
		if (Object.op_Implicit((Object)(object)Map.HitClosestUnit((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, 8, (DamageType)14, 14f, 24f, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 8f, ((BroforceObject)this).Y + 8f, ((Component)this).transform.localScale.x * 300f, 600f, true, false, ((NetworkObject)this).IsMine, false, true)))
		{
			((TestVanDammeAnim)this).sound.PlaySoundEffectAt(shieldMeleeHit[currentMeleeSound], 0.5f, ((Component)this).transform.position, 1f, true, false, false, 0f);
			((TestVanDammeAnim)this).meleeHasHit = true;
		}
		((TestVanDammeAnim)this).meleeChosenUnit = null;
		if (shouldTryHitTerrain && ((BroBase)this).TryMeleeTerrain(0, 6))
		{
			((TestVanDammeAnim)this).meleeHasHit = true;
			((TestVanDammeAnim)this).sound.PlaySoundEffectAt(shieldMeleeTerrain, 0.5f, ((Component)this).transform.position, 1f, true, false, false, 0f);
		}
		((TestVanDammeAnim)this).TriggerBroMeleeEvent();
	}

	protected override void StartCustomMelee()
	{
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		if (animateSpecial)
		{
			return;
		}
		if (((BroBase)this).CanStartNewMelee())
		{
			usingShieldMelee = ((TestVanDammeAnim)this)._specialAmmo > 0;
			alreadySpawnedBullet = false;
			if ((!((Object)(object)((TestVanDammeAnim)this).nearbyMook != (Object)null) || !((Unit)((TestVanDammeAnim)this).nearbyMook).CanBeThrown()) && usingShieldMelee)
			{
				currentMeleeSound = Random.Range(0, shieldMeleeSwing.Length);
				((TestVanDammeAnim)this).sound.PlaySoundEffectAt(shieldMeleeSwing[currentMeleeSound], 0.6f, ((Component)this).transform.position, 1f, true, false, false, 0f);
			}
			((Unit)this).frame = 1;
			((TestVanDammeAnim)this).counter = -0.05f;
			((TestVanDammeAnim)this).AnimateMelee();
		}
		else if (((BroBase)this).CanStartMeleeFollowUp())
		{
			((TestVanDammeAnim)this).meleeFollowUp = true;
			alreadySpawnedBullet = false;
		}
		if (!((TestVanDammeAnim)this).jumpingMelee && usingShieldMelee)
		{
			((TestVanDammeAnim)this).dashingMelee = true;
			((BroforceObject)this).xI = (float)((NetworkedUnit)this).Direction * ((TestVanDammeAnim)this).speed;
		}
		((BroBase)this).StartMeleeCommon();
	}

	protected override void AnimateCustomMelee()
	{
		//IL_016f: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: 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)
		((BroBase)this).AnimateMeleeCommon();
		if (usingShieldMelee)
		{
			int num = 25 + Mathf.Clamp(((Unit)this).frame, 0, 6);
			int num2 = 1;
			if (!((TestVanDammeAnim)this).standingMelee)
			{
				if (((TestVanDammeAnim)this).jumpingMelee)
				{
					num = 17 + Mathf.Clamp(((Unit)this).frame, 0, 6);
					num2 = 6;
				}
				else if (((TestVanDammeAnim)this).dashingMelee)
				{
					num = 17 + Mathf.Clamp(((Unit)this).frame, 0, 6);
					num2 = 6;
					if (((Unit)this).frame == 4)
					{
						((TestVanDammeAnim)this).counter = ((TestVanDammeAnim)this).counter - 0.0334f;
					}
					else if (((Unit)this).frame == 5)
					{
						((TestVanDammeAnim)this).counter = ((TestVanDammeAnim)this).counter - 0.0334f;
					}
				}
			}
			((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)(num * ((TestVanDammeAnim)this).spritePixelWidth), (float)(num2 * ((TestVanDammeAnim)this).spritePixelHeight));
			if (((Unit)this).frame == 3)
			{
				((TestVanDammeAnim)this).counter = ((TestVanDammeAnim)this).counter - 0.066f;
				MeleeAttack(shouldTryHitTerrain: true, playMissSound: true);
			}
			else if (((Unit)this).frame > 3 && !((TestVanDammeAnim)this).meleeHasHit)
			{
				MeleeAttack(shouldTryHitTerrain: false, playMissSound: false);
			}
			if (((Unit)this).frame >= 6)
			{
				((Unit)this).frame = 0;
				((TestVanDammeAnim)this).CancelMelee();
			}
		}
		else
		{
			int num3 = 25 + Mathf.Clamp(((Unit)this).frame, 0, 6);
			int num4 = 1;
			((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)(num3 * ((TestVanDammeAnim)this).spritePixelWidth), (float)(num4 * ((TestVanDammeAnim)this).spritePixelHeight));
			if (((Unit)this).frame == 3 && !alreadySpawnedBullet)
			{
				((TestVanDammeAnim)this).sound.PlaySoundEffectAt(pistolSounds, 0.5f, ((Component)this).transform.position, 1f, true, false, false, 0f);
				ProjectileController.SpawnProjectileLocally(pistolBullet, (MonoBehaviour)(object)this, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 12f, ((BroforceObject)this).Y + 13.5f, ((Component)this).transform.localScale.x * 250f, 0f, ((NetworkedUnit)this).playerNum);
				EffectsController.CreateMuzzleFlashEffect(((BroforceObject)this).X + ((Component)this).transform.localScale.x * 14f, ((BroforceObject)this).Y + 13.5f, -25f, ((Component)this).transform.localScale.x * 100f, 0f, ((Component)this).transform);
				alreadySpawnedBullet = true;
			}
			if (((Unit)this).frame >= 6)
			{
				((Unit)this).frame = 0;
				((TestVanDammeAnim)this).CancelMelee();
			}
		}
	}

	protected override void RunCustomMeleeMovement()
	{
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: 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)
		if (!((TestVanDammeAnim)this).useNewKnifingFrames)
		{
			if (((BroforceObject)this).Y > ((TestVanDammeAnim)this).groundHeight + 1f)
			{
				((TestVanDammeAnim)this).ApplyFallingGravity();
			}
		}
		else 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 && usingShieldMelee)
					{
						((BroforceObject)this).xI = ((TestVanDammeAnim)this).speed * 1f * ((Component)this).transform.localScale.x;
					}
					((BroforceObject)this).yI = 0f;
				}
				else if (!((TestVanDammeAnim)this).isInQuicksand && usingShieldMelee)
				{
					((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 <= 5)
			{
				if (!((TestVanDammeAnim)this).isInQuicksand && usingShieldMelee)
				{
					((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();
		}
	}

	protected override void AnimateWallAnticipation()
	{
		if (animateSpecial)
		{
			CancelSpecial();
		}
		((TestVanDammeAnim)this).AnimateWallAnticipation();
	}

	protected override void UseSpecial()
	{
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		if (((TestVanDammeAnim)this).SpecialAmmo > 0 && !isHoldingSpecial)
		{
			if (currentSpecialCharge > maxSpecialCharge)
			{
				currentSpecialCharge = maxSpecialCharge;
			}
			int specialAmmo = ((TestVanDammeAnim)this).SpecialAmmo;
			((TestVanDammeAnim)this).SpecialAmmo = specialAmmo - 1;
			float num = 400f + 100f * currentSpecialCharge;
			if (Physics.Raycast(((Component)this).transform.position, Vector3.up, ref ((TestVanDammeAnim)this).raycastHit, 22f, LayerMask.op_Implicit(((TestVanDammeAnim)this).groundLayer)))
			{
				thrownShield = ProjectileController.SpawnProjectileLocally((Projectile)(object)shield, (MonoBehaviour)(object)this, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 6f, ((BroforceObject)this).Y + 10f, ((Component)this).transform.localScale.x * num, 0f, false, ((NetworkedUnit)this).playerNum, false, false, 0f) as Shield;
			}
			else
			{
				thrownShield = ProjectileController.SpawnProjectileLocally((Projectile)(object)shield, (MonoBehaviour)(object)this, ((BroforceObject)this).X + ((Component)this).transform.localScale.x * 6f, ((BroforceObject)this).Y + 15f, ((Component)this).transform.localScale.x * num, 0f, false, ((NetworkedUnit)this).playerNum, false, false, 0f) as Shield;
			}
			thrownShield.Setup((TestVanDammeAnim)(object)this, currentSpecialCharge);
			currentSpecialCharge = 0f;
		}
		else
		{
			((TestVanDammeAnim)this).UseSpecial();
		}
	}

	protected void SwitchToNoShieldMats()
	{
		if (!((TestVanDammeAnim)this).hasBeenCoverInAcid && finishedStartup)
		{
			materialNormal = materialNormalNoShield;
			((TestVanDammeAnim)this).gunSprite.meshRender.material = gunMaterialNoShield;
		}
	}

	protected void SwitchToWithShieldMats()
	{
		if (!((TestVanDammeAnim)this).hasBeenCoverInAcid && finishedStartup)
		{
			materialNormal = materialNormalShield;
			((TestVanDammeAnim)this).gunSprite.meshRender.material = gunMaterialNormal;
			if (!animateSpecial)
			{
				((Component)this).GetComponent<Renderer>().material = materialNormalShield;
			}
		}
	}

	public void ReturnShield(Shield shield)
	{
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Invalid comparison between Unknown and I4
		int specialAmmo;
		if (((TestVanDammeAnim)this).hasBeenCoverInAcid)
		{
			specialAmmo = ((TestVanDammeAnim)this).SpecialAmmo + 1;
			((TestVanDammeAnim)this).SpecialAmmo = specialAmmo;
			return;
		}
		if (((TestVanDammeAnim)this).doingMelee)
		{
			((TestVanDammeAnim)this).doingMelee = false;
			((TestVanDammeAnim)this).jumpingMelee = false;
			((TestVanDammeAnim)this).dashingMelee = false;
			((TestVanDammeAnim)this).standingMelee = false;
			((TestVanDammeAnim)this).meleeFollowUp = false;
			((TestVanDammeAnim)this).meleeChosenUnit = null;
			((TestVanDammeAnim)this).counter = 0f;
			((TestVanDammeAnim)this).hasPlayedMissSound = false;
			if ((int)((Unit)this).actionState != 6)
			{
				if (((BroforceObject)this).Y > ((TestVanDammeAnim)this).groundHeight)
				{
					((Unit)this).actionState = (ActionState)3;
				}
				else if (((TestVanDammeAnim)this).left || ((TestVanDammeAnim)this).right)
				{
					((Unit)this).actionState = (ActionState)1;
				}
				else
				{
					((TestVanDammeAnim)this).SetActionstateToIdle();
				}
			}
		}
		if (!((TestVanDammeAnim)this).usingSpecial && !animateSpecial)
		{
			((TestVanDammeAnim)this).usingSpecial = true;
			grabbingFrame = 0;
			grabbingShield = true;
			((TestVanDammeAnim)this).ChangeFrame();
		}
		specialAmmo = ((TestVanDammeAnim)this).SpecialAmmo;
		((TestVanDammeAnim)this).SpecialAmmo = specialAmmo + 1;
	}

	protected override void OnDestroy()
	{
		if ((Object)(object)thrownShield != (Object)null && !thrownShield.dropping)
		{
			thrownShield.StartDropping();
		}
		((BroBase)this).OnDestroy();
	}

	protected override void PressSpecial()
	{
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		if (((TestVanDammeAnim)this).SpecialAmmo > 0 && !((TestVanDammeAnim)this).usingSpecial && !animateSpecial && !((TestVanDammeAnim)this).wallClimbing && !((TestVanDammeAnim)this).wallDrag && !((Object)(object)((Unit)this).attachedToZipline != (Object)null) && !((TestVanDammeAnim)this).IsGesturing() && !((BroBase)this).frontSomersaulting && !((TestVanDammeAnim)this).hasBeenCoverInAcid && !((TestVanDammeAnim)this).doingMelee)
		{
			((TestVanDammeAnim)this).speed = 80f;
			isHoldingSpecial = true;
			specialFrame = 0;
			specialFrameRate = 0.05f;
			((TestVanDammeAnim)this).specialCounter = specialFrameRate;
			animateSpecial = true;
			playedShingNoise = false;
			((Unit)this).frame = 0;
			((TestVanDammeAnim)this).pressSpecialFacingDirection = (int)((Component)this).transform.localScale.x;
		}
	}

	protected override void ReleaseSpecial()
	{
		isHoldingSpecial = false;
		((TestVanDammeAnim)this).ReleaseSpecial();
	}

	protected void CancelSpecial()
	{
		isHoldingSpecial = false;
		((TestVanDammeAnim)this).speed = 130f;
		animateSpecial = false;
		currentSpecialCharge = 0f;
		((TestVanDammeAnim)this).gunFrame = 0;
		if (!((TestVanDammeAnim)this).hasBeenCoverInAcid)
		{
			((Component)this).GetComponent<Renderer>().material = materialNormal;
		}
	}

	public override void AttachToZipline(ZipLine zipLine)
	{
		if (animateSpecial)
		{
			CancelSpecial();
		}
		((TestVanDammeAnim)this).AttachToZipline(zipLine);
	}

	public override void SetGestureAnimation(Gestures gesture)
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		if (!((TestVanDammeAnim)this).doingMelee)
		{
			if (animateSpecial && (int)gesture != 0)
			{
				CancelSpecial();
			}
			((BroBase)this).SetGestureAnimation(gesture);
		}
	}

	protected override void AnimateSpecial()
	{
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		if (grabbingShield)
		{
			((TestVanDammeAnim)this).SetSpriteOffset(0f, 0f);
			((TestVanDammeAnim)this).DeactivateGun();
			((TestVanDammeAnim)this).frameRate = 0.05f;
			((TestVanDammeAnim)this).sprite.SetLowerLeftPixel((float)((26 + grabbingFrame) * ((TestVanDammeAnim)this).spritePixelWidth), (float)(((TestVanDammeAnim)this).spritePixelHeight * 5));
			grabbingFrame++;
			if (grabbingFrame > 3)
			{
				((Unit)this).frame = 0;
				((TestVanDammeAnim)this).usingSpecial = false;
				grabbingShield = false;
				((TestVanDammeAnim)this).ChangeFrame();
			}
			return;
		}
		if (!((TestVanDammeAnim)this).hasBeenCoverInAcid)
		{
			((Component)this).GetComponent<Renderer>().material = materialArmless;
		}
		if (isHoldingSpecial && ((TestVanDammeAnim)this).SpecialAmmo > 0)
		{
			if (specialFrame > 2 && currentSpecialCharge < 0.25f)
			{
				specialFrameRate = 0.05f;
				specialFrame = 2;
			}
			else if (specialFrame > 5 && currentSpecialCharge < 1f)
			{
				specialFrame = 3;
			}
			else if (specialFrame == 5 && currentSpecialCharge > 1f)
			{
				specialFrame = 6;
			}
			else if (specialFrame > 5)
			{
				specialFrameRate = 0.0333f;
				specialFrame = 3;
			}
			if (!playedShingNoise && currentSpecialCharge > 1f)
			{
				Sound.GetInstance().PlaySoundEffectAt(shieldChargeShing, 0.3f, ((Component)this).transform.position, 1f, true, false, false, 0f);
				playedShingNoise = true;
			}
			((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)(32 * (1 + specialFrame)), 128f);
			return;
		}
		if (specialFrame > 2 && specialFrame < 7)
		{
			specialFrame = 7;
		}
		else if (specialFrame == 9)
		{
			((TestVanDammeAnim)this).UseSpecial();
			((TestVanDammeAnim)this).speed = 130f;
		}
		if (specialFrame >= 11)
		{
			((Unit)this).frame = 0;
			animateSpecial = (((TestVanDammeAnim)this).usingPockettedSpecial = false);
			if (!((TestVanDammeAnim)this).hasBeenCoverInAcid)
			{
				((Component)this).GetComponent<Renderer>().material = materialNormal;
			}
			((TestVanDammeAnim)this).ChangeFrame();
		}
		else
		{
			specialFrameRate = 0.05f;
			((TestVanDammeAnim)this).gunSprite.SetLowerLeftPixel((float)(32 * (1 + specialFrame)), 128f);
		}
	}

	protected override void AirDashLeft()
	{
		if ((!animateSpecial || playedShingNoise) && ((TestVanDammeAnim)this).SpecialAmmo > 0 && airDashCooldown <= 0f)
		{
			SetAirDashTime();
			if ((Object)(object)((Unit)this).attachedToZipline != (Object)null)
			{
				((Unit)this).attachedToZipline.DetachUnit((Unit)(object)this);
				((TestVanDammeAnim)this).ActivateGun();
			}
			((TestVanDammeAnim)this).gunFrame = 0;
			((TestVanDammeAnim)this).SetGunSprite(0, 0);
			if ((Object)(object)invulnerabilityFlash == (Object)null)
			{
				invulnerabilityFlash = ((Component)this).GetComponent<InvulnerabilityFlash>();
			}
			if ((Object)(object)invulnerabilityFlash != (Object)null && ((TestVanDammeAnim)this).invulnerableTime <= 0f)
			{
				((Behaviour)invulnerabilityFlash).enabled = false;
			}
			currentlyHitting = new List<Unit>();
			((TestVanDammeAnim)this).AirDashLeft();
			airDashCooldown = ((TestVanDammeAnim)this).airdashTime + 0.2f;
		}
	}

	protected override void AirDashRight()
	{
		if ((!animateSpecial || playedShingNoise) && ((TestVanDammeAnim)this).SpecialAmmo > 0 && airDashCooldown <= 0f)
		{
			SetAirDashTime();
			if ((Object)(object)((Unit)this).attachedToZipline != (Object)null)
			{
				((Unit)this).attachedToZipline.DetachUnit((Unit)(object)this);
				((TestVanDammeAnim)this).ActivateGun();
			}
			((TestVanDammeAnim)this).gunFrame = 0;
			((TestVanDammeAnim)this).SetGunSprite(0, 0);
			if ((Object)(object)invulnerabilityFlash == (Object)null)
			{
				invulnerabilityFlash = ((Component)this).GetComponent<InvulnerabilityFlash>();
			}
			if ((Object)(object)invulnerabilityFlash != (Object)null && ((TestVanDammeAnim)this).invulnerableTime <= 0f)
			{
				((Behaviour)invulnerabilityFlash).enabled = false;
			}
			currentlyHitting = new List<Unit>();
			((TestVanDammeAnim)this).AirDashRight();
			airDashCooldown = ((TestVanDammeAnim)this).airdashTime + 0.2f;
		}
	}

	protected override void RunAirDashing()
	{
		((TestVanDammeAnim)this).RunAirDashing();
		if (((TestVanDammeAnim)this).airdashTime <= 0f && (Object)(object)invulnerabilityFlash != (Object)null)
		{
			((Behaviour)invulnerabilityFlash).enabled = true;
		}
	}

	protected override void RunLeftAirDash()
	{
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		if (((TestVanDammeAnim)this).airDashDelay > 0f)
		{
			((TestVanDammeAnim)this).airDashDelay = ((TestVanDammeAnim)this).airDashDelay - ((Unit)this).t;
			((BroforceObject)this).yI = 0f;
			((BroforceObject)this).xI = 50f;
			((Component)this).transform.localScale = new Vector3(-1f, ((TestVanDammeAnim)this).yScale, 1f);
			if (((TestVanDammeAnim)this).airDashDelay <= 0f)
			{
				((TestVanDammeAnim)this).ChangeFrame();
				((TestVanDammeAnim)this).PlayAidDashSound();
			}
		}
		else
		{
			((TestVanDammeAnim)this).SetAirDashLeftSpeed();
		}
		specialAttackDashCounter += ((Unit)this).t;
		if (specialAttackDashCounter > 0f)
		{
			specialAttackDashCounter -= 0.0333f;
			if (Map.HitUnits((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, 3, (DamageType)4, 9f, ((BroforceObject)this).X, ((BroforceObject)this).Y, ((Component)this).transform.localScale.x * (200f + Random.value * 50f), 350f, true, true, false, currentlyHitting, true, false))
			{
				((TestVanDammeAnim)this).sound.PlaySoundEffectAt(shieldMeleeHit, 0.3f, ((Component)this).transform.position, 1f, true, false, false, 0f);
			}
		}
		if (((TestVanDammeAnim)this).airDashDelay <= 0f)
		{
			airdashFadeCounter += Time.deltaTime;
			if (airdashFadeCounter > airdashFadeRate)
			{
				airdashFadeCounter -= airdashFadeRate;
				((TestVanDammeAnim)this).CreateFaderTrailInstance();
			}
		}
	}

	protected override void RunRightAirDash()
	{
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		if (((TestVanDammeAnim)this).airDashDelay > 0f)
		{
			((TestVanDammeAnim)this).airDashDelay = ((TestVanDammeAnim)this).airDashDelay - ((Unit)this).t;
			((BroforceObject)this).yI = 0f;
			((BroforceObject)this).xI = -50f;
			((Component)this).transform.localScale = new Vector3(1f, ((TestVanDammeAnim)this).yScale, 1f);
			if (((TestVanDammeAnim)this).airDashDelay <= 0f)
			{
				((TestVanDammeAnim)this).ChangeFrame();
				((TestVanDammeAnim)this).PlayAidDashSound();
			}
		}
		else
		{
			((TestVanDammeAnim)this).SetAirDashRightSpeed();
		}
		specialAttackDashCounter += ((Unit)this).t;
		if (specialAttackDashCounter > 0f)
		{
			specialAttackDashCounter -= 0.0333f;
			if (Map.HitUnits((MonoBehaviour)(object)this, ((NetworkedUnit)this).playerNum, 3, (DamageType)4, 9f, ((BroforceObject)this).X, ((BroforceObject)this).Y, ((Component)this).transform.localScale.x * (200f + Random.value * 50f), 350f, true, true, false, currentlyHitting, true, false))
			{
				((TestVanDammeAnim)this).sound.PlaySoundEffectAt(shieldMeleeHit, 0.3f, ((Component)this).transform.position, 1f, true, false, false, 0f);
			}
		}
		if (((TestVanDammeAnim)this).airDashDelay <= 0f)
		{
			airdashFadeCounter += Time.deltaTime;
			if (airdashFadeCounter > airdashFadeRate)
			{
				airdashFadeCounter -= airdashFadeRate;
				((TestVanDammeAnim)this).CreateFaderTrailInstance();
			}
		}
	}

	protected override void PlayAidDashSound()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		((TestVanDammeAnim)this).sound.PlaySoundEffectAt(effortSounds, 0.25f, ((Component)this).transform.position, 1f, true, false, false, 0f);
		((TestVanDammeAnim)this).sound.PlaySoundEffectAt(airDashSound, 0.75f, ((Component)this).transform.position, 1f, true, false, false, 0f);
	}

	protected virtual void SetAirDashTime()
	{
		if (isHoldingSpecial && playedShingNoise)
		{
			chargedAirDash = true;
			((TestVanDammeAnim)this).airdashMaxTime = 0.4f;
			CancelSpecial();
		}
		else
		{
			chargedAirDash = false;
			((TestVanDammeAnim)this).airdashMaxTime = 0.23f;
		}
	}

	protected override void CreateFaderTrailInstance()
	{
	}
}
public class CaptainAmeribroActionInfo : LevelStartTriggerActionInfo
{
	public GridPoint SpawnPoint = new GridPoint(0, 0);

	public bool PermanentlyGrantShield;

	public override void ShowGUI(LevelEditorGUI gui)
	{
		((LevelStartTriggerActionInfo)this).ShowGUI(gui);
		CustomTriggerActionInfo.ShowGridPointOption(gui, SpawnPoint, "Set Spawn Point");
		GUILayout.Space(10f);
		PermanentlyGrantShield = GUILayout.Toggle(PermanentlyGrantShield, "Keep shield on respawn", (GUILayoutOption[])(object)new GUILayoutOption[0]);
	}
}
public class CaptainAmeribroAction : LevelStartTriggerAction<CaptainAmeribroActionInfo>
{
	public static Shield shieldPrefab = CustomProjectile.CreatePrefab<Shield>(new List<Type> { typeof(SphereCollider) });

	protected override void ExecuteAction(bool isLevelStart)
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: 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)
		Vector3 blockCenter = Map.GetBlockCenter(new GridPoint(((CustomTriggerAction<CaptainAmeribroActionInfo>)(object)this).info.SpawnPoint.collumn - Map.lastXLoadOffset, ((CustomTriggerAction<CaptainAmeribroActionInfo>)(object)this).info.SpawnPoint.row - Map.lastYLoadOffset));
		Shield obj = ProjectileController.SpawnProjectileLocally((Projectile)(object)shieldPrefab, (MonoBehaviour)null, blockCenter.x, blockCenter.y, 0f, 0f, false, 0, false, false, 0f) as Shield;
		obj.Setup(null);
		obj.dropping = true;
		obj.stopSeeking = true;
		obj.spawnedByTrigger = true;
		obj.permanentlyGrantShield = ((CustomTriggerAction<CaptainAmeribroActionInfo>)(object)this).info.PermanentlyGrantShield;
	}
}
public class PockettedShield : CustomPockettedSpecial
{
	public Shield shieldPrefab;

	public LayerMask groundLayer;

	public PockettedShield()
	{
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		shieldPrefab = CustomProjectile.CreatePrefab<Shield>(new List<Type> { typeof(SphereCollider) });
		groundLayer = LayerMask.op_Implicit((1 << LayerMask.NameToLayer("Ground")) | (1 << LayerMask.NameToLayer("LargeObjects")) | (1 << LayerMask.NameToLayer("IndestructibleGround")));
	}

	public override void UseSpecial(BroBase bro)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		RaycastHit val = default(RaycastHit);
		Shield shield = ((!Physics.Raycast(((Component)bro).transform.position, Vector3.up, ref val, 22f, LayerMask.op_Implicit(groundLayer))) ? (ProjectileController.SpawnProjectileLocally((Projectile)(object)shieldPrefab, (MonoBehaviour)(object)bro, ((BroforceObject)bro).X + ((Component)bro).transform.localScale.x * 6f, ((BroforceObject)bro).Y + 15f, ((Component)bro).transform.localScale.x * 400f, 0f, false, ((NetworkedUnit)bro).playerNum, false, false, 0f) as Shield) : (ProjectileController.SpawnProjectileLocally((Projectile)(object)shieldPrefab, (MonoBehaviour)(object)bro, ((BroforceObject)bro).X + ((Component)bro).transform.localScale.x * 6f, ((BroforceObject)bro).Y + 10f, ((Component)bro).transform.localScale.x * 400f, 0f, false, ((NetworkedUnit)bro).playerNum, false, false, 0f) as Shield));
		shield.Setup((TestVanDammeAnim)(object)bro, 0f, enableBoomerang: false);
	}

	public override void SetSpecialMaterials(BroBase bro)
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		Material material = ResourcesController.GetMaterial(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "captainAmeribroSpecial.png");
		BroMakerUtilities.SetSpecialMaterials(((NetworkedUnit)bro).playerNum, material, Vector2.zero, 0f);
	}

	public override bool RefreshAmmo()
	{
		return false;
	}
}
public class Shield : CustomProjectile
{
	public float returnTime = 0.25f;

	protected bool hasReachedApex;

	protected float shieldSpeed;

	public float rotationSpeed = 2f;

	protected float hitUnitsDelay;

	protected int hitUnitsCount;

	public bool dropping;

	public SphereCollider shieldCollider;

	public float shieldLoopPitchM = 1f;

	protected float collectDelayTime = 0.1f;

	protected float windCounter;

	protected int windCount;

	public float windRotationSpeedM = 1f;

	protected float xStart;

	protected float lastXI;

	public float bounceXM = 0.5f;

	public float bounceYM = 0.33f;

	public float frictionM = 0.5f;

	public float bounceVolumeM = 1f;

	public float heightOffGround = 8f;

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

	protected const float groundRotationSpeed = -10f;

	public TestVanDammeAnim throwingPlayer;

	protected bool shouldBoomerang = true;

	public float shieldCharge;

	protected const float ChargeReturnScalar = 0.25f;

	public const float ChargeSpeedScalar = 100f;

	protected const int BaseDamage = 3;

	protected int bossDamage = 3;

	protected float knockbackXI = 150f;

	protected float knockbackYI = 300f;

	protected float targetAngle;

	protected float targetX;

	protected float targetY;

	protected float originalAngle;

	public float seekRange = 75f;

	protected bool foundMook;

	protected float originalSpeed;

	protected float seekSpeedCurrent = 2f;

	protected float speed;

	public float seekTurningSpeedLerpM = 5f;

	public float seekTurningSpeedM = 20f;

	protected float angle;

	protected float seekCounter = 0.1f;

	public bool stopSeeking;

	protected int bounceCount = 5;

	protected bool startedSnap;

	protected float startingThrowX;

	protected float startingThrowY;

	protected Vector3 startingThrowVector;

	protected LayerMask ladderLayer;

	public bool spawnedByTrigger;

	public bool permanentlyGrantShield;

	public AudioClip[] shieldUnitBounce;

	protected override void Awake()
	{
		//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)
		base.SpriteWidth = 16f;
		base.SpriteHeight = 16f;
		ladderLayer = LayerMask.op_Implicit(1 << LayerMask.NameToLayer("Ladders"));
		shieldCollider = ((Component)this).GetComponent<SphereCollider>();
		if ((Object)(object)base.DefaultSoundHolder == (Object)null)
		{
			ref SoundHolder defaultSoundHolder = ref base.DefaultSoundHolder;
			TestVanDammeAnim heroPrefab = HeroController.GetHeroPrefab((HeroType)32);
			defaultSoundHolder = ((BroMax)((heroPrefab is BroMax) ? heroPrefab : null)).boomerang.soundHolder;
		}
		((Projectile)this).soundVolume = 0.09f;
		((CustomProjectile)this).Awake();
	}

	public override void PrefabSetup()
	{
		if (shieldUnitBounce == null)
		{
			shieldUnitBounce = (AudioClip[])(object)new AudioClip[3];
			shieldUnitBounce[0] = ResourcesController.GetAudioClip(base.SoundPath, "special1.wav");
			shieldUnitBounce[1] = ResourcesController.GetAudioClip(base.SoundPath, "special2.wav");
			shieldUnitBounce[2] = ResourcesController.GetAudioClip(base.SoundPath, "special3.wav");
		}
	}

	public override void Fire(float x, float y, float xI, float yI, float _zOffset, int playerNum, MonoBehaviour FiredBy)
	{
		//IL_0217: Unknown result type (might be due to invalid IL or missing references)
		shieldSpeed = xI;
		if (xI > 0f)
		{
			rotationSpeed *= -1f;
		}
		((Component)shieldCollider).transform.parent = ((Component)this).transform.parent;
		((Projectile)this).t = Time.deltaTime;
		((Projectile)this).damageInternal = ((Projectile)this).damage;
		((Projectile)this).fullLife = ((Projectile)this).life;
		((Projectile)this).fullDamage = ((Projectile)this).damage;
		((BroforceObject)this).SetXY(x, y);
		((BroforceObject)this).xI = xI;
		((BroforceObject)this).yI = yI;
		speed = Mathf.Abs(((BroforceObject)this).xI);
		bounceCount = 5;
		originalSpeed = speed;
		if (xI > 0f)
		{
			angle = (float)Math.PI / 2f;
		}
		else
		{
			angle = -(float)Math.PI / 2f;
		}
		targetAngle = angle;
		originalAngle = angle;
		((Projectile)this).playerNum = playerNum;
		((Projectile)this).SetPosition();
		((Projectile)this).SetRotation();
		((Projectile)this).firedBy = FiredBy;
		Vector3 val = default(Vector3);
		((Vector3)(ref val))..ctor(xI, yI, 0f);
		((Projectile)this).startProjectileSpeed = ((Vector3)(ref val)).magnitude;
		if (playerNum >= 0 && playerNum <= 3)
		{
			ScaleProjectileWithPerks component = ((Component)this).GetComponent<ScaleProjectileWithPerks>();
			if (component != null)
			{
				component.Setup((Projectile)(object)this);
			}
		}
		((Projectile)this).CheckSpawnPoint();
		((Projectile)this).zOffset = _zOffset;
		((Projectile)this).CheckFriendlyFireMaterial();
		((Component)this).gameObject.AddComponent<AudioSource>();
		((Component)this).GetComponent<AudioSource>().playOnAwake = false;
		((Component)this).GetComponent<AudioSource>().rolloffMode = (AudioRolloffMode)1;
		((Component)this).GetComponent<AudioSource>().minDistance = 100f;
		((Component)this).GetComponent<AudioSource>().dopplerLevel = 0.02f;
		((Component)this).GetComponent<AudioSource>().maxDistance = 220f;
		((Component)this).GetComponent<AudioSource>().spatialBlend = 1f;
		((Component)this).GetComponent<AudioSource>().volume = ((Projectile)this).soundVolume;
		((Component)this).GetComponent<AudioSource>().loop = true;
		((Component)this).GetComponent<AudioSource>().clip = ((Projectile)this).soundHolder.specialSounds[Random.Range(0, ((Projectile)this).soundHolder.specialSounds.Length)];
		((Component)this).GetComponent<AudioSource>().Play();
		Sound.GetInstance().PlaySoundEffectAt(((Projectile)this).soundHolder.effortSounds, 0.4f, ((Component)this).transform.position, 1.15f + Random.value * 0.1f, true, false, false, 0f);
		xStart = x - Mathf.Sign(xI) * 48f;
		lastXI = xI;
	}

	public void Setup(TestVanDammeAnim player, float currentSpecialCharge = 0f, bool enableBoomerang = true)
	{
		//IL_0017: 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_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		throwingPlayer = player;
		shouldBoomerang = enableBoomerang;
		shieldCharge = currentSpecialCharge;
		((Projectile)this).damageType = (DamageType)4;
		((Projectile)this).damage = 3 + (int)Math.Round(3f * currentSpecialCharge);
		((Projectile)this).damageInternal = ((Projectile)this).damage;
		((Projectile)this).fullDamage = ((Projectile)this).damage;
		bossDamage = 3 * ((Projectile)this).damage + 4;
		knockbackXI += knockbackXI * currentSpecialCharge;
		knockbackYI += knockbackYI * currentSpecialCharge;
		if ((Object)(object)throwingPlayer != (Object)null)
		{
			startingThrowX = ((BroforceObject)throwingPlayer).X;
			startingThrowY = ((BroforceObject)throwingPlayer).Y;
			startingThrowVector = ((Component)throwingPlayer).transform.position;
		}
		else
		{
			startingThrowX = 0f;
			startingThrowY = 0f;
			startingThrowVector = Vector3.zero;
		}
		((Component)this).transform.eulerAngles = new Vector3(0f, 0f, 0f);
		((Behaviour)this).enabled = true;
		returnTime += 0.25f * shieldCharge;
	}

	protected override void CheckSpawnPoint()
	{
		//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_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: 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_0182: 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_0195: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0240: Unknown result type (might be due to invalid IL or missing references)
		//IL_0256: Unknown result type (might be due to invalid IL or missing references)
		//IL_0276: Unknown result type (might be due to invalid IL or missing references)
		//IL_0289: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0216: 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(((Projectile)this).groundLayer));
		if (array.Length != 0)
		{
			((Projectile)this).MakeEffects(false, ((BroforceObject)this).X, ((BroforceObject)this).Y, false, ((RaycastHit)(ref ((Projectile)this).raycastHit)).normal, ((RaycastHit)(ref ((Projectile)this).raycastHit)).point);
			for (int i = 0; i < array.Length; i++)
			{
				((Projectile)this).ProjectileApplyDamageToBlock(((Component)array[i]).gameObject, ((Projectile)this).damageInternal, ((Projectile)this).damageType, ((BroforceObject)this).xI, ((BroforceObject)this).yI);
			}
			returnTime = 0f;
			((BroforceObject)this).xI = 0f;
		}
		((Projectile)this).RegisterProjectile();
		((Projectile)this).CheckReturnZones();
		if ((((Projectile)this).canReflect && ((Projectile)this).playerNum >= 0 && ((Projectile)this).horizontalProjectile && Physics.Raycast(new Vector3(((BroforceObject)this).X - Mathf.Sign(((BroforceObject)this).xI) * ((Projectile)this).projectileSize * 2f, ((BroforceObject)this).Y, 0f), new Vector3(((BroforceObject)this).xI, ((BroforceObject)this).yI, 0f), ref ((Projectile)this).raycastHit, ((Projectile)this).projectileSize * 3f, LayerMask.op_Implicit(((Projectile)this).barrierLayer))) || (!((Projectile)this).horizontalProjectile && Physics.Raycast(new Vector3(((BroforceObject)this).X, ((BroforceObject)this).Y, 0f), new Vector3(((BroforceObject)this).xI, ((BroforceObject)this).yI, 0f), ref ((Projectile)this).raycastHit, ((Projectile)this).projectileSize + ((Projectile)this).startProjectileSpeed * ((Projectile)this).t, LayerMask.op_Implicit(((Projectile)this).barrierLayer))))
		{
			((Projectile)this).ReflectProjectile(((Projectile)this).raycastHit);
		}
		else if ((((Projectile)this).canReflect && ((Projectile)this).playerNum < 0 && ((Projectile)this).horizontalProjectile && Physics.Raycast(new Vector3(((BroforceObject)this).X - Mathf.Sign(((BroforceObject)this).xI) * ((Projectile)this).projectileSize * 2f, ((BroforceObject)this).Y, 0f), new Vector3(((BroforceObject)this).xI, ((BroforceObject)this).yI, 0f), ref ((Projectile)this).raycastHit, ((Projectile)this).projectileSize * 3f, LayerMask.op_Implicit(((Projectile)this).friendlyBarrierLayer))) || (!((Projectile)this).horizontalProjectile && Physics.Raycast(new Vector3(((BroforceObject)this).X, ((BroforceObject)this).Y, 0f), new Vector3(((BroforceObject)this).xI, ((BroforceObject)this).yI, 0f), ref ((Projectile)this).raycastHit, ((Projectile)this).projectileSize + ((Projectile)this).startProjectileSpeed * ((Projectile)this).t, LayerMask.op_Implicit(((Projectile)this).friendlyBarrierLayer))))
		{
			((Projectile)this).ReflectProjectile(((Projectile)this).raycastHit);
		}
		((Projectile)this).CheckSpawnPointFragile();
	}

	protected override void RunProjectile(float t)
	{
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		((Projectile)this).RunProjectile(t);
		returnTime -= t;
		collectDelayTime -= t;
		if (returnTime <= 0f && !dropping)
		{
			if (((BroforceObject)this).Y < -50f)
			{
				ReturnShield(((Projectile)this).firedBy);
			}
			if (shouldBoomerang)
			{
				if (!hasReachedApex && (double)speed < 0.5 * (double)originalSpeed)
				{
					hasReachedApex = true;
					seekTurningSpeedLerpM = 3f;
					seekTurningSpeedM = 20f;
					seekSpeedCurrent = seekTurningSpeedM / 10f;
					BeginReturnSeek();
				}
				else if (hasReachedApex)
				{
					ReturnSeek();
				}
				CheckReturnShield();
			}
			else if (!shouldBoomerang)
			{
				StartDropping();
			}
			if (shouldBoomerang && hasReachedApex && !startedSnap && Vector3.Distance(((Component)this).transform.position, ((Component)throwingPlayer).transform.position) < 100f)
			{
				startedSnap = true;
				seekTurningSpeedLerpM = 60f;
				seekTurningSpeedM = 20f;
			}
		}
		if (!dropping)
		{
			float num = 140f + Mathf.Abs(((BroforceObject)this).xI) * 0.5f;
			if (speed != 0f && Time.timeScale > 0f)
			{
				float pitch = Mathf.Clamp(num / Mathf.Abs(speed) * 1.2f * shieldLoopPitchM, 0.5f * shieldLoopPitchM, 1f * shieldLoopPitchM) * Time.timeScale;
				((Component)this).GetComponent<AudioSource>().pitch = pitch;
			}
			((Component)this).transform.Rotate(0f, 0f, num * rotationSpeed * t, (Space)1);
			windCounter += t;
			if (windCounter > 0.0667f)
			{
				windCount++;
				windCounter -= 0.0667f;
				EffectsController.CreateBoomerangWindEffect(((BroforceObject)this).X, ((BroforceObject)this).Y, 5f, 0f, 0f, ((Component)this).transform, 0f, (float)(windCount * 27) * rotationSpeed);
			}
		}
		else
		{
			((Component)this).transform.Rotate(0f, 0f, rotationSpeed * t, (Space)1);
			CheckReturnShield();
		}
		if (Mathf.Sign(lastXI) != Mathf.Sign(((BroforceObject)this).xI))
		{
			alreadyHit.Clear();
		}
		lastXI = ((BroforceObject)this).xI;
	}

	protected void BeginReturnSeek()
	{
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		foundMook = true;
		targetX = ((BroforceObject)throwingPlayer).X;
		targetY = ((BroforceObject)throwingPlayer).Y + ((Unit)throwingPlayer).height + 5f;
		float num = targetX - ((BroforceObject)this).X;
		float num2 = targetY - ((BroforceObject)this).Y;
		targetAngle = Math.GetAngle(num2, num);
		DetermineReturnAngle(((Component)throwingPlayer).transform.position);
	}

	protected void ReturnSeek()
	{
		CalculateSeek(((BroforceObject)throwingPlayer).X, ((BroforceObject)throwingPlayer).Y);
	}

	protected void DetermineReturnAngle(Vector3 playerPos)
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: 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_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: 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_00e6: 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_0145: Unknown result type (might be due to invalid IL or missing references)
		//IL_0156: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ad: 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_01f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0217: Unknown result type (might be due to invalid IL or missing references)
		//IL_021e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0223: 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)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		//IL_0244: Unknown result type (might be due to invalid IL or missing references)
		//IL_0249: Unknown result type (might be due to invalid IL or missing references)
		//IL_024e: Unknown result type (might be due to invalid IL or missing references)
		//IL_025c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0261: Unknown result type (might be due to invalid IL or missing references)
		//IL_0268: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0300: Unknown result type (might be due to invalid IL or missing references)
		//IL_0308: Unknown result type (might be due to invalid IL or missing references)
		//IL_031c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0321: Unknown result type (might be due to invalid IL or missing references)
		//IL_0326: Unknown result type (might be due to invalid IL or missing references)
		//IL_0334: Unknown result type (might be due to invalid IL or missing references)
		//IL_0339: Unknown result type (might be due to invalid IL or missing references)
		//IL_0341: Unknown result type (might be due to invalid IL or missing references)
		bool flag = false;
		bool flag2 = false;
		if (Physics.Raycast(new Vector3(((BroforceObject)this).X, ((BroforceObject)this).Y, 0f), Vector3.down, ref ((Projectile)this).raycastHit, 100f, LayerMask.op_Implicit(((Projectile)this).groundLayer)))
		{
			float num = Vector3.Distance(((Component)this).transform.position, ((RaycastHit)(ref ((Projectile)this).raycastHit)).point);
			flag2 = num < 100f;
		}
		if (Physics.Raycast(new Vector3(((BroforceObject)this).X, ((BroforceObject)this).Y, 0f), Vector3.up, ref ((Projectile)this).raycastHit, 100f, LayerMask.op_Implicit(((Projectile)this).groundLayer)))
		{
			flag = Vector3.Distance(((Component)this).transform.position, ((RaycastHit)(ref ((Projectile)this).raycastHit)).point) < 100f;
		}
		if (Physics.Raycast(playerPos, Vector3.down, ref ((Projectile)this).raycastHit, 100f, LayerMask.op_Implicit(((Projectile)this).groundLayer)))
		{
			float num = Vector3.Distance(playerPos, ((RaycastHit)(ref ((Projectile)this).raycastHit)).point);
			flag2 = flag2 || num < 50f;
		}
		if (Physics.Raycast(playerPos, Vector3.down, ref ((Projectile)this).raycastHit, 100f, LayerMask.op_Implicit(ladderLayer)))
		{
			float num = Vector3.Distance(playerPos, ((RaycastHit)(ref ((Projectile)this).raycastHit)).point);
			flag2 = flag2 || num < 50f;
		}
		if (Physics.Raycast(playerPos, Vector3.up, ref ((Projectile)this).raycastHit, 100f, LayerMask.op_Implicit(((Projectile)this).groundLayer)) && Vector3.Distance(playerPos, ((RaycastHit)(ref ((Projectile)this).raycastHit)).point) < 100f)
		{
			flag = (flag2 = true);
		}
		if (Physics.Raycast(playerPos, Vector3.up, ref ((Projectile)this).raycastHit, 100f, LayerMask.op_Implicit(ladderLayer)) && Vector3.Distance(playerPos, ((RaycastHit)(ref ((Projectile)this).raycastHit)).point) < 100f)
		{
			flag = (flag2 = true);
		}
		if ((flag2 && flag) || Mathf.Sign(((BroforceObject)this).xI) == Mathf.Sign(playerPos.x - ((BroforceObject)this).X))
		{
			angle = targetAngle;
		}
		else if (flag2)
		{
			Vector3 val = playerPos;
			val.y += ((Unit)throwingPlayer).height + 2f;
			Vector3 val2 = val - ((Component)this).transform.position;
			if (Physics.Raycast(((Component)this).transform.position + new Vector3(0f, 30f, 0f), val2, ref ((Projectile)this).raycastHit, Vector3.Distance(((Component)this).transform.position, val), LayerMask.op_Implicit(((Projectile)this).groundLayer)))
			{
				angle = targetAngle;
			}
			else if (((BroforceObject)this).xI > 0f)
			{
				angle -= (float)Math.PI / 4f;
			}
			else if (((BroforceObject)this).xI < 0f)
			{
				angle += (float)Math.PI / 4f;
			}
		}
		else if (flag)
		{
			Vector3 val3 = playerPos;
			val3.y += ((Unit)throwingPlayer).height + 2f;
			Vector3 val4 = val3 - ((Component)this).transform.position;
			if (Physics.Raycast(((Component)this).transform.position - new Vector3(0f, 30f, 0f), val4, ref ((Projectile)this).raycastHit, Vector3.Distance(((Component)this).transform.position, val3), LayerMask.op_Implicit(((Projectile)this).groundLayer)))
			{
				angle = targetAngle;
			}
			else if (((BroforceObject)this).xI > 0f)
			{
				angle += (float)Math.PI / 4f;
			}
			else if (((BroforceObject)this).xI < 0f)
			{
				angle -= (float)Math.PI / 4f;
			}
		}
	}

	protected override void MoveProjectile()
	{
		//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
		if (!stopSeeking && !dropping)
		{
			RunSeeking();
			if (targetAngle > angle + (float)Math.PI)
			{
				angle += (float)Math.PI * 2f;
			}
			else if (targetAngle < angle - (float)Math.PI)
			{
				angle -= (float)Math.PI * 2f;
			}
			if (((Projectile)this).reversing)
			{
				if (((Projectile)this).IsHeldByZone())
				{
					speed *= 1f - ((Projectile)this).t * 8f;
				}
				else
				{
					speed = Mathf.Lerp(speed, originalSpeed, ((Projectile)this).t * 8f);
				}
			}
			else if (returnTime >= 0f || hasReachedApex)
			{
				speed = Mathf.Lerp(speed, originalSpeed, ((Projectile)this).t * 10f);
			}
			else if (shouldBoomerang)
			{
				speed = Mathf.Lerp(speed, 0f, ((Projectile)this).t * 10f);
			}
			else
			{
				speed *= 1f - ((Projectile)this).t * 0.5f;
			}
			if (!dropping)
			{
				seekSpeedCurrent = Mathf.Lerp(seekSpeedCurrent, seekTurningSpeedM, seekTurningSpeedLerpM * ((Projectile)this).t);
				angle = Mathf.Lerp(angle, targetAngle, ((Projectile)this).t * seekSpeedCurrent);
				Vector2 val = Math.Point2OnCircle(angle, speed);
				((BroforceObject)this).xI = val.x;
				((BroforceObject)this).yI = val.y;
			}
			else
			{
				((BroforceObject)this).xI = ((BroforceObject)this).xI * (1f - ((Projectile)this).t * 0.3f);
			}
		}
		((Projectile)this).MoveProjectile();
		((Component)shieldCollider).transform.position = ((Component)this).transform.position;
		if (dropping)
		{
			if (spawnedByTrigger && !SortOfFollow.IsItSortOfVisible(((Component)this).transform.position))
			{
				((BroforceObject)this).xI = (((BroforceObject)this).yI = 0f);
			}
			else
			{
				ApplyGravity();
			}
		}
	}

	protected void RunSeeking()
	{
		if (!((Projectile)this).IsHeldByZone())
		{
			seekCounter += ((Projectile)this).t;
			if (seekCounter > 0.1f)
			{
				seekCounter -= 0.03f;
				CalculateSeek();
			}
		}
	}

	protected void CalculateSeek(float manualTargetX, float manualTargetY)
	{
		foundMook = true;
		targetX = manualTargetX;
		targetY = manualTargetY + ((Unit)throwingPlayer).height + 2f;
		float num = targetX - ((BroforceObject)this).X;
		float num2 = targetY - ((BroforceObject)this).Y;
		targetAngle = Math.GetAngle(num2, num);
	}

	protected void CalculateSeek()
	{
		if (!foundMook)
		{
			Unit nearestVisibleUnitDamagebleBy = Map.GetNearestVisibleUnitDamagebleBy(((Projectile)this).playerNum, (int)seekRange, ((BroforceObject)this).X, ((BroforceObject)this).Y, false);
			if ((Object)(object)nearestVisibleUnitDamagebleBy != (Object)null && ((Component)nearestVisibleUnitDamagebleBy).gameObject.activeInHierarchy && !alreadyHit.Contains(nearestVisibleUnitDamagebleBy) && Mathf.Sign(((BroforceObject)nearestVisibleUnitDamagebleBy).X - ((BroforceObject)this).X) == Mathf.Sign(((BroforceObject)this).xI))
			{
				foundMook = true;
				targetX = ((BroforceObject)nearestVisibleUnitDamagebleBy).X;
				targetY = ((BroforceObject)nearestVisibleUnitDamagebleBy).Y + ((Unit)throwingPlayer).height + 4f;
			}
			else
			{
				targetX = ((BroforceObject)this).X + ((BroforceObject)this).xI;
				targetY = ((BroforceObject)this).Y + ((BroforceObject)this).yI;
			}
		}
		float num = targetX - ((BroforceObject)this).X;
		float num2 = targetY - ((BroforceObject)this).Y;
		targetAngle = Math.GetAngle(num2, num);
	}

	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(((Projectile)this).playerNum, ((Projectile)this).damageInternal, ((Projectile)this).damageType, ((Projectile)this).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 ((Projectile)this).raycastHit)).normal, ((RaycastHit)(ref ((Projectile)this).raycastHit)).point);
		}
	}

	protected override bool HitWalls()
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: 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_03aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_03af: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: 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_03f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0412: Unknown result type (might be due to invalid IL or missing references)
		//IL_070d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0712: Unknown result type (might be due to invalid IL or missing references)
		//IL_0738: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_010d: 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_0152: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		//IL_0871: Unknown result type (might be due to invalid IL or missing references)
		//IL_0876: Unknown result type (might be due to invalid IL or missing references)
		//IL_089c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0463: Unknown result type (might be due to invalid IL or missing references)
		//IL_0473: Unknown result type (might be due to invalid IL or missing references)
		//IL_048a: Unknown result type (might be due to invalid IL or missing references)
		//IL_049a: Unknown result type (might be due to invalid IL or missing references)
		//IL_04cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0587: Unknown result type (might be due to invalid IL or missing references)
		//IL_0591: Expected O, but got Unknown
		//IL_0593: Unknown result type (might be due to invalid IL or missing references)
		//IL_0905: Unknown result type (might be due to invalid IL or missing references)
		//IL_090f: Expected O, but got Unknown
		//IL_0817: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b8: Expected O, but got Unknown
		//IL_05fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0607: Expected O, but got Unknown
		//IL_0609: 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_022b: Expected O, but got Unknown
		//IL_022d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0695: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0673: Unknown result type (might be due to invalid IL or missing references)
		//IL_067d: Expected O, but got Unknown
		//IL_067f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0297: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a1: Expected O, but got Unknown
		//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_032f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0351: Unknown result type (might be due to invalid IL or missing references)
		//IL_030d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0317: Expected O, but got Unknown
		//IL_0319: Unknown result type (might be due to invalid IL or missing references)
		if (((BroforceObject)this).xI < 0f)
		{
			if (Physics.Raycast(new Vector3(((BroforceObject)this).X + 4f, ((BroforceObject)this).Y + 4f, 0f), Vector3.left, ref ((Projectile)this).raycastHit, 6f + heightOffGround, LayerMask.op_Implicit(((Projectile)this).groundLayer)) || Physics.Raycast(new Vector3(((BroforceObject)this).X + 4f, ((BroforceObject)this).Y - 4f, 0f), Vector3.left, ref ((Projectile)this).raycastHit, 6f + heightOffGround, LayerMask.op_Implicit(((Projectile)this).groundLayer)))
			{
				collectDelayTime = 0f;
				if (Mathf.Abs(((BroforceObject)this).xI) > Mathf.Abs(shieldSpeed) * 0.33f && !hasReachedApex)
				{
					EffectsController.CreateSuddenSparkShower(((RaycastHit)(ref ((Projectile)this).raycastHit)).point.x + ((RaycastHit)(ref ((Projectile)this).raycastHit)).normal.x * 3f, ((RaycastHit)(ref ((Projectile)this).raycastHit)).point.y + ((RaycastHit)(ref ((Projectile)this).raycastHit)).normal.y * 3f, ((Projectile)this).sparkCount / 2, 2f, 40f + Random.value * 80f, ((RaycastHit)(ref ((Projectile)this).raycastHit)).normal.x * (100f + Random.value * 210f), ((RaycastHit)(ref ((Projectile)this).raycastHit)).normal.y * 120f + (-60f + Random.value * 350f), 0.2f);
				}
				float num = (dropping ? 0.3f : 1f);
				((BroforceObject)this).xI = ((BroforceObject)this).xI * ((0f - bounceXM) * num);
				if ((Object)(object)((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<Block>() != (Object)null && !hasReachedApex)
				{
					((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<Block>().Damage(new DamageObject(2, (DamageType)14, ((BroforceObject)this).xI, ((BroforceObject)this).yI, ((BroforceObject)this).X, ((BroforceObject)this).Y, (MonoBehaviour)(object)this));
					HitBlock(((Projectile)this).raycastHit);
				}
				else if ((Object)(object)((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<BossBlockPiece>() != (Object)null && !hasReachedApex)
				{
					((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<BossBlockPiece>().Damage(new DamageObject(bossDamage, (DamageType)14, ((BroforceObject)this).xI, ((BroforceObject)this).yI, ((BroforceObject)this).X, ((BroforceObject)this).Y, (MonoBehaviour)(object)this));
					HitBlock(((Projectile)this).raycastHit);
				}
				else if ((Object)(object)((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<BossBlockWeapon>() != (Object)null && !hasReachedApex)
				{
					((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<BossBlockWeapon>().Damage(new DamageObject(bossDamage, (DamageType)14, ((BroforceObject)this).xI, ((BroforceObject)this).yI, ((BroforceObject)this).X, ((BroforceObject)this).Y, (MonoBehaviour)(object)this));
					HitBlock(((Projectile)this).raycastHit);
				}
				else if (!hasReachedApex)
				{
					HitBlock(((Projectile)this).raycastHit);
					((Projectile)this).ProjectileApplyDamageToBlock(((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject, bossDamage, ((Projectile)this).damageType, ((BroforceObject)this).xI, ((BroforceObject)this).yI);
				}
				if (!hasReachedApex)
				{
					PlayBounceSoundWall();
				}
			}
		}
		else if (((BroforceObject)this).xI > 0f && (Physics.Raycast(new Vector3(((BroforceObject)this).X - 4f, ((BroforceObject)this).Y + 4f, 0f), Vector3.right, ref ((Projectile)this).raycastHit, 4f + heightOffGround, LayerMask.op_Implicit(((Projectile)this).groundLayer)) || Physics.Raycast(new Vector3(((BroforceObject)this).X - 4f, ((BroforceObject)this).Y - 4f, 0f), Vector3.right, ref ((Projectile)this).raycastHit, 4f + heightOffGround, LayerMask.op_Implicit(((Projectile)this).groundLayer))))
		{
			collectDelayTime = 0f;
			if (Mathf.Abs(((BroforceObject)this).xI) > Mathf.Abs(shieldSpeed) * 0.33f && !hasReachedApex)
			{
				EffectsController.CreateSuddenSparkShower(((RaycastHit)(ref ((Projectile)this).raycastHit)).point.x + ((RaycastHit)(ref ((Projectile)this).raycastHit)).normal.x * 3f, ((RaycastHit)(ref ((Projectile)this).raycastHit)).point.y + ((RaycastHit)(ref ((Projectile)this).raycastHit)).normal.y * 3f, ((Projectile)this).sparkCount / 2, 2f, 40f + Random.value * 80f, ((RaycastHit)(ref ((Projectile)this).raycastHit)).normal.x * (100f + Random.value * 210f), ((RaycastHit)(ref ((Projectile)this).raycastHit)).normal.y * 120f + (-60f + Random.value * 350f), 0.2f);
			}
			((BroforceObject)this).xI = ((BroforceObject)this).xI * (0f - bounceXM);
			if ((Object)(object)((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<Block>() != (Object)null && !hasReachedApex)
			{
				((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<Block>().Damage(new DamageObject(2, (DamageType)14, ((BroforceObject)this).xI, ((BroforceObject)this).yI, ((BroforceObject)this).X, ((BroforceObject)this).Y, (MonoBehaviour)(object)this));
				HitBlock(((Projectile)this).raycastHit);
			}
			else if ((Object)(object)((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<BossBlockPiece>() != (Object)null && !hasReachedApex)
			{
				((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<BossBlockPiece>().Damage(new DamageObject(bossDamage, (DamageType)14, ((BroforceObject)this).xI, ((BroforceObject)this).yI, ((BroforceObject)this).X, ((BroforceObject)this).Y, (MonoBehaviour)(object)this));
				HitBlock(((Projectile)this).raycastHit);
			}
			else if ((Object)(object)((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<BossBlockWeapon>() != (Object)null && !hasReachedApex)
			{
				((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<BossBlockWeapon>().Damage(new DamageObject(bossDamage, (DamageType)14, ((BroforceObject)this).xI, ((BroforceObject)this).yI, ((BroforceObject)this).X, ((BroforceObject)this).Y, (MonoBehaviour)(object)this));
				HitBlock(((Projectile)this).raycastHit);
			}
			else if (!hasReachedApex)
			{
				HitBlock(((Projectile)this).raycastHit);
				((Projectile)this).ProjectileApplyDamageToBlock(((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject, bossDamage, ((Projectile)this).damageType, ((BroforceObject)this).xI, ((BroforceObject)this).yI);
			}
			if (!hasReachedApex)
			{
				PlayBounceSoundWall();
			}
		}
		if (dropping)
		{
			if (((BroforceObject)this).yI < 0f)
			{
				if (Physics.Raycast(new Vector3(((BroforceObject)this).X, ((BroforceObject)this).Y + 6f, 0f), Vector3.down, ref ((Projectile)this).raycastHit, 6f + heightOffGround - ((BroforceObject)this).yI * ((Projectile)this).t, LayerMask.op_Implicit(((Projectile)this).groundLayer)))
				{
					stopSeeking = true;
					if ((Object)(object)((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<Block>() != (Object)null && ((BroforceObject)this).yI < -30f)
					{
						((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<Block>().Damage(new DamageObject(0, (DamageType)14, ((BroforceObject)this).xI, ((BroforceObject)this).yI, ((BroforceObject)this).X, ((BroforceObject)this).Y, (MonoBehaviour)(object)this));
					}
					((BroforceObject)this).xI = ((BroforceObject)this).xI * frictionM;
					if (((BroforceObject)this).yI < -40f)
					{
						float num2 = (dropping ? 0.4f : 1f);
						((BroforceObject)this).yI = ((BroforceObject)this).yI * ((0f - bounceYM) * num2);
					}
					else
					{
						((BroforceObject)this).yI = 0f;
						((BroforceObject)this).Y = ((RaycastHit)(ref ((Projectile)this).raycastHit)).point.y + heightOffGround;
					}
					rotationSpeed = -10f * ((BroforceObject)this).xI;
					PlayBounceSoundWall();
				}
			}
			else if (((BroforceObject)this).yI > 0f && Physics.Raycast(new Vector3(((BroforceObject)this).X, ((BroforceObject)this).Y - 6f, 0f), Vector3.up, ref ((Projectile)this).raycastHit, 6f + heightOffGround + ((BroforceObject)this).yI * ((Projectile)this).t, LayerMask.op_Implicit(((Projectile)this).groundLayer)))
			{
				stopSeeking = true;
				if ((Object)(object)((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<Block>() != (Object)null)
				{
					((Component)((RaycastHit)(ref ((Projectile)this).raycastHit)).collider).gameObject.GetComponent<Block>().Damage(new DamageObject(0, (DamageType)14, ((BroforceObject)this).xI, ((BroforceObject)this).yI, ((BroforceObject)this).X, ((BroforceObject)this).Y, (MonoBehaviour)(object)this));
				}
				float num3 = (dropping ? 0.4f : 1f);
				((BroforceObject)this).yI = ((BroforceObject)this).yI * ((0f - (bounceYM + 0.1f)) * num3);
				PlayBounceSoundWall();
				rotationSpeed = -10f * ((BroforceObject)this).xI;
			}
		}
		return true;
	}

	protected void HitBlock(RaycastHit raycastHit)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		((Projectile)this).Bounce(raycastHit);
		if (returnTime > 0f)
		{
			returnTime = 0f;
		}
		bounceCount--;
	}

	protected override void RunDamageBackground(float t)
	{
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		if (((Projectile)this).damagedBackground)
		{
			return;
		}
		((Projectile)this).damageBackgroundCounter = ((Projectile)this).damageBackgroundCounter + t;
		if (((Projectile)this).damageBackgroundCounter > 0f)
		{
			((Projectile)this).damageBackgroundCounter = ((Projectile)this).damageBackgroundCounter - t * 2f;
			bool flag = default(bool);
			if (Map.DamageDoodads(((Projectile)this).damageInternal, ((Projectile)this).damageType, ((BroforceObject)this).X, ((BroforceObject)this).Y, ((BroforceObject)this).xI, ((BroforceObject)this).yI, ((Projectile)this).projectileSize, ((Projectile)this).playerNum, ref flag, (MonoBehaviour)(object)this))
			{
				((Projectile)this).damagedBackground = true;
				EffectsController.CreateEffect(((Projectile)this).flickPuff, ((BroforceObject)this).X, ((BroforceObject)this).Y);
			}
			if (((Projectile)this).affectScenery && Map.PassThroughScenery(((BroforceObject)this).X, ((BroforceObject)this).Y, ((BroforceObject)this).xI, ((BroforceObject)this).yI))
			{
				((Projectile)this).damageBackgroundCounter = ((Projectile)this).damageBackgroundCounter - 0.33f;
			}
		}
	}

	public void StartDropping()
	{
		dropping = true;
		collectDelayTime = 0f;
		rotationSpeed = -10f * ((BroforceObject)this).xI;
		((Component)this).GetComponent<AudioSource>().Stop();
		((Collider)shieldCollider).enabled = false;
		stopSeeking = true;
	}

	protected void PlayBounceSoundWall()
	{
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		float num = Mathf.Abs(((BroforceObject)this).xI) + Mathf.Abs(((BroforceObject)this).yI);
		if (num > 33f)
		{
			float num2 = num / 210f;
			float num3 = 0.05f + Mathf.Clamp(num2 * num2, 0f, 0.25f);
			if (dropping)
			{
				float num4 = Mathf.Clamp01(num / 300f);
				num3 *= num4 * 0.5f;
			}
			Sound.GetInstance().PlaySoundEffectAt(shieldUnitBounce, num3 * bounceVolumeM, ((Component)this).transform.position, 1f, true, false, false, 0f);
		}
	}

	protected void PlayBounceSoundUnit()
	{
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		float num = Mathf.Abs(((BroforceObject)this).xI) + Mathf.Abs(((BroforceObject)this).yI);
		if (num > 33f)
		{
			float num2 = num / 210f;
			float num3 = 0.05f + Mathf.Clamp(num2 * num2, 0f, 0.25f);
			if (dropping)
			{
				float num4 = Mathf.Clamp01(num / 300f);
				num3 *= num4 * 0.5f;
			}
			Sound.GetInstance().PlaySoundEffectAt(shieldUnitBounce, num3 * bounceVolumeM, ((Component)this).transform.position, 1f, true, false, false, 0f);
		}
	}

	protected override void RunLife()
	{
	}

	protected override void Bounce(RaycastHit raycastHit)
	{
		//IL_0045: 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_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		if (returnTime > 0f)
		{
			((BroforceObject)this).xI = 0f;
			returnTime = 0f;
		}
		Vector3 val = default(Vector3);
		((Vector3)(ref val))..ctor(Math.Cos(angle), Math.Sin(angle), 0f);
		Vector3 val2 = val - 2f * Vector3.Dot(val, ((RaycastHit)(ref raycastHit)).normal) * ((RaycastHit)(ref raycastHit)).normal;
		angle = Mathf.Atan(val2.y / val2.x);
		targetAngle = angle;
		speed = 0.9f * speed;
		Vector2 val3 = Math.Point2OnCircle(angle, speed);
		((BroforceObject)this).xI = val3.x;
		((BroforceObject)this).yI = val3.y;
		foundMook = false;
	}

	protected override void HitUnits()
	{
		//IL_006f: 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_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		if (dropping && Mathf.Abs(((BroforceObject)this).xI) < 10f && Mathf.Abs(((BroforceObject)this).yI) < 10f)
		{
			return;
		}
		if (hitUnitsDelay > 0f)
		{
			hitUnitsDelay -= ((Projectile)this).t;
		}
		else if (((Projectile)this).reversing || hasReachedApex)
		{
			if (Map.HitLivingUnits((MonoBehaviour)(object)this, ((Projectile)this).playerNum, ((Projectile)this).damag