Decompiled source of 2R4R v2.1.10

RiskierRain.dll

Decompiled 5 days ago
using System;
using System.Collections;
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.Bootstrap;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.BeetleQueenMonster;
using EntityStates.BrotherMonster;
using EntityStates.ClayBruiser.Weapon;
using EntityStates.Drone;
using EntityStates.Drone.DroneJunk;
using EntityStates.ExtractorUnit;
using EntityStates.GoldGat;
using EntityStates.Gup;
using EntityStates.ImpBossMonster;
using EntityStates.Interactables.GoldBeacon;
using EntityStates.LunarWisp;
using EntityStates.MeridianEvent;
using EntityStates.Missions.Arena.NullWard;
using EntityStates.Missions.BrotherEncounter;
using EntityStates.Missions.ChampRush;
using EntityStates.NullifierMonster;
using EntityStates.QuestVolatileBattery;
using EntityStates.RoboBallBoss.Weapon;
using EntityStates.ShrineHalcyonite;
using EntityStates.SolusWing2;
using EntityStates.TeleporterCatastrophe.DLC4.Teleporter;
using EntityStates.VagrantMonster;
using EntityStates.VagrantNovaItem;
using HG;
using HG.Reflection;
using IL.EntityStates.Drone.DroneWeapon;
using IL.RoR2;
using IL.RoR2.Artifacts;
using IL.RoR2.Items;
using IL.RoR2.Orbs;
using IL.RoR2.Projectile;
using IL.RoR2.Skills;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using MoreStats;
using On.EntityStates.CaptainSupplyDrop;
using On.EntityStates.ClayBruiser.Weapon;
using On.EntityStates.Drone;
using On.EntityStates.Drone.DroneJunk;
using On.EntityStates.ExtractorUnit;
using On.EntityStates.Gup;
using On.EntityStates.Interactables.GoldBeacon;
using On.EntityStates.LunarWisp;
using On.EntityStates.MeridianEvent;
using On.EntityStates.Missions.Arena.NullWard;
using On.EntityStates.Missions.BrotherEncounter;
using On.EntityStates.Missions.ChampRush;
using On.EntityStates.NullifierMonster;
using On.EntityStates.QuestVolatileBattery;
using On.EntityStates.RoboBallBoss.Weapon;
using On.EntityStates.ShrineHalcyonite;
using On.EntityStates.SolusWing2;
using On.EntityStates.TeleporterCatastrophe.DLC4.Teleporter;
using On.EntityStates.VagrantMonster;
using On.EntityStates.VagrantNovaItem;
using On.RoR2;
using On.RoR2.Items;
using On.RoR2.Orbs;
using On.RoR2.Quests.TrialQuests;
using On.RoR2.UI;
using R2API;
using R2API.Utils;
using RainrotSharedUtils;
using RainrotSharedUtils.Difficulties;
using RainrotSharedUtils.Shelters;
using RiskierRain.Changes;
using RiskierRain.Changes.Components;
using RiskierRain.Components;
using RiskierRain.CoreModules;
using RoR2;
using RoR2.ContentManagement;
using RoR2.Items;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Quests.TrialQuests;
using RoR2.Skills;
using RoR2.UI;
using RoR2BepInExPack.GameAssetPaths.Version_1_39_0;
using RoR2BepInExPack.GameAssetPathsBetter;
using SwanSongExtended.Items;
using SwanSongExtended.Modules;
using SwanSongExtended.Storms;
using ThreeEyedGames;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;

