Decompiled source of BlammCo Catalogue v2.1.0

plugins/ExampleMod.dll

Decompiled 3 months 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 ExampleMod;
using Gungeon;
using InControl;
using Microsoft.CodeAnalysis;
using MonoMod.RuntimeDetour;
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 ExampleM
{
	public class BabyFaceBlaster : AdvancedGunBehavior
	{
		private bool HasReloaded;

		public int bullethits;

		public float curdamage;

		public static int ID;

		public static void Add()
		{
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("Baby Face's Blaster", "babyface");
			Game.Items.Rename("outdated_gun_mods:baby_face's_blaster", "qad:baby_faces_blaster");
			((Component)val).gameObject.AddComponent<BabyFaceBlaster>();
			GunExt.SetShortDescription((PickupObject)(object)val, "BAM! YOU'RE DEAD PAL!");
			GunExt.SetLongDescription((PickupObject)(object)val, "Hitting an enemy grants you a speed boost. This speed boost is carried across guns but is fully lost when you take damage, and slightly lost when dodgerolling.\n\nThis gun makes its wielder more and more overconfident with every hit, making them think they don't need a dodge roll to dodge things, hence, why all is lost when they're proved wrong.");
			GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "babyface_idle_001", 8);
			GunExt.SetAnimationFPS(val, val.shootAnimation, 14);
			GunExt.SetAnimationFPS(val, val.reloadAnimation, 10);
			val.reloadTime = 1.1f;
			val.SetBaseMaxAmmo(200);
			val.gunClass = (GunClass)5;
			for (int i = 0; i < 5; i++)
			{
				PickupObject byId = PickupObjectDatabase.GetById(86);
				GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			}
			foreach (ProjectileModule projectile in val.Volley.projectiles)
			{
				projectile.ammoCost = 1;
				projectile.shootStyle = (ShootStyle)0;
				projectile.sequenceStyle = (ProjectileSequenceStyle)0;
				projectile.cooldownTime = 0.6f;
				projectile.numberOfShotsInClip = 4;
				projectile.angleVariance = 14f;
				Projectile val2 = Object.Instantiate<Projectile>(projectile.projectiles[0]);
				projectile.projectiles[0] = val2;
				val2.baseData.damage = 5f;
				val2.baseData.speed = 26f;
				val2.baseData.range = 15f;
				val2.baseData.force = 6f;
				((BraveBehaviour)val2).transform.parent = val.barrelOffset;
				((Component)val2).gameObject.SetActive(false);
				FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject);
				Object.DontDestroyOnLoad((Object)(object)val2);
				val.DefaultModule.projectiles[0] = val2;
				if (projectile != val.DefaultModule)
				{
					projectile.ammoCost = 0;
				}
			}
			((PickupObject)val).quality = (ItemQuality)2;
			((BraveBehaviour)val).encounterTrackable.EncounterGuid = "thespeedgun";
			val.DefaultModule.ammoType = (AmmoType)4;
			val.Volley.UsesShotgunStyleVelocityRandomizer = true;
			val.Volley.DecreaseFinalSpeedPercentMin = -25f;
			val.Volley.IncreaseFinalSpeedPercentMax = 30f;
			Transform transform = ((Component)val.barrelOffset).transform;
			transform.localPosition += new Vector3(0.5f, 0.625f);
			ref string gunSwitchGroup = ref val.gunSwitchGroup;
			PickupObject byId2 = PickupObjectDatabase.GetById(541);
			gunSwitchGroup = ((Gun)((byId2 is Gun) ? byId2 : null)).gunSwitchGroup;
			Databases.Items.Add((PickupObject)(object)val, false, "ANY");
			ID = ((PickupObject)val).PickupObjectId;
		}

		public override void PostProcessProjectile(Projectile projectile)
		{
			projectile.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(projectile.OnHitEnemy, new Action<Projectile, SpeculativeRigidbody, bool>(OnHitEnemy));
			((AdvancedGunBehavior)this).PostProcessProjectile(projectile);
		}

		private void OnHitEnemy(Projectile proj, SpeculativeRigidbody enemy, bool fatal)
		{
			if (bullethits < 40)
			{
				bullethits++;
			}
			StatChange(proj.PossibleSourceGun);
		}

		private void StatChange(Gun gun)
		{
			PlayerController val = GunTools.GunPlayerOwner(gun);
			GunTools.RemoveStatFromGun(gun, (StatType)0);
			GunTools.AddStatToGun(gun, (StatType)0, 1f + (float)bullethits * 0.0125f, (ModifyMethod)1);
			val.stats.RecalculateStats(val, true, false);
		}

		public override void OnPostFired(PlayerController player, Gun gun)
		{
			gun.PreventNormalFireAudio = true;
			AkSoundEngine.PostEvent("Play_babyface_shoot", ((Component)this).gameObject);
		}

		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;
				}
			}
		}

		protected override void OnPickup(GameActor player)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			((AdvancedGunBehavior)this).OnPickup(player);
			ETGModConsole.Log((object)"OnPickup Was Triggered", false);
			((BraveBehaviour)((player is PlayerController) ? player : null)).healthHaver.OnDamaged += new OnDamagedEvent(OnDamaged);
			((PlayerController)((player is PlayerController) ? player : null)).OnPreDodgeRoll += OnDodgeRoll;
			StatChange(((player is PlayerController) ? player : null).CurrentGun);
		}

		protected override void OnPostDrop(GameActor player)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			ETGModConsole.Log((object)"OnDrop Was Triggered", false);
			((AdvancedGunBehavior)this).OnPostDrop(player);
			((BraveBehaviour)((player is PlayerController) ? player : null)).healthHaver.OnDamaged += new OnDamagedEvent(OnDamaged);
			((PlayerController)((player is PlayerController) ? player : null)).OnPreDodgeRoll += OnDodgeRoll;
			StatChange(((player is PlayerController) ? player : null).CurrentGun);
		}

		public override void OnDestroy()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			GameActor owner = ((AdvancedGunBehavior)this).Owner;
			((BraveBehaviour)((owner is PlayerController) ? owner : null)).healthHaver.OnDamaged -= new OnDamagedEvent(OnDamaged);
			GameActor owner2 = ((AdvancedGunBehavior)this).Owner;
			((PlayerController)((owner2 is PlayerController) ? owner2 : null)).OnPreDodgeRoll += OnDodgeRoll;
			GameActor owner3 = ((AdvancedGunBehavior)this).Owner;
			StatChange(((owner3 is PlayerController) ? owner3 : null).CurrentGun);
			((BraveBehaviour)this).OnDestroy();
		}

		private void OnDamaged(float resultValue, float maxValue, CoreDamageTypes damageTypes, DamageCategory damageCategory, Vector2 damageDirection)
		{
			bullethits = 0;
			StatChange(base.gun);
		}

		private void OnDodgeRoll(PlayerController player)
		{
			bullethits -= 20;
			if (bullethits < 0)
			{
				bullethits = 0;
			}
			StatChange(base.gun);
		}

		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);
				AkSoundEngine.PostEvent("Play_scatter_gun_reload", ((Component)this).gameObject);
			}
		}
	}
}
namespace ExampleMod
{
	public class Dispenser : PlayerItem
	{
		public static GameObject DispenserObject;

