Decompiled source of SilverJacket v1.1.1

plugins/SilverJacket.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
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.ItemAPI;
using Alexandria.Misc;
using Alexandria.SoundAPI;
using Alexandria.VisualAPI;
using BepInEx;
using Dungeonator;
using Gungeon;
using HarmonyLib;
using InControl;
using MonoMod.RuntimeDetour;
using Newtonsoft.Json.Linq;
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]
namespace SilverJacket;

internal class ActiveTemplate : PlayerItem
{
	public static int ID;

	public static void Init()
	{
		//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 = " ";
		string text2 = "SilverJacket/Resources/Actives/...";
		GameObject val = new GameObject(text);
		ActiveTemplate activeTemplate = val.AddComponent<ActiveTemplate>();
		ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
		string text3 = " ";
		string text4 = " ";
		ItemBuilder.SetupItem((PickupObject)(object)activeTemplate, text3, text4, "slvjckt");
		ItemBuilder.SetCooldownType((PlayerItem)(object)activeTemplate, (CooldownType)0, 10f);
		((PlayerItem)activeTemplate).consumable = false;
		((PickupObject)activeTemplate).quality = (ItemQuality)2;
		((BraveBehaviour)activeTemplate).sprite.IsPerpendicular = true;
		ID = ((PickupObject)activeTemplate).PickupObjectId;
	}

	public override void DoEffect(PlayerController user)
	{
	}
}
public class ExamplePassive : PassiveItem
{
	public static int ID;

	public static void Init()
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Expected O, but got Unknown
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		string text = "Example Item Name";
		string text2 = "SilverJacket/Resources/example_item_sprite";
		GameObject val = new GameObject(text);
		ExamplePassive examplePassive = val.AddComponent<ExamplePassive>();
		ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
		string text3 = "Example Short Desc.";
		string text4 = "Example Long Description\n\nWow this description is really looooooooooong!";
		ItemBuilder.SetupItem((PickupObject)(object)examplePassive, text3, text4, "slvjckt");
		ItemBuilder.AddPassiveStatModifier((PickupObject)(object)examplePassive, (StatType)3, 1f, (ModifyMethod)0);
		ItemBuilder.AddPassiveStatModifier((PickupObject)(object)examplePassive, (StatType)4, 1f, (ModifyMethod)0);
		((PickupObject)examplePassive).quality = (ItemQuality)2;
		ID = ((PickupObject)examplePassive).PickupObjectId;
	}

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

	public override DebrisObject Drop(PlayerController player)
	{
		return ((PassiveItem)this).Drop(player);
	}
}
internal class GunTemplate : GunBehaviour
{
	public static string consoleID;

	private static string spriteID;

	public static int ID;

	public static void Add()
	{
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_0169: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		consoleID = "";
		spriteID = "";
		Gun val = Databases.Items.NewGun(" ", spriteID);
		Game.Items.Rename("outdated_gun_mods:" + consoleID, "slvjckt:" + consoleID);
		((Component)val).gameObject.AddComponent<GunTemplate>();
		GunExt.SetShortDescription((PickupObject)(object)val, " ");
		GunExt.SetLongDescription((PickupObject)(object)val, " ");
		GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, spriteID + "_idle_001", 20);
		GunExt.SetAnimationFPS(val, val.shootAnimation, 32);
		GunExt.SetAnimationFPS(val, val.reloadAnimation, 12);
		GunTools.TrimGunSprites(val);
		PickupObject byId = PickupObjectDatabase.GetById(26);
		GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
		ref VFXPool muzzleFlashEffects = ref val.muzzleFlashEffects;
		PickupObject byId2 = PickupObjectDatabase.GetById(26);
		muzzleFlashEffects = ((Gun)((byId2 is Gun) ? byId2 : null)).muzzleFlashEffects;
		val.DefaultModule.ammoCost = 1;
		val.DefaultModule.shootStyle = (ShootStyle)1;
		val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
		val.DefaultModule.ammoType = (AmmoType)14;
		val.reloadTime = 1f;
		val.DefaultModule.cooldownTime = 0.1f;
		val.DefaultModule.numberOfShotsInClip = 25;
		val.DefaultModule.angleVariance = 6f;
		val.SetBaseMaxAmmo(500);
		val.gunClass = (GunClass)1;
		Transform transform = ((Component)val.barrelOffset).transform;
		transform.localPosition += new Vector3(0.3125f, 0.5625f, 0f);
		((PickupObject)val).quality = (ItemQuality)(-100);
		val.gunSwitchGroup = "slvjckt" + consoleID;
		SoundManager.AddCustomSwitchData("WPN_Guns", val.gunSwitchGroup, "Play_WPN_Gun_Reload_01", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("ReloadSoundYouWant") });
		SoundManager.AddCustomSwitchData("WPN_Guns", val.gunSwitchGroup, "Play_WPN_Gun_Shot_01", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("ShootSoundYouWant") });
		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 = 3f;
		val2.baseData.speed = 26f;
		val2.baseData.range = 30f;
		val2.baseData.force = 8f;
		((BraveBehaviour)val2).transform.parent = val.barrelOffset;
		Databases.Items.Add((PickupObject)(object)val, false, "ANY");
		ID = ((PickupObject)val).PickupObjectId;
	}
}
internal class BoneParade : PlayerItem
{
	private class ProjectileBounceRedirect : MonoBehaviour
	{
		private void Start()
		{
			Projectile component = ((Component)this).gameObject.GetComponent<Projectile>();
			component.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(component.OnHitEnemy, new Action<Projectile, SpeculativeRigidbody, bool>(OnHitEnemy));
		}

		private void OnHitEnemy(Projectile p, SpeculativeRigidbody enemy, bool fatal)
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			BounceProjModifier component = ((Component)this).gameObject.GetComponent<BounceProjModifier>();
			if (component.numberOfBounces > 1)
			{
				component.numberOfBounces--;
				PierceProjModifier orAddComponent = GameObjectExtensions.GetOrAddComponent<PierceProjModifier>(((Component)this).gameObject);
				orAddComponent.penetratesBreakables = true;
				orAddComponent.penetration++;
				Vector2 insideUnitCircle = Random.insideUnitCircle;
				((BraveBehaviour)((Component)this).gameObject.GetComponent<Projectile>()).projectile.SendInDirection(insideUnitCircle, false, true);
			}
		}
	}

	public static int encounterTimes;

	public static int ID;

	public static ItemStats stats = new ItemStats();

	private static Projectile boneProjectilePrefab;

	public static void Init()
	{
		//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_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		string text = "Bone Parade";
		string text2 = "SilverJacket/Resources/Actives/bone_parade";
		GameObject val = new GameObject(text);
		BoneParade boneParade = val.AddComponent<BoneParade>();
		ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
		string text3 = "Yo-ho-ho!";
		string text4 = "Summons 10 slightly-homing bone projectiles that bounce off both enemies and walls.\n\nThe bones of a great pirate. When in flight, you can almost hear them singing.";
		ItemBuilder.SetupItem((PickupObject)(object)boneParade, text3, text4, "slvjckt");
		ItemBuilder.SetCooldownType((PlayerItem)(object)boneParade, (CooldownType)1, 600f);
		((PlayerItem)boneParade).consumable = false;
		((PickupObject)boneParade).quality = (ItemQuality)4;
		((BraveBehaviour)boneParade).sprite.IsPerpendicular = true;
		ID = ((PickupObject)boneParade).PickupObjectId;
		stats.name = ((PickupObject)boneParade).EncounterNameOrDisplayName;
		boneProjectilePrefab = Object.Instantiate<Projectile>(((Gun)Databases.Items[15]).DefaultModule.projectiles[0]);
		((Component)boneProjectilePrefab).gameObject.SetActive(false);
		FakePrefab.MarkAsFakePrefab(((Component)boneProjectilePrefab).gameObject);
		Object.DontDestroyOnLoad((Object)(object)boneProjectilePrefab);
		List<string> list = new List<string> { "bone_projectile_001", "bone_projectile_002", "bone_projectile_003", "bone_projectile_004" };
		GunTools.AddAnimationToProjectile(boneProjectilePrefab, list, 10, Library.ConstructListOfSameValues<IntVector2>(new IntVector2(19, 19), 4), Library.ConstructListOfSameValues(value: true, 4), Library.ConstructListOfSameValues<Anchor>((Anchor)4, 4), Library.ConstructListOfSameValues(value: false, 4), Library.ConstructListOfSameValues(value: false, 4), Library.ConstructListOfSameValues<Vector3?>(null, 4), Library.ConstructListOfSameValues<IntVector2?>(null, 4), Library.ConstructListOfSameValues<IntVector2?>(null, 4), Library.ConstructListOfSameValues<Projectile>(null, 4), (WrapMode)0, "idle", "idle");
		boneProjectilePrefab.shouldRotate = false;
		boneProjectilePrefab.baseData.damage = 6f;
		HomingModifier val2 = ((Component)boneProjectilePrefab).gameObject.AddComponent<HomingModifier>();
		val2.HomingRadius = 1000f;
		val2.AngularVelocity = 75f;
		BounceProjModifier val3 = ((Component)boneProjectilePrefab).gameObject.AddComponent<BounceProjModifier>();
		val3.damageMultiplierOnBounce = 1f;
		val3.bouncesTrackEnemies = false;
		val3.numberOfBounces = 5;
		((Component)boneProjectilePrefab).gameObject.AddComponent<ProjectileBounceRedirect>();
	}

	public override void DoEffect(PlayerController user)
	{
		//IL_001c: 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_0031: Unknown result type (might be due to invalid IL or missing references)
		float num = 0f;
		for (int i = 0; i < 10; i++)
		{
			GameObject val = SpawnManager.SpawnProjectile(((Component)boneProjectilePrefab).gameObject, Vector2.op_Implicit(((BraveBehaviour)user).sprite.WorldCenter), Quaternion.Euler(0f, 0f, num), true);
			Projectile component = val.GetComponent<Projectile>();
			component.Owner = (GameActor)(object)user;
			component.Shooter = ((BraveBehaviour)user).specRigidbody;
			component.collidesWithPlayer = false;
			component.UpdateCollisionMask();
			num += 36f;
		}
	}

	public override void Pickup(PlayerController player)
	{
		if (!base.m_pickedUpThisRun)
		{
			stats.encounterAmount++;
			Module.UpdateStatList();
		}
		((PlayerItem)this).Pickup(player);
	}
}
internal class IcebergShavings : PlayerItem
{
	public static int encounterTimes;

	public static int ID;

	public static ItemStats stats = new ItemStats();