[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.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("RiskierRain")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RiskierRain")]
[assembly: AssemblyTitle("RiskierRain")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: UnverifiableCode]
namespace RiskierRain
{
	[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.*/)]
	[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.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.RiskOfBrainrot.RiskierRain", "RiskierRain", "2.1.8")]
	[R2APISubmoduleDependency(new string[] { "LanguageAPI", "PrefabAPI", "DirectorAPI", "ItemAPI", "RecalculateStatsAPI", "EliteAPI" })]
	internal class RiskierRainPlugin : BaseUnityPlugin
	{
		public static int sacrificeDropCount = 12;

		public static int sacrificeDropCountRestricted = 5;

		public static float sacrificeDropRate = 8f;

		public static float sacrificeDropRateLimited = 20f;

		public static int sonorousDropCountBase = 4;

		public static int sonorousDropCountStack = 2;

		public static int sonorousDropCountRestrictedBase = 5;

		public static int sonorousDropCountRestrictedStack = 1;

		public static float sonorousDropRateBase = 5f;

		public static float sonorousDropRateStack = 5f;

		public static float sonorousDropRateLimited = 20f;

		private static int serverSacrificeDropTally = 0;

		private static int serverSonorousDropTally = 0;

		public static int minSpikes = 3;

		public static int maxSpikes = 4;

		public static int baseSpikesPerBuff = 2;

		public static int stackSpikesPerBuff = 1;

		public static float minDamageCoefficient = 5f;

		public static float releaseSpeed = 2f;

		public static float spikeDamageCoefficient = 0.3f;

		public static float spikeProcCoefficient = 1f;

		public static int shatterspleenBleedChance = 20;

		public static GameObject impBleedSpikePrefab;

		public const string guid = "com.RiskOfBrainrot.RiskierRain";

		public const string teamName = "RiskOfBrainrot";

		public const string modName = "RiskierRain";

		public const string version = "2.1.8";

		public static bool isAELoaded = Tools.isLoaded("com.Borbo.ArtificerExtended");

		public static bool isHBULoaded = Tools.isLoaded("com.Borbo.HuntressBuffULTIMATE");

		public static bool isScepterLoaded = Tools.isLoaded("com.DestroyedClone.AncientScepter");

		public static bool autosprintLoaded = Tools.isLoaded("com.johnedwa.RTAutoSprintEx");

		public static bool acridLungeLoaded = Tools.isLoaded("Withor.AcridBiteLunge");

		public static bool ucrLoaded = Tools.isLoaded("HIFU.UltimateCustomRun");

		public static bool chefOvercookedLoaded = Tools.isLoaded("noodleGemo.Chef_Overcooked");

		public static string drizzleDesc = "Simplifies difficulty for players new to the game. Weeping and gnashing is replaced by laughter and tickles.<style=cStack>\n\n>Player Health Regeneration: <style=cIsHealing>+50%</style> \n>Difficulty Scaling: <style=cIsHealing>-50%</style> \n>Player Damage Reduction: <style=cIsHealing>+38%</style>";

		public static string rainstormDesc = "This is the way the game is meant to be played! Test your abilities and skills against formidable foes.<style=cStack>\n\n>Player Health Regeneration: +0% \n>Difficulty Scaling: +0% ";

		public static string monsoonDesc = "For hardcore players. Every bend introduces pain and horrors of the planet. You will die.<style=cStack>\n\n>Player Health Regeneration: <style=cIsHealth>-40%</style> \n>Difficulty Scaling: <style=cIsHealth>+50%</style>";

		public static GameObject meatballNapalmPool;

		private static string LastCategory;

		public static PluginInfo PInfo { get; private set; }

		public static string dropPrefabsPath => Assets.dropPrefabsPath;

		public static string iconsPath => Assets.iconsPath;

		public static string eliteMaterialsPath => Assets.eliteMaterialsPath;

		internal static ConfigFile CustomConfigFile { get; set; }

		public static ConfigEntry<bool> EnableConfig { get; set; }

		public static void DoSacrificeDropLimit()
		{
			//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
			SacrificeArtifactManager.OnServerCharacterDeath += new Manipulator(DropLimitForSacrifice);
			GlobalEventManager.OnCharacterDeath += new Manipulator(DropLimitForSonorous);
			Stage.onServerStageBegin += ResetServerDropCount;
			LanguageAPI.Add("ITEM_ITEMDROPCHANCEONKILL_DESC", "On killing a large monster, it will <style=cIsDamage>always</style> drop an item. " + $"Elite monsters have a <style=cIsUtility>{sonorousDropRateBase}%</style> chance of " + $"dropping an item <style=cStack>(+{sonorousDropRateStack}% per stack)</style>.");
		}

		public static int GetDropCountForSacrifice()
		{
			if (!Object.op_Implicit((Object)(object)Run.instance))
			{
				return 0;
			}
			if (UsingRestrictedSacrifice())
			{
				return sacrificeDropCountRestricted * Run.instance.participatingPlayerCount;
			}
			return sacrificeDropCount * Run.instance.participatingPlayerCount;
		}

		public static int GetDropCountForSonorous()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)Run.instance))
			{
				return 0;
			}
			int itemCountForTeam = Util.GetItemCountForTeam((TeamIndex)1, Items.ItemDropChanceOnKill.itemIndex, false, true);
			if (UsingRestrictedSacrifice())
			{
				return sonorousDropCountRestrictedBase + sonorousDropCountRestrictedStack * (itemCountForTeam - 1);
			}
			return sonorousDropCountBase + sonorousDropCountStack * (itemCountForTeam - 1);
		}

		internal static bool UsingRestrictedSacrifice()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Invalid comparison between Unknown and I4
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Invalid comparison between Unknown and I4
			return (int)Stage.instance.sceneDef.sceneType == 2 || (int)Stage.instance.sceneDef.sceneType == 5;
		}

		private static void ResetServerDropCount(Stage obj)
		{
			serverSacrificeDropTally = 0;
			serverSonorousDropTally = 0;
		}

		private static void DropLimitForSacrifice(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			FixSacrificeDropChance(val);
			val.Index = 0;
			AddSacrificeDropTally(val);
		}

		private static void FixSacrificeDropChance(ILCursor c)
		{
			float num = default(float);
			if (!c.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.Util", "GetExpAdjustedDropChancePercent")
			}) || !c.TryGotoPrev((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num)
			}))
			{
				DebugBreakpoint("FixSacrificeDropChance");
				return;
			}
			c.EmitDelegate<Func<float, float>>((Func<float, float>)((float _) => (serverSacrificeDropTally >= GetDropCountForSacrifice() && !Util.CheckRoll(sacrificeDropRateLimited, 0f, (CharacterMaster)null)) ? 0f : sacrificeDropRate));
		}

		private static void AddSacrificeDropTally(ILCursor c)
		{
			if (!c.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<PickupDropletController>(x, "CreatePickupDroplet")
			}))
			{
				DebugBreakpoint("AddSacrificeDropTally");
				return;
			}
			c.EmitDelegate<Action>((Action)delegate
			{
				serverSacrificeDropTally++;
			});
		}

		private static void DropLimitForSonorous(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			ILLabel val2 = val.DefineLabel();
			int masterLoc = 17;
			int itemCountLoc = 102;
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.DLC2Content/Items", "ItemDropChanceOnKill")
			}) || !val.TryGotoPrev((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref masterLoc)
			}) || !val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCountEffective")
			}))
			{
				DebugBreakpoint("DropLimitForSonorous", 1);
				return;
			}
			SonorousUseTeamItemCount(val, masterLoc);
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref itemCountLoc)
			}))
			{
				DebugBreakpoint("DropLimitForSonorous", 2);
				return;
			}
			val2 = val.MarkLabel();
			FixSonorousDropChance(val, itemCountLoc, masterLoc);
			val.GotoLabel(val2, (MoveType)1, false);
			AddSonorousDropTally(val, itemCountLoc);
		}

		private static void SonorousUseTeamItemCount(ILCursor c, int masterLoc)
		{
			DoTheRoar();
			if (!c.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCountEffective")
			}))
			{
				DebugBreakpoint("SonorousUseTeamItemCount");
			}
			else
			{
				DoTheRoar();
			}
			void DoTheRoar()
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				c.Emit(OpCodes.Ldloc, masterLoc);
				c.EmitDelegate<Func<int, CharacterMaster, int>>((Func<int, CharacterMaster, int>)((int oldItemCount, CharacterMaster master) => Util.GetItemCountForTeam(master.teamIndex, Items.ItemDropChanceOnKill.itemIndex, true, true)));
			}
		}

		private static void FixSonorousDropChance(ILCursor c, int itemCountLoc, int masterLoc)
		{
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			if (!c.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_isElite")
			}) || !c.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, itemCountLoc)
			}) || !c.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, masterLoc)
			}))
			{
				DebugBreakpoint("FixSonorousDropChance");
				return;
			}
			c.Emit(OpCodes.Ldloc, itemCountLoc);
			c.EmitDelegate<Func<float, int, float>>((Func<float, int, float>)((float chanceIn, int stack) => (serverSonorousDropTally >= GetDropCountForSacrifice() && !Util.CheckRoll(sonorousDropRateLimited, 0f, (CharacterMaster)null)) ? 0f : (sonorousDropRateBase + sonorousDropRateStack * (float)(stack - 1))));
		}

		private static void AddSonorousDropTally(ILCursor c, int itemCountLoc)
		{
			if (!c.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "get_isElite")
			}) || !c.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, itemCountLoc)
			}) || !c.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<PickupDropletController>(x, "CreatePickupDroplet")
			}))
			{
				DebugBreakpoint("AddSonorousDropTally");
				return;
			}
			c.EmitDelegate<Action>((Action)delegate
			{
				serverSonorousDropTally++;
			});
		}

		private void ReworkShatterspleen()
		{
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Expected O, but got Unknown
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Expected O, but got Unknown
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Expected O, but got Unknown
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Expected O, but got Unknown
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Expected O, but got Unknown
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Expected O, but got Unknown
			impBleedSpikePrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("prefabs/projectiles/ImpVoidspikeProjectile"), "ShatterspleenBleedSpike", true);
			ProjectileController component = impBleedSpikePrefab.GetComponent<ProjectileController>();
			component.procCoefficient = 1f;
			ProjectileImpactExplosion component2 = impBleedSpikePrefab.GetComponent<ProjectileImpactExplosion>();
			((ProjectileExplosion)component2).blastRadius = 4f;
			Rigidbody component3 = impBleedSpikePrefab.GetComponent<Rigidbody>();
			component3.useGravity = true;
			AntiGravityForce val = impBleedSpikePrefab.AddComponent<AntiGravityForce>();
			val.antiGravityCoefficient = -1f;
			val.rb = component3;
			ProjectileDirectionalTargetFinder val2 = impBleedSpikePrefab.AddComponent<ProjectileDirectionalTargetFinder>();
			((Behaviour)val2).enabled = true;
			val2.lookRange = 50f;
			val2.lookCone = 10f;
			ProjectileSteerTowardTarget val3 = impBleedSpikePrefab.AddComponent<ProjectileSteerTowardTarget>();
			val3.yAxisOnly = false;
			val3.rotationSpeed = 50f;
			Assets.projectilePrefabs.Add(impBleedSpikePrefab);
			GlobalEventManager.ProcessHitEnemy += new Manipulator(RevokeShatterspleenBleedRights);
			GlobalEventManager.OnCharacterDeath += new Manipulator(RevokeShatterspleenDeathRights);
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RemoveShatterspleenCrit);
			CharacterBody.RecalculateStats += new hook_RecalculateStats(ShatterspleenBleedChance);
			GlobalEventManager.ProcessHitEnemy += new hook_ProcessHitEnemy(NewShatterspleenFunctionality);
			CharacterBody.RemoveBuff_BuffIndex += new hook_RemoveBuff_BuffIndex(FireShatterspleenBleedSpike);
			LanguageAPI.Add("ITEM_BLEEDONHITANDEXPLODE_PICKUP", "Massive hits charge a volley of bleed spikes.");
			LanguageAPI.Add("ITEM_BLEEDONHITANDEXPLODE_DESC", $"Gain {shatterspleenBleedChance}% bleed chance. " + "Hits that deal <style=cIsDamage>more than " + Tools.ConvertDecimal(minDamageCoefficient) + " damage</style> also " + $"charge {minSpikes}-{maxSpikes} volleys of " + $"{baseSpikesPerBuff} void spikes (+{stackSpikesPerBuff} per stack). " + $"These spikes release {releaseSpeed} seconds at a time, " + "dealing " + Tools.ConvertDecimal(spikeDamageCoefficient) + " BASE damage and bleeding enemies hit for " + Tools.ConvertDecimal(2.4f * spikeProcCoefficient) + " base damage.");
		}

		private void ShatterspleenBleedChance(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			Inventory inventory = self.inventory;
			if (inventory != null && inventory.GetItemCountEffective(Items.BleedOnHitAndExplode) > 0)
			{
				self.bleedChance += (float)shatterspleenBleedChance;
			}
		}

		private void RemoveShatterspleenCrit(CharacterBody sender, StatHookEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)sender.inventory))
			{
				Inventory inventory = sender.inventory;
				if (inventory.GetItemCountEffective(Items.BleedOnHitAndExplode) > 0)
				{
					args.critAdd -= 5f;
				}
			}
		}

		private void FireShatterspleenBleedSpike(orig_RemoveBuff_BuffIndex orig, CharacterBody self, BuffIndex buffType)
		{
			//IL_0001: 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_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: 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_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			if (buffType == Assets.shatterspleenSpikeBuff.buffIndex)
			{
				int itemCountEffective = self.inventory.GetItemCountEffective(Items.BleedOnHitAndExplode);
				if (itemCountEffective > 0)
				{
					Util.PlaySound(FireVoidspikes.attackSoundString, ((Component)self).gameObject);
					EffectManager.SimpleMuzzleFlash(FireVoidspikes.swipeEffectPrefab, ((Component)self).gameObject, "Head", false);
					Ray val = default(Ray);
					((Ray)(ref val))..ctor(self.inputBank.aimOrigin, self.inputBank.aimDirection);
					int num = baseSpikesPerBuff + stackSpikesPerBuff * (itemCountEffective - 1);
					Debug.Log((object)num);
					for (int i = 0; i < num; i++)
					{
						float num2 = 0f;
						float num3 = FireVoidspikes.projectileSpeed * 0.3f * (float)(i + 1);
						Vector3 val2 = Util.ApplySpread(((Ray)(ref val)).direction, 0f, 0f, 1f, 1f, num2, 0f);
						ProjectileManager.instance.FireProjectile(impBleedSpikePrefab, ((Ray)(ref val)).origin, Util.QuaternionSafeLookRotation(val2), ((Component)self).gameObject, self.damage * spikeDamageCoefficient, 0f, Util.CheckRoll(self.crit, self.master), (DamageColorIndex)0, (GameObject)null, num3, (DamageTypeCombo?)null);
					}
				}
			}
			orig.Invoke(self, buffType);
		}

		private void NewShatterspleenFunctionality(orig_ProcessHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)damageInfo.attacker) && damageInfo.procCoefficient > 0f && !((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)5))
			{
				CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
				CharacterBody component2 = victim.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)component))
				{
					int num = 0;
					Inventory inventory = component.inventory;
					if (Object.op_Implicit((Object)(object)inventory))
					{
						num = inventory.GetItemCountEffective(Items.BleedOnHitAndExplode);
						if ((Object)(object)component2 != (Object)null && num > 0)
						{
							int num2 = Random.Range(minSpikes, maxSpikes + 1);
							int buffCount = component.GetBuffCount(Assets.shatterspleenSpikeBuff);
							if (damageInfo.damage / component.damage >= minDamageCoefficient && num2 > buffCount)
							{
								((ProcChainMask)(ref damageInfo.procChainMask)).AddProc((ProcType)5);
								for (int i = buffCount; i < num2; i++)
								{
									component.AddTimedBuffAuthority(Assets.shatterspleenSpikeBuff.buffIndex, releaseSpeed * (float)(i + 1));
								}
							}
						}
					}
				}
			}
			orig.Invoke(self, damageInfo, victim);
		}

		private void RevokeShatterspleenBleedRights(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_005b: 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)
			ILCursor val = new ILCursor(il);
			val.GotoNext((MoveType)2, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "BleedOnHitAndExplode"),
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCountEffective")
			});
			val.Emit(OpCodes.Ldc_I4, 0);
			val.Emit(OpCodes.Mul);
		}

		private void RevokeShatterspleenDeathRights(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_005b: 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)
			ILCursor val = new ILCursor(il);
			val.GotoNext((MoveType)2, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Items", "BleedOnHitAndExplode"),
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Inventory>(x, "GetItemCountEffective")
			});
			val.Emit(OpCodes.Ldc_I4, 0);
			val.Emit(OpCodes.Mul);
		}

		private bool IsCategoryEnabled(bool category)
		{
			return category;
		}

		private void Awake()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			PInfo = ((BaseUnityPlugin)this).Info;
			InitializeCoreModules();
			InitializeConfig();
			InitializeEverything();
			CharacterBody.RemoveBuff_BuffDef += new hook_RemoveBuff_BuffDef(Gah);
			SaveConfig();
			new ContentPacks().Initialize();
		}

		public static void DebugBreakpoint(string methodName, int breakpointNumber = -1)
		{
			string text = "RiskierRain: " + methodName + " IL hook failed!";
			if (breakpointNumber >= 0)
			{
				text += $" (breakpoint {breakpointNumber})";
			}
			Debug.LogError((object)text);
		}

		private void Gah(orig_RemoveBuff_BuffDef orig, CharacterBody self, BuffDef buffType)
		{
			if (!NetworkServer.active)
			{
				Debug.Log((object)((Object)buffType).name);
			}
			orig.Invoke(self, buffType);
		}

		private void InitializeEverything()
		{
			ItemChanges.Initialize();
			EquipmentChanges.Initialize();
			DifficultyChanges.Initialize();
			AllyChanges.Initialize();
			EnemyChanges.Initialize();
			InteractableChanges.Initialize();
			QuickSection(DoSacrificeDropLimit, ": Sacrifice and Sonorous Drop Limit");
			LanguageAPI.Add("DIFFICULTY_EASY_DESCRIPTION", drizzleDesc + "</style>");
			LanguageAPI.Add("DIFFICULTY_NORMAL_DESCRIPTION", rainstormDesc + "</style>");
			LanguageAPI.Add("DIFFICULTY_HARD_DESCRIPTION", monsoonDesc + "</style>");
		}

		public static AssetReferenceT<T> LoadAsync<T>(string guid, Action<T> callback) where T : Object
		{
			//IL_0018: 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)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			AssetReferenceT<T> val = new AssetReferenceT<T>(guid);
			AsyncOperationHandle<T> handle = AssetAsyncReferenceManager<T>.LoadAsset(val, (AsyncReferenceHandleUnloadType)2);
			if (callback == null)
			{
				return val;
			}
			if (handle.IsDone)
			{
				onCompleted(handle);
				return val;
			}
			handle.Completed += onCompleted;
			return val;
			void onCompleted(AsyncOperationHandle<T> val2)
			{
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0017: Invalid comparison between Unknown and I4
				if (val2.Result == null || (int)val2.Status != 1)
				{
					Debug.LogError((object)$"Failed to load asset [{val2.DebugName}] : {val2.OperationException}");
				}
				else
				{
					callback(val2.Result);
				}
			}
		}

		public static void RetierItemAsync(string itemGuid, ItemTier tier = (ItemTier)5, Action<ItemDef> callback = null)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			AssetReferenceT<ItemDef> val = new AssetReferenceT<ItemDef>(itemGuid);
			AsyncOperationHandle<ItemDef> val2 = AssetAsyncReferenceManager<ItemDef>.LoadAsset(val, (AsyncReferenceHandleUnloadType)2);
			val2.Completed += delegate(AsyncOperationHandle<ItemDef> ctx)
			{
				//IL_000b: 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_001d: Unknown result type (might be due to invalid IL or missing references)
				ItemDef result = ctx.Result;
				result.tier = tier;
				result.deprecatedTier = tier;
				if (callback != null)
				{
					callback(result);
				}
			};
		}

		public static void RemoveEquipmentAsync(string equipmentGuid, Action<EquipmentDef> callback = null)
		{
			//IL_0017: 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)
			AssetReferenceT<EquipmentDef> val = new AssetReferenceT<EquipmentDef>(equipmentGuid);
			AsyncOperationHandle<EquipmentDef> val2 = AssetAsyncReferenceManager<EquipmentDef>.LoadAsset(val, (AsyncReferenceHandleUnloadType)2);
			val2.Completed += delegate(AsyncOperationHandle<EquipmentDef> ctx)
			{
				EquipmentDef result = ctx.Result;
				result.canDrop = false;
				result.canBeRandomlyTriggered = false;
				result.enigmaCompatible = false;
				result.dropOnDeathChance = 0f;
				if (callback != null)
				{
					callback(result);
				}
			};
		}

		public static void ChangeEquipmentEnigma(string equipName, bool canEnigma)
		{
			EquipmentDef val = LoadEquipDef(equipName);
			if ((Object)(object)val != (Object)null)
			{
				val.enigmaCompatible = canEnigma;
			}
		}

		public static void ChangeBuffStacking(string buffName, bool canStack)
		{
			BuffDef val = LoadBuffDef(buffName);
			if ((Object)(object)val != (Object)null)
			{
				val.canStack = canStack;
			}
		}

		public static ItemDef LoadItemDef(string name)
		{
			return LegacyResourcesAPI.Load<ItemDef>("ItemDefs/" + name);
		}

		public static EquipmentDef LoadEquipDef(string name)
		{
			return LegacyResourcesAPI.Load<EquipmentDef>("EquipmentDefs/" + name);
		}

		public static BuffDef LoadBuffDef(string name)
		{
			return LegacyResourcesAPI.Load<BuffDef>("BuffDefs/" + name);
		}

		public static void CreateMeatballNapalm()
		{
			//IL_0028: 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)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Expected O, but got Unknown
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: 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_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			meatballNapalmPool = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("prefabs/projectiles/beetlequeenacid"), "NapalmFire", true);
			Color val = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)120, (byte)0, byte.MaxValue));
			Transform val2 = meatballNapalmPool.transform.Find("FX/Decal");
			Material val3 = new Material(((Component)val2).GetComponent<Decal>().Material);
			val3.SetColor("_Color", val);
			((Component)val2).GetComponent<Decal>().Material = val3;
			ProjectileDotZone component = meatballNapalmPool.GetComponent<ProjectileDotZone>();
			component.lifetime = 5f;
			component.fireFrequency = 2f;
			component.damageCoefficient = 0.5f;
			component.overlapProcCoefficient = 0.5f;
			component.attackerFiltering = (AttackerFiltering)0;
			meatballNapalmPool.GetComponent<ProjectileDamage>().damageType = DamageTypeCombo.op_Implicit((DamageType)128);
			meatballNapalmPool.GetComponent<ProjectileController>().procCoefficient = 1f;
			float num = 2.5f;
			meatballNapalmPool.GetComponent<Transform>().localScale = new Vector3(num, num, num);
			Transform val4 = meatballNapalmPool.transform.Find("FX");
			((Component)val4.Find("Spittle")).gameObject.SetActive(false);
			GameObject val5 = Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>("prefabs/FireTrail").GetComponent<DamageTrail>().segmentPrefab, ((Component)val4).transform);
			MainModule main = val5.GetComponent<ParticleSystem>().main;
			((MainModule)(ref main)).duration = 8f;
			((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(-0.075f);
			MinMaxCurve startSizeX = ((MainModule)(ref main)).startSizeX;
			((MinMaxCurve)(ref startSizeX)).constantMin = ((MinMaxCurve)(ref startSizeX)).constantMin * 0.6f;
			((MinMaxCurve)(ref startSizeX)).constantMax = ((MinMaxCurve)(ref startSizeX)).constantMax * 0.8f;
			MinMaxCurve startSizeY = ((MainModule)(ref main)).startSizeY;
			((MinMaxCurve)(ref startSizeY)).constantMin = ((MinMaxCurve)(ref startSizeY)).constantMin * 0.8f;
			((MinMaxCurve)(ref startSizeY)).constantMax = ((MinMaxCurve)(ref startSizeY)).constantMax * 1f;
			MinMaxCurve startSizeZ = ((MainModule)(ref main)).startSizeZ;
			((MinMaxCurve)(ref startSizeZ)).constantMin = ((MinMaxCurve)(ref startSizeZ)).constantMin * 0.6f;
			((MinMaxCurve)(ref startSizeZ)).constantMax = ((MinMaxCurve)(ref startSizeZ)).constantMax * 0.8f;
			MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime;
			((MinMaxCurve)(ref startLifetime)).constantMin = 0.9f;
			((MinMaxCurve)(ref startLifetime)).constantMax = 1.1f;
			((Behaviour)val5.GetComponent<DestroyOnTimer>()).enabled = false;
			val5.transform.localPosition = Vector3.zero;
			val5.transform.localPosition = Vector3.zero;
			val5.transform.localScale = Vector3.one;
			ShapeModule shape = val5.GetComponent<ParticleSystem>().shape;
			((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0;
			((ShapeModule)(ref shape)).scale = Vector3.one * 0.5f;
			GameObject gameObject = ((Component)val4.Find("Point Light")).gameObject;
			Light component2 = gameObject.GetComponent<Light>();
			component2.color = new Color(1f, 0.5f, 0f);
			component2.intensity = 6f;
			component2.range = 12f;
			Assets.projectilePrefabs.Add(meatballNapalmPool);
		}

		internal static void QuickSection(Action callback, string category, string title = "Enable changes", string desc = "Refer to the Wiki page for info on changes.", bool defaultValue = true)
		{
			LastCategory = category;
			if (GetConfig(defaultValue, category, title, desc))
			{
				callback?.Invoke();
			}
		}

		internal static T QuickBind<T>(T defaultValue, string title, string desc = "")
		{
			return GetConfig(defaultValue, LastCategory, title, desc);
		}

		internal static T GetConfig<T>(T defaultValue, string category, string title, string desc = "")
		{
			return CustomConfigFile.Bind<T>(category, title, defaultValue, desc).Value;
		}

		private void InitializeConfig()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			CustomConfigFile = new ConfigFile(Paths.ConfigPath + "\\2R4R.cfg", true);
			CustomConfigFile.SaveOnConfigSet = false;
		}

		private void SaveConfig()
		{
			CustomConfigFile.SaveOnConfigSet = true;
			CustomConfigFile.Save();
		}

		private void InitializeCoreModules()
		{
			IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(CoreModule))
				select type;
			foreach (Type item in enumerable)
			{
				CoreModule coreModule = (CoreModule)Activator.CreateInstance(item);
				coreModule.Init();
				Debug.Log((object)("Core Module: " + coreModule?.ToString() + " Initialized!"));
			}
		}
	}
	public static class Extensions
	{
		public static T QuickBind<T>(this T defaultValue, string title, string desc = "")
		{
			return RiskierRainPlugin.QuickBind(defaultValue, title, desc);
		}

		public static string AsPercent(this float d)
		{
			return d * 100f + "%";
		}
	}
	public static class Tools
	{
		public static string modPrefix = string.Format("@{0}+{1}", "ArtificerExtended", "artiskillicons");

		public static AssetBundle LoadAssetBundle(byte[] resourceBytes)
		{
			if (resourceBytes == null)
			{
				throw new ArgumentNullException("resourceBytes");
			}
			return AssetBundle.LoadFromMemory(resourceBytes);
		}

		public static string GetModPrefix(this BaseUnityPlugin plugin, string bundleName)
		{
			return $"@{plugin.Info.Metadata.Name}+{bundleName}";
		}

		internal static bool isLoaded(string modguid)
		{
			foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos)
			{
				string key = pluginInfo.Key;
				PluginInfo value = pluginInfo.Value;
				if (key == modguid)
				{
					return true;
				}
			}
			return false;
		}

		internal static string ConvertDecimal(float d)
		{
			return d.AsPercent();
		}

		internal static void GetMaterial(GameObject model, string childObject, Color color, ref Material material, float scaleMultiplier = 1f, bool replaceAll = false)
		{
			//IL_0030: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Expected O, but got Unknown
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			Renderer[] componentsInChildren = model.GetComponentsInChildren<Renderer>();
			Renderer[] array = componentsInChildren;
			foreach (Renderer val in array)
			{
				Renderer val2 = val;
				if (string.Equals(((Object)val).name, childObject))
				{
					if (color == Color.clear)
					{
						Object.Destroy((Object)(object)val);
						break;
					}
					if ((Object)(object)material == (Object)null)
					{
						material = new Material(val.material);
						material.mainTexture = val.material.mainTexture;
						material.shader = val.material.shader;
						material.color = color;
					}
					val.material = material;
					Transform transform = ((Component)val).transform;
					transform.localScale *= scaleMultiplier;
					if (!replaceAll)
					{
						break;
					}
				}
			}
		}

		internal static void DebugMaterial(GameObject model)
		{
			Renderer[] componentsInChildren = model.GetComponentsInChildren<Renderer>();
			Renderer[] array = componentsInChildren;
			foreach (Renderer val in array)
			{
				Renderer val2 = val;
				Debug.Log((object)("Material: " + ((Object)val2).name.ToString()));
			}
		}

		internal static void GetParticle(GameObject model, string childObject, Color color, float sizeMultiplier = 1f, bool replaceAll = false)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			ParticleSystem[] componentsInChildren = model.GetComponentsInChildren<ParticleSystem>();
			ParticleSystem[] array = componentsInChildren;
			foreach (ParticleSystem val in array)
			{
				ParticleSystem val2 = val;
				MainModule main = val2.main;
				ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime;
				ColorBySpeedModule colorBySpeed = val2.colorBySpeed;
				if (string.Equals(((Object)val2).name, childObject))
				{
					((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(color);
					((MainModule)(ref main)).startSizeMultiplier = ((MainModule)(ref main)).startSizeMultiplier * sizeMultiplier;
					((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(color);
					((ColorBySpeedModule)(ref colorBySpeed)).color = MinMaxGradient.op_Implicit(color);
					if (!replaceAll)
					{
						break;
					}
				}
			}
		}

		internal static void DebugParticleSystem(GameObject model)
		{
			ParticleSystem[] components = model.GetComponents<ParticleSystem>();
			ParticleSystem[] array = components;
			foreach (ParticleSystem val in array)
			{
				ParticleSystem val2 = val;
				Debug.Log((object)("Particle: " + ((Object)val2).name.ToString()));
			}
		}

		internal static void GetLight(GameObject model, string childObject, Color color, bool replaceAll = false)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			Light[] componentsInChildren = model.GetComponentsInChildren<Light>();
			Light[] array = componentsInChildren;
			foreach (Light val in array)
			{
				Light val2 = val;
				if (string.Equals(((Object)val2).name, childObject))
				{
					val2.color = color;
					if (!replaceAll)
					{
						break;
					}
				}
			}
		}

		internal static void DebugLight(GameObject model)
		{
			Light[] componentsInChildren = model.GetComponentsInChildren<Light>();
			Light[] array = componentsInChildren;
			foreach (Light val in array)
			{
				Light val2 = val;
				Debug.Log((object)("Light: " + ((Object)val2).name.ToString()));
			}
		}

		public static void ClearDotStacksForType(this DotController dotController, DotIndex dotIndex)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			for (int num = dotController.dotStackList.Count - 1; num >= 0; num--)
			{
				if (dotController.dotStackList[num].dotIndex == dotIndex)
				{
					dotController.RemoveDotStackAtServer(num);
				}
			}
		}

		public static void LoadCharacterBodyAsync(string guid, Action<CharacterBody> callback)
		{
			//IL_0017: 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)
			AssetReferenceT<GameObject> val = new AssetReferenceT<GameObject>(guid);
			AsyncOperationHandle<GameObject> val2 = AssetAsyncReferenceManager<GameObject>.LoadAsset(val, (AsyncReferenceHandleUnloadType)2);
			val2.Completed += delegate(AsyncOperationHandle<GameObject> ctx)
			{
				GameObject result = ctx.Result;
				CharacterBody obj = default(CharacterBody);
				if (!((Object)(object)result == (Object)null) && result.TryGetComponent<CharacterBody>(ref obj))
				{
					callback(obj);
				}
			};
		}

		public static float GetStackValue(float baseValue, float stackValue, int itemCount)
		{
			return baseValue + stackValue * (float)(itemCount - 1);
		}

		public static int GetUniqueItemCountFromTag(Inventory inventory, ItemTag tag)
		{
			//IL_0015: 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)
			int num = 0;
			foreach (ItemIndex item in inventory.itemAcquisitionOrder)
			{
				if (ItemCatalog.GetItemDef(item).ContainsTag(tag))
				{
					num++;
				}
			}
			return num;
		}
	}
}
namespace RiskierRain.CoreModules
{
	public class Assets : CoreModule
	{
		public static AssetBundle _retierAssetBundle;

