Decompiled source of DoomslugQualityItemMod v1.0.4

DoomslugQualityItemMod.dll

Decompiled 16 hours ago
using System;
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using DoomslugItemMod.Items;
using ItemQualities;
using ItemQualities.ContentManagement;
using ItemQualities.Utilities.Extensions;
using Microsoft.CodeAnalysis;
using On.RoR2;
using On.RoR2.Projectile;
using R2API;
using RoR2;
using RoR2.Projectile;
using UnityEngine;
using UnityEngine.AddressableAssets;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("DoomslugQualityItemMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+409737aaf7bf83fec6e9d1a655c2e9f1a142b099")]
[assembly: AssemblyProduct("DoomslugQualityItemMod")]
[assembly: AssemblyTitle("DoomslugQualityItemMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 DoomslugItemMod
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Doomslug.Test", "Test", "1.0.4")]
	public class Initialize : BaseUnityPlugin
	{
		public const string PluginGUID = "Doomslug.Test";

		public const string PluginAuthor = "Doomslug";

		public const string PluginName = "Test";

		public const string PluginVersion = "1.0.4";

		public void Awake()
		{
			Log.Init(((BaseUnityPlugin)this).Logger);
			AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "doomslugbundle"));
			if (!Object.op_Implicit((Object)(object)val))
			{
				Log.Error("AssetBundle failed to load!");
			}
			MicrobialBullets.Init(val);
			QualityMicrobialBullets.Init();
			Biomissles.Init(val);
			QualityBiomissles.Init();
		}

		private void Update()
		{
			MicrobialBullets.Update();
			Biomissles.Update();
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
}
namespace DoomslugItemMod.Items
{
	public class BiomisslesMarker : MonoBehaviour
	{
	}
	public class Biomissles
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_OnHitEnemy <0>__GlobalEventManager_OnHitEnemy;

			public static hook_Awake <1>__ProjectileController_Awake;

			public static StatHookEventHandler <2>__RecalculateStats;
		}

		public static string IconName = "Placeholder_Icon";

		public static ItemDef ItemDef;

		public static ModdedProcType BiomisslesProcType;

		private static bool isFiringBiomissle = false;

		private static double procCoeffecient = 0.5;

		private static GameObject missilePrefab;

		public static void Init(AssetBundle bundle)
		{
			//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)
			BiomisslesProcType = ProcTypeAPI.ReserveProcType();
			if (!Object.op_Implicit((Object)(object)bundle))
			{
				Log.Error("AssetBundle failed to load!");
			}
			CreateItem(bundle);
			AddHooks();
		}

		private static void CreateItem(AssetBundle bundle)
		{
			//IL_0091: 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_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_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Expected O, but got Unknown
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Expected O, but got Unknown
			ItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)ItemDef).name = "DOOMSLUG_BIOMISSLES";
			ItemDef.nameToken = "DOOMSLUG_BIOMISSLES_NAME";
			ItemDef.pickupToken = "DOOMSLUG_BIOMISSLES_PICKUP";
			ItemDef.descriptionToken = "DOOMSLUG_BIOMISSLES_DESC";
			ItemDef.loreToken = "DOOMSLUG_BIOMISSLES_DESC_LORE";
			LanguageAPI.Add("DOOMSLUG_BIOMISSLES_NAME", "Biomissles");
			LanguageAPI.Add("DOOMSLUG_BIOMISSLES_PICKUP", "Fire missles on crit");
			LanguageAPI.Add("DOOMSLUG_BIOMISSLES_DESC", "On crit fire 2 (+1 per stack) missles that deal 30% Total Damage each with a Proc Coeffecient of 0.5");
			ItemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)"RoR2/Base/Common/Tier3Def.asset").WaitForCompletion();
			ItemDef.pickupIconSprite = bundle.LoadAsset<Sprite>(IconName);
			ItemDef.pickupModelPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mystery/PickupMystery.prefab").WaitForCompletion();
			ItemDef.canRemove = true;
			ItemDef.hidden = false;
			missilePrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/MissileProjectile.prefab").WaitForCompletion();
			if (!Object.op_Implicit((Object)(object)missilePrefab))
			{
				Log.Error("Biomissles: missile prefab failed to load!");
			}
			else
			{
				Log.Info("Biomissles: missile prefab loaded successfully!");
			}
			ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
			ItemAPI.Add(new CustomItem(ItemDef, val));
		}

		private static void AddHooks()
		{
			//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_001c: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			object obj = <>O.<0>__GlobalEventManager_OnHitEnemy;
			if (obj == null)
			{
				hook_OnHitEnemy val = GlobalEventManager_OnHitEnemy;
				<>O.<0>__GlobalEventManager_OnHitEnemy = val;
				obj = (object)val;
			}
			GlobalEventManager.OnHitEnemy += (hook_OnHitEnemy)obj;
			object obj2 = <>O.<1>__ProjectileController_Awake;
			if (obj2 == null)
			{
				hook_Awake val2 = ProjectileController_Awake;
				<>O.<1>__ProjectileController_Awake = val2;
				obj2 = (object)val2;
			}
			ProjectileController.Awake += (hook_Awake)obj2;
			object obj3 = <>O.<2>__RecalculateStats;
			if (obj3 == null)
			{
				StatHookEventHandler val3 = RecalculateStats;
				<>O.<2>__RecalculateStats = val3;
				obj3 = (object)val3;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj3;
		}

		private static void ProjectileController_Awake(orig_Awake orig, ProjectileController self)
		{
			orig.Invoke(self);
			if (isFiringBiomissle)
			{
				self.procCoefficient = (float)procCoeffecient;
			}
		}

		private static void GlobalEventManager_OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: 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_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_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: 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_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageInfo, victim);
			if (!Object.op_Implicit((Object)(object)damageInfo.attacker))
			{
				return;
			}
			CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
			if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.inventory))
			{
				return;
			}
			int itemCount = component.inventory.GetItemCount(ItemDef.itemIndex);
			if (itemCount <= 0)
			{
				return;
			}
			ItemQualityCounts itemCountsEffective = InventoryExtensions.GetItemCountsEffective(component.inventory, QualityBiomissles.BiomisslesItemGroup);
			procCoeffecient = 0.5 + (double)itemCountsEffective.UncommonCount * 0.1 + (double)itemCountsEffective.RareCount * 0.2 + (double)itemCountsEffective.EpicCount * 0.4 + (double)itemCountsEffective.LegendaryCount * 0.8;
			if (ProcTypeAPI.HasModdedProc(damageInfo.procChainMask, BiomisslesProcType) || !damageInfo.crit || damageInfo.procCoefficient == 0f)
			{
				return;
			}
			CharacterBody component2 = victim.GetComponent<CharacterBody>();
			if (!Object.op_Implicit((Object)(object)component2) || !Object.op_Implicit((Object)(object)component2.healthComponent))
			{
				return;
			}
			if (!Object.op_Implicit((Object)(object)missilePrefab))
			{
				Log.Error("Biomissles: missile prefab is null, cannot fire!");
				return;
			}
			Log.Info("Biomissles proc fired!");
			ProcTypeAPI.AddModdedProc(ref damageInfo.procChainMask, BiomisslesProcType);
			int num = 1 + itemCount;
			HurtBox mainHurtBox = component2.mainHurtBox;
			Collider val = ((mainHurtBox != null) ? mainHurtBox.collider : null);
			float num2 = 0f;
			if ((Object)(object)val != (Object)null)
			{
				Bounds bounds = val.bounds;
				num2 = Mathf.Max(((Bounds)(ref bounds)).extents.x, ((Bounds)(ref bounds)).extents.z);
			}
			Vector3 position = component2.corePosition + Vector3.up * (1.5f * num2 + 1f);
			isFiringBiomissle = true;
			for (int i = 0; i < num; i++)
			{
				Vector3 val2 = Util.ApplySpread(Vector3.up, 0f, 20f, 1f, 1f, 0f, 0f);
				FireProjectileInfo val3 = new FireProjectileInfo
				{
					projectilePrefab = missilePrefab,
					position = position,
					rotation = Util.QuaternionSafeLookRotation(val2),
					owner = ((Component)component).gameObject,
					damage = damageInfo.damage * 0.3f,
					force = 0f,
					crit = damageInfo.crit,
					damageColorIndex = (DamageColorIndex)3,
					procChainMask = damageInfo.procChainMask
				};
				ProjectileManager.instance.FireProjectile(val3);
			}
			isFiringBiomissle = false;
		}

		private static void RecalculateStats(CharacterBody body, StatHookEventArgs args)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)body.inventory))
			{
				int itemCount = body.inventory.GetItemCount(ItemDef.itemIndex);
				if (itemCount > 0)
				{
					args.critAdd += 5f;
				}
			}
		}

		public static void Update()
		{
			//IL_0031: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown((KeyCode)285))
			{
				Transform transform = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform;
				Log.Info($"Player pressed F4. Spawning our Biomissles at coordinates {transform.position}");
				PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(ItemDef.itemIndex), transform.position, transform.forward * 20f);
			}
		}
	}
	public class MicrobialBulletsMarker : MonoBehaviour
	{
	}
	public class MicrobialBullets
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_OnHitEnemy <0>__GlobalEventManager_OnHitEnemy;

			public static hook_Awake <1>__DelayBlast_Awake;

			public static hook_Detonate <2>__DelayBlast_Detonate;
		}

		public static string IconName = "Microbial_Bullet_Icon2";

		public static ItemDef ItemDef;

		private static bool isFiringFakeDeathReport = false;

		public static ModdedProcType MicrobialBulletsProcType;

		public static void Init(AssetBundle bundle)
		{
			//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)
			MicrobialBulletsProcType = ProcTypeAPI.ReserveProcType();
			if (!Object.op_Implicit((Object)(object)bundle))
			{
				Log.Error("AssetBundle failed to load!");
			}
			CreateItem(bundle);
			AddHooks();
		}

		private static void CreateItem(AssetBundle bundle)
		{
			//IL_0091: 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_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_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Expected O, but got Unknown
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Expected O, but got Unknown
			ItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)ItemDef).name = "DOOMSLUG_MICROBIAL_BULLETS";
			ItemDef.nameToken = "DOOMSLUG_MICROBIAL_BULLETS_NAME";
			ItemDef.pickupToken = "DOOMSLUG_MICROBIAL_BULLETS_PICKUP";
			ItemDef.descriptionToken = "DOOMSLUG_MICROBIAL_BULLETS_DESC";
			ItemDef.loreToken = "DOOMSLUG_MICROBIAL_BULLETS_DESC_LORE";
			LanguageAPI.Add("DOOMSLUG_MICROBIAL_BULLETS_NAME", "Microbial Bullets");
			LanguageAPI.Add("DOOMSLUG_MICROBIAL_BULLETS_PICKUP", "Chance to trigger on kill effects");
			LanguageAPI.Add("DOOMSLUG_MICROBIAL_BULLETS_DESC", "3% (+2% per stack) chance to trigger all on kill effects on hit.");
			ItemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)"RoR2/Base/Common/Tier2Def.asset").WaitForCompletion();
			ItemDef.pickupIconSprite = bundle.LoadAsset<Sprite>(IconName);
			ItemDef.pickupModelPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mystery/PickupMystery.prefab").WaitForCompletion();
			ItemDef.canRemove = true;
			ItemDef.hidden = false;
			ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
			ItemAPI.Add(new CustomItem(ItemDef, val));
		}

		private static void AddHooks()
		{
			//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_001c: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			object obj = <>O.<0>__GlobalEventManager_OnHitEnemy;
			if (obj == null)
			{
				hook_OnHitEnemy val = GlobalEventManager_OnHitEnemy;
				<>O.<0>__GlobalEventManager_OnHitEnemy = val;
				obj = (object)val;
			}
			GlobalEventManager.OnHitEnemy += (hook_OnHitEnemy)obj;
			object obj2 = <>O.<1>__DelayBlast_Awake;
			if (obj2 == null)
			{
				hook_Awake val2 = DelayBlast_Awake;
				<>O.<1>__DelayBlast_Awake = val2;
				obj2 = (object)val2;
			}
			DelayBlast.Awake += (hook_Awake)obj2;
			object obj3 = <>O.<2>__DelayBlast_Detonate;
			if (obj3 == null)
			{
				hook_Detonate val3 = DelayBlast_Detonate;
				<>O.<2>__DelayBlast_Detonate = val3;
				obj3 = (object)val3;
			}
			DelayBlast.Detonate += (hook_Detonate)obj3;
		}

		private static void DelayBlast_Awake(orig_Awake orig, DelayBlast self)
		{
			orig.Invoke(self);
			if (isFiringFakeDeathReport)
			{
				((Component)self).gameObject.AddComponent<MicrobialBulletsMarker>();
			}
		}

		private static void DelayBlast_Detonate(orig_Detonate orig, DelayBlast self)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((Component)self).GetComponent<MicrobialBulletsMarker>()))
			{
				ProcTypeAPI.AddModdedProc(ref self.procChainMask, MicrobialBulletsProcType);
			}
			orig.Invoke(self);
		}

		private static void GlobalEventManager_OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//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_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Expected O, but got Unknown
			orig.Invoke(self, damageInfo, victim);
			if (isFiringFakeDeathReport || !Object.op_Implicit((Object)(object)damageInfo.attacker))
			{
				return;
			}
			CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
			if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.inventory))
			{
				return;
			}
			int itemCount = component.inventory.GetItemCount(ItemDef.itemIndex);
			if (itemCount > 0 && !ProcTypeAPI.HasModdedProc(damageInfo.procChainMask, MicrobialBulletsProcType) && Util.CheckRoll(1f + 2f * (float)itemCount * damageInfo.procCoefficient, component.master))
			{
				CharacterBody component2 = victim.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component2.healthComponent) && component2.healthComponent.alive)
				{
					Log.Info("Microbial Bullets proc fired!");
					ProcTypeAPI.AddModdedProc(ref damageInfo.procChainMask, MicrobialBulletsProcType);
					DamageReport val = new DamageReport(damageInfo, component2.healthComponent, damageInfo.damage, component2.healthComponent.combinedHealth);
					isFiringFakeDeathReport = true;
					GlobalEventManager.instance.OnCharacterDeath(val);
					isFiringFakeDeathReport = false;
				}
			}
		}

		public static void Update()
		{
			//IL_0031: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown((KeyCode)284))
			{
				Transform transform = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform;
				Log.Info($"Player pressed F3. Spawning our Microbial Bullets at coordinates {transform.position}");
				PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(ItemDef.itemIndex), transform.position, transform.forward * 20f);
			}
		}
	}
	internal static class QualityBiomissles
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static LoadContentAsyncDelegate <0>__loadContent;
		}

		public static ItemQualityGroup BiomisslesItemGroup;

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void Init()
		{
			//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_001c: Expected O, but got Unknown
			object obj = <>O.<0>__loadContent;
			if (obj == null)
			{
				LoadContentAsyncDelegate val = loadContent;
				<>O.<0>__loadContent = val;
				obj = (object)val;
			}
			QualityContentManager.LoadContentAsync += (LoadContentAsyncDelegate)obj;
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_UNCOMMON_PICKUP", "{0}\n<sprite name=\"Quality\"> Increases the proc coeffecient.");
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_RARE_PICKUP", "{0}\n<sprite name=\"Quality\"> Increases the proc coeffecient.");
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_EPIC_PICKUP", "{0}\n<sprite name=\"Quality\"> Increases the proc coeffecient.");
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_LEGENDARY_PICKUP", "{0}\n<sprite name=\"Quality\"> Increases the proc coeffecient.");
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_UNCOMMON_DESC", "{0}\nIncreases the proc coeffecient of Biomissles by 0.1 <style=cStack>(+0.1 per stack)</style>");
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_RARE_PICKUP", "{0}\nIncreases the proc coeffecient of Biomissles by 0.1 <style=cStack>(+0.2 per stack)</style>");
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_EPIC_PICKUP", "{0}\nIncreases the proc coeffecient of Biomissles by 0.1 <style=cStack>(+0.4 per stack)</style>");
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_LEGENDARY_PICKUP", "{0}\nIncreases the proc coeffecient of Biomissles by 0.1 <style=cStack>(+0.8 per stack)</style>");
		}

		private static IEnumerator loadContent(QualityContentLoadArgs args)
		{
			BiomisslesItemGroup = args.CreateItemQualityGroup(Biomissles.ItemDef);
			yield break;
		}
	}
	internal class QualityMicrobialBullets
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static LoadContentAsyncDelegate <0>__CreateItem;

			public static hook_OnCharacterDeath <1>__GlobalEventManager_OnCharacterDeath;
		}

		private static ItemQualityGroup MicrobialBulletsItemGroup;

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void Init()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			Log.Info("QualityMicrobialBullets Init Started");
			object obj = <>O.<0>__CreateItem;
			if (obj == null)
			{
				LoadContentAsyncDelegate val = CreateItem;
				<>O.<0>__CreateItem = val;
				obj = (object)val;
			}
			QualityContentManager.LoadContentAsync += (LoadContentAsyncDelegate)obj;
			object obj2 = <>O.<1>__GlobalEventManager_OnCharacterDeath;
			if (obj2 == null)
			{
				hook_OnCharacterDeath val2 = GlobalEventManager_OnCharacterDeath;
				<>O.<1>__GlobalEventManager_OnCharacterDeath = val2;
				obj2 = (object)val2;
			}
			GlobalEventManager.OnCharacterDeath += (hook_OnCharacterDeath)obj2;
		}

		private static IEnumerator CreateItem(QualityContentLoadArgs args)
		{
			Log.Info("QualityMicrobialBullets CreateItem Started");
			MicrobialBulletsItemGroup = args.CreateItemQualityGroup(MicrobialBullets.ItemDef);
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_UNCOMMON_PICKUP", "{0}\n<sprite name=\"Quality\"> Provides a portion of the killed enemies max HP as healing.");
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_RARE_PICKUP", "{0}\n<sprite name=\"Quality\"> Provides a portion of the killed enemies max HP as healing.");
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_EPIC_PICKUP", "{0}\n<sprite name=\"Quality\"> Provides a portion of the killed enemies max HP as healing.");
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_LEGENDARY_PICKUP", "{0}\n<sprite name=\"Quality\"> Provides a portion of the killed enemies max HP as healing.");
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_UNCOMMON_DESC", "{0}\nOn Killing an Enemy heal for 4% <style=cStack>(+4% per stack)</style> of their max HP");
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_RARE_PICKUP", "{0}\nOn Killing an Enemy heal for 9% <style=cStack>(+9% per stack)</style> of their max HP");
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_EPIC_PICKUP", "{0}\nOn Killing an Enemy heal for 15% <style=cStack>(+15% per stack)</style> of their max HP");
			LanguageAPI.Add("ITEM_DOOMLSUG_MICROBIAL_BULLETS_LEGENDARY_PICKUP", "{0}\nOn Killing an Enemy heal for 22% <style=cStack>(+22% per stack)</style> of their max HP");
			yield break;
		}

		private static void GlobalEventManager_OnCharacterDeath(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport)
		{
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: 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_0095: 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_00c1: 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_0070: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageReport);
			CharacterBody component = damageReport.attacker.GetComponent<CharacterBody>();
			CharacterBody component2 = ((Component)damageReport.victim).GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory))
			{
				ItemQualityCounts itemCountsEffective = InventoryExtensions.GetItemCountsEffective(component.inventory, MicrobialBulletsItemGroup);
				if (itemCountsEffective.UncommonCount > 0 || itemCountsEffective.RareCount > 0 || itemCountsEffective.EpicCount > 0 || itemCountsEffective.LegendaryCount > 0)
				{
					float num = itemCountsEffective.UncommonCount * 4 + itemCountsEffective.RareCount * 9 + itemCountsEffective.EpicCount * 15 + itemCountsEffective.LegendaryCount * 22;
					float num2 = num * component2.levelMaxHealth;
					component.healthComponent.Heal(num2, default(ProcChainMask), true);
				}
			}
		}
	}
}