	private GoopDefinition iceygoop = new GoopDefinition
	{
		ambientGoopFX = Library.WaterGoop.ambientGoopFX,
		ambientGoopFXChance = Library.WaterGoop.ambientGoopFXChance,
		AppliesSpeedModifier = Library.PlayerFriendlyWebGoop.AppliesSpeedModifier,
		AppliesSpeedModifierContinuously = Library.PlayerFriendlyWebGoop.AppliesSpeedModifierContinuously,
		baseColor32 = Library.WaterGoop.baseColor32,
		CanBeElectrified = Library.WaterGoop.CanBeElectrified,
		CanBeFrozen = true,
		AppliesDamageOverTime = false,
		AppliesCharm = false,
		AppliesCheese = false,
		DrainsAmmo = false,
		CanBeIgnited = false,
		damagePerSecondtoEnemies = 0f,
		damagesEnemies = false,
		damagesPlayers = false,
		electrifiedDamagePerSecondToEnemies = Library.WaterGoop.electrifiedDamagePerSecondToEnemies,
		electrifiedDamageToPlayer = Library.WaterGoop.electrifiedDamageToPlayer,
		electrifiedTime = Library.WaterGoop.electrifiedTime,
		damageTypes = (CoreDamageTypes)32,
		eternal = false,
		fadeColor32 = Library.WaterGoop.fadeColor32,
		fadePeriod = Library.WaterGoop.fadePeriod,
		freezeLifespan = Library.WaterGoop.freezeLifespan,
		freezeSpreadTime = Library.WaterGoop.freezeSpreadTime,
		frozenColor32 = Library.WaterGoop.frozenColor32,
		goopTexture = Library.WaterGoop.goopTexture,
		lifespan = Library.WaterGoop.lifespan * 2f,
		lifespanRadialReduction = Library.WaterGoop.lifespanRadialReduction,
		overrideOpaqueness = Library.WaterGoop.overrideOpaqueness,
		playerStepsChangeLifetime = Library.WaterGoop.playerStepsChangeLifetime,
		playerStepsLifetime = Library.WaterGoop.playerStepsLifetime,
		prefreezeColor32 = Library.WaterGoop.prefreezeColor32,
		SpeedModifierEffect = Library.PlayerFriendlyWebGoop.SpeedModifierEffect,
		usesLifespan = Library.WaterGoop.usesLifespan,
		usesWaterVfx = Library.WaterGoop.usesWaterVfx,
		usesAmbientGoopFX = Library.WaterGoop.usesAmbientGoopFX,
		usesOverrideOpaqueness = Library.WaterGoop.usesOverrideOpaqueness,
		usesWorldTextureByDefault = Library.WaterGoop.usesWorldTextureByDefault,
		worldTexture = Library.WaterGoop.worldTexture
	};

	public static void Init()
	{
		//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 = "Iceberg Shavings";
		string text2 = "SilverJacket/Resources/Actives/iceberg_shavings";
		GameObject val = new GameObject(text);
		IcebergShavings icebergShavings = val.AddComponent<IcebergShavings>();
		ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
		string text3 = "Hie Hie no Mi";
		string text4 = "Freezes all nearby enemies and creates a pool of ice that slows enemies.\n\nShards of a super-chilled iceberg said to have been made by an 'Ice Man'.";
		ItemBuilder.SetupItem((PickupObject)(object)icebergShavings, text3, text4, "slvjckt");
		ItemBuilder.SetCooldownType((PlayerItem)(object)icebergShavings, (CooldownType)1, 600f);
		((PlayerItem)icebergShavings).consumable = false;
		((PickupObject)icebergShavings).quality = (ItemQuality)2;
		((BraveBehaviour)icebergShavings).sprite.IsPerpendicular = true;
		ID = ((PickupObject)icebergShavings).PickupObjectId;
		stats.name = ((PickupObject)icebergShavings).EncounterNameOrDisplayName;
	}

	public override void Pickup(PlayerController player)
	{
		if (!base.m_pickedUpThisRun)
		{
			stats.encounterAmount++;
			Module.UpdateStatList();
		}
		((PlayerItem)this).Pickup(player);
	}

	public override void DoEffect(PlayerController user)
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: 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)
		RoomHandler currentRoom = user.CurrentRoom;
		List<AIActor> targets = new List<AIActor>();
		Action<AIActor, float> action = delegate(AIActor actor, float dist)
		{
			targets.Add(actor);
		};
		currentRoom.ApplyActionToNearbyEnemies(((BraveBehaviour)user).sprite.WorldCenter, 4f, action);
		foreach (AIActor item in targets)
		{
			? val = item;
			PickupObject byId = PickupObjectDatabase.GetById(278);
			((GameActor)val).ApplyEffect((GameActorEffect)(object)((BulletStatusEffectItem)((byId is BulletStatusEffectItem) ? byId : null)).FreezeModifierEffect, 1f, (Projectile)null);
			if (((BraveBehaviour)item).healthHaver.IsBoss)
			{
				((GameActor)item).FreezeAmount = 75f;
			}
			else
			{
				((GameActor)item).FreezeAmount = 101f;
			}
		}
		DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(iceygoop).TimedAddGoopCircle(((BraveBehaviour)user).sprite.WorldCenter, 5f, 6f, false);
		DeadlyDeadlyGoopManager.FreezeGoopsCircle(((BraveBehaviour)user).sprite.WorldCenter, 2f);
	}
}
internal class TacticalArtillery : PlayerItem
{
	public static int encounterTimes;

	public static int ID;

	public static ItemStats stats = new ItemStats();

	private List<AIActor> PossibleLargestGrouping = new List<AIActor>();

	public static void Init()
	{
		//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 = "Tactical Artillery";
		string text2 = "SilverJacket/Resources/Actives/tactical_missile";
		GameObject val = new GameObject(text);
		TacticalArtillery tacticalArtillery = val.AddComponent<TacticalArtillery>();
		ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
		string text3 = "Heavy Air Support";
		string text4 = "Summons a series of air strikes at the largest cluster of enemies in the room.\n";
		ItemBuilder.SetupItem((PickupObject)(object)tacticalArtillery, text3, text4, "slvjckt");
		ItemBuilder.SetCooldownType((PlayerItem)(object)tacticalArtillery, (CooldownType)1, 500f);
		((PlayerItem)tacticalArtillery).consumable = false;
		((PickupObject)tacticalArtillery).quality = (ItemQuality)3;
		((BraveBehaviour)tacticalArtillery).sprite.IsPerpendicular = true;
		ID = ((PickupObject)tacticalArtillery).PickupObjectId;
		stats.name = ((PickupObject)tacticalArtillery).EncounterNameOrDisplayName;
	}

	public override void Pickup(PlayerController player)
	{
		if (!base.m_pickedUpThisRun)
		{
			stats.encounterAmount++;
			Module.UpdateStatList();
		}
		((PlayerItem)this).Pickup(player);
	}

	public override void DoEffect(PlayerController user)
	{
		((MonoBehaviour)GameManager.Instance).StartCoroutine(DoAirStrikes(user));
	}

	private IEnumerator DoAirStrikes(PlayerController user)
	{
		int i = 0;
		do
		{
			ExplosionData explosionData = new ExplosionData();
			explosionData.CopyFrom(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultSmallExplosionData);
			explosionData.damageToPlayer = 0f;
			AIActor Target = TargetEnemies(user, 150f, explosionData.damageRadius);
			if ((Object)(object)Target != (Object)null)
			{
				Exploder.Explode(Vector2.op_Implicit(((BraveBehaviour)Target).specRigidbody.UnitCenter), explosionData, Vector2.zero, (Action)null, false, (CoreDamageTypes)0, false);
			}
			i++;
			yield return (object)new WaitForSeconds(0.15f);
		}
		while (i < 4);
	}

	private AIActor TargetEnemies(PlayerController user, float initialRange, float secondaryRange)
	{
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		if (user.CurrentRoom.HasActiveEnemies((ActiveEnemyType)1))
		{
			if (PossibleLargestGrouping.Any())
			{
				PossibleLargestGrouping.Clear();
			}
			RoomHandler currentRoom = user.CurrentRoom;
			List<AIActor> PossibleTargets = new List<AIActor>();
			AIActor result = null;
			Action<AIActor, float> action = delegate(AIActor actor, float dist)
			{
				PossibleTargets.Add(actor);
			};
			currentRoom.ApplyActionToNearbyEnemies(((BraveBehaviour)user).specRigidbody.UnitCenter, initialRange, action);
			foreach (AIActor item in PossibleTargets)
			{
				List<AIActor> nearbyEnemies = new List<AIActor>();
				Action<AIActor, float> action2 = delegate(AIActor actor, float dist)
				{
					nearbyEnemies.Add(actor);
				};
				currentRoom.ApplyActionToNearbyEnemies(((BraveBehaviour)item).specRigidbody.UnitCenter, secondaryRange, action2);
				if (PossibleLargestGrouping.Count() < nearbyEnemies.Count())
				{
					PossibleLargestGrouping = nearbyEnemies;
					result = item;
				}
			}
			return result;
		}
		return null;
	}
}
internal class AGGun : GunBehaviour
{
	private class AGBulletDamageMod : MonoBehaviour
	{
		private void Start()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			Projectile component = ((Component)this).gameObject.GetComponent<Projectile>();
			SpeculativeRigidbody specRigidbody = ((BraveBehaviour)component).specRigidbody;
			specRigidbody.OnPreRigidbodyCollision = (OnPreRigidbodyCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody.OnPreRigidbodyCollision, (Delegate?)new OnPreRigidbodyCollisionDelegate(PreCollide));
		}