		public static string dropPrefabsPath = "Assets/Models/DropPrefabs";

		public static string iconsPath = "Assets/Textures/Icons/";

		public static string eliteMaterialsPath = "Assets/Textures/Materials/Elite/";

		public static List<ArtifactDef> artifactDefs = new List<ArtifactDef>();

		public static List<BuffDef> buffDefs = new List<BuffDef>();

		public static List<EffectDef> effectDefs = new List<EffectDef>();

		public static List<SkillFamily> skillFamilies = new List<SkillFamily>();

		public static List<SkillDef> skillDefs = new List<SkillDef>();

		public static List<GameObject> projectilePrefabs = new List<GameObject>();

		public static List<GameObject> networkedObjectPrefabs = new List<GameObject>();

		public static List<Type> entityStates = new List<Type>();

		public static List<ItemDef> itemDefs = new List<ItemDef>();

		public static List<EquipmentDef> equipDefs = new List<EquipmentDef>();

		public static List<EliteDef> eliteDefs = new List<EliteDef>();

		public static List<GameObject> masterPrefabs = new List<GameObject>();

		public static List<GameObject> bodyPrefabs = new List<GameObject>();

		public static string shredKeywordToken = "DUCK_SHRED_KEYWORD";

		public static BuffDef soulShrineLuckBuff;

