Decompiled source of BManItems v1.0.2

BManItems.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using EntityStates;
using On.RoR2;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;

[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 = "")]
[assembly: AssemblyCompany("BManItems")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BManItems")]
[assembly: AssemblyTitle("BManItems")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace BManItems;

internal class Assets
{
	internal static AssetBundle MainAssetBundle;

	public static T Load<T>(string name) where T : Object
	{
		return MainAssetBundle.LoadAsset<T>(name);
	}

	public static void PopulateAssets()
	{
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		if ((Object)(object)MainAssetBundle == (Object)null)
		{
			using (Stream stream = executingAssembly.GetManifestResourceStream("BManItems.AssetBundle.pikmanitemassets"))
			{
				MainAssetBundle = AssetBundle.LoadFromStream(stream);
			}
		}
	}
}
internal class BloodMaryRegenItemBodyBehavior : ItemBehavior
{
	private float stopwatch;

	private void FixedUpdate()
	{
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		if (NetworkServer.active)
		{
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= 1f)
			{
				stopwatch = 0f;
				float num = base.body.healthComponent.fullCombinedHealth * Utils.CalculateItemBonus(Items.bloodymary.floatValue1.Value, Items.bloodymary.floatValue1Stack.Value, base.body.inventory.GetItemCount(Items.bloodymary.itemDef));
				base.body.healthComponent.Heal(num / Items.bloodymary.floatValue2.Value, default(ProcChainMask), false);
			}
		}
	}
}
internal class GoldenAspectItemBodyBehaviour : ItemBehavior
{
	private TemporaryOverlayInstance overlay;

	private void Start()
	{
		Transform modelTransform = base.body.modelLocator.modelTransform;
		if (Object.op_Implicit((Object)(object)modelTransform))
		{
			CharacterModel component = ((Component)modelTransform).GetComponent<CharacterModel>();
			if (Object.op_Implicit((Object)(object)component))
			{
				overlay = TemporaryOverlayManager.AddOverlay(((Component)component).gameObject);
				overlay.originalMaterial = Prefabs.goldenAspectOverlay;
				overlay.animateShaderAlpha = false;
				overlay.AddToCharacterModel(component);
			}
		}
	}

	private void OnDestroy()
	{
		if (overlay != null)
		{
			overlay.Destroy();
		}
	}
}
internal class StageTimeTracker : MonoBehaviour
{
	public float lastStartTime;

	public float lastFinishTime;

	private void OnEnable()
	{
		InstanceTracker.Add<StageTimeTracker>(this);
		Stage.onStageStartGlobal += Stage_onStageStartGlobal;
		Stage.onServerStageComplete += Stage_onServerStageComplete;
	}

	private void OnDisable()
	{
		InstanceTracker.Remove<StageTimeTracker>(this);
		Stage.onStageStartGlobal -= Stage_onStageStartGlobal;
		Stage.onServerStageComplete -= Stage_onServerStageComplete;
	}

	private void Stage_onServerStageComplete(Stage stage)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Invalid comparison between Unknown and I4
		if ((int)stage.sceneDef.sceneType != 2)
		{
			Debug.LogWarning((object)("RunStopwatch: " + Run.instance.GetRunStopwatch()));
			Debug.LogWarning((object)("lastStartTime: " + lastStartTime));
			lastFinishTime = ((Run.instance.stageClearCount == 0) ? Run.instance.GetRunStopwatch() : (Run.instance.GetRunStopwatch() - lastStartTime));
			Debug.LogWarning((object)("lastFinishTime: " + lastFinishTime));
		}
	}

	private void Stage_onStageStartGlobal(Stage stage)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Invalid comparison between Unknown and I4
		if ((int)stage.sceneDef.sceneType != 2)
		{
			lastStartTime = Run.instance.GetRunStopwatch();
		}
	}
}
internal class SuperAntacidsBehaviour : MonoBehaviour
{
	public bool canRevive;

	public bool hasRevived;

	private void OnEnable()
	{
		Stage.onServerStageBegin += Stage_onServerStageBegin;
	}

	private void OnDisable()
	{
		Stage.onServerStageBegin -= Stage_onServerStageBegin;
	}

	private void Stage_onServerStageBegin(Stage obj)
	{
		canRevive = false;
		hasRevived = false;
	}
}
internal class VapeItemBodyBehaviour : ItemBehavior
{
	private float stopwatch;

	private float cooldown => Items.vape.floatValue1.Value - Items.vape.floatValue1Stack.Value * (float)base.body.inventory.GetItemCount(Items.vape.itemDef);

	private float itemBonus => Utils.CalculateItemBonus(Items.vape.floatValue2.Value, Items.vape.floatValue2Stack.Value, base.body.inventory.GetItemCount(Items.vape.itemDef));

	private void Start()
	{
		AddCDBuff();
	}

	private void FixedUpdate()
	{
		stopwatch += Time.fixedDeltaTime;
		if (stopwatch >= cooldown)
		{
			stopwatch = 0f;
			Vape();
		}
	}

	private void Vape()
	{
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		AddCDBuff();
		switch (RoR2Application.rng.RangeInt(0, 3))
		{
		case 0:
			base.body.healthComponent.Heal(base.body.healthComponent.fullCombinedHealth * (1f + itemBonus), default(ProcChainMask), true);
			break;
		case 1:
			Blast("RoR2/Base/EliteIce/AffixWhiteExplosion.prefab", (DamageType)256);
			break;
		case 2:
			Blast("RoR2/Base/IgniteOnKill/IgniteExplosionVFX.prefab", (DamageType)128);
			break;
		}
	}

	private void Blast(string explosionEffect, DamageType damageType)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: 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_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: 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_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		Vector3 footPosition = base.body.footPosition;
		GameObject val = Object.Instantiate<GameObject>(Prefabs.Load<GameObject>("RoR2/Base/Common/GenericDelayBlast.prefab"), footPosition, Quaternion.identity);
		float num = 12f + base.body.radius;
		val.transform.localScale = new Vector3(num, num, num);
		DelayBlast component = val.GetComponent<DelayBlast>();
		if (Object.op_Implicit((Object)(object)component))
		{
			component.position = footPosition;
			component.baseDamage = 0f;
			component.baseForce = 0f;
			component.attacker = ((Component)this).gameObject;
			component.radius = num * (1f + Items.vape.floatValue2Stack.Value * (float)base.body.inventory.GetItemCount(Items.vape.itemDef));
			component.crit = base.body.RollCrit();
			component.procCoefficient = 0.75f;
			component.maxTimer = 0f;
			component.falloffModel = (FalloffModel)0;
			component.explosionEffect = Prefabs.Load<GameObject>(explosionEffect);
			component.damageType = DamageTypeCombo.op_Implicit(damageType);
			TeamFilter component2 = val.GetComponent<TeamFilter>();
			if (Object.op_Implicit((Object)(object)component2))
			{
				component2.teamIndex = TeamComponent.GetObjectTeam(component.attacker);
			}
		}
	}

	private void AddCDBuff()
	{
		base.body.AddTimedBuff(Prefabs.vapeUnavailableBuff, cooldown);
	}
}
internal class VarianCigarBehaviour : MonoBehaviour
{
	private CharacterMaster master;

	private void Start()
	{
		master = ((Component)this).GetComponent<CharacterMaster>();
		Stage.onStageStartGlobal += Stage_onStageStartGlobal;
	}

	private void Stage_onStageStartGlobal(Stage obj)
	{
		List<StageTimeTracker> instancesList = InstanceTracker.GetInstancesList<StageTimeTracker>();
		if (instancesList != null && instancesList.Count > 0)
		{
			float num = 300f / instancesList[0].lastFinishTime;
			int num2 = Mathf.CeilToInt((float)Utils.CalculateItemBonus(Items.variancigar.intValue1.Value, Items.variancigar.intValue1Stack.Value, master.inventory.GetItemCount(Items.variancigar.itemDef)) * num);
			master.GiveMoney((uint)num2);
		}
	}