		private void PreCollide(SpeculativeRigidbody myBody, PixelCollider myCollider, SpeculativeRigidbody otherBody, PixelCollider otherCollider)
		{
			if (!((Object)(object)((Component)otherBody).gameObject.GetComponent<AIActor>() != (Object)null) || ((BraveBehaviour)otherBody).healthHaver.IsDead)
			{
				return;
			}
			List<GameActorEffect> list = new List<GameActorEffect>();
			foreach (GameActorEffect activeEffect in ((GameActor)((BraveBehaviour)otherBody).aiActor).m_activeEffects)
			{
				if (activeEffect.effectIdentifier != WetEffectTempImmunity.ID && activeEffect.effectIdentifier != OilCoatedTempImmunity.ID && activeEffect.effectIdentifier != PoisonFumeTempImmunity.ID)
				{
					ProjectileData baseData = ((Component)this).gameObject.GetComponent<Projectile>().baseData;
					baseData.damage *= 1.5f;
					list.Add(activeEffect);
				}
			}
			foreach (GameActorEffect item in list)
			{
				((GameActor)((BraveBehaviour)otherBody).aiActor).RemoveEffect(item.effectIdentifier);
			}
		}
	}

	public static int encounterTimes;

	public static string consoleID;

	public static ItemStats stats = new ItemStats();

	public static int ID;

	public static void Add()
	{
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_016f: 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_0181: Unknown result type (might be due to invalid IL or missing references)
		consoleID = "slvjckt:ag_gun";
		Gun val = Databases.Items.NewGun("AG Gun", "ag_gun");
		Game.Items.Rename("outdated_gun_mods:ag_gun", consoleID);
		((Component)val).gameObject.AddComponent<GunTemplate>();
		GunExt.SetShortDescription((PickupObject)(object)val, "No Assembly Required");
		GunExt.SetLongDescription((PickupObject)(object)val, "The silver in this gun's bullets purify enemies of their status effects on hit, dealing 50% extra damage for each status effect removed.\n\nLegends tell of a gun that can kill anything with a single shot.\nThis gun is one step away from coming close to it.");
		GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "ag_gun_idle_001", 0);
		GunExt.SetAnimationFPS(val, val.shootAnimation, 10);
		GunExt.SetAnimationFPS(val, val.reloadAnimation, 12);
		GunTools.TrimGunSprites(val);
		PickupObject byId = PickupObjectDatabase.GetById(15);
		GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
		ref VFXPool muzzleFlashEffects = ref val.muzzleFlashEffects;
		PickupObject byId2 = PickupObjectDatabase.GetById(223);
		muzzleFlashEffects = ((Gun)((byId2 is Gun) ? byId2 : null)).muzzleFlashEffects;
		val.DefaultModule.ammoCost = 1;
		val.DefaultModule.shootStyle = (ShootStyle)0;
		val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
		val.DefaultModule.ammoType = (AmmoType)14;
		val.DefaultModule.customAmmoType = "noxin";
		val.reloadTime = 1.2f;
		val.DefaultModule.cooldownTime = 0.25f;
		val.DefaultModule.numberOfShotsInClip = 1;
		val.DefaultModule.angleVariance = 0f;
		val.SetBaseMaxAmmo(92);
		val.gunClass = (GunClass)1;
		((Component)val).gameObject.AddComponent<OneHandedInFrontOfPlayerGunLayeringBehavior>();
		Transform transform = ((Component)val.barrelOffset).transform;
		transform.localPosition += new Vector3(1.1875f, 0.3125f, 0f);
		((PickupObject)val).quality = (ItemQuality)5;
		ref string gunSwitchGroup = ref val.gunSwitchGroup;
		PickupObject byId3 = PickupObjectDatabase.GetById(53);
		gunSwitchGroup = ((Gun)((byId3 is Gun) ? byId3 : null)).gunSwitchGroup;
		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 = 20f;
		val2.baseData.speed = 20f;
		val2.baseData.force = 10f;
		((BraveBehaviour)val2).transform.parent = val.barrelOffset;
		GunTools.SetProjectileSpriteRight(val2, "ag_gun_projectile", 12, 12, true, (Anchor)0, (int?)null, (int?)null, true, false, (int?)null, (int?)null, (Projectile)null);
		((Component)val2).gameObject.AddComponent<AGBulletDamageMod>();
		Databases.Items.Add((PickupObject)(object)val, false, "ANY");
		ID = ((PickupObject)val).PickupObjectId;
		stats.name = ((PickupObject)val).EncounterNameOrDisplayName;
	}

	public override void OnPlayerPickup(PlayerController playerOwner)
	{
		stats.encounterAmount++;
		Module.UpdateStatList();
		((GunBehaviour)this).OnPlayerPickup(playerOwner);
	}
}
internal class BreachFist : GunBehaviour
{
	private class BreachExplosionDoer : MonoBehaviour
	{
		private void Awake()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Expected O, but got Unknown
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			Projectile component = ((Component)this).gameObject.GetComponent<Projectile>();
			ExplosionData val = new ExplosionData();
			val.CopyFrom(GameManager.Instance.Dungeon.sharedSettingsPrefab.DefaultExplosionData);
			val.damage = component.ModifiedDamage;
			val.damageToPlayer = 0f;
			val.preventPlayerForce = true;
			Exploder.Explode(Vector2.op_Implicit(((BraveBehaviour)component).sprite.WorldCenter), val, Vector2.zero, (Action)null, false, (CoreDamageTypes)0, false);
			component.DieInAir(true, true, true, false);
		}
	}

	public static int encounterTimes;

	public static string consoleID;

	private static string spriteID;

	public static ItemStats stats = new ItemStats();

	public static int ID;

	public static void Add()
	{
		//IL_00d6: 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_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0150: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_019e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01df: Unknown result type (might be due to invalid IL or missing references)
		//IL_028e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0293: Unknown result type (might be due to invalid IL or missing references)
		//IL_029a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a6: Expected O, but got Unknown
		consoleID = "breach_fist";
		spriteID = "breach_fist";
		Gun val = Databases.Items.NewGun("Breach Fist", spriteID);
		Game.Items.Rename("outdated_gun_mods:" + consoleID, "slvjckt:" + consoleID);
		((Component)val).gameObject.AddComponent<BreachFist>();
		GunExt.SetShortDescription((PickupObject)(object)val, "Twenty Pounds of Iron");
		GunExt.SetLongDescription((PickupObject)(object)val, "Creates a friendly explosion in front of the player.\n\nThe hand of a BR-TT Model LSA combat mech that has been retrofitted for use by a person. Due to the fact it must rely on a smaller power source than normal, each attack requires a charge up and the heatsinks must be vented more often.");
		GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, spriteID + "_idle_001", 10);
		GunExt.SetAnimationFPS(val, val.shootAnimation, 10);
		GunExt.SetAnimationFPS(val, val.reloadAnimation, 12);
		GunExt.SetAnimationFPS(val, val.chargeAnimation, 10);
		GunTools.TrimGunSprites(val);
		((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.chargeAnimation).wrapMode = (WrapMode)1;
		((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.chargeAnimation).loopStart = 7;
		PickupObject byId = PickupObjectDatabase.GetById(15);
		GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
		val.muzzleFlashEffects.type = (VFXPoolType)0;
		val.DefaultModule.ammoCost = 1;
		val.DefaultModule.shootStyle = (ShootStyle)3;
		val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
		val.DefaultModule.ammoType = (AmmoType)3;
		val.reloadTime = 2f;
		val.gunHandedness = (GunHandedness)3;
		val.DefaultModule.cooldownTime = 0.5f;
		val.DefaultModule.numberOfShotsInClip = 2;
		val.DefaultModule.angleVariance = 0f;
		val.SetBaseMaxAmmo(150);
		val.gunClass = (GunClass)60;
		val.carryPixelOffset += new IntVector2(0, 2);
		Transform transform = ((Component)val.barrelOffset).transform;
		transform.localPosition += new Vector3(3.125f, 0.1875f, 0f);
		((PickupObject)val).quality = (ItemQuality)3;
		val.gunSwitchGroup = "slvjckt" + consoleID;
		SoundManager.AddCustomSwitchData("WPN_Guns", val.gunSwitchGroup, "Play_WPN_Gun_Reload_01", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_WPN_plasmacell_reload_01") });
		SoundManager.AddCustomSwitchData("WPN_Guns", val.gunSwitchGroup, "Play_WPN_Gun_Shot_01", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_WPN_smallrocket_impact_01") });
		Projectile val2 = Object.Instantiate<Projectile>(val.DefaultModule.projectiles[0]);
		((Component)val2).gameObject.SetActive(false);
		BreachExplosionDoer breachExplosionDoer = ((Component)val2).gameObject.AddComponent<BreachExplosionDoer>();
		FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject);
		Object.DontDestroyOnLoad((Object)(object)val2);
		ChargeProjectile item = new ChargeProjectile
		{
			Projectile = val2,
			ChargeTime = 0.8f
		};
		val.DefaultModule.chargeProjectiles = new List<ChargeProjectile>();
		val.DefaultModule.chargeProjectiles.Add(item);
		val2.baseData.damage = 35f;
		val2.baseData.speed = 26f;
		val2.baseData.range = 30f;
		val2.baseData.force = 8f;
		((BraveBehaviour)val2).transform.parent = val.barrelOffset;
		Databases.Items.Add((PickupObject)(object)val, false, "ANY");
		ID = ((PickupObject)val).PickupObjectId;
		stats.name = ((PickupObject)val).EncounterNameOrDisplayName;
	}

	public override void OnPlayerPickup(PlayerController playerOwner)
	{
		stats.encounterAmount++;
		Module.UpdateStatList();
		((GunBehaviour)this).OnPlayerPickup(playerOwner);
	}
}
internal class BreachFistMuzzleFlash : MonoBehaviour
{
	public static List<string> spritePaths = new List<string> { "SilverJacket/Resources/VFX/BreachFistMuzzleflash/breach_fist_muzzleflash_start_001", "SilverJacket/Resources/VFX/BreachFistMuzzleflash/breach_fist_muzzleflash_start_002", "SilverJacket/Resources/VFX/BreachFistMuzzleflash/breach_fist_muzzleflash_start_003", "SilverJacket/Resources/VFX/BreachFistMuzzleflash/breach_fist_muzzleflash_start_004" };

	public static GameObject breachMuzzleflashPrefab;

	public static void Init()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = BasicVFXCreator.MakeBasicVFX("breach_fist_muzzleflash", spritePaths, 10, new IntVector2(23, 22), (Anchor)4);
		val.AddComponent<BreachFistMuzzleFlash>();
		breachMuzzleflashPrefab = val;
	}

	public static void CreateEffect(Vector2 pos)
	{
		//IL_0012: 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)
		GameObject val = Object.Instantiate<GameObject>(breachMuzzleflashPrefab);
		val.transform.position = Vector2.op_Implicit(pos);
		val.SetActive(true);
	}

	private void Start()
	{
		((Component)this).gameObject.GetComponent<tk2dSpriteAnimator>().PlayAndDestroyObject("start", (Action)null);
	}
}
internal class DollArm : GunBehaviour
{
	public static int encounterTimes;

	public static string consoleID;

	private static string spriteID;

	public static ItemStats stats = new ItemStats();

	public static int ID;

	private bool extraDamage = false;

	public static void Add()
	{
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: 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_012f: 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_019b: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
		consoleID = "doll_arm";
		spriteID = "doll_arm";
		Gun val = Databases.Items.NewGun("Doll Arm", spriteID);
		Game.Items.Rename("outdated_gun_mods:" + consoleID, "slvjckt:" + consoleID);
		((Component)val).gameObject.AddComponent<DollArm>();
		GunExt.SetShortDescription((PickupObject)(object)val, "Everlasting");
		GunExt.SetLongDescription((PickupObject)(object)val, "When reloaded, destroys nearby projectiles, increasing the damage of the next clip.\n\n The arm of a wooden doll that has seen numerous deaths and caused even more.");
		GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, spriteID + "_idle_001", 12);
		GunExt.SetAnimationFPS(val, val.shootAnimation, 12);
		GunExt.SetAnimationFPS(val, val.reloadAnimation, 12);
		GunTools.TrimGunSprites(val);
		val.carryPixelOffset += new IntVector2(5, 0);
		val.gunHandedness = (GunHandedness)3;
		PickupObject byId = PickupObjectDatabase.GetById(15);
		GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
		ref VFXPool muzzleFlashEffects = ref val.muzzleFlashEffects;
		PickupObject byId2 = PickupObjectDatabase.GetById(145);
		muzzleFlashEffects = ((Gun)((byId2 is Gun) ? byId2 : null)).muzzleFlashEffects;
		val.DefaultModule.ammoCost = 1;
		val.DefaultModule.shootStyle = (ShootStyle)0;
		val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
		val.DefaultModule.ammoType = (AmmoType)14;
		val.DefaultModule.customAmmoType = "samus";
		val.reloadTime = 1.1f;
		val.DefaultModule.cooldownTime = 0.3f;
		val.DefaultModule.numberOfShotsInClip = 8;
		val.DefaultModule.angleVariance = 6f;
		val.SetBaseMaxAmmo(250);
		val.gunClass = (GunClass)50;
		Transform transform = ((Component)val.barrelOffset).transform;
		transform.localPosition += new Vector3(-0.0625f, 0f, 0f);
		((PickupObject)val).quality = (ItemQuality)2;
		ref string gunSwitchGroup = ref val.gunSwitchGroup;
		PickupObject byId3 = PickupObjectDatabase.GetById(145);
		gunSwitchGroup = ((Gun)((byId3 is Gun) ? byId3 : null)).gunSwitchGroup;
		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 = 5f;
		val2.baseData.speed = 26f;
		val2.baseData.force = 8f;
		((BraveBehaviour)val2).transform.parent = val.barrelOffset;
		GunTools.SetProjectileSpriteRight(val2, "doll_arm_projectile", 8, 6, true, (Anchor)0, (int?)null, (int?)null, true, false, (int?)null, (int?)null, (Projectile)null);
		val2.shouldRotate = true;
		Databases.Items.Add((PickupObject)(object)val, false, "ANY");
		ID = ((PickupObject)val).PickupObjectId;
		stats.name = ((PickupObject)val).EncounterNameOrDisplayName;
	}

	public override void PostProcessProjectile(Projectile projectile)
	{
		if (extraDamage)
		{
			ProjectileData baseData = projectile.baseData;
			baseData.damage *= 1.15f;
		}
	}

	public override void OnReloadedPlayer(PlayerController owner, Gun gun)
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		extraDamage = false;
		PickupObject byId = PickupObjectDatabase.GetById(15);
		GameObject val = SpawnManager.SpawnProjectile(((Component)((Gun)((byId is Gun) ? byId : null)).DefaultModule.projectiles[0]).gameObject, gun.barrelOffset.position, Quaternion.Euler(0f, 0f, gun.CurrentAngle), true);
		ProjectileSlashingBehaviour val2 = val.AddComponent<ProjectileSlashingBehaviour>();
		val2.slashParameters.projInteractMode = (ProjInteractMode)1;
		val2.slashParameters.damage = 0f;
		val2.slashParameters.enemyKnockbackForce = 40f;
		val2.slashParameters.playerKnockbackForce = 0f;
		val2.slashParameters.soundEvent = "";
		SlashData slashParameters = val2.slashParameters;
		slashParameters.OnHitBullet = (Action<Projectile>)Delegate.Combine(slashParameters.OnHitBullet, new Action<Projectile>(OnHitBullet));
		val2.SlashDamageUsesBaseProjectileDamage = false;
		Projectile component = val.GetComponent<Projectile>();
		if ((Object)(object)component != (Object)null)
		{
			component.Owner = (GameActor)(object)owner;
			component.Shooter = ((BraveBehaviour)owner).specRigidbody;
			((Renderer)component.m_renderer).enabled = false;
		}
	}

	private void OnHitBullet(Projectile p)
	{
		if (!extraDamage)
		{
			extraDamage = true;
		}
	}

	public override void OnPlayerPickup(PlayerController playerOwner)
	{
		stats.encounterAmount++;
		Module.UpdateStatList();
		((GunBehaviour)this).OnPlayerPickup(playerOwner);
	}
}
internal class FerrymanOar : GunBehaviour
{
	public static int encounterTimes;