		public static BuffDef voidCradleCurse;

		public static BuffDef shockMarker;

		public static int shockMarkerDuration = 4;

		public static BuffDef shockHealCooldown;

		public static float survivorExecuteThreshold = 0.15f;

		public static float banditExecutionThreshold = 0.1f;

		public static float harvestExecutionThreshold = 0.2f;

		public static BuffDef shatterspleenSpikeBuff;

		public static BuffDef noRazorwire;

		public static AssetBundle retierAssetBundle
		{
			get
			{
				if ((Object)(object)_retierAssetBundle == (Object)null)
				{
					_retierAssetBundle = AssetBundle.LoadFromFile(GetAssetBundlePath("retierrain"));
				}
				return _retierAssetBundle;
			}
			set
			{
				_retierAssetBundle = value;
			}
		}

		public static List<Material> MaterialsWithSwappedShaders { get; } = new List<Material>();

		public static string GetAssetBundlePath(string bundleName)
		{
			return Path.Combine(Path.GetDirectoryName(RiskierRainPlugin.PInfo.Location), bundleName);
		}

		public static bool RegisterEntityState(Type entityState)
		{
			if (entityStates.Contains(entityState) || !entityState.IsSubclassOf(typeof(EntityState)) || entityState.IsAbstract)
			{
				return false;
			}
			entityStates.Add(entityState);
			return true;
		}

		public static EffectDef CreateEffect(GameObject effect)
		{
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Expected O, but got Unknown
			if ((Object)(object)effect == (Object)null)
			{
				Debug.LogError((object)"Effect prefab was null");
				return null;
			}
			EffectComponent component = effect.GetComponent<EffectComponent>();
			if ((Object)(object)component == (Object)null)
			{
				Debug.LogErrorFormat("Effect prefab: \"{0}\" does not have an EffectComponent.", new object[1] { ((Object)effect).name });
				return null;
			}
			VFXAttributes component2 = effect.GetComponent<VFXAttributes>();
			if ((Object)(object)component2 == (Object)null)
			{
				Debug.LogErrorFormat("Effect prefab: \"{0}\" does not have a VFXAttributes component.", new object[1] { ((Object)effect).name });
				return null;
			}
			EffectDef val = new EffectDef
			{
				prefab = effect,
				prefabEffectComponent = component,
				prefabVfxAttributes = component2,
				prefabName = ((Object)effect).name,
				spawnSoundEventName = component.soundName
			};
			effectDefs.Add(val);
			return val;
		}

		public override void Init()
		{
			AddShatterspleenSpikeBuff();
			AddRazorwireCooldown();
			AddVoidCradleCurse();
			AddShockDebuff();
			AddShockCooldown();
			AddSoulShrineLuckBuff();
		}

		private void AddSoulShrineLuckBuff()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Expected O, but got Unknown
			BuffDef val = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/DLC2/bdExtraLifeBuff.asset").WaitForCompletion();
			soulShrineLuckBuff = ScriptableObject.CreateInstance<BuffDef>();
			soulShrineLuckBuff.buffColor = val.buffColor;
			soulShrineLuckBuff.canStack = true;
			soulShrineLuckBuff.isDebuff = val.isDebuff;
			soulShrineLuckBuff.flags = val.flags;
			((Object)soulShrineLuckBuff).name = "bdExtraLuckBuff";
			soulShrineLuckBuff.iconSprite = val.iconSprite;
			buffDefs.Add(soulShrineLuckBuff);
			StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(SoulShrineLuck);
		}

		private void SoulShrineLuck(CharacterBody sender, MoreStatHookEventArgs args)
		{
			int buffCount = sender.GetBuffCount(soulShrineLuckBuff);
			if (buffCount > 0)
			{
				args.luckAdd += (float)(buffCount * InteractableChanges.soulShrineLuckIncrease);
			}
		}

		private void AddVoidCradleCurse()
		{
			//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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			voidCradleCurse = ScriptableObject.CreateInstance<BuffDef>();
			voidCradleCurse.buffColor = Color.black;
			voidCradleCurse.canStack = false;
			voidCradleCurse.isDebuff = false;
			((Object)voidCradleCurse).name = "VoidCradleCurse";
			voidCradleCurse.iconSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/texBuffVoidFog.tif").WaitForCompletion();
			buffDefs.Add(voidCradleCurse);
		}

