Decompiled source of PlayWithEliteItem v1.0.1

plugins/AlchemyFlames-GiveEliteItem 1.0.1/GiveEliteItem.dll

Decompiled 10 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HG.Reflection;
using InLobbyConfig;
using InLobbyConfig.Fields;
using On.RoR2;
using R2API.Utils;
using RoR2;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("GiveEliteItem")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("GiveEliteItem")]
[assembly: AssemblyTitle("GiveEliteItem")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
namespace GiveEliteItem;

public class BepConfig
{
	public static ConfigEntry<int> StartingCash;

	public static ConfigEntry<EnumCollection.ItemWhiteEnum> StartingItemWhite;

	public static ConfigEntry<int> StartingItemWhiteCount;

	public static ConfigEntry<EnumCollection.ItemGreenEnum> StartingItemGreen;

	public static ConfigEntry<int> StartingItemGreenCount;

	public static ConfigEntry<EnumCollection.ItemRedEnum> StartingItemRed;

	public static ConfigEntry<int> StartingItemRedCount;

	public static ConfigEntry<EnumCollection.ItemBossEnum> StartingItemBoss;

	public static ConfigEntry<int> StartingItemBossCount;

	public static ConfigEntry<EnumCollection.ItemLunarEnum> StartingItemLunar;

	public static ConfigEntry<int> StartingItemLunarCount;

	public static ConfigEntry<EnumCollection.ItemVoidEnum> StartingItemVoid;

	public static ConfigEntry<int> StartingItemVoidCount;

	public static ConfigEntry<EnumCollection.ItemEquipEnum> StartingItemEquip;

	public static void Init()
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Expected O, but got Unknown
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: 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_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Expected O, but got Unknown
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Expected O, but got Unknown
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: Expected O, but got Unknown
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Expected O, but got Unknown
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Expected O, but got Unknown
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Expected O, but got Unknown
		//IL_017e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0188: Expected O, but got Unknown
		//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: Expected O, but got Unknown
		//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: Expected O, but got Unknown
		//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fa: Expected O, but got Unknown
		//IL_0216: Unknown result type (might be due to invalid IL or missing references)
		//IL_0220: Expected O, but got Unknown
		ConfigFile config = ((BaseUnityPlugin)GiveEliteItem.instance).Config;
		StartingCash = config.Bind<int>("Start Bonus", "Cash", 500, new ConfigDescription("How much starting cash each player receives.", (AcceptableValueBase)null, Array.Empty<object>()));
		StartingItemWhite = config.Bind<EnumCollection.ItemWhiteEnum>("Start Bonus", "White Item", EnumCollection.ItemWhiteEnum.None, new ConfigDescription("Which white item each player shall receive at the start.", (AcceptableValueBase)null, Array.Empty<object>()));
		StartingItemWhiteCount = config.Bind<int>("Start Bonus", "White Item Count", 1, new ConfigDescription("How many of the white item each player shall receive.", (AcceptableValueBase)null, Array.Empty<object>()));
		StartingItemGreen = config.Bind<EnumCollection.ItemGreenEnum>("Start Bonus", "Green Item", EnumCollection.ItemGreenEnum.None, new ConfigDescription("Which green item each player shall receive at the start.", (AcceptableValueBase)null, Array.Empty<object>()));
		StartingItemGreenCount = config.Bind<int>("Start Bonus", "Green Item Count", 1, new ConfigDescription("How many of the green item each player shall receive.", (AcceptableValueBase)null, Array.Empty<object>()));
		StartingItemRed = config.Bind<EnumCollection.ItemRedEnum>("Start Bonus", "Red Item", EnumCollection.ItemRedEnum.None, new ConfigDescription("Which red item each player shall receive at the start.", (AcceptableValueBase)null, Array.Empty<object>()));
		StartingItemRedCount = config.Bind<int>("Start Bonus", "Red Item Count", 1, new ConfigDescription("How many of the red item each player shall receive.", (AcceptableValueBase)null, Array.Empty<object>()));
		StartingItemBoss = config.Bind<EnumCollection.ItemBossEnum>("Start Bonus", "Boss Item", EnumCollection.ItemBossEnum.None, new ConfigDescription("Which boss item each player shall receive at the start.", (AcceptableValueBase)null, Array.Empty<object>()));
		StartingItemBossCount = config.Bind<int>("Start Bonus", "Boss Item Count", 1, new ConfigDescription("How many of the boss item each player shall receive.", (AcceptableValueBase)null, Array.Empty<object>()));
		StartingItemLunar = config.Bind<EnumCollection.ItemLunarEnum>("Start Bonus", "Lunar Item", EnumCollection.ItemLunarEnum.None, new ConfigDescription("Which lunar item each player shall receive at the start.", (AcceptableValueBase)null, Array.Empty<object>()));
		StartingItemLunarCount = config.Bind<int>("Start Bonus", "Lunar Item Count", 1, new ConfigDescription("How many of the lunar item each player shall receive.", (AcceptableValueBase)null, Array.Empty<object>()));
		StartingItemVoid = config.Bind<EnumCollection.ItemVoidEnum>("Start Bonus", "Void Item", EnumCollection.ItemVoidEnum.None, new ConfigDescription("Which void item each player shall receive at the start.", (AcceptableValueBase)null, Array.Empty<object>()));
		StartingItemVoidCount = config.Bind<int>("Start Bonus", "Void Item Count", 1, new ConfigDescription("How many of the void item each player shall receive.", (AcceptableValueBase)null, Array.Empty<object>()));
		StartingItemEquip = config.Bind<EnumCollection.ItemEquipEnum>("Start Bonus", "Equipment", EnumCollection.ItemEquipEnum.None, new ConfigDescription("Which equipment each player shall receive at the start.", (AcceptableValueBase)null, Array.Empty<object>()));
		if (ModCompatibilityInLobbyConfig.enabled)
		{
			ModCompatibilityInLobbyConfig.CreateFromBepInExConfigFile(config, "Start Bonus");
		}
	}
}
public class EnumCollection
{
	public enum ItemWhiteEnum
	{
		None,
		ArmorPiercingRounds,
		BackupMagazine,
		BisonSteak,
		BundleOfFireworks,
		BustlingFungus,
		CautiousSlug,
		Crowbar,
		DelicateWatch,
		EnergyDrink,
		FocusCrystal,
		Gasoline,
		ItemScrapWhite,
		LensMakersGlasses,
		Medkit,
		Mocha,
		MonsterTooth,
		OddlyshapedOpal,
		PaulsGoatHoof,
		PersonalShieldGenerator,
		PowerElixir,
		RepulsionArmorPlate,
		RollOfPennies,
		RustedKey,
		SoldiersSyringe,
		StickyBomb,
		StunGrenade,
		TopazBrooch,
		TougherTimes,
		TriTipDagger,
		Warbanner
	}