	public static string consoleID;

	private static string spriteID;

	public static ItemStats stats = new ItemStats();

	public static int ID;

	public static void Add()
	{
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0317: Unknown result type (might be due to invalid IL or missing references)
		//IL_031e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0388: Unknown result type (might be due to invalid IL or missing references)
		//IL_038e: Expected O, but got Unknown
		consoleID = "ferryman_oar";
		spriteID = "ferryman_oar";
		Gun val = Databases.Items.NewGun("Ferryman Oar", spriteID);
		Game.Items.Rename("outdated_gun_mods:" + consoleID, "slvjckt:" + consoleID);
		((Component)val).gameObject.AddComponent<GunTemplate>();
		GunExt.SetShortDescription((PickupObject)(object)val, "Tsk Tsk");
		GunExt.SetLongDescription((PickupObject)(object)val, " ");
		GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, spriteID + "_idle_001", 20);
		GunExt.SetAnimationFPS(val, val.shootAnimation, 18);
		GunExt.SetAnimationFPS(val, val.reloadAnimation, 12);
		GunTools.TrimGunSprites(val);
		for (int i = 0; i < 5; i++)
		{
			PickupObject byId = PickupObjectDatabase.GetById(15);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
		}
		Transform transform = ((Component)val.barrelOffset).transform;
		transform.localPosition += new Vector3(2f, 1.875f, 0f);
		foreach (ProjectileModule projectile in val.Volley.projectiles)
		{
			projectile.ammoCost = 1;
			projectile.shootStyle = (ShootStyle)0;
			projectile.sequenceStyle = (ProjectileSequenceStyle)0;
			projectile.ammoType = (AmmoType)14;
			projectile.customAmmoType = "Tear";
			projectile.cooldownTime = 0.7f;
			projectile.numberOfShotsInClip = 1;
			projectile.angleVariance = 6f;
			PickupObject byId2 = PickupObjectDatabase.GetById(404);
			Projectile val2 = Object.Instantiate<Projectile>(((Gun)((byId2 is Gun) ? byId2 : null)).DefaultModule.projectiles[0]);
			((Component)val2).gameObject.SetActive(false);
			FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject);
			Object.DontDestroyOnLoad((Object)(object)val2);
			projectile.projectiles[0] = val2;
			val.DefaultModule.projectiles[0] = val2;
			val2.baseData.damage = 3f;
			val2.baseData.range = 30f;
			val2.baseData.force = 8f;
			((BraveBehaviour)val2).transform.parent = val.barrelOffset;
			if (projectile != val.DefaultModule)
			{
				projectile.ammoCost = 0;
			}
		}
		ProjectileSlashingBehaviour val3 = ((Component)val.Volley.projectiles[0].projectiles[0]).gameObject.AddComponent<ProjectileSlashingBehaviour>();
		val.Volley.projectiles[0].angleVariance = 0f;
		val3.DestroyBaseAfterFirstSlash = true;
		SlashData slashParameters = val3.slashParameters;
		slashParameters.projInteractMode = (ProjInteractMode)0;
		slashParameters.enemyKnockbackForce = 60f;
		slashParameters.damage = 8f;
		slashParameters.soundEvent = "";
		ref VFXPool muzzleFlashEffects = ref val.muzzleFlashEffects;
		PickupObject byId3 = PickupObjectDatabase.GetById(404);
		muzzleFlashEffects = ((Gun)((byId3 is Gun) ? byId3 : null)).muzzleFlashEffects;
		val.reloadTime = 1f;
		val.SetBaseMaxAmmo(200);
		val.gunClass = (GunClass)50;
		((PickupObject)val).quality = (ItemQuality)2;
		val.gunSwitchGroup = "slvjckt" + consoleID;
		SoundManager.AddCustomSwitchData("WPN_Guns", val.gunSwitchGroup, "Play_WPN_Gun_Reload_01", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_ENV_water_splash_01") });
		SoundManager.AddCustomSwitchData("WPN_Guns", val.gunSwitchGroup, "Play_WPN_Gun_Shot_01", (SwitchedEvent[])(object)new SwitchedEvent[1]
		{
			new SwitchedEvent("Play_WPN_Gun_Shot_01", "WPN_Guns", "Siren")
		});
		Databases.Items.Add((PickupObject)(object)val, false, "ANY");
		ID = ((PickupObject)val).PickupObjectId;
		stats.name = ((PickupObject)val).EncounterNameOrDisplayName;
	}

	public override void OnPlayerPickup(PlayerController playerOwner)
	{
		stats.encounterAmount++;
		Module.UpdateStatList();
		((GunBehaviour)this).OnPlayerPickup(playerOwner);
	}

	public override void OnPostFired(PlayerController player, Gun gun)
	{
	}
}
internal class HFBladeLightning : GunBehaviour
{
	private class BloodDripFromSword : MonoBehaviour
	{
		private float elapsed = 0f;

		private Gun thisGun;

		private void Awake()
		{
			thisGun = ((Component)this).gameObject.GetComponent<Gun>();
		}