		private void AddShockDebuff()
		{
			//IL_0030: 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_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			shockMarker = ScriptableObject.CreateInstance<BuffDef>();
			((Object)shockMarker).name = "Shock";
			shockMarker.buffColor = new Color(0f, 0f, 0.6f);
			shockMarker.canStack = false;
			shockMarker.isDebuff = true;
			BuffDef obj = shockMarker;
			obj.flags = (Flags)(obj.flags | 1);
			shockMarker.isHidden = true;
			shockMarker.iconSprite = null;
			buffDefs.Add(shockMarker);
		}

		private void AddShockCooldown()
		{
			//IL_0030: 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)
			shockHealCooldown = ScriptableObject.CreateInstance<BuffDef>();
			((Object)shockHealCooldown).name = "Shock";
			shockHealCooldown.buffColor = new Color(0f, 0f, 0.6f);
			shockHealCooldown.canStack = true;
			shockHealCooldown.isDebuff = false;
			shockHealCooldown.isCooldown = true;
			shockHealCooldown.iconSprite = null;
			buffDefs.Add(shockHealCooldown);
		}

		private void AddShatterspleenSpikeBuff()
		{
			//IL_0024: 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)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			shatterspleenSpikeBuff = ScriptableObject.CreateInstance<BuffDef>();
			shatterspleenSpikeBuff.buffColor = new Color(0.7f, 0f, 0.2f, 1f);
			shatterspleenSpikeBuff.canStack = true;
			shatterspleenSpikeBuff.isDebuff = false;
			((Object)shatterspleenSpikeBuff).name = "ShatterspleenSpikeCharge";
			shatterspleenSpikeBuff.iconSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/LunarSkillReplacements/texBuffLunarDetonatorIcon.tif").WaitForCompletion();
			buffDefs.Add(shatterspleenSpikeBuff);
		}