	private void OnDisable()
	{
		Stage.onStageStartGlobal -= Stage_onStageStartGlobal;
	}
}
internal class VodkaUse : MonoBehaviour
{
}
internal class Hook
{
	internal static void Hooks()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Expected O, but got Unknown
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Expected O, but got Unknown
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Expected O, but got Unknown
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Expected O, but got Unknown
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Expected O, but got Unknown
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Expected O, but got Unknown
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Expected O, but got Unknown
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Expected O, but got Unknown
		//IL_013a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Expected O, but got Unknown
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0156: Expected O, but got Unknown
		RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
		HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
		CharacterModel.EnableItemDisplay += new hook_EnableItemDisplay(CharacterModel_EnableItemDisplay);
		CharacterModel.SetEquipmentDisplay += new hook_SetEquipmentDisplay(CharacterModel_SetEquipmentDisplay);
		GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
		EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(EquipmentSlot_PerformEquipmentAction);
		CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
		CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal;
		Inventory.onServerItemGiven += Inventory_onServerItemGiven;
		Inventory.CalculateEquipmentCooldownScale += new hook_CalculateEquipmentCooldownScale(Inventory_CalculateEquipmentCooldownScale);
		Inventory.GetEquipmentSlotMaxCharges += new hook_GetEquipmentSlotMaxCharges(Inventory_GetEquipmentSlotMaxCharges1);
		StrengthenBurnUtils.CheckDotForUpgrade += new hook_CheckDotForUpgrade(StrengthenBurnUtils_CheckDotForUpgrade);
		CharacterBody.OnSkillActivated += new hook_OnSkillActivated(CharacterBody_OnSkillActivated);
		DeathRewards.OnKilledServer += new hook_OnKilledServer(DeathRewards_OnKilledServer);
		TeleporterInteraction.FixedUpdate += new hook_FixedUpdate(TeleporterInteraction_FixedUpdate);
		GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal1;
		Inventory.UpdateEquipment += new hook_UpdateEquipment(Inventory_UpdateEquipment);
		EquipmentSlot.FireBossHunterConsumed += new hook_FireBossHunterConsumed(EquipmentSlot_FireBossHunterConsumed);
		OverlapAttack.PerformDamage += new hook_PerformDamage(OverlapAttack_PerformDamage1);
	}

	private static void OverlapAttack_PerformDamage1(orig_PerformDamage orig, GameObject attacker, GameObject inflictor, float damage, bool isCrit, ProcChainMask procChainMask, float procCoefficient, DamageColorIndex damageColorIndex, DamageTypeCombo damageType, Vector3 forceVector, float pushAwayForce, object hitList)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		ProcTypeAPI.AddModdedProc(ref procChainMask, Prefabs.meleeProc);
		orig.Invoke(attacker, inflictor, damage, isCrit, procChainMask, procCoefficient, damageColorIndex, damageType, forceVector, pushAwayForce, hitList);
	}

	private static bool EquipmentSlot_FireBossHunterConsumed(orig_FireBossHunterConsumed orig, EquipmentSlot self)
	{
		//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_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Expected O, but got Unknown
		if (Object.op_Implicit((Object)(object)self.characterBody))
		{
			Chat.SendBroadcastChat((ChatMessageBase)new BodyChatMessage
			{
				bodyObject = ((Component)self.characterBody).gameObject,
				token = "BMANITEMS_GINCONSUMED_CHAT"
			});
			self.subcooldownTimer = 1f;
		}
		return true;
	}

	private static void Inventory_UpdateEquipment(orig_UpdateEquipment orig, Inventory self)
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: 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_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Invalid comparison between Unknown and I4
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_0147: Unknown result type (might be due to invalid IL or missing references)
		//IL_014e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active)
		{
			Debug.LogWarning((object)"[Server] function 'System.Void RoR2.Inventory::UpdateEquipment()' called on client");
			return;
		}
		FixedTimeStamp now = FixedTimeStamp.now;
		int num = ((self.GetItemCount(Items.bourbon.itemDef) > 0) ? 2 : 0);
		byte b = (byte)Mathf.Min(1 + self.GetItemCount(Items.EquipmentMagazine) + num, 255);
		for (uint num2 = 0u; (ulong)num2 < (ulong)self.equipmentStateSlots.Length; num2++)
		{
			EquipmentState val = self.equipmentStateSlots[num2];
			if ((int)val.equipmentIndex == -1)
			{
				continue;
			}
			if (val.charges < b)
			{
				FixedTimeStamp val2 = val.chargeFinishTime;
				byte b2 = val.charges;
				if (!((FixedTimeStamp)(ref val2)).isPositiveInfinity)
				{
					b2++;
				}
				if (((FixedTimeStamp)(ref val2)).isInfinity)
				{
					val2 = now;
				}
				if (((FixedTimeStamp)(ref val2)).hasPassed)
				{
					float num3 = val.equipmentDef.cooldown * self.CalculateEquipmentCooldownScale();
					self.SetEquipment(new EquipmentState(val.equipmentIndex, val2 + num3, b2, false), num2);
				}
			}
			if (val.charges >= b && !((FixedTimeStamp)(ref val.chargeFinishTime)).isPositiveInfinity)
			{
				self.SetEquipment(new EquipmentState(val.equipmentIndex, FixedTimeStamp.positiveInfinity, b, false), num2);
			}
		}
	}

	private static int Inventory_GetEquipmentSlotMaxCharges1(orig_GetEquipmentSlotMaxCharges orig, Inventory self, byte slot)
	{
		int num = ((self.GetItemCount(Items.bourbon.itemDef) > 0) ? 3 : 0);
		return Math.Min(1 + self.GetItemCount(Items.EquipmentMagazine) + num, 255);
	}

	private static void GlobalEventManager_onCharacterDeathGlobal1(DamageReport damageReport)
	{
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: 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_00ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f2: Expected O, but got Unknown
		if (!Object.op_Implicit((Object)(object)damageReport.victimBody) || !Object.op_Implicit((Object)(object)damageReport.victimBody.master) || !Object.op_Implicit((Object)(object)damageReport.victimBody.inventory))
		{
			return;
		}
		CharacterMaster master = damageReport.victimBody.master;
		if (!NetworkServer.active || ((MonoBehaviour)master).IsInvoking("RespawnExtraLife"))
		{
			return;
		}
		SuperAntacidsBehaviour component = ((Component)master).GetComponent<SuperAntacidsBehaviour>();
		if (!Object.op_Implicit((Object)(object)component) || !component.canRevive || !Object.op_Implicit((Object)(object)master.inventory) || master.inventory.GetItemCount(Items.ExtraLife) != 0)
		{
			return;
		}
		component.canRevive = false;
		component.hasRevived = true;
		damageReport.victimBody.RemoveBuff(Prefabs.superAntacidsReviveOnBuff);
		Vector3 val = ((master.deathFootPosition == Vector3.zero) ? damageReport.victimBody.footPosition : master.deathFootPosition);
		if (master.killedByUnsafeArea)
		{
			val = (Vector3)(((??)TeleportHelper.FindSafeTeleportDestination(master.deathFootPosition, master.bodyPrefab.GetComponent<CharacterBody>(), RoR2Application.rng)) ?? master.deathFootPosition);
		}
		master.Respawn(val, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f), false);
		master.GetBody().AddTimedBuff(Buffs.Immune, 3f);
		if (Object.op_Implicit((Object)(object)master.bodyInstanceObject))
		{
			EntityStateMachine[] components = master.bodyInstanceObject.GetComponents<EntityStateMachine>();
			foreach (EntityStateMachine val2 in components)
			{
				val2.initialStateType = val2.mainStateType;
			}
			EffectManager.SpawnEffect(Prefabs.Load<GameObject>("RoR2/Base/ExtraLife/HippoRezEffect.prefab"), new EffectData
			{
				origin = val,
				rotation = master.bodyInstanceObject.transform.rotation
			}, true);
		}
		master.PlayExtraLifeSFX();
	}

	private static int Inventory_GetEquipmentSlotMaxCharges(orig_GetEquipmentSlotMaxCharges orig, Inventory self, byte slot)
	{
		int num = orig.Invoke(self, slot);
		return Mathf.Min((num + self.GetItemCount(Items.bourbon.itemDef) > 0) ? 3 : 0, 255);
	}

	private static bool EquipmentSlot_PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef)
	{
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0113: Unknown result type (might be due to invalid IL or missing references)
		//IL_014b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0150: Unknown result type (might be due to invalid IL or missing references)
		//IL_0212: Unknown result type (might be due to invalid IL or missing references)
		//IL_0217: Unknown result type (might be due to invalid IL or missing references)
		//IL_0219: Unknown result type (might be due to invalid IL or missing references)
		//IL_0224: Unknown result type (might be due to invalid IL or missing references)
		//IL_022a: Invalid comparison between Unknown and I4
		//IL_0264: Unknown result type (might be due to invalid IL or missing references)
		//IL_026a: Invalid comparison between Unknown and I4
		//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02aa: Invalid comparison between Unknown and I4
		//IL_0252: Unknown result type (might be due to invalid IL or missing references)
		//IL_0292: Unknown result type (might be due to invalid IL or missing references)
		//IL_023b: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_027b: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_041a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0423: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)self.characterBody))
		{
			HealthComponent healthComponent = self.characterBody.healthComponent;
			if ((Object)(object)equipmentDef == (Object)(object)Items.vodka.equipDef && !Object.op_Implicit((Object)(object)((Component)self.characterBody).GetComponent<VodkaUse>()))
			{
				Util.PlaySound("Play_teamWarCry_activate", ((Component)self.characterBody).gameObject);
				Util.PlaySound("Play_item_proc_phasing", ((Component)self.characterBody).gameObject);
				((Component)self.characterBody).gameObject.AddComponent<VodkaUse>();
				self.characterBody.AddTimedBuff(Prefabs.vodkaBuff, Items.vodka.floatValue2.Value);
				self.characterBody.AddTimedBuff(Buffs.Cloak, Items.vodka.floatValue2.Value);
				CharacterMasterNotificationQueue.SendTransformNotification(self.characterBody.master, self.characterBody.inventory.currentEquipmentIndex, Items.vodkaConsumed.equipDef.equipmentIndex, (TransformationType)0);
				self.characterBody.inventory.SetEquipmentIndex(Items.vodkaConsumed.equipDef.equipmentIndex);
				self.FireBossHunterConsumed();
			}
			if ((Object)(object)equipmentDef == (Object)(object)Items.smokes.equipDef)
			{
				EffectManager.SimpleEffect(Prefabs.Load<GameObject>("RoR2/Base/Medkit/MedkitHealEffect.prefab"), self.characterBody.corePosition, Quaternion.identity, true);
				healthComponent.AddBarrier(healthComponent.fullHealth);
				return true;
			}
			if ((Object)(object)equipmentDef == (Object)(object)Items.superAntacids.equipDef)
			{
				bool flag = false;
				SuperAntacidsBehaviour superAntacidsBehaviour = self.characterBody.masterObject.GetComponent<SuperAntacidsBehaviour>();
				if (!Object.op_Implicit((Object)(object)superAntacidsBehaviour))
				{
					superAntacidsBehaviour = self.characterBody.masterObject.AddComponent<SuperAntacidsBehaviour>();
				}
				if (!superAntacidsBehaviour.canRevive && !superAntacidsBehaviour.hasRevived)
				{
					List<ItemIndex> source = null;
					List<ItemIndex> list = new List<ItemIndex>();
					List<ItemIndex> list2 = new List<ItemIndex>();
					List<ItemIndex> list3 = new List<ItemIndex>();
					for (int i = 0; i < self.inventory.itemAcquisitionOrder.Count; i++)
					{
						ItemIndex val = self.inventory.itemAcquisitionOrder[i];
						ItemDef itemDef = ItemCatalog.GetItemDef(val);
						if ((int)itemDef.tier == 0)
						{
							for (int j = 0; j < self.inventory.GetItemCount(val); j++)
							{
								list.Add(val);
							}
						}
						if ((int)itemDef.tier == 1)
						{
							for (int k = 0; k < self.inventory.GetItemCount(val); k++)
							{
								list2.Add(val);
							}
						}
						if ((int)itemDef.tier == 2)
						{
							for (int l = 0; l < self.inventory.GetItemCount(val); l++)
							{
								list3.Add(val);
							}
						}
					}
					bool flag2 = list.Count >= Items.superAntacids.intValue3.Value;
					bool flag3 = list2.Count >= Items.superAntacids.intValue2.Value;
					bool flag4 = list3.Count >= Items.superAntacids.intValue1.Value;
					int count = 0;
					if (flag2)
					{
						count = Items.superAntacids.intValue3.Value;
						source = list;
						flag = true;
					}
					if (flag3)
					{
						count = Items.superAntacids.intValue2.Value;
						source = list2;
						flag = true;
					}
					if (flag4)
					{
						flag = true;
						count = Items.superAntacids.intValue1.Value;
						source = list3;
					}
					if (flag)
					{
						superAntacidsBehaviour.canRevive = true;
						ItemIndex[] array = source.OrderBy((ItemIndex x) => RoR2Application.rng.nextBool).Take(count).ToArray();
						ItemIndex[] array2 = array;
						foreach (ItemIndex val2 in array2)
						{
							self.inventory.RemoveItem(val2, 1);
						}
						self.characterBody.AddBuff(Prefabs.superAntacidsReviveOnBuff);
					}
				}
				return flag;
			}
		}
		return orig.Invoke(self, equipmentDef);
	}

	private static void TeleporterInteraction_FixedUpdate(orig_FixedUpdate orig, TeleporterInteraction self)
	{
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		orig.Invoke(self);
		if (!Object.op_Implicit((Object)(object)self) || !NetworkServer.active || self.chargePercent <= 0 || !self.isCharging)
		{
			return;
		}
		int num = 0;
		foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
		{
			if (Object.op_Implicit((Object)(object)instance.master) && Object.op_Implicit((Object)(object)instance.master.inventory))
			{
				num += instance.master.inventory.GetItemCount(Items.sherry.itemDef);
			}
		}
		float num2 = Utils.CalculateItemBonus(Items.sherry.floatValue1.Value, Items.sherry.floatValue1Stack.Value, num);
		if (self.holdoutZoneController.isAnyoneCharging)
		{
			int num3 = HoldoutZoneController.CountLivingPlayers(self.holdoutZoneController.chargingTeam);
			int num4 = HoldoutZoneController.CountPlayersInRadius(self.holdoutZoneController, ((Component)self.holdoutZoneController).transform.position, self.holdoutZoneController.currentRadius * self.holdoutZoneController.currentRadius, self.holdoutZoneController.chargingTeam);
			float baseChargeDuration = self.holdoutZoneController.baseChargeDuration;
			float num5 = ((!self.holdoutZoneController.isAnyoneCharging || num3 <= 0) ? (0f - self.holdoutZoneController.dischargeRate) : (Mathf.Pow((float)num4 / (float)num3, self.holdoutZoneController.playerCountScaling) / baseChargeDuration));
			self.holdoutZoneController.charge = Mathf.Clamp01(self.holdoutZoneController.charge + num5 * Time.fixedDeltaTime * num2);
		}
	}

	private static void CharacterModel_SetEquipmentDisplay(orig_SetEquipmentDisplay orig, CharacterModel self, EquipmentIndex newEquipmentIndex)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		if (!Items.replacedItems.Contains(EquipmentCatalog.GetEquipmentDef(newEquipmentIndex)))
		{
			orig.Invoke(self, newEquipmentIndex);
		}
	}

	private static void DeathRewards_OnKilledServer(orig_OnKilledServer orig, DeathRewards self, DamageReport damageReport)
	{
		int num = 0;
		if (Object.op_Implicit((Object)(object)damageReport.attackerBody) && Object.op_Implicit((Object)(object)damageReport.attackerBody.inventory) && (num = damageReport.attackerBody.inventory.GetItemCount(Items.cigar.itemDef)) > 0)
		{
			uint num2 = 0u;
			float num3 = Utils.CalculateItemBonus(Items.cigar.floatValue1.Value, Items.cigar.floatValue1Stack.Value, num);
			if (!Object.op_Implicit((Object)(object)self.characterBody.master))
			{
				num2 = self.fallbackGold;
				self.fallbackGold = (uint)Mathf.CeilToInt((float)num2 * num3);
			}
			else
			{
				num2 = self.characterBody.master.money;
				self.characterBody.master.money = (uint)Mathf.CeilToInt((float)num2 * num3);
			}
		}
		orig.Invoke(self, damageReport);
	}

	private static void CharacterBody_OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill)
	{
		orig.Invoke(self, skill);
		if (NetworkServer.active && Object.op_Implicit((Object)(object)self.inventory) && (Object)(object)skill == (Object)(object)self.skillLocator.secondary)
		{
			self.AddTimedBuff(Prefabs.mojitoArmorBuff, Utils.CalculateItemBonus(Items.mojito.floatValue1.Value, Items.mojito.floatValue1Stack.Value, self.inventory.GetItemCount(Items.mojito.itemDef)));
		}
	}

	private static void Inventory_onServerItemGiven(Inventory inventory, ItemIndex itemIndex, int count)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: 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_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Invalid comparison between Unknown and I4
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		int num = 0;
		if (itemIndex != Items.hotwings.itemDef.itemIndex && itemIndex != Items.hotwingsConsumed.itemDef.itemIndex && (num = inventory.GetItemCount(Items.hotwings.itemDef)) > 0)
		{
			ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex);
			if (Object.op_Implicit((Object)(object)itemDef) && (int)itemDef.tier != 5)
			{
				inventory.RemoveItem(Items.hotwings.itemDef, 1);
				inventory.GiveItem(Items.hotwingsConsumed.itemDef, 1);
				CharacterMasterNotificationQueue.SendTransformNotification(((Component)inventory).GetComponent<CharacterMaster>(), Items.hotwings.itemDef.itemIndex, Items.hotwingsConsumed.itemDef.itemIndex, (TransformationType)0);
				inventory.GiveItem(itemIndex, 1);
			}
		}
	}

	private static void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body)
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: 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)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0165: Unknown result type (might be due to invalid IL or missing references)
		//IL_016a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0180: Unknown result type (might be due to invalid IL or missing references)
		Inventory inventory = body.inventory;
		if (!NetworkServer.active || !Object.op_Implicit((Object)(object)inventory))
		{
			return;
		}
		body.AddItemBehavior<GoldenAspectItemBodyBehaviour>((inventory.currentEquipmentIndex == Items.goldenAspect.equipDef.equipmentIndex) ? 1 : 0);
		body.AddItemBehavior<VapeItemBodyBehaviour>(inventory.GetItemCount(Items.vape.itemDef));
		body.AddItemBehavior<BloodMaryRegenItemBodyBehavior>(inventory.GetItemCount(Items.bloodymary.itemDef));
		Utils.AddItemBehavior<VarianCigarBehaviour>(body.masterObject, inventory.GetItemCount(Items.variancigar.itemDef));
		int num = 0;
		if ((num = inventory.GetItemCount(Items.maria.itemDef)) <= 0)
		{
			return;
		}
		bool flag = false;
		ItemIndex itemIndex = Items.maria.itemDef.itemIndex;
		ItemIndex itemIndex2 = Items.mariaConsumed.itemDef.itemIndex;
		for (int i = 0; i < ItemCatalog.itemCount; i++)
		{
			ItemIndex val = (ItemIndex)i;
			if (val != itemIndex && val != itemIndex2 && inventory.GetItemCount(val) > 0)
			{
				flag = true;
				break;
			}
		}
		if (!flag)
		{
			return;
		}
		inventory.RemoveItem(Items.maria.itemDef, 1);
		inventory.GiveItem(Items.mariaConsumed.itemDef, 1);
		List<ItemIndex> itemAcquisitionOrder = inventory.itemAcquisitionOrder;
		for (int j = 0; j < itemAcquisitionOrder.Count; j++)
		{
			if (itemAcquisitionOrder[j] != itemIndex && itemAcquisitionOrder[j] != itemIndex2)
			{
				inventory.GiveItem(itemAcquisitionOrder[j], Items.maria.intValue1.Value);
			}
		}
		CharacterMasterNotificationQueue.SendTransformNotification(((Component)inventory).GetComponent<CharacterMaster>(), Items.maria.itemDef.itemIndex, Items.mariaConsumed.itemDef.itemIndex, (TransformationType)0);
	}

	private static void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
	{
		orig.Invoke(self);
		if (Object.op_Implicit((Object)(object)self.inventory) && self.healthComponent.barrier > 0f && self.inventory.GetItemCount(Items.painkiller.itemDef) > 0)
		{
			self.barrierDecayRate *= Math.Max(0f, 1f - Items.painkiller.floatValue2.Value);
		}
	}

	private static void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport)
	{
		//IL_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0239: Unknown result type (might be due to invalid IL or missing references)
		//IL_023e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_0318: Unknown result type (might be due to invalid IL or missing references)
		//IL_031e: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)damageReport.victimBody) || !Object.op_Implicit((Object)(object)damageReport.attackerBody) || !Object.op_Implicit((Object)(object)damageReport.attackerBody.inventory) || !Object.op_Implicit((Object)(object)damageReport.attackerMaster))
		{
			return;
		}
		HealthComponent healthComponent = damageReport.attackerBody.healthComponent;
		int num = 0;
		if (NetworkServer.active)
		{
			float num2 = 0f;
			RigidbodyMotor component = ((Component)damageReport.victimBody).GetComponent<RigidbodyMotor>();
			if (Object.op_Implicit((Object)(object)damageReport.victimBody.characterMotor))
			{
				num2 = damageReport.victimBody.characterMotor.mass;
			}
			else if (Object.op_Implicit((Object)(object)component))
			{
				num2 = component.mass;
			}
			if (num2 >= 250f && (num = damageReport.attackerBody.inventory.GetItemCount(Items.champagne.itemDef)) > 0)
			{
				HealthComponent healthComponent2 = damageReport.attackerBody.healthComponent;
				healthComponent2.Heal(healthComponent2.fullCombinedHealth * Utils.CalculateItemBonus(Items.champagne.floatValue1.Value, Items.champagne.floatValue1Stack.Value, num), default(ProcChainMask), true);
			}
			if ((num = damageReport.attackerBody.inventory.GetItemCount(Items.beer.itemDef)) > 0 && RoR2Application.rng.RangeFloat(0f, 1f) <= Utils.CalculateItemBonus(Items.beer.floatValue1.Value, Items.beer.floatValue1Stack.Value, num))
			{
				BuffIndex[] eliteBuffIndices = BuffCatalog.eliteBuffIndices;
				damageReport.attackerBody.AddTimedBuff(eliteBuffIndices[RoR2Application.rng.RangeInt(0, eliteBuffIndices.Length)], Items.beer.floatValue2.Value);
			}
			if ((num = damageReport.attackerBody.inventory.GetItemCount(Items.spliff.itemDef)) > 0)
			{
				damageReport.attackerMaster.GiveMoney((uint)(damageReport.attackerBody.multiKillCount * Utils.CalculateItemBonus(Items.spliff.intValue1.Value, Items.spliff.intValue1Stack.Value, num)));
			}
			if (ProcTypeAPI.HasModdedProc(damageReport.damageInfo.procChainMask, Prefabs.meleeProc) && (num = damageReport.attackerBody.inventory.GetItemCount(Items.mead.itemDef)) > 0)
			{
				healthComponent.Heal(healthComponent.fullCombinedHealth * Utils.CalculateItemBonus(Items.mead.floatValue1.Value, Items.mead.floatValue1.Value, num), default(ProcChainMask), true);
			}
			if ((num = damageReport.attackerBody.inventory.GetItemCount(Items.tequila.itemDef)) > 0)
			{
				HealthComponent healthComponent3 = damageReport.attackerBody.healthComponent;
				healthComponent3.Heal(healthComponent3.fullCombinedHealth * Utils.CalculateItemBonus(Items.tequila.floatValue1.Value, Items.tequila.floatValue1Stack.Value, num), default(ProcChainMask), true);
			}
		}
	}

	private static void CharacterModel_EnableItemDisplay(orig_EnableItemDisplay orig, CharacterModel self, ItemIndex itemIndex)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		if (!Items.replacedItems.Contains(ItemCatalog.GetItemDef(itemIndex)))
		{
			orig.Invoke(self, itemIndex);
		}
	}

	private static void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
	{
		//IL_040e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0413: Unknown result type (might be due to invalid IL or missing references)
		//IL_042f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0436: Unknown result type (might be due to invalid IL or missing references)
		//IL_043b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0440: Unknown result type (might be due to invalid IL or missing references)
		//IL_044c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0458: Unknown result type (might be due to invalid IL or missing references)
		//IL_045f: Unknown result type (might be due to invalid IL or missing references)
		//IL_046a: Unknown result type (might be due to invalid IL or missing references)
		//IL_046c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0473: Expected O, but got Unknown
		//IL_0210: Unknown result type (might be due to invalid IL or missing references)
		//IL_0215: Unknown result type (might be due to invalid IL or missing references)
		int num = 0;
		bool flag = Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.master) && Object.op_Implicit((Object)(object)self.body.inventory) && Object.op_Implicit((Object)(object)damageInfo.attacker);
		CharacterBody val = null;
		if (flag)
		{
			val = damageInfo.attacker.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.inventory))
			{
				if ((num = self.body.inventory.GetItemCount(Items.cider.itemDef)) > 0 && Object.op_Implicit((Object)(object)val))
				{
					float num2 = 0f;
					RigidbodyMotor component = ((Component)val).GetComponent<RigidbodyMotor>();
					if (Object.op_Implicit((Object)(object)val.characterMotor))
					{
						num2 = val.characterMotor.mass;
					}
					else if (Object.op_Implicit((Object)(object)component))
					{
						num2 = component.mass;
					}
					if (num2 >= 250f)
					{
						damageInfo.damage *= Math.Max(0f, 1f + Utils.CalculateItemBonus(Items.cider.floatValue1.Value, Items.cider.floatValue1Stack.Value, num));
					}
				}
				if ((num = val.inventory.GetItemCount(Items.ale.itemDef)) > 0)
				{
					damageInfo.damage *= 1f + Utils.CalculateItemBonus(Items.ale.floatValue1.Value, Items.ale.floatValue1Stack.Value, num);
				}
				if ((num = self.body.inventory.GetItemCount(Items.rum.itemDef)) > 0)
				{
					damageInfo.damage -= (float)self.body.master.money * Utils.CalculateItemBonus(Items.rum.floatValue1.Value, Items.rum.floatValue1Stack.Value, num);
				}
				bool flag2 = ProcTypeAPI.HasModdedProc(damageInfo.procChainMask, Prefabs.meleeProc);
				if (flag2 && (num = self.body.inventory.GetItemCount(Items.painkiller.itemDef)) > 0)
				{
					damageInfo.damage *= Math.Max(0f, 1f - Utils.CalculateItemBonus(Items.painkiller.floatValue1.Value, Items.painkiller.floatValue1Stack.Value, num));
				}
				if (val.HasBuff(Buffs.AffixBlue) && (num = self.body.inventory.GetItemCount(Items.water.itemDef)) > 0)
				{
					damageInfo.damage *= Math.Max(0f, 1f - Utils.CalculateItemBonus(Items.water.floatValue2.Value, Items.water.floatValue2Stack.Value, num));
				}
				if (flag2 && (num = val.inventory.GetItemCount(Items.sake.itemDef)) > 0)
				{
					damageInfo.damage *= Math.Max(0f, 1f + Utils.CalculateItemBonus(Items.sake.floatValue1.Value, Items.sake.floatValue1Stack.Value, num));
				}
			}
		}
		orig.Invoke(self, damageInfo);
		if (flag && Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.inventory) && damageInfo.procCoefficient > 0f && (num = val.inventory.GetItemCount(Items.screwdriver.itemDef)) > 0 && RoR2Application.rng.RangeFloat(0f, 1f) <= Utils.CalculateItemBonus(Items.screwdriver.floatValue1.Value, Items.screwdriver.floatValue1Stack.Value, num))
		{
			DamageInfo val2 = new DamageInfo
			{
				damage = damageInfo.damage * Items.screwdriver.floatValue2.Value,
				position = self.body.corePosition,
				attacker = damageInfo.attacker,
				inflictor = damageInfo.inflictor,
				crit = false,
				procCoefficient = 0f,
				damageColorIndex = (DamageColorIndex)3
			};
			self.TakeDamage(val2);
		}
	}

	private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
	{
		HealthComponent healthComponent = sender.healthComponent;
		if (sender.HasBuff(Prefabs.vodkaBuff))
		{
			float value = Items.vodka.floatValue1.Value;
			args.damageMultAdd += value;
			args.regenMultAdd += value;
			args.moveSpeedMultAdd += value;
		}
		if (sender.HasBuff(Prefabs.mojitoArmorBuff))
		{
			args.armorAdd += (float)Items.mojito.intValue1.Value;
		}
		if (Object.op_Implicit((Object)(object)sender.inventory))
		{
			int num = 0;
			if (healthComponent.barrier > 0f && (num = sender.inventory.GetItemCount(Items.whitewine.itemDef)) > 0)
			{
				args.damageMultAdd += Utils.CalculateItemBonus(Items.whitewine.floatValue1.Value, Items.whitewine.floatValue1Stack.Value, num);
			}
			if (healthComponent.combinedHealth < healthComponent.fullCombinedHealth * 0.5f && (num = sender.inventory.GetItemCount(Items.espresso.itemDef)) > 0)
			{
				args.damageMultAdd += Utils.CalculateItemBonus(Items.espresso.floatValue1.Value, Items.espresso.floatValue1Stack.Value, num);
			}
			if ((num = sender.inventory.GetItemCount(Items.whiskey.itemDef)) > 0)
			{
				args.cooldownMultAdd -= Utils.CalculateItemBonus(Items.whiskey.floatValue1.Value, Items.whiskey.floatValue1Stack.Value, num);
			}
		}
	}

	private static void StrengthenBurnUtils_CheckDotForUpgrade(orig_CheckDotForUpgrade orig, Inventory inventory, ref InflictDotInfo dotInfo)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Invalid comparison between Unknown and I4
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Invalid comparison between Unknown and I4
		if ((int)dotInfo.dotIndex == 1 || (int)dotInfo.dotIndex == 2)
		{
			CharacterBody component = dotInfo.victimObject.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory))
			{
				int num = 0;
				if ((num = component.inventory.GetItemCount(Items.water.itemDef)) > 0)
				{
					if (dotInfo.duration != 0f)
					{
						dotInfo.duration *= Items.water.floatValue1.Value;
					}
					else
					{
						dotInfo.totalDamage *= Items.water.floatValue1.Value;
					}
				}
			}
		}
		orig.Invoke(inventory, ref dotInfo);
	}

	private static float Inventory_CalculateEquipmentCooldownScale(orig_CalculateEquipmentCooldownScale orig, Inventory self)
	{
		float num = orig.Invoke(self);
		int itemCount = self.GetItemCount(Items.bourbon.itemDef);
		float num2 = ((itemCount > 0) ? (1f - Utils.CalculateItemBonus(Items.bourbon.floatValue1.Value, Items.bourbon.floatValue1Stack.Value, itemCount)) : 1f);
		return num * num2;
	}
}
internal class ItemBase : ScriptableObject
{
	public ConfigFile config;