		private void Update()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: 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_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			elapsed += Time.deltaTime;
			if (elapsed > 0.1f)
			{
				Vector3 val = Vector2Extensions.ToVector3ZisY(((BraveBehaviour)thisGun).sprite.WorldBottomLeft, 0f);
				Vector3 val2 = Vector2Extensions.ToVector3ZisY(((BraveBehaviour)thisGun).sprite.WorldTopRight, 0f);
				float num = (val2.y - val.y) * (val2.x - val.x);
				float num2 = 40f * num;
				int num3 = Mathf.CeilToInt(Mathf.Max(1f, num2 * BraveTime.DeltaTime));
				int num4 = num3;
				Vector3 val3 = val;
				Vector3 val4 = val2;
				Vector3 up = Vector3.up;
				float num5 = 120f;
				float num6 = 0.5f;
				float? num7 = Random.Range(1f, 1.65f);
				GlobalSparksDoer.DoRandomParticleBurst(num4, val3, val4, up, num5, num6, (float?)null, num7, (Color?)null, (SparksType)7);
				elapsed = 0f;
			}
		}
	}

	private class PreventDupeSlicing : MonoBehaviour
	{
		private AIActor actor;

		public void AssignDeathEffect()
		{
			actor = ((Component)this).gameObject.GetComponent<AIActor>();
			((BraveBehaviour)actor).healthHaver.OnPreDeath += OnPreDeath;
		}

		private void OnPreDeath(Vector2 pos)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	private class MoveAndKillAfterDelay : MonoBehaviour
	{
		public float duration = 0.3f;

		private float speed = 5f;

		public Vector2 targetPos;

		public Vector2 startingPos;

		public void StartTimer()
		{
			((MonoBehaviour)GameManager.Instance).StartCoroutine(DieTimer());
		}

		private void Update()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Abs(Vector2.Distance(startingPos, targetPos));
			float num2 = speed * Time.deltaTime * Mathf.Pow(num, 1f / 3f);
			((Component)this).transform.position = Vector2.op_Implicit(Vector2.MoveTowards(Vector2.op_Implicit(((Component)this).transform.position), targetPos, num2 / 2f));
		}

		private IEnumerator DieTimer()
		{
			yield return (object)new WaitForSeconds(duration);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	public static int encounterTimes;

	public static string consoleID;

	private static string spriteID;

	public static ItemStats stats = new ItemStats();

	public bool canDoRipper = false;

	private bool isRipperMode = false;

	public int kills = 0;

	private float elapsed = 0f;

	public static int ID;

	public static void Add()
	{
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_014e: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_01df: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0214: Unknown result type (might be due to invalid IL or missing references)
		//IL_0233: Unknown result type (might be due to invalid IL or missing references)
		//IL_0239: Expected O, but got Unknown
		//IL_025d: 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_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)
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		//IL_027f: Unknown result type (might be due to invalid IL or missing references)
		//IL_034f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0354: Unknown result type (might be due to invalid IL or missing references)
		//IL_035b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0368: Expected O, but got Unknown
		//IL_048c: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04de: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e8: Expected O, but got Unknown
		consoleID = "hf_blade_lightning";
		spriteID = "hf_blade_lightning";
		Gun val = Databases.Items.NewGun("HF Blade Lightning", spriteID);
		Game.Items.Rename("outdated_gun_mods:" + consoleID, "slvjckt:" + consoleID);
		((Component)val).gameObject.AddComponent<HFBladeLightning>();
		GunExt.SetShortDescription((PickupObject)(object)val, "Not Your Sword");
		GunExt.SetLongDescription((PickupObject)(object)val, "After killing 6 enemies, gain the ability to enter Ripper Mode by manually pressing the reload button. While in Ripper Mode, gain increased speed, your uncharged attacks deal a bit more damage, and your charged attacks take much less time to charge and deal a lot more damage. Cannot switch weapons while in Ripper Mode. Increases Curse by 2 while held.\n\nThe former sword of a famous mercenary who really just likes killing evil people.");
		GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, spriteID + "_idle_001", 20);
		GunExt.SetAnimationFPS(val, val.shootAnimation, 12);
		GunExt.SetAnimationFPS(val, val.reloadAnimation, 12);
		GunExt.SetAnimationFPS(val, val.chargeAnimation, 8);
		GunExt.SetAnimationFPS(val, val.criticalFireAnimation, 18);
		GunTools.TrimGunSprites(val);
		((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.chargeAnimation).wrapMode = (WrapMode)1;
		((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.chargeAnimation).loopStart = 20;
		val.carryPixelOffset += new IntVector2(14, 0);
		PickupObject byId = PickupObjectDatabase.GetById(17);
		GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
		val.muzzleFlashEffects.type = (VFXPoolType)0;
		val.DefaultModule.ammoCost = 1;
		val.DefaultModule.shootStyle = (ShootStyle)3;
		val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
		val.DefaultModule.ammoType = (AmmoType)14;
		val.DefaultModule.customAmmoType = "pulse blue";
		val.reloadTime = 1f;
		val.DefaultModule.cooldownTime = 0.25f;
		val.DefaultModule.triggerCooldownForAnyChargeAmount = true;
		val.DefaultModule.numberOfShotsInClip = 1;
		val.DefaultModule.angleVariance = 0f;
		val.SetBaseMaxAmmo(250);
		val.gunClass = (GunClass)60;
		Transform transform = ((Component)val.barrelOffset).transform;
		transform.localPosition += new Vector3(1.25f, 1.1875f, 0f);
		ItemBuilder.AddPassiveStatModifier((PickupObject)(object)val, (StatType)14, 2f, (ModifyMethod)0);
		((PickupObject)val).quality = (ItemQuality)4;
		ref string gunSwitchGroup = ref val.gunSwitchGroup;
		PickupObject byId2 = PickupObjectDatabase.GetById(390);
		gunSwitchGroup = ((Gun)((byId2 is Gun) ? byId2 : null)).gunSwitchGroup;
		GameObject val2 = new GameObject();
		val2.transform.SetParent(((BraveBehaviour)val).transform);
		Transform transform2 = val2.transform;
		Transform transform3 = ((Component)val.barrelOffset).transform;
		Vector3 localPosition = (transform3.localPosition += new Vector3(0.75f, 0.25f));
		transform2.localPosition = localPosition;
		Projectile val4 = Object.Instantiate<Projectile>(val.DefaultModule.projectiles[0]);
		((Component)val4).gameObject.SetActive(false);
		FakePrefab.MarkAsFakePrefab(((Component)val4).gameObject);
		Object.DontDestroyOnLoad((Object)(object)val4);
		val4.baseData.damage = 15f;
		val4.baseData.force = 10f;
		((BraveBehaviour)val4).transform.parent = val2.transform;
		ProjectileIDMarker projectileIDMarker = ((Component)val4).gameObject.AddComponent<ProjectileIDMarker>();
		projectileIDMarker.ID = "hf_nocharge";
		ProjectileSlashingBehaviourForked projectileSlashingBehaviourForked = ((Component)val4).gameObject.AddComponent<ProjectileSlashingBehaviourForked>();
		projectileSlashingBehaviourForked.SlashDamageUsesBaseProjectileDamage = true;
		projectileSlashingBehaviourForked.slashParameters.projInteractMode = SlashDoerForked.ProjInteractMode.DESTROY;
		projectileSlashingBehaviourForked.DestroyBaseAfterFirstSlash = true;
		projectileSlashingBehaviourForked.slashParameters.soundEvent = null;
		projectileSlashingBehaviourForked.slashParameters.slashRange = 2.5f;
		ChargeProjectile item = new ChargeProjectile
		{
			Projectile = val4,
			ChargeTime = 0f
		};
		Projectile val5 = Object.Instantiate<Projectile>(val.DefaultModule.projectiles[0]);
		((Component)val5).gameObject.SetActive(false);
		FakePrefab.MarkAsFakePrefab(((Component)val5).gameObject);
		Object.DontDestroyOnLoad((Object)(object)val5);
		val5.baseData.damage = 35f;
		val5.baseData.force = 40f;
		((BraveBehaviour)val5).transform.parent = val.barrelOffset;
		ProjectileIDMarker projectileIDMarker2 = ((Component)val5).gameObject.AddComponent<ProjectileIDMarker>();
		projectileIDMarker2.ID = "hf_fullcharge";
		ProjectileSlashingBehaviourForked projectileSlashingBehaviourForked2 = ((Component)val5).gameObject.AddComponent<ProjectileSlashingBehaviourForked>();
		projectileSlashingBehaviourForked2.SlashDamageUsesBaseProjectileDamage = true;
		projectileSlashingBehaviourForked2.DestroyBaseAfterFirstSlash = true;
		SlashDataForked slashParameters = projectileSlashingBehaviourForked2.slashParameters;
		slashParameters.slashDegrees = 210f;
		slashParameters.slashRange = 2.5f;
		slashParameters.soundEvent = null;
		List<string> list = new List<string> { "SilverJacket/Resources/VFX/Slashes/HFBladeLightning/lightning_slash_001", "SilverJacket/Resources/VFX/Slashes/HFBladeLightning/lightning_slash_002", "SilverJacket/Resources/VFX/Slashes/HFBladeLightning/lightning_slash_003", "SilverJacket/Resources/VFX/Slashes/HFBladeLightning/lightning_slash_004" };
		VFXPool vFX = VFXBuilder.CreateVFXPool("slvjckt_" + consoleID + "_slash", list, 12, new IntVector2(99, 94), (Anchor)4, true, 0.1f, false, (VFXAlignment)1, -1f, (Color?)null, (Assembly)null);
		slashParameters.VFX = vFX;
		ChargeProjectile item2 = new ChargeProjectile
		{
			Projectile = val5,
			ChargeTime = 2f,
			OverrideShootAnimation = val.criticalFireAnimation,
			UsedProperties = (ChargeProjectileProperties)16
		};
		val.DefaultModule.chargeProjectiles = new List<ChargeProjectile>();
		val.DefaultModule.chargeProjectiles.Add(item);
		val.DefaultModule.chargeProjectiles.Add(item2);
		Databases.Items.Add((PickupObject)(object)val, false, "ANY");
		ID = ((PickupObject)val).PickupObjectId;
		stats.name = ((PickupObject)val).EncounterNameOrDisplayName;
	}

	public override void PostProcessProjectile(Projectile projectile)
	{
		if ((Object)(object)((Component)projectile).gameObject.GetComponent<ProjectileIDMarker>() != (Object)null)
		{
			if (((Component)projectile).gameObject.GetComponent<ProjectileIDMarker>().ID == "hf_fullcharge")
			{
				ProjectileSlashingBehaviourForked component = ((Component)projectile).gameObject.GetComponent<ProjectileSlashingBehaviourForked>();
				SlashDataForked slashParameters = component.slashParameters;
				slashParameters.OnHitTarget = (Action<GameActor, bool>)Delegate.Combine(slashParameters.OnHitTarget, new Action<GameActor, bool>(OnHitTargetCharged));
				if (isRipperMode)
				{
					component.slashParameters.damage *= 2f;
				}
			}
			else if (((Component)projectile).gameObject.GetComponent<ProjectileIDMarker>().ID == "hf_nocharge")
			{
				ProjectileSlashingBehaviourForked component2 = ((Component)projectile).gameObject.GetComponent<ProjectileSlashingBehaviourForked>();
				SlashDataForked slashParameters2 = component2.slashParameters;
				slashParameters2.OnHitTarget = (Action<GameActor, bool>)Delegate.Combine(slashParameters2.OnHitTarget, new Action<GameActor, bool>(OnHitTarget));
				component2.slashParameters.damage *= 1.2f;
			}
		}
		if (base.gun.CurrentAmmo > 0)
		{
			base.gun.ClipShotsRemaining = 2;
			base.gun.ClearReloadData();
		}
	}

	private void OnHitTarget(GameActor enemy, bool fatal)
	{
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		if (fatal && !isRipperMode)
		{
			kills++;
			if (kills > 6)
			{
				kills = 6;
			}
		}
		if (kills == 6 && !canDoRipper && !isRipperMode)
		{
			AkSoundEngine.PostEvent("Play_WPN_energy_impact_01", ((Component)this).gameObject);
			PickupObject byId = PickupObjectDatabase.GetById(21);
			SpawnManager.SpawnVFX(((Gun)((byId is Gun) ? byId : null)).DefaultModule.chargeProjectiles[4].Projectile.hitEffects.overrideMidairDeathVFX, Vector2.op_Implicit(((BraveBehaviour)base.gun.CurrentOwner).sprite.WorldCenter), Quaternion.Euler(0f, 0f, 0f));
			canDoRipper = true;
		}
	}

	private void OnHitTargetCharged(GameActor enemy, bool fatal)
	{
		//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Expected O, but got Unknown
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Expected O, but got Unknown
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b7: 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_01f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0204: Unknown result type (might be due to invalid IL or missing references)
		//IL_0209: Unknown result type (might be due to invalid IL or missing references)
		//IL_0210: Unknown result type (might be due to invalid IL or missing references)
		//IL_0214: Unknown result type (might be due to invalid IL or missing references)
		//IL_0219: Unknown result type (might be due to invalid IL or missing references)
		//IL_021e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_0239: Unknown result type (might be due to invalid IL or missing references)
		//IL_0280: Unknown result type (might be due to invalid IL or missing references)
		//IL_028a: Unknown result type (might be due to invalid IL or missing references)
		//IL_028f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0291: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02de: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_030e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0313: Unknown result type (might be due to invalid IL or missing references)
		if (fatal)
		{
			if (!isRipperMode)
			{
				kills++;
				if (kills > 6)
				{
					kills = 6;
				}
			}
			if (isRipperMode && !((BraveBehaviour)enemy).healthHaver.IsBoss && (!((BraveBehaviour)enemy).healthHaver.IsSubboss & Object.op_Implicit((Object)(object)((BraveBehaviour)enemy).healthHaver)) && (Object)(object)((Component)enemy).gameObject.GetComponent<PreventDupeSlicing>() == (Object)null)
			{
				((Component)enemy).gameObject.AddComponent<PreventDupeSlicing>();
				((Component)enemy).gameObject.GetComponent<PreventDupeSlicing>().AssignDeathEffect();
				Texture2D val = GunTools.DesheetTexture(((BraveBehaviour)enemy).sprite.GetCurrentSpriteDef());
				Texture2D val2 = new Texture2D(((Texture)val).width, Mathf.CeilToInt((float)((Texture)val).height / 2f));
				Texture2D val3 = new Texture2D(((Texture)val).width, Mathf.FloorToInt((float)((Texture)val).height / 2f));
				val2.SetPixels(val.GetPixels(0, Mathf.FloorToInt((float)((Texture)val).height / 2f), ((Texture)val).width, Mathf.CeilToInt((float)((Texture)val).height / 2f)));
				val3.SetPixels(val.GetPixels(0, 0, ((Texture)val).width, Mathf.FloorToInt((float)((Texture)val).height / 2f)));
				GameObject val4 = SpriteBuilder.SpriteFromTexture(val2, ((Object)enemy).name + "_topSpriteHalf", (GameObject)null);
				tk2dSprite component = val4.GetComponent<tk2dSprite>();
				((tk2dBaseSprite)component).HeightOffGround = ((tk2dBaseSprite)component).HeightOffGround + 0.1f;
				Vector2 val5 = Random.insideUnitCircle * 2.5f;
				if (val5.y < 0.5f)
				{
					val5.y = 0.5f;
				}
				MoveAndKillAfterDelay moveAndKillAfterDelay = val4.AddComponent<MoveAndKillAfterDelay>();
				moveAndKillAfterDelay.startingPos = (((BraveBehaviour)enemy).sprite.WorldTopCenter + ((BraveBehaviour)enemy).sprite.WorldCenter) / 2f;
				moveAndKillAfterDelay.targetPos = val5 + moveAndKillAfterDelay.startingPos;
				moveAndKillAfterDelay.StartTimer();
				val4.transform.position = Vector2.op_Implicit(moveAndKillAfterDelay.startingPos);
				val4.SetActive(true);
				GameObject val6 = SpriteBuilder.SpriteFromTexture(val3, ((Object)enemy).name + "_bottomSpriteHalf", (GameObject)null);
				tk2dSprite component2 = val6.GetComponent<tk2dSprite>();
				((tk2dBaseSprite)component2).HeightOffGround = ((tk2dBaseSprite)component2).HeightOffGround + 0.1f;
				Vector2 val7 = Random.insideUnitCircle * 2.5f;
				if (val7.y > -0.5f)
				{
					val7.y = -0.5f;
				}
				MoveAndKillAfterDelay moveAndKillAfterDelay2 = val6.AddComponent<MoveAndKillAfterDelay>();
				moveAndKillAfterDelay2.startingPos = (((BraveBehaviour)enemy).sprite.WorldBottomCenter + ((BraveBehaviour)enemy).sprite.WorldCenter) / 2f;
				moveAndKillAfterDelay2.targetPos = val7 + moveAndKillAfterDelay2.startingPos;
				moveAndKillAfterDelay2.StartTimer();
				val6.transform.position = Vector2.op_Implicit(moveAndKillAfterDelay2.startingPos);
				val6.SetActive(true);
				enemy.StealthDeath = true;
				((BraveBehaviour)enemy).aiActor.CorpseObject = null;
				((BraveBehaviour)enemy).aiActor.CorpseShadow = false;
			}
		}
		if (kills == 6 && !canDoRipper && !isRipperMode)
		{
			AkSoundEngine.PostEvent("Play_WPN_energy_impact_01", ((Component)this).gameObject);
			PickupObject byId = PickupObjectDatabase.GetById(21);
			SpawnManager.SpawnVFX(((Gun)((byId is Gun) ? byId : null)).DefaultModule.chargeProjectiles[4].Projectile.hitEffects.overrideMidairDeathVFX, Vector2.op_Implicit(((BraveBehaviour)base.gun.CurrentOwner).sprite.WorldCenter), Quaternion.Euler(0f, 0f, 0f));
			canDoRipper = true;
		}
	}

	public override void OwnedUpdatePlayer(PlayerController owner, GunInventory inventory)
	{
		if (Key((GungeonActionType)11, owner) && ((PickupObject)((GameActor)owner).CurrentGun).PickupObjectId == ID && kills == 6 && canDoRipper && !isRipperMode)
		{
			((MonoBehaviour)GameManager.Instance).StartCoroutine(RipperMode());
		}
	}

	private IEnumerator RipperMode()
	{
		PlayerController player = GunTools.GunPlayerOwner(base.gun);
		AkSoundEngine.PostEvent("Play_OBJ_bloodybullet_proc_01", ((Component)this).gameObject);
		Color cachedOverrideMatColor = SpriteOutlineManager.GetOutlineMaterial(((BraveBehaviour)player).sprite).GetColor("_OverrideColor");
		SpriteOutlineManager.GetOutlineMaterial(((BraveBehaviour)player).sprite).SetColor("_OverrideColor", new Color(16f, 0f, 0f, 255f));
		GunTools.AddStatToGun(base.gun, (StatType)0, 1.4f, (ModifyMethod)1);
		GunTools.AddStatToGun(base.gun, (StatType)1, 1.8f, (ModifyMethod)1);
		GunTools.AddStatToGun(base.gun, (StatType)25, 3.5f, (ModifyMethod)1);
		((Component)base.gun).gameObject.AddComponent<BloodDripFromSword>();
		player.stats.RecalculateStats(player, true, false);
		canDoRipper = false;
		isRipperMode = true;
		kills = 0;
		elapsed = 0f;
		((PickupObject)base.gun).CanBeDropped = false;
		((PickupObject)base.gun).CanBeSold = false;
		player.inventory.GunLocked.SetOverride("slvjckt_Ripper Mode", true, (float?)null);
		yield return (object)new WaitForSeconds(12f);
		((PickupObject)base.gun).CanBeDropped = true;
		((PickupObject)base.gun).CanBeSold = true;
		player.inventory.GunLocked.SetOverride("slvjckt_Ripper Mode", false, (float?)null);
		GunTools.RemoveStatFromGun(base.gun, (StatType)0);
		GunTools.RemoveStatFromGun(base.gun, (StatType)1);
		GunTools.RemoveStatFromGun(base.gun, (StatType)25);
		player.stats.RecalculateStats(player, true, false);
		SpriteOutlineManager.GetOutlineMaterial(((BraveBehaviour)player).sprite).SetColor("_OverrideColor", cachedOverrideMatColor);
		Object.Destroy((Object)(object)((Component)base.gun).gameObject.GetComponent<BloodDripFromSword>());
		canDoRipper = false;
		isRipperMode = false;
		kills = 0;
	}

	public bool Key(GungeonActionType action, PlayerController user)
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		return ((OneAxisInputControl)BraveInput.GetInstanceForPlayer(user.PlayerIDX).ActiveActions.GetActionFromType(action)).IsPressed;
	}

	public override void OnPlayerPickup(PlayerController playerOwner)
	{
		stats.encounterAmount++;
		Module.UpdateStatList();
		((GunBehaviour)this).OnPlayerPickup(playerOwner);
	}
}
public class ProjectileIDMarker : MonoBehaviour
{
	public string ID = "test";
}
internal class ElectrolytePack : PlayerItem
{
	public static int ID;

	public static void Init()
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Expected O, but got Unknown
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		string text = "Electrolyte Pack";
		string text2 = "SilverJacket/Resources/Actives/electrolyte_pack";
		GameObject val = new GameObject(text);
		ElectrolytePack electrolytePack = val.AddComponent<ElectrolytePack>();
		ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
		string text3 = "The Gatorade Eucharist";
		string text4 = "Instantly allows the user to enter Ripper Mode if the held gun is the HF Blade Lightning. Only for debug purposes.";
		ItemBuilder.SetupItem((PickupObject)(object)electrolytePack, text3, text4, "slvjckt");
		ItemBuilder.SetCooldownType((PlayerItem)(object)electrolytePack, (CooldownType)0, 10f);
		((PlayerItem)electrolytePack).consumable = false;
		((PickupObject)electrolytePack).quality = (ItemQuality)(-100);
		((BraveBehaviour)electrolytePack).sprite.IsPerpendicular = true;
		ID = ((PickupObject)electrolytePack).PickupObjectId;
	}

	public override void DoEffect(PlayerController user)
	{
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		if (((PickupObject)((GameActor)user).CurrentGun).PickupObjectId == HFBladeLightning.ID)
		{
			PickupObject byId = PickupObjectDatabase.GetById(21);
			SpawnManager.SpawnVFX(((Gun)((byId is Gun) ? byId : null)).DefaultModule.chargeProjectiles[4].Projectile.hitEffects.overrideMidairDeathVFX, Vector2.op_Implicit(((BraveBehaviour)user).sprite.WorldCenter), Quaternion.Euler(0f, 0f, 0f));
			AkSoundEngine.PostEvent("Play_WPN_energy_impact_01", ((Component)this).gameObject);
			((Component)((GameActor)user).CurrentGun).gameObject.GetComponent<HFBladeLightning>().kills = 6;
			((Component)((GameActor)user).CurrentGun).gameObject.GetComponent<HFBladeLightning>().canDoRipper = true;
		}
	}
}
internal class HookAndGut : GunBehaviour
{
	private class ChainProjectileToPlayer : MonoBehaviour
	{
		public PlayerController player;

