Decompiled source of Modded Bug Fix v1.1.1

ModdedBugFix.dll

Decompiled 6 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BepInEx;
using BepInEx.Bootstrap;
using Gungeon;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using ModdedBugFix.Mods;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Collections.Generic;
using MonoMod.Cil;
using MonoMod.Utils;
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("ModdedBugFix")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("N/A")]
[assembly: AssemblyProduct("ModdedBugFix")]
[assembly: AssemblyCopyright("Copyright © N/A 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b3366f76-a9d7-4941-918c-347c0111d8c6")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
[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 ModdedBugFix
{
	[HarmonyPatch]
	public static class GetByEncounterNameFix
	{
		public static Dictionary<string, PickupObject> EnglishItemNames = new Dictionary<string, PickupObject>
		{
			{
				"magic lamp",
				PickupObjectDatabase.GetById(0)
			},
			{
				"winchester",
				PickupObjectDatabase.GetById(1)
			},
			{
				"thompson sub-machinegun",
				PickupObjectDatabase.GetById(2)
			},
			{
				"screecher",
				PickupObjectDatabase.GetById(3)
			},
			{
				"sticky crossbow",
				PickupObjectDatabase.GetById(4)
			},
			{
				"a.w.p.",
				PickupObjectDatabase.GetById(5)
			},
			{
				"zorgun",
				PickupObjectDatabase.GetById(6)
			},
			{
				"barrel",
				PickupObjectDatabase.GetById(7)
			},
			{
				"bow",
				PickupObjectDatabase.GetById(8)
			},
			{
				"dueling pistol",
				PickupObjectDatabase.GetById(9)
			},
			{
				"mega douser",
				PickupObjectDatabase.GetById(10)
			},
			{
				"crossbow",
				PickupObjectDatabase.GetById(12)
			},
			{
				"thunderclap",
				PickupObjectDatabase.GetById(13)
			},
			{
				"bee hive",
				PickupObjectDatabase.GetById(14)
			},
			{
				"ak-47",
				PickupObjectDatabase.GetById(15)
			},
			{
				"yari launcher",
				PickupObjectDatabase.GetById(16)
			},
			{
				"heck blaster",
				PickupObjectDatabase.GetById(17)
			},
			{
				"blooper",
				PickupObjectDatabase.GetById(18)
			},
			{
				"grenade launcher",
				PickupObjectDatabase.GetById(19)
			},
			{
				"moonscraper",
				PickupObjectDatabase.GetById(20)
			},
			{
				"bsg",
				PickupObjectDatabase.GetById(21)
			},
			{
				"shades's revolver",
				PickupObjectDatabase.GetById(22)
			},
			{
				"dungeon eagle",
				PickupObjectDatabase.GetById(23)
			},
			{
				"dart gun",
				PickupObjectDatabase.GetById(24)
			},
			{
				"m1",
				PickupObjectDatabase.GetById(25)
			},
			{
				"nail gun",
				PickupObjectDatabase.GetById(26)
			},
			{
				"light gun",
				PickupObjectDatabase.GetById(27)
			},
			{
				"mailbox",
				PickupObjectDatabase.GetById(28)
			},
			{
				"vertebraek-47",
				PickupObjectDatabase.GetById(29)
			},
			{
				"m1911",
				PickupObjectDatabase.GetById(30)
			},
			{
				"klobbe",
				PickupObjectDatabase.GetById(31)
			},
			{
				"void marshal",
				PickupObjectDatabase.GetById(32)
			},
			{
				"tear jerker",
				PickupObjectDatabase.GetById(33)
			},
			{
				"smiley's revolver",
				PickupObjectDatabase.GetById(35)
			},
			{
				"megahand",
				PickupObjectDatabase.GetById(36)
			},
			{
				"serious cannon",
				PickupObjectDatabase.GetById(37)
			},
			{
				"magnum",
				PickupObjectDatabase.GetById(38)
			},
			{
				"rpg",
				PickupObjectDatabase.GetById(39)
			},
			{
				"freeze ray",
				PickupObjectDatabase.GetById(40)
			},
			{
				"heroine",
				PickupObjectDatabase.GetById(41)
			},
			{
				"trank gun",
				PickupObjectDatabase.GetById(42)
			},
			{
				"machine pistol",
				PickupObjectDatabase.GetById(43)
			},
			{
				"skull spitter",
				PickupObjectDatabase.GetById(45)
			},
			{
				"jolter",
				PickupObjectDatabase.GetById(47)
			},
			{
				"sniper rifle",
				PickupObjectDatabase.GetById(49)
			},
			{
				"saa",
				PickupObjectDatabase.GetById(50)
			},
			{
				"regular shotgun",
				PickupObjectDatabase.GetById(51)
			},
			{
				"crescent crossbow",
				PickupObjectDatabase.GetById(52)
			},
			{
				"au gun",
				PickupObjectDatabase.GetById(53)
			},
			{
				"laser rifle",
				PickupObjectDatabase.GetById(54)
			},
			{
				"void shotgun",
				PickupObjectDatabase.GetById(55)
			},
			{
				"38 special",
				PickupObjectDatabase.GetById(56)
			},
			{
				"alien sidearm",
				PickupObjectDatabase.GetById(57)
			},
			{
				"void core assault rifle",
				PickupObjectDatabase.GetById(58)
			},
			{
				"hegemony rifle",
				PickupObjectDatabase.GetById(59)
			},
			{
				"demon head",
				PickupObjectDatabase.GetById(60)
			},
			{
				"bundle of wands",
				PickupObjectDatabase.GetById(61)
			},
			{
				"colt 1851",
				PickupObjectDatabase.GetById(62)
			},
			{
				"medkit",
				PickupObjectDatabase.GetById(63)
			},
			{
				"potion of lead skin",
				PickupObjectDatabase.GetById(64)
			},
			{
				"knife shield",
				PickupObjectDatabase.GetById(65)
			},
			{
				"proximity mine",
				PickupObjectDatabase.GetById(66)
			},
			{
				"key",
				PickupObjectDatabase.GetById(67)
			},
			{
				"bullet time",
				PickupObjectDatabase.GetById(69)
			},
			{
				"decoy",
				PickupObjectDatabase.GetById(71)
			},
			{
				"half heart",
				PickupObjectDatabase.GetById(73)
			},
			{
				"supply drop",
				PickupObjectDatabase.GetById(77)
			},
			{
				"makarov",
				PickupObjectDatabase.GetById(79)
			},
			{
				"budget revolver",
				PickupObjectDatabase.GetById(80)
			},
			{
				"deck4rd",
				PickupObjectDatabase.GetById(81)
			},
			{
				"elephant gun",
				PickupObjectDatabase.GetById(82)
			},
			{
				"unfinished gun",
				PickupObjectDatabase.GetById(83)
			},
			{
				"vulcan cannon",
				PickupObjectDatabase.GetById(84)
			},
			{
				"full heart",
				PickupObjectDatabase.GetById(85)
			},
			{
				"marine sidearm",
				PickupObjectDatabase.GetById(86)
			},
			{
				"gamma ray",
				PickupObjectDatabase.GetById(87)
			},
			{
				"robot's right hand",
				PickupObjectDatabase.GetById(88)
			},
			{
				"rogue special",
				PickupObjectDatabase.GetById(89)
			},
			{
				"eye of the beholster",
				PickupObjectDatabase.GetById(90)
			},
			{
				"h4mmer",
				PickupObjectDatabase.GetById(91)
			},
			{
				"stinger",
				PickupObjectDatabase.GetById(92)
			},
			{
				"old goldie",
				PickupObjectDatabase.GetById(93)
			},
			{
				"mac10",
				PickupObjectDatabase.GetById(94)
			},
			{
				"akey-47",
				PickupObjectDatabase.GetById(95)
			},
			{
				"m16",
				PickupObjectDatabase.GetById(96)
			},
			{
				"polaris",
				PickupObjectDatabase.GetById(97)
			},
			{
				"patriot",
				PickupObjectDatabase.GetById(98)
			},
			{
				"rusty sidearm",
				PickupObjectDatabase.GetById(99)
			},
			{
				"unicorn horn",
				PickupObjectDatabase.GetById(100)
			},
			{
				"scope",
				PickupObjectDatabase.GetById(102)
			},
			{
				"ration",
				PickupObjectDatabase.GetById(104)
			},
			{
				"fortune's favor",
				PickupObjectDatabase.GetById(105)
			},
			{
				"jetpack",
				PickupObjectDatabase.GetById(106)
			},
			{
				"raiden coil",
				PickupObjectDatabase.GetById(107)
			},
			{
				"bomb",
				PickupObjectDatabase.GetById(108)
			},
			{
				"ice bomb",
				PickupObjectDatabase.GetById(109)
			},
			{
				"magic sweet",
				PickupObjectDatabase.GetById(110)
			},
			{
				"heavy bullets",
				PickupObjectDatabase.GetById(111)
			},
			{
				"cartographer's ring",
				PickupObjectDatabase.GetById(112)
			},
			{
				"rocket-powered bullets",
				PickupObjectDatabase.GetById(113)
			},
			{
				"bionic leg",
				PickupObjectDatabase.GetById(114)
			},
			{
				"ballot",
				PickupObjectDatabase.GetById(115)
			},
			{
				"ammo synthesizer",
				PickupObjectDatabase.GetById(116)
			},
			{
				"eyepatch",
				PickupObjectDatabase.GetById(118)
			},
			{
				"metronome",
				PickupObjectDatabase.GetById(119)
			},
			{
				"armor",
				PickupObjectDatabase.GetById(120)
			},
			{
				"disintegrator",
				PickupObjectDatabase.GetById(121)
			},
			{
				"blunderbuss",
				PickupObjectDatabase.GetById(122)
			},
			{
				"pulse cannon",
				PickupObjectDatabase.GetById(123)
			},
			{
				"cactus",
				PickupObjectDatabase.GetById(124)
			},
			{
				"flame hand",
				PickupObjectDatabase.GetById(125)
			},
			{
				"shotbow",
				PickupObjectDatabase.GetById(126)
			},
			{
				"junk",
				PickupObjectDatabase.GetById(127)
			},
			{
				"rube-adyne mk.ii",
				PickupObjectDatabase.GetById(128)
			},
			{
				"com4nd0",
				PickupObjectDatabase.GetById(129)
			},
			{
				"glacier",
				PickupObjectDatabase.GetById(130)
			},
			{
				"utility belt",
				PickupObjectDatabase.GetById(131)
			},
			{
				"ring of miserly protection",
				PickupObjectDatabase.GetById(132)
			},
			{
				"backpack",
				PickupObjectDatabase.GetById(133)
			},
			{
				"ammo belt",
				PickupObjectDatabase.GetById(134)
			},
			{
				"cog of battle",
				PickupObjectDatabase.GetById(135)
			},
			{
				"c4",
				PickupObjectDatabase.GetById(136)
			},
			{
				"map",
				PickupObjectDatabase.GetById(137)
			},
			{
				"honeycomb",
				PickupObjectDatabase.GetById(138)
			},
			{
				"master of unlocking",
				PickupObjectDatabase.GetById(140)
			},
			{
				"rube-adyne prototype",
				PickupObjectDatabase.GetById(142)
			},
			{
				"shotgun full of hate",
				PickupObjectDatabase.GetById(143)
			},
			{
				"witch pistol",
				PickupObjectDatabase.GetById(145)
			},
			{
				"dragunfire",
				PickupObjectDatabase.GetById(146)
			},
			{
				"lies",
				PickupObjectDatabase.GetById(148)
			},
			{
				"face melter",
				PickupObjectDatabase.GetById(149)
			},
			{
				"t-shirt cannon",
				PickupObjectDatabase.GetById(150)
			},
			{
				"the membrane",
				PickupObjectDatabase.GetById(151)
			},
			{
				"the kiln",
				PickupObjectDatabase.GetById(152)
			},
			{
				"shock rifle",
				PickupObjectDatabase.GetById(153)
			},
			{
				"trashcannon",
				PickupObjectDatabase.GetById(154)
			},
			{
				"singularity",
				PickupObjectDatabase.GetById(155)
			},
			{
				"laser lotus",
				PickupObjectDatabase.GetById(156)
			},
			{
				"big iron",
				PickupObjectDatabase.GetById(157)
			},
			{
				"amulet of the pit lord",
				PickupObjectDatabase.GetById(158)
			},
			{
				"gundromeda strain",
				PickupObjectDatabase.GetById(159)
			},
			{
				"gunknight helmet",
				PickupObjectDatabase.GetById(160)
			},
			{
				"gunknight greaves",
				PickupObjectDatabase.GetById(161)
			},
			{
				"gunknight gauntlet",
				PickupObjectDatabase.GetById(162)
			},
			{
				"gunknight armor",
				PickupObjectDatabase.GetById(163)
			},
			{
				"heart synthesizer",
				PickupObjectDatabase.GetById(164)
			},
			{
				"oiled cylinder",
				PickupObjectDatabase.GetById(165)
			},
			{
				"shelleton key",
				PickupObjectDatabase.GetById(166)
			},
			{
				"bloody eye",
				PickupObjectDatabase.GetById(167)
			},
			{
				"double vision",
				PickupObjectDatabase.GetById(168)
			},
			{
				"black hole gun",
				PickupObjectDatabase.GetById(169)
			},
			{
				"ice cube",
				PickupObjectDatabase.GetById(170)
			},
			{
				"ghost bullets",
				PickupObjectDatabase.GetById(172)
			},
			{
				"potion of gun friendship",
				PickupObjectDatabase.GetById(174)
			},
			{
				"tangler",
				PickupObjectDatabase.GetById(175)
			},
			{
				"gungeon ant",
				PickupObjectDatabase.GetById(176)
			},
			{
				"alien engine",
				PickupObjectDatabase.GetById(177)
			},
			{
				"crestfaller",
				PickupObjectDatabase.GetById(178)
			},
			{
				"proton backpack",
				PickupObjectDatabase.GetById(179)
			},
			{
				"grasschopper",
				PickupObjectDatabase.GetById(180)
			},
			{
				"winchester rifle",
				PickupObjectDatabase.GetById(181)
			},
			{
				"grey mauser",
				PickupObjectDatabase.GetById(182)
			},
			{
				"ser manuel's revolver",
				PickupObjectDatabase.GetById(183)
			},
			{
				"the judge",
				PickupObjectDatabase.GetById(184)
			},
			{
				"machine fist",
				PickupObjectDatabase.GetById(186)
			},
			{
				"disarming personality",
				PickupObjectDatabase.GetById(187)
			},
			{
				"rolling eye",
				PickupObjectDatabase.GetById(190)
			},
			{
				"ring of fire resistance",
				PickupObjectDatabase.GetById(191)
			},
			{
				"bug boots",
				PickupObjectDatabase.GetById(193)
			},
			{
				"fossilized gun",
				PickupObjectDatabase.GetById(196)
			},
			{
				"pea shooter",
				PickupObjectDatabase.GetById(197)
			},
			{
				"gunslinger's ashes",
				PickupObjectDatabase.GetById(198)
			},
			{
				"luxin cannon",
				PickupObjectDatabase.GetById(199)
			},
			{
				"charmed bow",
				PickupObjectDatabase.GetById(200)
			},
			{
				"portable turret",
				PickupObjectDatabase.GetById(201)
			},
			{
				"sawed-off",
				PickupObjectDatabase.GetById(202)
			},
			{
				"cigarettes",
				PickupObjectDatabase.GetById(203)
			},
			{
				"irradiated lead",
				PickupObjectDatabase.GetById(204)
			},
			{
				"poison vial",
				PickupObjectDatabase.GetById(205)
			},
			{
				"charm horn",
				PickupObjectDatabase.GetById(206)
			},
			{
				"plague pistol",
				PickupObjectDatabase.GetById(207)
			},
			{
				"plunger",
				PickupObjectDatabase.GetById(208)
			},
			{
				"sense of direction",
				PickupObjectDatabase.GetById(209)
			},
			{
				"gunbow",
				PickupObjectDatabase.GetById(210)
			},
			{
				"ballistic boots",
				PickupObjectDatabase.GetById(212)
			},
			{
				"lichy trigger finger",
				PickupObjectDatabase.GetById(213)
			},
			{
				"coin crown",
				PickupObjectDatabase.GetById(214)
			},
			{
				"box",
				PickupObjectDatabase.GetById(216)
			},
			{
				"old knight's shield",
				PickupObjectDatabase.GetById(219)
			},
			{
				"old knight's helm",
				PickupObjectDatabase.GetById(222)
			},
			{
				"cold 45",
				PickupObjectDatabase.GetById(223)
			},
			{
				"blank",
				PickupObjectDatabase.GetById(224)
			},
			{
				"ice breaker",
				PickupObjectDatabase.GetById(225)
			},
			{
				"wristbow",
				PickupObjectDatabase.GetById(227)
			},
			{
				"particulator",
				PickupObjectDatabase.GetById(228)
			},
			{
				"hegemony carbine",
				PickupObjectDatabase.GetById(229)
			},
			{
				"helix",
				PickupObjectDatabase.GetById(230)
			},
			{
				"gilded hydra",
				PickupObjectDatabase.GetById(231)
			},
			{
				"space friend",
				PickupObjectDatabase.GetById(232)
			},
			{
				"ibomb companion app",
				PickupObjectDatabase.GetById(234)
			},
			{
				"aged bell",
				PickupObjectDatabase.GetById(237)
			},
			{
				"duct tape",
				PickupObjectDatabase.GetById(239)
			},
			{
				"crutch",
				PickupObjectDatabase.GetById(240)
			},
			{
				"scattershot",
				PickupObjectDatabase.GetById(241)
			},
			{
				"napalm strike",
				PickupObjectDatabase.GetById(242)
			},
			{
				"infuriating note",
				PickupObjectDatabase.GetById(243)
			},
			{
				"owl",
				PickupObjectDatabase.GetById(249)
			},
			{
				"grappling hook",
				PickupObjectDatabase.GetById(250)
			},
			{
				"prize pistol",
				PickupObjectDatabase.GetById(251)
			},
			{
				"air strike",
				PickupObjectDatabase.GetById(252)
			},
			{
				"gungeon pepper",
				PickupObjectDatabase.GetById(253)
			},
			{
				"ring of chest friendship",
				PickupObjectDatabase.GetById(254)
			},
			{
				"ancient hero's bandana",
				PickupObjectDatabase.GetById(255)
			},
			{
				"heavy boots",
				PickupObjectDatabase.GetById(256)
			},
			{
				"broccoli",
				PickupObjectDatabase.GetById(258)
			},
			{
				"antibody",
				PickupObjectDatabase.GetById(259)
			},
			{
				"pink guon stone",
				PickupObjectDatabase.GetById(260)
			},
			{
				"white guon stone",
				PickupObjectDatabase.GetById(262)
			},
			{
				"orange guon stone",
				PickupObjectDatabase.GetById(263)
			},
			{
				"clear guon stone",
				PickupObjectDatabase.GetById(264)
			},
			{
				"old knight's flask",
				PickupObjectDatabase.GetById(267)
			},
			{
				"red guon stone",
				PickupObjectDatabase.GetById(269)
			},
			{
				"blue guon stone",
				PickupObjectDatabase.GetById(270)
			},
			{
				"riddle of lead",
				PickupObjectDatabase.GetById(271)
			},
			{
				"iron coin",
				PickupObjectDatabase.GetById(272)
			},
			{
				"laser sight",
				PickupObjectDatabase.GetById(273)
			},
			{
				"dark marker",
				PickupObjectDatabase.GetById(274)
			},
			{
				"flare gun",
				PickupObjectDatabase.GetById(275)
			},
			{
				"spice",
				PickupObjectDatabase.GetById(276)
			},
			{
				"fat bullets",
				PickupObjectDatabase.GetById(277)
			},
			{
				"frost bullets ",
				PickupObjectDatabase.GetById(278)
			},
			{
				"super hot watch",
				PickupObjectDatabase.GetById(279)
			},
			{
				"drum clip",
				PickupObjectDatabase.GetById(280)
			},
			{
				"gungeon blueprint",
				PickupObjectDatabase.GetById(281)
			},
			{
				"homing bullets",
				PickupObjectDatabase.GetById(284)
			},
			{
				"blood brooch",
				PickupObjectDatabase.GetById(285)
			},
			{
				"+1 bullets",
				PickupObjectDatabase.GetById(286)
			},
			{
				"backup gun",
				PickupObjectDatabase.GetById(287)
			},
			{
				"bouncy bullets",
				PickupObjectDatabase.GetById(288)
			},
			{
				"seven-leaf clover",
				PickupObjectDatabase.GetById(289)
			},
			{
				"sunglasses",
				PickupObjectDatabase.GetById(290)
			},
			{
				"meatbun",
				PickupObjectDatabase.GetById(291)
			},
			{
				"molotov launcher",
				PickupObjectDatabase.GetById(292)
			},
			{
				"mimic tooth necklace",
				PickupObjectDatabase.GetById(293)
			},
			{
				"ring of mimic friendship",
				PickupObjectDatabase.GetById(294)
			},
			{
				"hot lead",
				PickupObjectDatabase.GetById(295)
			},
			{
				"hegemony credit",
				PickupObjectDatabase.GetById(297)
			},
			{
				"shock rounds",
				PickupObjectDatabase.GetById(298)
			},
			{
				"super space turtle",
				PickupObjectDatabase.GetById(299)
			},
			{
				"dog",
				PickupObjectDatabase.GetById(300)
			},
			{
				"bullet that can kill the past",
				PickupObjectDatabase.GetById(303)
			},
			{
				"explosive rounds",
				PickupObjectDatabase.GetById(304)
			},
			{
				"old crest",
				PickupObjectDatabase.GetById(305)
			},
			{
				"escape rope",
				PickupObjectDatabase.GetById(306)
			},
			{
				"wax wings",
				PickupObjectDatabase.GetById(307)
			},
			{
				"cluster mine",
				PickupObjectDatabase.GetById(308)
			},
			{
				"cloranthy ring",
				PickupObjectDatabase.GetById(309)
			},
			{
				"fairy wings",
				PickupObjectDatabase.GetById(310)
			},
			{
				"clone",
				PickupObjectDatabase.GetById(311)
			},
			{
				"blast helmet",
				PickupObjectDatabase.GetById(312)
			},
			{
				"monster blood",
				PickupObjectDatabase.GetById(313)
			},
			{
				"nanomachines",
				PickupObjectDatabase.GetById(314)
			},
			{
				"gunboots",
				PickupObjectDatabase.GetById(315)
			},
			{
				"gnawed key",
				PickupObjectDatabase.GetById(316)
			},
			{
				"r2g2",
				PickupObjectDatabase.GetById(318)
			},
			{
				"ticket",
				PickupObjectDatabase.GetById(320)
			},
			{
				"gold ammolet",
				PickupObjectDatabase.GetById(321)
			},
			{
				"lodestone ammolet",
				PickupObjectDatabase.GetById(322)
			},
			{
				"angry bullets",
				PickupObjectDatabase.GetById(323)
			},
			{
				"chaos ammolet",
				PickupObjectDatabase.GetById(325)
			},
			{
				"number 2",
				PickupObjectDatabase.GetById(326)
			},
			{
				"corsair",
				PickupObjectDatabase.GetById(327)
			},
			{
				"charge shot",
				PickupObjectDatabase.GetById(328)
			},
			{
				"zilla shotgun",
				PickupObjectDatabase.GetById(329)
			},
			{
				"the emperor",
				PickupObjectDatabase.GetById(330)
			},
			{
				"science cannon",
				PickupObjectDatabase.GetById(331)
			},
			{
				"lil' bomber",
				PickupObjectDatabase.GetById(332)
			},
			{
				"mutation",
				PickupObjectDatabase.GetById(333)
			},
			{
				"wind up gun",
				PickupObjectDatabase.GetById(334)
			},
			{
				"silencer",
				PickupObjectDatabase.GetById(335)
			},
			{
				"pitchfork",
				PickupObjectDatabase.GetById(336)
			},
			{
				"composite gun",
				PickupObjectDatabase.GetById(337)
			},
			{
				"gunther",
				PickupObjectDatabase.GetById(338)
			},
			{
				"mahoguny",
				PickupObjectDatabase.GetById(339)
			},
			{
				"lower case r",
				PickupObjectDatabase.GetById(340)
			},
			{
				"buzzkill",
				PickupObjectDatabase.GetById(341)
			},
			{
				"uranium ammolet",
				PickupObjectDatabase.GetById(342)
			},
			{
				"copper ammolet",
				PickupObjectDatabase.GetById(343)
			},
			{
				"frost ammolet",
				PickupObjectDatabase.GetById(344)
			},
			{
				"fightsabre",
				PickupObjectDatabase.GetById(345)
			},
			{
				"huntsman",
				PickupObjectDatabase.GetById(346)
			},
			{
				"shotgrub",
				PickupObjectDatabase.GetById(347)
			},
			{
				"prime primer",
				PickupObjectDatabase.GetById(348)
			},
			{
				"planar lead",
				PickupObjectDatabase.GetById(349)
			},
			{
				"obsidian shell casing",
				PickupObjectDatabase.GetById(350)
			},
			{
				"arcane gunpowder",
				PickupObjectDatabase.GetById(351)
			},
			{
				"shadow bullets",
				PickupObjectDatabase.GetById(352)
			},
			{
				"enraging photo",
				PickupObjectDatabase.GetById(353)
			},
			{
				"military training",
				PickupObjectDatabase.GetById(354)
			},
			{
				"chromesteel assault rifle",
				PickupObjectDatabase.GetById(355)
			},
			{
				"trusty lockpicks",
				PickupObjectDatabase.GetById(356)
			},
			{
				"cat claw",
				PickupObjectDatabase.GetById(357)
			},
			{
				"railgun",
				PickupObjectDatabase.GetById(358)
			},
			{
				"compressed air tank",
				PickupObjectDatabase.GetById(359)
			},
			{
				"snakemaker",
				PickupObjectDatabase.GetById(360)
			},
			{
				"bullet bore",
				PickupObjectDatabase.GetById(362)
			},
			{
				"trick gun",
				PickupObjectDatabase.GetById(363)
			},
			{
				"heart of ice",
				PickupObjectDatabase.GetById(364)
			},
			{
				"mass shotgun",
				PickupObjectDatabase.GetById(365)
			},
			{
				"molotov",
				PickupObjectDatabase.GetById(366)
			},
			{
				"hunter's journal",
				PickupObjectDatabase.GetById(367)
			},
			{
				"el tigre",
				PickupObjectDatabase.GetById(368)
			},
			{
				"bait launcher",
				PickupObjectDatabase.GetById(369)
			},
			{
				"prototype railgun",
				PickupObjectDatabase.GetById(370)
			},
			{
				"rc rocket",
				PickupObjectDatabase.GetById(372)
			},
			{
				"alpha bullet",
				PickupObjectDatabase.GetById(373)
			},
			{
				"omega bullets",
				PickupObjectDatabase.GetById(374)
			},
			{
				"easy reload bullets",
				PickupObjectDatabase.GetById(375)
			},
			{
				"brick breaker",
				PickupObjectDatabase.GetById(376)
			},
			{
				"excaliber",
				PickupObjectDatabase.GetById(377)
			},
			{
				"derringer",
				PickupObjectDatabase.GetById(378)
			},
			{
				"shotgun full of love",
				PickupObjectDatabase.GetById(379)
			},
			{
				"betrayer's shield",
				PickupObjectDatabase.GetById(380)
			},
			{
				"triple crossbow",
				PickupObjectDatabase.GetById(381)
			},
			{
				"sling",
				PickupObjectDatabase.GetById(382)
			},
			{
				"flash ray",
				PickupObjectDatabase.GetById(383)
			},
			{
				"phoenix",
				PickupObjectDatabase.GetById(384)
			},
			{
				"hexagun",
				PickupObjectDatabase.GetById(385)
			},
			{
				"frost giant",
				PickupObjectDatabase.GetById(387)
			},
			{
				"cobalt hammer",
				PickupObjectDatabase.GetById(390)
			},
			{
				"cell key",
				PickupObjectDatabase.GetById(392)
			},
			{
				"anvillain",
				PickupObjectDatabase.GetById(393)
			},
			{
				"mine cutter",
				PickupObjectDatabase.GetById(394)
			},
			{
				"staff of firepower",
				PickupObjectDatabase.GetById(395)
			},
			{
				"table tech sight",
				PickupObjectDatabase.GetById(396)
			},
			{
				"table tech money",
				PickupObjectDatabase.GetById(397)
			},
			{
				"table tech rocket",
				PickupObjectDatabase.GetById(398)
			},
			{
				"table tech rage",
				PickupObjectDatabase.GetById(399)
			},
			{
				"table tech blanks",
				PickupObjectDatabase.GetById(400)
			},
			{
				"gungine",
				PickupObjectDatabase.GetById(401)
			},
			{
				"snowballer",
				PickupObjectDatabase.GetById(402)
			},
			{
				"melted rock",
				PickupObjectDatabase.GetById(403)
			},
			{
				"siren",
				PickupObjectDatabase.GetById(404)
			},
			{
				"rattler",
				PickupObjectDatabase.GetById(406)
			},
			{
				"sixth chamber",
				PickupObjectDatabase.GetById(407)
			},
			{
				"busted television",
				PickupObjectDatabase.GetById(409)
			},
			{
				"battery bullets",
				PickupObjectDatabase.GetById(410)
			},
			{
				"coolant leak",
				PickupObjectDatabase.GetById(411)
			},
			{
				"friendship cookie",
				PickupObjectDatabase.GetById(412)
			},
			{
				"hero's sword",
				PickupObjectDatabase.GetById(413)
			},
			{
				"live ammo",
				PickupObjectDatabase.GetById(414)
			},
			{
				"replacement arm",
				PickupObjectDatabase.GetById(415)
			},
			{
				"balloon!",
				PickupObjectDatabase.GetById(416)
			},
			{
				"blasphemy",
				PickupObjectDatabase.GetById(417)
			},
			{
				"heart holster",
				PickupObjectDatabase.GetById(421)
			},
			{
				"heart lunchbox",
				PickupObjectDatabase.GetById(422)
			},
			{
				"heart locket",
				PickupObjectDatabase.GetById(423)
			},
			{
				"heart bottle",
				PickupObjectDatabase.GetById(424)
			},
			{
				"heart purse",
				PickupObjectDatabase.GetById(425)
			},
			{
				"shotga cola",
				PickupObjectDatabase.GetById(426)
			},
			{
				"shotgun coffee",
				PickupObjectDatabase.GetById(427)
			},
			{
				"liquid valkyrie",
				PickupObjectDatabase.GetById(431)
			},
			{
				"jar of bees",
				PickupObjectDatabase.GetById(432)
			},
			{
				"stuffed star",
				PickupObjectDatabase.GetById(433)
			},
			{
				"bullet idol",
				PickupObjectDatabase.GetById(434)
			},
			{
				"mustache",
				PickupObjectDatabase.GetById(435)
			},
			{
				"bloodied scarf",
				PickupObjectDatabase.GetById(436)
			},
			{
				"muscle relaxant",
				PickupObjectDatabase.GetById(437)
			},
			{
				"explosive decoy",
				PickupObjectDatabase.GetById(438)
			},
			{
				"bracket key",
				PickupObjectDatabase.GetById(439)
			},
			{
				"ruby bracelet",
				PickupObjectDatabase.GetById(440)
			},
			{
				"emerald bracelet",
				PickupObjectDatabase.GetById(441)
			},
			{
				"badge",
				PickupObjectDatabase.GetById(442)
			},
			{
				"big boy",
				PickupObjectDatabase.GetById(443)
			},
			{
				"trident",
				PickupObjectDatabase.GetById(444)
			},
			{
				"the scrambler",
				PickupObjectDatabase.GetById(445)
			},
			{
				"shield of the maiden",
				PickupObjectDatabase.GetById(447)
			},
			{
				"boomerang",
				PickupObjectDatabase.GetById(448)
			},
			{
				"teleporter prototype",
				PickupObjectDatabase.GetById(449)
			},
			{
				"armor synthesizer",
				PickupObjectDatabase.GetById(450)
			},
			{
				"hero pig",
				PickupObjectDatabase.GetById(451)
			},
			{
				"sponge",
				PickupObjectDatabase.GetById(452)
			},
			{
				"gas mask",
				PickupObjectDatabase.GetById(453)
			},
			{
				"hazmat suit",
				PickupObjectDatabase.GetById(454)
			},
			{
				"ring of triggers",
				PickupObjectDatabase.GetById(456)
			},
			{
				"armor of thorns",
				PickupObjectDatabase.GetById(457)
			},
			{
				"ring of ethereal form",
				PickupObjectDatabase.GetById(458)
			},
			{
				"chaff grenade",
				PickupObjectDatabase.GetById(460)
			},
			{
				"blank companion's ring",
				PickupObjectDatabase.GetById(461)
			},
			{
				"smoke bomb",
				PickupObjectDatabase.GetById(462)
			},
			{
				"ring of the resourceful rat",
				PickupObjectDatabase.GetById(463)
			},
			{
				"shellegun",
				PickupObjectDatabase.GetById(464)
			},
			{
				"table tech stun",
				PickupObjectDatabase.GetById(465)
			},
			{
				"green guon stone",
				PickupObjectDatabase.GetById(466)
			},
			{
				"master round",
				PickupObjectDatabase.GetById(467)
			},
			{
				"hidden compartment",
				PickupObjectDatabase.GetById(473)
			},
			{
				"abyssal tentacle",
				PickupObjectDatabase.GetById(474)
			},
			{
				"quad laser",
				PickupObjectDatabase.GetById(475)
			},
			{
				"microtransaction gun",
				PickupObjectDatabase.GetById(476)
			},
			{
				"origuni",
				PickupObjectDatabase.GetById(477)
			},
			{
				"banana",
				PickupObjectDatabase.GetById(478)
			},
			{
				"super meat gun",
				PickupObjectDatabase.GetById(479)
			},
			{
				"makeshift cannon",
				PickupObjectDatabase.GetById(480)
			},
			{
				"camera",
				PickupObjectDatabase.GetById(481)
			},
			{
				"gunzheng",
				PickupObjectDatabase.GetById(482)
			},
			{
				"tetrominator",
				PickupObjectDatabase.GetById(483)
			},
			{
				"devolver",
				PickupObjectDatabase.GetById(484)
			},
			{
				"orange",
				PickupObjectDatabase.GetById(485)
			},
			{
				"items_string_not_found",
				PickupObjectDatabase.GetById(486)
			},
			{
				"book of chest anatomy",
				PickupObjectDatabase.GetById(487)
			},
			{
				"ring of chest vampirism",
				PickupObjectDatabase.GetById(488)
			},
			{
				"gun soul",
				PickupObjectDatabase.GetById(489)
			},
			{
				"brick of cash",
				PickupObjectDatabase.GetById(490)
			},
			{
				"wingman",
				PickupObjectDatabase.GetById(491)
			},
			{
				"wolf",
				PickupObjectDatabase.GetById(492)
			},
			{
				"briefcase of cash",
				PickupObjectDatabase.GetById(493)
			},
			{
				"galactic medal of valor",
				PickupObjectDatabase.GetById(494)
			},
			{
				"unity",
				PickupObjectDatabase.GetById(495)
			},
			{
				"elder blank",
				PickupObjectDatabase.GetById(499)
			},
			{
				"hip holster",
				PickupObjectDatabase.GetById(500)
			},
			{
				"bullet",
				PickupObjectDatabase.GetById(503)
			},
			{
				"hyper light blaster",
				PickupObjectDatabase.GetById(504)
			},
			{
				"really special lute",
				PickupObjectDatabase.GetById(506)
			},
			{
				"starpew",
				PickupObjectDatabase.GetById(507)
			},
			{
				"dueling laser",
				PickupObjectDatabase.GetById(508)
			},
			{
				"jk-47",
				PickupObjectDatabase.GetById(510)
			},
			{
				"3rd party controller",
				PickupObjectDatabase.GetById(511)
			},
			{
				"shell",
				PickupObjectDatabase.GetById(512)
			},
			{
				"poxcannon",
				PickupObjectDatabase.GetById(513)
			},
			{
				"directional pad",
				PickupObjectDatabase.GetById(514)
			},
			{
				"mourning star",
				PickupObjectDatabase.GetById(515)
			},
			{
				"triple gun",
				PickupObjectDatabase.GetById(516)
			},
			{
				"combined rifle",
				PickupObjectDatabase.GetById(519)
			},
			{
				"balloon gun",
				PickupObjectDatabase.GetById(520)
			},
			{
				"chance bullets",
				PickupObjectDatabase.GetById(521)
			},
			{
				"stout bullets",
				PickupObjectDatabase.GetById(523)
			},
			{
				"bloody 9mm",
				PickupObjectDatabase.GetById(524)
			},
			{
				"lament configurum",
				PickupObjectDatabase.GetById(525)
			},
			{
				"springheel boots",
				PickupObjectDatabase.GetById(526)
			},
			{
				"charming rounds",
				PickupObjectDatabase.GetById(527)
			},
			{
				"zombie bullets",
				PickupObjectDatabase.GetById(528)
			},
			{
				"battle standard",
				PickupObjectDatabase.GetById(529)
			},
			{
				"remote bullets",
				PickupObjectDatabase.GetById(530)
			},
			{
				"flak bullets",
				PickupObjectDatabase.GetById(531)
			},
			{
				"gilded bullets",
				PickupObjectDatabase.GetById(532)
			},
			{
				"magic bullets",
				PickupObjectDatabase.GetById(533)
			},
			{
				"relodestone",
				PickupObjectDatabase.GetById(536)
			},
			{
				"vorpal gun",
				PickupObjectDatabase.GetById(537)
			},
			{
				"silver bullets",
				PickupObjectDatabase.GetById(538)
			},
			{
				"boxing glove",
				PickupObjectDatabase.GetById(539)
			},
			{
				"glass cannon",
				PickupObjectDatabase.GetById(540)
			},
			{
				"casey",
				PickupObjectDatabase.GetById(541)
			},
			{
				"strafe® gun",
				PickupObjectDatabase.GetById(542)
			},
			{
				"the predator",
				PickupObjectDatabase.GetById(543)
			},
			{
				"ac-15",
				PickupObjectDatabase.GetById(545)
			},
			{
				"windgunner",
				PickupObjectDatabase.GetById(546)
			},
			{
				"knight's gun",
				PickupObjectDatabase.GetById(550)
			},
			{
				"crown of guns",
				PickupObjectDatabase.GetById(551)
			},
			{
				"bottle",
				PickupObjectDatabase.GetById(558)
			},
			{
				"the fat line",
				PickupObjectDatabase.GetById(562)
			},
			{
				"the exotic",
				PickupObjectDatabase.GetById(563)
			},
			{
				"full metal jacket",
				PickupObjectDatabase.GetById(564)
			},
			{
				"glass guon stone",
				PickupObjectDatabase.GetById(565)
			},
			{
				"rad gun",
				PickupObjectDatabase.GetById(566)
			},
			{
				"roll bomb",
				PickupObjectDatabase.GetById(567)
			},
			{
				"helix bullets",
				PickupObjectDatabase.GetById(568)
			},
			{
				"chaos bullets",
				PickupObjectDatabase.GetById(569)
			},
			{
				"yellow chamber",
				PickupObjectDatabase.GetById(570)
			},
			{
				"cursed bullets",
				PickupObjectDatabase.GetById(571)
			},
			{
				"chicken flute",
				PickupObjectDatabase.GetById(572)
			},
			{
				"chest teleporter",
				PickupObjectDatabase.GetById(573)
			},
			{
				"robot's left hand",
				PickupObjectDatabase.GetById(576)
			},
			{
				"turbo-gun",
				PickupObjectDatabase.GetById(577)
			},
			{
				"sprun",
				PickupObjectDatabase.GetById(578)
			},
			{
				"blank bullets",
				PickupObjectDatabase.GetById(579)
			},
			{
				"void core cannon",
				PickupObjectDatabase.GetById(593)
			},
			{
				"moonlight tiara",
				PickupObjectDatabase.GetById(594)
			},
			{
				"life orb",
				PickupObjectDatabase.GetById(595)
			},
			{
				"teapot",
				PickupObjectDatabase.GetById(596)
			},
			{
				"mr. accretion jr.",
				PickupObjectDatabase.GetById(597)
			},
			{
				"stone dome",
				PickupObjectDatabase.GetById(598)
			},
			{
				"bubble blaster",
				PickupObjectDatabase.GetById(599)
			},
			{
				"big shotgun",
				PickupObjectDatabase.GetById(601)
			},
			{
				"gunner",
				PickupObjectDatabase.GetById(602)
			},
			{
				"slinger",
				PickupObjectDatabase.GetById(604)
			},
			{
				"loot bag",
				PickupObjectDatabase.GetById(605)
			},
			{
				"clown mask",
				PickupObjectDatabase.GetById(607)
			},
			{
				"rubenstein's monster",
				PickupObjectDatabase.GetById(609)
			},
			{
				"wood beam",
				PickupObjectDatabase.GetById(610)
			},
			{
				"heroine (wave beam)",
				PickupObjectDatabase.GetById(612)
			},
			{
				"heroine (ice beam)",
				PickupObjectDatabase.GetById(613)
			},
			{
				"heroine (plasma beam)",
				PickupObjectDatabase.GetById(614)
			},
			{
				"heroine (hyper beam)",
				PickupObjectDatabase.GetById(615)
			},
			{
				"quick boomerang",
				PickupObjectDatabase.GetById(617)
			},
			{
				"time stopper",
				PickupObjectDatabase.GetById(618)
			},
			{
				"metal blade",
				PickupObjectDatabase.GetById(619)
			},
			{
				"leaf shield",
				PickupObjectDatabase.GetById(620)
			},
			{
				"atomic fire",
				PickupObjectDatabase.GetById(621)
			},
			{
				"bubble lead",
				PickupObjectDatabase.GetById(622)
			},
			{
				"air shooter",
				PickupObjectDatabase.GetById(623)
			},
			{
				"crash bomber",
				PickupObjectDatabase.GetById(624)
			},
			{
				"drill",
				PickupObjectDatabase.GetById(625)
			},
			{
				"elimentaler",
				PickupObjectDatabase.GetById(626)
			},
			{
				"platinum bullets",
				PickupObjectDatabase.GetById(627)
			},
			{
				"bumbullets",
				PickupObjectDatabase.GetById(630)
			},
			{
				"holey grail",
				PickupObjectDatabase.GetById(631)
			},
			{
				"turkey",
				PickupObjectDatabase.GetById(632)
			},
			{
				"table tech shotgun",
				PickupObjectDatabase.GetById(633)
			},
			{
				"crisis stone",
				PickupObjectDatabase.GetById(634)
			},
			{
				"snowballets",
				PickupObjectDatabase.GetById(636)
			},
			{
				"weird egg",
				PickupObjectDatabase.GetById(637)
			},
			{
				"devolver rounds",
				PickupObjectDatabase.GetById(638)
			},
			{
				"vorpal bullets",
				PickupObjectDatabase.GetById(640)
			},
			{
				"gold junk",
				PickupObjectDatabase.GetById(641)
			},
			{
				"daruma",
				PickupObjectDatabase.GetById(643)
			},
			{
				"portable table device",
				PickupObjectDatabase.GetById(644)
			},
			{
				"turtle problem",
				PickupObjectDatabase.GetById(645)
			},
			{
				"chamber gun",
				PickupObjectDatabase.GetById(647)
			},
			{
				"uppercase r",
				PickupObjectDatabase.GetById(649)
			},
			{
				"hungry bullets",
				PickupObjectDatabase.GetById(655)
			},
			{
				"kruller glaive",
				PickupObjectDatabase.GetById(656)
			},
			{
				"orbital bullets",
				PickupObjectDatabase.GetById(661)
			},
			{
				"partially-eaten cheese",
				PickupObjectDatabase.GetById(662)
			},
			{
				"resourceful sack",
				PickupObjectDatabase.GetById(663)
			},
			{
				"baby good mimic",
				PickupObjectDatabase.GetById(664)
			},
			{
				"macho brace",
				PickupObjectDatabase.GetById(665)
			},
			{
				"table tech heat",
				PickupObjectDatabase.GetById(666)
			},
			{
				"rat boots",
				PickupObjectDatabase.GetById(667)
			},
			{
				"high dragunfire",
				PickupObjectDatabase.GetById(670)
			},
			{
				"gunderfury",
				PickupObjectDatabase.GetById(732)
			},
			{
				"mimic",
				PickupObjectDatabase.GetById(734)
			},
			{
				"sunlight javelin",
				PickupObjectDatabase.GetById(748)
			},
			{
				"evolver",
				PickupObjectDatabase.GetById(755)
			},
			{
				"high kaliber",
				PickupObjectDatabase.GetById(761)
			},
			{
				"finished gun",
				PickupObjectDatabase.GetById(762)
			},
			{
				"magazine rack",
				PickupObjectDatabase.GetById(814)
			},
			{
				"lich's eye bullets",
				PickupObjectDatabase.GetById(815)
			},
			{
				"cat bullet king throne",
				PickupObjectDatabase.GetById(817)
			},
			{
				"baby good shelleton",
				PickupObjectDatabase.GetById(818)
			},
			{
				"shadow clone",
				PickupObjectDatabase.GetById(820)
			},
			{
				"scouter",
				PickupObjectDatabase.GetById(821)
			},
			{
				"katana bullets",
				PickupObjectDatabase.GetById(822)
			}
		};

		[HarmonyPatch(typeof(GunExt), "SetName")]
		[HarmonyPostfix]
		public static void RegisterEnglishName(PickupObject item, string text)
		{
			if (!EnglishItemNames.ContainsKey(text.ToLowerInvariant()) && !EnglishItemNames.ContainsValue(item))
			{
				EnglishItemNames[text.ToLowerInvariant()] = item;
			}
		}

		[HarmonyPatch(typeof(PickupObjectDatabase), "GetByEncounterName")]
		[HarmonyPrefix]
		public static bool MaybeGetByEnglishName(ref PickupObject __result, string name)
		{
			if (EnglishItemNames.TryGetValue(name.ToLowerInvariant(), out var value) && (Object)(object)value != (Object)null)
			{
				__result = value;
				return false;
			}
			return true;
		}
	}
	public static class ILTools
	{
		public static bool JumpToNext(this ILCursor crs, Func<Instruction, bool> match, int times = 1)
		{
			for (int i = 0; i < times; i++)
			{
				if (!crs.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1] { match }))
				{
					return false;
				}
			}
			return true;
		}

		public static bool JumpBeforeNext(this ILCursor crs, Func<Instruction, bool> match, int times = 1)
		{
			for (int i = 0; i < times; i++)
			{
				if (!crs.TryGotoNext((MoveType)((i != times - 1) ? 2 : 0), new Func<Instruction, bool>[1] { match }))
				{
					return false;
				}
			}
			return true;
		}

		public static IEnumerable MatchAfter(this ILCursor crs, Func<Instruction, bool> match)
		{
			Instruction curr = crs.Next;
			crs.Index = 0;
			while (crs.JumpToNext(match))
			{
				yield return null;
			}
			crs.Next = curr;
		}

		public static IEnumerable MatchBefore(this ILCursor crs, Func<Instruction, bool> match)
		{
			Instruction curr = crs.Next;
			crs.Index = 0;
			while (crs.JumpBeforeNext(match))
			{
				Instruction c = crs.Next;
				yield return null;
				crs.Goto(c, (MoveType)2, false);
			}
			crs.Next = curr;
		}

		public static VariableDefinition DeclareLocal<T>(this ILContext ctx)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			VariableDefinition val = new VariableDefinition(ctx.Import(typeof(T)));
			ctx.Body.Variables.Add(val);
			return val;
		}

		public static VariableDefinition DeclareLocal<T>(this ILCursor crs)
		{
			return crs.Context.DeclareLocal<T>();
		}

		public static bool TryGotoArg(this ILCursor crs, Instruction targetInstr, int argIndex, int instance = 0)
		{
			if (argIndex < 0)
			{
				return false;
			}
			if (instance < 0)
			{
				return false;
			}
			if (targetInstr == null)
			{
				return false;
			}
			List<Instruction> argumentInstructions = targetInstr.GetArgumentInstructions(crs.Context, argIndex);
			if (instance >= argumentInstructions.Count)
			{
				return false;
			}
			crs.Goto(argumentInstructions[instance], (MoveType)2, false);
			return true;
		}

		public static bool TryGotoArg(this ILCursor crs, int argIndex, int instance = 0)
		{
			return crs.TryGotoArg(crs.Next, argIndex, instance);
		}

		public static IEnumerable MatchArg(this ILCursor crs, Instruction targetInstr, int argIndex)
		{
			if (argIndex < 0 || targetInstr == null)
			{
				yield break;
			}
			Instruction curr = crs.Next;
			List<Instruction> argumentInstrs = targetInstr.GetArgumentInstructions(crs.Context, argIndex);
			foreach (Instruction arg in argumentInstrs)
			{
				crs.Goto(arg, (MoveType)2, false);
				yield return null;
			}
			crs.Next = curr;
		}

		public static IEnumerable MatchArg(this ILCursor crs, int argIndex)
		{
			return crs.MatchArg(crs.Next, argIndex);
		}

		private static List<Instruction> GetArgumentInstructions(this Instruction instruction, ILContext context, int argumentIndex)
		{
			int num = instruction.InputCount();
			int num2 = num - argumentIndex - 1;
			if (num2 < 0)
			{
				Debug.Log((object)$"Argument index {argumentIndex} is higher than the highest argument index ({num - 1})");
				return new List<Instruction>();
			}
			List<Instruction> list = instruction.PossiblePreviousInstructions(context);
			List<Instruction> list2 = new List<Instruction>();
			foreach (Instruction item in list)
			{
				BacktrackToArg(item, context, num2, list2);
			}
			list2.Sort((Instruction a, Instruction b) => context.IndexOf(a).CompareTo(context.IndexOf(b)));
			return list2;
		}

		private static void BacktrackToArg(Instruction current, ILContext ctx, int remainingMoves, List<Instruction> foundArgs)
		{
			if (remainingMoves <= 0 && current.OutputCount() > 0)
			{
				if (remainingMoves == 0)
				{
					foundArgs.Add(current);
				}
				return;
			}
			remainingMoves -= current.StackDelta();
			List<Instruction> list = current.PossiblePreviousInstructions(ctx);
			foreach (Instruction item in list)
			{
				BacktrackToArg(item, ctx, remainingMoves, foundArgs);
			}
		}

		public static int InputCount(this Instruction instr)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Invalid comparison between Unknown and I4
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Invalid comparison between Unknown and I4
			//IL_00aa: 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_00f7: Expected I4, but got Unknown
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Invalid comparison between Unknown and I4
			if (instr == null)
			{
				return 0;
			}
			OpCode opCode = instr.OpCode;
			if ((int)((OpCode)(ref opCode)).FlowControl == 2)
			{
				IMethodSignature val = (IMethodSignature)instr.Operand;
				int num = 0;
				if ((int)((OpCode)(ref opCode)).Code != 114 && val.HasThis && !val.ExplicitThis)
				{
					num++;
				}
				if (val.HasParameters)
				{
					num += val.Parameters.Count;
				}
				if ((int)((OpCode)(ref opCode)).Code == 40)
				{
					num++;
				}
				return num;
			}
			StackBehaviour stackBehaviourPop = ((OpCode)(ref opCode)).StackBehaviourPop;
			if (1 == 0)
			{
			}
			int result;
			switch (stackBehaviourPop - 1)
			{
			case 0:
			case 2:
			case 9:
				result = 1;
				break;
			case 1:
			case 3:
			case 4:
			case 5:
			case 7:
			case 8:
			case 10:
			case 11:
				result = 2;
				break;
			case 6:
			case 12:
			case 13:
			case 14:
			case 15:
			case 16:
				result = 3;
				break;
			default:
				result = 0;
				break;
			}
			if (1 == 0)
			{
			}
			return result;
		}

		public static int OutputCount(this Instruction instr)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Invalid comparison between Unknown and I4
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Invalid comparison between Unknown and I4
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Expected I4, but got Unknown
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Invalid comparison between Unknown and I4
			if (instr == null)
			{
				return 0;
			}
			OpCode opCode = instr.OpCode;
			if ((int)((OpCode)(ref opCode)).FlowControl == 2)
			{
				IMethodSignature val = (IMethodSignature)instr.Operand;
				int num = 0;
				if ((int)((OpCode)(ref opCode)).Code == 114 || (int)val.ReturnType.MetadataType != 1)
				{
					num++;
				}
				return num;
			}
			StackBehaviour stackBehaviourPush = ((OpCode)(ref opCode)).StackBehaviourPush;
			if (1 == 0)
			{
			}
			int result;
			switch (stackBehaviourPush - 20)
			{
			case 0:
			case 2:
			case 3:
			case 4:
			case 5:
			case 6:
				result = 1;
				break;
			case 1:
				result = 2;
				break;
			default:
				result = 0;
				break;
			}
			if (1 == 0)
			{
			}
			return result;
		}

		public static int StackDelta(this Instruction instr)
		{
			return instr.OutputCount() - instr.InputCount();
		}

		public static List<Instruction> PossiblePreviousInstructions(this Instruction instr, ILContext ctx)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			List<Instruction> list = new List<Instruction>();
			Enumerator<Instruction> enumerator = ctx.Instrs.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					Instruction current = enumerator.Current;
					if (Array.IndexOf(current.PossibleNextInstructions(), instr) >= 0)
					{
						list.Add(current);
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			return list;
		}

		public static Instruction[] PossibleNextInstructions(this Instruction instr)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected I4, but got Unknown
			OpCode opCode = instr.OpCode;
			FlowControl flowControl = ((OpCode)(ref opCode)).FlowControl;
			if (1 == 0)
			{
			}
			Instruction[] result;
			switch ((int)flowControl)
			{
			case 2:
			case 5:
				result = (Instruction[])(object)new Instruction[1] { instr.Next };
				break;
			case 0:
			{
				Instruction branchTarget2 = instr.GetBranchTarget();
				result = (Instruction[])(object)((branchTarget2 == null) ? new Instruction[0] : new Instruction[1] { branchTarget2 });
				break;
			}
			case 3:
			{
				Instruction branchTarget = instr.GetBranchTarget();
				result = (Instruction[])(object)((branchTarget == null) ? new Instruction[1] { instr.Next } : new Instruction[2] { instr.Next, branchTarget });
				break;
			}
			default:
				result = (Instruction[])(object)new Instruction[0];
				break;
			}
			if (1 == 0)
			{
			}
			return result;
		}

		public static Instruction GetBranchTarget(this Instruction branch)
		{
			object operand = branch.Operand;
			Instruction val = (Instruction)((operand is Instruction) ? operand : null);
			if (val != null)
			{
				return val;
			}
			object operand2 = branch.Operand;
			return ((ILLabel)(((operand2 is ILLabel) ? operand2 : null)?)).Target;
		}

		public static string InstructionToString(this Instruction c)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Invalid comparison between Unknown and I4
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Invalid comparison between Unknown and I4
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				return ((object)c).ToString();
			}
			catch
			{
				try
				{
					OpCode opCode = c.OpCode;
					OperandType operandType = ((OpCode)(ref opCode)).OperandType;
					if (((int)operandType == 0 || (int)operandType == 15) ? true : false)
					{
						object operand = c.Operand;
						ILLabel val = (ILLabel)((operand is ILLabel) ? operand : null);
						if (val != null)
						{
							object arg = c.Offset;
							opCode = c.OpCode;
							return $"IL_{arg:x4}: {((OpCode)(ref opCode)).Name} IL_{val.Target.Offset:x4}";
						}
					}
					opCode = c.OpCode;
					if ((int)((OpCode)(ref opCode)).OperandType == 10 && c.Operand is IEnumerable<ILLabel> source)
					{
						object arg2 = c.Offset;
						opCode = c.OpCode;
						return string.Format("IL_{0:x4}: {1} {2}", arg2, ((OpCode)(ref opCode)).Name, string.Join(", ", source.Select((ILLabel x) => x.Target.Offset.ToString("x4")).ToArray()));
					}
				}
				catch
				{
				}
			}
			return "This shouldn't be happening";
		}

		public static T EnumeratorGetField<T>(this object obj, string name)
		{
			return (T)obj.GetType().EnumeratorField(name).GetValue(obj);
		}

		public static FieldInfo EnumeratorField(this MethodBase method, string name)
		{
			return method.DeclaringType.EnumeratorField(name);
		}

		public static FieldInfo EnumeratorField(this Type tp, string name)
		{
			return tp.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).First((FieldInfo x) => (object)x != null && x.Name != null && (x.Name.Contains("<" + name + ">") || x.Name == name));
		}
	}
	[HarmonyPatch]
	public static class GeneralPatches
	{
		[HarmonyPatch(typeof(AudioAnimatorListener), "Start")]
		[HarmonyPrefix]
		public static bool AudioAnimatorListenerFix_Start_Prefix(AudioAnimatorListener __instance)
		{
			if ((Object)(object)__instance == (Object)null || (Object)(object)((BraveBehaviour)__instance).spriteAnimator == (Object)null)
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(PlayerOrbital), "OnDestroy")]
		[HarmonyPrefix]
		public static bool PlayerOrbitalFix_OnDestroy_Prefix(PlayerOrbital __instance)
		{
			if ((Object)(object)__instance == (Object)null || (Object)(object)__instance.Owner == (Object)null || __instance.Owner.orbitals == null)
			{
				return false;
			}
			return true;
		}
	}
	[BepInPlugin("spapi.etg.moddedbugfix", "Modded Bugfix", "1.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		public const string GUID = "spapi.etg.moddedbugfix";

		public const string NAME = "Modded Bugfix";

		public const string VERSION = "1.1.0";

		public static Harmony HarmonyInstance;

		public void Start()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			HarmonyInstance = new Harmony("spapi.etg.moddedbugfix");
			HarmonyInstance.PatchAll();
			if (Chainloader.PluginInfos.ContainsKey("kp.etg.frostandgunfire"))
			{
				FrostAndGunfire.Patch();
			}
			if (Chainloader.PluginInfos.ContainsKey("blazeykat.etg.prismatism"))
			{
				Prismatism.Patch();
			}
			if (Chainloader.PluginInfos.ContainsKey("Retrash"))
			{
				RetrashItems.Patch();
			}
			if (Chainloader.PluginInfos.ContainsKey("bleak.etg.abip"))
			{
				Bleaker.Patch();
			}
		}
	}
}
namespace ModdedBugFix.Mods
{
	public static class Bleaker
	{
		public static MethodInfo cf_u_p = AccessTools.Method(typeof(Bleaker), "CarrotFix_Update_Prefix", (Type[])null, (Type[])null);