	public ConfigEntry<float> floatValue1;

	public ConfigEntry<float> floatValue1Stack;

	public ConfigEntry<int> intValue1;

	public ConfigEntry<int> intValue1Stack;

	public ConfigEntry<float> floatValue2;

	public ConfigEntry<float> floatValue2Stack;

	public ConfigEntry<int> intValue2;

	public ConfigEntry<int> intValue2Stack;

	public ConfigEntry<float> floatValue3;

	public ConfigEntry<float> floatValue3Stack;

	public ConfigEntry<int> intValue3;

	public ConfigEntry<int> intValue3Stack;

	public ConfigEntry<float> cooldown;

	public ItemDef itemDef;

	public EquipmentDef equipDef;
}
internal class Items
{
	internal const string Prefix = "BMANITEMS_";

	internal static Dictionary<ItemBase, object> ItemDict = new Dictionary<ItemBase, object>();

	internal static List<object> replacedItems = new List<object>();

	internal static ItemBase cider;

	internal static ItemBase ale;

	internal static ItemBase champagne;

	internal static ItemBase vodka;

	internal static ItemBase vodkaConsumed;

	internal static ItemBase whitewine;

	internal static ItemBase rum;

	internal static ItemBase painkiller;

	internal static ItemBase beer;

	internal static ItemBase spliff;