	public enum ItemGreenEnum
	{
		None,
		AtGMissileMk1,
		Bandolier,
		BerzerkersPauldron,
		Chronobauble,
		DeathMark,
		FuelCell,
		GhorsTome,
		HarvestersScythe,
		HopooFeather,
		HuntersHarpoon,
		IgnitionTank,
		Infusion,
		ItemScrapGreen,
		KjarosBand,
		LeechingSeed,
		LeptonDaisy,
		OldGuillotine,
		OldWarStealthkit,
		PredatoryInstincts,
		Razorwire,
		RedWhip,
		RegeneratingScrap,
		RoseBuckler,
		RunaldsBand,
		ShippingRequestForm,
		Shuriken,
		SquidPolyp,
		Ukulele,
		WarHorn,
		WaxQuail,
		WillOTheWisp
	}

	public enum ItemRedEnum
	{
		None,
		_57LeafClover,
		Aegis,
		AlienHead,
		BensRaincoat,
		BottledChaos,
		Brainstalks,
		BrilliantBehemoth,
		CeremonialDagger,
		DefensiveMicrobots,
		DiosBestFriend,
		FrostRelic,
		H3AD5Tv2,
		HappiestMask,
		HardlightAfterburner,
		InterstellarDeskPlant,
		ItemScrapRed,
		LaserScope,
		NkuhanasOpinion,
		PocketICBM,
		RejuvenationRack,
		ResonanceDisc,
		SentientMeatHook,
		ShatteringJustice,
		SoulboundCatalyst,
		SpareDroneParts,
		SymbioticScorpion,
		UnstableTeslaCoil,
		WakeOfVultures
	}

	public enum ItemBossEnum
	{
		None,
		ChargedPerforator,
		DefenseNucleus,
		EmpathyCores,
		GenesisLoop,
		HalcyonSeed,
		IrradiantPearl,
		ItemScrapYellow,
		LittleDisciple,
		MiredUrn,
		MoltenPerforator,
		Pearl,
		Planula,
		QueensGland,
		Shatterspleen,
		TitanicKnurl
	}

