Decompiled source of BlammCo Catalogue v2.2.1

plugins/TF2Items.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Alexandria.BreakableAPI;
using Alexandria.CharacterAPI;
using Alexandria.ItemAPI;
using Alexandria.Misc;
using Alexandria.SoundAPI;
using Alexandria.VisualAPI;
using BepInEx;
using Dungeonator;
using Gungeon;
using HarmonyLib;
using InControl;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using TF2Items;
using TF2Stuff;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Mod")]
[assembly: AssemblyCopyright("Copyright ©  2020")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("d6d7a494-722e-4763-959b-c2d6b6a42b01")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class JarateGoop : SpecialGoopBehaviourDoer
{
	public static void Init()
	{
		//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_003b: Unknown result type (might be due to invalid IL or missing references)
		CustomGoops.JarateGoop = ScriptableObject.CreateInstance<GoopDefinition>();
		CustomGoops.JarateGoop.CanBeIgnited = false;
		CustomGoops.JarateGoop.damagesEnemies = false;
		CustomGoops.JarateGoop.damagesPlayers = false;
		CustomGoops.JarateGoop.baseColor32 = Color32.op_Implicit(MoreColours.jarateyellow);
		CustomGoops.JarateGoop.goopTexture = GoopUtility.WaterDef.goopTexture;
		CustomGoops.JarateGoop.usesLifespan = true;
		CustomGoops.JarateGoop.lifespan = 30f;
		((Object)CustomGoops.JarateGoop).name = "piss";
		GoopUtility.RegisterComponentToGoopDefinition(CustomGoops.JarateGoop, typeof(JarateGoop));
	}

	public override void DoGoopEffectUpdate(DeadlyDeadlyGoopManager goop, GameActor actor, IntVector2 position)
	{
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)actor) && (!((BraveBehaviour)actor).aiAnimator.IsPlaying("spawn") || ((BraveBehaviour)actor).aiAnimator.IsPlaying("awaken")) && Object.op_Implicit((Object)(object)((BraveBehaviour)actor).healthHaver) && !((BraveBehaviour)actor).healthHaver.IsBoss)
		{
			actor.ApplyEffect((GameActorEffect)(object)StaticStatusEffects.StandardJarateEffect, 1f, (Projectile)null);
		}
		((SpecialGoopBehaviourDoer)this).DoGoopEffectUpdate(goop, actor, position);
	}
}
namespace TF2Items
{
	public class TF2PlayerExtension : MonoBehaviour
	{
		public delegate void ModifyMaximumRollDepthDelegate(ref int maxDepth);

		public delegate void ModifyCanAttackProperty(ref bool canAttack);

		public ModifyMaximumRollDepthDelegate ModifyMaxRollDepth;

		public ModifyCanAttackProperty ModifyCanAttack;
	}
	public class TF2GrenadeProjectile : MonoBehaviour
	{
		private float activeTime = 0f;

		private ExplosiveModifier explode;

		private bool becameDebris = false;

		private bool debris_grounded = false;

		public Projectile self;

		public float fuseTime = 2.5f;

		public ExplosionData expsionData;

		public void Start()
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected O, but got Unknown
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Expected O, but got Unknown
			self = ((Component)this).GetComponent<Projectile>();
			if (expsionData != null)
			{
				explode = GameObjectExtensions.GetOrAddComponent<ExplosiveModifier>(((Component)self).gameObject);
				explode.explosionData = expsionData;
			}
			SpeculativeRigidbody specRigidbody = ((BraveBehaviour)self).specRigidbody;
			specRigidbody.OnTileCollision = (OnTileCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody.OnTileCollision, (Delegate?)new OnTileCollisionDelegate(OnCollision));
		}

		public void Update()
		{
			if ((Object)(object)((Component)this).gameObject != (Object)null)
			{
				fuseTime -= BraveTime.DeltaTime;
				if (fuseTime <= 0f && (Object)(object)explode != (Object)null && ((Behaviour)self).enabled && Object.op_Implicit((Object)(object)self))
				{
					self.DieInAir(true, true, true, false);
				}
			}
		}

		public void CorrectDirection(DebrisObject debris)
		{
			debris_grounded = true;
		}

		public IEnumerator HandleRoller(DebrisObject roller)
		{
			roller.angularVelocity = 180f;
			while (fuseTime > 0f)
			{
				while (!debris_grounded)
				{
					SpeculativeRigidbody specRigidbody = ((BraveBehaviour)roller).specRigidbody;
					specRigidbody.Velocity *= Mathf.Pow(0.8f, BraveTime.DeltaTime);
					roller.angularVelocity *= Mathf.Pow(0.8f, BraveTime.DeltaTime);
					yield return null;
				}
				roller.angularVelocity = 0f;
			}
			((Behaviour)self).enabled = true;
			self.DieInAir(false, true, true, false);
		}

		public void OnCollision(CollisionData collisiondata)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: 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_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			if (!becameDebris)
			{
				Vector2 val = collisiondata.MyRigidbody.Velocity;
				if (collisiondata.CollidedX)
				{
					val = Vector2Extensions.WithX(val, 0f - val.x);
				}
				if (collisiondata.CollidedY)
				{
					val = Vector2Extensions.WithY(val, 0f - val.y);
				}
				PhysicsEngine.PostSliceVelocity = val;
				DebrisObject val2;
				self.OnBecameDebris(val2 = self.BecomeDebris(Vector2.op_Implicit(val / 2f), 1f));
				((Behaviour)self).enabled = false;
				((MonoBehaviour)val2).StartCoroutine(HandleRoller(val2));
				val2.OnGrounded = (Action<DebrisObject>)Delegate.Combine(val2.OnGrounded, new Action<DebrisObject>(CorrectDirection));
			}
		}
	}
}
namespace TF2Stuff
{
	public class Dispenser : PlayerItem
	{
		public static int ID;

		public static string consoleID;

		public static GameObject DispenserObject;

		public static void Register()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Expected O, but got Unknown
			//IL_00d6: 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_0103: Unknown result type (might be due to invalid IL or missing references)
			string text = "Dispenser";
			string text2 = "TF2Items/Resources/actives/dispenser_001";
			GameObject val = new GameObject(text);
			Dispenser dispenser = val.AddComponent<Dispenser>();
			ItemBuilder.SetCooldownType((PlayerItem)(object)dispenser, (CooldownType)1, 500f);
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "Erectin'";
			string text4 = "UNCLE DANE THEME INTENSIFIES";
			ItemBuilder.SetupItem((PickupObject)(object)dispenser, text3, text4, "qad");
			((PlayerItem)dispenser).consumable = false;
			((PickupObject)dispenser).quality = (ItemQuality)3;
			consoleID = "qad:" + ETGMod.ToID(((Object)dispenser).name);
			ID = ((PickupObject)dispenser).PickupObjectId;
			DispenserObject = SpriteBuilder.SpriteFromResource("TF2Items/Resources/actives/dispenser_001", new GameObject("Spawned_Dispenser"), (Assembly)null);
			DispenserObject.SetActive(false);
			FakePrefab.MarkAsFakePrefab(DispenserObject);
			((tk2dBaseSprite)DispenserObject.GetComponent<tk2dSprite>()).HeightOffGround = 0.1f;
			SpeculativeRigidbody val2 = SpriteBuilder.SetUpSpeculativeRigidbody(DispenserObject.GetComponent<tk2dSprite>(), new IntVector2(0, -3), new IntVector2(20, 23));
			val2.CollideWithTileMap = false;
			val2.CollideWithOthers = true;
			val2.PrimaryPixelCollider.CollisionLayer = (CollisionLayer)6;
			DispenserObject.AddComponent<DispenserController>();
		}