		public static MethodInfo cf_u_t = AccessTools.Method(typeof(Bleaker), "CarrotFix_Update_Transpiler", (Type[])null, (Type[])null);

		public static MethodInfo cf_u_cn = AccessTools.Method(typeof(Bleaker), "CarrotFix_Update_CameraNullcheck", (Type[])null, (Type[])null);

		public static MethodInfo coff_dtf_t = AccessTools.Method(typeof(Bleaker), "ChamberOfFrogsFix_DoTongueFlick_Transpiler", (Type[])null, (Type[])null);

		public static MethodInfo coff_dtf_cn = AccessTools.Method(typeof(Bleaker), "ChamberOfFrogsFix_DoTongueFlick_CheckNearest", (Type[])null, (Type[])null);

		public static MethodInfo coff_dtf_n = AccessTools.Method(typeof(Bleaker), "ChamberOfFrogsFix_DoTongueflick_Null", (Type[])null, (Type[])null);

		public static MethodInfo whf_u_t = AccessTools.Method(typeof(Bleaker), "WinchestersHatFix_Update_Transpiler", (Type[])null, (Type[])null);

		public static MethodInfo whf_u_n_1 = AccessTools.Method(typeof(Bleaker), "WinchestersHatFix_Update_Nullcheck_1", (Type[])null, (Type[])null);

