Decompiled source of Modular Remastered v1.3.6

plugins/ModularCharacter.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.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using Alexandria;
using Alexandria.BreakableAPI;
using Alexandria.CharacterAPI;
using Alexandria.DungeonAPI;
using Alexandria.EnemyAPI;
using Alexandria.ItemAPI;
using Alexandria.Misc;
using Alexandria.NPCAPI;
using Alexandria.PrefabAPI;
using BepInEx;
using BepInEx.Configuration;
using Brave.BulletScript;
using Dungeonator;
using FullInspector;
using FullSerializer;
using Gungeon;
using HarmonyLib;
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;
using InControl;
using JuneLib;
using JuneLib.Items;
using JuneLib.Status;
using ModularMod.Code.Collectibles.Guns.Gravity_Pulsar;
using ModularMod.Code.Collectibles.Guns.Update_3;
using ModularMod.Code.Components;
using ModularMod.Code.Components.Misc_Components;
using ModularMod.Code.Components.Projectile_Components;
using ModularMod.Code.Controllers;
using ModularMod.Code.Enemies.EnemyBehaviours;
using ModularMod.Code.Hooks;
using ModularMod.Code.Toolboxes;
using ModularMod.Code.Unlocks;
using ModularMod.Past.Prefabs.Objects;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using MonoMod.Utils;
using Pathfinding;
using SGUI;
using SaveAPI;
using SoundAPI;
using UnityEngine;
using UnityEngine.Rendering;

[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("57445610-0892-47c3-be16-453172104123")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
public class CustomProximityMine : BraveBehaviour
{
	public enum ExplosiveStyle
	{
		PROXIMITY,
		TIMED
	}

	public ExplosionData explosionData;

	public ExplosiveStyle explosionStyle;

	[ShowInInspectorIf("explosionStyle", 0, false)]
	public float detectRadius = 2.5f;

	public float explosionDelay = 0.3f;

	public bool usesCustomExplosionDelay;

	[ShowInInspectorIf("usesCustomExplosionDelay", false)]
	public float customExplosionDelay = 0.1f;

	[CheckAnimation(null)]
	public string deployAnimName;

	[CheckAnimation(null)]
	public string idleAnimName;

	[CheckAnimation(null)]
	public string explodeAnimName;

	[Header("Homing")]
	public bool MovesTowardEnemies;

	public bool HomingTriggeredOnSynergy;

	[LongNumericEnum]
	public CustomSynergyType TriggerSynergy;

	public float HomingRadius = 5f;

	public float HomingSpeed = 3f;

	public float HomingDelay = 5f;

	protected bool m_triggered;

	protected bool m_disarmed;

	public bool Force_Disarm = false;

	private void TransitionToIdle(tk2dSpriteAnimator animator, tk2dSpriteAnimationClip clip)
	{
		if (idleAnimName != null && !animator.IsPlaying(explodeAnimName))
		{
			animator.Play(idleAnimName);
		}
		animator.AnimationCompleted = (Action<tk2dSpriteAnimator, tk2dSpriteAnimationClip>)Delegate.Remove(animator.AnimationCompleted, new Action<tk2dSpriteAnimator, tk2dSpriteAnimationClip>(TransitionToIdle));
	}

	private void Update()
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: 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_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		if (!MovesTowardEnemies && HomingTriggeredOnSynergy && GameManager.Instance.PrimaryPlayer.HasActiveBonusSynergy(TriggerSynergy, false))
		{
			MovesTowardEnemies = true;
		}
		if (!MovesTowardEnemies)
		{
			return;
		}
		RoomHandler absoluteRoom = Vector3Extensions.GetAbsoluteRoom(((BraveBehaviour)this).transform.position);
		float num = float.MaxValue;
		AIActor nearestEnemy = absoluteRoom.GetNearestEnemy(((BraveBehaviour)this).sprite.WorldCenter, ref num, true, false);
		if (Object.op_Implicit((Object)(object)nearestEnemy) && num < HomingRadius)
		{
			Vector2 centerPosition = ((GameActor)nearestEnemy).CenterPosition;
			Vector2 val = centerPosition - ((BraveBehaviour)this).sprite.WorldCenter;
			Vector2 normalized = ((Vector2)(ref val)).normalized;
			if (Object.op_Implicit((Object)(object)((BraveBehaviour)this).debris))
			{
				((BraveBehaviour)this).debris.ApplyFrameVelocity(normalized * HomingSpeed);
			}
			else
			{
				((BraveBehaviour)this).transform.position = ((BraveBehaviour)this).transform.position + Vector2Extensions.ToVector3ZisY(normalized, 0f) * HomingSpeed * BraveTime.DeltaTime;
			}
		}
	}

	private IEnumerator Start()
	{
		if (!string.IsNullOrEmpty(deployAnimName))
		{
			((BraveBehaviour)this).spriteAnimator.Play(deployAnimName);
			tk2dSpriteAnimator spriteAnimator = ((BraveBehaviour)this).spriteAnimator;
			spriteAnimator.AnimationCompleted = (Action<tk2dSpriteAnimator, tk2dSpriteAnimationClip>)Delegate.Combine(spriteAnimator.AnimationCompleted, new Action<tk2dSpriteAnimator, tk2dSpriteAnimationClip>(TransitionToIdle));
		}
		else if (!string.IsNullOrEmpty(idleAnimName))
		{
			((BraveBehaviour)this).spriteAnimator.Play(idleAnimName);
		}
		if (explosionStyle == ExplosiveStyle.PROXIMITY)
		{
			Vector2 position = Vector3Extensions.XY(((BraveBehaviour)this).transform.position);
			List<AIActor> allActors = StaticReferenceManager.AllEnemies;
			AkSoundEngine.PostEvent("Play_OBJ_mine_set_01", ((Component)this).gameObject);
			while (!m_triggered)
			{
				if (MovesTowardEnemies)
				{
					position = ((BraveBehaviour)this).sprite.WorldCenter;
				}
				if (!GameManager.Instance.Dungeon.data.GetAbsoluteRoomFromPosition(Vector3Extensions.IntXY(((BraveBehaviour)this).transform.position, (VectorConversions)0)).HasActiveEnemies((ActiveEnemyType)1))
				{
					m_triggered = true;
					m_disarmed = true;
					break;
				}
				bool shouldContinue = false;
				for (int i = 0; i < GameManager.Instance.AllPlayers.Length; i++)
				{
					if (Object.op_Implicit((Object)(object)GameManager.Instance.AllPlayers[i]) && !GameManager.Instance.AllPlayers[i].IsGhost)
					{
						float num = Vector2.SqrMagnitude(position - ((BraveBehaviour)GameManager.Instance.AllPlayers[i]).specRigidbody.UnitCenter);
						if (num < detectRadius * detectRadius)
						{
							shouldContinue = true;
							break;
						}
					}
				}
				if (shouldContinue)
				{
					yield return null;
					continue;
				}
				for (int j = 0; j < allActors.Count; j++)
				{
					AIActor aiactor = allActors[j];
					if (aiactor.IsNormalEnemy && ((Component)aiactor).gameObject.activeSelf && aiactor.HasBeenEngaged && !((BraveBehaviour)aiactor).healthHaver.IsDead)
					{
						float num2 = Vector2.SqrMagnitude(position - ((BraveBehaviour)aiactor).specRigidbody.UnitCenter);
						if (num2 < detectRadius * detectRadius && !Force_Disarm)
						{
							m_triggered = true;
							break;
						}
					}
				}
				yield return null;
			}
		}
		else if (explosionStyle == ExplosiveStyle.TIMED)
		{
			yield return (object)new WaitForSeconds(explosionDelay);
			if (MovesTowardEnemies && HomingDelay > explosionDelay)
			{
				yield return (object)new WaitForSeconds(HomingDelay - explosionDelay);
			}
		}
		if (!m_disarmed)
		{
			if (!string.IsNullOrEmpty(explodeAnimName))
			{
				((BraveBehaviour)this).spriteAnimator.Play(explodeAnimName);
				if (usesCustomExplosionDelay)
				{
					yield return (object)new WaitForSeconds(customExplosionDelay);
				}
				else
				{
					tk2dSpriteAnimationClip clip = ((BraveBehaviour)this).spriteAnimator.GetClipByName(explodeAnimName);
					yield return (object)new WaitForSeconds((float)clip.frames.Length / clip.fps);
				}
			}
			Exploder.Explode(Vector2Extensions.ToVector3ZUp(((BraveBehaviour)this).sprite.WorldCenter, 0f), explosionData, Vector2.zero, (Action)null, false, (CoreDamageTypes)0, false);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
		else
		{
			((BraveBehaviour)this).spriteAnimator.StopAndResetFrame();
		}
	}

	public override void OnDestroy()
	{
		((BraveBehaviour)this).OnDestroy();
	}
}
namespace System
{
	public class Func<T1, T2, T3, T4, T5, T6>
	{
	}
}
namespace SGUI
{
	public class ShakyWobbly : SModifier
	{
		private float startTime;

		private Color defaultColor = new Color(0.5f, 0.9f, 1f);

		private float offset;

		private float freq;

		private float amp;

		public override void Init()
		{
			startTime = Time.realtimeSinceStartup;
			offset = Random.Range(-0.25f, 0.25f);
			freq = Random.Range(1f, 2.1f);
			amp = Random.Range(1f, 2.1f);
		}

		public override void Update()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			float num = Time.realtimeSinceStartup - startTime;
			float num2 = Mathf.Sin(num * 3f * freq) * amp;
			base.Elem.Foreground = defaultColor;
			base.Elem.Position = Vector2Extensions.WithY(base.Elem.Position, num2);
		}
	}
	public class ShakyWobblyNoColor : SModifier
	{
		private float startTime;

		private float freq;

		private float amp;

		public override void Init()
		{
			startTime = Time.realtimeSinceStartup;
			freq = 1f;
			amp = 1.5f;
		}

		public override void Update()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			float num = Time.realtimeSinceStartup - startTime;
			float num2 = Mathf.Sin(num * 3f * freq) * amp;
			base.Elem.Position = Vector2Extensions.WithY(base.Elem.Position, num2);
		}
	}
}
namespace ModularMod
{
	public class FortifierAlt : GunBehaviour
	{
		public static int GunID;