		private Projectile projectile;

		public tk2dTiledSprite chainSprite;

		private void Start()
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			projectile = ((Component)this).gameObject.GetComponent<Projectile>();
			ref tk2dTiledSprite reference = ref chainSprite;
			PickupObject byId = PickupObjectDatabase.GetById(250);
			reference = Object.Instantiate<tk2dTiledSprite>(((GrapplingHookItem)((byId is GrapplingHookItem) ? byId : null)).GrapplePrefab.GetComponentInChildren<tk2dTiledSprite>());
			((BraveBehaviour)chainSprite).transform.position = Vector2.op_Implicit(((BraveBehaviour)projectile).sprite.WorldCenter);
			PhysicsEngine.Instance.OnPostRigidbodyMovement += UpdateChain;
			projectile.OnDestruction += Projectile_OnDestruction;
		}

		private void Projectile_OnDestruction(Projectile obj)
		{
			DestroyChain();
			Object.Destroy((Object)(object)chainSprite);
		}

		public void UpdateChain()
		{
			//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_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)player != (Object)null)
			{
				((BraveBehaviour)chainSprite).transform.position = Vector2.op_Implicit(((BraveBehaviour)projectile).sprite.WorldCenter);
				Vector2 val = ((BraveBehaviour)projectile).sprite.WorldCenter - Vector2.op_Implicit(((GameActor)player).CurrentGun.barrelOffset.position);
				int num = Mathf.RoundToInt(((Vector2)(ref val)).magnitude / 0.0625f);
				chainSprite.dimensions = new Vector2((float)num, chainSprite.dimensions.y);
				float num2 = BraveMathCollege.Atan2Degrees(val);
				((BraveBehaviour)chainSprite).transform.rotation = Quaternion.Euler(0f, 0f, num2);
			}
			if ((Object)(object)player == (Object)null)
			{
				DestroyChain();
			}
		}