	internal static ItemBase vape;

	internal static ItemBase hotwings;

	internal static ItemBase hotwingsConsumed;

	internal static ItemBase espresso;

	internal static ItemBase water;

	internal static ItemBase smokes;

	internal static ItemBase tequila;

	internal static ItemBase bloodymary;

	internal static ItemBase sake;

	internal static ItemBase mead;

	internal static ItemBase cigar;

	internal static ItemBase variancigar;

	internal static ItemBase whiskey;

	internal static ItemBase mojito;

	internal static ItemBase bourbon;

	internal static ItemBase sherry;

	internal static ItemBase screwdriver;

	internal static ItemBase superAntacids;

	internal static ItemBase maria;

	internal static ItemBase mariaConsumed;

	internal static ItemBase goldenAspect;

	internal static ItemBase CreateNewItemBase(object def, float floatValue1 = 0f, float floatValue1Stack = 0f, int intValue1 = 0, int intValue1Stack = 0, float floatValue2 = 0f, float floatValue2Stack = 0f, int intValue2 = 0, int intValue2Stack = 0, float floatValue3 = 0f, float floatValue3Stack = 0f, int intValue3 = 0, int intValue3Stack = 0)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Expected O, but got Unknown
		ItemDef val = ((!(def is ItemDef)) ? ((ItemDef)null) : ((ItemDef)def));
		EquipmentDef val2 = ((!(def is EquipmentDef)) ? ((EquipmentDef)null) : ((EquipmentDef)def));
		ItemBase itemBase = ScriptableObject.CreateInstance<ItemBase>();
		itemBase.itemDef = val;
		itemBase.equipDef = val2;
		if ((Object.op_Implicit((Object)(object)val2) && val2.cooldown != 0f && floatValue1 != 0f) || floatValue1Stack != 0f || intValue1 != 0 || intValue1Stack != 0 || floatValue2 != 0f || floatValue2Stack != 0f || intValue2 != 0 || intValue2Stack != 0 || floatValue3 != 0f || floatValue3Stack != 0f || intValue3 != 0 || intValue3Stack != 0)
		{
			string text = (Object.op_Implicit((Object)(object)val) ? ((Object)val).name : ((Object)val2).name);
			itemBase.config = new ConfigFile(Paths.ConfigPath + "\\BManItems\\" + text.Replace("BMANITEMS_", "") + ".cfg", true);
			if (Object.op_Implicit((Object)(object)itemBase.equipDef) && itemBase.equipDef.cooldown != 0f)
			{
				itemBase.cooldown = itemBase.config.Bind<float>("General", "Cooldown", itemBase.equipDef.cooldown, (ConfigDescription)null);
				itemBase.equipDef.cooldown = itemBase.cooldown.Value;
			}
			if (floatValue1 != 0f)
			{
				itemBase.floatValue1 = itemBase.config.Bind<float>("General", "Float Value 1", floatValue1, (ConfigDescription)null);
			}
			if (floatValue1Stack != 0f)
			{
				itemBase.floatValue1Stack = itemBase.config.Bind<float>("General", "Stacking Float Value 1", floatValue1Stack, (ConfigDescription)null);
			}
			if (intValue1 != 0)
			{
				itemBase.intValue1 = itemBase.config.Bind<int>("General", "Integer Value 1", intValue1, (ConfigDescription)null);
			}
			if (intValue1Stack != 0)
			{
				itemBase.intValue1Stack = itemBase.config.Bind<int>("General", "Stacking Integer Value 2", intValue1Stack, (ConfigDescription)null);
			}
			if (floatValue2 != 0f)
			{
				itemBase.floatValue2 = itemBase.config.Bind<float>("General", "Float Value 2", floatValue2, (ConfigDescription)null);
			}
			if (floatValue2Stack != 0f)
			{
				itemBase.floatValue2Stack = itemBase.config.Bind<float>("General", "Stacking Float Value 2", floatValue2Stack, (ConfigDescription)null);
			}
			if (intValue2 != 0)
			{
				itemBase.intValue2 = itemBase.config.Bind<int>("General", "Integer Value 2", intValue2, (ConfigDescription)null);
			}
			if (intValue2Stack != 0)
			{
				itemBase.intValue2Stack = itemBase.config.Bind<int>("General", "Stacking Integer Value 2", intValue2Stack, (ConfigDescription)null);
			}
			if (floatValue3 != 0f)
			{
				itemBase.floatValue3 = itemBase.config.Bind<float>("General", "Float Value 3", floatValue3, (ConfigDescription)null);
			}
			if (floatValue3Stack != 0f)
			{
				itemBase.floatValue3Stack = itemBase.config.Bind<float>("General", "Stacking Float Value 3", floatValue3Stack, (ConfigDescription)null);
			}
			if (intValue3 != 0)
			{
				itemBase.intValue3 = itemBase.config.Bind<int>("General", "Integer Value 3", intValue3, (ConfigDescription)null);
			}
			if (intValue3Stack != 0)
			{
				itemBase.intValue3Stack = itemBase.config.Bind<int>("General", "Stacking Integer Value 3", intValue3Stack, (ConfigDescription)null);
			}
		}
		ItemDict.Add(itemBase, def);
		return itemBase;
	}

	internal static ItemDef CreateNewItem(string name, ItemTier tier, ItemTag[] tags, bool canRemove)
	{
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		ItemDef val = ScriptableObject.CreateInstance<ItemDef>();
		((Object)val).name = "BMANITEMS_" + name;
		val.nameToken = "BMANITEMS_" + name + "_NAME";
		val.descriptionToken = "BMANITEMS_" + name + "_DESC";
		val.pickupToken = "BMANITEMS_" + name + "_PICKUP";
		val.loreToken = "BMANITEMS_" + name + "_LORE";
		val.deprecatedTier = tier;
		val.pickupIconSprite = Assets.Load<Sprite>(name.ToLower());
		val.pickupModelPrefab = NewItemPrefab(name.ToLower());
		val.canRemove = canRemove;
		val.hidden = false;
		val.unlockableDef = null;
		val.tags = tags;
		ContentAddition.AddItemDef(val);
		return val;
	}

	internal static EquipmentDef CreateNewEquipment(string name, float cooldown, bool isLunar = false, bool canDrop = true)
	{
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		EquipmentDef val = ScriptableObject.CreateInstance<EquipmentDef>();
		((Object)val).name = "BMANITEMS_" + name;
		val.nameToken = "BMANITEMS_" + name + "_NAME";
		val.descriptionToken = "BMANITEMS_" + name + "_DESC";
		val.pickupToken = "BMANITEMS_" + name + "_PICKUP";
		val.loreToken = "BMANITEMS_" + name + "_LORE";
		val.pickupIconSprite = Assets.Load<Sprite>(name.ToLower());
		val.pickupModelPrefab = NewItemPrefab(name.ToLower());
		val.unlockableDef = null;
		val.appearsInSinglePlayer = true;
		val.appearsInMultiPlayer = true;
		val.canBeRandomlyTriggered = true;
		val.canDrop = canDrop;
		val.canBeRandomlyTriggered = canDrop;
		val.cooldown = cooldown;
		val.enigmaCompatible = true;
		val.isBoss = false;
		val.isLunar = isLunar;
		val.colorIndex = (ColorIndex)(isLunar ? 4 : 5);
		ContentAddition.AddEquipmentDef(val);
		return val;
	}

	internal static GameObject NewItemPrefab(string name)
	{
		if (!Object.op_Implicit((Object)(object)Prefabs.itemModels.GetComponent<ChildLocator>().FindChild(name.Replace("CONSUMED", ""))))
		{
			return null;
		}
		GameObject val = Prefabs.Instantiate(Prefabs.itemModels, name);
		((Component)val.GetComponent<ChildLocator>().FindChild(name)).gameObject.SetActive(true);
		return val;
	}

	internal static void SwapItem(string path, string token, bool description = false)
	{
		string name = token.ToLower();
		ItemDef val = Prefabs.Load<ItemDef>(path);
		if (Object.op_Implicit((Object)(object)val))
		{
			val.nameToken = "BMANITEMS_" + token + "_NAME";
			val.pickupModelPrefab = NewItemPrefab(name);
			val.pickupIconSprite = Assets.Load<Sprite>(name);
			replacedItems.Add(val);
			if (description)
			{
				val.descriptionToken = "BMANITEMS_" + token + "_DESC";
			}
		}
		else
		{
			EquipmentDef val2 = Prefabs.Load<EquipmentDef>(path);
			if (Object.op_Implicit((Object)(object)val2))
			{
				val2.nameToken = "BMANITEMS_" + token + "_NAME";
				val2.pickupModelPrefab = NewItemPrefab(name);
				val2.pickupIconSprite = Assets.Load<Sprite>(name);
				replacedItems.Add(val2);
			}
		}
	}

	internal static void CreateItems()
	{
		bool flag = true;
		string text = "";
		if (flag)
		{
			text = "CIDER";
			cider = CreateNewItemBase(CreateNewItem(text, (ItemTier)1, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)1,
				(ItemTag)5
			}, canRemove: true), -0.05f, -0.05f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Cider");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Receive <style=cIsHealth>" + cider.floatValue1.Value * 100f + "%</style> <style=cStack>(" + cider.floatValue1Stack.Value * 100f + "% per stack) less damage from large enemies.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Receive less damage from large enemies.");
		}
		if (flag)
		{
			text = "ALE";
			ale = CreateNewItemBase(CreateNewItem(text, (ItemTier)0, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)1,
				(ItemTag)5
			}, canRemove: true), 0.05f, 0.05f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Ale");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Deal <style=cIsHealth>" + ale.floatValue1.Value * 100f + "%</style> <style=cStack>(+" + ale.floatValue1Stack.Value * 100f + "% per stack) more damage from all sources.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Deal more damage.");
			LanguageAPI.Add("BMANITEMS_" + text + "_LORE", "");
		}
		if (flag)
		{
			text = "STOUT";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Stout");
			SwapItem("RoR2/Base/UtilitySkillMagazine/UtilitySkillMagazine.asset", text);
		}
		if (flag)
		{
			text = "LAGER";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Lager");
			SwapItem("RoR2/Base/FlatHealth/FlatHealth.asset", text);
		}
		if (flag)
		{
			text = "PORTER";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Porter");
			SwapItem("RoR2/Base/EquipmentMagazine/EquipmentMagazine.asset", text);
		}
		if (flag)
		{
			text = "PORTERCORRUPTED";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Porter (Corrupted)");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Add <style=cIsUtility>+1</style> <style=cStack>(+1 per stack)</style> charge of your <style=cIsUtility>Special skill</style>. <style=cIsVoid>Corrupts all Porters.</style>.");
			SwapItem("RoR2/DLC1/EquipmentMagazineVoid/EquipmentMagazineVoid.asset", text, description: true);
		}
		if (flag)
		{
			text = "MOONSHINE";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Moonshine");
			SwapItem("RoR2/DLC1/StrengthenBurn/StrengthenBurn.asset", text);
		}
		if (flag)
		{
			text = "CHAMPAGNE";
			champagne = CreateNewItemBase(CreateNewItem(text, (ItemTier)2, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)2,
				(ItemTag)5
			}, canRemove: true), 0.1f, 0.025f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Champagne");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Killing a large enemy <style=cIsHealing>heals</style> for <style=cIsHealing>" + champagne.floatValue1.Value * 100f + "%</style> <style=cStack>(+" + champagne.floatValue1Stack.Value * 100f + "% per stack)</style> max health.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Heal when killing large enemies.");
		}
		if (flag)
		{
			text = "VODKA";
			vodka = CreateNewItemBase(CreateNewEquipment(text, 0f), 3f, 0f, 0, 0, 180f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Vodka");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Increases <style=cIsDamage>damage</style>, <style=cIsHealing>health regeneration</style> and <style=cIsUtility>movement speed</style> by <style=cIsDamage>" + vodka.floatValue1.Value * 100f + "%</style>, and grants <style=cIsUtility>invisibility</style> for <style=cIsUtility>" + vodka.floatValue2.Value + "s</style>. Equipment is <style=cIsUtility>consumed</style> on use.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Increases damage, health regeneration and movement speed. Grants invisibility.");
		}
		if (flag)
		{
			text = "VODKACONSUMED";
			vodkaConsumed = CreateNewItemBase(CreateNewEquipment(text, 0f, isLunar: false, canDrop: false));
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Vodka (Consumed)");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "A spent equipment with no remaining power.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "A spent equipment with no remaining power.");
		}
		if (flag)
		{
			text = "REDWINE";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Red Wine");
			SwapItem("RoR2/Base/Infusion/Infusion.asset", text);
		}
		if (flag)
		{
			text = "WHITEWINE";
			whitewine = CreateNewItemBase(CreateNewItem(text, (ItemTier)1, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)1,
				(ItemTag)5
			}, canRemove: true), 0.2f, 0.1f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "White Wine");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Increases <style=cIsDamage>damage</style> by <style=cIsDamage>" + whitewine.floatValue1.Value * 100f + "%</style> <style=cStack>(+" + whitewine.floatValue1Stack.Value * 100f + "% per stack)</style> while you have a <style=cIsHealing>barrier</style>.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "");
		}
		if (flag)
		{
			text = "RUM";
			rum = CreateNewItemBase(CreateNewItem(text, (ItemTier)2, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)2,
				(ItemTag)5
			}, canRemove: true), 0.01f, 0.005f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Rum");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Damage received is reduced by <style=cIsHealing>" + rum.floatValue1.Value * 100f + "%</style> <style=cStack>(+" + rum.floatValue1Stack.Value * 100f + "% per stack)</style> of your <style=cIsUtility>gold</style>.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Receive reduced damage based on your gold.");
		}
		if (flag)
		{
			text = "MARTINI";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Martini");
			SwapItem("RoR2/Base/AlienHead/AlienHead.asset", text);
		}
		if (flag)
		{
			text = "MARGARITA";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Margarita");
			SwapItem("RoR2/Base/Syringe/Syringe.asset", text);
		}
		if (flag)
		{
			text = "PAINKILLER";
			string name = text;
			ItemTag[] array = new ItemTag[3];
			RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			painkiller = CreateNewItemBase(CreateNewItem(name, (ItemTier)0, (ItemTag[])(object)array, canRemove: true), 0.05f, 0.05f, 0, 0, 0.25f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Painkillers");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Damage received by melee attacks is reduced by <style=cIsHealing>" + painkiller.floatValue1.Value * 100f + "%</style> <style=cStack>(" + painkiller.floatValue1Stack.Value * 100f + "% per stack)</style>. Barrier decays <style=cIsUtility>" + painkiller.floatValue1Stack.Value * 100f + "%</style> slower.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Receive reduced damage form melee attacks and barrier decay is slower.");
		}
		if (flag)
		{
			text = "STIMULANTS";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Stimulants");
			SwapItem("RoR2/Base/Bear/Bear.asset", text);
		}
		if (flag)
		{
			text = "STIMULANTSCORRUPTED";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Stimulants (Corrupted)");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "<style=cIsHealing>Blocks</style> incoming damage once. Recharges after <style=cIsUtility>15 seconds</style> <style=cStack>(-10% per stack)</style>. <style=cIsVoid>Corrupts all Stimulants</style>.");
			SwapItem("RoR2/DLC1/BearVoid/BearVoid.asset", text, description: true);
		}
		if (flag)
		{
			text = "BEER";
			string name2 = text;
			ItemTag[] array2 = new ItemTag[3];
			RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			beer = CreateNewItemBase(CreateNewItem(name2, (ItemTier)2, (ItemTag[])(object)array2, canRemove: true), 0.025f, 0.025f, 0, 0, 10f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Beer");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "<style=cIsDamage>" + beer.floatValue1.Value * 100f + "%</style> <style=cStack>(+" + beer.floatValue1Stack.Value * 100f + "% per stack)</style> chance on kill to gain a random <style=cIsDamage>elite aspect</style> for <style=cIsUtility>" + beer.floatValue2.Value + "s</style>.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Chance on kill to gain a random elite aspect.");
		}
		if (flag)
		{
			text = "ENERGYDRINK";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Energy Drink");
			SwapItem("RoR2/Base/SprintBonus/SprintBonus.asset", text);
		}
		if (flag)
		{
			text = "SPLIFF";
			string name3 = text;
			ItemTag[] array3 = new ItemTag[3];
			RuntimeHelpers.InitializeArray(array3, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			spliff = CreateNewItemBase(CreateNewItem(name3, (ItemTier)1, (ItemTag[])(object)array3, canRemove: true), 0f, 0f, 2, 2);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Spliff");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Gain <style=cIsUtility>" + spliff.intValue1.Value + " <style=cStack>(+" + spliff.intValue1Stack.Value + " per stack)</style> <style=cIsUtility>gold</style> on kill, scaling with multiple kills in a row.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Gain gold on kill.");
		}
		if (flag)
		{
			text = "VAPE";
			vape = CreateNewItemBase(CreateNewItem(text, (ItemTier)2, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)3,
				(ItemTag)5
			}, canRemove: true), 60f, 10f, 0, 0, 0.15f, 0.05f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Vape Pen");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Trigger a random effect every <style=cIsUtility>" + vape.floatValue1.Value + " <style=cStack>(-" + vape.floatValue1Stack.Value + " per stack)</style>. The effect can be a <style=cIsHealing>" + vape.floatValue2.Value * 100f + "%</style> <style=cStack>(" + vape.floatValue2Stack.Value * 100f + "% per stack)</style> <style=cIsHealing>max health heal</style>, <style=cIsUtility>freeze</style> or <style=cIsDamage>ignite</style> nearby enemies.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Trigger a random effect after a delay.");
		}
		if (flag)
		{
			text = "HOTWINGS";
			hotwings = CreateNewItemBase(CreateNewItem(text, (ItemTier)0, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)3,
				(ItemTag)5
			}, canRemove: true));
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Hot Wings");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Gain an additional copy of the next item you get. This item will be <style=cIsUtility>consumed</style> after its activation.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Gain more of the next item you get.");
		}
		if (flag)
		{
			text = "HOTWINGSCONSUMED";
			string name4 = text;
			ItemTag[] array4 = new ItemTag[3];
			RuntimeHelpers.InitializeArray(array4, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			hotwingsConsumed = CreateNewItemBase(CreateNewItem(name4, (ItemTier)5, (ItemTag[])(object)array4, canRemove: true), 0f, 0f, 1, 1);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Hot Wings (Consumed)");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "A spent item with no remaining power.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "A spent item with no remaining power.");
		}
		if (flag)
		{
			text = "ESPRESSO";
			espresso = CreateNewItemBase(CreateNewItem(text, (ItemTier)1, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)1,
				(ItemTag)5
			}, canRemove: true), 0.15f, 0.15f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Espresso");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Gain <style=cIsDamage>" + espresso.floatValue1.Value * 100f + "%</style><style=cStack>(+" + espresso.floatValue1Stack.Value * 100f + "%</style> damage while your <style=cIsHealth>health</style> is lower than <style=cIsHealth>50%</style>.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Increases damage while low on health.");
		}
		if (flag)
		{
			text = "WATER";
			water = CreateNewItemBase(CreateNewItem(text, (ItemTier)1, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)2,
				(ItemTag)5
			}, canRemove: true), 0.5f, 0f, 0, 0, 0.05f, 0.05f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Water");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Reduce the duration of <style=cIsDamage>ignites</style> by <style=cIsUtility>" + water.floatValue1.Value * 100f + "%</style>. Overloading enemies deal <style=cIsDamage></style>" + water.floatValue2.Value * 100f + "%</style><style=cStack>(+" + water.floatValue2Stack.Value * 100f + "%</style> less damage.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Ignite effect durations are shortened, and gain resistance to overloading enemies.");
		}
		if (flag)
		{
			text = "ANTACIDS";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Antacids");
		}
		if (flag)
		{
			text = "ANTACIDSCONSUMED";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Antacids (Consumed)");
		}
		if (flag)
		{
			text = "SMOKES";
			smokes = CreateNewItemBase(CreateNewEquipment(text, 45f));
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Smokes");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Instantly gain a <style=cIsHealing>full health temporary barrier</style>.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Gain a temporary barrier for full health.");
		}
		if (flag)
		{
			text = "TEQUILA";
			string name5 = text;
			ItemTag[] array5 = new ItemTag[3];
			RuntimeHelpers.InitializeArray(array5, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			tequila = CreateNewItemBase(CreateNewItem(name5, (ItemTier)1, (ItemTag[])(object)array5, canRemove: true), 0.025f, 0.025f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Tequila");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "<style=cIsHealing>Heal " + tequila.floatValue1.Value * 100f + "% maximum health</style> <style=cStack>(+" + tequila.floatValue1Stack.Value * 100f + "% per stack)</style> on kill.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Heal on kill.");
		}
		if (flag)
		{
			text = "BLOODYMARY";
			bloodymary = CreateNewItemBase(CreateNewItem(text, (ItemTier)0, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)2,
				(ItemTag)5
			}, canRemove: true), 0.05f, 0.025f, 0, 0, 5f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Bloody Mary");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Gain <style=cIsHealing>" + bloodymary.floatValue1.Value * 100f + "% maximum</style> <style=cStack>(+" + bloodymary.floatValue1Stack.Value * 100f + "% per stack)</style> <style=cIsHealing>max health</style> over <style=cIsUtility>" + bloodymary.floatValue2.Value + "s</style>.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Gain maximum health regeneration.");
		}
		if (flag)
		{
			text = "SAKE";
			sake = CreateNewItemBase(CreateNewItem(text, (ItemTier)0, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)1,
				(ItemTag)5
			}, canRemove: true), 0.1f, 0.1f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Sake");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Increases <style=cIsDamage>melee damage</style> by <style=cIsDamage>" + sake.floatValue1.Value * 100f + "%</style> <style=cStack>(+" + sake.floatValue1Stack.Value * 100f + "% per stack)</style>.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Increases melee damage.");
		}
		if (flag)
		{
			text = "MEAD";
			string name6 = text;
			ItemTag[] array6 = new ItemTag[3];
			RuntimeHelpers.InitializeArray(array6, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			mead = CreateNewItemBase(CreateNewItem(name6, (ItemTier)1, (ItemTag[])(object)array6, canRemove: true), 0.01f, 0.01f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Mead");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "<style=cIsHealing>Heal " + mead.floatValue1.Value * 100f + "%</style> <style=cStack>(+" + mead.floatValue1Stack.Value * 100f + "% per stack)</style> <style=cIsHealing>max health</style> on <style=cIsDamage>melee</style> kills.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Heal on melee kills.");
		}
		if (flag)
		{
			text = "CIGAR";
			string name7 = text;
			ItemTag[] array7 = new ItemTag[3];
			RuntimeHelpers.InitializeArray(array7, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			cigar = CreateNewItemBase(CreateNewItem(name7, (ItemTier)0, (ItemTag[])(object)array7, canRemove: true), 0.25f, 0.1f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Cigar");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Gain <style=cIsUtility>" + cigar.floatValue1.Value * 100f + "%</style> <style=cStack>(+" + cigar.floatValue1Stack.Value * 100f + "% per stack)</style> more <style=cIsUtility>gold</style> on kill.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Gain more gold on kill.");
		}
		if (flag)
		{
			text = "VARIANCIGAR";
			string name8 = text;
			ItemTag[] array8 = new ItemTag[3];
			RuntimeHelpers.InitializeArray(array8, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			variancigar = CreateNewItemBase(CreateNewItem(name8, (ItemTier)2, (ItemTag[])(object)array8, canRemove: true), 0f, 0f, 50, 50);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Varian Cigar");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "At the start of each stage, gain <style=cIsUtility>" + variancigar.intValue1.Value + "</style> <style=cStack>(+" + variancigar.intValue1Stack.Value + " per stack)</style> <style=cIsUtility>gold</style>, which is increased by how fast the previous stage was completed.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Gain gold at the start of the stage.");
		}
		if (flag)
		{
			text = "WHISKEY";
			whiskey = CreateNewItemBase(CreateNewItem(text, (ItemTier)1, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)3,
				(ItemTag)5
			}, canRemove: true), 0.08f, 0.08f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Whiskey");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "<style=cIsUtility>Reduce skill cooldowns</style> by <style=cIsUtility>" + whiskey.floatValue1.Value * 100f + "%</style> <style=cStack>(+" + whiskey.floatValue1Stack.Value * 100f + "% per stack)</style>.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "");
		}
		if (flag)
		{
			text = "MOJITO";
			mojito = CreateNewItemBase(CreateNewItem(text, (ItemTier)0, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)2,
				(ItemTag)5
			}, canRemove: true), 3f, 1f, 20);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Mojito");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Activating a <style=cIsUtility>Secondary skill</style> grants <style=cIsDamage>" + mojito.intValue1.Value + " armor</style> for <style=cIsUtility>" + mojito.floatValue1.Value + "s</style> <style=cStack>(+" + mojito.floatValue1Stack.Value + "s per stack)</style>");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Activating a Secondary skill grants armor.");
		}
		if (flag)
		{
			text = "JOINT";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Joint");
			SwapItem("RoR2/Base/Feather/Feather.asset", text);
		}
		if (flag)
		{
			text = "JAGERBOMB";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Jägerbomb");
			SwapItem("RoR2/Base/StunChanceOnHit/StunChanceOnHit.asset", text);
		}
		if (flag)
		{
			text = "GIN";
		}
		if (flag)
		{
			text = "GINCONSUMED";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Gin & Tonic (Consumed)");
			LanguageAPI.Add("BMANITEMS_" + text + "_CHAT", "Useless!");
			SwapItem("RoR2/DLC1/BossHunter/BossHunterConsumed.asset", text);
		}
		if (flag)
		{
			text = "BOURBON";
			string name9 = text;
			ItemTag[] array9 = new ItemTag[3];
			RuntimeHelpers.InitializeArray(array9, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			bourbon = CreateNewItemBase(CreateNewItem(name9, (ItemTier)2, (ItemTag[])(object)array9, canRemove: true), 0.1f, 0.1f, 2);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Bourbon & Cola");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Hold <style=cIsUtility>" + bourbon.intValue1.Value + " additional equipment charges</style>. <style=cIsUtility>Reduce equipment cooldown</style> by <style=cIsUtility>" + bourbon.floatValue1.Value * 100f + "%</style> <style=cStack>(+" + bourbon.floatValue1Stack.Value * 100f + "% per stack)</style>.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Increases equipment charges, and reduces equipment cooldown.");
		}
		if (flag)
		{
			text = "SHERRY";
			string name10 = text;
			ItemTag[] array10 = new ItemTag[3];
			RuntimeHelpers.InitializeArray(array10, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			sherry = CreateNewItemBase(CreateNewItem(name10, (ItemTier)1, (ItemTag[])(object)array10, canRemove: true), 0.15f, 0.15f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Sherry");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Teleporters charge <style=cIsUtility>" + sherry.floatValue1.Value * 100f + "%</style> <style=cStack>(+" + sherry.floatValue1Stack.Value * 100f + "% per stack)</style> faster.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Teleporters charge faster.");
		}
		if (flag)
		{
			text = "RUBBING";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Rubbing Alcohol");
			SwapItem("RoR2/DLC1/HealingPotion/HealingPotion.asset", text);
		}
		if (flag)
		{
			text = "RUBBINGCONSUMED";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Rubbing Alcohol (Consumed)");
			SwapItem("RoR2/DLC1/HealingPotion/HealingPotionConsumed.asset", text);
		}
		if (flag)
		{
			text = "SCREWDRIVER";
			string name11 = text;
			ItemTag[] array11 = new ItemTag[3];
			RuntimeHelpers.InitializeArray(array11, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			screwdriver = CreateNewItemBase(CreateNewItem(name11, (ItemTier)0, (ItemTag[])(object)array11, canRemove: true), 0.01f, 0.01f, 0, 0, 1f);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Screwdriver");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "<style=cIsDamage>" + screwdriver.floatValue1.Value * 100f + "%</style> <style=cStack>(+" + screwdriver.floatValue1Stack.Value * 100f + "% per stack)</style> chance on hit to deal <style=cIsDamage>" + screwdriver.floatValue2.Value * 100f + "%</style> of the damage again.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Chance on hit to deal double damage.");
		}
		if (flag)
		{
			text = "ABSINTHE";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Absinthe");
			SwapItem("RoR2/Base/IncreaseHealing/IncreaseHealing.asset", text);
		}
		if (flag)
		{
			text = "SUPERANTACIDS";
			superAntacids = CreateNewItemBase(CreateNewEquipment(text, 0f, isLunar: true), 0f, 0f, 1, 0, 0f, 0f, 5, 0, 0f, 0f, 15);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Super Antacids");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "<style=cIsHealing>Revive</style> once per stage at the <style=cIsHealth>cost</style> of <style=cIsHealth>-" + superAntacids.intValue1.Value + "</style> legendary items or <style=cIsHealth>-" + superAntacids.intValue2.Value + "</style> uncommon items or <style=cIsHealth>-" + superAntacids.intValue3.Value + "</style> common items.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Resurrect once per stage for a cost.");
		}
		if (flag)
		{
			text = "MARIA";
			maria = CreateNewItemBase(CreateNewItem(text, (ItemTier)2, (ItemTag[])(object)new ItemTag[2]
			{
				(ItemTag)3,
				(ItemTag)5
			}, canRemove: true), 0f, 0f, 2);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Maria");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "Gain <style=cIsUtility>" + maria.intValue1.Value + " additional copies</style> of each item that you have.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Gain additional copies of each item that you have.");
		}
		if (flag)
		{
			text = "MARIACONSUMED";
			string name12 = text;
			ItemTag[] array12 = new ItemTag[3];
			RuntimeHelpers.InitializeArray(array12, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			mariaConsumed = CreateNewItemBase(CreateNewItem(name12, (ItemTier)5, (ItemTag[])(object)array12, canRemove: true), 0f, 0f, 1, 1);
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Maria (Consumed)");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "A spent item with no remaining power.");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "A spent item with no remaining power.");
		}
		if (flag)
		{
			text = "INDIGO";
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Indigo's Reserve");
			SwapItem("RoR2/Base/LunarDagger/LunarDagger.asset", text);
		}
		if (flag)
		{
			text = "ASPECT";
			goldenAspect = CreateNewItemBase(CreateNewEquipment(text, 0f, isLunar: false, canDrop: false));
			LanguageAPI.Add("BMANITEMS_" + text + "_NAME", "Golden Aspect");
			LanguageAPI.Add("BMANITEMS_" + text + "_DESC", "");
			LanguageAPI.Add("BMANITEMS_" + text + "_PICKUP", "Become a golden aspect.");
		}
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.BManItems", "BManItems", "1.0.0")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.BManItems";

	public const string MODNAME = "BManItems";

	public const string VERSION = "1.0.0";

	private void Awake()
	{
		Assets.PopulateAssets();
		Prefabs.CreatePrefabs();
		Items.CreateItems();
		Hook.Hooks();
	}

	public void Update()
	{
	}
}
internal class Prefabs
{
	internal static GameObject itemModels;

	internal static BuffDef vodkaBuff;

	internal static BuffDef vapeUnavailableBuff;

	internal static BuffDef vapeAvailableBuff;

	internal static BuffDef mojitoArmorBuff;

	internal static BuffDef superAntacidsReviveOnBuff;

	internal static Material goldenAspectOverlay;

	internal static ModdedProcType meleeProc;

	internal static void CreatePrefabs()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Expected O, but got Unknown
		//IL_0059: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: 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_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_019e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a4: Expected O, but got Unknown
		//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0213: Unknown result type (might be due to invalid IL or missing references)
		//IL_021a: Expected O, but got Unknown
		//IL_0242: 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_02e6: Unknown result type (might be due to invalid IL or missing references)
		meleeProc = ProcTypeAPI.ReserveProcType();
		Load<GameObject>("RoR2/Base/ClassicRun/ClassicRun.prefab").AddComponent<StageTimeTracker>();
		Load<GameObject>("RoR2/Base/EclipseRun/EclipseRun.prefab").AddComponent<StageTimeTracker>();
		goldenAspectOverlay = new Material(Load<Material>("RoR2/Base/ElitePoison/matElitePoisonOverlay.mat"));
		goldenAspectOverlay.SetColor("_TintColor", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)144, (byte)0, byte.MaxValue)));
		goldenAspectOverlay.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/DLC1/Common/ColorRamps/texRampSuppressorEye.png"));
		goldenAspectOverlay.SetFloat("_AlphaBoost", 4.5f);
		vodkaBuff = Utils.NewBuffDef("Vodka", stack: false, hidden: false, Assets.Load<Sprite>("statusBuff"), Color32.op_Implicit(new Color32(byte.MaxValue, (byte)181, (byte)85, byte.MaxValue)));
		vapeUnavailableBuff = Utils.NewBuffDef("VapeCDBuff", stack: false, hidden: false, Assets.Load<Sprite>("vapeBuff"), Color32.op_Implicit(new Color32((byte)106, (byte)102, (byte)102, byte.MaxValue)));
		vapeAvailableBuff = Utils.NewBuffDef("VapeOnBuff", stack: false, hidden: false, Assets.Load<Sprite>("vapeBuff"), Color32.op_Implicit(new Color32((byte)241, (byte)116, (byte)116, byte.MaxValue)));
		mojitoArmorBuff = Utils.NewBuffDef("MojitoArmorBuff", stack: false, hidden: false, Load<Sprite>("RoR2/Junk/Common/texBuffBodyArmorIcon.tif"), Color32.op_Implicit(new Color32((byte)235, (byte)243, (byte)116, byte.MaxValue)));
		superAntacidsReviveOnBuff = Utils.NewBuffDef("Revive", stack: false, hidden: false, Assets.Load<Sprite>("ExtraLifeBuff"), Color.white);
		Shader val = Load<Shader>("RoR2/Base/Shaders/HGStandard.shader");
		Material val2 = Assets.Load<Material>("items");
		Material val3 = new Material(val);
		val3.SetTexture("_MainTex", val2.mainTexture);
		val3.SetTexture("_EmTex", (Texture)(object)Assets.Load<Texture2D>("items_e"));
		val3.SetColor("_EmColor", Color32.op_Implicit(new Color32((byte)149, (byte)149, (byte)185, byte.MaxValue)));
		val3.SetFloat("_EmPower", 2f);
		Material val4 = Assets.Load<Material>("corrupteditems");
		Material val5 = new Material(val);
		val5.SetTexture("_MainTex", val4.mainTexture);
		val5.SetTexture("_EmTex", (Texture)null);
		val5.SetColor("_EmColor", Color.black);
		val5.SetFloat("_EmPower", 0f);
		itemModels = Assets.Load<GameObject>("itemModels");
		ChildLocator component = itemModels.GetComponent<ChildLocator>();
		List<NameTransformPair> list = new List<NameTransformPair>();
		MeshRenderer[] componentsInChildren = itemModels.GetComponentsInChildren<MeshRenderer>(true);
		foreach (MeshRenderer val6 in componentsInChildren)
		{
			string name = ((Object)val6).name;
			((Renderer)val6).material = (name.Contains("corrupted") ? val5 : val3);
			list.Add(new NameTransformPair
			{
				name = ((Object)val6).name,
				transform = ((Component)val6).transform
			});
		}
		ModelPanelParameters val7 = itemModels.AddComponent<ModelPanelParameters>();
		val7.focusPointTransform = component.FindChild("FocusPoint");
		val7.cameraPositionTransform = component.FindChild("CameraPosition");
		component.transformPairs = list.ToArray();
	}

	internal static T Load<T>(string path)
	{
		//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)
		return Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion();
	}

	internal static GameObject Instantiate(string path, string name, bool registerNetwork = false)
	{
		return PrefabAPI.InstantiateClone(Load<GameObject>(path), name, registerNetwork);
	}

	internal static GameObject Instantiate(GameObject obj, string name, bool registerNetwork = false)
	{
		return PrefabAPI.InstantiateClone(obj, name, registerNetwork);
	}
}
internal static class Extensions
{
	public static GameObject NewSyringe(this GameObject g, params Material[] m)
	{
		((Renderer)g.GetComponentsInChildren<MeshRenderer>(false)[0]).material = m[0];
		((Renderer)g.GetComponent<TrailRenderer>()).material = m[1];
		((Renderer)g.GetComponent<ParticleSystemRenderer>()).material = m[2];
		return g;
	}