		public static void Init()
		{
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0374: Unknown result type (might be due to invalid IL or missing references)
			//IL_0382: Unknown result type (might be due to invalid IL or missing references)
			//IL_0390: Unknown result type (might be due to invalid IL or missing references)
			//IL_039e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Unknown result type (might be due to invalid IL or missing references)
			//IL_043e: Expected O, but got Unknown
			//IL_0452: Unknown result type (might be due to invalid IL or missing references)
			//IL_0457: Unknown result type (might be due to invalid IL or missing references)
			//IL_0765: Unknown result type (might be due to invalid IL or missing references)
			//IL_076a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0779: Unknown result type (might be due to invalid IL or missing references)
			//IL_0780: Expected O, but got Unknown
			//IL_07e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0866: Unknown result type (might be due to invalid IL or missing references)
			//IL_086b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0872: Unknown result type (might be due to invalid IL or missing references)
			//IL_087d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0888: Unknown result type (might be due to invalid IL or missing references)
			//IL_0893: Unknown result type (might be due to invalid IL or missing references)
			//IL_089e: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_08be: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0900: Unknown result type (might be due to invalid IL or missing references)
			//IL_0907: Unknown result type (might be due to invalid IL or missing references)
			//IL_090e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0919: Unknown result type (might be due to invalid IL or missing references)
			//IL_0920: Unknown result type (might be due to invalid IL or missing references)
			//IL_0927: Unknown result type (might be due to invalid IL or missing references)
			//IL_092e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0935: Unknown result type (might be due to invalid IL or missing references)
			//IL_0940: Unknown result type (might be due to invalid IL or missing references)
			//IL_0950: Expected O, but got Unknown
			//IL_0a21: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a26: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a82: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0abf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae9: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("Fortifier", "turretplaceralt");
			Game.Items.Rename("outdated_gun_mods:fortifier", "mdl:armcannon_15_alt");
			FortifierAlt @object = ((Component)val).gameObject.AddComponent<FortifierAlt>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Mk.2");
			GunExt.SetLongDescription((PickupObject)(object)val, "Fires wall-mounted turrets. Compatible with Modular Upgrade Software.\n\nThe perfect defense? An even better offense.");
			val.SetupSprite(StaticCollections.Gun_Collection, "turretplaceralt_idle_001");
			((BraveBehaviour)val).spriteAnimator.Library = StaticCollections.Gun_Animation;
			((BraveBehaviour)val).sprite.SortingOrder = 1;
			val.idleAnimation = "turretplaceralt_idle";
			val.shootAnimation = "turretplaceralt_fire";
			val.reloadAnimation = "turretplaceralt_reload";
			val.introAnimation = "turretplaceralt_intro";
			((PickupObject)val).PersistsOnDeath = true;
			((PickupObject)val).PreventStartingOwnerFromDropping = true;
			PickupObject byId = PickupObjectDatabase.GetById(56);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			ModularGunController modularGunController = ((Component)val).gameObject.AddComponent<ModularGunController>();
			modularGunController.isAlt = true;
			val.DefaultModule.ammoCost = 1;
			val.DefaultModule.shootStyle = (ShootStyle)1;
			val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
			ref string gunSwitchGroup = ref val.gunSwitchGroup;
			PickupObject byId2 = PickupObjectDatabase.GetById(156);
			gunSwitchGroup = ((Gun)((byId2 is Gun) ? byId2 : null)).gunSwitchGroup;
			val.reloadTime = 6.5f;
			val.DefaultModule.cooldownTime = 5f;
			val.DefaultModule.numberOfShotsInClip = 1;
			val.SetBaseMaxAmmo(250);
			val.DefaultModule.angleVariance = 0f;
			val.InfiniteAmmo = true;
			((PickupObject)val).quality = (ItemQuality)(-100);
			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;
			ref string objectImpactEventName = ref val2.objectImpactEventName;
			PickupObject byId3 = PickupObjectDatabase.GetById(334);
			objectImpactEventName = ((Gun)((byId3 is Gun) ? byId3 : null)).DefaultModule.projectiles[0].objectImpactEventName;
			ref string enemyImpactEventName = ref val2.enemyImpactEventName;
			PickupObject byId4 = PickupObjectDatabase.GetById(334);
			enemyImpactEventName = ((Gun)((byId4 is Gun) ? byId4 : null)).DefaultModule.projectiles[0].enemyImpactEventName;
			ref VFXPool tileMapHorizontal = ref val2.hitEffects.tileMapHorizontal;
			PickupObject byId5 = PickupObjectDatabase.GetById(223);
			tileMapHorizontal = Toolbox.MakeObjectIntoVFX(((Gun)((byId5 is Gun) ? byId5 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool tileMapVertical = ref val2.hitEffects.tileMapVertical;
			PickupObject byId6 = PickupObjectDatabase.GetById(223);
			tileMapVertical = Toolbox.MakeObjectIntoVFX(((Gun)((byId6 is Gun) ? byId6 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool enemy = ref val2.hitEffects.enemy;
			PickupObject byId7 = PickupObjectDatabase.GetById(223);
			enemy = Toolbox.MakeObjectIntoVFX(((Gun)((byId7 is Gun) ? byId7 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool deathAny = ref val2.hitEffects.deathAny;
			PickupObject byId8 = PickupObjectDatabase.GetById(223);
			deathAny = Toolbox.MakeObjectIntoVFX(((Gun)((byId8 is Gun) ? byId8 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			val2.AnimateProjectileBundle("turretidlealt", StaticCollections.Projectile_Collection, StaticCollections.Projectile_Animation, "turretidlealt", new List<IntVector2>
			{
				new IntVector2(8, 8),
				new IntVector2(8, 8),
				new IntVector2(8, 8),
				new IntVector2(8, 8),
				new IntVector2(8, 8),
				new IntVector2(8, 8)
			}, ProjectileToolbox.ConstructListOfSameValues(value: true, 6), ProjectileToolbox.ConstructListOfSameValues<Anchor>((Anchor)4, 6), ProjectileToolbox.ConstructListOfSameValues(value: true, 6), ProjectileToolbox.ConstructListOfSameValues(value: false, 6), ProjectileToolbox.ConstructListOfSameValues<Vector3?>(null, 6), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 6), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 6), ProjectileToolbox.ConstructListOfSameValues<Projectile>(null, 6));
			Material val3 = new Material(((BraveBehaviour)((BraveBehaviour)EnemyDatabase.GetOrLoadByName("GunNut")).sprite).renderer.material);
			val3.SetColor("_EmissiveColor", Color32.op_Implicit(new Color32((byte)0, byte.MaxValue, (byte)54, byte.MaxValue)));
			val3.SetFloat("_EmissiveColorPower", 10f);
			val3.SetFloat("_EmissivePower", 10f);
			val3.SetFloat("_EmissiveThresholdSensitivity", 0.2f);
			val3.SetTexture("_MainTex", ((BraveBehaviour)((BraveBehaviour)val2).sprite).renderer.material.GetTexture("_MainTex"));
			((BraveBehaviour)((BraveBehaviour)val2).sprite).renderer.material = val3;
			val2.baseData.speed = 45f;
			val2.baseData.damage = 15f;
			val2.shouldRotate = false;
			val2.baseData.range = 100000f;
			Projectile val4 = Object.Instantiate<Projectile>(val.DefaultModule.projectiles[0]);
			((Component)val4).gameObject.SetActive(false);
			FakePrefab.MarkAsFakePrefab(((Component)val4).gameObject);
			Object.DontDestroyOnLoad((Object)(object)val4);
			ref string objectImpactEventName2 = ref val4.objectImpactEventName;
			PickupObject byId9 = PickupObjectDatabase.GetById(334);
			objectImpactEventName2 = ((Gun)((byId9 is Gun) ? byId9 : null)).DefaultModule.projectiles[0].objectImpactEventName;
			ref string enemyImpactEventName2 = ref val4.enemyImpactEventName;
			PickupObject byId10 = PickupObjectDatabase.GetById(334);
			enemyImpactEventName2 = ((Gun)((byId10 is Gun) ? byId10 : null)).DefaultModule.projectiles[0].enemyImpactEventName;
			ref VFXPool tileMapHorizontal2 = ref val4.hitEffects.tileMapHorizontal;
			PickupObject byId11 = PickupObjectDatabase.GetById(223);
			tileMapHorizontal2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId11 is Gun) ? byId11 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool tileMapVertical2 = ref val4.hitEffects.tileMapVertical;
			PickupObject byId12 = PickupObjectDatabase.GetById(223);
			tileMapVertical2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId12 is Gun) ? byId12 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool enemy2 = ref val4.hitEffects.enemy;
			PickupObject byId13 = PickupObjectDatabase.GetById(223);
			enemy2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId13 is Gun) ? byId13 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool deathAny2 = ref val4.hitEffects.deathAny;
			PickupObject byId14 = PickupObjectDatabase.GetById(223);
			deathAny2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId14 is Gun) ? byId14 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			val4.baseData.damage = 10f;
			val4.baseData.speed = 35f;
			val4.baseData.range = 10000f;
			val4.shouldRotate = true;
			ImprovedAfterImage improvedAfterImage = ((Component)val4).gameObject.AddComponent<ImprovedAfterImage>();
			improvedAfterImage.spawnShadows = true;
			improvedAfterImage.shadowLifetime = 0.75f;
			improvedAfterImage.shadowTimeDelay = 0.05f;
			improvedAfterImage.dashColor = new Color(0f, 0.5f, 0f, 1f);
			Material val5 = new Material(ShaderCache.Acquire("Brave/LitTk2dCustomFalloffTiltedCutoutEmissive"));
			val5.EnableKeyword("BRIGHTNESS_CLAMP_ON");
			val5.SetFloat("_EmissivePower", 20f);
			val5.SetFloat("_EmissiveColorPower", 20f);
			((BraveBehaviour)((BraveBehaviour)val4).sprite).renderer.material = val5;
			val4.AnimateProjectileBundle("longshotalt_idle", StaticCollections.Projectile_Collection, StaticCollections.Projectile_Animation, "longshot_idle", new List<IntVector2>
			{
				new IntVector2(14, 5),
				new IntVector2(14, 5)
			}, ProjectileToolbox.ConstructListOfSameValues(value: true, 2), ProjectileToolbox.ConstructListOfSameValues<Anchor>((Anchor)4, 2), ProjectileToolbox.ConstructListOfSameValues(value: true, 2), ProjectileToolbox.ConstructListOfSameValues(value: false, 2), ProjectileToolbox.ConstructListOfSameValues<Vector3?>(null, 2), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 2), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 2), ProjectileToolbox.ConstructListOfSameValues<Projectile>(null, 2));
			ExplosiveModifier orAddComponent = GameObjectExtensions.GetOrAddComponent<ExplosiveModifier>(((Component)val2).gameObject);
			orAddComponent.explosionData = new ExplosionData
			{
				breakSecretWalls = false,
				comprehensiveDelay = 0f,
				damage = 12f,
				damageRadius = 2.5f,
				damageToPlayer = 0f,
				debrisForce = 40f,
				doDamage = true,
				doDestroyProjectiles = false,
				doExplosionRing = false,
				doForce = true,
				doScreenShake = false,
				doStickyFriction = false,
				effect = StaticExplosionDatas.genericLargeExplosion.effect,
				explosionDelay = 0f,
				force = 4f,
				forcePreventSecretWallDamage = false,
				forceUseThisRadius = true,
				freezeEffect = null,
				freezeRadius = 0f,
				IsChandelierExplosion = false,
				isFreezeExplosion = false,
				playDefaultSFX = true,
				preventPlayerForce = false,
				pushRadius = 1f,
				secretWallsRadius = 1f
			};
			orAddComponent.doExplosion = true;
			orAddComponent.IgnoreQueues = true;
			PierceProjModifier orAddComponent2 = GameObjectExtensions.GetOrAddComponent<PierceProjModifier>(((Component)val2).gameObject);
			orAddComponent2.penetration += 1000;
			val2.pierceMinorBreakables = true;
			TurretComponent orAddComponent3 = GameObjectExtensions.GetOrAddComponent<TurretComponent>(((Component)val2).gameObject);
			orAddComponent3.materialToCopy = val3;
			ref GameObject muzzleFlashPrefab = ref orAddComponent3.muzzleFlashPrefab;
			PickupObject byId15 = PickupObjectDatabase.GetById(153);
			muzzleFlashPrefab = ((Gun)((byId15 is Gun) ? byId15 : null)).muzzleFlashEffects.effects[0].effects[0].effect;
			TurretComponent.projectileToFireAlt = val4;
			((Component)val2).gameObject.AddComponent<StickyProjectileModifier>();
			ImprovedAfterImage improvedAfterImage2 = ((Component)val2).gameObject.AddComponent<ImprovedAfterImage>();
			improvedAfterImage2.spawnShadows = true;
			improvedAfterImage2.shadowLifetime = 0.5f;
			improvedAfterImage2.shadowTimeDelay = 0.01f;
			improvedAfterImage2.dashColor = new Color(0.85f, 0.85f, 0.85f, 1f);
			val.gunClass = (GunClass)0;
			val.DefaultModule.ammoType = (AmmoType)14;
			val.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("TurretBallAlt", StaticCollections.Clip_Ammo_Atlas, "turretalt_1", "turretalt_2", (AmmoType)14);
			val.AddGlowShaderToGun(new Color32((byte)0, byte.MaxValue, (byte)54, byte.MaxValue), 3, 3);
			val.gunHandedness = (GunHandedness)3;
			val.carryPixelOffset = new IntVector2(1, -1);
			ref VFXPool muzzleFlashEffects = ref val.muzzleFlashEffects;
			PickupObject byId16 = PickupObjectDatabase.GetById(370);
			muzzleFlashEffects = ((Gun)((byId16 is Gun) ? byId16 : null)).muzzleFlashEffects;
			val.muzzleOffset = Toolbox.GenerateTransformPoint(((Component)val).gameObject, new Vector2(0.5f, 0.5f), "muzzle_point").transform;
			val.barrelOffset = Toolbox.GenerateTransformPoint(((Component)val).gameObject, new Vector2(0.5f, 0.5f), "barrel_point").transform;
			val.IsMinusOneGun = true;
			Databases.Items.Add((PickupObject)(object)val, false, "ANY");
			GunID = ((PickupObject)val).PickupObjectId;
			IteratedDesign.SpecialProcessGunSpecificReload = (Func<float, int, ModulePrinterCore, PlayerController, float>)Delegate.Combine(IteratedDesign.SpecialProcessGunSpecificReload, new Func<float, int, ModulePrinterCore, PlayerController, float>(@object.ProcessFireRateSpecial));
		}

		public float ProcessFireRateSpecial(float f, int stack, ModulePrinterCore modulePrinterCore, PlayerController player)
		{
			if (((PickupObject)modulePrinterCore.ModularGunController.gun).PickupObjectId != GunID)
			{
				return f;
			}
			return f / (float)(1 + stack / 4);
		}

		public void Start()
		{
			base.gun.IsMinusOneGun = true;
		}
	}
	public class Fortifier : GunBehaviour
	{
		public static int GunID;

		public static void Init()
		{
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0374: Unknown result type (might be due to invalid IL or missing references)
			//IL_0382: Unknown result type (might be due to invalid IL or missing references)
			//IL_0390: Unknown result type (might be due to invalid IL or missing references)
			//IL_039e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Unknown result type (might be due to invalid IL or missing references)
			//IL_043e: Expected O, but got Unknown
			//IL_0456: Unknown result type (might be due to invalid IL or missing references)
			//IL_045b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0769: Unknown result type (might be due to invalid IL or missing references)
			//IL_076e: Unknown result type (might be due to invalid IL or missing references)
			//IL_077d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0784: Expected O, but got Unknown
			//IL_07e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_086a: Unknown result type (might be due to invalid IL or missing references)
			//IL_086f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0876: Unknown result type (might be due to invalid IL or missing references)
			//IL_0881: Unknown result type (might be due to invalid IL or missing references)
			//IL_088c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0897: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0904: Unknown result type (might be due to invalid IL or missing references)
			//IL_090b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0912: Unknown result type (might be due to invalid IL or missing references)
			//IL_091d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0924: Unknown result type (might be due to invalid IL or missing references)
			//IL_092b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0932: Unknown result type (might be due to invalid IL or missing references)
			//IL_0939: Unknown result type (might be due to invalid IL or missing references)
			//IL_0944: Unknown result type (might be due to invalid IL or missing references)
			//IL_0954: Expected O, but got Unknown
			//IL_0a25: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a31: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a7b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a94: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a99: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af3: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("Fortifier", "turretplacer");
			Game.Items.Rename("outdated_gun_mods:fortifier", "mdl:armcannon_15");
			Fortifier @object = ((Component)val).gameObject.AddComponent<Fortifier>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Mk.1");
			GunExt.SetLongDescription((PickupObject)(object)val, "Fires wall-mounted turrets. Compatible with Modular Upgrade Software.\n\nThe perfect defense? An even better offense.");
			val.SetupSprite(StaticCollections.Gun_Collection, "turretplace_reload_001");
			((BraveBehaviour)val).spriteAnimator.Library = StaticCollections.Gun_Animation;
			((BraveBehaviour)val).sprite.SortingOrder = 1;
			val.idleAnimation = "turretplacer_idle";
			val.shootAnimation = "turretplacer_fire";
			val.reloadAnimation = "turretplacer_reload";
			val.introAnimation = "turretplacer_intro";
			((PickupObject)val).PersistsOnDeath = true;
			((PickupObject)val).PreventStartingOwnerFromDropping = true;
			PickupObject byId = PickupObjectDatabase.GetById(56);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			ModularGunController modularGunController = ((Component)val).gameObject.AddComponent<ModularGunController>();
			modularGunController.isAlt = false;
			val.DefaultModule.ammoCost = 1;
			val.DefaultModule.shootStyle = (ShootStyle)1;
			val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
			ref string gunSwitchGroup = ref val.gunSwitchGroup;
			PickupObject byId2 = PickupObjectDatabase.GetById(156);
			gunSwitchGroup = ((Gun)((byId2 is Gun) ? byId2 : null)).gunSwitchGroup;
			val.reloadTime = 6.5f;
			val.DefaultModule.cooldownTime = 5f;
			val.DefaultModule.numberOfShotsInClip = 1;
			val.SetBaseMaxAmmo(250);
			val.DefaultModule.angleVariance = 0f;
			val.InfiniteAmmo = true;
			((PickupObject)val).quality = (ItemQuality)(-50);
			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;
			ref string objectImpactEventName = ref val2.objectImpactEventName;
			PickupObject byId3 = PickupObjectDatabase.GetById(334);
			objectImpactEventName = ((Gun)((byId3 is Gun) ? byId3 : null)).DefaultModule.projectiles[0].objectImpactEventName;
			ref string enemyImpactEventName = ref val2.enemyImpactEventName;
			PickupObject byId4 = PickupObjectDatabase.GetById(334);
			enemyImpactEventName = ((Gun)((byId4 is Gun) ? byId4 : null)).DefaultModule.projectiles[0].enemyImpactEventName;
			ref VFXPool tileMapHorizontal = ref val2.hitEffects.tileMapHorizontal;
			PickupObject byId5 = PickupObjectDatabase.GetById(223);
			tileMapHorizontal = Toolbox.MakeObjectIntoVFX(((Gun)((byId5 is Gun) ? byId5 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool tileMapVertical = ref val2.hitEffects.tileMapVertical;
			PickupObject byId6 = PickupObjectDatabase.GetById(223);
			tileMapVertical = Toolbox.MakeObjectIntoVFX(((Gun)((byId6 is Gun) ? byId6 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool enemy = ref val2.hitEffects.enemy;
			PickupObject byId7 = PickupObjectDatabase.GetById(223);
			enemy = Toolbox.MakeObjectIntoVFX(((Gun)((byId7 is Gun) ? byId7 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool deathAny = ref val2.hitEffects.deathAny;
			PickupObject byId8 = PickupObjectDatabase.GetById(223);
			deathAny = Toolbox.MakeObjectIntoVFX(((Gun)((byId8 is Gun) ? byId8 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			val2.AnimateProjectileBundle("turretidle", StaticCollections.Projectile_Collection, StaticCollections.Projectile_Animation, "turretidle", new List<IntVector2>
			{
				new IntVector2(8, 8),
				new IntVector2(8, 8),
				new IntVector2(8, 8),
				new IntVector2(8, 8),
				new IntVector2(8, 8),
				new IntVector2(8, 8)
			}, ProjectileToolbox.ConstructListOfSameValues(value: true, 6), ProjectileToolbox.ConstructListOfSameValues<Anchor>((Anchor)4, 6), ProjectileToolbox.ConstructListOfSameValues(value: true, 6), ProjectileToolbox.ConstructListOfSameValues(value: false, 6), ProjectileToolbox.ConstructListOfSameValues<Vector3?>(null, 6), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 6), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 6), ProjectileToolbox.ConstructListOfSameValues<Projectile>(null, 6));
			Material val3 = new Material(((BraveBehaviour)((BraveBehaviour)EnemyDatabase.GetOrLoadByName("GunNut")).sprite).renderer.material);
			val3.SetColor("_EmissiveColor", Color32.op_Implicit(new Color32((byte)121, (byte)234, byte.MaxValue, byte.MaxValue)));
			val3.SetFloat("_EmissiveColorPower", 10f);
			val3.SetFloat("_EmissivePower", 10f);
			val3.SetFloat("_EmissiveThresholdSensitivity", 0.2f);
			val3.SetTexture("_MainTex", ((BraveBehaviour)((BraveBehaviour)val2).sprite).renderer.material.GetTexture("_MainTex"));
			((BraveBehaviour)((BraveBehaviour)val2).sprite).renderer.material = val3;
			val2.baseData.speed = 45f;
			val2.baseData.damage = 15f;
			val2.shouldRotate = false;
			val2.baseData.range = 100000f;
			Projectile val4 = Object.Instantiate<Projectile>(val.DefaultModule.projectiles[0]);
			((Component)val4).gameObject.SetActive(false);
			FakePrefab.MarkAsFakePrefab(((Component)val4).gameObject);
			Object.DontDestroyOnLoad((Object)(object)val4);
			ref string objectImpactEventName2 = ref val4.objectImpactEventName;
			PickupObject byId9 = PickupObjectDatabase.GetById(334);
			objectImpactEventName2 = ((Gun)((byId9 is Gun) ? byId9 : null)).DefaultModule.projectiles[0].objectImpactEventName;
			ref string enemyImpactEventName2 = ref val4.enemyImpactEventName;
			PickupObject byId10 = PickupObjectDatabase.GetById(334);
			enemyImpactEventName2 = ((Gun)((byId10 is Gun) ? byId10 : null)).DefaultModule.projectiles[0].enemyImpactEventName;
			ref VFXPool tileMapHorizontal2 = ref val4.hitEffects.tileMapHorizontal;
			PickupObject byId11 = PickupObjectDatabase.GetById(223);
			tileMapHorizontal2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId11 is Gun) ? byId11 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool tileMapVertical2 = ref val4.hitEffects.tileMapVertical;
			PickupObject byId12 = PickupObjectDatabase.GetById(223);
			tileMapVertical2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId12 is Gun) ? byId12 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool enemy2 = ref val4.hitEffects.enemy;
			PickupObject byId13 = PickupObjectDatabase.GetById(223);
			enemy2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId13 is Gun) ? byId13 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool deathAny2 = ref val4.hitEffects.deathAny;
			PickupObject byId14 = PickupObjectDatabase.GetById(223);
			deathAny2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId14 is Gun) ? byId14 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			val4.baseData.damage = 10f;
			val4.baseData.speed = 35f;
			val4.baseData.range = 10000f;
			val4.shouldRotate = true;
			ImprovedAfterImage improvedAfterImage = ((Component)val4).gameObject.AddComponent<ImprovedAfterImage>();
			improvedAfterImage.spawnShadows = true;
			improvedAfterImage.shadowLifetime = 0.75f;
			improvedAfterImage.shadowTimeDelay = 0.05f;
			improvedAfterImage.dashColor = new Color(0f, 0.5f, 0.5f, 1f);
			Material val5 = new Material(ShaderCache.Acquire("Brave/LitTk2dCustomFalloffTiltedCutoutEmissive"));
			val5.EnableKeyword("BRIGHTNESS_CLAMP_ON");
			val5.SetFloat("_EmissivePower", 20f);
			val5.SetFloat("_EmissiveColorPower", 20f);
			((BraveBehaviour)((BraveBehaviour)val4).sprite).renderer.material = val5;
			val4.AnimateProjectileBundle("longshot_idle", StaticCollections.Projectile_Collection, StaticCollections.Projectile_Animation, "longshot_idle", new List<IntVector2>
			{
				new IntVector2(14, 5),
				new IntVector2(14, 5)
			}, ProjectileToolbox.ConstructListOfSameValues(value: true, 2), ProjectileToolbox.ConstructListOfSameValues<Anchor>((Anchor)4, 2), ProjectileToolbox.ConstructListOfSameValues(value: true, 2), ProjectileToolbox.ConstructListOfSameValues(value: false, 2), ProjectileToolbox.ConstructListOfSameValues<Vector3?>(null, 2), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 2), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 2), ProjectileToolbox.ConstructListOfSameValues<Projectile>(null, 2));
			ExplosiveModifier orAddComponent = GameObjectExtensions.GetOrAddComponent<ExplosiveModifier>(((Component)val2).gameObject);
			orAddComponent.explosionData = new ExplosionData
			{
				breakSecretWalls = false,
				comprehensiveDelay = 0f,
				damage = 12f,
				damageRadius = 2.5f,
				damageToPlayer = 0f,
				debrisForce = 40f,
				doDamage = true,
				doDestroyProjectiles = false,
				doExplosionRing = false,
				doForce = true,
				doScreenShake = false,
				doStickyFriction = false,
				effect = StaticExplosionDatas.genericLargeExplosion.effect,
				explosionDelay = 0f,
				force = 4f,
				forcePreventSecretWallDamage = false,
				forceUseThisRadius = true,
				freezeEffect = null,
				freezeRadius = 0f,
				IsChandelierExplosion = false,
				isFreezeExplosion = false,
				playDefaultSFX = true,
				preventPlayerForce = false,
				pushRadius = 1f,
				secretWallsRadius = 1f
			};
			orAddComponent.doExplosion = true;
			orAddComponent.IgnoreQueues = true;
			PierceProjModifier orAddComponent2 = GameObjectExtensions.GetOrAddComponent<PierceProjModifier>(((Component)val2).gameObject);
			orAddComponent2.penetration += 1000;
			val2.pierceMinorBreakables = true;
			TurretComponent orAddComponent3 = GameObjectExtensions.GetOrAddComponent<TurretComponent>(((Component)val2).gameObject);
			orAddComponent3.materialToCopy = val3;
			ref GameObject muzzleFlashPrefab = ref orAddComponent3.muzzleFlashPrefab;
			PickupObject byId15 = PickupObjectDatabase.GetById(153);
			muzzleFlashPrefab = ((Gun)((byId15 is Gun) ? byId15 : null)).muzzleFlashEffects.effects[0].effects[0].effect;
			TurretComponent.projectileToFire = val4;
			((Component)val2).gameObject.AddComponent<StickyProjectileModifier>();
			ImprovedAfterImage improvedAfterImage2 = ((Component)val2).gameObject.AddComponent<ImprovedAfterImage>();
			improvedAfterImage2.spawnShadows = true;
			improvedAfterImage2.shadowLifetime = 0.5f;
			improvedAfterImage2.shadowTimeDelay = 0.01f;
			improvedAfterImage2.dashColor = new Color(0.85f, 0.85f, 0.85f, 1f);
			val.gunClass = (GunClass)0;
			val.DefaultModule.ammoType = (AmmoType)14;
			val.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("TurretBall", StaticCollections.Clip_Ammo_Atlas, "turret_1", "turret_2", (AmmoType)14);
			val.AddGlowShaderToGun(new Color32((byte)121, (byte)234, byte.MaxValue, byte.MaxValue), 10, 10);
			val.gunHandedness = (GunHandedness)3;
			val.carryPixelOffset = new IntVector2(1, -1);
			ref VFXPool muzzleFlashEffects = ref val.muzzleFlashEffects;
			PickupObject byId16 = PickupObjectDatabase.GetById(370);
			muzzleFlashEffects = ((Gun)((byId16 is Gun) ? byId16 : null)).muzzleFlashEffects;
			val.muzzleOffset = Toolbox.GenerateTransformPoint(((Component)val).gameObject, new Vector2(0.5f, 0.5f), "muzzle_point").transform;
			val.barrelOffset = Toolbox.GenerateTransformPoint(((Component)val).gameObject, new Vector2(0.5f, 0.5f), "barrel_point").transform;
			val.IsMinusOneGun = true;
			Databases.Items.Add((PickupObject)(object)val, false, "ANY");
			GunID = ((PickupObject)val).PickupObjectId;
			IteratedDesign.SpecialProcessGunSpecificReload = (Func<float, int, ModulePrinterCore, PlayerController, float>)Delegate.Combine(IteratedDesign.SpecialProcessGunSpecificReload, new Func<float, int, ModulePrinterCore, PlayerController, float>(@object.ProcessFireRateSpecial));
		}

		public float ProcessFireRateSpecial(float f, int stack, ModulePrinterCore modulePrinterCore, PlayerController player)
		{
			if (((PickupObject)modulePrinterCore.ModularGunController.gun).PickupObjectId != GunID)
			{
				return f;
			}
			return f / (float)(1 + stack / 4);
		}

		public void Start()
		{
			base.gun.IsMinusOneGun = true;
		}
	}
	public class ShieldGeneratorAlt : GunBehaviour
	{
		public static int GunID;

		public static void Init()
		{
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: 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_02f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0303: 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)
			//IL_0323: Unknown result type (might be due to invalid IL or missing references)
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_0343: Unknown result type (might be due to invalid IL or missing references)
			//IL_0353: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03df: Expected O, but got Unknown
			//IL_0417: Unknown result type (might be due to invalid IL or missing references)
			//IL_041c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0719: Unknown result type (might be due to invalid IL or missing references)
			//IL_071e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0790: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0800: Unknown result type (might be due to invalid IL or missing references)
			//IL_0810: Unknown result type (might be due to invalid IL or missing references)
			//IL_0820: Unknown result type (might be due to invalid IL or missing references)
			//IL_0830: Unknown result type (might be due to invalid IL or missing references)
			//IL_0840: Unknown result type (might be due to invalid IL or missing references)
			//IL_0850: Unknown result type (might be due to invalid IL or missing references)
			//IL_0860: Unknown result type (might be due to invalid IL or missing references)
			//IL_0870: Unknown result type (might be due to invalid IL or missing references)
			//IL_0880: Unknown result type (might be due to invalid IL or missing references)
			//IL_0890: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0925: Unknown result type (might be due to invalid IL or missing references)
			//IL_092c: Expected O, but got Unknown
			//IL_0964: Unknown result type (might be due to invalid IL or missing references)
			//IL_0969: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c96: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c9b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cb7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc0: Expected O, but got Unknown
			//IL_0cc0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ccd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce1: Expected O, but got Unknown
			//IL_0d0b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d38: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d4b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d5a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d62: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d67: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d97: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dc1: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("Barrier Builder", "barrierbuilderalt");
			Game.Items.Rename("outdated_gun_mods:barrier_builder", "mdl:armcannon_14_alt");
			ShieldGeneratorAlt shieldGeneratorAlt = ((Component)val).gameObject.AddComponent<ShieldGeneratorAlt>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Mk.2");
			GunExt.SetLongDescription((PickupObject)(object)val, "Creates energy cubes that projectiles stick to. Compatible with Modular Upgrade Software.\n\nUsing hardlight technology as a weapon? What next?");
			val.SetupSprite(StaticCollections.Gun_Collection, "sheildgenalt_idle_004");
			((BraveBehaviour)val).spriteAnimator.Library = StaticCollections.Gun_Animation;
			((BraveBehaviour)val).sprite.SortingOrder = 1;
			val.idleAnimation = "shieldgenalt_idle";
			val.shootAnimation = "shieldgenalt_fire";
			val.reloadAnimation = "shieldgenalt_reload";
			val.introAnimation = "shieldgenalt_intro";
			val.chargeAnimation = "shieldgenalt_charge";
			((PickupObject)val).PersistsOnDeath = true;
			((PickupObject)val).PreventStartingOwnerFromDropping = true;
			PickupObject byId = PickupObjectDatabase.GetById(57);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			Tk2dSpriteAnimatorUtility.AddSoundsToAnimationFrame(((Component)val).GetComponent<tk2dSpriteAnimator>(), val.chargeAnimation, new Dictionary<int, string>
			{
				{ 5, "Play_BOSS_cannon_stop_01" },
				{ 6, "Play_BOSS_cyborg_charge_01" },
				{ 15, "Play_WPN_thor_charge_01" },
				{ 19, "Play_OBJ_mine_beep_01" }
			});
			Tk2dSpriteAnimatorUtility.AddSoundsToAnimationFrame(((Component)val).GetComponent<tk2dSpriteAnimator>(), val.shootAnimation, new Dictionary<int, string> { { 0, "Play_ITM_Macho_Brace_Trigger_01" } });
			Tk2dSpriteAnimatorUtility.AddSoundsToAnimationFrame(((Component)val).GetComponent<tk2dSpriteAnimator>(), val.reloadAnimation, new Dictionary<int, string>
			{
				{ 0, "Play_BOSS_omegaBeam_fade_01" },
				{ 6, "Play_BOSS_hatch_open_01" },
				{ 13, "Play_BOSS_lasthuman_torch_01" }
			});
			ModularGunController modularGunController = ((Component)val).gameObject.AddComponent<ModularGunController>();
			modularGunController.isAlt = true;
			val.DefaultModule.ammoCost = 1;
			val.DefaultModule.shootStyle = (ShootStyle)3;
			val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
			ref string gunSwitchGroup = ref val.gunSwitchGroup;
			PickupObject byId2 = PickupObjectDatabase.GetById(21);
			gunSwitchGroup = ((Gun)((byId2 is Gun) ? byId2 : null)).gunSwitchGroup;
			val.reloadTime = 4.5f;
			val.DefaultModule.cooldownTime = 0.35f;
			val.DefaultModule.numberOfShotsInClip = 6;
			val.SetBaseMaxAmmo(250);
			val.DefaultModule.angleVariance = 6f;
			val.InfiniteAmmo = true;
			((PickupObject)val).quality = (ItemQuality)(-100);
			Projectile val2 = Object.Instantiate<Projectile>(val.DefaultModule.projectiles[0]);
			((Component)val2).gameObject.SetActive(false);
			((Object)((Component)val2).gameObject).name = "EnergyCube_Small";
			FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject);
			Object.DontDestroyOnLoad((Object)(object)val2);
			val.DefaultModule.projectiles[0] = val2;
			val2.AnimateProjectileBundle("energycube_small_alt", StaticCollections.Projectile_Collection, StaticCollections.Projectile_Animation, "energycube_small_alt", new List<IntVector2>
			{
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15)
			}, ProjectileToolbox.ConstructListOfSameValues(value: true, 12), ProjectileToolbox.ConstructListOfSameValues<Anchor>((Anchor)4, 12), ProjectileToolbox.ConstructListOfSameValues(value: true, 12), ProjectileToolbox.ConstructListOfSameValues(value: false, 12), ProjectileToolbox.ConstructListOfSameValues<Vector3?>(null, 12), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 12), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 12), ProjectileToolbox.ConstructListOfSameValues<Projectile>(null, 12));
			Material val3 = new Material(((BraveBehaviour)((BraveBehaviour)EnemyDatabase.GetOrLoadByName("GunNut")).sprite).renderer.material);
			val3.mainTexture = ((BraveBehaviour)((BraveBehaviour)val2).sprite).renderer.material.mainTexture;
			val3.SetColor("_EmissiveColor", Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue)));
			val3.SetFloat("_EmissiveColorPower", 100f);
			val3.SetFloat("_EmissivePower", 100f);
			((BraveBehaviour)((BraveBehaviour)val2).sprite).renderer.material = val3;
			val2.baseData.speed = 7f;
			val2.baseData.damage = 3f;
			val2.shouldRotate = false;
			val2.baseData.force = 3f;
			val2.collidesWithProjectiles = true;
			val2.projectileHitHealth = 5;
			val2.baseData.UsesCustomAccelerationCurve = true;
			val2.baseData.AccelerationCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0.033f);
			ProjectileData baseData = val2.baseData;
			baseData.range *= 1.2f;
			((Component)val2).gameObject.AddComponent<BeamCollisionEvent>();
			ref string objectImpactEventName = ref val2.objectImpactEventName;
			PickupObject byId3 = PickupObjectDatabase.GetById(504);
			objectImpactEventName = ((Gun)((byId3 is Gun) ? byId3 : null)).DefaultModule.projectiles[0].objectImpactEventName;
			ref string enemyImpactEventName = ref val2.enemyImpactEventName;
			PickupObject byId4 = PickupObjectDatabase.GetById(504);
			enemyImpactEventName = ((Gun)((byId4 is Gun) ? byId4 : null)).DefaultModule.projectiles[0].enemyImpactEventName;
			ref VFXPool tileMapHorizontal = ref val2.hitEffects.tileMapHorizontal;
			PickupObject byId5 = PickupObjectDatabase.GetById(223);
			tileMapHorizontal = Toolbox.MakeObjectIntoVFX(((Gun)((byId5 is Gun) ? byId5 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool tileMapVertical = ref val2.hitEffects.tileMapVertical;
			PickupObject byId6 = PickupObjectDatabase.GetById(223);
			tileMapVertical = Toolbox.MakeObjectIntoVFX(((Gun)((byId6 is Gun) ? byId6 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool enemy = ref val2.hitEffects.enemy;
			PickupObject byId7 = PickupObjectDatabase.GetById(223);
			enemy = Toolbox.MakeObjectIntoVFX(((Gun)((byId7 is Gun) ? byId7 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool deathAny = ref val2.hitEffects.deathAny;
			PickupObject byId8 = PickupObjectDatabase.GetById(223);
			deathAny = Toolbox.MakeObjectIntoVFX(((Gun)((byId8 is Gun) ? byId8 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ShieldEater shieldEater = ((Component)val2).gameObject.AddComponent<ShieldEater>();
			((Component)val2).gameObject.AddComponent<MaintainDamageOnPierce>();
			PierceProjModifier orAddComponent = GameObjectExtensions.GetOrAddComponent<PierceProjModifier>(((Component)val2).gameObject);
			orAddComponent.penetration = 100;
			BounceProjModifier orAddComponent2 = GameObjectExtensions.GetOrAddComponent<BounceProjModifier>(((Component)val2).gameObject);
			orAddComponent2.numberOfBounces = 3;
			ImprovedAfterImage improvedAfterImage = ((Component)val2).gameObject.AddComponent<ImprovedAfterImage>();
			improvedAfterImage.spawnShadows = true;
			improvedAfterImage.shadowLifetime = 0.5f;
			improvedAfterImage.shadowTimeDelay = 0.25f;
			improvedAfterImage.dashColor = new Color(0f, 0.7f, 0.7f, 1f);
			Projectile val4 = Object.Instantiate<Projectile>(val.DefaultModule.projectiles[0]);
			((Component)val4).gameObject.SetActive(false);
			((Object)((Component)val4).gameObject).name = "EnergyCube_Small";
			FakePrefab.MarkAsFakePrefab(((Component)val4).gameObject);
			Object.DontDestroyOnLoad((Object)(object)val4);
			val4.AnimateProjectileBundle("largecube_alt", StaticCollections.Projectile_Collection, StaticCollections.Projectile_Animation, "largecube_alt", new List<IntVector2>
			{
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30)
			}, ProjectileToolbox.ConstructListOfSameValues(value: true, 18), ProjectileToolbox.ConstructListOfSameValues<Anchor>((Anchor)4, 18), ProjectileToolbox.ConstructListOfSameValues(value: true, 18), ProjectileToolbox.ConstructListOfSameValues(value: false, 18), ProjectileToolbox.ConstructListOfSameValues<Vector3?>(null, 18), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 18), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 18), ProjectileToolbox.ConstructListOfSameValues<Projectile>(null, 18));
			Material material = new Material(((BraveBehaviour)((BraveBehaviour)EnemyDatabase.GetOrLoadByName("GunNut")).sprite).renderer.material);
			val3.mainTexture = ((BraveBehaviour)((BraveBehaviour)val2).sprite).renderer.material.mainTexture;
			val3.SetColor("_EmissiveColor", Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue)));
			val3.SetFloat("_EmissiveColorPower", 100f);
			val3.SetFloat("_EmissivePower", 100f);
			((BraveBehaviour)((BraveBehaviour)val4).sprite).renderer.material = material;
			val4.baseData.speed = 10f;
			val4.baseData.damage = 7f;
			val4.shouldRotate = false;
			val4.baseData.force = 5f;
			val4.collidesWithProjectiles = true;
			val4.projectileHitHealth = 15;
			val4.baseData.UsesCustomAccelerationCurve = true;
			val4.baseData.AccelerationCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0.05f);
			ProjectileData baseData2 = val4.baseData;
			baseData2.range *= 3f;
			ref string objectImpactEventName2 = ref val4.objectImpactEventName;
			PickupObject byId9 = PickupObjectDatabase.GetById(504);
			objectImpactEventName2 = ((Gun)((byId9 is Gun) ? byId9 : null)).DefaultModule.projectiles[0].objectImpactEventName;
			ref string enemyImpactEventName2 = ref val4.enemyImpactEventName;
			PickupObject byId10 = PickupObjectDatabase.GetById(504);
			enemyImpactEventName2 = ((Gun)((byId10 is Gun) ? byId10 : null)).DefaultModule.projectiles[0].enemyImpactEventName;
			((Component)val4).gameObject.AddComponent<BeamCollisionEvent>();
			ref VFXPool tileMapHorizontal2 = ref val4.hitEffects.tileMapHorizontal;
			PickupObject byId11 = PickupObjectDatabase.GetById(223);
			tileMapHorizontal2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId11 is Gun) ? byId11 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool tileMapVertical2 = ref val4.hitEffects.tileMapVertical;
			PickupObject byId12 = PickupObjectDatabase.GetById(223);
			tileMapVertical2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId12 is Gun) ? byId12 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool enemy2 = ref val4.hitEffects.enemy;
			PickupObject byId13 = PickupObjectDatabase.GetById(223);
			enemy2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId13 is Gun) ? byId13 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool deathAny2 = ref val4.hitEffects.deathAny;
			PickupObject byId14 = PickupObjectDatabase.GetById(223);
			deathAny2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId14 is Gun) ? byId14 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			((Component)val4).gameObject.AddComponent<MaintainDamageOnPierce>();
			ShieldBlock shieldBlock = ((Component)val4).gameObject.AddComponent<ShieldBlock>();
			shieldBlock.Range = 1.5f;
			PierceProjModifier orAddComponent3 = GameObjectExtensions.GetOrAddComponent<PierceProjModifier>(((Component)val4).gameObject);
			orAddComponent3.penetration = 100;
			((Component)val4).gameObject.AddComponent<MaintainDamageOnPierce>();
			BounceProjModifier orAddComponent4 = GameObjectExtensions.GetOrAddComponent<BounceProjModifier>(((Component)val4).gameObject);
			orAddComponent4.numberOfBounces = 5;
			ImprovedAfterImage improvedAfterImage2 = ((Component)val4).gameObject.AddComponent<ImprovedAfterImage>();
			improvedAfterImage2.spawnShadows = true;
			improvedAfterImage2.shadowLifetime = 0.5f;
			improvedAfterImage2.shadowTimeDelay = 0.25f;
			improvedAfterImage2.dashColor = new Color(0f, 0.7f, 0.7f, 1f);
			ChargeProjectile item = new ChargeProjectile
			{
				Projectile = val2,
				ChargeTime = 0.55f,
				AmmoCost = 1
			};
			ChargeProjectile item2 = new ChargeProjectile
			{
				Projectile = val4,
				ChargeTime = 1.85f,
				AmmoCost = 1
			};
			val.DefaultModule.chargeProjectiles = new List<ChargeProjectile> { item, item2 };
			val.DefaultModule.ammoType = (AmmoType)14;
			val.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("EnergyCubeAlt", StaticCollections.Clip_Ammo_Atlas, "cubealt_1", "cubealt_2", (AmmoType)14);
			val.gunClass = (GunClass)0;
			val.AddGlowShaderToGun(new Color32((byte)0, byte.MaxValue, (byte)54, byte.MaxValue), 3, 3);
			val.gunHandedness = (GunHandedness)3;
			val.carryPixelOffset = new IntVector2(4, 4);
			ref VFXPool muzzleFlashEffects = ref val.muzzleFlashEffects;
			PickupObject byId15 = PickupObjectDatabase.GetById(362);
			muzzleFlashEffects = ((Gun)((byId15 is Gun) ? byId15 : null)).muzzleFlashEffects;
			val.muzzleOffset = Toolbox.GenerateTransformPoint(((Component)val).gameObject, new Vector2(0.5f, 0.9375f), "muzzle_point").transform;
			val.barrelOffset = Toolbox.GenerateTransformPoint(((Component)val).gameObject, new Vector2(0.5f, 0.9375f), "barrel_point").transform;
			Databases.Items.Add((PickupObject)(object)val, false, "ANY");
			GunID = ((PickupObject)val).PickupObjectId;
		}
	}
	public class ShieldGenerator : GunBehaviour
	{
		public static int GunID;

		public static void Init()
		{
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: 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_02f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0303: 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)
			//IL_0323: Unknown result type (might be due to invalid IL or missing references)
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_0343: Unknown result type (might be due to invalid IL or missing references)
			//IL_0353: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03df: Expected O, but got Unknown
			//IL_0417: Unknown result type (might be due to invalid IL or missing references)
			//IL_041c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0719: Unknown result type (might be due to invalid IL or missing references)
			//IL_071e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0790: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0800: Unknown result type (might be due to invalid IL or missing references)
			//IL_0810: Unknown result type (might be due to invalid IL or missing references)
			//IL_0820: Unknown result type (might be due to invalid IL or missing references)
			//IL_0830: Unknown result type (might be due to invalid IL or missing references)
			//IL_0840: Unknown result type (might be due to invalid IL or missing references)
			//IL_0850: Unknown result type (might be due to invalid IL or missing references)
			//IL_0860: Unknown result type (might be due to invalid IL or missing references)
			//IL_0870: Unknown result type (might be due to invalid IL or missing references)
			//IL_0880: Unknown result type (might be due to invalid IL or missing references)
			//IL_0890: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0925: Unknown result type (might be due to invalid IL or missing references)
			//IL_092c: Expected O, but got Unknown
			//IL_0964: Unknown result type (might be due to invalid IL or missing references)
			//IL_0969: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c96: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c9b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cb7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc0: Expected O, but got Unknown
			//IL_0cc0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ccd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce1: Expected O, but got Unknown
			//IL_0d0b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d38: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d4f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d60: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d68: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d6d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d9d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dc7: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("Barrier Builder", "barrierbuilder");
			Game.Items.Rename("outdated_gun_mods:barrier_builder", "mdl:armcannon_14");
			ShieldGenerator @object = ((Component)val).gameObject.AddComponent<ShieldGenerator>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Mk.1");
			GunExt.SetLongDescription((PickupObject)(object)val, "Creates energy cubes that projectiles stick to. Compatible with Modular Upgrade Software.\n\nUsing hardlight technology as a weapon? What next?");
			val.SetupSprite(StaticCollections.Gun_Collection, "shieldgen_idle_004");
			((BraveBehaviour)val).spriteAnimator.Library = StaticCollections.Gun_Animation;
			((BraveBehaviour)val).sprite.SortingOrder = 1;
			val.idleAnimation = "shieldgen_idle";
			val.shootAnimation = "shieldgen_fire";
			val.reloadAnimation = "shieldgen_reload";
			val.introAnimation = "shieldgen_intro";
			val.chargeAnimation = "shieldgen_charge";
			((PickupObject)val).PersistsOnDeath = true;
			((PickupObject)val).PreventStartingOwnerFromDropping = true;
			PickupObject byId = PickupObjectDatabase.GetById(57);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			Tk2dSpriteAnimatorUtility.AddSoundsToAnimationFrame(((Component)val).GetComponent<tk2dSpriteAnimator>(), val.chargeAnimation, new Dictionary<int, string>
			{
				{ 5, "Play_BOSS_cannon_stop_01" },
				{ 6, "Play_BOSS_cyborg_charge_01" },
				{ 15, "Play_WPN_thor_charge_01" },
				{ 19, "Play_OBJ_mine_beep_01" }
			});
			Tk2dSpriteAnimatorUtility.AddSoundsToAnimationFrame(((Component)val).GetComponent<tk2dSpriteAnimator>(), val.shootAnimation, new Dictionary<int, string> { { 0, "Play_ITM_Macho_Brace_Trigger_01" } });
			Tk2dSpriteAnimatorUtility.AddSoundsToAnimationFrame(((Component)val).GetComponent<tk2dSpriteAnimator>(), val.reloadAnimation, new Dictionary<int, string>
			{
				{ 0, "Play_BOSS_omegaBeam_fade_01" },
				{ 6, "Play_BOSS_hatch_open_01" },
				{ 13, "Play_BOSS_lasthuman_torch_01" }
			});
			ModularGunController modularGunController = ((Component)val).gameObject.AddComponent<ModularGunController>();
			modularGunController.isAlt = false;
			val.DefaultModule.ammoCost = 1;
			val.DefaultModule.shootStyle = (ShootStyle)3;
			val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
			ref string gunSwitchGroup = ref val.gunSwitchGroup;
			PickupObject byId2 = PickupObjectDatabase.GetById(21);
			gunSwitchGroup = ((Gun)((byId2 is Gun) ? byId2 : null)).gunSwitchGroup;
			val.reloadTime = 4.5f;
			val.DefaultModule.cooldownTime = 0.35f;
			val.DefaultModule.numberOfShotsInClip = 6;
			val.SetBaseMaxAmmo(250);
			val.DefaultModule.angleVariance = 6f;
			val.InfiniteAmmo = true;
			((PickupObject)val).quality = (ItemQuality)(-50);
			Projectile val2 = Object.Instantiate<Projectile>(val.DefaultModule.projectiles[0]);
			((Component)val2).gameObject.SetActive(false);
			((Object)((Component)val2).gameObject).name = "EnergyCube_Small";
			FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject);
			Object.DontDestroyOnLoad((Object)(object)val2);
			val.DefaultModule.projectiles[0] = val2;
			val2.AnimateProjectileBundle("energycube_small", StaticCollections.Projectile_Collection, StaticCollections.Projectile_Animation, "energycube_small", new List<IntVector2>
			{
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15),
				new IntVector2(10, 15)
			}, ProjectileToolbox.ConstructListOfSameValues(value: true, 12), ProjectileToolbox.ConstructListOfSameValues<Anchor>((Anchor)4, 12), ProjectileToolbox.ConstructListOfSameValues(value: true, 12), ProjectileToolbox.ConstructListOfSameValues(value: false, 12), ProjectileToolbox.ConstructListOfSameValues<Vector3?>(null, 12), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 12), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 12), ProjectileToolbox.ConstructListOfSameValues<Projectile>(null, 12));
			Material val3 = new Material(((BraveBehaviour)((BraveBehaviour)EnemyDatabase.GetOrLoadByName("GunNut")).sprite).renderer.material);
			val3.mainTexture = ((BraveBehaviour)((BraveBehaviour)val2).sprite).renderer.material.mainTexture;
			val3.SetColor("_EmissiveColor", Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue)));
			val3.SetFloat("_EmissiveColorPower", 100f);
			val3.SetFloat("_EmissivePower", 100f);
			((BraveBehaviour)((BraveBehaviour)val2).sprite).renderer.material = val3;
			val2.baseData.speed = 7f;
			val2.baseData.damage = 3f;
			val2.shouldRotate = false;
			val2.baseData.force = 3f;
			val2.collidesWithProjectiles = true;
			val2.projectileHitHealth = 5;
			val2.baseData.UsesCustomAccelerationCurve = true;
			val2.baseData.AccelerationCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0.033f);
			ProjectileData baseData = val2.baseData;
			baseData.range *= 1.2f;
			((Component)val2).gameObject.AddComponent<BeamCollisionEvent>();
			ref string objectImpactEventName = ref val2.objectImpactEventName;
			PickupObject byId3 = PickupObjectDatabase.GetById(504);
			objectImpactEventName = ((Gun)((byId3 is Gun) ? byId3 : null)).DefaultModule.projectiles[0].objectImpactEventName;
			ref string enemyImpactEventName = ref val2.enemyImpactEventName;
			PickupObject byId4 = PickupObjectDatabase.GetById(504);
			enemyImpactEventName = ((Gun)((byId4 is Gun) ? byId4 : null)).DefaultModule.projectiles[0].enemyImpactEventName;
			ref VFXPool tileMapHorizontal = ref val2.hitEffects.tileMapHorizontal;
			PickupObject byId5 = PickupObjectDatabase.GetById(223);
			tileMapHorizontal = Toolbox.MakeObjectIntoVFX(((Gun)((byId5 is Gun) ? byId5 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool tileMapVertical = ref val2.hitEffects.tileMapVertical;
			PickupObject byId6 = PickupObjectDatabase.GetById(223);
			tileMapVertical = Toolbox.MakeObjectIntoVFX(((Gun)((byId6 is Gun) ? byId6 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool enemy = ref val2.hitEffects.enemy;
			PickupObject byId7 = PickupObjectDatabase.GetById(223);
			enemy = Toolbox.MakeObjectIntoVFX(((Gun)((byId7 is Gun) ? byId7 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool deathAny = ref val2.hitEffects.deathAny;
			PickupObject byId8 = PickupObjectDatabase.GetById(223);
			deathAny = Toolbox.MakeObjectIntoVFX(((Gun)((byId8 is Gun) ? byId8 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ShieldEater shieldEater = ((Component)val2).gameObject.AddComponent<ShieldEater>();
			((Component)val2).gameObject.AddComponent<MaintainDamageOnPierce>();
			PierceProjModifier orAddComponent = GameObjectExtensions.GetOrAddComponent<PierceProjModifier>(((Component)val2).gameObject);
			orAddComponent.penetration = 100;
			BounceProjModifier orAddComponent2 = GameObjectExtensions.GetOrAddComponent<BounceProjModifier>(((Component)val2).gameObject);
			orAddComponent2.numberOfBounces = 3;
			ImprovedAfterImage improvedAfterImage = ((Component)val2).gameObject.AddComponent<ImprovedAfterImage>();
			improvedAfterImage.spawnShadows = true;
			improvedAfterImage.shadowLifetime = 0.5f;
			improvedAfterImage.shadowTimeDelay = 0.25f;
			improvedAfterImage.dashColor = new Color(0f, 0.7f, 0.7f, 1f);
			Projectile val4 = Object.Instantiate<Projectile>(val.DefaultModule.projectiles[0]);
			((Component)val4).gameObject.SetActive(false);
			((Object)((Component)val4).gameObject).name = "EnergyCube_Small";
			FakePrefab.MarkAsFakePrefab(((Component)val4).gameObject);
			Object.DontDestroyOnLoad((Object)(object)val4);
			val4.AnimateProjectileBundle("largecube", StaticCollections.Projectile_Collection, StaticCollections.Projectile_Animation, "largecube", new List<IntVector2>
			{
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30),
				new IntVector2(25, 30)
			}, ProjectileToolbox.ConstructListOfSameValues(value: true, 18), ProjectileToolbox.ConstructListOfSameValues<Anchor>((Anchor)4, 18), ProjectileToolbox.ConstructListOfSameValues(value: true, 18), ProjectileToolbox.ConstructListOfSameValues(value: false, 18), ProjectileToolbox.ConstructListOfSameValues<Vector3?>(null, 18), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 18), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 18), ProjectileToolbox.ConstructListOfSameValues<Projectile>(null, 18));
			Material material = new Material(((BraveBehaviour)((BraveBehaviour)EnemyDatabase.GetOrLoadByName("GunNut")).sprite).renderer.material);
			val3.mainTexture = ((BraveBehaviour)((BraveBehaviour)val2).sprite).renderer.material.mainTexture;
			val3.SetColor("_EmissiveColor", Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue)));
			val3.SetFloat("_EmissiveColorPower", 100f);
			val3.SetFloat("_EmissivePower", 100f);
			((BraveBehaviour)((BraveBehaviour)val4).sprite).renderer.material = material;
			val4.baseData.speed = 10f;
			val4.baseData.damage = 6f;
			val4.shouldRotate = false;
			val4.baseData.force = 5f;
			val4.collidesWithProjectiles = true;
			val4.projectileHitHealth = 15;
			val4.baseData.UsesCustomAccelerationCurve = true;
			val4.baseData.AccelerationCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0.05f);
			ProjectileData baseData2 = val4.baseData;
			baseData2.range *= 3f;
			ref string objectImpactEventName2 = ref val4.objectImpactEventName;
			PickupObject byId9 = PickupObjectDatabase.GetById(504);
			objectImpactEventName2 = ((Gun)((byId9 is Gun) ? byId9 : null)).DefaultModule.projectiles[0].objectImpactEventName;
			ref string enemyImpactEventName2 = ref val4.enemyImpactEventName;
			PickupObject byId10 = PickupObjectDatabase.GetById(504);
			enemyImpactEventName2 = ((Gun)((byId10 is Gun) ? byId10 : null)).DefaultModule.projectiles[0].enemyImpactEventName;
			((Component)val4).gameObject.AddComponent<BeamCollisionEvent>();
			ref VFXPool tileMapHorizontal2 = ref val4.hitEffects.tileMapHorizontal;
			PickupObject byId11 = PickupObjectDatabase.GetById(223);
			tileMapHorizontal2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId11 is Gun) ? byId11 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool tileMapVertical2 = ref val4.hitEffects.tileMapVertical;
			PickupObject byId12 = PickupObjectDatabase.GetById(223);
			tileMapVertical2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId12 is Gun) ? byId12 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool enemy2 = ref val4.hitEffects.enemy;
			PickupObject byId13 = PickupObjectDatabase.GetById(223);
			enemy2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId13 is Gun) ? byId13 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			ref VFXPool deathAny2 = ref val4.hitEffects.deathAny;
			PickupObject byId14 = PickupObjectDatabase.GetById(223);
			deathAny2 = Toolbox.MakeObjectIntoVFX(((Gun)((byId14 is Gun) ? byId14 : null)).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal.effects.First().effects.First().effect);
			((Component)val4).gameObject.AddComponent<MaintainDamageOnPierce>();
			ShieldBlock shieldBlock = ((Component)val4).gameObject.AddComponent<ShieldBlock>();
			shieldBlock.Range = 1.5f;
			PierceProjModifier orAddComponent3 = GameObjectExtensions.GetOrAddComponent<PierceProjModifier>(((Component)val4).gameObject);
			orAddComponent3.penetration = 100;
			((Component)val4).gameObject.AddComponent<MaintainDamageOnPierce>();
			BounceProjModifier orAddComponent4 = GameObjectExtensions.GetOrAddComponent<BounceProjModifier>(((Component)val4).gameObject);
			orAddComponent4.numberOfBounces = 5;
			ImprovedAfterImage improvedAfterImage2 = ((Component)val4).gameObject.AddComponent<ImprovedAfterImage>();
			improvedAfterImage2.spawnShadows = true;
			improvedAfterImage2.shadowLifetime = 0.5f;
			improvedAfterImage2.shadowTimeDelay = 0.25f;
			improvedAfterImage2.dashColor = new Color(0f, 0.7f, 0.7f, 1f);
			ChargeProjectile item = new ChargeProjectile
			{
				Projectile = val2,
				ChargeTime = 0.55f,
				AmmoCost = 1
			};
			ChargeProjectile item2 = new ChargeProjectile
			{
				Projectile = val4,
				ChargeTime = 1.85f,
				AmmoCost = 1
			};
			val.DefaultModule.chargeProjectiles = new List<ChargeProjectile> { item, item2 };
			val.DefaultModule.ammoType = (AmmoType)14;
			val.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("EnergyCube", StaticCollections.Clip_Ammo_Atlas, "cube_1", "cube_2", (AmmoType)14);
			val.gunClass = (GunClass)0;
			val.AddGlowShaderToGun(new Color32((byte)121, (byte)234, byte.MaxValue, byte.MaxValue), 10, 10);
			val.gunHandedness = (GunHandedness)3;
			val.carryPixelOffset = new IntVector2(4, 4);
			ref VFXPool muzzleFlashEffects = ref val.muzzleFlashEffects;
			PickupObject byId15 = PickupObjectDatabase.GetById(156);
			muzzleFlashEffects = ((Gun)((byId15 is Gun) ? byId15 : null)).muzzleFlashEffects;
			val.muzzleOffset = Toolbox.GenerateTransformPoint(((Component)val).gameObject, new Vector2(0.5f, 0.9375f), "muzzle_point").transform;
			val.barrelOffset = Toolbox.GenerateTransformPoint(((Component)val).gameObject, new Vector2(0.5f, 0.9375f), "barrel_point").transform;
			Databases.Items.Add((PickupObject)(object)val, false, "ANY");
			GunID = ((PickupObject)val).PickupObjectId;
			IteratedDesign.SpecialProcessGunSpecificFireRate = (Func<float, int, ModulePrinterCore, PlayerController, float>)Delegate.Combine(IteratedDesign.SpecialProcessGunSpecificFireRate, new Func<float, int, ModulePrinterCore, PlayerController, float>(@object.ProcessFireRateSpecial));
		}

		public float ProcessFireRateSpecial(float f, int stack, ModulePrinterCore modulePrinterCore, PlayerController player)
		{
			if (((PickupObject)modulePrinterCore.ModularGunController.gun).PickupObjectId != GunID)
			{
				return f;
			}
			return f / (float)(1 + stack / 5);
		}
	}
	public class FlamethrowerAlt : GunBehaviour
	{
		public static int ID;

		public static void Init()
		{
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: 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_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: 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_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a8: Expected O, but got Unknown
			//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d1: Expected O, but got Unknown
			//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fa: Expected O, but got Unknown
			//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_041c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0423: Expected O, but got Unknown
			//IL_0426: Unknown result type (might be due to invalid IL or missing references)
			//IL_0479: Unknown result type (might be due to invalid IL or missing references)
			//IL_0480: Expected O, but got Unknown
			//IL_0561: Unknown result type (might be due to invalid IL or missing references)
			//IL_0574: Unknown result type (might be due to invalid IL or missing references)
			//IL_0583: Unknown result type (might be due to invalid IL or missing references)
			//IL_058b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0590: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_060b: Unknown result type (might be due to invalid IL or missing references)
			//IL_065a: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("Flame Ejector", "flamethroweralt");
			Game.Items.Rename("outdated_gun_mods:flame_ejector", "mdl:armcannon_13_alt");
			FlamethrowerAlt @object = ((Component)val).gameObject.AddComponent<FlamethrowerAlt>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Mk.2");
			GunExt.SetLongDescription((PickupObject)(object)val, "Fires super heated energy. Compatible with Modular Upgrade Software.\n\nA flamethrower. This is 100% a flamethrower, no-one can convince anyone else otherwise.");
			val.SetupSprite(StaticCollections.Gun_Collection, "flameralt_idle_001");
			((BraveBehaviour)val).spriteAnimator.Library = StaticCollections.Gun_Animation;
			((BraveBehaviour)val).sprite.SortingOrder = 1;
			val.idleAnimation = "flameralt_idle";
			val.shootAnimation = "flameralt_fire";
			val.reloadAnimation = "flameralt_reload";
			val.introAnimation = "flameralt_intro";
			val.emptyAnimation = "flameralt_empty";
			((PickupObject)val).PersistsOnDeath = true;
			((PickupObject)val).PreventStartingOwnerFromDropping = true;
			Tk2dSpriteAnimatorUtility.AddSoundsToAnimationFrame(((Component)val).GetComponent<tk2dSpriteAnimator>(), val.shootAnimation, new Dictionary<int, string> { { 0, "Play_OBJ_bomb_fuse_01" } });
			Tk2dSpriteAnimatorUtility.AddSoundsToAnimationFrame(((Component)val).GetComponent<tk2dSpriteAnimator>(), val.reloadAnimation, new Dictionary<int, string> { { 2, "Play_WPN_brickgun_reload_01" } });
			PickupObject byId = PickupObjectDatabase.GetById(336);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			ModularGunController modularGunController = ((Component)val).gameObject.AddComponent<ModularGunController>();
			modularGunController.isAlt = true;
			val.DefaultModule.ammoCost = 1;
			val.DefaultModule.shootStyle = (ShootStyle)1;
			val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
			ref string gunSwitchGroup = ref val.gunSwitchGroup;
			PickupObject byId2 = PickupObjectDatabase.GetById(125);
			gunSwitchGroup = ((Gun)((byId2 is Gun) ? byId2 : null)).gunSwitchGroup;
			val.reloadTime = 4.5f;
			val.DefaultModule.cooldownTime = 0.04f;
			val.DefaultModule.numberOfShotsInClip = 125;
			val.SetBaseMaxAmmo(250);
			val.DefaultModule.angleVariance = 7.2f;
			val.InfiniteAmmo = true;
			((PickupObject)val).quality = (ItemQuality)(-100);
			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.AnimateProjectileBundle("flamingfire", StaticCollections.Projectile_Collection, StaticCollections.Projectile_Animation, "flamingfire", new List<IntVector2>
			{
				new IntVector2(30, 30),
				new IntVector2(30, 30),
				new IntVector2(30, 30),
				new IntVector2(30, 30),
				new IntVector2(30, 30),
				new IntVector2(30, 30),
				new IntVector2(30, 30),
				new IntVector2(30, 30),
				new IntVector2(30, 30),
				new IntVector2(30, 30),
				new IntVector2(30, 30),
				new IntVector2(30, 30),
				new IntVector2(30, 30),
				new IntVector2(30, 30)
			}, ProjectileToolbox.ConstructListOfSameValues(value: true, 14), ProjectileToolbox.ConstructListOfSameValues<Anchor>((Anchor)4, 14), ProjectileToolbox.ConstructListOfSameValues(value: true, 14), ProjectileToolbox.ConstructListOfSameValues(value: false, 14), ProjectileToolbox.ConstructListOfSameValues<Vector3?>(null, 14), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 14), ProjectileToolbox.ConstructListOfSameValues<IntVector2?>(null, 14), ProjectileToolbox.ConstructListOfSameValues<Projectile>(null, 14));
			val2.objectImpactEventName = null;
			ref string enemyImpactEventName = ref val2.enemyImpactEventName;
			PickupObject byId3 = PickupObjectDatabase.GetById(384);
			enemyImpactEventName = ((Gun)((byId3 is Gun) ? byId3 : null)).DefaultModule.projectiles[0].enemyImpactEventName;
			ProjectileImpactVFXPool hitEffects = val2.hitEffects;
			VFXPool val3 = new VFXPool();
			val3.type = (VFXPoolType)0;
			val3.effects = (VFXComplex[])(object)new VFXComplex[0];
			hitEffects.tileMapHorizontal = val3;
			ProjectileImpactVFXPool hitEffects2 = val2.hitEffects;
			val3 = new VFXPool();
			val3.type = (VFXPoolType)0;
			val3.effects = (VFXComplex[])(object)new VFXComplex[0];
			hitEffects2.tileMapVertical = val3;
			ProjectileImpactVFXPool hitEffects3 = val2.hitEffects;
			val3 = new VFXPool();
			val3.type = (VFXPoolType)0;
			val3.effects = (VFXComplex[])(object)new VFXComplex[0];
			hitEffects3.enemy = val3;
			ProjectileImpactVFXPool hitEffects4 = val2.hitEffects;
			val3 = new VFXPool();
			val3.type = (VFXPoolType)0;
			val3.effects = (VFXComplex[])(object)new VFXComplex[0];
			hitEffects4.deathAny = val3;
			val2.baseData.UsesCustomAccelerationCurve = true;
			val2.baseData.AccelerationCurve = AnimationCurve.EaseInOut(0f, 1.1f, 0.75f, 0.35f);
			Material val4 = new Material(ShaderCache.Acquire("Brave/LitTk2dCustomFalloffTiltedCutoutEmissive"));
			val4.EnableKeyword("BRIGHTNESS_CLAMP_ON");
			val4.SetFloat("_EmissivePower", 100f);
			val4.SetFloat("_EmissiveColorPower", 100f);
			((BraveBehaviour)((BraveBehaviour)val2).sprite).renderer.material = val4;
			val2.baseData.speed = 18.5f;
			val2.baseData.damage = 0.7f;
			val2.baseData.force = 2.2f;
			val2.AppliesFire = true;
			val2.FireApplyChance = 0.35f;
			val2.fireEffect = DebuffStatics.hotLeadEffect;
			((Component)val2).gameObject.AddComponent<MaintainDamageOnPierce>();
			PierceProjModifier orAddComponent = GameObjectExtensions.GetOrAddComponent<PierceProjModifier>(((Component)val2).gameObject);
			orAddComponent.penetration = 10000;
			BounceProjModifier orAddComponent2 = GameObjectExtensions.GetOrAddComponent<BounceProjModifier>(((Component)val2).gameObject);
			orAddComponent2.numberOfBounces = 100;
			((Component)val2).gameObject.AddComponent<FlamethrowerFire>();
			val2.shouldRotate = true;
			val.gunClass = (GunClass)0;
			val.AddGlowShaderToGun(new Color32((byte)0, byte.MaxValue, (byte)54, byte.MaxValue), 3, 3);
			val.gunHandedness = (GunHandedness)3;
			val.carryPixelOffset = new IntVector2(4, 0);
			ref VFXPool muzzleFlashEffects = ref val.muzzleFlashEffects;
			PickupObject byId4 = PickupObjectDatabase.GetById(329);
			muzzleFlashEffects = ((Gun)((byId4 is Gun) ? byId4 : null)).muzzleFlashEffects;
			val.muzzleOffset = Toolbox.GenerateTransformPoint(((Component)val).gameObject, new Vector2(0.75f, 0.5625f), "muzzle_point").transform;
			val.barrelOffset = Toolbox.GenerateTransformPoint(((Component)val).gameObject, new Vector2(0.75f, 0.5625f), "barrel_point").transform;
			val.DefaultModule.ammoType = (AmmoType)14;
			val.DefaultModule.customAmmoType = CustomClipAmmoTypeToolbox.AddCustomAmmoType("flamethrowerMDLR", StaticCollections.Clip_Ammo_Atlas, "flamer_1", "flamer_2", (AmmoType)14);
			((Component)((Component)val).gameObject.transform.Find("Clip")).transform.position = new Vector3(1.125f, 0.5f);
			val.clipObject = ((Component)Toolbox.GenerateDebrisObject("canister_clip", StaticCollections.Gun_Collection, debrisObjectsCanRotate: true, 1f, 3f, 60f, 20f, null, 2f, "Play_ITM_Crisis_Stone_Impact_02", null, 1)).gameObject;
			val.reloadClipLaunchFrame = 9;
			val.clipsToLaunchOnReload = 1;
			Databases.Items.Add((PickupObject)(object)val, false, "ANY");
			ID = ((PickupObject)val).PickupObjectId;
			IteratedDesign.SpecialProcessGunSpecific = (Action<ModulePrinterCore, Projectile, int, PlayerController>)Delegate.Combine(IteratedDesign.SpecialProcessGunSpecific, new Action<ModulePrinterCore, Projectile, int, PlayerController>(@object.Process));
		}

		public void Process(ModulePrinterCore modulePrinterCore, Projectile p, int stack, PlayerController player)
		{
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			if (((PickupObject)modulePrinterCore.ModularGunController.gun).PickupObjectId == ID)
			{
				ProjectileData baseData = p.baseData;
				baseData.damage += 0.1f * (float)stack;
				ProjectileData baseData2 = p.baseData;
				baseData2.speed *= 1f + 0.25f * (float)stack;
				p.FireApplyChance = 0.1f * (float)stack;
				ProjectileData baseData3 = p.baseData;
				baseData3.force += (float)stack;
				p.fireEffect = DebuffStatics.greenFireEffect;
				p.AdjustPlayerProjectileTint(new Color(0f, 3f, 0f, 1f), 10, 0f);
			}
		}
	}
	public class Flamethrower : GunBehaviour
	{
		public static int ID;

		public static void Init()
		{
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: 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_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: 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_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a8: Expected O, but got Unknown
			//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d1: Expected O, but got Unknown
			//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fa: Expected O, but got Unknown
			//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_041c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0423: Expected O, but got Unknown
			//IL_0426: Unknown result type (might be due to invalid IL or missing references)
			//IL_0479: Unknown result type (might be due to invalid IL or missing references)
			//IL_0480: Expected O, but got Unknown
			//IL_0561: Unknown result type (might be due to invalid IL or missing references)
			//IL_0578: Unknown result type (might be due to invalid IL or missing references)
			//IL_0589: Unknown result type (might be due to invalid IL or missing references)
			//IL_0591: Unknown result type (might be due to invalid IL or missing references)
			//IL_0596: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0611: Unknown result type (might be due to invalid IL or missing references)
			//IL_0660: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("Flame Ejector", "flamethrower");
			Game.Items.Rename("outdated_gun_mods:flame_ejector", "mdl:armcannon_13");
			Flamethrower @object = ((Component)val).gameObject.AddComponent<Flamethrower>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Mk.1");
			GunExt.SetLongDescription((PickupObject)(object)val, "Fires super heated energy. Compatible with Modular Upgrade Software.\n\nA flamethrower. This is 100% a flamethrower, no-one can convince anyone else otherwise.");
			val.SetupSprite(StaticCollections.Gun_Collection, "flamer_idle_001");
			((BraveBehaviour)val).spriteAnimator.Library = StaticCollections.Gun_Animation;
			((BraveBehaviour)val).sprite.SortingOrder = 1;
			val.idleAnimation = "flamer_idle";
			val.shootAnimation = "flamer_fire";
			val.reloadAnimation = "flamer_reload";
			val.introAnimation = "flamer_intro";
			val.emptyAnimation = "flamer_empty";
			((PickupObject)val).PersistsOnDeath = true;
			((PickupObject)val).PreventStartingOwnerFromDropping = true;
			Tk2dSprite