	public enum ItemVoidEnum
	{
		None,
		BenthicBloom,
		EncrustedKey,
		LostSeersLenses,
		LysateCell,
		Needletick,
		NewlyHatchedZoea,
		PlasmaShrimp,
		PluripotentLarva,
		Polylute,
		SaferSpaces,
		SingularityBand,
		Tentabauble,
		VoidsentFlame,
		WeepingFungus
	}

	public enum ItemLunarEnum
	{
		None,
		BeadsOfFealty,
		BrittleCrown,
		Corpsebloom,
		DefiantGouge,
		Egocentrism,
		EssenceOfHeresy,
		EulogyZero,
		FocusedConvergence,
		GestureOfTheDrowned,
		HooksOfHeresy,
		LightFluxPauldron,
		MercurialRachis,
		Purity,
		ShapedGlass,
		StoneFluxPauldron,
		StridesOfHeresy,
		Transcendence,
		VisionsOfHeresy
	}

	public enum ItemEquipEnum
	{
		None,
		BeyondTheLimits,
		BlastShower,
		CovenOfGold,
		DisposableMissileLauncher,
		EccentricVase,
		EffigyOfGrief,
		ElegyOfExtinction,
		ExecutiveCard,
		ForeignFruit,
		ForgiveMePlease,
		FuelArray,
		GlowingMeteorite,
		GnarledWoodsprite,
		GooboJr,
		GoragsOpus,
		HelfireTincture,
		HerBitingEmbrace,
		HisReassurance,
		IfritsDistinction,
		JadeElephant,
		JarOfSouls,
		MilkyChrysalis,
		Molotov,
		NkuhanasRetort,
		OcularHUD,
		OverloadingExcavator,
		PreonAccumulator,
		PrimordialCube,
		RadarScanner,
		ReapersRemorse,
		Recycler,
		RemoteCaffeinator,
		RoyalCapacitor,
		Sawmerang,
		SharedDesign,
		SilenceBetweenTwoStrikes,
		SpectralCirclet,
		SpinelTonic,
		SuperMassiveLeech,
		TheBackup,
		TheCrowdfunder,
		TrophyHuntersTricorn,
		VolcanicEgg
	}

