Decompiled source of The Western Bullet v2.0.3

plugins/wb.dll

Decompiled 3 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Alexandria.ItemAPI;
using BepInEx;
using Gungeon;
using Microsoft.CodeAnalysis;
using UnityEngine;

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Mod
{
	public static class Tools
	{
		public static tk2dSpriteDefinition CopyDefinitionFrom(this tk2dSpriteDefinition other)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Expected O, but got Unknown
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: 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_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Expected O, but got Unknown
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_0389: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0397: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_040d: Unknown result type (might be due to invalid IL or missing references)
			//IL_041b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0427: Unknown result type (might be due to invalid IL or missing references)
			tk2dSpriteDefinition val = new tk2dSpriteDefinition
			{
				boundsDataCenter = new Vector3
				{
					x = other.boundsDataCenter.x,
					y = other.boundsDataCenter.y,
					z = other.boundsDataCenter.z
				},
				boundsDataExtents = new Vector3
				{
					x = other.boundsDataExtents.x,
					y = other.boundsDataExtents.y,
					z = other.boundsDataExtents.z
				},
				colliderConvex = other.colliderConvex,
				colliderSmoothSphereCollisions = other.colliderSmoothSphereCollisions,
				colliderType = other.colliderType,
				colliderVertices = other.colliderVertices,
				collisionLayer = other.collisionLayer,
				complexGeometry = other.complexGeometry,
				extractRegion = other.extractRegion,
				flipped = other.flipped,
				indices = other.indices,
				material = new Material(other.material),
				materialId = other.materialId,
				materialInst = new Material(other.materialInst),
				metadata = other.metadata,
				name = other.name,
				normals = other.normals,
				physicsEngine = other.physicsEngine,
				position0 = new Vector3
				{
					x = other.position0.x,
					y = other.position0.y,
					z = other.position0.z
				},
				position1 = new Vector3
				{
					x = other.position1.x,
					y = other.position1.y,
					z = other.position1.z
				},
				position2 = new Vector3
				{
					x = other.position2.x,
					y = other.position2.y,
					z = other.position2.z
				},
				position3 = new Vector3
				{
					x = other.position3.x,
					y = other.position3.y,
					z = other.position3.z
				},
				regionH = other.regionH,
				regionW = other.regionW,
				regionX = other.regionX,
				regionY = other.regionY,
				tangents = other.tangents,
				texelSize = new Vector2
				{
					x = other.texelSize.x,
					y = other.texelSize.y
				},
				untrimmedBoundsDataCenter = new Vector3
				{
					x = other.untrimmedBoundsDataCenter.x,
					y = other.untrimmedBoundsDataCenter.y,
					z = other.untrimmedBoundsDataCenter.z
				},
				untrimmedBoundsDataExtents = new Vector3
				{
					x = other.untrimmedBoundsDataExtents.x,
					y = other.untrimmedBoundsDataExtents.y,
					z = other.untrimmedBoundsDataExtents.z
				}
			};
			List<Vector2> list = new List<Vector2>();
			Vector2[] uvs = other.uvs;
			foreach (Vector2 val2 in uvs)
			{
				list.Add(new Vector2
				{
					x = val2.x,
					y = val2.y
				});
			}
			val.uvs = list.ToArray();
			List<Vector3> list2 = new List<Vector3>();
			Vector3[] colliderVertices = other.colliderVertices;
			foreach (Vector3 val3 in colliderVertices)
			{
				list2.Add(new Vector3
				{
					x = val3.x,
					y = val3.y,
					z = val3.z
				});
			}
			val.colliderVertices = list2.ToArray();
			return val;
		}

		public static void SetProjectileSpriteRight(this Projectile proj, string name, int pixelWidth, int pixelHeight, int? overrideColliderPixelWidth = null, int? overrideColliderPixelHeight = null)
		{
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				if (!overrideColliderPixelWidth.HasValue)
				{
					overrideColliderPixelWidth = pixelWidth;
				}
				if (!overrideColliderPixelHeight.HasValue)
				{
					overrideColliderPixelHeight = pixelHeight;
				}
				float num = (float)pixelWidth / 16f;
				float num2 = (float)pixelHeight / 16f;
				float x = (float)overrideColliderPixelWidth.Value / 16f;
				float y = (float)overrideColliderPixelHeight.Value / 16f;
				ETGMod.GetAnySprite((BraveBehaviour)(object)proj).spriteId = Databases.Items.ProjectileCollection.inst.GetSpriteIdByName(name);
				tk2dSpriteDefinition[] spriteDefinitions = Databases.Items.ProjectileCollection.inst.spriteDefinitions;
				PickupObject byId = PickupObjectDatabase.GetById(12);
				tk2dSpriteDefinition val = spriteDefinitions[ETGMod.GetAnySprite((BraveBehaviour)(object)((Gun)((byId is Gun) ? byId : null)).DefaultModule.projectiles[0]).spriteId].CopyDefinitionFrom();
				val.boundsDataCenter = new Vector3(num / 2f, num2 / 2f, 0f);
				val.boundsDataExtents = new Vector3(num, num2, 0f);
				val.untrimmedBoundsDataCenter = new Vector3(num / 2f, num2 / 2f, 0f);
				val.untrimmedBoundsDataExtents = new Vector3(num, num2, 0f);
				val.position0 = new Vector3(0f, 0f, 0f);
				val.position1 = new Vector3(0f + num, 0f, 0f);
				val.position2 = new Vector3(0f, 0f + num2, 0f);
				val.position3 = new Vector3(0f + num, 0f + num2, 0f);
				val.colliderVertices[1].x = x;
				val.colliderVertices[1].y = y;
				val.name = name;
				Databases.Items.ProjectileCollection.inst.spriteDefinitions[ETGMod.GetAnySprite((BraveBehaviour)(object)proj).spriteId] = val;
				proj.baseData.force = 0f;
			}
			catch (Exception ex)
			{
				ETGModConsole.Log((object)"Ooops! Seems like something got very, Very, VERY wrong. Here's the exception:", false);
				ETGModConsole.Log((object)ex.ToString(), false);
			}
		}
	}
	internal class UnnamedGun : GunBehaviour
	{
		private bool HasReloaded;

		public static void Add()
		{
			//IL_008d: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("Unnamed Gun", "ung");
			Game.Items.Rename("outdated_gun_mods:unnamed_gun", "wb:unnamed_gun");
			((Component)val).gameObject.AddComponent<UnnamedGun>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Never named");
			GunExt.SetLongDescription((PickupObject)(object)val, "A gun that has no name. perhaps their creator couldnt come up with one?\n\nThe starting weapon of the Western Bullet");
			GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "ung_idle_001", 8);
			GunExt.SetAnimationFPS(val, val.shootAnimation, 24);
			GunExt.AddProjectileModuleFrom(val, "ak-47", true, false);
			val.DefaultModule.ammoCost = 1;
			val.DefaultModule.shootStyle = (ShootStyle)0;
			val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
			val.reloadTime = 1f;
			val.DefaultModule.cooldownTime = 0.15f;
			val.DefaultModule.numberOfShotsInClip = 10;
			val.SetBaseMaxAmmo(100);
			((PickupObject)val).quality = (ItemQuality)1;
			Projectile val2 = Object.Instantiate<Projectile>(val.DefaultModule.projectiles[0]);
			((Component)val2).gameObject.SetActive(false);
			FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject);
			Object.DontDestroyOnLoad((Object)(object)val2);
			val.DefaultModule.projectiles[0] = val2;
			val2.baseData.damage = 6f;
			val2.baseData.speed = 15f;
			((BraveBehaviour)val2).transform.parent = val.barrelOffset;
			GunTools.SetProjectileSpriteRight(val2, "ung_projectile_001", 8, 8, false, (Anchor)4, (int?)16, (int?)16, true, false, (int?)null, (int?)null, (Projectile)null);
			Databases.Items.Add(val, (tk2dSpriteCollectionData)null, "ANY");
		}

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

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

		public override void OnReloadPressed(PlayerController player, Gun gun, bool bSOMETHING)
		{
			if (gun.IsReloading && HasReloaded)
			{
				HasReloaded = false;
				AkSoundEngine.PostEvent("Stop_WPN_All", ((Component)this).gameObject);
				((GunBehaviour)this).OnReloadPressed(player, gun, bSOMETHING);
				AkSoundEngine.PostEvent("Play_WPN_SAA_reload_01", ((Component)this).gameObject);
			}
		}
	}
	internal class WaterBottleCannon : GunBehaviour
	{
		private bool HasReloaded;

		public static void Add()
		{
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Expected O, but got Unknown
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			Gun val = Databases.Items.NewGun("Water Bottle Cannon", "wbg");
			Game.Items.Rename("outdated_gun_mods:water_bottle_cannon", "wb:water_bottle_cannon");
			((Component)val).gameObject.AddComponent<WaterBottleCannon>();
			GunExt.SetShortDescription((PickupObject)(object)val, "Shoots caps!");
			GunExt.SetLongDescription((PickupObject)(object)val, "Legend has it that Emmet Calx fed this water bottle to a Gatling Gull, which distracted him enough for Emmet to escape.\n\nWhat does this gun have to do with the Western Bullet? uhh idk, cowboys get thirsty?");
			GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "wbg_idle_001", 8);
			GunExt.SetAnimationFPS(val, val.shootAnimation, 24);
			PickupObject byId = PickupObjectDatabase.GetById(15);
			GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
			val.DefaultModule.ammoCost = 1;
			val.DefaultModule.shootStyle = (ShootStyle)3;
			val.DefaultModule.sequenceStyle = (ProjectileSequenceStyle)0;
			val.reloadTime = 2f;
			val.DefaultModule.cooldownTime = 0.1f;
			val.DefaultModule.numberOfShotsInClip = 10;
			val.SetBaseMaxAmmo(100);
			((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.chargeAnimation).wrapMode = (WrapMode)1;
			((Component)val).GetComponent<tk2dSpriteAnimator>().GetClipByName(val.chargeAnimation).loopStart = 4;
			((PickupObject)val).quality = (ItemQuality)3;
			PickupObject byId2 = PickupObjectDatabase.GetById(15);
			Projectile val2 = Object.Instantiate<Projectile>(((Gun)((byId2 is Gun) ? byId2 : null)).DefaultModule.projectiles[0]);
			((Component)val2).gameObject.SetActive(false);
			FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject);
			Object.DontDestroyOnLoad((Object)(object)val2);
			val.DefaultModule.projectiles[0] = val2;
			val2.baseData.damage = 35f;
			val2.baseData.speed = 20f;
			((BraveBehaviour)val2).transform.parent = val.barrelOffset;
			GunTools.SetProjectileSpriteRight(val2, "wbg_projectile_001", 12, 5, false, (Anchor)4, (int?)15, (int?)16, true, false, (int?)null, (int?)null, (Projectile)null);
			val2.shouldFlipVertically = true;
			val2.shouldRotate = true;
			ChargeProjectile item = new ChargeProjectile
			{
				Projectile = val2,
				ChargeTime = 0.5f
			};
			val.DefaultModule.chargeProjectiles = new List<ChargeProjectile> { item };
			val.DefaultModule.ammoType = (AmmoType)14;
			val.DefaultModule.customAmmoType = "evo3";
			val.carryPixelOffset = new IntVector2(12, 0);
			val.gunSwitchGroup = null;
			Databases.Items.Add(val, (tk2dSpriteCollectionData)null, "ANY");
		}

		public override void PostProcessProjectile(Projectile projectile)
		{
			AkSoundEngine.PostEvent("Play_WPN_megablaster_shot_01", ((Component)this).gameObject);
			((GunBehaviour)this).PostProcessProjectile(projectile);
		}

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

		public override void OnReloadPressed(PlayerController player, Gun gun, bool bSOMETHING)
		{
			if (gun.IsReloading && HasReloaded)
			{
				HasReloaded = false;
				AkSoundEngine.PostEvent("Stop_WPN_All", ((Component)this).gameObject);
				((GunBehaviour)this).OnReloadPressed(player, gun, bSOMETHING);
				AkSoundEngine.PostEvent("Play_WPN_SAA_reload_01", ((Component)this).gameObject);
			}
		}
	}
	public class CowboyHat : PassiveItem
	{
		public static void Register()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			string text = "Cowboy Hat";
			string text2 = "Mod/Resources/Cowboy_Hat_By_Dallan";
			GameObject val = new GameObject(text);
			CowboyHat cowboyHat = val.AddComponent<CowboyHat>();
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "Yeehaw!";
			string text4 = "An old cowboy hat, i wonder who this belonged to.\n\nMan, cowboys are really cool!\n\nIncreases coolness by 5, Decreases damage by 0.25";
			ItemBuilder.SetupItem((PickupObject)(object)cowboyHat, text3, text4, "wb");
			ItemBuilder.AddPassiveStatModifier((PickupObject)(object)cowboyHat, (StatType)5, -0.25f, (ModifyMethod)0);
			ItemBuilder.AddPassiveStatModifier((PickupObject)(object)cowboyHat, (StatType)4, 5f, (ModifyMethod)0);
			((PickupObject)cowboyHat).quality = (ItemQuality)4;
		}

		public override void Pickup(PlayerController player)
		{
			((PassiveItem)this).Pickup(player);
			Plugin.Log("Player picked up " + ((PickupObject)this).DisplayName);
		}

		public override void DisableEffect(PlayerController player)
		{
			Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).DisplayName);
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("gustavin.etg.wbitems", "The Western Bullet Items", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public const string GUID = "gustavin.etg.wbitems";

		public const string NAME = "The Western Bullet Items";

		public const string VERSION = "1.0.0";

		public const string TEXT_COLOR = "#00FFFF";

		public void Start()
		{
			ETGModMainBehaviour.WaitForGameManagerStart((Action<GameManager>)GMStart);
		}

		public void GMStart(GameManager g)
		{
			CowboyHat.Register();
			WantedPoster.Register();
			WaterBottleCannon.Add();
			UnnamedGun.Add();
			Log("The Western Bullet Items v1.0.0 started successfully.", "#00FFFF");
		}

		public static void Log(string text, string color = "#FFFFFF")
		{
			ETGModConsole.Log((object)("<color=" + color + ">" + text + "</color>"), false);
		}
	}
	public class WantedPoster : PassiveItem
	{
		public static void Register()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			string text = "Wanted Poster";
			string text2 = "Mod/Resources/Wanted_Poster_By_Dallan";
			GameObject val = new GameObject(text);
			WantedPoster wantedPoster = val.AddComponent<WantedPoster>();
			ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
			string text3 = "On the run";
			string text4 = "You are a wanted man! The text reads:\n\n       WANTED\n     BULLET MAN\nREWARD - 500 CASINGS\n\nIncreases movement speed by 2, Decreases fire rate by 0.3";
			ItemBuilder.SetupItem((PickupObject)(object)wantedPoster, text3, text4, "wb");
			ItemBuilder.AddPassiveStatModifier((PickupObject)(object)wantedPoster, (StatType)0, 2f, (ModifyMethod)0);
			ItemBuilder.AddPassiveStatModifier((PickupObject)(object)wantedPoster, (StatType)1, -0.3f, (ModifyMethod)0);
			((PickupObject)wantedPoster).quality = (ItemQuality)2;
		}

		public override void Pickup(PlayerController player)
		{
			((PassiveItem)this).Pickup(player);
			Plugin.Log("Player picked up " + ((PickupObject)this).DisplayName);
		}

		public override void DisableEffect(PlayerController player)
		{
			Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).DisplayName);
		}
	}
}