		public void DestroyChain()
		{
			if ((Object)(object)chainSprite != (Object)null)
			{
				Object.Destroy((Object)(object)chainSprite);
			}
			PhysicsEngine.Instance.OnPostRigidbodyMovement -= UpdateChain;
		}
	}

	private class StickProjectileOnHit : MonoBehaviour
	{
		public PlayerController player;

		private Projectile projectile;

		private AIActor hitEnemy;

		public Gun sourceGun;

		private void Start()
		{
			projectile = ((Component)this).gameObject.GetComponent<Projectile>();
			Projectile obj = projectile;
			obj.OnHitEnemy = (Action<Projectile, SpeculativeRigidbody, bool>)Delegate.Combine(obj.OnHitEnemy, new Action<Projectile, SpeculativeRigidbody, bool>(OnHitEnemy));
		}

		private void OnHitEnemy(Projectile p, SpeculativeRigidbody enemy, bool fatal)
		{
			if ((Object)(object)((Component)enemy).gameObject.GetComponent<AIActor>() != (Object)null)
			{
				hitEnemy = ((BraveBehaviour)enemy).aiActor;
				if (!fatal && (Object)(object)((Component)sourceGun).gameObject.GetComponent<HookAndGut>() != (Object)null && (Object)(object)((Component)hitEnemy).gameObject.GetComponent<ChainToEnemy>() == (Object)null && Object.op_Implicit((Object)(object)((Component)p.Owner).GetComponent<PlayerController>()))
				{
					player = ((Component)p.Owner).GetComponent<PlayerController>();
					((Component)sourceGun).gameObject.GetComponent<HookAndGut>().hookedActors.Add(hitEnemy);
					((Component)hitEnemy).gameObject.AddComponent<ChainToEnemy>();
					((Component)hitEnemy).gameObject.GetComponent<ChainToEnemy>().player = player;
				}
			}
		}
	}

	private class ChainToEnemy : MonoBehaviour
	{
		public PlayerController player;

		private tk2dTiledSprite chainSprite;

		private void Start()
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			ref tk2dTiledSprite reference = ref chainSprite;
			PickupObject byId = PickupObjectDatabase.GetById(250);
			reference = Object.Instantiate<tk2dTiledSprite>(((GrapplingHookItem)((byId is GrapplingHookItem) ? byId : null)).GrapplePrefab.GetComponentInChildren<tk2dTiledSprite>());
			((BraveBehaviour)chainSprite).transform.position = Vector2.op_Implicit(((BraveBehaviour)((Component)this).gameObject.GetComponent<AIActor>()).sprite.WorldCenter);
			PhysicsEngine.Instance.OnPostRigidbodyMovement += UpdateChain;
		}

		public void UpdateChain()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: 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_00c8: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)player != (Object)null)
			{
				((BraveBehaviour)chainSprite).transform.position = Vector2.op_Implicit(((BraveBehaviour)((Component)this).gameObject.GetComponent<AIActor>()).sprite.WorldCenter);
				Vector2 val = ((BraveBehaviour)((Component)this).gameObject.GetComponent<AIActor>()).sprite.WorldCenter - Vector2.op_Implicit(((GameActor)player).CurrentGun.barrelOffset.position);
				int num = Mathf.RoundToInt(((Vector2)(ref val)).magnitude / 0.0625f);
				chainSprite.dimensions = new Vector2((float)num, chainSprite.dimensions.y);
				float num2 = BraveMathCollege.Atan2Degrees(val);
				((BraveBehaviour)chainSprite).transform.rotation = Quaternion.Euler(0f, 0f, num2);
			}
			if ((Object)(object)player == (Object)null)
			{
				DestroyChain();
			}
		}

		public void DestroyChain()
		{
			if ((Object)(object)chainSprite != (Object)null)
			{
				Object.Destroy((Object)(object)chainSprite);
			}
			PhysicsEngine.Instance.OnPostRigidbodyMovement -= UpdateChain;
		}

		private void OnDestroy()
		{
			DestroyChain();
		}
	}

	private class KillKBWhenNearPlayer : MonoBehaviour
	{
		public AIActor enemy;

		public PlayerController player;

		private KnockbackDoer kbDoer;

		private Vector2 cachedKBDirection;

		private int kbID;

		private void Start()
		{
			//IL_002f: 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_0044: 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_0087: Unknown result type (might be due to invalid IL or missing references)
			enemy = ((Component)this).gameObject.GetComponent<AIActor>();
			kbDoer = ((BraveBehaviour)enemy).knockbackDoer;
			cachedKBDirection = ((BraveBehaviour)player).sprite.WorldCenter - ((BraveBehaviour)enemy).sprite.WorldCenter;
			kbDoer.m_isImmobile.ClearOverrides();
			kbDoer.m_isImmobile.SetOverride("get yoinked", false, (float?)null);
			kbID = kbDoer.ApplyContinuousKnockback(cachedKBDirection, 60f);
		}

		private void Update()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: 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_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)player))
			{
				if (Mathf.Abs(Vector2.Distance(((BraveBehaviour)enemy).sprite.WorldCenter, ((BraveBehaviour)player).sprite.WorldCenter)) < 1f)
				{
					kbDoer.EndContinuousKnockback(kbID);
					kbDoer.knockbackMultiplier = 0f;
					kbDoer.m_isImmobile.ClearOverrides();
					kbDoer.SetImmobile(true, "hook_and_gut");
				}
				if (Mathf.Abs(Vector2.Distance(((BraveBehaviour)enemy).sprite.WorldCenter, ((BraveBehaviour)player).sprite.WorldCenter)) > 1f && ((BraveBehaviour)player).sprite.WorldCenter - ((BraveBehaviour)enemy).sprite.WorldCenter != cachedKBDirection)
				{
					cachedKBDirection = ((BraveBehaviour)player).sprite.WorldCenter - ((BraveBehaviour)enemy).sprite.WorldCenter;
					kbDoer.UpdateContinuousKnockback(cachedKBDirection, 60f, kbID);
				}
			}
			if (!Object.op_Implicit((Object)(object)player))
			{
				Object.Destroy((Object)(object)((Component)this).gameObject.GetComponent<KillKBWhenNearPlayer>());
			}
		}
	}

	public static int encounterTimes;

	public static string consoleID;

	private static string spriteID;

	private static GameObject vfxPrefab;

	public static ItemStats stats = new ItemStats();

	private bool hooking = false;

	public static int ID;

	public List<AIActor> hookedActors = new List<AIActor>();

	public static void Add()
	{
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: 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_0166: Unknown result type (might be due to invalid IL or missing references)
		//IL_016b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0170: Unknown result type (might be due to invalid IL or missing references)
		//IL_0181: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f2: Expected O, but got Unknown
		//IL_030d: Unknown result type (might be due to invalid IL or missing references)
		consoleID = "hook_and_gut";
		spriteID = "hook_and_gut";
		Gun val = Databases.Items.NewGun("Hook And Gut", spriteID);
		Game.Items.Rename("outdated_gun_mods:" + consoleID, "slvjckt:" + consoleID);
		((Component)val).gameObject.AddComponent<HookAndGut>();
		GunExt.SetShortDescription((PickupObject)(object)val, "No Release");
		GunExt.SetLongDescription((PickupObject)(object)val, "Hooks enemies on hit. If an enemy is under 10% HP, reload to reel them in and perform a devastating finishing attack with invincibility frames. Otherwise, if the enemy is over 10% HP, deal damage and create a pool of blood under them on reload. Increases Curse by 1 while held.\n\nAn unusual harpoon launcher with a hollow stock that serves as a sheathe for a wicked hunting knife.");
		GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, spriteID + "_idle_001", 12);
		GunExt.SetAnimationFPS(val, val.shootAnimation, 12);
		GunExt.SetAnimationFPS(val, val.reloadAnimation, 12);
		GunTools.TrimGunSprites(val);
		PickupObject byId = PickupObjectDatabase.GetById(15);
		GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
		ref VFXPool muzzleFlashEffects = ref val.muzzleFlashEffects;
		PickupObject byId2 = PickupObjectDatabase.GetById(26);
		muzzleFlashEffects = ((Gun)((byId2 is Gun) ? byId2 : null)).muzzleFlashEffects;
		val.DefaultModule.ammoCost = 1;
		val.DefaultModule.shootStyle = (ShootStyle)1;
		val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
		val.DefaultModule.ammoType = (AmmoType)9;
		val.reloadTime = 1.5f;
		val.DefaultModule.cooldownTime = 1f;
		val.DefaultModule.numberOfShotsInClip = 1;
		val.DefaultModule.angleVariance = 0f;
		val.SetBaseMaxAmmo(150);
		val.gunClass = (GunClass)15;
		val.carryPixelOffset += new IntVector2(8, 0);
		Transform transform = ((Component)val.barrelOffset).transform;
		transform.localPosition += new Vector3(1.125f, 0.5625f, 0f);
		ItemBuilder.AddPassiveStatModifier((PickupObject)(object)val, (StatType)14, 1f, (ModifyMethod)0);
		GunBehaviour[] components = ((Component)val).GetComponents<GunBehaviour>();
		((PickupObject)val).quality = (ItemQuality)3;
		val.gunSwitchGroup = "slvjckt" + consoleID;
		SoundManager.AddCustomSwitchData("WPN_Guns", val.gunSwitchGroup, "Play_WPN_Gun_Reload_01", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_OBJ_hook_shot_01") });
		SoundManager.AddCustomSwitchData("WPN_Guns", val.gunSwitchGroup, "Play_WPN_Gun_Shot_01", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_WPN_m1rifle_shot_01") });
		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 = 10f;
		val2.baseData.speed = 40f;
		val2.baseData.force = 20f;
		((BraveBehaviour)val2).transform.parent = val.barrelOffset;
		List<string> spritePaths = new List<string> { "SilverJacket/Resources/VFX/Slashes/HookAndGut/hook_and_gut_slash_001", "SilverJacket/Resources/VFX/Slashes/HookAndGut/hook_and_gut_slash_002", "SilverJacket/Resources/VFX/Slashes/HookAndGut/hook_and_gut_slash_003", "SilverJacket/Resources/VFX/Slashes/HookAndGut/hook_and_gut_slash_004" };
		GameObject val3 = new GameObject();
		val3 = BasicVFXCreator.MakeBasicVFX("slvjckt_" + spriteID + "_slash", spritePaths, 12, new IntVector2(15, 25), (Anchor)4);
		vfxPrefab = val3;
		GunTools.SetProjectileSpriteRight(val2, "hook_projectile_2", 8, 7, true, (Anchor)0, (int?)null, (int?)null, true, false, (int?)null, (int?)null, (Projectile)null);
		Databases.Items.Add((PickupObject)(object)val, false, "ANY");
		ID = ((PickupObject)val).PickupObjectId;
		stats.name = ((PickupObject)val).EncounterNameOrDisplayName;
	}

	public override void OwnedUpdatePlayer(PlayerController owner, GunInventory inventory)
	{
		if (((PickupObject)((GameActor)owner).CurrentGun).PickupObjectId == ID)
		{
			return;
		}
		if (hookedActors.Any())
		{
			foreach (AIActor hookedActor in hookedActors)
			{
				if (Object.op_Implicit((Object)(object)((Component)hookedActor).gameObject.GetComponent<ChainToEnemy>()))
				{
					((Component)hookedActor).gameObject.GetComponent<ChainToEnemy>().DestroyChain();
					Object.Destroy((Object)(object)((Component)hookedActor).gameObject.GetComponent<ChainToEnemy>());
				}
			}
			hookedActors.Clear();
		}
		if (hooking)
		{
			((MonoBehaviour)GameManager.Instance).StopCoroutine(GutEnemies(hookedActors, owner));
			ClearHook(owner);
		}
	}

	public override void AutoreloadOnEmptyClip(GameActor owner, Gun gun, ref bool autoreload)
	{
		autoreload = false;
	}

	public override void PostProcessProjectile(Projectile projectile)
	{
		projectile.shouldRotate = true;
		StickProjectileOnHit stickProjectileOnHit = ((Component)projectile).gameObject.AddComponent<StickProjectileOnHit>();
		stickProjectileOnHit.sourceGun = base.gun;
		((Component)projectile).gameObject.AddComponent<ChainProjectileToPlayer>();
		ref PlayerController player = ref ((Component)projectile).gameObject.GetComponent<ChainProjectileToPlayer>().player;
		GameActor currentOwner = base.gun.CurrentOwner;
		player = (PlayerController)(object)((currentOwner is PlayerController) ? currentOwner : null);
	}

	public override void OnReloadedPlayer(PlayerController owner, Gun gun)
	{
		//IL_00b1: 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_01df: Unknown result type (might be due to invalid IL or missing references)
		//IL_0231: Unknown result type (might be due to invalid IL or missing references)
		//IL_0266: 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)
		List<AIActor> list = new List<AIActor>();
		foreach (AIActor hookedActor in hookedActors)
		{
			if (Object.op_Implicit((Object)(object)((Component)hookedActor).gameObject.GetComponent<ChainToEnemy>()))
			{
				((Component)hookedActor).gameObject.GetComponent<ChainToEnemy>().DestroyChain();
			}
			if (!((Object)(object)((BraveBehaviour)hookedActor).healthHaver != (Object)null))
			{
				continue;
			}
			if (!((BraveBehaviour)hookedActor).healthHaver.IsDead)
			{
				if (((BraveBehaviour)hookedActor).healthHaver.IsBoss || ((BraveBehaviour)hookedActor).healthHaver.IsSubboss)
				{
					((BraveBehaviour)hookedActor).healthHaver.ApplyDamage(15f * owner.stats.GetStatValue((StatType)5), Vector2.zero, ((GameActor)owner).ActorName, (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
					AkSoundEngine.PostEvent("Play_BOSS_blobulord_burst_01", ((Component)this).gameObject);
					PickupObject byId = PickupObjectDatabase.GetById(272);
					GoopDefinition bloodDefinition = ((IronCoinItem)((byId is IronCoinItem) ? byId : null)).BloodDefinition;
					DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(bloodDefinition).TimedAddGoopCircle(((BraveBehaviour)hookedActor).sprite.WorldCenter, 1.2f, 0.3f, false);
				}
				else
				{
					float currentHealthPercentage = ((BraveBehaviour)hookedActor).healthHaver.GetCurrentHealthPercentage();
					if (currentHealthPercentage <= 0.2f || ((BraveBehaviour)hookedActor).healthHaver.GetCurrentHealth() <= 15f * owner.stats.GetStatValue((StatType)5))
					{
						if ((Object)(object)((BraveBehaviour)hookedActor).behaviorSpeculator != (Object)null)
						{
							((BraveBehaviour)hookedActor).behaviorSpeculator.ImmuneToStun = false;
							((BraveBehaviour)hookedActor).behaviorSpeculator.Stun(100f, true);
						}
						if ((Object)(object)((BraveBehaviour)hookedActor).aiShooter != (Object)null)
						{
							((BraveBehaviour)hookedActor).aiShooter.CeaseAttack();
						}
						hookedActor.MovementSpeed = 0f;
						list.Add(hookedActor);
					}
					else
					{
						((BraveBehaviour)hookedActor).healthHaver.ApplyDamage(15f * owner.stats.GetStatValue((StatType)5), Vector2.zero, ((GameActor)owner).ActorName, (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
						AkSoundEngine.PostEvent("Play_BOSS_blobulord_burst_01", ((Component)this).gameObject);
						PickupObject byId2 = PickupObjectDatabase.GetById(272);
						GoopDefinition bloodDefinition2 = ((IronCoinItem)((byId2 is IronCoinItem) ? byId2 : null)).BloodDefinition;
						bloodDefinition2.eternal = false;
						DeadlyDeadlyGoopManager.GetGoopManagerForGoopType(bloodDefinition2).TimedAddGoopCircle(((BraveBehaviour)hookedActor).sprite.WorldCenter, 1.2f, 0.3f, false);
						if ((Object)(object)((BraveBehaviour)hookedActor).knockbackDoer != (Object)null)
						{
							((BraveBehaviour)hookedActor).knockbackDoer.ApplyKnockback(((BraveBehaviour)owner).sprite.WorldCenter - ((BraveBehaviour)hookedActor).sprite.WorldCenter, 15f, false);
						}
					}
				}
			}
			if (Object.op_Implicit((Object)(object)((Component)hookedActor).gameObject.GetComponent<ChainToEnemy>()))
			{
				Object.Destroy((Object)(object)((Component)hookedActor).gameObject.GetComponent<ChainToEnemy>());
			}
		}
		if (list.Any())
		{
			((MonoBehaviour)GameManager.Instance).StartCoroutine(GutEnemies(list, owner));
		}
		if (hookedActors.Any())
		{
			hookedActors.Clear();
		}
	}

	private IEnumerator MakePlayerInvincible(PlayerController player)
	{
		((BraveBehaviour)player).healthHaver.IsVulnerable = false;
		yield return (object)new WaitForSeconds(2f);
		((BraveBehaviour)player).healthHaver.IsVulnerable = true;
	}

	private IEnumerator GutEnemies(List<AIActor> actorsToGut, PlayerController player)
	{
		hooking = true;
		((PickupObject)base.gun).CanBeDropped = false;
		((PickupObject)base.gun).CanBeSold = false;
		player.inventory.GunLocked.SetOverride("hook_and_gut", true, (float?)null);
		player.SetInputOverride("hook_and_gut");
		((MonoBehaviour)GameManager.Instance).StartCoroutine(MakePlayerInvincible(player));
		foreach (AIActor a2 in actorsToGut)
		{
			((Component)a2).gameObject.AddComponent<KillKBWhenNearPlayer>();
			((Component)a2).gameObject.GetComponent<KillKBWhenNearPlayer>().player = player;
		}
		yield return (object)new WaitForSeconds(0.3f);
		((BraveBehaviour)((GameActor)player).CurrentGun).spriteAnimator.StopAndResetFrameToDefault();
		((BraveBehaviour)((GameActor)player).CurrentGun).spriteAnimator.Play(base.gun.criticalFireAnimation);
		yield return (object)new WaitForSeconds(1f);
		SpawnManager.SpawnVFX(vfxPrefab, ((GameActor)player).CurrentGun.barrelOffset.position, Quaternion.Euler(0f, 0f, ((GameActor)player).CurrentGun.CurrentAngle));
		foreach (AIActor a in actorsToGut)
		{
			((BraveBehaviour)a).healthHaver.ApplyDamage(((BraveBehaviour)a).healthHaver.AdjustedMaxHealth, Vector2.zero, "gutted", (CoreDamageTypes)0, (DamageCategory)5, true, (PixelCollider)null, true);
		}
		hooking = false;
		ClearHook(player);
	}

	private void ClearHook(PlayerController player)
	{
		((PickupObject)base.gun).CanBeDropped = true;
		((PickupObject)base.gun).CanBeSold = true;
		hooking = false;
		player.inventory.GunLocked.SetOverride("hook_and_gut", false, (float?)null);
		player.ClearInputOverride("hook_and_gut");
	}

	public override void OnSwitchedAwayFromPlayer(PlayerController owner, GunInventory inventory, Gun newGun, bool isNewGun)
	{
		foreach (AIActor hookedActor in hookedActors)
		{
			((Component)hookedActor).gameObject.GetComponent<ChainToEnemy>().DestroyChain();
			Object.Destroy((Object)(object)((Component)hookedActor).gameObject.GetComponent<ChainToEnemy>());
		}
		hookedActors.Clear();
	}

	public override void OnDropped()
	{
		foreach (AIActor hookedActor in hookedActors)
		{
			((Component)hookedActor).gameObject.GetComponent<ChainToEnemy>().DestroyChain();
			Object.Destroy((Object)(object)((Component)hookedActor).gameObject.GetComponent<ChainToEnemy>());
		}
		hookedActors.Clear();
	}

	public override void OnGunThrown(Gun gun, GameActor owner, Projectile thrownGunProjectile)
	{
		foreach (AIActor hookedActor in hookedActors)
		{
			((Component)hookedActor).gameObject.GetComponent<ChainToEnemy>().DestroyChain();
			Object.Destroy((Object)(object)((Component)hookedActor).gameObject.GetComponent<ChainToEnemy>());
		}
		hookedActors.Clear();
	}

	public override void OnDestroy()
	{
		foreach (AIActor hookedActor in hookedActors)
		{
			((Component)hookedActor).gameObject.GetComponent<ChainToEnemy>().DestroyChain();
			Object.Destroy((Object)(object)((Component)hookedActor).gameObject.GetComponent<ChainToEnemy>());
		}
	}

	public override void OnPlayerPickup(PlayerController playerOwner)
	{
		stats.encounterAmount++;
		Module.UpdateStatList();
		((GunBehaviour)this).OnPlayerPickup(playerOwner);
	}
}
internal class PunishingCrossMG : GunBehaviour
{
	public static string consoleID;

	private static string spriteID;

	private static VFXPool slashFX;

	private bool reloadEnded = false;

	private bool doingTransformEnum = false;

	public static int ID;

	public static void Add()
	{
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: 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_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Unknown result type (might be due to invalid IL or missing references)
		//IL_0199: Expected O, but got Unknown
		//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
		consoleID = "punishing_cross_mg";
		spriteID = "punishing_cross_mg";
		Gun val = Databases.Items.NewGun("Punishing Cross MG", spriteID);
		Game.Items.Rename("outdated_gun_mods:" + consoleID, "slvjckt:" + consoleID);
		((Component)val).gameObject.AddComponent<PunishingCrossMG>();
		((Component)val).gameObject.AddComponent<GunTransformationManager>();
		GunExt.SetShortDescription((PickupObject)(object)val, "Carry With No Vanity");
		GunExt.SetLongDescription((PickupObject)(object)val, "A powerful two-handed beast of a gun that switches between a machine gun and a rocket launcher on reload.\nDestroys nearby bullets on transforming when from MG form and performs a damaging swing on transforming from RPG form.\n\n");
		GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, spriteID + "_idle_001", 12);
		GunExt.SetAnimationFPS(val, val.shootAnimation, 20);
		GunExt.SetAnimationFPS(val, val.reloadAnimation, 12);
		GunTools.TrimGunSprites(val);
		PickupObject byId = PickupObjectDatabase.GetById(96);
		GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
		ref VFXPool muzzleFlashEffects = ref val.muzzleFlashEffects;
		PickupObject byId2 = PickupObjectDatabase.GetById(98);
		muzzleFlashEffects = ((Gun)((byId2 is Gun) ? byId2 : null)).muzzleFlashEffects;
		val.DefaultModule.ammoCost = 1;
		val.DefaultModule.shootStyle = (ShootStyle)1;
		val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
		val.DefaultModule.ammoType = (AmmoType)0;
		val.reloadTime = 1.5f;
		val.DefaultModule.cooldownTime = 0.1f;
		val.DefaultModule.numberOfShotsInClip = 35;
		val.DefaultModule.angleVariance = 6f;
		val.SetBaseMaxAmmo(500);
		val.gunClass = (GunClass)10;
		((Component)val.barrelOffset).transform.localPosition = new Vector3(3f, 1.0625f, 0f);
		GameObject val2 = new GameObject("mg offset");
		val2.transform.SetParent(((BraveBehaviour)val).transform);
		val2.transform.localPosition = new Vector3(3.25f, 1.0625f, 0f);
		((PickupObject)val).quality = (ItemQuality)5;
		ref string gunSwitchGroup = ref val.gunSwitchGroup;
		PickupObject byId3 = PickupObjectDatabase.GetById(96);
		gunSwitchGroup = ((Gun)((byId3 is Gun) ? byId3 : null)).gunSwitchGroup;
		Projectile val3 = Object.Instantiate<Projectile>(val.DefaultModule.projectiles[0]);
		((Component)val3).gameObject.SetActive(false);
		FakePrefab.MarkAsFakePrefab(((Component)val3).gameObject);
		Object.DontDestroyOnLoad((Object)(object)val3);
		val.DefaultModule.projectiles[0] = val3;
		val3.baseData.damage = 6.5f;
		val3.baseData.speed = 26f;
		val3.baseData.force = 10f;
		((BraveBehaviour)val3).transform.parent = val.barrelOffset;
		List<string> list = new List<string> { "SilverJacket/Resources/VFX/Slashes/Cross/cross_slash_001", "SilverJacket/Resources/VFX/Slashes/Cross/cross_slash_002", "SilverJacket/Resources/VFX/Slashes/Cross/cross_slash_003", "SilverJacket/Resources/VFX/Slashes/Cross/cross_slash_004" };
		VFXPool val4 = VFXBuilder.CreateVFXPool("slvjckt_" + consoleID + "_slash", list, 12, new IntVector2(53, 78), (Anchor)4, true, 0.1f, false, (VFXAlignment)1, -1f, (Color?)null, (Assembly)null);
		slashFX = val4;
		Databases.Items