		public static int ID;

		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_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			string text = "Dispenser";
			string text2 = "ExampleMod/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;
			ID = ((PickupObject)dispenser).PickupObjectId;
			DispenserObject = SpriteBuilder.SpriteFromResource("ExampleMod/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;

		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 = "ExampleMod/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;
			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 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 = "ExampleMod/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;
			ID = ((PickupObject)bonk_Soda).PickupObjectId;
			customVFXPrefab = VFXToolbox.CreateOverheadVFX(new List<string> { "ExampleMod/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 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 = "ExampleMod/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;
			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 TF2Characters
	{
		public static PlayableCharacters Scout;

		public static PlayableCharacters Soldier;
	}
	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 : MonoBehaviour
	{
		public Gun self;

		private PlayerController gunOwner;

		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 Action OnStartedRev;

		public Action OnEndedRev;

		public void Start()
		{
			self = ((Component)this).GetComponent<Gun>();
			currentAmmo = self.ammo;
			gunOwner = GunTools.GunPlayerOwner(self);
			_muzzleFlashHolder = self.muzzleFlashEffects;
			_shellsHolder = self.shellsToLaunchOnFire;
			doesScreenshake = self.doesScreenShake;
			self.doesScreenShake = false;
			self.muzzleFlashEffects = CodeShortcuts.Empty;
			self.shellsToLaunchOnFire = 0;
			Gun obj = self;
			obj.PostProcessProjectile = (Action<Projectile>)Delegate.Combine(obj.PostProcessProjectile, new Action<Projectile>(OnFire));
			if (Object.op_Implicit((Object)(object)gunOwner))
			{
				gunOwner.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)self) || !Object.op_Implicit((Object)(object)gunOwner))
			{
				return;
			}
			if (self.IsFiring && !gunOwner.IsDodgeRolling)
			{
				if (!isRevving && !isPostRev)
				{
					OnStartedRev();
				}
				else if (_currentSpin < RevTime)
				{
					if (currentAmmo != self.ammo)
					{
						self.ammo = currentAmmo;
					}
					_currentSpin += BraveTime.DeltaTime;
				}
				else if (_currentSpin >= RevTime && !isPostRev)
				{
					AkSoundEngine.PostEvent(RevLoopAudio + "_stop", ((Component)this).gameObject);
					AkSoundEngine.PostEvent(ShootLoopAudio, ((Component)this).gameObject);
					self.muzzleFlashEffects = _muzzleFlashHolder;
					self.shellsToLaunchOnFire = _shellsHolder;
					self.doesScreenShake = doesScreenshake;
					((BraveBehaviour)self).spriteAnimator.PlayFromFrame(FireLoopStartIndex);
					isPostRev = true;
					isRevving = false;
				}
			}
			else if (isPostRev || isRevving)
			{
				OnEndedRev();
			}
			else
			{
				currentAmmo = self.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;
		}

		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;
			self.doesScreenShake = false;
			self.muzzleFlashEffects = CodeShortcuts.Empty;
			self.shellsToLaunchOnFire = 0;
		}

		public void OnFire(Projectile projectile)
		{
			if (_currentSpin < RevTime)
			{
				projectile.DieInAir(true, true, true, false);
			}
		}

		private void OnGunChanged(Gun previous, Gun current, bool changed)
		{
			if ((Object)(object)current != (Object)(object)self && (isPostRev || isRevving))
			{
				OnEndedRev();
			}
		}
	}
	public class BaseballProjectile : MonoBehaviour
	{
		private float m_timeActive = 0f;

		private float m_debrisTime = 0f;

		private bool hasHitEnemy = false;

		private bool becameDebris = false;

		public Action OnBallPickup;

		public Projectile self;

		public float MaxTimeForStun = 1f;

		public float MaxStunDuration = 8f;

		public float MinStunDuration = 1f;

		public float DebrisTime = 2f;

		public float DespawnTime = 6f;

		public GameObject DeathVFX;

		private ImprovedAfterImage effect;

		private ProjectileSpin spin;

		public void Start()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: 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_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Expected O, but got Unknown
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Expected O, but got Unknown
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			self = ((Component)this).GetComponent<Projectile>();
			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));
			SpeculativeRigidbody specRigidbody3 = ((BraveBehaviour)self).specRigidbody;
			specRigidbody3.OnTileCollision = (OnTileCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody3.OnTileCollision, (Delegate?)new OnTileCollisionDelegate(Bounced));
			DeathVFX = self.hitEffects.overrideMidairDeathVFX;
			OnBallPickup = (Action)Delegate.Combine(OnBallPickup, 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 = 900f;
			spin.DecayRate = 0.8f;
			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;
		}