		private void AddRazorwireCooldown()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: 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)
			noRazorwire = ScriptableObject.CreateInstance<BuffDef>();
			noRazorwire.buffColor = Color.black;
			noRazorwire.canStack = false;
			noRazorwire.isDebuff = true;
			BuffDef obj = noRazorwire;
			obj.flags = (Flags)(obj.flags | 1);
			((Object)noRazorwire).name = "NoRazorwire";
			noRazorwire.iconSprite = null;
			buffDefs.Add(noRazorwire);
		}

		public static void SwapShadersFromMaterialsInBundle(AssetBundle bundle)
		{
			if (bundle.isStreamedSceneAssetBundle)
			{
				Debug.LogWarning((object)"Cannot swap material shaders from a streamed scene assetbundle.");
				return;
			}
			Material[] array = (from mat in bundle.LoadAllAssets<Material>()
				where ((Object)mat.shader).name.StartsWith("Stubbed")
				select mat).ToArray();
			foreach (Material val in array)
			{
				if (!((Object)val.shader).name.StartsWith("Stubbed"))
				{
					Debug.LogWarning((object)$"The material {val} has a shader which's name doesnt start with \"Stubbed\" ({((Object)val.shader).name}), this is not allowed for stubbed shaders for MSU. not swapping shader.");
					continue;
				}
				try
				{
					SwapShader(val);
				}
				catch (Exception arg)
				{
					Debug.LogError((object)$"Failed to swap shader of material {val}: {arg}");
				}
			}
		}

		private static void SwapShader(Material material)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			string text = ((Object)material.shader).name.Substring("Stubbed".Length);
			string text2 = text + ".shader";
			Shader shader = Addressables.LoadAssetAsync<Shader>((object)text2).WaitForCompletion();
			material.shader = shader;
			MaterialsWithSwappedShaders.Add(material);
		}
	}
	internal class ContentPacks : IContentPackProvider
	{
		internal ContentPack contentPack = new ContentPack();

		public string identifier => "RiskierRain";

		public void Initialize()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders);
		}

		private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider)
		{
			addContentPackProvider.Invoke((IContentPackProvider)(object)this);
		}

		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			contentPack.identifier = identifier;
			contentPack.artifactDefs.Add(Assets.artifactDefs.ToArray());
			contentPack.buffDefs.Add(Assets.buffDefs.ToArray());
			contentPack.effectDefs.Add(Assets.effectDefs.ToArray());
			contentPack.equipmentDefs.Add(Assets.equipDefs.ToArray());
			contentPack.itemDefs.Add(Assets.itemDefs.ToArray());
			contentPack.eliteDefs.Add(Assets.eliteDefs.ToArray());
			contentPack.projectilePrefabs.Add(Assets.projectilePrefabs.ToArray());
			contentPack.bodyPrefabs.Add(Assets.bodyPrefabs.ToArray());
			contentPack.masterPrefabs.Add(Assets.masterPrefabs.ToArray());
			contentPack.entityStateTypes.Add(Assets.entityStates.ToArray());
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
		{
			ContentPack.Copy(contentPack, args.output);
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			args.ReportProgress(1f);
			yield break;
		}
	}
	public abstract class CoreModule
	{
		public abstract void Init();
	}
	public class EliteModule : CoreModule
	{
		public class CustomEliteDef : ScriptableObject
		{
			public EliteDef eliteDef;

			public EliteTiers eliteTier;

			public Color lightColor = Color.clear;

			public Texture eliteRamp;

			public Material overlayMaterial;

			public GameObject spawnEffect;
		}

		public enum EliteTiers
		{
			Tier1,
			Tier2,
			Other
		}

		public static List<CustomEliteDef> Elites = new List<CustomEliteDef>();

		public static Texture defaultShaderRamp = null;

		public override void Init()
		{
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(AddElites));
		}

		private static void AddElites()
		{
			foreach (CustomEliteDef elite in Elites)
			{
				switch (elite.eliteTier)
				{
				case EliteTiers.Tier1:
					ArrayUtils.ArrayAppend<EliteDef>(ref CombatDirector.eliteTiers[1].eliteTypes, ref elite.eliteDef);
					ArrayUtils.ArrayAppend<EliteDef>(ref CombatDirector.eliteTiers[2].eliteTypes, ref elite.eliteDef);
					break;
				case EliteTiers.Tier2:
					ArrayUtils.ArrayAppend<EliteDef>(ref CombatDirector.eliteTiers[3].eliteTypes, ref elite.eliteDef);
					break;
				}
			}
		}
	}
	internal static class Language
	{
		public static class Styling
		{
			public static string ConvertDecimal(float value)
			{
				return value * 100f + "%";
			}

			public static string DamageColor(string text)
			{
				return "<style=cIsDamage>" + text + "</style>";
			}

			public static string HealingColor(string text)
			{
				return "<style=cIsHealing>" + text + "</style>";
			}

			public static string DamageValueText(float value)
			{
				return DamageColor(value.AsPercent() + " damage");
			}

			public static string UtilityColor(string text)
			{
				return "<style=cIsUtility>" + text + "</style>";
			}

			public static string RedText(string text)
			{
				return HealthColor(text);
			}

			public static string HealthColor(string text)
			{
				return "<style=cIsHealth>" + text + "</style>";
			}

			public static string KeywordText(string keyword, string sub)
			{
				return "<style=cKeywordName>" + keyword + "</style><style=cSub>" + sub + "</style>";
			}

			public static string ScepterDescription(string desc)
			{
				return "\n<color=#d299ff>SCEPTER: " + desc + "</color>";
			}

			public static string VoidColor(string text)
			{
				return "<style=cIsVoid>" + text + "</style>";
			}

			public static string StackText(string text)
			{
				return StackColor("(" + text + " per stack)");
			}

			public static string StackColor(string text)
			{
				return "<style=cStack>" + text + "</style>";
			}

			public static string GetAchievementNameToken(string identifier)
			{
				return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_NAME";
			}

			public static string GetAchievementDescriptionToken(string identifier)
			{
				return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_DESCRIPTION";
			}

			public static string NumToAdj(int num)
			{
				return num switch
				{
					1 => num + "st", 
					2 => num + "nd", 
					3 => num + "rd", 
					_ => num + "th", 
				};
			}
		}

		public static string TokensOutput = "";

		public static bool usingLanguageFolder = false;

		public static bool printingEnabled = false;

		public static void Init()
		{
			if (usingLanguageFolder)
			{
				Language.collectLanguageRootFolders += Language_collectLanguageRootFolders;
			}
		}

		private static void Language_collectLanguageRootFolders(List<string> obj)
		{
			string text = Path.Combine(Path.GetDirectoryName(RiskierRainPlugin.PInfo.Location), "Language");
			if (Directory.Exists(text))
			{
				obj.Add(text);
			}
		}

		public static void Add(string token, string text)
		{
			if (!usingLanguageFolder)
			{
				LanguageAPI.Add(token, text);
			}
			if (printingEnabled)
			{
				TokensOutput = TokensOutput + "\n    \"" + token + "\" : \"" + text.Replace(Environment.NewLine, "\\n").Replace("\n", "\\n") + "\",";
			}
		}

		public static void TryPrintOutput(string fileName = "")
		{
			if (usingLanguageFolder && printingEnabled)
			{
				PrintOutput(fileName);
			}
		}

		public static void PrintOutput(string fileName = "")
		{
			if (printingEnabled)
			{
				string text = "{\n    strings:\n    {" + TokensOutput + "\n    }\n}";
				Debug.LogWarning((object)(fileName + ": \n" + text));
				if (!string.IsNullOrEmpty(fileName))
				{
					string path = Path.Combine(Directory.GetParent(RiskierRainPlugin.PInfo.Location).FullName, "Language", "en", fileName);
					File.WriteAllText(path, text);
				}
				TokensOutput = "";
			}
		}
	}
	public class Spawnlists : CoreModule
	{
		public override void Init()
		{
			SpawnCards.Init();
		}

		public static void AddMonsterCardToSpawnlist(DirectorCardCategorySelection categorySelection, DirectorCard directorCard, MonsterCategory monsterCategory)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Expected I4, but got Unknown
			categorySelection.AddCard((int)monsterCategory, directorCard);
		}
	}
	public static class SpawnCards
	{
		public static bool initialized;

		public static CharacterSpawnCard AlphaConstruct;

		public static CharacterSpawnCard Beetle;

		public static CharacterSpawnCard Lemurian;

		public static CharacterSpawnCard Larva;

		public static CharacterSpawnCard Wisp;

		public static CharacterSpawnCard Jellyfish;

		public static CharacterSpawnCard BlindPestSnowy;

		public static CharacterSpawnCard BlindVerminSnowy;

		public static CharacterSpawnCard Imp;

		public static CharacterSpawnCard Vulture;

		public static CharacterSpawnCard Golem;

		public static CharacterSpawnCard BeetleGuard;

		public static CharacterSpawnCard Mushrum;

		public static CharacterSpawnCard Bison;

		public static CharacterSpawnCard ClayApothecary;

		public static CharacterSpawnCard ElderLemurian;

		public static CharacterSpawnCard Parent;

		public static CharacterSpawnCard Gup;

		public static CharacterSpawnCard Bronzong;

		public static CharacterSpawnCard GreaterWisp;

		public static CharacterSpawnCard TitanBlackBeach;

		public static CharacterSpawnCard TitanDampCave;

		public static CharacterSpawnCard TitanGolemPlains;

		public static CharacterSpawnCard TitanGooLake;

		public static CharacterSpawnCard Vagrant;

		public static CharacterSpawnCard BeetleQueen;

		public static CharacterSpawnCard Dunestrider;

		public static CharacterSpawnCard MagmaWorm;

		public static CharacterSpawnCard ImpOverlord;

		public static CharacterSpawnCard Grovetender;

		public static CharacterSpawnCard RoboBall;

		public static CharacterSpawnCard XiConstruct;

		public static CharacterSpawnCard Grandparent;

		public static CharacterSpawnCard OverloadingWorm;

		public static CharacterSpawnCard solusInvalidator;

		public static CharacterSpawnCard solusScorcher;

		public static CharacterSpawnCard solusTransporter;

		public static CharacterSpawnCard solusExtractor;

		public static CharacterSpawnCard solusProspector;

		public static CharacterSpawnCard solusDistributor;

		public static CharacterSpawnCard solusAmalgamator;

		public static void Init()
		{
			//IL_001a: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: 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_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: 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_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Unknown result type (might be due to invalid IL or missing references)
			if (!initialized)
			{
				initialized = true;
				AlphaConstruct = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC1/MajorAndMinorConstruct/cscMinorConstruct.asset").WaitForCompletion();
				Beetle = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscbeetle");
				Lemurian = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/csclemurian");
				Wisp = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/csclesserwisp");
				Jellyfish = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscjellyfish");
				Imp = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscimp");
				Vulture = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscvulture");
				Golem = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/Base/Golem/cscGolem.asset").WaitForCompletion();
				BeetleGuard = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscbeetleguard");
				Mushrum = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscminimushroom");
				Bison = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/Base/Bison/cscBison.asset").WaitForCompletion();
				ElderLemurian = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/Base/LemurianBruiser/cscLemurianBruiser.asset").WaitForCompletion();
				Parent = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/Base/Parent/cscParent.asset").WaitForCompletion();
				Gup = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC1/Gup/cscGupBody.asset").WaitForCompletion();
				Bronzong = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscbell");
				GreaterWisp = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscgreaterwisp");
				TitanBlackBeach = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/csctitanblackbeach");
				TitanDampCave = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/csctitandampcave");
				TitanGolemPlains = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/csctitangolemplains");
				TitanGooLake = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/csctitangoolake");
				Vagrant = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscvagrant");
				BeetleQueen = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscbeetlequeen");
				Dunestrider = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscclayboss");
				MagmaWorm = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscmagmaworm");
				ImpOverlord = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscimpboss");
				Grovetender = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscgravekeeper");
				RoboBall = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscroboballboss");
				Grandparent = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/Base/Grandparent/cscGrandparent.asset").WaitForCompletion();
				OverloadingWorm = LegacyResourcesAPI.Load<CharacterSpawnCard>("spawncards/characterspawncards/cscelectricworm");
				BlindVerminSnowy = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC1/Vermin/cscVerminSnowy.asset").WaitForCompletion();
				BlindPestSnowy = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC1/FlyingVermin/cscFlyingVerminSnowy.asset").WaitForCompletion();
				ClayApothecary = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC1/ClayGrenadier/cscClayGrenadier.asset").WaitForCompletion();
				Larva = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC1/AcidLarva/cscAcidLarva.asset").WaitForCompletion();
				XiConstruct = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC1/MajorAndMinorConstruct/cscMegaConstruct.asset").WaitForCompletion();
				solusDistributor = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC3/MinePod/cscMinePod.asset").WaitForCompletion();
				solusExtractor = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC3/ExtractorUnit/cscExtractorUnit.asset ").WaitForCompletion();
				solusInvalidator = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC3/DefectiveUnit/cscDefectiveUnit.asset").WaitForCompletion();
				solusProspector = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC3/WorkerUnit/cscWorkerUnit.asset").WaitForCompletion();
				solusScorcher = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC3/Tanker/cscTanker.asset").WaitForCompletion();
				solusTransporter = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC3/IronHauler/cscIronHauler.asset").WaitForCompletion();
				solusAmalgamator = Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/DLC3/SolusAmalgamator/cscSolusAmalgamator.asset").WaitForCompletion();
				DirectorCards.Init();
			}
		}
	}
	public static class DirectorCards
	{
		public static bool initialized;

		public static DirectorCard AlphaConstruct;

		public static DirectorCard AlphaConstructNear;

		public static DirectorCard Beetle;

		public static DirectorCard Lemurian;

		public static DirectorCard Larva;

		public static DirectorCard Wisp;

		public static DirectorCard Jellyfish;

		public static DirectorCard BlindPestSnowy;

		public static DirectorCard BlindVerminSnowy;

		public static DirectorCard Imp;

		public static DirectorCard Vulture;

		public static DirectorCard Golem;

		public static DirectorCard BeetleGuard;

		public static DirectorCard Mushrum;

		public static DirectorCard ClayApothecary;

		public static DirectorCard Bison;

		public static DirectorCard BisonLoop;

		public static DirectorCard ElderLemurian;

		public static DirectorCard Parent;

		public static DirectorCard Gup;

		public static DirectorCard Bronzong;

		public static DirectorCard GreaterWisp;

		public static DirectorCard TitanBlackBeach;

		public static DirectorCard TitanDampCave;

		public static DirectorCard TitanGolemPlains;

		public static DirectorCard TitanGooLake;

		public static DirectorCard Vagrant;

		public static DirectorCard BeetleQueen;

		public static DirectorCard Dunestrider;

		public static DirectorCard MagmaWorm;

		public static DirectorCard ImpOverlord;

		public static DirectorCard Grovetender;

		public static DirectorCard RoboBall;

		public static DirectorCard Grandparent;

		public static DirectorCard OverloadingWorm;

		public static DirectorCard XiConstruct;

		public static DirectorCard LunarGolemSkyMeadow;

		public static DirectorCard LunarGolemSkyMeadowBasic;

		public static DirectorCard SolusInvalidator;

		public static DirectorCard SolusScorcher;

		public static DirectorCard SolusTransporter;

		public static DirectorCard SolusExtractor;

		public static DirectorCard SolusProspector;

		public static DirectorCard SolusDistributor;

		public static DirectorCard SolusAmalgamator;

		public static bool logCardInfo;

		public static void Init()
		{
			if (!initialized)
			{
				initialized = true;
				AlphaConstruct = BuildDirectorCard(SpawnCards.AlphaConstruct, 1, 1, (MonsterSpawnDistance)0);
				AlphaConstructNear = BuildDirectorCard(SpawnCards.AlphaConstruct, 1, 1, (MonsterSpawnDistance)1);
				Beetle = BuildDirectorCard(SpawnCards.Beetle);
				Lemurian = BuildDirectorCard(SpawnCards.Lemurian);
				Larva = BuildDirectorCard(SpawnCards.Larva);
				Wisp = BuildDirectorCard(SpawnCards.Wisp);
				Jellyfish = BuildDirectorCard(SpawnCards.Jellyfish, 1, 0, (MonsterSpawnDistance)2);
				BlindPestSnowy = BuildDirectorCard(SpawnCards.BlindPestSnowy);
				BlindVerminSnowy = BuildDirectorCard(SpawnCards.BlindVerminSnowy);
				Imp = BuildDirectorCard(SpawnCards.Imp);
				Vulture = BuildDirectorCard(SpawnCards.Vulture, 1, 3, (MonsterSpawnDistance)0);
				Golem = BuildDirectorCard(SpawnCards.Golem);
				BeetleGuard = BuildDirectorCard(SpawnCards.BeetleGuard);
				Mushrum = BuildDirectorCard(SpawnCards.Mushrum);
				ClayApothecary = BuildDirectorCard(SpawnCards.ClayApothecary);
				Bison = BuildDirectorCard(SpawnCards.Bison, 1, 2, (MonsterSpawnDistance)0);
				Bronzong = BuildDirectorCard(SpawnCards.Bronzong);
				GreaterWisp = BuildDirectorCard(SpawnCards.GreaterWisp);
				ElderLemurian = BuildDirectorCard(SpawnCards.ElderLemurian, 1, 3, (MonsterSpawnDistance)0);
				Parent = BuildDirectorCard(SpawnCards.Parent, 1, 3, (MonsterSpawnDistance)0);
				Gup = BuildDirectorCard(SpawnCards.Gup, 1, 3, (MonsterSpawnDistance)0);
				TitanBlackBeach = BuildDirectorCard(SpawnCards.TitanBlackBeach);
				TitanDampCave = BuildDirectorCard(SpawnCards.TitanDampCave);
				TitanGolemPlains = BuildDirectorCard(SpawnCards.TitanGolemPlains);
				TitanGooLake = BuildDirectorCard(SpawnCards.TitanGooLake);
				Vagrant = BuildDirectorCard(SpawnCards.Vagrant);
				BeetleQueen = BuildDirectorCard(SpawnCards.BeetleQueen);
				Dunestrider = BuildDirectorCard(SpawnCards.Dunestrider);
				ImpOverlord = BuildDirectorCard(SpawnCards.ImpOverlord, 1, 1, (MonsterSpawnDistance)0);
				Grovetender = BuildDirectorCard(SpawnCards.Grovetender);
				RoboBall = BuildDirectorCard(SpawnCards.RoboBall, 1, 3, (MonsterSpawnDistance)0);
				MagmaWorm = BuildDirectorCard(SpawnCards.MagmaWorm, 1, 2, (MonsterSpawnDistance)0);
				Grandparent = BuildDirectorCard(SpawnCards.Grandparent, 1, 2, (MonsterSpawnDistance)0);
				OverloadingWorm = BuildDirectorCard(SpawnCards.OverloadingWorm);
				XiConstruct = BuildDirectorCard(SpawnCards.XiConstruct, 1, 2, (MonsterSpawnDistance)0);
				SolusInvalidator = BuildDirectorCard(SpawnCards.solusInvalidator);
				SolusScorcher = BuildDirectorCard(SpawnCards.solusScorcher);
				SolusTransporter = BuildDirectorCard(SpawnCards.solusTransporter);
				SolusExtractor = BuildDirectorCard(SpawnCards.solusExtractor);
				SolusProspector = BuildDirectorCard(SpawnCards.solusProspector);
				SolusDistributor = BuildDirectorCard(SpawnCards.solusDistributor);
				SolusAmalgamator = BuildDirectorCard(SpawnCards.solusAmalgamator);
			}
		}

		public static DirectorCard BuildDirectorCard(CharacterSpawnCard spawnCard)
		{
			return BuildDirectorCard(spawnCard, 1, 0, (MonsterSpawnDistance)0);
		}

		public static DirectorCard BuildDirectorCard(CharacterSpawnCard spawnCard, int weight, int minStages, MonsterSpawnDistance spawnDistance)
		{
			//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_000d: 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_001b: 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_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			return new DirectorCard
			{
				spawnCard = (SpawnCard)(object)spawnCard,
				selectionWeight = weight,
				preventOverhead = false,
				minimumStageCompletions = minStages,
				spawnDistance = spawnDistance
			};
		}

		public static DirectorCard BuildDirectorCard(InteractableSpawnCard spawnCard, int weight, int minStages)
		{
			//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_000d: 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_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Expected O, but got Unknown
			return new DirectorCard
			{
				spawnCard = (SpawnCard)(object)spawnCard,
				selectionWeight = weight,
				preventOverhead = false,
				minimumStageCompletions = minStages
			};
		}
	}
	public class StatHooks : CoreModule
	{
		public class BorboStatHookEventArgs : EventArgs
		{
			public float attackSpeedMultAdd = 1f;

			public float attackSpeedDivAdd = 1f;
		}

		public delegate void StatHookEventHandler(CharacterBody sender, BorboStatHookEventArgs args);

		public static event StatHookEventHandler BorboStatCoefficients;

		public static void ApplyCooldownScale(GenericSkill skillSlot, float cooldownScale)
		{
			if ((Object)(object)skillSlot != (Object)null)
			{
				skillSlot.cooldownScale *= cooldownScale;
			}
		}

		public override void Init()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			CharacterBody.RecalculateStats += new hook_RecalculateStats(AttackSpeedBs);
		}

		private void AttackSpeedBs(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			BorboStatHookEventArgs e = new BorboStatHookEventArgs();
			StatHooks.BorboStatCoefficients?.Invoke(self, e);
			float num = e.attackSpeedMultAdd / e.attackSpeedDivAdd;
			self.attackSpeed *= num;
		}
	}
}
namespace RiskierRain.Components
{
	internal class CopyInventoryFromOwner : MonoBehaviour
	{
		public Func<ItemIndex, bool> inventoryItemCopyFilter = Inventory.defaultItemCopyFilterDelegate.Invoke;