	private static ItemDef ToItemDef(string itemName)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Invalid comparison between Unknown and I4
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		if (itemName == null)
		{
			return null;
		}
		ItemIndex val = ItemCatalog.FindItemIndex(itemName);
		if ((int)val == -1)
		{
			return null;
		}
		return ItemCatalog.GetItemDef(val);
	}

	public static ItemDef ToItemDef(ItemWhiteEnum value)
	{
		return ToItemDef(getItemName(value));
	}

	public static ItemDef ToItemDef(ItemGreenEnum value)
	{
		return ToItemDef(getItemName(value));
	}

	public static ItemDef ToItemDef(ItemRedEnum value)
	{
		return ToItemDef(getItemName(value));
	}

	public static ItemDef ToItemDef(ItemBossEnum value)
	{
		return ToItemDef(getItemName(value));
	}

	public static ItemDef ToItemDef(ItemVoidEnum value)
	{
		return ToItemDef(getItemName(value));
	}

	public static ItemDef ToItemDef(ItemLunarEnum value)
	{
		return ToItemDef(getItemName(value));
	}

	public static EquipmentIndex ToEquipIndex(ItemEquipEnum value)
	{
		//IL_0015: 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_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		string itemName = getItemName(value);
		if (itemName == null)
		{
			return (EquipmentIndex)(-1);
		}
		return EquipmentCatalog.FindEquipmentIndex(itemName);
	}

	private static string getItemName(ItemWhiteEnum item)
	{
		return item switch
		{
			ItemWhiteEnum.ArmorPiercingRounds => "BossDamageBonus", 
			ItemWhiteEnum.BackupMagazine => "SecondarySkillMagazine", 
			ItemWhiteEnum.BisonSteak => "FlatHealth", 
			ItemWhiteEnum.BundleOfFireworks => "Firework", 
			ItemWhiteEnum.BustlingFungus => "Mushroom", 
			ItemWhiteEnum.CautiousSlug => "HealWhileSafe", 
			ItemWhiteEnum.Crowbar => "Crowbar", 
			ItemWhiteEnum.DelicateWatch => "FragileDamageBonus", 
			ItemWhiteEnum.EnergyDrink => "SprintBonus", 
			ItemWhiteEnum.FocusCrystal => "NearbyDamageBonus", 
			ItemWhiteEnum.Gasoline => "IgniteOnKill", 
			ItemWhiteEnum.ItemScrapWhite => "ScrapWhite", 
			ItemWhiteEnum.LensMakersGlasses => "CritGlasses", 
			ItemWhiteEnum.Medkit => "Medkit", 
			ItemWhiteEnum.Mocha => "AttackSpeedAndMoveSpeed", 
			ItemWhiteEnum.MonsterTooth => "Tooth", 
			ItemWhiteEnum.OddlyshapedOpal => "OutOfCombatArmor", 
			ItemWhiteEnum.PaulsGoatHoof => "Hoof", 
			ItemWhiteEnum.PersonalShieldGenerator => "PersonalShield", 
			ItemWhiteEnum.PowerElixir => "HealingPotion", 
			ItemWhiteEnum.RepulsionArmorPlate => "ArmorPlate", 
			ItemWhiteEnum.RollOfPennies => "GoldOnHurt", 
			ItemWhiteEnum.RustedKey => "TreasureCache", 
			ItemWhiteEnum.SoldiersSyringe => "Syringe", 
			ItemWhiteEnum.StickyBomb => "StickyBomb", 
			ItemWhiteEnum.StunGrenade => "StunChanceOnHit", 
			ItemWhiteEnum.TopazBrooch => "BarrierOnKill", 
			ItemWhiteEnum.TougherTimes => "Bear", 
			ItemWhiteEnum.TriTipDagger => "BleedOnHit", 
			ItemWhiteEnum.Warbanner => "WardOnLevel", 
			_ => null, 
		};
	}

	private static string getItemName(ItemGreenEnum item)
	{
		return item switch
		{
			ItemGreenEnum.AtGMissileMk1 => "Missile", 
			ItemGreenEnum.Bandolier => "Bandolier", 
			ItemGreenEnum.BerzerkersPauldron => "WarCryOnMultiKill", 
			ItemGreenEnum.Chronobauble => "SlowOnHit", 
			ItemGreenEnum.DeathMark => "DeathMark", 
			ItemGreenEnum.FuelCell => "EquipmentMagazine", 
			ItemGreenEnum.GhorsTome => "BonusGoldPackOnKill", 
			ItemGreenEnum.HarvestersScythe => "HealOnCrit", 
			ItemGreenEnum.HopooFeather => "Feather", 
			ItemGreenEnum.HuntersHarpoon => "MoveSpeedOnKill", 
			ItemGreenEnum.IgnitionTank => "StrengthenBurn", 
			ItemGreenEnum.Infusion => "Infusion", 
			ItemGreenEnum.ItemScrapGreen => "ScrapGreen", 
			ItemGreenEnum.KjarosBand => "FireRing", 
			ItemGreenEnum.LeechingSeed => "Seed", 
			ItemGreenEnum.LeptonDaisy => "TPHealingNova", 
			ItemGreenEnum.OldGuillotine => "ExecuteLowHealthElite", 
			ItemGreenEnum.OldWarStealthkit => "Phasing", 
			ItemGreenEnum.PredatoryInstincts => "AttackSpeedOnCrit", 
			ItemGreenEnum.Razorwire => "Thorns", 
			ItemGreenEnum.RedWhip => "SprintOutOfCombat", 
			ItemGreenEnum.RegeneratingScrap => "RegeneratingScrap", 
			ItemGreenEnum.RoseBuckler => "SprintArmor", 
			ItemGreenEnum.RunaldsBand => "IceRing", 
			ItemGreenEnum.ShippingRequestForm => "FreeChest", 
			ItemGreenEnum.Shuriken => "PrimarySkillShuriken", 
			ItemGreenEnum.SquidPolyp => "Squid", 
			ItemGreenEnum.Ukulele => "ChainLightning", 
			ItemGreenEnum.WarHorn => "EnergizedOnEquipmentUse", 
			ItemGreenEnum.WaxQuail => "JumpBoost", 
			ItemGreenEnum.WillOTheWisp => "ExplodeOnDeath", 
			_ => null, 
		};
	}

	private static string getItemName(ItemRedEnum item)
	{
		return item switch
		{
			ItemRedEnum._57LeafClover => "Clover", 
			ItemRedEnum.Aegis => "BarrierOnOverHeal", 
			ItemRedEnum.AlienHead => "AlienHead", 
			ItemRedEnum.BensRaincoat => "ImmuneToDebuff", 
			ItemRedEnum.BottledChaos => "RandomEquipmentTrigger", 
			ItemRedEnum.Brainstalks => "KillEliteFrenzy", 
			ItemRedEnum.BrilliantBehemoth => "Behemoth", 
			ItemRedEnum.CeremonialDagger => "Dagger", 
			ItemRedEnum.DefensiveMicrobots => "CaptainDefenseMatrix", 
			ItemRedEnum.DiosBestFriend => "ExtraLife", 
			ItemRedEnum.FrostRelic => "Icicle", 
			ItemRedEnum.H3AD5Tv2 => "FallBoots", 
			ItemRedEnum.HappiestMask => "GhostOnKill", 
			ItemRedEnum.HardlightAfterburner => "UtilitySkillMagazine", 
			ItemRedEnum.InterstellarDeskPlant => "Plant", 
			ItemRedEnum.ItemScrapRed => "ScrapRed", 
			ItemRedEnum.LaserScope => "CritDamage", 
			ItemRedEnum.NkuhanasOpinion => "NovaOnHeal", 
			ItemRedEnum.PocketICBM => "MoreMissile", 
			ItemRedEnum.RejuvenationRack => "IncreaseHealing", 
			ItemRedEnum.ResonanceDisc => "LaserTurbine", 
			ItemRedEnum.SentientMeatHook => "BounceNearby", 
			ItemRedEnum.ShatteringJustice => "ArmorReductionOnHit", 
			ItemRedEnum.SoulboundCatalyst => "Talisman", 
			ItemRedEnum.SpareDroneParts => "DroneWeapons", 
			ItemRedEnum.SymbioticScorpion => "PermanentDebuffOnHit", 
			ItemRedEnum.UnstableTeslaCoil => "ShockNearby", 
			ItemRedEnum.WakeOfVultures => "HeadHunter", 
			_ => null, 
		};
	}

	private static string getItemName(ItemBossEnum item)
	{
		return item switch
		{
			ItemBossEnum.ChargedPerforator => "LightningStrikeOnHit", 
			ItemBossEnum.DefenseNucleus => "MinorConstructOnKill", 
			ItemBossEnum.EmpathyCores => "RoboBallBuddy", 
			ItemBossEnum.GenesisLoop => "NovaOnLowHealth", 
			ItemBossEnum.HalcyonSeed => "TitanGoldDuringTP", 
			ItemBossEnum.IrradiantPearl => "ShinyPearl", 
			ItemBossEnum.ItemScrapYellow => "ScrapYellow", 
			ItemBossEnum.LittleDisciple => "SprintWisp", 
			ItemBossEnum.MiredUrn => "SiphonOnLowHealth", 
			ItemBossEnum.MoltenPerforator => "FireballsOnHit", 
			ItemBossEnum.Pearl => "Pearl", 
			ItemBossEnum.Planula => "ParentEgg", 
			ItemBossEnum.QueensGland => "BeetleGland", 
			ItemBossEnum.Shatterspleen => "BleedOnHitAndExplode", 
			ItemBossEnum.TitanicKnurl => "Knurl", 
			_ => null, 
		};
	}

	private static string getItemName(ItemVoidEnum item)
	{
		return item switch
		{
			ItemVoidEnum.BenthicBloom => "CloverVoid", 
			ItemVoidEnum.EncrustedKey => "TreasureCacheVoid", 
			ItemVoidEnum.LostSeersLenses => "CritGlassesVoid", 
			ItemVoidEnum.LysateCell => "EquipmentMagazineVoid", 
			ItemVoidEnum.Needletick => "BleedOnHitVoid", 
			ItemVoidEnum.NewlyHatchedZoea => "VoidMegaCrabItem", 
			ItemVoidEnum.PlasmaShrimp => "MissileVoid", 
			ItemVoidEnum.PluripotentLarva => "ExtraLifeVoid", 
			ItemVoidEnum.Polylute => "ChainLightningVoid", 
			ItemVoidEnum.SaferSpaces => "BearVoid", 
			ItemVoidEnum.SingularityBand => "ElementalRingVoid", 
			ItemVoidEnum.Tentabauble => "SlowOnHitVoid", 
			ItemVoidEnum.VoidsentFlame => "ExplodeOnDeathVoid", 
			ItemVoidEnum.WeepingFungus => "MushroomVoid", 
			_ => null, 
		};
	}

	private static string getItemName(ItemLunarEnum item)
	{
		return item switch
		{
			ItemLunarEnum.BeadsOfFealty => "LunarTrinket", 
			ItemLunarEnum.BrittleCrown => "GoldOnHit", 
			ItemLunarEnum.Corpsebloom => "RepeatHeal", 
			ItemLunarEnum.DefiantGouge => "MonstersOnShrineUse", 
			ItemLunarEnum.Egocentrism => "LunarSun", 
			ItemLunarEnum.EssenceOfHeresy => "LunarSpecialReplacement", 
			ItemLunarEnum.EulogyZero => "RandomlyLunar", 
			ItemLunarEnum.FocusedConvergence => "FocusConvergence", 
			ItemLunarEnum.GestureOfTheDrowned => "AutoCastEquipment", 
			ItemLunarEnum.HooksOfHeresy => "LunarSecondaryReplacement", 
			ItemLunarEnum.LightFluxPauldron => "HalfAttackSpeedHalfCooldowns", 
			ItemLunarEnum.MercurialRachis => "RandomDamageZone", 
			ItemLunarEnum.Purity => "LunarBadLuck", 
			ItemLunarEnum.ShapedGlass => "LunarDagger", 
			ItemLunarEnum.StoneFluxPauldron => "HalfSpeedDoubleHealth", 
			ItemLunarEnum.StridesOfHeresy => "LunarUtilityReplacement", 
			ItemLunarEnum.Transcendence => "ShieldOnly", 
			ItemLunarEnum.VisionsOfHeresy => "LunarPrimaryReplacement", 
			_ => null, 
		};
	}

	private static string getItemName(ItemEquipEnum item)
	{
		return item switch
		{
			ItemEquipEnum.BeyondTheLimits => "EliteSecretSpeedEquipment", 
			ItemEquipEnum.BlastShower => "Cleanse", 
			ItemEquipEnum.CovenOfGold => "EliteGoldEquipment", 
			ItemEquipEnum.DisposableMissileLauncher => "CommandMissile", 
			ItemEquipEnum.EccentricVase => "Gateway", 
			ItemEquipEnum.EffigyOfGrief => "CrippleWard", 
			ItemEquipEnum.ElegyOfExtinction => "LunarPortalOnUse", 
			ItemEquipEnum.ExecutiveCard => "MultiShopCard", 
			ItemEquipEnum.ForeignFruit => "Fruit", 
			ItemEquipEnum.ForgiveMePlease => "DeathProjectile", 
			ItemEquipEnum.FuelArray => "QuestVolatileBattery", 
			ItemEquipEnum.GlowingMeteorite => "Meteor", 
			ItemEquipEnum.GnarledWoodsprite => "PassiveHealing", 
			ItemEquipEnum.GooboJr => "GummyClone", 
			ItemEquipEnum.GoragsOpus => "TeamWarCry", 
			ItemEquipEnum.HelfireTincture => "BurnNearby", 
			ItemEquipEnum.HerBitingEmbrace => "EliteIceEquipment", 
			ItemEquipEnum.HisReassurance => "EliteEarthEquipment", 
			ItemEquipEnum.IfritsDistinction => "EliteFireEquipment", 
			ItemEquipEnum.JadeElephant => "GainArmor", 
			ItemEquipEnum.JarOfSouls => "SoulJar", 
			ItemEquipEnum.MilkyChrysalis => "Jetpack", 
			ItemEquipEnum.Molotov => "Molotov", 
			ItemEquipEnum.NkuhanasRetort => "ElitePoisonEquipment", 
			ItemEquipEnum.OcularHUD => "CritOnUse", 
			ItemEquipEnum.OverloadingExcavator => "IrradiatingLaser", 
			ItemEquipEnum.PreonAccumulator => "BFG", 
			ItemEquipEnum.PrimordialCube => "Blackhole", 
			ItemEquipEnum.RadarScanner => "Scanner", 
			ItemEquipEnum.ReapersRemorse => "GhostGun", 
			ItemEquipEnum.Recycler => "Recycle", 
			ItemEquipEnum.RemoteCaffeinator => "VendingMachine", 
			ItemEquipEnum.RoyalCapacitor => "Lightning", 
			ItemEquipEnum.Sawmerang => "Saw", 
			ItemEquipEnum.SharedDesign => "EliteLunarEquipment", 
			ItemEquipEnum.SilenceBetweenTwoStrikes => "EliteLightningEquipment", 
			ItemEquipEnum.SpectralCirclet => "EliteHauntedEquipment", 
			ItemEquipEnum.SpinelTonic => "Tonic", 
			ItemEquipEnum.SuperMassiveLeech => "LifestealOnHit", 
			ItemEquipEnum.TheBackup => "DroneBackup", 
			ItemEquipEnum.TheCrowdfunder => "GoldGat", 
			ItemEquipEnum.TrophyHuntersTricorn => "BossHunter", 
			ItemEquipEnum.VolcanicEgg => "FireBallDash", 
			_ => null, 
		};
	}
}
[NetworkCompatibility(/*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.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("AlchemyFlame.PlayWithEliteItem", "PlayWithEliteItem", "1.0.1")]
public class GiveEliteItem : BaseUnityPlugin
{
	public class PlayerStorage
	{
		public NetworkUser user = null;

		public CharacterMaster master = null;

		public EquipmentIndex previousEquipment = (EquipmentIndex)(-1);

		public string chosenEquipment = null;

		public uint chosenEquipmentSlot = 1u;
	}

	public static GiveEliteItem instance;

	private bool canUseEquipment = true;

	public const string PluginGUID = "AlchemyFlame.PlayWithEliteItem";

	public const string PluginAuthor = "AlchemyFlame";

	public const string PluginName = "PlayWithEliteItem";

	public const string PluginVersion = "1.0.1";

	public List<PlayerStorage> playerStorage = new List<PlayerStorage>();

	public float respawnTime;

	private string[] equipmentOptions = new string[7] { "EliteEarthEquipment", "EliteFireEquipment", "EliteHauntedEquipment", "EliteIceEquipment", "EliteLightningEquipment", "EliteLunarEquipment", "ElitePoisonEquipment" };

	public static PluginInfo PInfo { get; private set; }

	public void Awake()
	{
		PInfo = ((BaseUnityPlugin)this).Info;
		instance = this;
		BepConfig.Init();
		Debug.Log((object)"Carregando Mod2!");
		SetupHooks();
		AnalyzeEquip();
	}

	private void AnalyzeEquip()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		EquipmentSlot.PerformEquipmentAction += (hook_PerformEquipmentAction)delegate(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentIndex)
		{
			CharacterBody characterBody = self.characterBody;
			if (Object.op_Implicit((Object)(object)characterBody))
			{
				foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
				{
					if (Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)instance.master) && (Object)(object)instance.master.GetBody() == (Object)(object)characterBody)
					{
						NetworkUser networkUser = instance.networkUser;
						if ((Object)(object)networkUser != (Object)null)
						{
							string userName = networkUser.userName;
							PlayerStorage playerStorage = FindPlayerStorageForUser(networkUser);
							if (playerStorage != null)
							{
								((MonoBehaviour)GiveEliteItem.instance).StartCoroutine(DelayedEquipmentSwitch(instance, playerStorage));
							}
						}
					}
				}
			}
			return orig.Invoke(self, equipmentIndex);
		};
	}

	private IEnumerator DelayedEquipmentSwitch(PlayerCharacterMasterController playerCharacterMaster, PlayerStorage playerStorage)
	{
		canUseEquipment = false;
		yield return (object)new WaitForSeconds(0.3f);
		uint slot = 0u;
		EquipmentIndex user1 = playerCharacterMaster.master.inventory.GetEquipment(slot).equipmentIndex;
		uint slot2 = 1u;
		EquipmentIndex user2 = playerCharacterMaster.master.inventory.GetEquipment(slot2).equipmentIndex;
		Debug.Log((object)"Adicionando ao jogadores...");
		Debug.Log((object)playerCharacterMaster.master.inventory.GetEquipment(slot).equipmentIndex);
		Debug.Log((object)playerCharacterMaster.master.inventory.GetEquipment(slot2).equipmentIndex);
		if (playerStorage.chosenEquipmentSlot == 1)
		{
			if ((int)user1 == 3)
			{
				playerCharacterMaster.master.inventory.SetEquipmentIndexForSlot(user2, 0u);
				playerCharacterMaster.master.inventory.SetEquipmentIndexForSlot((EquipmentIndex)(-1), 1u);
				canUseEquipment = true;
				yield break;
			}
			playerCharacterMaster.master.inventory.SetEquipmentIndexForSlot(user2, 0u);
			playerCharacterMaster.master.inventory.SetEquipmentIndexForSlot(user1, 1u);
			playerStorage.chosenEquipmentSlot = 0u;
		}
		else
		{
			playerCharacterMaster.master.inventory.SetEquipmentIndexForSlot(user2, 0u);
			playerCharacterMaster.master.inventory.SetEquipmentIndexForSlot(user1, 1u);
			playerStorage.chosenEquipmentSlot = 1u;
		}
		canUseEquipment = true;
	}

	private PlayerStorage FindPlayerStorageForUser(NetworkUser user)
	{
		foreach (PlayerStorage item in playerStorage)
		{
			if ((Object)(object)item.user == (Object)(object)user)
			{
				return item;
			}
		}
		return null;
	}

	private void SetupHooks()
	{
		//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
		Run.Start += new hook_Start(Run_Start);
		Run.OnUserAdded += new hook_OnUserAdded(Run_OnUserAdded);
		Run.OnUserRemoved += new hook_OnUserRemoved(Run_OnUserRemoved);
	}

	private void Run_Start(orig_Start orig, Run self)
	{
		orig.Invoke(self);
		SetupPlayers();
	}

	private void SetupPlayers(bool StageUpdate = true)
	{
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		Debug.Log((object)"Configurando jogadores...");
		if (StageUpdate)
		{
			this.playerStorage.Clear();
		}
		List<int> list = new List<int>();
		foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
		{
			if (this.playerStorage != null && (Object)(object)instance.networkUser == (Object)null)
			{
				Debug.Log((object)"Um jogador desconectou! Ignorando o que resta deles...");
				continue;
			}
			if (!StageUpdate && this.playerStorage != null)
			{
				bool flag = false;
				foreach (PlayerStorage item in this.playerStorage)
				{
					if ((Object)(object)item.master == (Object)(object)instance.master)
					{
						flag = true;
						break;
					}
				}
				if (flag)
				{
					continue;
				}
			}
			PlayerStorage playerStorage = new PlayerStorage();
			if (Object.op_Implicit((Object)(object)instance.networkUser))
			{
				playerStorage.user = instance.networkUser;
			}
			if (Object.op_Implicit((Object)(object)instance.master))
			{
				playerStorage.master = instance.master;
			}
			Random random = new Random();
			int num;
			do
			{
				num = random.Next(0, equipmentOptions.Length);
			}
			while (list.Contains(num));
			list.Add(num);
			string chosenEquipment = equipmentOptions[num];
			playerStorage.chosenEquipment = chosenEquipment;
			playerStorage.chosenEquipmentSlot = 1u;
			this.playerStorage.Add(playerStorage);
			Debug.Log((object)(playerStorage.user.userName + " adicionado ao PlayerStorage!"));
			if (Object.op_Implicit((Object)(object)instance.master.inventory))
			{
				instance.master.inventory.SetEquipmentIndexForSlot(EquipmentCatalog.FindEquipmentIndex(playerStorage.chosenEquipment), 1u);
			}
			Debug.Log((object)(playerStorage.chosenEquipment + " adicionado ao Jogador!"));
		}
		Debug.Log((object)"A configuração dos jogadores foi concluída.");
	}

	private void Run_OnUserAdded(orig_OnUserAdded orig, Run self, NetworkUser user)
	{
		orig.Invoke(self, user);
		if (Run.instance.time > 1f)
		{
			SetupPlayers(StageUpdate: false);
		}
	}

	private void Run_OnUserRemoved(orig_OnUserRemoved orig, Run self, NetworkUser user)
	{
		orig.Invoke(self, user);
		if (!(Run.instance.time > 1f))
		{
			return;
		}
		PlayerStorage item = null;
		foreach (PlayerStorage item2 in playerStorage)
		{
			if (item2.user.userName == user.userName)
			{
				item = item2;
				((BaseUnityPlugin)this).Logger.LogInfo((object)(user.userName + " left. Removing them from PlayerStorage."));
				break;
			}
		}
		playerStorage.Remove(item);
	}
}
internal static class Log
{
	internal static ManualLogSource _logSource;

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

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

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

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

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

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

	internal static void LogWarning(object data)
	{
		_logSource.LogWarning(data);
	}
}
public static class ModCompatibilityInLobbyConfig
{
	private static bool? _enabled;

	public static bool enabled
	{
		get
		{
			if (!_enabled.HasValue)
			{
				_enabled = Chainloader.PluginInfos.ContainsKey("com.KingEnderBrine.InLobbyConfig");
			}
			return _enabled.Value;
		}
	}

	public static void CreateFromBepInExConfigFile(ConfigFile config, string displayName)
	{
		ModConfigEntry val = ConfigFieldUtilities.CreateFromBepInExConfigFile(config, displayName);
		ModConfigCatalog.Add(val);
	}
}