		public static MethodInfo whf_u_n_2 = AccessTools.Method(typeof(Bleaker), "WinchestersHatFix_Update_Nullcheck_2", (Type[])null, (Type[])null);

		public static MethodInfo whf_sva_p = AccessTools.Method(typeof(Bleaker), "WinchestersHatFix_SpawnVFXAttached_Prefix", (Type[])null, (Type[])null);

		public static void Patch()
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_0052: Expected O, but got Unknown
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Expected O, but got Unknown
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Expected O, but got Unknown
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Expected O, but got Unknown
			Type type = AccessTools.TypeByName("BleakMod.Carrot");
			if ((object)type != null)
			{
				MethodInfo methodInfo = AccessTools.Method(type, "Update", (Type[])null, (Type[])null);
				if ((object)methodInfo != null)
				{
					Plugin.HarmonyInstance.Patch((MethodBase)methodInfo, new HarmonyMethod(cf_u_p), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(cf_u_t));
				}
			}
			Type type2 = AccessTools.TypeByName("BleakMod.ChamberOfFrogs+FrogTongueBehavior");
			if ((object)type2 != null)
			{
				MethodInfo methodInfo2 = AccessTools.Method(type2, "DoTongueFlick", (Type[])null, (Type[])null);
				if ((object)methodInfo2 != null)
				{
					Plugin.HarmonyInstance.Patch((MethodBase)methodInfo2, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(coff_dtf_t));
				}
			}
			Type type3 = AccessTools.TypeByName("BleakMod.WinchestersHat");
			if ((object)type3 != null)
			{
				MethodInfo methodInfo3 = AccessTools.Method(type3, "Update", (Type[])null, (Type[])null);
				MethodInfo methodInfo4 = AccessTools.Method(type3, "SpawnVFXAttached", (Type[])null, (Type[])null);
				if ((object)methodInfo3 != null)
				{
					Plugin.HarmonyInstance.Patch((MethodBase)methodInfo3, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(whf_u_t));
				}
				if ((object)methodInfo4 != null)
				{
					Plugin.HarmonyInstance.Patch((MethodBase)methodInfo4, new HarmonyMethod(whf_sva_p), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				}
			}
		}