		public bool copyInventory = true;

		public bool copyEquipment = true;

		public void Start()
		{
			CharacterMaster component = ((Component)this).gameObject.GetComponent<CharacterMaster>();
			MinionOwnership component2 = ((Component)this).gameObject.GetComponent<MinionOwnership>();
			if (!((Object)(object)component2 != (Object)null) || !((Object)(object)component != (Object)null))
			{
				return;
			}
			CharacterMaster ownerMaster = component2.ownerMaster;
			Inventory val = ((ownerMaster != null) ? ownerMaster.inventory : null);
			if (Object.op_Implicit((Object)(object)val))
			{
				if (copyEquipment)
				{
					component.inventory.CopyEquipmentFrom(val);
				}
				if (copyInventory)
				{
					component.inventory.CopyItemsFrom(val, inventoryItemCopyFilter);
				}
			}
		}
	}
	internal class InteractableBuffController : MonoBehaviour
	{
		private PurchaseInteraction _purchaseInteraction;

		public BuffDef buffDef;

		public float duration = -1f;

		public PurchaseInteraction purchaseInteraction
		{
			get
			{
				if (Object.op_Implicit((Object)(object)_purchaseInteraction))
				{
					return _purchaseInteraction;
				}
				_purchaseInteraction = ((Component)this).GetComponent<PurchaseInteraction>();
				return _purchaseInteraction;
			}
		}

		internal virtual void Start()
		{
			((UnityEvent<Interactor>)(object)purchaseInteraction.onPurchase).AddListener((UnityAction<Interactor>)OnPurchase);
		}

		private void OnPurchase(Interactor interactor)
		{
			if (!((Object)(object)buffDef == (Object)null))
			{
				CharacterBody component = ((Component)interactor).GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)component) && NetworkServer.active)
				{
					AddDebuff(component);
				}
			}
		}

		internal virtual void AddDebuff(CharacterBody interactorBody)
		{
			if (duration <= 0f)
			{
				interactorBody.AddBuff(buffDef);
			}
			else
			{
				interactorBody.AddTimedBuff(buffDef, duration);
			}
		}
	}
	internal class StatBuffer : MonoBehaviour
	{
		public int levelOffset = 0;

		public float levelDamage = 0f;

		public float levelAttackSpeed = 0f;

		public float levelMoveSpeed = 0f;

		public float levelShield = 0f;

		public float levelArmor = 0f;
	}
}
namespace RiskierRain.Changes
{
	public static class AllyChanges
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Func<Instruction, bool> <>9__2_0;

			public static Func<BaseState, float> <>9__2_1;

			public static Action<GameObject> <>9__5_0;

			public static hook_OnEnter <>9__9_0;

			public static hook_OnEnter <>9__13_0;

			internal bool <NerfHealingDroneScaling>b__2_0(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdfld<BaseState>(x, "damageStat");
			}

			internal float <NerfHealingDroneScaling>b__2_1(BaseState self)
			{
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Invalid comparison between Unknown and I4
				if ((Object)(object)((EntityState)self).characterBody == (Object)null || (Object)(object)((EntityState)self).characterBody.teamComponent == (Object)null || (int)((EntityState)self).characterBody.teamComponent.teamIndex != 1)
				{
					return self.damageStat;
				}
				float num = (float)(5 + TeamManager.instance.GetTeamLevel((TeamIndex)1)) / (float)(5 + Run.instance.ambientLevelFloor);
				return self.damageStat * num;
			}

			internal void <ChangeMegaDrone>b__5_0(GameObject prefab)
			{
				CharacterBody val = default(CharacterBody);
				if (prefab.TryGetComponent<CharacterBody>(ref val))
				{
					val.baseMaxHealth = megaDroneBaseMaxHealth;
					val.levelMaxHealth = val.baseMaxHealth * 0.3f;
					val.baseDamage = megaDroneBaseDamage;
					val.levelDamage = val.baseDamage * 0.2f;
					val.PerformAutoCalculateLevelStats();
				}
			}

			internal void <ChangeJunkDrone>b__9_0(orig_OnEnter orig, Surprise self)
			{
				Surprise.itemsToDropCoefficient = junkDroneDropCoefficient;
				Surprise.maxItemCount = junkDroneDropsMax;
				Surprise.extraItemsPerTier = junkDroneDropsPerTier;
				orig.Invoke(self);
			}