		public override void DoEffect(PlayerController user)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: 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_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			Object.Instantiate<GameObject>(DispenserObject, ((BraveBehaviour)base.LastOwner).transform.position + ((Vector3)(ref base.LastOwner.m_cachedAimDirection)).normalized * 20f / 16f, Quaternion.identity);
		}

		public override void Pickup(PlayerController player)
		{
			((PlayerItem)this).Pickup(player);
		}

		public override bool CanBeUsed(PlayerController user)
		{
			return user.IsInCombat;
		}

		public DebrisObject Drop(PlayerController player)
		{
			return ((PlayerItem)this).Drop(player, 4f);
		}

		public override void OnDestroy()
		{
			((PlayerItem)this).OnDestroy();
		}
	}
	public class DispenserController : SpawnObjectItem
	{
		private void Start()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			RoomHandler roomFromPosition = GameManager.Instance.Dungeon.GetRoomFromPosition(Vector3Extensions.IntXY(((BraveBehaviour)this).transform.position, (VectorConversions)0));
			for (int i = 0; i < GameManager.Instance.AllPlayers.Length; i++)
			{
				((BraveBehaviour)this).specRigidbody.RegisterSpecificCollisionException(((BraveBehaviour)GameManager.Instance.AllPlayers[i]).specRigidbody);
			}
			AttractEnemies(roomFromPosition);
		}

		private void AttractEnemies(RoomHandler room)
		{
			List<AIActor> activeEnemies = room.GetActiveEnemies((ActiveEnemyType)0);
			if (activeEnemies == null)
			{
				return;
			}
			for (int i = 0; i < activeEnemies.Count; i++)
			{
				if ((Object)(object)activeEnemies[i].OverrideTarget == (Object)null)
				{
					activeEnemies[i].OverrideTarget = ((BraveBehaviour)this).specRigidbody;
				}
			}
		}
	}
	public class Disciplinary_Action : PlayerItem
	{
		public static int ID;

		public static string consoleID;

		private bool applied = false;

		private bool applied_p2 = false;

		private bool hitObject;

		private float m_timer = 0f;

		private StatModifier speed = StatModifier.Create((StatType)0, (ModifyMethod)1, 1.8f);

		private StatModifier shotSpeed = StatModifier.Create((StatType)1, (ModifyMethod)1, 1.2f);

		public static void Register()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			string text = "Disciplinary Action";
			string text2 = "TF2Items/Resources/actives/disciplinary_action_sprite";
			GameObject val = new GameObject(text);
			Disciplinary_Action disciplinary_Action = val.AddComponent<Disciplinary_Action>();
			ItemBuilder.SetCooldownType((PlayerItem)(object)disciplinary_Action, (CooldownType)0, 3f);
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "Violent Encouragement";
			string text4 = "Whip an enemy or a companion to give yourself a little boost. Enemies are stunned and take more damage and companions are \"lightly encouraged\" to up their game.";
			ItemBuilder.SetupItem((PickupObject)(object)disciplinary_Action, text3, text4, "qad");
			((PlayerItem)disciplinary_Action).consumable = false;
			((PickupObject)disciplinary_Action).quality = (ItemQuality)2;
			consoleID = "qad:" + ETGMod.ToID(((Object)disciplinary_Action).name);
			ID = ((PickupObject)disciplinary_Action).PickupObjectId;
		}

		private void EnableVFX(GameObject obj)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			ImprovedAfterImage orAddComponent = GameObjectExtensions.GetOrAddComponent<ImprovedAfterImage>(obj);
			orAddComponent.shadowTimeDelay = 0.1f;
			orAddComponent.targetHeight = 1f;
			orAddComponent.shadowLifetime = 0.5f;
			orAddComponent.dashColor = MoreColours.lightgrey;
			orAddComponent.OverrideImageShader = ShaderCache.Acquire("Brave/Internal/DownwellAfterImage");
			orAddComponent.spawnShadows = true;
		}

		private void DisableVFX(GameObject obj)
		{
			ImprovedAfterImage orAddComponent = GameObjectExtensions.GetOrAddComponent<ImprovedAfterImage>(obj);
			orAddComponent.spawnShadows = false;
		}

		public override void DoEffect(PlayerController user)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			hitObject = false;
			SlashData val = ScriptableObject.CreateInstance<SlashData>();
			val.damage = 3f * user.stats.GetStatValue((StatType)5);
			val.projInteractMode = (ProjInteractMode)0;
			val.slashRange = 3f;
			val.enemyKnockbackForce = 2f * user.stats.GetStatValue((StatType)12);
			((MonoBehaviour)user).StartCoroutine(DoSlash(user, val));
		}

		private IEnumerator DoSlash(PlayerController user, SlashData slashParameters)
		{
			_ = ((GameActor)user).CenterPosition;
			float angleToUse = ((GameActor)user).CurrentGun.CurrentAngle;
			slashParameters.OnHitTarget = (Action<GameActor, bool>)Delegate.Combine(slashParameters.OnHitTarget, new Action<GameActor, bool>(OnSlashedEnemy));
			if (Random.value < 0.5f)
			{
				AkSoundEngine.PostEvent("Play_whip_woosh_01", ((Component)this).gameObject);
			}
			else
			{
				AkSoundEngine.PostEvent("Play_whip_woosh_02", ((Component)this).gameObject);
			}
			SlashDoer.DoSwordSlash(((GameActor)user).CenterPosition, angleToUse, (GameActor)(object)user, slashParameters, (Transform)null);
			CheckCompanionSlashed(user, slashParameters, angleToUse);
			yield break;
		}

		private void OnSlashedEnemy(GameActor enemy, bool fatal)
		{
			if (Random.value < 0.5f)
			{
				AkSoundEngine.PostEvent("Play_whip_impact_01", ((Component)this).gameObject);
			}
			else
			{
				AkSoundEngine.PostEvent("Play_whip_impact_02", ((Component)this).gameObject);
			}
			float num = 2.5f;
			if (Object.op_Implicit((Object)(object)((BraveBehaviour)enemy).healthHaver) && !((BraveBehaviour)enemy).healthHaver.IsBoss)
			{
				((BraveBehaviour)enemy).behaviorSpeculator.Stun(3f, true);
			}
			if (((BraveBehaviour)enemy).healthHaver.IsBoss)
			{
				num *= 2f;
			}
			((MonoBehaviour)GameManager.Instance).StartCoroutine(HandleEnemyEffect(enemy));
			PlayerController lastOwner = base.LastOwner;
			DoBuff(lastOwner, num);
			hitObject = true;
		}

		public void CheckCompanionSlashed(PlayerController currentPlayer, SlashData data, float angleOfSlash)
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: 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_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: 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_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			List<AIActor> companions = currentPlayer.companions;
			PlayerController val = null;
			if ((Object)(object)GameManager.Instance.SecondaryPlayer != (Object)null)
			{
				val = (currentPlayer.IsPrimaryPlayer ? GameManager.Instance.SecondaryPlayer : GameManager.Instance.PrimaryPlayer);
				companions.AddRange(val.companions);
			}
			if ((Object)(object)val != (Object)null && ObjectWasHitBySlash(((BraveBehaviour)val).sprite.WorldCenter, ((GameActor)currentPlayer).CenterPosition, angleOfSlash, data.slashRange, data.slashDegrees))
			{
				DoBuff(currentPlayer, 3f, val);
				PixelCollider hitboxPixelCollider = ((BraveBehaviour)val).specRigidbody.HitboxPixelCollider;
				Vector2 val2 = BraveMathCollege.ClosestPointOnRectangle(((GameActor)currentPlayer).CenterPosition, hitboxPixelCollider.UnitBottomLeft, hitboxPixelCollider.UnitDimensions);
				data.hitVFX.SpawnAtPosition(new Vector3(val2.x, val2.y), 0f, ((BraveBehaviour)val).transform, (Vector2?)null, (Vector2?)null, (float?)null, false, (SpawnMethod)null, (tk2dBaseSprite)null, false);
				hitObject = true;
			}
			foreach (AIActor item in companions)
			{
				if (!Object.op_Implicit((Object)(object)item) || !Object.op_Implicit((Object)(object)((BraveBehaviour)item).aiActor))
				{
					continue;
				}
				PixelCollider hitboxPixelCollider2 = ((BraveBehaviour)item).specRigidbody.HitboxPixelCollider;
				if (ObjectWasHitBySlash(((BraveBehaviour)item).sprite.WorldCenter, ((GameActor)currentPlayer).CenterPosition, angleOfSlash, data.slashRange, data.slashDegrees))
				{
					Vector2 val3 = BraveMathCollege.ClosestPointOnRectangle(((GameActor)currentPlayer).CenterPosition, hitboxPixelCollider2.UnitBottomLeft, hitboxPixelCollider2.UnitDimensions);
					if (Random.value < 0.5f)
					{
						AkSoundEngine.PostEvent("Play_whip_impact_01", ((Component)this).gameObject);
					}
					else
					{
						AkSoundEngine.PostEvent("Play_whip_impact_02", ((Component)this).gameObject);
					}
					data.hitVFX.SpawnAtPosition(new Vector3(val3.x, val3.y), 0f, ((BraveBehaviour)item).transform, (Vector2?)null, (Vector2?)null, (float?)null, false, (SpawnMethod)null, (tk2dBaseSprite)null, false);
					DoBuff(currentPlayer, 2f);
					((MonoBehaviour)GameManager.Instance).StartCoroutine(HandleCompanionEffect(item));
					hitObject = true;
				}
			}
		}

		private IEnumerator HandleEnemyEffect(GameActor enemy)
		{
			DamageTypeModifier damageBonus = new DamageTypeModifier();
			damageBonus.damageMultiplier = (((BraveBehaviour)enemy).healthHaver.IsBoss ? 1.2f : 1.5f);
			damageBonus.damageType = (CoreDamageTypes)0;
			((BraveBehaviour)enemy).healthHaver.damageTypeModifiers.Add(damageBonus);
			yield return (object)new WaitForSeconds(3f);
			((BraveBehaviour)enemy).healthHaver.damageTypeModifiers.Remove(damageBonus);
		}

		private IEnumerator HandleCompanionEffect(AIActor companion)
		{
			companion.MovementSpeed *= 2f;
			BehaviorSpeculator behaviorSpeculator = ((BraveBehaviour)companion).behaviorSpeculator;
			behaviorSpeculator.AttackCooldown /= 1.4f;
			EnableVFX(((Component)companion).gameObject);
			while (m_timer >= 0f)
			{
				yield return null;
			}
			BehaviorSpeculator behaviorSpeculator2 = ((BraveBehaviour)companion).behaviorSpeculator;
			behaviorSpeculator2.AttackCooldown *= 1.4f;
			companion.MovementSpeed /= 2f;
			DisableVFX(((Component)companion).gameObject);
		}

		public void DoBuff(PlayerController player, float duration, PlayerController otherPlayer = null)
		{
			if (hitObject)
			{
				return;
			}
			AkSoundEngine.PostEvent("Play_whip_power_up", ((Component)this).gameObject);
			m_timer += duration;
			if (!applied)
			{
				((MonoBehaviour)GameManager.Instance).StartCoroutine(ApplyEffect(player));
				if (Object.op_Implicit((Object)(object)otherPlayer))
				{
					((MonoBehaviour)GameManager.Instance).StartCoroutine(ApplyEffect(otherPlayer, doTimer: false));
				}
			}
		}

		private IEnumerator ApplyEffect(PlayerController player, bool doTimer = true)
		{
			player.ownerlessStatModifiers.Add(speed);
			player.ownerlessStatModifiers.Add(shotSpeed);
			player.stats.RecalculateStats(player, false, false);
			EnableVFX(((Component)player).gameObject);
			applied = true;
			while (m_timer >= 0f)
			{
				if (doTimer)
				{
					m_timer -= BraveTime.DeltaTime;
				}
				yield return null;
			}
			hitObject = false;
			DisableEffect(player);
		}

		public void DisableEffect(PlayerController player)
		{
			player.ownerlessStatModifiers.Remove(speed);
			player.ownerlessStatModifiers.Remove(shotSpeed);
			player.stats.RecalculateStats(player, false, false);
			DisableVFX(((Component)player).gameObject);
			AkSoundEngine.PostEvent("Play_whip_power_down", ((Component)this).gameObject);
			applied = false;
			m_timer = 0f;
		}

		public override void Pickup(PlayerController player)
		{
			((PlayerItem)this).Pickup(player);
		}

		public override bool CanBeUsed(PlayerController user)
		{
			return true;
		}

		public DebrisObject Drop(PlayerController player)
		{
			DebrisObject result = ((PlayerItem)this).Drop(player, 4f);
			DisableEffect(base.LastOwner);
			return result;
		}

		public override void OnDestroy()
		{
			if (Object.op_Implicit((Object)(object)base.LastOwner))
			{
				DisableEffect(base.LastOwner);
			}
			((PlayerItem)this).OnDestroy();
		}

		private static bool ObjectWasHitBySlash(Vector2 ObjectPosition, Vector2 SlashPosition, float slashAngle, float SlashRange, float SlashDimensions)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: 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_0015: Unknown result type (might be due to invalid IL or missing references)
			if (Vector2.Distance(ObjectPosition, SlashPosition) < SlashRange)
			{
				float num = BraveMathCollege.Atan2Degrees(ObjectPosition - SlashPosition);
				float num2 = Math.Min(SlashDimensions, 0f - SlashDimensions);
				float num3 = Math.Max(SlashDimensions, 0f - SlashDimensions);
				bool result = false;
				float num4 = slashAngle + num3;
				float num5 = slashAngle + num2;
				if (MathsAndLogicHelper.IsBetweenRange(num, num5, num4))
				{
					result = true;
				}
				if (num4 > 180f)
				{
					float num6 = num4 - 180f;
					if (MathsAndLogicHelper.IsBetweenRange(num, -180f, -180f + num6))
					{
						result = true;
					}
				}
				if (num5 < -180f)
				{
					float num7 = num5 + 180f;
					if (MathsAndLogicHelper.IsBetweenRange(num, 180f + num7, 180f))
					{
						result = true;
					}
				}
				return result;
			}
			return false;
		}
	}
	public class Bonk_Soda : PlayerItem
	{
		public static int ID;

		public static string consoleID;

		public static float timer = 10f;

		public static GameObject customVFXPrefab;

		private StatModifier rollDamage = StatModifier.Create((StatType)21, (ModifyMethod)0, 50f);

		private StatModifier speed = StatModifier.Create((StatType)0, (ModifyMethod)1, 1.6f);

		private bool isCurrentlyActive;

		private float damageWhileActive = 0f;

		public static void Register()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			string text = "BONK! Atomic Punch";
			string text2 = "TF2Items/Resources/actives/bonk_can_sprite";
			GameObject val = new GameObject(text);
			Bonk_Soda bonk_Soda = val.AddComponent<Bonk_Soda>();
			ItemBuilder.SetCooldownType((PlayerItem)(object)bonk_Soda, (CooldownType)1, 500f);
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "Now With Isotopes!";
			string text4 = "Cherry Fission flavoured. Drinking this will allow you to dodge every bullet that comes your way, and roll with great power. Unfortunately, this is your only offensive option.\n\nAre you tired of time moving too fast for your tastes? Well BONK! proudly presents the Atomic Punch - now with REAL radioactive isotopes, allowing you to remain alert for every second.\nWarning: side effects may include heavy muscle cramps and tiredness after the drink's effects wear off, and long-term use may cause  glowing skin, extreme cancer, and possible organ failure. BONK! is not responsible for any injuries caused by consumption.";
			ItemBuilder.SetupItem((PickupObject)(object)bonk_Soda, text3, text4, "qad");
			((PlayerItem)bonk_Soda).consumable = false;
			((PickupObject)bonk_Soda).quality = (ItemQuality)2;
			consoleID = "qad:" + ETGMod.ToID(((Object)bonk_Soda).name);
			ID = ((PickupObject)bonk_Soda).PickupObjectId;
			customVFXPrefab = VFXToolbox.CreateOverheadVFX(new List<string> { "TF2Items/Resources/StatusEffectVFX/slowed_effect_icon" }, "SlowedEffect", 1);
			Object.DontDestroyOnLoad((Object)(object)customVFXPrefab);
			FakePrefab.MarkAsFakePrefab(customVFXPrefab);
			customVFXPrefab.SetActive(false);
		}

		public override void DoEffect(PlayerController user)
		{
			AkSoundEngine.PostEvent("Play_soda_drink", ((Component)this).gameObject);
			StartEffect(user);
			((MonoBehaviour)this).StartCoroutine(ItemBuilder.HandleDuration((PlayerItem)(object)this, timer, user, (Action<PlayerController>)EndEffect));
		}

		private void EnableVFX(PlayerController player)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			ImprovedAfterImage orAddComponent = GameObjectExtensions.GetOrAddComponent<ImprovedAfterImage>(((Component)player).gameObject);
			orAddComponent.shadowTimeDelay = 0.05f;
			orAddComponent.targetHeight = 1f;
			orAddComponent.shadowLifetime = 0.5f;
			orAddComponent.dashColor = Color.yellow;
			orAddComponent.OverrideImageShader = ShaderCache.Acquire("Brave/Internal/DownwellAfterImage");
			orAddComponent.spawnShadows = true;
		}

		private void DisableVFX(PlayerController player)
		{
			ImprovedAfterImage orAddComponent = GameObjectExtensions.GetOrAddComponent<ImprovedAfterImage>(((Component)player).gameObject);
			orAddComponent.spawnShadows = false;
		}

		private void OnHit(SpeculativeRigidbody myRigidbody, PixelCollider myPixelCollider, SpeculativeRigidbody otherRigidbody, PixelCollider otherPixelCollider)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			if ((Object)(object)((BraveBehaviour)otherRigidbody).projectile != (Object)null)
			{
				VFXToolbox.DoStringSquirt("Miss!", ((BraveBehaviour)myRigidbody).sprite.WorldTopRight, Color.red);
				Projectile projectile = ((BraveBehaviour)otherRigidbody).projectile;
				if (projectile.IsBlackBullet)
				{
					damageWhileActive += 1f;
				}
				else
				{
					damageWhileActive += 0.5f;
				}
			}
		}

		private void StartEffect(PlayerController player)
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Expected O, but got Unknown
			isCurrentlyActive = true;
			damageWhileActive = 0f;
			player.ownerlessStatModifiers.Add(rollDamage);
			player.ownerlessStatModifiers.Add(speed);
			((BraveBehaviour)player).healthHaver.TriggerInvulnerabilityPeriod(timer);
			player.IsGunLocked = true;
			player.stats.RecalculateStats(player, true, false);
			SpeculativeRigidbody specRigidbody = ((BraveBehaviour)player).specRigidbody;
			specRigidbody.OnPreRigidbodyCollision = (OnPreRigidbodyCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody.OnPreRigidbodyCollision, (Delegate?)new OnPreRigidbodyCollisionDelegate(OnHit));
			EnableVFX(player);
		}

		private void EndEffect(PlayerController player)
		{
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Expected O, but got Unknown
			if ((Object)(object)player != (Object)null && isCurrentlyActive)
			{
				player.ownerlessStatModifiers.Remove(rollDamage);
				player.ownerlessStatModifiers.Remove(speed);
				player.stats.RecalculateStats(player, true, false);
				player.IsGunLocked = false;
				DisableVFX(player);
				SpeculativeRigidbody specRigidbody = ((BraveBehaviour)player).specRigidbody;
				specRigidbody.OnPreRigidbodyCollision = (OnPreRigidbodyCollisionDelegate)Delegate.Remove((Delegate?)(object)specRigidbody.OnPreRigidbodyCollision, (Delegate?)new OnPreRigidbodyCollisionDelegate(OnHit));
				isCurrentlyActive = false;
				((MonoBehaviour)GameManager.Instance).StartCoroutine(HandleSlowdown(player));
			}
		}

		private IEnumerator HandleSlowdown(PlayerController player)
		{
			if ((Object)(object)player != (Object)null && damageWhileActive > 0f)
			{
				float value = 0f - damageWhileActive / 30f + 0.9f;
				if (value < 0.5f)
				{
					value = 0.65f;
				}
				StatModifier speedMultiplier = StatModifier.Create((StatType)0, (ModifyMethod)1, value);
				player.ownerlessStatModifiers.Add(speedMultiplier);
				player.stats.RecalculateStats(player, true, false);
				Vector2 offset = new Vector2(0f, 0.2f);
				GameObject obj = Object.Instantiate<GameObject>(customVFXPrefab);
				obj.SetActive(true);
				tk2dSprite sprite = obj.GetComponent<tk2dSprite>();
				((tk2dBaseSprite)sprite).PlaceAtPositionByAnchor(Vector2.op_Implicit(((BraveBehaviour)player).sprite.WorldTopCenter + offset), (Anchor)1);
				((BraveBehaviour)sprite).transform.SetParent(((BraveBehaviour)player).transform);
				AkSoundEngine.PostEvent("Play_stun_effect", ((Component)this).gameObject);
				yield return (object)new WaitForSeconds(5f);
				player.ownerlessStatModifiers.Remove(speedMultiplier);
				player.stats.RecalculateStats(player, true, false);
				Object.Destroy((Object)(object)sprite);
			}
		}

		private void OnGunChanged(Gun previous, Gun current, bool GunChanged)
		{
			PlayerController val = GunTools.GunPlayerOwner(current);
			if ((Object)(object)val != (Object)null && isCurrentlyActive && (Object)(object)current != (Object)(object)previous)
			{
				val.ChangeToGunSlot(0, false);
			}
		}

		public override void Pickup(PlayerController player)
		{
			((PlayerItem)this).Pickup(player);
		}

		public override bool CanBeUsed(PlayerController user)
		{
			return user.IsInCombat;
		}

		public DebrisObject Drop(PlayerController player)
		{
			DebrisObject result = ((PlayerItem)this).Drop(player, 4f);
			EndEffect(player);
			return result;
		}

		public override void OnDestroy()
		{
			if (Object.op_Implicit((Object)(object)base.LastOwner))
			{
				EndEffect(base.LastOwner);
			}
			((PlayerItem)this).OnDestroy();
		}
	}
	public class Buffalo_Steak : PlayerItem
	{
		public static int ID;

		public static string consoleID;

		public static float timer = 10f;

		public bool isActive = false;

		private StatModifier speed = StatModifier.Create((StatType)0, (ModifyMethod)1, 1.4f);

		private StatModifier firerate = StatModifier.Create((StatType)1, (ModifyMethod)1, 1.5f);

		private StatModifier damage = StatModifier.Create((StatType)5, (ModifyMethod)1, 2f);

		private StatModifier reloadspeed = StatModifier.Create((StatType)10, (ModifyMethod)1, 0.5f);

		private bool activeOutline = false;

		public static void Register()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			string text = "Buffalo Steak Sandvich";
			string text2 = "TF2Items/Resources/actives/steak_sprite";
			GameObject val = new GameObject(text);
			Buffalo_Steak buffalo_Steak = val.AddComponent<Buffalo_Steak>();
			ItemBuilder.SetCooldownType((PlayerItem)(object)buffalo_Steak, (CooldownType)1, 750f);
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "Prime Blood";
			string text4 = "A raw T-bone steak, a perfect sandwich. Who even needs bread?. If you look at it from the right angle, it even looks like a gun.\n\nFills the eater with a primal rage, improving their combat effectiveness, but inhibits greater cognitive function to the point where only muscle memory to the gungeoneer's most used and reliable weapon through their lifetime can be used.";
			ItemBuilder.SetupItem((PickupObject)(object)buffalo_Steak, text3, text4, "qad");
			((PlayerItem)buffalo_Steak).consumable = false;
			((PickupObject)buffalo_Steak).quality = (ItemQuality)1;
			consoleID = "qad:" + ETGMod.ToID(((Object)buffalo_Steak).name);
			ID = ((PickupObject)buffalo_Steak).PickupObjectId;
		}

		public override void DoEffect(PlayerController user)
		{
			AkSoundEngine.PostEvent("Play_OBJ_power_up_01", ((Component)this).gameObject);
			StartEffect(user);
			((MonoBehaviour)this).StartCoroutine(ItemBuilder.HandleDuration((PlayerItem)(object)this, 10f, user, (Action<PlayerController>)EndEffect));
		}

		private void EnableVFX(PlayerController user)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(((BraveBehaviour)user).sprite);
			outlineMaterial.SetColor("_OverrideColor", new Color(255f, 200f, 74f));
		}

		private void DisableVFX(PlayerController user)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			Material outlineMaterial = SpriteOutlineManager.GetOutlineMaterial(((BraveBehaviour)user).sprite);
			outlineMaterial.SetColor("_OverrideColor", new Color(0f, 0f, 0f));
		}

		private IEnumerator GainOutline()
		{
			PlayerController user = base.LastOwner;
			yield return (object)new WaitForSeconds(0.05f);
			EnableVFX(user);
		}

		private IEnumerator LoseOutline()
		{
			PlayerController user = base.LastOwner;
			yield return (object)new WaitForSeconds(0.05f);
			DisableVFX(user);
		}

		private void PlayerTookDamage(float resultValue, float maxValue, CoreDamageTypes damageTypes, DamageCategory damageCategory, Vector2 damageDirection)
		{
			if (activeOutline)
			{
				((MonoBehaviour)GameManager.Instance).StartCoroutine(GainOutline());
			}
			else if (!activeOutline)
			{
				((MonoBehaviour)GameManager.Instance).StartCoroutine(LoseOutline());
			}
		}

		private void StartEffect(PlayerController player)
		{
			isActive = true;
			player.ChangeToGunSlot(0, false);
			player.GunChanged += OnGunChanged;
			player.ownerlessStatModifiers.Add(speed);
			player.ownerlessStatModifiers.Add(firerate);
			player.ownerlessStatModifiers.Add(damage);
			player.ownerlessStatModifiers.Add(reloadspeed);
			player.stats.RecalculateStats(player, true, false);
			EnableVFX(player);
			activeOutline = true;
		}

		private void EndEffect(PlayerController player)
		{
			if (Object.op_Implicit((Object)(object)player) && isActive)
			{
				player.GunChanged -= OnGunChanged;
				player.IsGunLocked = false;
				player.ownerlessStatModifiers.Remove(speed);
				player.ownerlessStatModifiers.Remove(firerate);
				player.ownerlessStatModifiers.Remove(damage);
				player.ownerlessStatModifiers.Remove(reloadspeed);
				player.stats.RecalculateStats(player, true, false);
				DisableVFX(player);
				activeOutline = false;
				isActive = false;
			}
		}

		private void OnGunChanged(Gun previous, Gun current, bool GunChanged)
		{
			PlayerController val = GunTools.GunPlayerOwner(current);
			if ((Object)(object)current != (Object)(object)previous)
			{
				val.ChangeToGunSlot(0, false);
			}
		}

		public override void Pickup(PlayerController player)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			((PlayerItem)this).Pickup(player);
			((BraveBehaviour)player).healthHaver.OnDamaged += new OnDamagedEvent(PlayerTookDamage);
		}

		public override bool CanBeUsed(PlayerController user)
		{
			return user.IsInCombat;
		}

		public DebrisObject Drop(PlayerController player)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			DebrisObject result = ((PlayerItem)this).Drop(player, 4f);
			((BraveBehaviour)player).healthHaver.OnDamaged -= new OnDamagedEvent(PlayerTookDamage);
			EndEffect(player);
			return result;
		}

		public override void OnDestroy()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			if (Object.op_Implicit((Object)(object)base.LastOwner))
			{
				EndEffect(base.LastOwner);
				((BraveBehaviour)base.LastOwner).healthHaver.OnDamaged -= new OnDamagedEvent(PlayerTookDamage);
			}
			((PlayerItem)this).OnDestroy();
		}
	}
	public class Sandvich : PlayerItem
	{
		public static int ID;

		public static string consoleID;

		public static Projectile sandwich;

		public static void Register()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: 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_020c: Expected O, but got Unknown
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Expected O, but got Unknown
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Expected O, but got Unknown
			string text = "Sandvich";
			string text2 = "TF2Items/Resources/actives/sandvich_sprite";
			GameObject val = new GameObject(text);
			Sandvich sandvich = val.AddComponent<Sandvich>();
			ItemBuilder.SetCooldownType((PlayerItem)(object)sandvich, (CooldownType)1, 500f);
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "Om Nom Nom";
			string text4 = "Throw a tasty snack at your enemies. If the resulting blow kills them, heal up some damage. Otherwise, too bad! If you miss, pick it back up and give it another shot. Read your enemies well!\n\nThere's nothing like eating a healthy, balanced combination of ingredients in the middle of an ensuing firefight.";
			ItemBuilder.SetupItem((PickupObject)(object)sandvich, text3, text4, "qad");
			((PlayerItem)sandvich).consumable = false;
			((PickupObject)sandvich).quality = (ItemQuality)3;
			consoleID = "qad:" + ETGMod.ToID(((Object)sandvich).name);
			ID = ((PickupObject)sandvich).PickupObjectId;
			PickupObject byId = PickupObjectDatabase.GetById(86);
			sandwich = ProjectileUtility.InstantiateAndFakeprefab(((Gun)((byId is Gun) ? byId : null)).DefaultModule.projectiles[0]);
			sandwich.baseData.damage = 5f;
			sandwich.baseData.speed = 30f;
			sandwich.baseData.range = 2000f;
			GunTools.SetProjectileSpriteRight(sandwich, "sandvich_projectile", 16, 16, false, (Anchor)4, (int?)14, (int?)14, true, false, (int?)null, (int?)null, (Projectile)null);
			sandwich.pierceMinorBreakables = true;
			sandwich.collidesWithPlayer = true;
			sandwich.allowSelfShooting = true;
			List<VFXObject> list = new List<VFXObject>();
			List<string> list2 = CodeShortcuts.GenerateFilePaths("TF2Items/Resources/Debris/sandvich_debris/sandvich_debris_", 11);
			DebrisObject[] array = BreakableAPIToolbox.GenerateDebrisObjects(list2.ToArray(), true, 0.33f, 2f, 0f, 60f, (tk2dSprite)null, 1f, (string)null, (GameObject)null, 0, false, (GoopDefinition)null, 1f);
			foreach (DebrisObject val2 in array)
			{
				GunTools.ConstructOffsetsFromAnchor(((Component)val2).gameObject.GetComponent<tk2dBaseSprite>().CurrentSprite, (Anchor)4, (Vector2?)null, false, true);
				list.Add(new VFXObject
				{
					attached = true,
					persistsOnDeath = true,
					usesZHeight = false,
					zHeight = 0f,
					alignment = (VFXAlignment)2,
					destructible = false,
					orphaned = true,
					effect = ((Component)val2).gameObject
				});
			}
			VFXPool val3 = new VFXPool();
			val3.type = (VFXPoolType)1;
			val3.effects = (VFXComplex[])(object)new VFXComplex[1]
			{
				new VFXComplex
				{
					effects = list.ToArray()
				}
			};
			VFXPool deathEnemy = val3;
			sandwich.hitEffects.HasProjectileDeathVFX = true;
			sandwich.hitEffects.deathEnemy = deathEnemy;
			tk2dSpriteDefinition currentSprite = ((BraveBehaviour)sandwich).sprite.CurrentSprite;
			List<Material> list3 = new List<Material> { currentSprite.material, currentSprite.materialInst };
			foreach (Material item in list3)
			{
				if (!((Object)(object)item == (Object)null))
				{
					item.SetFloat("_EmissivePower", 0f);
				}
			}
			PickupableProjectile orAddComponent = GameObjectExtensions.GetOrAddComponent<PickupableProjectile>(((Component)sandwich).gameObject);
			orAddComponent.BecomesDebris = false;
			orAddComponent.hasAfterImageEffect = false;
			orAddComponent.DebrisTime = 10000f;
			orAddComponent.spinDegreeRate = 540f;
			orAddComponent.spinDecayRate = 0.9f;
			orAddComponent.speedDecayRate = 0.3f;
			BounceProjModifier orAddComponent2 = GameObjectExtensions.GetOrAddComponent<BounceProjModifier>(((Component)sandwich).gameObject);
			orAddComponent2.numberOfBounces += 4;
		}

		public override void DoEffect(PlayerController user)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			float num = (((Object)(object)((GameActor)user).CurrentGun == (Object)null) ? 0f : ((GameActor)user).CurrentGun.CurrentAngle);
			GameObject val = SpawnManager.SpawnProjectile(((Component)sandwich).gameObject, Vector2.op_Implicit(((BraveBehaviour)user).sprite.WorldCenter), Quaternion.Euler(0f, 0f, num), true);
			Projectile component = val.GetComponent<Projectile>();
			if ((Object)(object)component != (Object)null)
			{
				component.Owner = (GameActor)(object)user;
				component.Shooter = ((BraveBehaviour)user).specRigidbody;
				component.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(component.OnHitEnemy, new Action<Projectile, SpeculativeRigidbody, bool>(OnHitEnemy));
				SpeculativeRigidbody specRigidbody = ((BraveBehaviour)component).specRigidbody;
				specRigidbody.OnTileCollision = (OnTileCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody.OnTileCollision, (Delegate?)new OnTileCollisionDelegate(HitWall));
			}
			PickupableProjectile component2 = val.GetComponent<PickupableProjectile>();
			if (Object.op_Implicit((Object)(object)component2))
			{
				component2.OnPickup = (Action)Delegate.Combine(component2.OnPickup, new Action(OnPickup));
			}
		}

		public void HitWall(CollisionData data)
		{
			string[] array = new string[3] { "baseball_hitworld1", "baseball_hitworld2", "baseball_hitworld3" };
			AkSoundEngine.PostEvent(array[Random.Range(0, array.Length)], ((Component)this).gameObject);
		}

		public void OnHitEnemy(Projectile projectile, SpeculativeRigidbody enemy, bool fatal)
		{
			if ((Object)(object)enemy != (Object)null && (Object)(object)((BraveBehaviour)enemy).aiActor != (Object)null)
			{
				AkSoundEngine.PostEvent("Play_OBJ_pot_shatter_01", ((Component)this).gameObject);
				if (fatal)
				{
					((BraveBehaviour)base.LastOwner).healthHaver.ApplyHealingAdvanced(1f, true, true, null);
				}
			}
		}

		public void OnPickup()
		{
			if (Object.op_Implicit((Object)(object)this) && Object.op_Implicit((Object)(object)((Component)this).gameObject))
			{
				AkSoundEngine.PostEvent("recharged", ((Component)this).gameObject);
				((PlayerItem)this).ClearCooldowns();
			}
		}
	}
	public class TF2Characters
	{
		public static PlayableCharacters Scout;

		public static PlayableCharacters Soldier;
	}
	public class AirstrikeProjectile : MonoBehaviour
	{
		public Projectile self;

		public PlayerController player;

		public float ascentTime = 0.5f;

		private float timeActive = 0f;

		public GameObject targetEffect;

		private GameObject activeEffect;

		private bool swapped = false;

		public Vector2 endPosition;

		private bool canCollide;

		public void Start()
		{
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Expected O, but got Unknown
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Expected O, but got Unknown
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: 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_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			self = ((Component)this).GetComponent<Projectile>();
			player = ProjectileUtility.ProjectilePlayerOwner(self);
			canCollide = false;
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)player))
			{
				endPosition = Vector2.op_Implicit(player.unadjustedAimPoint);
				((BraveBehaviour)self).specRigidbody.Velocity = Vector2.op_Implicit(new Vector3(0f, 0f, self.Speed));
				self.SendInDirection(Vector2.zero, true, true);
				self.m_currentDirection = Vector2.op_Implicit(Vector3.zero);
				((BraveBehaviour)((BraveBehaviour)self).sprite).transform.rotation = Quaternion.Euler(0f, 0f, 90f);
				if ((Object)(object)targetEffect != (Object)null)
				{
					activeEffect = Object.Instantiate<GameObject>(targetEffect, Vector2.op_Implicit(endPosition), Quaternion.identity);
				}
				ParticleSystem particleTrail = self.ParticleTrail;
				if (Object.op_Implicit((Object)(object)particleTrail))
				{
					BraveUtility.EnableEmission(self.ParticleTrail, true);
				}
			}
			SpeculativeRigidbody specRigidbody = ((BraveBehaviour)self).specRigidbody;
			specRigidbody.OnPreRigidbodyCollision = (OnPreRigidbodyCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody.OnPreRigidbodyCollision, (Delegate?)new OnPreRigidbodyCollisionDelegate(OnPreCollision));
		}

		public void Update()
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)self))
			{
				return;
			}
			timeActive += BraveTime.DeltaTime;
			float num = self.Speed * BraveTime.DeltaTime;
			Vector3 position = ((BraveBehaviour)((BraveBehaviour)self).sprite).transform.position;
			if (timeActive < ascentTime)
			{
				Transform transform = ((BraveBehaviour)((BraveBehaviour)self).sprite).transform;
				transform.position += new Vector3(0f, num, 0f);
				return;
			}
			if (!swapped)
			{
				swapped = true;
				((BraveBehaviour)((BraveBehaviour)self).sprite).transform.rotation = Quaternion.Euler(0f, 0f, -90f);
				((BraveBehaviour)((BraveBehaviour)self).sprite).transform.position = new Vector3(endPosition.x, position.y);
			}
			Transform transform2 = ((BraveBehaviour)((BraveBehaviour)self).sprite).transform;
			transform2.position += new Vector3(0f, 0f - num, 0f);
			if (((BraveBehaviour)((BraveBehaviour)self).sprite).transform.position.y <= endPosition.y)
			{
				canCollide = true;
				((BraveBehaviour)self).transform.position = new Vector3(endPosition.x, endPosition.y);
				((BraveBehaviour)self).specRigidbody.Position = new Position(endPosition.x, endPosition.y);
				self.DieInAir(false, true, true, false);
				if ((Object)(object)activeEffect != (Object)null)
				{
					Object.Destroy((Object)(object)activeEffect);
				}
			}
		}

		public void OnPreCollision(SpeculativeRigidbody body, PixelCollider collider, SpeculativeRigidbody collision, PixelCollider collisionCollider)
		{
			if (!canCollide && (Object)(object)((Component)collision).GetComponentInParent<DungeonDoorController>() == (Object)null && ((Object)(object)((Component)collision).GetComponent<MajorBreakable>() == (Object)null || !((Component)collision).GetComponent<MajorBreakable>().IsSecretDoor))
			{
				PhysicsEngine.SkipCollision = true;
			}
		}
	}
	public struct RevAudioMessages
	{
		public string StartAudioMessage;

		public string EndAudioMessage;

		public string RevLoopAudio;

		public string ShootLoopAudio;

		public RevAudioMessages(string start, string end, string rev, string shoot)
		{
			StartAudioMessage = "";
			EndAudioMessage = "";
			RevLoopAudio = "";
			ShootLoopAudio = "";
			StartAudioMessage = start;
			EndAudioMessage = end;
			RevLoopAudio = rev;
			ShootLoopAudio = shoot;
		}
	}
	public class GunRevDoer : GunBehaviour
	{
		private float _currentSpin = 0f;

		private VFXPool _muzzleFlashHolder;

		private int _shellsHolder;

		private bool doesScreenshake;

		public float RevTime = 0.75f;

		public bool isRevving = false;

		public bool isPostRev = false;

		public int currentAmmo;

		public string StartAudioMessage = "";

		public string EndAudioMessage = "";

		public string RevLoopAudio = "";

		public string ShootLoopAudio = "";

		public int FireLoopStartIndex = 0;

		public float SlowDownMultiplier = 1f;

		public float minusAnimationFPS = 0f;

		public Action OnStartedRev;

		public Action OnEndedRev;

		public void Start()
		{
			currentAmmo = base.gun.ammo;
			_muzzleFlashHolder = base.gun.muzzleFlashEffects;
			_shellsHolder = base.gun.shellsToLaunchOnFire;
			doesScreenshake = base.gun.doesScreenShake;
			base.gun.doesScreenShake = false;
			base.gun.muzzleFlashEffects = CodeShortcuts.Empty;
			base.gun.shellsToLaunchOnFire = 0;
			if (Object.op_Implicit((Object)(object)((GunBehaviour)this).PlayerOwner))
			{
				((GunBehaviour)this).PlayerOwner.GunChanged += OnGunChanged;
			}
			OnEndedRev = (Action)Delegate.Combine(OnEndedRev, new Action(ResetRev));
			OnStartedRev = (Action)Delegate.Combine(OnStartedRev, new Action(StartRev));
		}

		public void Update()
		{
			if (!Object.op_Implicit((Object)(object)base.gun) || !Object.op_Implicit((Object)(object)((GunBehaviour)this).PlayerOwner))
			{
				return;
			}
			if (base.gun.IsFiring && !((GunBehaviour)this).PlayerOwner.IsDodgeRolling)
			{
				if (!isRevving && !isPostRev)
				{
					OnStartedRev();
				}
				else if (_currentSpin < RevTime)
				{
					if (currentAmmo != base.gun.ammo)
					{
						base.gun.ammo = currentAmmo;
					}
					_currentSpin += BraveTime.DeltaTime;
				}
				else if (_currentSpin >= RevTime && !isPostRev)
				{
					AkSoundEngine.PostEvent(RevLoopAudio + "_stop", ((Component)this).gameObject);
					AkSoundEngine.PostEvent(ShootLoopAudio, ((Component)this).gameObject);
					base.gun.muzzleFlashEffects = _muzzleFlashHolder;
					base.gun.shellsToLaunchOnFire = _shellsHolder;
					base.gun.doesScreenShake = doesScreenshake;
					((BraveBehaviour)base.gun).spriteAnimator.PlayFromFrame(FireLoopStartIndex);
					isPostRev = true;
					isRevving = false;
				}
			}
			else if (isPostRev || isRevving)
			{
				OnEndedRev();
			}
			else
			{
				currentAmmo = base.gun.ammo;
				_currentSpin = Mathf.Max(_currentSpin - BraveTime.DeltaTime, 0f);
			}
		}

		public void StartRev()
		{
			AkSoundEngine.PostEvent(StartAudioMessage, ((Component)this).gameObject);
			AkSoundEngine.PostEvent(RevLoopAudio, ((Component)this).gameObject);
			isRevving = true;
			if (SlowDownMultiplier != 1f)
			{
				SlowDown("add");
			}
		}

		public void ResetRev()
		{
			AkSoundEngine.PostEvent(ShootLoopAudio + "_stop", ((Component)this).gameObject);
			AkSoundEngine.PostEvent(RevLoopAudio + "_stop", ((Component)this).gameObject);
			AkSoundEngine.PostEvent(StartAudioMessage + "_stop", ((Component)this).gameObject);
			AkSoundEngine.PostEvent(EndAudioMessage, ((Component)this).gameObject);
			isRevving = false;
			isPostRev = false;
			base.gun.doesScreenShake = false;
			base.gun.muzzleFlashEffects = CodeShortcuts.Empty;
			base.gun.shellsToLaunchOnFire = 0;
			if (SlowDownMultiplier != 1f)
			{
				SlowDown("remove");
			}
		}

		public override void OnPostFired(PlayerController player, Gun gun)
		{
			if (_currentSpin < RevTime)
			{
				gun.GainAmmo(1);
			}
			((GunBehaviour)this).OnPostFired(player, gun);
		}

		public override void PostProcessProjectile(Projectile projectile)
		{
			if (_currentSpin < RevTime)
			{
				projectile.DieInAir(true, true, true, false);
			}
			else
			{
				((GunBehaviour)this).PostProcessProjectile(projectile);
			}
		}

		public void SetAudioMessages(string start, string end, string revLoop, string shootLoop)
		{
			StartAudioMessage = start;
			EndAudioMessage = end;
			RevLoopAudio = revLoop;
			ShootLoopAudio = shootLoop;
		}

		private void OnGunChanged(Gun previous, Gun current, bool changed)
		{
			if ((Object)(object)current != (Object)(object)base.gun && (isPostRev || isRevving))
			{
				OnEndedRev();
			}
		}

		public void SlowDown(string mode)
		{
			mode = mode.ToLower();
			if (mode == "add")
			{
				GunTools.AddStatToGun(base.gun, (StatType)0, SlowDownMultiplier, (ModifyMethod)1);
				((GunBehaviour)this).PlayerOwner.stats.RecalculateStats(((GunBehaviour)this).PlayerOwner, false, false);
				tk2dSpriteAnimator spriteAnimator = ((BraveBehaviour)((GunBehaviour)this).PlayerOwner).spriteAnimator;
				spriteAnimator.clipFps -= minusAnimationFPS;
			}
			else if (mode == "remove")
			{
				GunTools.RemoveStatFromGun(base.gun, (StatType)0);
				((GunBehaviour)this).PlayerOwner.stats.RecalculateStats(((GunBehaviour)this).PlayerOwner, false, false);
				tk2dSpriteAnimator spriteAnimator2 = ((BraveBehaviour)((GunBehaviour)this).PlayerOwner).spriteAnimator;
				spriteAnimator2.clipFps += minusAnimationFPS;
			}
		}
	}
	public class BaseballProjectile : MonoBehaviour
	{
		private float m_timeActive = 0f;

		private float m_debrisTime = 0f;

		private bool hasHitEnemy = false;

		public Projectile self;

		public float MaxTimeForStun = 1f;

		public float MaxStunDuration = 8f;

		public float MinStunDuration = 1f;

		public void Start()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected O, but got Unknown
			self = ((Component)this).GetComponent<Projectile>();
			SpeculativeRigidbody specRigidbody = ((BraveBehaviour)self).specRigidbody;
			specRigidbody.OnTileCollision = (OnTileCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody.OnTileCollision, (Delegate?)new OnTileCollisionDelegate(Bounced));
			SpeculativeRigidbody specRigidbody2 = ((BraveBehaviour)self).specRigidbody;
			specRigidbody2.OnRigidbodyCollision = (OnRigidbodyCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody2.OnRigidbodyCollision, (Delegate?)new OnRigidbodyCollisionDelegate(OnBallCollided));
		}

		public void Update()
		{
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)((Component)self).gameObject))
			{
				m_timeActive += BraveTime.DeltaTime;
			}
		}

		public void OnBallCollided(CollisionData collisiondata)
		{
			SpeculativeRigidbody otherRigidbody = collisiondata.OtherRigidbody;
			if (!((Object)(object)otherRigidbody != (Object)null) || !((Object)(object)((BraveBehaviour)otherRigidbody).healthHaver != (Object)null) || !((Object)(object)((BraveBehaviour)otherRigidbody).aiActor != (Object)null))
			{
				return;
			}
			hasHitEnemy = true;
			if (!((BraveBehaviour)otherRigidbody).healthHaver.IsBoss)
			{
				float num = ((m_timeActive < MaxTimeForStun) ? (m_timeActive / MaxTimeForStun) : 1f);
				float num2 = Mathf.Lerp(MinStunDuration, MaxStunDuration, num);
				if (((BraveBehaviour)((BraveBehaviour)otherRigidbody).aiActor).behaviorSpeculator.IsStunned)
				{
					((BraveBehaviour)((BraveBehaviour)otherRigidbody).aiActor).behaviorSpeculator.UpdateStun(num2);
				}
				else
				{
					((BraveBehaviour)((BraveBehaviour)otherRigidbody).aiActor).behaviorSpeculator.Stun(num2, true);
				}
				if (m_timeActive < MaxTimeForStun)
				{
					AkSoundEngine.PostEvent("baseball_stun", ((Component)this).gameObject);
				}
				else
				{
					AkSoundEngine.PostEvent("baseball_moonshot", ((Component)this).gameObject);
				}
			}
		}

		public void Bounced(CollisionData tileCollision)
		{
			string[] array = new string[3] { "baseball_hitworld1", "baseball_hitworld2", "baseball_hitworld3" };
			AkSoundEngine.PostEvent(array[Random.Range(0, array.Length)], ((Component)this).gameObject);
		}
	}
	public class PickupableProjectile : MonoBehaviour
	{
		private float m_timeActive = 0f;

		private float m_debrisTime = 0f;

		private bool hasHitEnemy = false;

		private bool becameDebris = false;

		private bool hasHitWall;

		public Action OnPickup;

		public Projectile self;

		public float DebrisTime = 2f;

		public float DespawnTime = 6f;

		public bool BecomesDebris = true;

		public bool hasAfterImageEffect = true;

		public GameObject DeathVFX;

		public float speedDecayRate = 0.5f;

		private ImprovedAfterImage effect;

		private ProjectileSpin spin;

		public float spinDegreeRate = 900f;

		public float spinDecayRate = 0.8f;

		public void Start()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Expected O, but got Unknown
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Expected O, but got Unknown
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Expected O, but got Unknown
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			self = ((Component)this).GetComponent<Projectile>();
			if (BecomesDebris)
			{
				self.DestroyMode = (ProjectileDestroyMode)2;
			}
			SpeculativeRigidbody specRigidbody = ((BraveBehaviour)self).specRigidbody;
			specRigidbody.OnPreRigidbodyCollision = (OnPreRigidbodyCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody.OnPreRigidbodyCollision, (Delegate?)new OnPreRigidbodyCollisionDelegate(OnPreBallCollided));
			SpeculativeRigidbody specRigidbody2 = ((BraveBehaviour)self).specRigidbody;
			specRigidbody2.OnRigidbodyCollision = (OnRigidbodyCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody2.OnRigidbodyCollision, (Delegate?)new OnRigidbodyCollisionDelegate(OnBallCollided));
			((BraveBehaviour)self).specRigidbody.RegisterTemporaryCollisionException(self.Shooter, 0.01f, (float?)null);
			SpeculativeRigidbody specRigidbody3 = ((BraveBehaviour)self).specRigidbody;
			specRigidbody3.OnTileCollision = (OnTileCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody3.OnTileCollision, (Delegate?)new OnTileCollisionDelegate(Bounced));
			DeathVFX = self.hitEffects.overrideMidairDeathVFX;
			OnPickup = (Action)Delegate.Combine(OnPickup, new Action(OnBallPlayerPickup));
			BounceProjModifier orAddComponent = GameObjectExtensions.GetOrAddComponent<BounceProjModifier>(((Component)self).gameObject);
			orAddComponent.numberOfBounces++;
			orAddComponent.percentVelocityToLoseOnBounce = 0.2f;
			spin = GameObjectExtensions.GetOrAddComponent<ProjectileSpin>(((Component)self).gameObject);
			spin.directionOfSpinDependsOnVelocity = true;
			spin.degreesPerSecond = spinDegreeRate;
			spin.DecayRate = spinDecayRate;
			if (hasAfterImageEffect)
			{
				effect = GameObjectExtensions.GetOrAddComponent<ImprovedAfterImage>(((Component)self).gameObject);
				float num = 0f;
				effect.shadowLifetime = 0.04f;
				effect.shadowTimeDelay = 0f;
				effect.dashColor = Color.white;
				effect.targetHeight = 1f;
				effect.maxEmission = 0.2f;
				effect.minTranslation = 0f;
				effect.spawnShadows = true;
			}
			hasHitWall = false;
		}

		public void Update()
		{
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((Component)this).gameObject) && Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)((Component)self).gameObject) && !becameDebris)
			{
				m_timeActive += BraveTime.DeltaTime;
				Projectile obj = self;
				obj.Speed *= Mathf.Pow(speedDecayRate, BraveTime.DeltaTime);
				if (m_timeActive > DebrisTime && !becameDebris)
				{
					self.Speed = 0f;
					DropBall(self.LastVelocity);
				}
			}
			if (Object.op_Implicit((Object)(object)((Component)this).gameObject) && becameDebris)
			{
				m_debrisTime += BraveTime.DeltaTime;
				if (m_debrisTime > DespawnTime)
				{
					DespawnDebris();
				}
			}
		}

		public void DropBall(Vector2 NewVelocity)
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			becameDebris = true;
			((Behaviour)spin).enabled = false;
			if (Object.op_Implicit((Object)(object)effect) && hasAfterImageEffect)
			{
				effect.spawnShadows = false;
			}
			if (BecomesDebris)
			{
				self.BecomeDebris(Vector2.op_Implicit(NewVelocity), ((BraveBehaviour)self).specRigidbody.UnitHeight);
			}
		}

		public void OnPreBallCollided(SpeculativeRigidbody myrigidbody, PixelCollider mypixelcollider, SpeculativeRigidbody otherrigidbody, PixelCollider otherpixelcollider)
		{
			if ((Object)(object)otherrigidbody != (Object)null && (Object)(object)((BraveBehaviour)otherrigidbody).healthHaver != (Object)null && ((BraveBehaviour)otherrigidbody).healthHaver.isPlayerCharacter)
			{
				PhysicsEngine.SkipCollision = true;
				if (OnPickup != null && hasHitWall)
				{
					OnPickup();
				}
			}
		}

		public void OnBallCollided(CollisionData collisiondata)
		{
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: 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_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: 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)
			SpeculativeRigidbody otherRigidbody = collisiondata.OtherRigidbody;
			if ((Object)(object)otherRigidbody != (Object)null && (Object)(object)((BraveBehaviour)otherRigidbody).healthHaver != (Object)null && (Object)(object)((BraveBehaviour)otherRigidbody).aiActor != (Object)null)
			{
				if (!((BraveBehaviour)otherRigidbody).healthHaver.IsBoss)
				{
					DespawnTime *= 0.75f * m_timeActive;
				}
				Vector2 val = collisiondata.MyRigidbody.Velocity;
				if (collisiondata.CollidedX)
				{
					val = Vector2Extensions.WithX(val, 0f - val.x);
				}
				if (collisiondata.CollidedY)
				{
					val = Vector2Extensions.WithY(val, 0f - val.y);
				}
				PhysicsEngine.PostSliceVelocity = val;
				DropBall(val / 2f);
			}
		}

		public void Bounced(CollisionData data)
		{
			hasHitWall = true;
		}

		public void OnBallPlayerPickup()
		{
			DespawnDebris();
		}

		public void DespawnDebris()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			SpawnManager.SpawnVFX(DeathVFX, ((Component)this).transform.position, Quaternion.identity);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
	public class RocketJumpDoer : MonoBehaviour
	{
		private PlayerController player;

		private PassiveItem item;

		private Gun gun;

		public bool isAbleToRocketJump;

		public bool isRocketJumping;

		public bool cancelJump;

		public bool isRocketJumper;

		public bool dodgesCancelsJump;

		public float AirstrafeControl;

		public float cancelJumpSpeedThreshold;

		public float jumpMaxMagnitude;

		private bool canWallScrape = false;

		private IntVector2 collisionDirection = IntVector2.Zero;

		public Vector2 jumpDirection;

		public Action<PlayerController> OnRocketJump;

		public Action<PlayerController> PostRocketJump;

		public PlayerController Player => player;

		public RocketJumpDoer()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			isAbleToRocketJump = false;
			isRocketJumping = false;
			cancelJump = false;
			AirstrafeControl = 0.1f;
			cancelJumpSpeedThreshold = 7f;
			jumpMaxMagnitude = 150f;
		}

		private void Start()
		{
			item = ((Component)this).GetComponent<PassiveItem>();
			gun = ((Component)this).GetComponent<Gun>();
			if ((Object)(object)item != (Object)null)
			{
				player = item.Owner;
			}
			else if ((Object)(object)gun != (Object)null)
			{
				player = GunTools.GunPlayerOwner(gun);
			}
			else
			{
				player = ((Component)this).GetComponent<PlayerController>();
			}
			if (Object.op_Implicit((Object)(object)player))
			{
				CustomActions.OnExplosionComplex = (Action<Vector3, ExplosionData, Vector2, Action, bool, CoreDamageTypes, bool>)(object)Delegate.Combine((Delegate?)(object)CustomActions.OnExplosionComplex, (Delegate?)(object)new Action<Vector3, ExplosionData, Vector2, Action, bool, CoreDamageTypes, bool>(OnExplosion));
			}
			OnRocketJump = (Action<PlayerController>)Delegate.Combine(OnRocketJump, new Action<PlayerController>(RocketJumpAction));
			PostRocketJump = (Action<PlayerController>)Delegate.Combine(PostRocketJump, new Action<PlayerController>(AfterRocketJump));
		}

		public void OnExplosion(Vector3 position, ExplosionData data, Vector2 dir, Action onbegin, bool ignoreQueues, CoreDamageTypes damagetypes, bool ignoreDamageCaps)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)player) && !isRocketJumper)
			{
				((MonoBehaviour)GameManager.Instance).StartCoroutine(CheckForRocketJump(player, position, data));
			}
		}

		private IEnumerator CheckForRocketJump(PlayerController player, Vector3 position, ExplosionData data)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			bool isAbleToRocketJump = false;
			float timer = 0.25f;
			while (!isAbleToRocketJump && timer > 0f)
			{
				BraveInput instanceForPlayer = BraveInput.GetInstanceForPlayer(player.PlayerIDX);
				timer -= BraveTime.DeltaTime;
				float distance = Vector3.Distance(position, Vector2Extensions.ToVector3ZUp(((BraveBehaviour)player).sprite.WorldCenter, 0f));
				if (distance <= data.damageRadius + 0.2f && ((((OneAxisInputControl)instanceForPlayer.ActiveActions.DodgeRollAction).IsPressed && timer > 0.125f) || player.IsDodgeRolling))
				{
					Vector3 vector = Vector2Extensions.ToVector3ZUp(((BraveBehaviour)player).sprite.WorldCenter, 0f) - position;
					jumpDirection = new Vector2(vector.x, vector.y);
					jumpDirection.x *= jumpMaxMagnitude * (timer / distance);
					jumpDirection.y *= jumpMaxMagnitude * (timer / distance);
					isAbleToRocketJump = true;
					((MonoBehaviour)GameManager.Instance).StartCoroutine(HandleRocketJump(player));
				}
				yield return null;
			}
		}

		public void CheckForJump(PlayerController player, Vector3 position, ExplosionData data)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)player))
			{
				((MonoBehaviour)GameManager.Instance).StartCoroutine(CheckForRocketJump(player, position, data));
			}
		}

		private IEnumerator HandleRocketJump(PlayerController player)
		{
			cancelJump = false;
			dodgesCancelsJump = false;
			if (!((Object)(object)player != (Object)null))
			{
				yield break;
			}
			ImprovedAfterImage effect = GameObjectExtensions.GetOrAddComponent<ImprovedAfterImage>(((Component)player).gameObject);
			float delay = 0f;
			effect.shadowLifetime = 0.2f;
			effect.shadowTimeDelay = 0.1f;
			effect.dashColor = MoreColours.lightgrey;
			effect.targetHeight = 1f;
			effect.OverrideImageShader = ShaderCache.Acquire("Brave/Internal/DownwellAfterImage");
			effect.minTranslation = 0.5f;
			player.ForceStopDodgeRoll();
			player.ToggleHandRenderers(true, "");
			player.ToggleGunRenderers(true, "");
			player.stats.RecalculateStats(player, false, false);
			player.OnPreDodgeRoll += OnDodgeRoll;
			((BraveBehaviour)player).healthHaver.OnDamaged += new OnDamagedEvent(OnDamaged);
			SpeculativeRigidbody specRigidbody = ((BraveBehaviour)player).specRigidbody;
			specRigidbody.OnTileCollision = (OnTileCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody.OnTileCollision, (Delegate?)new OnTileCollisionDelegate(OnHitWall));
			SpeculativeRigidbody specRigidbody2 = ((BraveBehaviour)player).specRigidbody;
			specRigidbody2.OnPreRigidbodyCollision = (OnPreRigidbodyCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody2.OnPreRigidbodyCollision, (Delegate?)new OnPreRigidbodyCollisionDelegate(OnPreRigidbodyCollision));
			((GameActor)player).SetIsFlying(true, "rocketjump", true, false);
			effect.spawnShadows = true;
			((GameActor)player).MovementModifiers += new MovementModifier(MovementMod);
			isRocketJumping = true;
			if (OnRocketJump != null)
			{
				OnRocketJump(player);
			}
			while (!cancelJump && ((Vector2)(ref jumpDirection)).magnitude > cancelJumpSpeedThreshold)
			{
				if (delay > 0.2f)
				{
					player.AdditionalCanDodgeRollWhileFlying.SetOverride("rocketjump", true, (float?)null);
				}
				if (player.IsOnFire)
				{
					if (player.CurrentFireMeterValue > 0f)
					{
						float currentFireMeterValue = player.CurrentFireMeterValue;
						Vector2 velocity = ((GameActor)player).Velocity;
						player.CurrentFireMeterValue = Mathf.Max(0f, player.CurrentFireMeterValue = currentFireMeterValue - 0.0005f * ((Vector2)(ref velocity)).magnitude);
					}
					if (player.CurrentFireMeterValue == 0f)
					{
						player.IsOnFire = false;
					}
				}
				jumpDirection.x *= Mathf.Pow(0.8f, BraveTime.DeltaTime);
				jumpDirection.y *= Mathf.Pow(0.8f, BraveTime.DeltaTime);
				if (canWallScrape)
				{
					if (CellCheckIHateThisAAAA())
					{
						jumpDirection *= Mathf.Pow(0.5f, BraveTime.DeltaTime);
					}
					else
					{
						canWallScrape = false;
					}
				}
				if (!player.AdditionalCanDodgeRollWhileFlying.BaseValue)
				{
					delay += BraveTime.DeltaTime;
				}
				yield return null;
			}
			if (cancelJump && !player.IsDodgeRolling)
			{
				GameManager.Instance.MainCameraController.DoScreenShake(new ScreenShakeSettings(((Vector2)(ref jumpDirection)).magnitude / jumpMaxMagnitude, 5f, 0.1f, 0.3f), (Vector2?)((BraveBehaviour)player).specRigidbody.UnitCenter, false);
			}
			player.AdditionalCanDodgeRollWhileFlying.SetOverride("rocketjump", false, (float?)null);
			((GameActor)player).MovementModifiers -= new MovementModifier(MovementMod);
			((GameActor)player).SetIsFlying(false, "rocketjump", true, false);
			if ((Object)(object)effect != (Object)null)
			{
				effect.spawnShadows = false;
			}
			player.stats.RecalculateStats(player, false, false);
			SpeculativeRigidbody specRigidbody3 = ((BraveBehaviour)player).specRigidbody;
			specRigidbody3.OnPreRigidbodyCollision = (OnPreRigidbodyCollisionDelegate)Delegate.Remove((Delegate?)(object)specRigidbody3.OnPreRigidbodyCollision, (Delegate?)new OnPreRigidbodyCollisionDelegate(OnPreRigidbodyCollision));
			((BraveBehaviour)player).healthHaver.OnDamaged -= new OnDamagedEvent(OnDamaged);
			SpeculativeRigidbody specRigidbody4 = ((BraveBehaviour)player).specRigidbody;
			specRigidbody4.OnTileCollision = (OnTileCollisionDelegate)Delegate.Remove((Delegate?)(object)specRigidbody4.OnTileCollision, (Delegate?)new OnTileCollisionDelegate(OnHitWall));
			player.OnPreDodgeRoll -= OnDodgeRoll;
			isRocketJumping = false;
			if (PostRocketJump != null)
			{
				PostRocketJump(player);
			}
		}

		public void OnPreRigidbodyCollision(SpeculativeRigidbody myrigidbody, PixelCollider mypixelcollider, SpeculativeRigidbody otherrigidbody, PixelCollider otherpixelcollider)
		{
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)((BraveBehaviour)otherrigidbody).projectile == (Object)null)
			{
				if ((Object)(object)((BraveBehaviour)otherrigidbody).majorBreakable != (Object)null)
				{
					if ((Object)(object)((Component)((BraveBehaviour)otherrigidbody).majorBreakable).GetComponentInParent<FlippableCover>() != (Object)null)
					{
						FlippableCover componentInParent = ((Component)otherrigidbody).GetComponentInParent<FlippableCover>();
						if (!componentInParent.IsFlipped)
						{
							otherrigidbody.RegisterTemporaryCollisionException(myrigidbody, 1f / 150f, (float?)null);
						}
						else
						{
							cancelJump = true;
						}
					}
				}
				else if ((Object)(object)((Component)otherrigidbody).GetComponent<ConveyorBelt>() != (Object)null || Object.op_Implicit((Object)(object)((Component)otherrigidbody).GetComponent<MovingPlatform>()))
				{
					PhysicsEngine.SkipCollision = true;
				}
				else if (Object.op_Implicit((Object)(object)((BraveBehaviour)otherrigidbody).healthHaver) && Object.op_Implicit((Object)(object)((BraveBehaviour)otherrigidbody).aiActor))
				{
					if (!cancelJump)
					{
						((BraveBehaviour)otherrigidbody).knockbackDoer.ApplyKnockback(((Vector2)(ref jumpDirection)).normalized, ((Vector2)(ref jumpDirection)).magnitude, false);
						((BraveBehaviour)otherrigidbody).healthHaver.ApplyDamageDirectional(player.stats.rollDamage / 8f * ((Vector2)(ref jumpDirection)).magnitude, ((BraveBehaviour)otherrigidbody).sprite.WorldCenter - ((BraveBehaviour)myrigidbody).sprite.WorldCenter, "Rocket Jump", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
						cancelJump = true;
					}
				}
				else if (!Object.op_Implicit((Object)(object)((BraveBehaviour)otherrigidbody).minorBreakable))
				{
					cancelJump = true;
				}
			}
			else
			{
				PhysicsEngine.SkipCollision = true;
			}
		}

		public bool AnyDistanceToNearestWall(SpeculativeRigidbody body)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: 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_005d: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			IntVector2[] array = (IntVector2[])(object)new IntVector2[4]
			{
				IntVector2.Up,
				IntVector2.Down,
				IntVector2.Left,
				IntVector2.Right
			};
			int num = 4;
			IntVector2[] array2 = array;
			foreach (IntVector2 pushDirection in array2)
			{
				flag |= body.DistanceToNearestWall(pushDirection, num) >= 0 && body.DistanceToNearestWall(pushDirection, num) < num;
			}
			return flag;
		}

		public bool CellCheckIHateThisAAAA()
		{
			//IL_0016: 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_0037: Unknown result type (might be due to invalid IL or missing references)
			RoomHandler absoluteRoomFromPosition = GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(Vector2Extensions.ToIntVector2(((GameActor)player).CenterPosition, (VectorConversions)2));
			if (absoluteRoomFromPosition != null)
			{
				CellData nearestCellToPosition = absoluteRoomFromPosition.GetNearestCellToPosition(((GameActor)player).CenterPosition);
				return nearestCellToPosition.HasWallNeighbor(true, true);
			}
			return false;
		}

		public void OnDamaged(float resultValue, float maxValue, CoreDamageTypes damageTypes, DamageCategory damageCategory, Vector2 damageDirection)
		{
		}

		public void OnHitWall(CollisionData collisionData)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			canWallScrape = true;
			Vector2 val = Vector2.Dot(jumpDirection, ((CastResult)collisionData).Normal) * ((CastResult)collisionData).Normal;
			GameManager.Instance.MainCameraController.DoScreenShake(new ScreenShakeSettings(((Vector2)(ref val)).magnitude / jumpMaxMagnitude, 5f, 0.1f, 0.3f), (Vector2?)((BraveBehaviour)player).specRigidbody.UnitCenter, false);
			jumpDirection -= val;
			jumpDirection *= 0.8f;
		}

		public void OnDodgeRoll(PlayerController player)
		{
			cancelJump = true;
		}

		public void MovementMod(ref Vector2 voluntaryVal, ref Vector2 involuntaryVal)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: 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_0075: 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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
			involuntaryVal += jumpDirection;
			if (voluntaryVal != Vector2.zero && involuntaryVal != Vector2.zero)
			{
				float num = Vector2.Dot(involuntaryVal, voluntaryVal) / (((Vector2)(ref voluntaryVal)).magnitude * ((Vector2)(ref involuntaryVal)).magnitude);
				jumpDirection = involuntaryVal + voluntaryVal * AirstrafeControl * (1f - Mathf.Abs(num)) * (((Vector2)(ref involuntaryVal)).magnitude / jumpMaxMagnitude);
				voluntaryVal = Vector2.zero;
			}
		}

		public void SetPlayer(PlayerController target)
		{
			player = target;
		}

		public void RocketJumpAction(PlayerController player)
		{
		}

		public void AfterRocketJump(PlayerController player)
		{
		}
	}
	public class LibertyLauncher : AdvancedGunBehavior
	{
		public static ExplosionData genericSmallExplosion = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultSmallExplosionData;

		public static ExplosionData genericLargeExplosion = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultExplosionData;

		public static string consoleID;

		public static int ID;

		private bool HasReloaded;

		public static ExplosionData rocketexplosion = new ExplosionData
		{
			useDefaultExplosion = false,
			doExplosionRing = true,
			damageRadius = 3f,
			pushRadius = 3.5f,
			damage = 10f,
			doDamage = true,
			damageToPlayer = 0f,
			secretWallsRadius = 6f,
			forcePreventSecretWallDamage = false,
			doDestroyProjectiles = true,
			doForce = true,
			force = 20f,
			debrisForce = 25f,
			preventPlayerForce = false,
			explosionDelay = 0.1f,
			usesComprehensiveDelay = false,
			comprehensiveDelay = 0f,
			doScreenShake = false,
			playDefaultSFX = true,
			effect = genericLargeExplosion.effect,
			ignoreList = genericLargeExplosion.ignoreList,
			ss = genericLargeExplosion.ss
		};

		public static void Add()
		{
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: 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_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			consoleID = "qad:liberty_launcher";
			Gun val = Databases.Items.NewGun("Liberty Launcher", "liberty");
			Game.Items.Rename("outdated_gun_mods:liberty_launcher", consoleID);
			((Component)val).gameObject.AddComponent<LibertyLauncher>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Bells and Whistles");
			GunExt.SetLongDescription((PickupObject)(object)val, "Fire fast fancy flying rockets at foes to fling them far out into familiar family faces to also fracture their facade. An absolute staple of modern military equipment!");
			GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "liberty_idle_001", 8);
			GunExt.SetAnimationFPS(val, val.shootAnimation, 10);
			GunExt.SetAnimationFPS(val, val.reloadAnimation, 1);
			GunTools.TrimGunSprites(val);
			PickupObject byId = PickupObjectDatabase.GetById(39);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			val.DefaultModule.ammoCost = 1;
			val.DefaultModule.shootStyle = (ShootStyle)0;
			val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
			val.reloadTime = 2f;
			val.DefaultModule.cooldownTime = 0.9f;
			val.DefaultModule.numberOfShotsInClip = 5;
			val.SetBaseMaxAmmo(150);
			val.gunClass = (GunClass)45;
			ref string gunSwitchGroup = ref val.gunSwitchGroup;
			PickupObject byId2 = PickupObjectDatabase.GetById(541);
			gunSwitchGroup = ((Gun)((byId2 is Gun) ? byId2 : null)).gunSwitchGroup;
			val.carryPixelOffset += new IntVector2(0, 2);
			((PickupObject)val).quality = (ItemQuality)3;
			ItemBuilder.AddToSubShop((PickupObject)(object)val, (ShopType)3, 1f);
			Projectile val2 = Object.Instantiate<Projectile>(val.DefaultModule.projectiles[0]);
			((Component)val2).gameObject.SetActive(false);
			FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject);
			Object.DontDestroyOnLoad((Object)(object)val2);
			val.DefaultModule.projectiles[0] = val2;
			val2.baseData.damage = 25f;
			val2.baseData.speed = 32f;
			val2.baseData.range = 50f;
			val2.baseData.force = 50f;
			Transform transform = ((Component)val.barrelOffset).transform;
			transform.localPosition += new Vector3(0.75f, 0.875f);
			((BraveBehaviour)val2).transform.parent = val.barrelOffset;
			val2.baseData.UsesCustomAccelerationCurve = false;
			GunTools.SetProjectileSpriteRight(val2, "rocket_projectile", 22, 6, false, (Anchor)3, (int?)28, (int?)6, true, false, (int?)null, (int?)null, (Projectile)null);
			Databases.Items.Add((PickupObject)(object)val, false, "ANY");
			val.DefaultModule.ammoType = (AmmoType)14;
			val.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("stock_rocket", "TF2Items/Resources/CustomGunAmmoTypes/rocket/rocket_clipfull", "TF2Items/Resources/CustomGunAmmoTypes/rocket/rocket_clipempty");
			ExplosiveModifier orAddComponent = GameObjectExtensions.GetOrAddComponent<ExplosiveModifier>(((Component)val2).gameObject);
			orAddComponent.explosionData = rocketexplosion;
			ID = ((PickupObject)val).PickupObjectId;
			KilledEnemiesBecomeProjectileModifier orAddComponent2 = GameObjectExtensions.GetOrAddComponent<KilledEnemiesBecomeProjectileModifier>(((Component)val2).gameObject);
			((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.shootAnimation).frames[0].eventAudio = "Play_rocket_shoot";
			((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.shootAnimation).frames[0].triggerEvent = true;
			((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.reloadAnimation).frames[0].eventAudio = "Play_rocket_reload";
			((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.reloadAnimation).frames[0].triggerEvent = true;
		}

		protected override void Update()
		{
			if (Object.op_Implicit((Object)(object)base.gun.CurrentOwner))
			{
				if (!base.gun.PreventNormalFireAudio)
				{
					base.gun.PreventNormalFireAudio = true;
				}
				if (!base.gun.IsReloading && !HasReloaded)
				{
					HasReloaded = true;
				}
			}
		}

		public override void OnReloadPressed(PlayerController player, Gun gun, bool bSOMETHING)
		{
			if (gun.IsReloading && HasReloaded)
			{
				HasReloaded = false;
				AkSoundEngine.PostEvent("Stop_WPN_All", ((Component)this).gameObject);
				((AdvancedGunBehavior)this).OnReloadPressed(player, gun, bSOMETHING);
			}
		}
	}
	public class Airstrike : GunBehaviour
	{
		public static ExplosionData genericSmallExplosion = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultSmallExplosionData;

		public static ExplosionData genericLargeExplosion = GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultExplosionData;

		public static int ID;

		public static string consoleID;

		public bool boostedFirerate = false;

		private float time_boosted = 0f;

		private float BoostTimePerBulletInClip = 0.5f;

		public float normalCooldown = 0.9f;

		public float boostMult = 0.31f;

		public static ExplosionData airstrikeExplosion = new ExplosionData
		{
			useDefaultExplosion = false,
			doExplosionRing = true,
			damageRadius = 2f,
			pushRadius = 2.5f,
			damage = 25f,
			doDamage = true,
			damageToPlayer = 0f,
			secretWallsRadius = 6f,
			forcePreventSecretWallDamage = false,
			doDestroyProjectiles = true,
			doForce = true,
			force = 4f,
			debrisForce = 8f,
			preventPlayerForce = false,
			explosionDelay = 0.1f,
			usesComprehensiveDelay = false,
			comprehensiveDelay = 0f,
			doScreenShake = true,
			playDefaultSFX = true,
			effect = genericSmallExplosion.effect,
			ignoreList = genericSmallExplosion.ignoreList,
			ss = genericSmallExplosion.ss
		};

		public static void Add()
		{
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: 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_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: 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_0357: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			consoleID = "qad:air_strike";
			Gun val = Databases.Items.NewGun("The Air Strike", "airstrike");
			Game.Items.Rename("outdated_gun_mods:the_air_strike", consoleID);
			((Component)val).gameObject.AddComponent<Airstrike>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Don't Confuse It For The Item");
			GunExt.SetLongDescription((PickupObject)(object)val, "Fire a barrage of rockets into the air which shortly land at the required target! They certainly won't see what's coming now!");
			GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "airstrike_idle_001", 8);
			GunExt.SetAnimationFPS(val, val.shootAnimation, 10);
			GunExt.SetAnimationFPS(val, val.reloadAnimation, 1);
			GunTools.TrimGunSprites(val);
			PickupObject byId = PickupObjectDatabase.GetById(56);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			val.DefaultModule.ammoCost = 1;
			val.DefaultModule.shootStyle = (ShootStyle)0;
			val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
			val.reloadTime = 1.6f;
			val.DefaultModule.cooldownTime = 0.9f;
			val.DefaultModule.numberOfShotsInClip = 4;
			val.SetBaseMaxAmmo(120);
			val.gunClass = (GunClass)45;
			val.gunSwitchGroup = "qad_airstrike";
			SoundManager.AddCustomSwitchData("WPN_Guns", val.gunSwitchGroup, "Play_WPN_Gun_Shot_01", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_rocket_shoot") });
			SoundManager.AddCustomSwitchData("WPN_Guns", val.gunSwitchGroup, "Play_WPN_Gun_Reload_01", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_rocket_reload") });
			val.muzzleFlashEffects = CodeShortcuts.Empty;
			val.preventRotation = true;
			((PickupObject)val).quality = (ItemQuality)3;
			ItemBuilder.AddToSubShop((PickupObject)(object)val, (ShopType)3, 1f);
			Projectile val2 = ProjectileUtility.InstantiateAndFakeprefab(val.DefaultModule.projectiles[0]);
			val.DefaultModule.projectiles[0] = val2;
			val2.baseData.damage = 15f;
			val2.baseData.speed = 40f;
			val2.baseData.range = 10000000f;
			val2.baseData.force = 2f;
			Transform transform = ((Component)val.barrelOffset).transform;
			transform.localPosition += new Vector3(-0.6875f, 1.25f);
			val.barrelOffset.rotation = Quaternion.Euler(new Vector3(0f, 0f, 90f));
			((BraveBehaviour)val2).transform.parent = val.barrelOffset;
			val2.baseData.UsesCustomAccelerationCurve = false;
			val2.AnimateProjectile(new List<string> { "airstrike_rocket_001", "airstrike_rocket_002", "airstrike_rocket_003", "airstrike_rocket_004" }, 16, loops: true, AnimateBullet.ConstructListOfSameValues<IntVector2>(new IntVector2(17, 9), 4), AnimateBullet.ConstructListOfSameValues(value: false, 4), AnimateBullet.ConstructListOfSameValues<Anchor>((Anchor)4, 4), AnimateBullet.ConstructListOfSameValues(value: false, 4), AnimateBullet.ConstructListOfSameValues(value: false, 4), AnimateBullet.ConstructListOfSameValues<Vector3?>(null, 4), AnimateBullet.ConstructListOfSameValues((IntVector2?)new IntVector2(17, 9), 4), AnimateBullet.ConstructListOfSameValues<IntVector2?>(null, 4), AnimateBullet.ConstructListOfSameValues<Projectile>(null, 4));
			PickupObject byId2 = PickupObjectDatabase.GetById(39);
			Projectile val3 = ((Gun)((byId2 is Gun) ? byId2 : null)).DefaultModule.projectiles[0];
			val2.ParticleTrail = val3.ParticleTrail;
			val2.TrailRenderer = val3.TrailRenderer;
			val2.CustomTrailRenderer = val3.CustomTrailRenderer;
			Databases.Items.Add((PickupObject)(object)val, false, "ANY");
			val.DefaultModule.ammoType = (AmmoType)14;
			val.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("airstrike_rocket", "TF2Items/Resources/CustomGunAmmoTypes/airstrike/airstrike_clipfull", "TF2Items/Resources/CustomGunAmmoTypes/airstrike/airstrike_clipempty");
			ExplosiveModifier orAddComponent = GameObjectExtensions.GetOrAddComponent<ExplosiveModifier>(((Component)val2).gameObject);
			orAddComponent.explosionData = airstrikeExplosion;
			AirstrikeProjectile orAddComponent2 = GameObjectExtensions.GetOrAddComponent<AirstrikeProjectile>(((Component)val2).gameObject);
			GameObject val4 = ResourceManager.LoadAssetBundle("shared_auto_002").LoadAsset<GameObject>("NapalmStrikeReticle");
			GameObject val5 = VFXBuilder.CreateVFX("airstrike_target", CodeShortcuts.GenerateFilePaths("TF2Items/Resources/OtherVFX/airstrike_target/airstrike_target_", 6), 5, new IntVector2(29, 29), (Anchor)4, false, 0.2f, -1f, (Color?)null, (WrapMode)2, true);
			tk2dSprite component = val5.GetComponent<tk2dSprite>();
			int spriteId = ((tk2dBaseSprite)component).spriteId;
			tk2dSpriteCollectionData collection = ((tk2dBaseSprite)component).collection;
			Object.Destroy((Object)(object)component);
			GameObject val6 = Object.Instantiate<GameObject>(val4);
			tk2dSlicedSprite component2 = val6.GetComponent<tk2dSlicedSprite>();
			tk2dSlicedSprite orAddComponent3 = GameObjectExtensions.GetOrAddComponent<tk2dSlicedSprite>(val5);
			((tk2dBaseSprite)orAddComponent3).SetSprite(collection, spriteId);
			orAddComponent3.anchor = (Anchor)4;
			GameObjectExtensions.GetOrAddComponent<ReticleRiserEffect>(val5);
			orAddComponent2.targetEffect = val5;
			ID = ((PickupObject)val).PickupObjectId;
		}

		public override void Update()
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043