	public static Material SwapTexture(this Material m, Texture2D t)
	{
		m.mainTexture = (Texture)(object)t;
		return m;
	}

	public static GameObject SwapMaterials(this GameObject g, Material[] m)
	{
		Renderer[] componentsInChildren = g.GetComponentsInChildren<Renderer>();
		for (int i = 0; i < componentsInChildren.Length; i++)
		{
			if (Object.op_Implicit((Object)(object)m[i]))
			{
				componentsInChildren[i].material = m[i];
			}
		}
		return g;
	}

	public static float Mult(this float f, float mult = 100f)
	{
		return f * mult;
	}

	public static Color ToRGB255(this Color c, string title, string body)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: 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_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		return new Color(c.r / 255f, c.g / 255f, c.b / 255f);
	}

	public static void SetStrings(this TooltipProvider t, string title, string body)
	{
		t.overrideTitleText = title;
		t.overrideBodyText = body;
	}
}
internal class Utils
{
	public static void AddItemBehavior<T>(GameObject target, int stack) where T : MonoBehaviour
	{
		T component = target.GetComponent<T>();
		if (stack > 0)
		{
			if (!Object.op_Implicit((Object)(object)component))
			{
				component = target.AddComponent<T>();
			}
		}
		else if (Object.op_Implicit((Object)(object)component))
		{
			Object.Destroy((Object)(object)component);
		}
	}