		public static bool CarrotFix_Update_Prefix(PassiveItem __instance)
		{
			if ((Object)(object)__instance == (Object)null || !__instance.PickedUp || (Object)(object)__instance.Owner == (Object)null)
			{
				return false;
			}
			if (__instance.Owner.passiveItems == null || __instance.Owner.inventory == null || __instance.Owner.inventory.AllGuns == null)
			{
				return false;
			}
			return true;
		}

		public static void CarrotFix_Update_Transpiler(ILContext ctx)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(ctx);
			if (val.JumpToNext((Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Object>(x, "op_Implicit")))
			{
				val.Emit(OpCodes.Call, (MethodBase)cf_u_cn);
			}
		}

		public static bool CarrotFix_Update_CameraNullcheck(bool curr)
		{
			return curr && (Object)(object)GameManager.Instance != (Object)null && (Object)(object)GameManager.Instance.MainCameraController != (Object)null;
		}

		public static void ChamberOfFrogsFix_DoTongueFlick_Transpiler(ILContext ctx)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0088: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(ctx);
			ILCursor[] array = default(ILCursor[]);
			if (val.TryFindNext(ref array, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchRet(x)
			}) && val.JumpToNext((Instruction x) => ILPatternMatchingExt.MatchStloc(x, 1)))
			{
				Instruction next = array[0].Next;
				Instruction next2 = val.Next;
				val.Emit(OpCodes.Ldloc_1);
				val.Emit(OpCodes.Call, (MethodBase)coff_dtf_cn);
				val.Emit(OpCodes.Brfalse, next2);
				val.Emit(OpCodes.Call, (MethodBase)coff_dtf_n);
				val.Emit(OpCodes.Br, next);
			}
		}

		public static bool ChamberOfFrogsFix_DoTongueFlick_CheckNearest(AIActor ai)
		{
			return (Object)(object)ai == (Object)null;
		}

		public static BeamController ChamberOfFrogsFix_DoTongueflick_Null()
		{
			return null;
		}

		public static void WinchestersHatFix_Update_Transpiler(ILContext ctx)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(ctx);
			ILLabel label = null;
			ILCursor[] array = default(ILCursor[]);
			if (val.TryFindNext(ref array, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchBneUn(x, ref label)
			}) && label != null)
			{
				val.Emit(OpCodes.Ldarg_0);
				val.Emit(OpCodes.Call, (MethodBase)whf_u_n_1);
				val.Emit(OpCodes.Call, (MethodBase)whf_u_n_2);
				val.Emit(OpCodes.Beq, (object)label);
			}
		}

		public static int WinchestersHatFix_Update_Nullcheck_1(PassiveItem p)
		{
			if ((Object)(object)p == (Object)null || (Object)(object)p.Owner == (Object)null || (Object)(object)((GameActor)p.Owner).CurrentGun == (Object)null)
			{
				return 0;
			}
			return 1;
		}

		public static int WinchestersHatFix_Update_Nullcheck_2()
		{
			return 0;
		}

		public static bool WinchestersHatFix_SpawnVFXAttached_Prefix(PassiveItem __instance)
		{
			if ((Object)(object)__instance == (Object)null || (Object)(object)__instance.Owner == (Object)null)
			{
				return false;
			}
			if ((Object)(object)((BraveBehaviour)__instance.Owner).specRigidbody == (Object)null || ((BraveBehaviour)__instance.Owner).specRigidbody.PrimaryPixelCollider == null)
			{
				return false;
			}
			if ((Object)(object)PhysicsEngine.Instance == (Object)null)
			{
				return false;
			}
			return true;
		}
	}
	public static class FrostAndGunfire
	{
		public static MethodInfo bf_cbu_p = AccessTools.Method(typeof(FrostAndGunfire), "BarterFix_CanBeUsed_Prefix", (Type[])null, (Type[])null);

		public static MethodInfo bf_de_t = AccessTools.Method(typeof(FrostAndGunfire), "BarterFix_DoEffect_Transpiler", (Type[])null, (Type[])null);

		public static MethodInfo bf_de_sin = AccessTools.Method(typeof(FrostAndGunfire), "BarterFix_DoEffect_ShopItemNullcheck", (Type[])null, (Type[])null);

		public static MethodInfo bf_de_iln_f = AccessTools.Method(typeof(FrostAndGunfire), "BarterFix_DoEffect_ItemsListNullcheck", (Type[])null, (Type[])null);

		public static MethodInfo mmf_bp_p = AccessTools.Method(typeof(FrostAndGunfire), "MiniMushboomFix_BuildPrefab_Postfix", (Type[])null, (Type[])null);

		public static MethodInfo bkf_cbu_p = AccessTools.Method(typeof(FrostAndGunfire), "BloodiedKeyFix_CanBeUsed_Prefix", (Type[])null, (Type[])null);

		public static void Patch()
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Expected O, but got Unknown
			Type type = AccessTools.TypeByName("FrostAndGunfireItems.Barter");
			if ((object)type != null)
			{
				MethodInfo methodInfo = AccessTools.Method(type, "CanBeUsed", (Type[])null, (Type[])null);
				MethodInfo methodInfo2 = AccessTools.Method(type, "DoEffect", (Type[])null, (Type[])null);
				if ((object)methodInfo != null)
				{
					Plugin.HarmonyInstance.Patch((MethodBase)methodInfo, new HarmonyMethod(bf_cbu_p), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				}
				if ((object)methodInfo2 != null)
				{
					Plugin.HarmonyInstance.Patch((MethodBase)methodInfo2, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(bf_de_t));
				}
			}
			Type type2 = AccessTools.TypeByName("FrostAndGunfireItems.MiniMushboom");
			if ((object)type2 != null)
			{
				MethodInfo methodInfo3 = AccessTools.Method(type2, "BuildPrefab", (Type[])null, (Type[])null);
				if ((object)methodInfo3 != null)
				{
					Plugin.HarmonyInstance.Patch((MethodBase)methodInfo3, (HarmonyMethod)null, new HarmonyMethod(mmf_bp_p), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				}
				MiniMushboomFix_BuildPrefab_Postfix();
			}
			Type type3 = AccessTools.TypeByName("FrostAndGunfireItems.BloodiedKey");
			if ((object)type3 != null)
			{
				MethodInfo methodInfo4 = AccessTools.Method(type3, "CanBeUsed", (Type[])null, (Type[])null);
				if ((object)methodInfo4 != null)
				{
					Plugin.HarmonyInstance.Patch((MethodBase)methodInfo4, new HarmonyMethod(bkf_cbu_p), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				}
			}
		}

		public static bool BarterFix_CanBeUsed_Prefix(ref bool __result, PlayerController user)
		{
			if ((Object)(object)user == (Object)null || user.CurrentRoom == null || user.carriedConsumables == null)
			{
				__result = false;
				return false;
			}
			return true;
		}

		public static void BarterFix_DoEffect_Transpiler(ILContext ctx)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(ctx);
			if (val.JumpBeforeNext((Instruction x) => ILPatternMatchingExt.MatchStloc(x, 2)))
			{
				val.Emit(OpCodes.Call, (MethodBase)bf_de_iln_f);
			}
			val.Index = 0;
			if (val.JumpToNext((Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Object>(x, "op_Inequality")))
			{
				val.Emit(OpCodes.Ldloc_S, (byte)4);
				val.Emit(OpCodes.Call, (MethodBase)bf_de_sin);
			}
		}

		public static List<ShopItemController> BarterFix_DoEffect_ItemsListNullcheck(List<ShopItemController> itm)
		{
			return itm ?? new List<ShopItemController>();
		}

		public static bool BarterFix_DoEffect_ShopItemNullcheck(bool curr, ShopItemController sic)
		{
			return curr && (Object)(object)sic != (Object)null && (Object)(object)sic.item != (Object)null;
		}

		public static void MiniMushboomFix_BuildPrefab_Postfix()
		{
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			if (!Game.Enemies.ContainsID("kp:mini_mushboom"))
			{
				return;
			}
			AIActor val = Game.Enemies["kp:mini_mushboom"];
			if (!((Object)(object)val == (Object)null) && !((Object)(object)((BraveBehaviour)val).aiAnimator == (Object)null))
			{
				AIAnimator aiAnimator = ((BraveBehaviour)val).aiAnimator;
				if (aiAnimator.IdleAnimation != null && (aiAnimator.IdleAnimation.AnimNames == null || aiAnimator.IdleAnimation.AnimNames.Length < 2))
				{
					aiAnimator.IdleAnimation.AnimNames = new string[2] { "idle", "idle" };
				}
				if (aiAnimator.HitAnimation != null)
				{
					aiAnimator.HitAnimation.Type = (DirectionType)0;
				}
			}
		}

		public static bool BloodiedKeyFix_CanBeUsed_Prefix(ref bool __result, PlayerController user)
		{
			if ((Object)(object)user != (Object)null && user.CurrentRoom != null && (Object)(object)((BraveBehaviour)user).healthHaver != (Object)null)
			{
				return true;
			}
			__result = false;
			return false;
		}
	}
	public static class Prismatism
	{
		public static MethodInfo pff_cbu_p = AccessTools.Method(typeof(Prismatism), "ParrotsFeatherFix_CanBeUsed_Prefix", (Type[])null, (Type[])null);

		public static void Patch()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			Type type = AccessTools.TypeByName("katmod.ParrotsFeather");
			if ((object)type != null)
			{
				MethodInfo methodInfo = AccessTools.Method(type, "CanBeUsed", (Type[])null, (Type[])null);
				if ((object)methodInfo != null)
				{
					Plugin.HarmonyInstance.Patch((MethodBase)methodInfo, new HarmonyMethod(pff_cbu_p), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				}
			}
		}

		public static bool ParrotsFeatherFix_CanBeUsed_Prefix(ref bool __result, PlayerController user)
		{
			if ((Object)(object)user == (Object)null || user.CurrentRoom == null || (Object)(object)Camera.main == (Object)null)
			{
				__result = false;
				return false;
			}
			return true;
		}
	}
	public static class RetrashItems
	{
		public static MethodInfo cbf_sh_t = AccessTools.Method(typeof(RetrashItems), "CrystalBallFix_SoulHook_Transpiler", (Type[])null, (Type[])null);

		public static MethodInfo cbf_sh_n = AccessTools.Method(typeof(RetrashItems), "CrystalBallFix_SoulHook_Nullcheck", (Type[])null, (Type[])null);

		public static MethodInfo cbf_sh_rp1 = AccessTools.Method(typeof(RetrashItems), "CrystalBallFix_SoulHook_ReplaceP1", (Type[])null, (Type[])null);

		public static MethodInfo cbf_sh_rp2 = AccessTools.Method(typeof(RetrashItems), "CrystalBallFix_SoulHook_ReplaceP2", (Type[])null, (Type[])null);

		public static void Patch()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			Type type = AccessTools.TypeByName("Blunderbeast.CrystalBall");
			if ((object)type != null)
			{
				MethodInfo methodInfo = AccessTools.Method(type, "SoulHook", (Type[])null, (Type[])null);
				if ((object)methodInfo != null)
				{
					Plugin.HarmonyInstance.Patch((MethodBase)methodInfo, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(cbf_sh_t));
				}
			}
		}

		public static void CrystalBallFix_SoulHook_Transpiler(ILContext ctx)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(ctx);
			ILCursor[] array = default(ILCursor[]);
			MethodReference val2 = default(MethodReference);
			if (!val.TryFindNext(ref array, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchRet(x)
			}) || !val.JumpToNext((Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val2) && Extensions.Is((MemberReference)(object)((MemberReference)val2).DeclaringType, (MemberInfo)typeof(Action<LifeOrbGunModifier, bool>)) && ((MemberReference)val2).Name == "Invoke"))
			{
				return;
			}
			Instruction next = array[0].Next;
			val.Emit(OpCodes.Ldarg_1);
			val.Emit(OpCodes.Call, (MethodBase)cbf_sh_n);
			val.Emit(OpCodes.Brtrue, next);
			if (val.JumpBeforeNext((Instruction x) => ILPatternMatchingExt.MatchStloc(x, 0)))
			{
				val.Emit(OpCodes.Call, (MethodBase)cbf_sh_rp1);
				if (val.JumpBeforeNext((Instruction x) => ILPatternMatchingExt.MatchStloc(x, 1)))
				{
					val.Emit(OpCodes.Call, (MethodBase)cbf_sh_rp2);
				}
			}
		}

		public static bool CrystalBallFix_SoulHook_Nullcheck(LifeOrbGunModifier orb)
		{
			if ((Object)(object)orb == (Object)null)
			{
				return true;
			}
			if ((Object)(object)GameManager.Instance == (Object)null)
			{
				return true;
			}
			bool flag = (Object)(object)GameManager.Instance.PrimaryPlayer != (Object)null && (Object)(object)((GameActor)GameManager.Instance.PrimaryPlayer).CurrentGun != (Object)null;
			bool flag2 = (Object)(object)GameManager.Instance.SecondaryPlayer != (Object)null && (Object)(object)((GameActor)GameManager.Instance.SecondaryPlayer).CurrentGun != (Object)null;
			if (!flag && !flag2)
			{
				return true;
			}
			return false;
		}

		public static PlayerController CrystalBallFix_SoulHook_ReplaceP1(PlayerController curr)
		{
			if ((Object)(object)curr != (Object)null && (Object)(object)((GameActor)curr).CurrentGun != (Object)null)
			{
				return curr;
			}
			if ((Object)(object)GameManager.Instance == (Object)null || (Object)(object)GameManager.Instance.SecondaryPlayer == (Object)null || (Object)(object)((GameActor)GameManager.Instance.SecondaryPlayer).CurrentGun == (Object)null)
			{
				return curr;
			}
			return GameManager.Instance.SecondaryPlayer;
		}

		public static PlayerController CrystalBallFix_SoulHook_ReplaceP2(PlayerController curr)
		{
			if ((Object)(object)curr != (Object)null && (Object)(object)((GameActor)curr).CurrentGun != (Object)null)
			{
				return curr;
			}
			if ((Object)(object)GameManager.Instance == (Object)null || (Object)(object)GameManager.Instance.PrimaryPlayer == (Object)null || (Object)(object)((GameActor)GameManager.Instance.PrimaryPlayer).CurrentGun == (Object)null)
			{
				return curr;
			}
			return GameManager.Instance.PrimaryPlayer;
		}
	}
}