		public void Update()
		{
			//IL_00af: 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(0.5f, 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)
				{
					DespawnBall();
				}
			}
		}

		public void DropBall(Vector2 NewVelocity)
		{
			//IL_0027: 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)
			becameDebris = true;
			((Behaviour)spin).enabled = false;
			effect.spawnShadows = false;
			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 && OnBallPickup != null && m_timeActive > 0.05f)
			{
				OnBallPickup();
			}
		}

		public void OnBallCollided(CollisionData collisiondata)
		{
			//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_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: 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))
			{
				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);
				}
				DespawnTime *= 0.75f * num;
			}
			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 tileCollision)
		{
			string[] array = new string[3] { "baseball_hitworld1", "baseball_hitworld2", "baseball_hitworld3" };
			AkSoundEngine.PostEvent(array[Random.Range(0, array.Length)], ((Component)this).gameObject);
		}

		public void OnBallPlayerPickup()
		{
			DespawnBall();
		}

		public void DespawnBall()
		{
			//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 Vector2 jumpDirection;

		public Action<PlayerController> OnRocketJump;

		public Action<PlayerController> PostRocketJump;

		public PlayerController Player => player;

		public RocketJumpDoer()
		{
			isAbleToRocketJump = false;
			isRocketJumping = false;
			cancelJump = false;
		}

		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 *= 200f * (timer / distance);
					jumpDirection.y *= 200f * (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.OnPreTileCollision = (OnPreTileCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody.OnPreTileCollision, (Delegate?)new OnPreTileCollisionDelegate(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 > 7f)
			{
				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.98f, BraveTime.DeltaTime);
				jumpDirection.y *= Mathf.Pow(0.98f, BraveTime.DeltaTime);
				if (!player.AdditionalCanDodgeRollWhileFlying.BaseValue)
				{
					delay += BraveTime.DeltaTime;
				}
				yield return null;
			}
			if (cancelJump && !player.IsDodgeRolling)
			{
				GameManager.Instance.MainCameraController.DoScreenShake(new ScreenShakeSettings(((Vector2)(ref jumpDirection)).magnitude / 60f, 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.OnPreTileCollision = (OnPreTileCollisionDelegate)Delegate.Remove((Delegate?)(object)specRigidbody4.OnPreTileCollision, (Delegate?)new OnPreTileCollisionDelegate(OnHitWall));
			player.OnPreDodgeRoll -= OnDodgeRoll;
			isRocketJumping = false;
			if (PostRocketJump != null)
			{
				PostRocketJump(player);
			}
		}

		public void OnPreRigidbodyCollision(SpeculativeRigidbody myrigidbody, PixelCollider mypixelcollider, SpeculativeRigidbody otherrigidbody, PixelCollider otherpixelcollider)
		{
			//IL_0123: 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_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)((BraveBehaviour)otherrigidbody).projectile == (Object)null))
			{
				return;
			}
			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>()))
			{
				otherrigidbody.RegisterTemporaryCollisionException(myrigidbody, 0.01f, (float?)null);
			}
			else if (Object.op_Implicit((Object)(object)((BraveBehaviour)otherrigidbody).healthHaver) && Object.op_Implicit((Object)(object)((BraveBehaviour)otherrigidbody).aiActor))
			{
				if (!cancelJump)
				{
					((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);
					((BraveBehaviour)otherrigidbody).knockbackDoer.ApplyKnockback(((BraveBehaviour)myrigidbody).sprite.WorldCenter - ((BraveBehaviour)otherrigidbody).sprite.WorldCenter, 0.5f * ((Vector2)(ref jumpDirection)).magnitude, false);
					cancelJump = true;
				}
			}
			else if (!Object.op_Implicit((Object)(object)((BraveBehaviour)otherrigidbody).minorBreakable))
			{
				cancelJump = true;
			}
		}

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

		public void OnHitWall(SpeculativeRigidbody myrigidbody, PixelCollider mypixelcollider, Tile tile, PixelCollider tilepixelcollider)
		{
			cancelJump = true;
		}

		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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			involuntaryVal += jumpDirection;
			if (voluntaryVal != Vector2.zero && involuntaryVal != Vector2.zero)
			{
				float num = Vector2.Dot(involuntaryVal, voluntaryVal) / (((Vector2)(ref voluntaryVal)).magnitude * ((Vector2)(ref involuntaryVal)).magnitude);
				involuntaryVal += voluntaryVal * 1.5f * (1f - Mathf.Abs(num));
				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 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_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: 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_01d1: 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_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("Liberty Launcher", "liberty");
			Game.Items.Rename("outdated_gun_mods:liberty_launcher", "qad:liberty_launcher");
			((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", "ExampleMod/Resources/CustomGunAmmoTypes/rocket/rocket_clipfull", "ExampleMod/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;

		private bool HasReloaded;

		public static ExplosionData rocketexplosion = new ExplosionData
		{
			useDefaultExplosion = false,
			doExplosionRing = true,
			damageRadius = 2f,
			pushRadius = 2.5f,
			damage = 20f,
			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_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: 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_01ca: 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_0265: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("The Air Strike", "airstrike");
			Game.Items.Rename("outdated_gun_mods:the_air_strike", "qad:air_strike");
			((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(86);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			val.DefaultModule.ammoCost = 1;
			val.DefaultModule.shootStyle = (ShootStyle)1;
			val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
			val.reloadTime = 1.6f;
			val.DefaultModule.cooldownTime = 0.28f;
			val.DefaultModule.numberOfShotsInClip = 4;
			val.SetBaseMaxAmmo(120);
			val.gunClass = (GunClass)45;
			ref string gunSwitchGroup = ref val.gunSwitchGroup;
			PickupObject byId2 = PickupObjectDatabase.GetById(541);
			gunSwitchGroup = ((Gun)((byId2 is Gun) ? byId2 : null)).gunSwitchGroup;
			((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 = 15f;
			val2.baseData.speed = 40f;
			val2.baseData.range = 0.1f;
			val2.baseData.force = 0f;
			Transform transform = ((Component)val.barrelOffset).transform;
			transform.localPosition += new Vector3(0.75f, 0.625f);
			val.barrelOffset.rotation = Quaternion.Euler(new Vector3(0f, 0f, 90f));
			((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", "ExampleMod/Resources/CustomGunAmmoTypes/rocket/rocket_clipfull", "ExampleMod/Resources/CustomGunAmmoTypes/rocket/rocket_clipempty");
			SkyRocket orAddComponent = GameObjectExtensions.GetOrAddComponent<SkyRocket>(((Component)((BraveBehaviour)val2).sprite).gameObject);
			orAddComponent.AscentTime = 0.4f;
			orAddComponent.DescentTime = 0.6f;
			orAddComponent.Variance = 0f;
			ID = ((PickupObject)val).PickupObjectId;
		}

		public override void OnPostFired(PlayerController player, Gun gun)
		{
			gun.PreventNormalFireAudio = true;
			AkSoundEngine.PostEvent("Play_rocket_shoot", ((Component)this).gameObject);
		}

		public 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 PostProcessProjectile(Projectile projectile)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			((GunBehaviour)this).PostProcessProjectile(projectile);
			GameObject val = Object.Instantiate<GameObject>((GameObject)BraveResources.Load("Global Prefabs/_ChallengeManager", ".prefab"));
			ChallengeModifier challenge = val.GetComponent<ChallengeManager>().PossibleChallenges.Where((ChallengeDataEntry c) => c.challenge is SkyRocketChallengeModifier).First().challenge;
			GameObject rocket = ((SkyRocketChallengeModifier)((challenge is SkyRocketChallengeModifier) ? challenge : null)).Rocket;
			Object.Destroy((Object)(object)val);
			SkyRocket orAddComponent = GameObjectExtensions.GetOrAddComponent<SkyRocket>(SpawnManager.SpawnProjectile(rocket, Vector3.zero, Quaternion.identity, true).gameObject);
			orAddComponent.SpawnObject = ((Component)projectile).gameObject;
			orAddComponent.ExplosionData = rocketexplosion;
			orAddComponent.TargetVector2 = Vector2.op_Implicit(GunTools.GunPlayerOwner(projectile.PossibleSourceGun).unadjustedAimPoint);
			orAddComponent.AscentTime = 0.2f;
			orAddComponent.DescentTime = 0.4f;
			orAddComponent.Variance = 0f;
		}

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

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

		public static int ID;

		private static GameObject ExplosionEffect;

		private bool HasReloaded;

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

		public static void Add()
		{
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_033d: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("Rocket Jumper", "jumper");
			Game.Items.Rename("outdated_gun_mods:rocket_jumper", "qad:rocket_jumper");
			((Component)val).gameObject.AddComponent<RocketJumper>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Reach For The Star");
			GunExt.SetLongDescription((PickupObject)(object)val, "A very ineffective weapon, but a very useful mobility tool. Dodge roll in the presence of it's projectiles'  explosions to perform a rocket jump\n\nThis weapon was supposedly used to train young rocket jumpees the ropes, which resulted in a lot of broken legs. Hm.");
			GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "jumper_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 = 1f;
			val.DefaultModule.cooldownTime = 0.9f;
			val.DefaultModule.numberOfShotsInClip = 4;
			val.SetBaseMaxAmmo(1000);
			val.gunClass = (GunClass)50;
			ref string gunSwitchGroup = ref val.gunSwitchGroup;
			PickupObject byId2 = PickupObjectDatabase.GetById(541);
			gunSwitchGroup = ((Gun)((byId2 is Gun) ? byId2 : null)).gunSwitchGroup;
			((PickupObject)val).quality = (ItemQuality)1;
			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;
			ExplosionEffect = VFXToolbox.CreateVFX("Explosion Ring", new List<string>
			{
				"ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_001.png", "ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_002.png", "ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_003.png", "ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_004.png", "ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_005.png", "ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_006.png", "ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_007.png", "ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_008.png", "ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_009.png", "ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_010.png",
				"ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_011.png", "ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_012.png", "ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_013.png", "ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_014.png", "ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_015.png", "ExampleMod/Resources/OtherVFX/explosion_ring/explosion_ring_cloud_016.png"
			}, 48, new IntVector2(101, 101), (Anchor)4, usesZHeight: false, 0f, -1f, null, (WrapMode)2);
			val2.baseData.damage = 3f;
			val2.baseData.speed = 22f;
			val2.baseData.range = 100f;
			val2.baseData.force = 30f;
			Transform transform = ((Component)val.barrelOffset).transform;
			transform.localPosition += new Vector3(0.75f, 0.625f);
			((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);
			rocketexplosion.effect = ExplosionEffect;
			Databases.Items.Add((PickupObject)(object)val, false, "ANY");
			val.DefaultModule.ammoType = (AmmoType)14;
			val.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("stock_rocket", "ExampleMod/Resources/CustomGunAmmoTypes/rocket/rocket_clipfull", "ExampleMod/Resources/CustomGunAmmoTypes/rocket/rocket_clipempty");
			ExplosiveModifier orAddComponent = GameObjectExtensions.GetOrAddComponent<ExplosiveModifier>(((Component)val2).gameObject);
			orAddComponent.explosionData = rocketexplosion;
			ID = ((PickupObject)val).PickupObjectId;
			((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.shootAnimation).frames[0].eventAudio = "rocket_jumper_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;
		}

		public override void PostProcessProjectile(Projectile projectile)
		{
			((GunBehaviour)this).PostProcessProjectile(projectile);
			projectile.OnDestruction += OnDestroy;
		}

		public void OnDestroy(Projectile projectile)
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			AkSoundEngine.PostEvent("rocket_jumper_explode1", ((Component)projectile).gameObject);
			if (Object.op_Implicit((Object)(object)((GunBehaviour)this).PlayerOwner))
			{
				RocketJumpDoer component = ((Component)((GunBehaviour)this).PlayerOwner).gameObject.GetComponent<RocketJumpDoer>();
				if ((Object)(object)component == (Object)null || (Object)(object)component.Player == (Object)null)
				{
					component = GameObjectExtensions.GetOrAddComponent<RocketJumpDoer>(((Component)base.gun).gameObject);
					component.CheckForJump(((GunBehaviour)this).PlayerOwner, Vector2.op_Implicit(projectile.SafeCenter), rocketexplosion);
				}
			}
		}

		public override void OnPostFired(PlayerController player, Gun gun)
		{
			gun.PreventNormalFireAudio = true;
		}

		public 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);
				((GunBehaviour)this).OnReloadPressed(player, gun, bSOMETHING);
			}
		}

		public override void OnPlayerPickup(PlayerController playerOwner)
		{
			((GunBehaviour)this).OnPlayerPickup(playerOwner);
			RocketJumpDoer orAddComponent = GameObjectExtensions.GetOrAddComponent<RocketJumpDoer>(((Component)base.gun).gameObject);
			orAddComponent.SetPlayer(playerOwner);
			orAddComponent.isRocketJumper = true;
		}

		public override void DisableEffect(GameActor owner)
		{
			RocketJumpDoer component = ((Component)base.gun).gameObject.GetComponent<RocketJumpDoer>();
			component.SetPlayer(null);
			((GunBehaviour)this).DisableEffect(owner);
		}
	}
	public class Gunboats : PassiveItem
	{
		public static int ID;

		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_0050: Unknown result type (might be due to invalid IL or missing references)
			string text = "Gunboats";
			string text2 = "ExampleMod/Resources/passives/gunboats_sprite";
			GameObject val = new GameObject(text);
			Gunboats gunboats = val.AddComponent<Gunboats>();
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "Fly Away";
			string text4 = "These thin fabric boots laced with some metal plating allows you to rocket jump. Dodge roll in the blast radius of an explosion to do so, and dodge roll mid-air to cancel the jump prematurey.\n\nHow to these marvels of technology function? Nobody knows. Most people suspect magic is involved. Others say the metal was sourced from great depths.";
			ItemBuilder.SetupItem((PickupObject)(object)gunboats, text3, text4, "qad");
			ID = ((PickupObject)gunboats).PickupObjectId;
			((PickupObject)gunboats).quality = (ItemQuality)3;
		}

		public void OnRocketJump(PlayerController player)
		{
		}

		public override void Pickup(PlayerController player)
		{
			RocketJumpDoer orAddComponent = GameObjectExtensions.GetOrAddComponent<RocketJumpDoer>(((Component)player).gameObject);
			orAddComponent.SetPlayer(player);
			((PassiveItem)this).Pickup(player);
		}

		public override void DisableEffect(PlayerController player)
		{
			RocketJumpDoer component = ((Component)player).gameObject.GetComponent<RocketJumpDoer>();
			component.SetPlayer(null);
			((PassiveItem)this).DisableEffect(player);
		}
	}
	public class SynergyInitialiser
	{
		public static void Initialise()
		{
			CustomSynergies.Add("I Love My Balls", new List<string> { "qad:sandman" }, new List<string> { "scattershot", "helix_bullets", "flak_bullets" }, true);
			CustomSynergies.Add("Home Run All The Time", new List<string> { "qad:sandman" }, new List<string> { "orbital_bullets", "mr_accretion_jr" }, true);
			CustomSynergies.Add("The Forbidden Combo", new List<string> { "qad:sandman", "qad:flying_guillotine" }, (List<string>)null, true);
			AddSynergyForm(26, Nailgun.ID, new List<string> { "nail_gun" }, new List<string> { "qad:recon_pouch" }, "What Could Have Been", isSelectable: false);
			AddDualWield(ForceANature.ID, "qad:force_a_nature", SodaPopper.ID, "qad:soda_popper", "Double-Barrelled Twins");
		}

		public static void AddSynergyForm(int baseGun, int newGun, List<string> mandatoryConsoleIDs, List<string> optionalConsoleIDs, string synergy, bool isSelectable)
		{
			PickupObject byId = PickupObjectDatabase.GetById(baseGun);
			GunTools.AddTransformSynergy((Gun)(object)((byId is Gun) ? byId : null), newGun, true, synergy, !isSelectable);
			CustomSynergies.Add(synergy, mandatoryConsoleIDs, optionalConsoleIDs, true);
		}

		public static void AddDualWield(int gun1, string gun1ConsoleID, int gun2, string gun2ConsoleID, string synergy)
		{
			PickupObject byId = PickupObjectDatabase.GetById(gun1);
			AdvancedDualWieldSynergyProcessor val = ((Component)((byId is Gun) ? byId : null)).gameObject.AddComponent<AdvancedDualWieldSynergyProcessor>();
			val.PartnerGunID = gun2;
			val.SynergyNameToCheck = synergy;
			PickupObject byId2 = PickupObjectDatabase.GetById(gun2);
			AdvancedDualWieldSynergyProcessor val2 = ((Component)((byId2 is Gun) ? byId2 : null)).gameObject.AddComponent<AdvancedDualWieldSynergyProcessor>();
			val2.PartnerGunID = gun1;
			val2.SynergyNameToCheck = synergy;
			CustomSynergies.Add(synergy, new List<string> { gun1ConsoleID, gun2ConsoleID }, (List<string>)null, true);
		}
	}
	public class CustomGoops
	{
		public static GoopDefinition JarateGoop;

		public static void DefineGoops()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: 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)
			//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)
			//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_0034: 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)
			//IL_004b: Expected O, but got Unknown
			JarateGoop = new GoopDefinition
			{
				damagesEnemies = false,
				damagesPlayers = false,
				baseColor32 = Color32.op_Implicit(MoreColours.jarateyellow),
				goopTexture = GoopUtility.WaterDef.goopTexture,
				lifespan = 10f,
				usesLifespan = true
			};
		}
	}
	public class JarateEffectSetup
	{
		public static List<string> JarateFilePath = new List<string> { "ExampleMod/Resources/StatusEffectVFX/jarate_effect_icon" };

		public static GameObject jarateVFXObject;

		public static void Init()
		{
			//IL_000c: 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)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			JarateStatusEffect standardJarateEffect = StatusEffectHelper.GenerateJarateEffect(100f, 2f, tintEnemy: true, MoreColours.jarateyellow, tintCorpse: true, MoreColours.jarateyellow);
			StaticStatusEffects.StandardJarateEffect = standardJarateEffect;
			jarateVFXObject = SpriteBuilder.SpriteFromResource("ExampleMod/Resources/StatusEffectVFX/jarate_effect_icon", new GameObject("JarateIcon"), (Assembly)null);
			jarateVFXObject.SetActive(false);
			tk2dBaseSprite component = jarateVFXObject.GetComponent<tk2dBaseSprite>();
			GunTools.ConstructOffsetsFromAnchor(component.GetCurrentSpriteDef(), (Anchor)1, (Vector2?)Vector2.op_Implicit(component.GetCurrentSpriteDef().position3), false, true);
			FakePrefab.MarkAsFakePrefab(jarateVFXObject);
			Object.DontDestroyOnLoad((Object)(object)jarateVFXObject);
		}
	}
	public class JarateStatusEffect : GameActorEffect
	{
		public static List<string> JarateFilePath = new List<string> { "ExampleMod/Resources/StatusEffectVFX/jarate_effect_icon" };

		public static GameObject jarateVFXObject;

		public JarateStatusEffect()
		{
			//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_0014: 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)
			base.TintColor = MoreColours.jarateyellow;
			base.DeathTintColor = MoreColours.jarateyellow;
			base.AppliesTint = false;
			base.AppliesDeathTint = false;
		}

		public override void OnEffectApplied(GameActor actor, RuntimeGameActorEffectData effectData, float partialAmount = 1f)
		{
			((GameActorEffect)this).OnEffectApplied(actor, effectData, partialAmount);
			if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).aiActor))
			{
				HealthHaver healthHaver = ((BraveBehaviour)actor).healthHaver;
				healthHaver.AllDamageMultiplier += 0.75f;
				Vector2 val = default(Vector2);
				((Vector2)(ref val))..ctor(0f, 0.2f);
			}
		}

		public override void OnEffectRemoved(GameActor actor, RuntimeGameActorEffectData effectData)
		{
			((GameActorEffect)this).OnEffectRemoved(actor, effectData);
			if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).aiActor))
			{
				HealthHaver healthHaver = ((BraveBehaviour)actor).healthHaver;
				healthHaver.AllDamageMultiplier -= 0.75f;
				GameObject val = Object.Instantiate<GameObject>(jarateVFXObject);
				val.SetActive(false);
				tk2dSprite component = val.GetComponent<tk2dSprite>();
				Object.Destroy((Object)(object)component);
			}
		}
	}
	public class BabyFaceBlaster : AdvancedGunBehavior
	{
		public int bullethits;

		public float curdamage;

		public static int ID;

		public static bool isprimary;

		public static void Add()
		{
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: 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)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Expected O, but got Unknown
			Gun val = Databases.Items.NewGun("Baby Face's Blaster", "babyface");
			Game.Items.Rename("outdated_gun_mods:baby_face's_blaster", "qad:baby_faces_blaster");
			((Component)val).gameObject.AddComponent<BabyFaceBlaster>();
			GunExt.SetShortDescription((PickupObject)(object)val, "BAM! YOU'RE DEAD PAL!");
			GunExt.SetLongDescription((PickupObject)(object)val, "Hitting an enemy grants you a speed boost. This speed boost is carried across guns but is fully lost when you take damage, and slightly lost when dodgerolling.\n\nThis gun makes its wielder more and more overconfident with every hit, making them think they don't need a dodge roll to dodge things, hence, why all is lost when they're proved wrong.");
			GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "babyface_idle_001", 8);
			GunExt.SetAnimationFPS(val, val.shootAnimation, 14);
			GunExt.SetAnimationFPS(val, val.reloadAnimation, 10);
			GunTools.TrimGunSprites(val);
			val.reloadTime = 1.1f;
			val.SetBaseMaxAmmo(200);
			val.gunClass = (GunClass)5;
			for (int i = 0; i < 5; i++)
			{
				PickupObject byId = PickupObjectDatabase.GetById(86);
				GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			}
			foreach (ProjectileModule projectile in val.Volley.projectiles)
			{
				projectile.ammoCost = 1;
				projectile.shootStyle = (ShootStyle)0;
				projectile.sequenceStyle = (ProjectileSequenceStyle)0;
				projectile.cooldownTime = 0.6f;
				projectile.numberOfShotsInClip = 4;
				projectile.angleVariance = 14f;
				Projectile val2 = Object.Instantiate<Projectile>(projectile.projectiles[0]);
				projectile.projectiles[0] = val2;
				val2.bas