	public static void AddItemBehaviour<T>(Inventory inv, GameObject target) where T : MonoBehaviour
	{
		if (!Object.op_Implicit((Object)(object)target.GetComponent<T>()))
		{
			target.AddComponent<T>();
		}
	}

	public static int CalculateItemBonus(int float1, int float1Stack, int itemCount)
	{
		return float1 + float1Stack * (itemCount - 1);
	}

	public static float CalculateItemBonus(float float1, float float1Stack, int itemCount)
	{
		return float1 + float1Stack * (float)(itemCount - 1);
	}

	public static EntityStateMachine NewStateMachine<T>(GameObject obj, string customName) where T : EntityState
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		SerializableEntityStateType val = default(SerializableEntityStateType);
		((SerializableEntityStateType)(ref val))..ctor(typeof(T));
		EntityStateMachine val2 = obj.AddComponent<EntityStateMachine>();
		val2.customName = customName;
		val2.initialStateType = val;
		val2.mainStateType = val;
		return val2;
	}

	public static GenericSkill NewGenericSkill(GameObject obj, SkillDef skill)
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Expected O, but got Unknown
		//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)
		GenericSkill val = obj.AddComponent<GenericSkill>();
		SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
		val2.variants = (Variant[])(object)new Variant[1];
		val._skillFamily = val2;
		SkillFamily skillFamily = val.skillFamily;
		Variant[] variants = skillFamily.variants;
		Variant val3 = new Variant
		{
			skillDef = skill
		};
		((Variant)(ref val3)).viewableNode = new Node(skill.skillNameToken, false, (Node)null);
		variants[0] = val3;
		ContentAddition.AddSkillFamily(skillFamily);
		return val;
	}

	public static void AddAlt(SkillFamily skillFamily, SkillDef SkillDef)
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Expected O, but got Unknown
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
		Variant[] variants = skillFamily.variants;
		int num = skillFamily.variants.Length - 1;
		Variant val = new Variant
		{
			skillDef = SkillDef
		};
		((Variant)(ref val)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null);
		variants[num] = val;
	}

	public static BuffDef NewBuffDef(string name, bool stack, bool hidden, Sprite sprite, Color color)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
		((Object)val).name = name;
		val.canStack = stack;
		val.isHidden = hidden;
		val.iconSprite = sprite;
		val.buffColor = color;
		ContentAddition.AddBuffDef(val);
		return val;
	}

	public static ObjectScaleCurve AddScaleComponent(GameObject target, float timeMax)
	{
		ObjectScaleCurve val = target.AddComponent<ObjectScaleCurve>();
		val.useOverallCurveOnly = true;
		val.timeMax = timeMax;
		val.overallCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f);
		return val;
	}

	public static RotateAroundAxis AddRotationComponent(GameObject target, float speed, RotationAxis axis)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		RotateAroundAxis val = target.AddComponent<RotateAroundAxis>();
		val.speed = (Speed)2;
		val.fastRotationSpeed = speed;
		val.rotateAroundAxis = axis;
		return val;
	}

	public static GameObject NewDisplayModel(GameObject model, string name)
	{
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Expected O, but got Unknown
		GameObject val = PrefabAPI.InstantiateClone(model, name, false);
		val.GetComponentInChildren<Animator>().runtimeAnimatorController = Assets.Load<RuntimeAnimatorController>("displayAnimator");
		RendererInfo[] baseRendererInfos = val.GetComponentInChildren<CharacterModel>().baseRendererInfos;
		for (int i = 0; i < baseRendererInfos.Length; i++)
		{
			baseRendererInfos[i].defaultMaterial = new Material(baseRendererInfos[i].defaultMaterial);
			baseRendererInfos[i].defaultMaterial.DisableKeyword("_DITHER");
		}
		return val;
	}

	internal static Sprite CreateSprite(Texture2D tex)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f), 128f);
	}

	internal static T CopyComponent<T>(T original, GameObject destination) where T : Component
	{
		Type type = ((object)original).GetType();
		Component val = destination.AddComponent(type);
		FieldInfo[] fields = type.GetFields();
		FieldInfo[] array = fields;
		foreach (FieldInfo fieldInfo in array)
		{
			fieldInfo.SetValue(val, fieldInfo.GetValue(original));
		}
		return (T)(object)((val is T) ? val : null);
	}

	public static Sprite CreateSpriteFromTexture(Texture2D texture)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)texture))
		{
			return Sprite.Create(texture, new Rect(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height), new Vector2(0.5f, 0.5f));
		}
		return null;
	}

	public static GameObject FindInActiveObjectByName(string name)
	{
		//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_0031: Unknown result type (might be due to invalid IL or missing references)
		Scene activeScene = SceneManager.GetActiveScene();
		GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects();
		foreach (GameObject val in rootGameObjects)
		{
			Transform[] componentsInChildren = val.GetComponentsInChildren<Transform>();
			foreach (Transform val2 in componentsInChildren)
			{
				if ((int)((Object)val2).hideFlags == 0 && ((Object)val2).name == name)
				{
					return ((Component)val2).gameObject;
				}
			}
		}
		return null;
	}

	public static GameObject CreateHitbox(string name, Transform parent, Vector3 scale)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		//IL_001b: 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_003d: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = new GameObject(name);
		val.transform.SetParent(parent);
		val.transform.localPosition = Vector3.zero;
		val.transform.localRotation = Quaternion.identity;
		val.transform.localScale = scale;
		HitBoxGroup val2 = ((Component)parent).gameObject.AddComponent<HitBoxGroup>();
		HitBox val3 = val.AddComponent<HitBox>();
		val.layer = LayerIndex.projectile.intVal;
		val2.hitBoxes = (HitBox[])(object)new HitBox[1] { val3 };
		val2.groupName = name;
		return val;
	}

	internal static EffectComponent RegisterEffect(GameObject effect, float duration, string soundName = "", bool parentToReferencedTransform = true, bool positionAtReferencedTransform = true)
	{
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		EffectComponent val = effect.GetComponent<EffectComponent>();
		if (!Object.op_Implicit((Object)(object)val))
		{
			val = effect.AddComponent<EffectComponent>();
		}
		if (duration != -1f)
		{
			DestroyOnTimer component = effect.GetComponent<DestroyOnTimer>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				effect.AddComponent<DestroyOnTimer>().duration = duration;
			}
			else
			{
				component.duration = duration;
			}
		}
		if (!Object.op_Implicit((Object)(object)effect.GetComponent<NetworkIdentity>()))
		{
			effect.AddComponent<NetworkIdentity>();
		}
		if (!Object.op_Implicit((Object)(object)effect.GetComponent<VFXAttributes>()))
		{
			effect.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
		}
		val.applyScale = false;
		val.effectIndex = (EffectIndex)(-1);
		val.parentToReferencedTransform = parentToReferencedTransform;
		val.positionAtReferencedTransform = positionAtReferencedTransform;
		val.soundName = soundName;
		ContentAddition.AddEffect(effect);
		return val;
	}

	public static Material InstantiateMaterial(Texture tex)
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		Material val = Object.Instantiate<Material>(Prefabs.Load<Material>("RoR2/Base/Commando/matCommandoDualies.mat"));
		if (Object.op_Implicit((Object)(object)val))
		{
			val.SetColor("_Color", Color.white);
			val.SetTexture("_MainTex", tex);
			val.SetColor("_EmColor", Color.black);
			val.SetFloat("_EmPower", 0f);
			val.SetTexture("_EmTex", (Texture)null);
			val.SetFloat("_NormalStrength", 1f);
			val.SetTexture("_NormalTex", (Texture)null);
			return val;
		}
		return val;
	}

	public static Material InstantiateMaterial(Color color, Texture tex, Color emColor, float emPower, Texture emTex, float normStr, Texture normTex)
	{
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		Material val = Object.Instantiate<Material>(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<CharacterModel>().baseRendererInfos[0].defaultMaterial);
		if (Object.op_Implicit((Object)(object)val))
		{
			val.SetColor("_Color", color);
			val.SetTexture("_MainTex", tex);
			val.SetColor("_EmColor", emColor);
			val.SetFloat("_EmPower", emPower);
			val.SetTexture("_EmTex", emTex);
			val.SetFloat("_No