			internal void <ChangeCleanupDrone>b__13_0(orig_OnEnter orig, Cleanup self)
			{
				Cleanup.goldPackValue = cleanupValueGold;
				Cleanup.healthOrbFractionalHealing = cleanupValueHealFraction;
				Cleanup.healthOrbFlatHealing = cleanupValueHealFlat;
				orig.Invoke(self);
			}
		}

		public static float megaDroneBaseMaxHealth = 450f;

		public static float megaDroneBaseDamage = 10f;

		public static float junkDroneDropCoefficient = 1000f;

		public static int junkDroneDropsMax = 3;

		public static int junkDroneDropsPerTier = 1;

		public static int cleanupValueGold = 8;

		public static float cleanupValueHealFraction = 0.1f;

		public static float cleanupValueHealFlat = 0f;

		public static void Initialize()
		{
			RiskierRainPlugin.QuickSection(ChangeCleanupDrone, "Allies : Cleanup Drone");
			RiskierRainPlugin.QuickSection(ChangeJunkDrone, "Allies : Junk Drone");
			RiskierRainPlugin.QuickSection(ChangeMegaDrone, "Allies : TC-280 Prototype Drone");
			RiskierRainPlugin.QuickSection(ChangeHealingDrones, "Allies : Healing Drone");
		}

		private static void ChangeHealingDrones()
		{
			//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
			HealBeam.OnEnter += new Manipulator(NerfHealingDroneScaling);
			StartHealBeam.OnEnter += new Manipulator(NerfHealingDroneScaling);
		}

		private static void NerfHealingDroneScaling(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<BaseState>(x, "damageStat")
			}))
			{
				RiskierRainPlugin.DebugBreakpoint("NerfHealingDroneScaling");
				return;
			}
			val.Remove();
			val.EmitDelegate<Func<BaseState, float>>((Func<BaseState, float>)delegate(BaseState self)
			{
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Invalid comparison between Unknown and I4
				if ((Object)(object)((EntityState)self).characterBody == (Object)null || (Object)(object)((EntityState)self).characterBody.teamComponent == (Object)null || (int)((EntityState)self).characterBody.teamComponent.teamIndex != 1)
				{
					return self.damageStat;
				}
				float num = (float)(5 + TeamManager.instance.GetTeamLevel((TeamIndex)1)) / (float)(5 + Run.instance.ambientLevelFloor);
				return self.damageStat * num;
			});
		}

		private static void ChangeMegaDrone()
		{
			RiskierRainPlugin.LoadAsync<GameObject>(RoR2_Base_Drones.MegaDroneBody_prefab, (Action<GameObject>)delegate(GameObject prefab)
			{
				CharacterBody val = default(CharacterBody);
				if (prefab.TryGetComponent<CharacterBody>(ref val))
				{
					val.baseMaxHealth = megaDroneBaseMaxHealth;
					val.levelMaxHealth = val.baseMaxHealth * 0.3f;
					val.baseDamage = megaDroneBaseDamage;
					val.levelDamage = val.baseDamage * 0.2f;
					val.PerformAutoCalculateLevelStats();
				}
			});
		}

		private static void ChangeJunkDrone()
		{
			//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_0020: Expected O, but got Unknown
			object obj = <>c.<>9__9_0;
			if (obj == null)
			{
				hook_OnEnter val = delegate(orig_OnEnter orig, Surprise self)
				{
					Surprise.itemsToDropCoefficient = junkDroneDropCoefficient;
					Surprise.maxItemCount = junkDroneDropsMax;
					Surprise.extraItemsPerTier = junkDroneDropsPerTier;
					orig.Invoke(self);
				};
				<>c.<>9__9_0 = val;
				obj = (object)val;
			}
			Surprise.OnEnter += (hook_OnEnter)obj;
		}

		private static void ChangeCleanupDrone()
		{
			//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_0020: Expected O, but got Unknown
			object obj = <>c.<>9__13_0;
			if (obj == null)
			{
				hook_OnEnter val = delegate(orig_OnEnter orig, Cleanup self)
				{
					Cleanup.goldPackValue = cleanupValueGold;
					Cleanup.healthOrbFractionalHealing = cleanupValueHealFraction;
					Cleanup.healthOrbFlatHealing = cleanupValueHealFlat;
					orig.Invoke(self);
				};
				<>c.<>9__13_0 = val;
				obj = (object)val;
			}
			Cleanup.OnEnter += (hook_OnEnter)obj;
		}
	}
	public static class DifficultyChanges
	{
		public delegate bool orig_getHasOneShotProtection(CharacterBody self);

		public delegate float get_oneShotProtectionFraction(CharacterBody self);

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Action <>9__2_0;

			public static hook_Start <>9__2_3;

			public static hook_SetParticipantMasterId <>9__13_1;

			public static hook_OnControlEnd <>9__13_2;

			public static Func<Instruction, bool> <>9__41_0;

			public static Func<Instruction, bool> <>9__41_1;

			public static Func<Instruction, bool> <>9__41_2;

			public static Func<Instruction, bool> <>9__41_3;

			public static Func<Instruction, bool> <>9__41_4;

			public static Manipulator <>9__91_0;

			public static Manipulator <>9__91_1;

			public static Manipulator <>9__91_2;

			public static Manipulator <>9__91_3;

			public static Func<Instruction, bool> <>9__98_0;

			public static Func<Instruction, bool> <>9__98_2;

			public static Func<Instruction, bool> <>9__100_0;

			public static Func<Instruction, bool> <>9__102_0;

			public static Func<Instruction, bool> <>9__102_1;

			public static Func<Instruction, bool> <>9__102_2;

			public static Action<SceneDef> <>9__104_0;

			public static Action<SceneDef> <>9__104_1;

			public static Action<SceneDef> <>9__104_2;

			public static Func<Instruction, bool> <>9__123_1;

			public static Func<Instruction, bool> <>9__123_2;

			public static Func<Instruction, bool> <>9__123_3;

			public static Func<Instruction, bool> <>9__123_4;

			public static Func<Instruction, bool> <>9__123_5;

			public static Func<Instruction, bool> <>9__123_6;

			public static Func<Instruction, bool> <>9__123_8;

			public static Func<Instruction, bool> <>9__123_9;

			public static Func<Instruction, bool> <>9__123_10;

			public static Func<Instruction, bool> <>9__123_11;

			public static Func<Instruction, bool> <>9__123_12;

			public static Func<Instruction, bool> <>9__123_13;

			public static Func<float, float> <>9__123_14;

			internal void <Initialize>b__2_0()
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				CharacterBody.RecalculateStats += new hook_RecalculateStats(NoLevelUpHeal);
			}

			internal void <Initialize>b__2_3(orig_Start orig, MoneyPickup self)
			{
				if (NetworkServer.active)
				{
					self.goldReward = (self.shouldScale ? Run.instance.GetDifficultyScaledCost(self.baseGoldReward, Stage.instance.entryDifficultyCoefficient) : self.baseGoldReward);
				}
			}

			internal void <AddPotentialProtection>b__13_1(orig_SetParticipantMasterId orig, NetworkUIPromptController self, NetworkInstanceId newMasterObjectInstanceId)
			{
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				CharacterMaster currentParticipantMaster = self.currentParticipantMaster;
				orig.Invoke(self, newMasterObjectInstanceId);
				<AddPotentialProtection>g__PickupPickerPanelProtection|13_3(currentParticipantMaster, self.currentParticipantMaster);
			}

			internal void <AddPotentialProtection>b__13_2(orig_OnControlEnd orig, NetworkUIPromptController self)
			{
				orig.Invoke(self);
				self.ClearParticipant();
			}

			internal bool <DirectorCreditGainChanges>b__41_0(Instruction x)
			{
				float num = default(float);
				return ILPatternMatchingExt.MatchLdcR4(x, ref num);
			}

			internal bool <DirectorCreditGainChanges>b__41_1(Instruction x)
			{
				float num = default(float);
				return ILPatternMatchingExt.MatchLdcR4(x, ref num);
			}

			internal bool <DirectorCreditGainChanges>b__41_2(Instruction x)
			{
				float num = default(float);
				return ILPatternMatchingExt.MatchLdcR4(x, ref num);
			}

			internal bool <DirectorCreditGainChanges>b__41_3(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchStloc(x, ref num);
			}

			internal bool <DirectorCreditGainChanges>b__41_4(Instruction x)
			{
				float num = default(float);
				return ILPatternMatchingExt.MatchLdcR4(x, ref num);
			}

			internal void <ChangeEclipse>b__91_0(ILContext ctx)
			{
				RemoveEclipseEffect(ctx, "E1");
			}

			internal void <ChangeEclipse>b__91_1(ILContext ctx)
			{
				RemoveEclipseEffect(ctx, "E3");
			}

			internal void <ChangeEclipse>b__91_2(ILContext ctx)
			{
				RemoveEclipseEffect(ctx, "E5");
			}

			internal void <ChangeEclipse>b__91_3(ILContext ctx)
			{
				RemoveEclipseEffect(ctx, "E6");
			}

			internal bool <ChangeRequiredDifficultyLevelForStats>b__98_0(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "get_selectedDifficulty");
			}

			internal bool <ChangeRequiredDifficultyLevelForStats>b__98_2(Instruction x)
			{
				float num = default(float);
				return ILPatternMatchingExt.MatchLdcR4(x, ref num);
			}

			internal bool <RemoveEclipseEffect>b__100_0(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "get_selectedDifficulty");
			}

			internal bool <EclipseHoldoutScale>b__102_0(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "get_selectedDifficulty");
			}

			internal bool <EclipseHoldoutScale>b__102_1(Instruction x)
			{
				int num = default(int);
				return ILPatternMatchingExt.MatchLdcI4(x, ref num);
			}

			internal bool <EclipseHoldoutScale>b__102_2(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<HealthComponent>(x, "get_fullHealth");
			}

			internal void <FreezeDifficultyScalingOnFinalLevels>b__104_0(SceneDef meridian)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				meridian.sceneType = (SceneType)4;
			}

			internal void <FreezeDifficultyScalingOnFinalLevels>b__104_1(SceneDef shaunt)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				shaunt.sceneType = (SceneType)4;
			}

			internal void <FreezeDifficultyScalingOnFinalLevels>b__104_2(SceneDef champrush)
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				champrush.sceneType = (SceneType)4;
			}

			internal bool <AmbientLevelChanges>b__123_1(Instruction x)
			{
				float num = default(float);
				return ILPatternMatchingExt.MatchLdcR4(x, ref num);
			}

			internal bool <AmbientLevelChanges>b__123_2(Instruction x)
			{
				return ILPatternMatchingExt.MatchMul(x);
			}

			internal bool <AmbientLevelChanges>b__123_3(Instruction x)
			{
				return ILPatternMatchingExt.MatchCallOrCallvirt<Mathf>(x, "Floor");
			}

			internal bool <AmbientLevelChanges>b__123_4(Instruction x)
			{
				float num = default(float);
				return ILPatternMatchingExt.MatchLdcR4(x, ref num);
			}

			internal bool <AmbientLevelChanges>b__123_5(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdarg(x, 0);
			}

			internal bool <AmbientLevelChanges>b__123_6(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdfld<Run>(x, "stageClearCount");
			}

			internal bool <AmbientLevelChanges>b__123_8(Instruction x)
			{
				float num = default(float);
				return ILPatternMatchingExt.MatchLdcR4(x, ref num);
			}

			internal bool <AmbientLevelChanges>b__123_9(Instruction x)
			{
				return ILPatternMatchingExt.MatchMul(x);
			}

			internal bool <AmbientLevelChanges>b__123_10(Instruction x)
			{
				float num = default(float);
				return ILPatternMatchingExt.MatchLdcR4(x, ref num);
			}

			internal bool <AmbientLevelChanges>b__123_11(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdarg(x, 0);
			}

			internal bool <AmbientLevelChanges>b__123_12(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdfld<Run>(x, "stageClearCount");
			}

			internal bool <AmbientLevelChanges>b__123_13(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdsfld<Run>(x, "ambientLevelCap");
			}

			internal float <AmbientLevelChanges>b__123_14(float levelIn)
			{
				float ambientLevelBoost = GetAmbientLevelBoost();
				return levelIn + ambientLevelBoost;
			}
		}

		public static string Tier2EliteName = "Rare";

		public static bool potentialProtectionVisibility = true;

		public static bool potentialProtectionLimitedTime = false;

		public static float potentialProtectionDurationUnlimited = 0.5f;

		public static float potentialProtectionDurationLimited = 4f;

		public static bool pityChargeOn = false;

		public static float pityChargeShrinkDelta = 0f;

		public static float pityChargeRecolorDelta = 0f;

		public static float playerSpawnRateFactor = 0.5f;

		public static float difficultySpawnRateFactor = 0.4f;

		public static float fastDirectorEliteBias = 0.75f;

		public static float fastDirectorCreditMultiplier = 0.75f;

		public static float slowDirectorEliteBias = 0.5f;

		public static float slowDirectorCreditMultiplier = 1f;

		public static float teleLesserEliteBias = 0.5f;

		public static float teleLesserCreditMultiplier = 0.8f;

		public static float teleBossEliteBias = 1f;

		public static float teleBossCreditMultiplier = 1f;

		public static float teleBossCreditMultiplierStage1 = 0.5f;

		public static float monsterCreditsMultiplier = 1f;

		public static float drizzleDifficultyBoost = 0f;

		public static float rainstormDifficultyBoost = 0f;

		public static float monsoonDifficultyBoost = 3f;

		public static float eclipseDifficultyBoost = 6f;

		public static int ambientLevelCapDrizzle = 99;

		public static int ambientLevelCap = 999;

		public static float easyTeleParticleRadius = 1f;

		public static float normalTeleParticleRadius = 0.8f;

		public static float hardTeleParticleRadius = 0.4f;

		public static float eclipseTeleParticleRadius = 0.4f;

		public static float defaultTeleParticleRadius = 0.9f;

		public static int Tier2EliteMinimumStageDefault = 6;

		public static int Tier2EliteMinimumStageDrizzle = 11;

		public static int Tier2EliteMinimumStageRainstorm = 6;

		public static int Tier2EliteMinimumStageMonsoon = 4;

		public static int Tier2EliteMinimumStageEclipse = 4;

		public static DifficultyIndex eclipseLevelBoss