Decompiled source of EclipseRefurbished v1.0.5

EclipseRefurbished.dll

Decompiled a month ago
using System;
using System.Diagnostics;
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 BepInEx.Logging;
using HG.Reflection;
using IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using R2API;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("EclipseRefurbished")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("EclipseRefurbished")]
[assembly: AssemblyTitle("EclipseRefurbished")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ExamplePlugin
{
	internal static class Log
	{
		private static ManualLogSource _logSource;

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

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

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

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

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

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

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
}
namespace EclipseRefurbished
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Puporongod.EclipseRefurbished", "EclipseRefurbished", "1.0.5")]
	public class EclipseRefurbished : BaseUnityPlugin
	{
		public const string PluginGUID = "Pupi.EclipseRefurbished";

		public const string PluginAuthor = "Pupi";

		public const string PluginName = "EclipseRefurbished";

		public const string PluginVersion = "1.0.5";

		public static BodyIndex AWUBody = BodyCatalog.FindBodyIndex("SuperRoboBallBossBody");

		public static ConfigEntry<float> directorBoost;

		public static ConfigEntry<float> directorBoostEarly;

		public static ConfigEntry<float> directorBoostGilded;

		public static ConfigEntry<float> directorBoostGildedEarly;

		public static ConfigEntry<float> NewE4Modifier;

		public static ConfigEntry<bool> NewE4ModifierVoid;

		public static ConfigEntry<float> NewE6Modifier;

		public static ConfigEntry<float> E1Modifier;

		public static ConfigEntry<float> E2Modifier;

		public static ConfigEntry<float> E5Modifier;

		public static ConfigEntry<float> E6Modifier;

		public static ConfigEntry<bool> E7ModifierVoid;

		public static ConfigEntry<bool> difficultyComparison;

		public static bool RoOEnabled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");

		private static ConfigFile ERFBConfig { get; set; }

		public void Awake()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			SetupConfig();
			if (RoOEnabled)
			{
				SetupRoO();
			}
			else
			{
				Debug.Log((object)"EclipseRefurbished: no risk of options detected");
			}
			IncreaseScaling();
			ChangeDescriptions();
			CombatDirector.OnEnable += new hook_OnEnable(CombatDirector_OnEnable);
			CharacterMaster.OnBodyStart += new Manipulator(TweakE1Modifier);
			HoldoutZoneController.DoUpdate += new Manipulator(TweakE2Modifier);
			HealthComponent.Heal += new Manipulator(TweakE5Modifier);
			DeathRewards.OnKilledServer += new Manipulator(RemoveE6Modifier);
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(ATKSpeedAndAWUCooldown);
		}

		private void Update()
		{
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Expected O, but got Unknown
			if (Object.op_Implicit((Object)(object)Run.instance) && difficultyComparison.Value && Input.GetKeyDown((KeyCode)286))
			{
				float num = Run.instance.participatingPlayerCount;
				float num2 = Mathf.Pow(num, 0.2f);
				float num3 = 0.7f + num * 0.3f;
				float runStopwatch = Run.instance.GetRunStopwatch();
				float num4 = Mathf.Floor(runStopwatch * (1f / 60f));
				float num5 = 0.1518f * num2;
				float num6 = Mathf.Pow(1.15f, (float)Run.instance.stageClearCount);
				float num7 = (num3 + num4 * num5) * num6;
				float num8 = (num3 + (num4 + 5f) * num5) * num6;
				float num9 = (num3 + (num4 + 10f) * num5) * num6;
				float num10 = (num3 + (num4 + 15f) * num5) * num6;
				float num11 = (num3 + runStopwatch / 60f * num5) * num6;
				float num12 = (num3 + (runStopwatch + 300f) / 60f * num5) * num6;
				float num13 = (num3 + (runStopwatch + 600f) / 60f * num5) * num6;
				float num14 = (num3 + (runStopwatch + 900f) / 60f * num5) * num6;
				float num15 = Mathf.Min((num11 - num3) / 0.33f + 1f, (float)Run.ambientLevelCap);
				float num16 = Mathf.Min((num12 - num3) / 0.33f + 1f, (float)Run.ambientLevelCap);
				float num17 = Mathf.Min((num13 - num3) / 0.33f + 1f, (float)Run.ambientLevelCap);
				float num18 = Mathf.Min((num14 - num3) / 0.33f + 1f, (float)Run.ambientLevelCap);
				Debug.Log((object)("------\nPlayers:" + num + "\nRun time (seconds):" + runStopwatch + "\nRun Time (minutes):" + num4 + "\nStage Factor:" + num6));
				Debug.Log((object)("------\nCoeff comparison: " + num7 + Run.instance.difficultyCoefficient + "\nMonsoon level: " + num15 + Run.instance.ambientLevel));
				SimpleChatMessage val = new SimpleChatMessage();
				val.baseToken = "-------\nMonsoon Coeff: " + num7.ToString("0.00") + " | Ambient Level: " + num15.ToString("0.00") + "\nMS+5 Coeff:    " + num8.ToString("0.00") + " | Ambient Level: " + num16.ToString("0.00") + "\nMS+10 Coeff:   " + num9.ToString("0.00") + " | Ambient Level: " + num17.ToString("0.00") + "\nMS+15 Coeff:   " + num10.ToString("0.00") + " | Ambient Level: " + num18.ToString("0.00") + "\nCurrent Coeff: " + Run.instance.difficultyCoefficient.ToString("0.00") + " | Ambient Level: " + Run.instance.ambientLevel.ToString("0.00");
				Chat.SendBroadcastChat((ChatMessageBase)(object)val);
			}
		}

		private void SetupConfig()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			ERFBConfig = new ConfigFile(Paths.ConfigPath + "\\com.Puporongod.EclipseRefurbished.cfg", true);
			directorBoost = ERFBConfig.Bind<float>("Director credits", "General credit boost multiplier", 1.15f, "Default for ER is 1.15 \n What to multiply director credits by? (entire run except Gilded Coast).\nVanilla total multiplier is 1 (none)\n\nApplies on stage load");
			directorBoostEarly = ERFBConfig.Bind<float>("Director credits", "Stages 1 and 2 extra additive", 0.2f, "Default for ER is 0.3 \nAn additive increase to credit multiplier (for S1 and S2).\nStacks additively with the above value forming the final multiplier for S1-2. Vanilla total multiplier is 1 (none)\n\nApplies on stage load");
			directorBoostGilded = ERFBConfig.Bind<float>("Director credits", "General Gilded Coast multiplier", 1.15f, "Default for ER is 1.15 \nWhat to multiply director credits by? (Gilded Coast, entire run).\nOnly applies to Gilded Coast. Vanilla total multiplier is 1 (none)\n\nApplies on stage load");
			directorBoostGildedEarly = ERFBConfig.Bind<float>("Director credits", "Stages 1 and 2 Gilded Coast extra additive", 0.25f, "Default for ER is 0.3 \nAn additive increase to credit multiplier (Gilded Coast S1-2).\nStacks additively with the above value forming the final multiplier for GC S1-2. Vanilla total multiplier is 1 (none)\n\nApplies on stage load");
			NewE4Modifier = ERFBConfig.Bind<float>("New eclipse modifiers", "E4- Enemies have +% attack speed", 0.25f, "Default for ER is 0.25 \nWhat to add to enemy attack speed factor (which starts at 1.00=100%) on E4.\nVanilla default is 0\n\nApplies in real-time.");
			NewE4ModifierVoid = ERFBConfig.Bind<bool>("New eclipse modifiers", "Should E4 apply to void enemies?", true, "Default for ER is true \nIn vanilla, void enemies do not obtain the benefits of E4 (speed and atk speed) as they exist on a different team that is not modified\n\nApplies in real-time.");
			NewE6Modifier = ERFBConfig.Bind<float>("New eclipse modifiers", "E6- Scaling difficulty", 3.6f, "Default for ER is 3.6 \nValue used for run difficulty on E6+.\nVanilla default depends on difficulty (1-drizzle, 2-rainstorm, 3-monsoon/eclipse)\n\nRequires restart to apply");
			E1Modifier = ERFBConfig.Bind<float>("Vanilla eclipse modifiers", "E1-Ally starting health percent", 0.75f, "Default for ER is 0.75 \nWhat to multiply starting health by.\nVanilla default is 0.5\n\nRequires restart to apply");
			E2Modifier = ERFBConfig.Bind<float>("Vanilla eclipse modifiers", "E2-Holdout zone radius percent", 0.65f, "Default for ER is 0.65 \nWhat to multiply holdout zone radius by.\nVanilla default is 0.75\n\nRequires restart to apply");
			E5Modifier = ERFBConfig.Bind<float>("Vanilla eclipse modifiers", "E5-Ally healing", 1.5f, "Default for ER is 1.5 \nEntered value is what to divide healing received by, for example 4 will mean healing is only 1/4 or 25% as effective.\nVanilla default is 2\n\nRequires restart to apply");
			E6Modifier = ERFBConfig.Bind<float>("Vanilla eclipse modifiers", "E6-Enemy gold drops", 1f, "Default for ER is 1 \nWhat to multiply enemy gold rewards by.\nVanilla default is 0.8\n\nRequires restart to apply");
			E7ModifierVoid = ERFBConfig.Bind<bool>("Vanilla eclipse modifiers", "Should E7 apply to void enemies?", true, "Default for ER is true \nIn vanilla, void enemies do not obtain the benefits of E7 (-50% cooldown reduction) as they exist on a different team that is not modified\n\nApplies in real-time.");
			difficultyComparison = ERFBConfig.Bind<bool>("ZDebug", "Enable coeff and level comparison print", false, "If enabled, pressing F5 during a run will print a comparison between current difficulty coeff and monsoon, monsoon+5mins, monsoon+10 and monsoon+15 to chat");
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private void SetupRoO()
		{
			//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_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			//IL_0031: 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_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Expected O, but got Unknown
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Expected O, but got Unknown
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Expected O, but got Unknown
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Expected O, but got Unknown
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Expected O, but got Unknown
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Expected O, but got Unknown
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Expected O, but got Unknown
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Expected O, but got Unknown
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Expected O, but got Unknown
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Expected O, but got Unknown
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Expected O, but got Unknown
			//IL_0151: 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_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Expected O, but got Unknown
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Expected O, but got Unknown
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Expected O, but got Unknown
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Expected O, but got Unknown
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Expected O, but got Unknown
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Expected O, but got Unknown
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Expected O, but got Unknown
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new SliderOption(directorBoost, (SliderConfig)new StepSliderConfig
			{
				min = 0.1f,
				max = 5f
			}));
			ModSettingsManager.AddOption((BaseOption)new SliderOption(directorBoostEarly, (SliderConfig)new StepSliderConfig
			{
				min = 0.1f,
				max = 5f
			}));
			ModSettingsManager.AddOption((BaseOption)new SliderOption(directorBoostGilded, (SliderConfig)new StepSliderConfig
			{
				min = 0.1f,
				max = 5f
			}));
			ModSettingsManager.AddOption((BaseOption)new SliderOption(directorBoostGildedEarly, (SliderConfig)new StepSliderConfig
			{
				min = 0.1f,
				max = 5f
			}));
			ModSettingsManager.AddOption((BaseOption)new SliderOption(NewE4Modifier, (SliderConfig)new StepSliderConfig
			{
				min = 0f,
				max = 3f
			}));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(NewE4ModifierVoid));
			ModSettingsManager.AddOption((BaseOption)new SliderOption(NewE6Modifier, (SliderConfig)new StepSliderConfig
			{
				min = 1f,
				max = 6f,
				restartRequired = true
			}));
			ModSettingsManager.AddOption((BaseOption)new SliderOption(E1Modifier, (SliderConfig)new StepSliderConfig
			{
				min = 0.1f,
				max = 1f,
				restartRequired = true
			}));
			ModSettingsManager.AddOption((BaseOption)new SliderOption(E2Modifier, (SliderConfig)new StepSliderConfig
			{
				min = 0.1f,
				max = 3f,
				restartRequired = true
			}));
			ModSettingsManager.AddOption((BaseOption)new SliderOption(E5Modifier, (SliderConfig)new StepSliderConfig
			{
				min = 1f,
				max = 5f,
				restartRequired = true
			}));
			ModSettingsManager.AddOption((BaseOption)new SliderOption(E6Modifier, (SliderConfig)new StepSliderConfig
			{
				min = 0.1f,
				max = 3f,
				restartRequired = true
			}));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(E7ModifierVoid));
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(difficultyComparison));
		}

		private void ATKSpeedAndAWUCooldown(CharacterBody sender, StatHookEventArgs args)
		{
			//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_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Invalid comparison between Unknown and I4
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Invalid comparison between Unknown and I4
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Invalid comparison between Unknown and I4
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Invalid comparison between Unknown and I4
			//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)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Invalid comparison between Unknown and I4
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Invalid comparison between Unknown and I4
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Invalid comparison between Unknown and I4
			BodyIndex val = BodyCatalog.FindBodyIndex("SuperRoboBallBossBody");
			if ((int)Run.instance.selectedDifficulty >= 6 && Object.op_Implicit((Object)(object)sender.teamComponent) && (int)sender.teamComponent.teamIndex != 1)
			{
				args.attackSpeedMultAdd = NewE4Modifier.Value;
				if ((int)Run.instance.selectedDifficulty >= 9 && sender.bodyIndex == val)
				{
					args.specialCooldownMultAdd = 0.4f;
				}
				if (NewE4ModifierVoid.Value && (int)sender.teamComponent.teamIndex != 1 && (int)sender.teamComponent.teamIndex != 2)
				{
					args.moveSpeedMultAdd = 0.4f;
				}
			}
			if ((int)Run.instance.selectedDifficulty >= 9 && E7ModifierVoid.Value && Object.op_Implicit((Object)(object)sender.teamComponent) && (int)sender.teamComponent.teamIndex != 1 && (int)sender.teamComponent.teamIndex != 2)
			{
				args.cooldownMultAdd = -0.5f;
			}
		}

		private void IncreaseScaling()
		{
			DifficultyCatalog.GetDifficultyDef((DifficultyIndex)8).scalingValue = NewE6Modifier.Value;
			DifficultyCatalog.GetDifficultyDef((DifficultyIndex)9).scalingValue = NewE6Modifier.Value;
			DifficultyCatalog.GetDifficultyDef((DifficultyIndex)10).scalingValue = NewE6Modifier.Value;
		}

		private void TweakE1Modifier(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.MatchLdcR4(x, 0.5f)
			}))
			{
				val.Next.Operand = E1Modifier.Value;
			}
			else
			{
				Debug.LogError((object)"EclipseRefurbished: TweakE1Modifier IL Hook failed");
			}
		}

		private void TweakE2Modifier(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.MatchLdcR4(x, 0.5f)
			}))
			{
				val.Next.Operand = E2Modifier.Value;
			}
			else
			{
				Debug.LogError((object)"EclipseRefurbished: TweakE2Modifier IL Hook failed");
			}
		}

		private void TweakE5Modifier(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);
			val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 2f)
			});
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 2f)
			}))
			{
				val.Next.Operand = E5Modifier.Value;
			}
			else
			{
				Debug.LogError((object)"EclipseRefurbished: TweakE5Modifier IL Hook failed");
			}
		}

		private void RemoveE6Modifier(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.MatchLdcR4(x, 0.8f)
			}))
			{
				val.Next.Operand = E6Modifier.Value;
			}
			else
			{
				Debug.LogError((object)"EclipseRefurbished: RemoveE6Modifier IL Hook failed");
			}
		}

		private void CombatDirector_OnEnable(orig_OnEnable orig, CombatDirector self)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Invalid comparison between Unknown and I4
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)Run.instance) || (int)Run.instance.selectedDifficulty < 3)
			{
				return;
			}
			DirectorMoneyWave[] moneyWaves = self.moneyWaves;
			if (moneyWaves == null || moneyWaves.Length == 0)
			{
				return;
			}
			DirectorMoneyWave[] array = moneyWaves;
			foreach (DirectorMoneyWave val in array)
			{
				if ((Object)(object)SceneCatalog.mostRecentSceneDef == (Object)(object)SceneCatalog.GetSceneDefFromSceneName("goldshores"))
				{
					float num = 0f;
					num += directorBoostGilded.Value;
					if (Run.instance.stageClearCount <= 1)
					{
						num += directorBoostGildedEarly.Value;
					}
					val.multiplier *= num;
					continue;
				}
				float num2 = 0f;
				num2 += directorBoost.Value;
				if (Run.instance.stageClearCount <= 1)
				{
					num2 += directorBoostEarly.Value;
				}
				if (((Object)self).name.Equals("Teleporter1(Clone)"))
				{
					val.multiplier *= Mathf.Max(num2 / 2f, 1f);
				}
				else
				{
					val.multiplier *= num2;
				}
			}
		}

		private void ChangeDescriptions()
		{
			string text = "Starts at baseline Monsoon difficulty\n";
			string text2 = "Director Credits: *(" + directorBoost.Value + "+(" + directorBoostEarly.Value + ")) |GC:  *(" + directorBoostGilded.Value + "+(" + directorBoostGildedEarly.Value + "))\n";
			string text3 = "<mspace=0.5em>(1)</mspace> Ally Starting health: <style=cIsHealth>" + E1Modifier.Value * 100f + "%</style></style>\n";
			string text4 = "<mspace=0.5em>(2)</mspace> Teleporter Radius: <style=cIsHealth>" + E2Modifier.Value * 100f + "%</style></style>\n";
			string text5 = "<mspace=0.5em>(3)</mspace> Ally Fall Damage: <style=cIsHealth>+100% and lethal</style></style>\n";
			string text6 = "<mspace=0.5em>(4)</mspace> Enemies: <style=cIsHealth>+40% Speed, +" + NewE4Modifier.Value * 100f + "% ATK Speed</style></style>\n";
			string text7 = "<mspace=0.5em>(5)</mspace> Ally Healing: <style=cIsHealth>" + (1f / E5Modifier.Value * 100f - 100f) + "%</style></style>\n";
			string text8 = "<mspace=0.5em>(6)</mspace> Difficulty Scaling: <style=cIsHealth>" + NewE6Modifier.Value + " </style></style> Enemy $ Drops:<style=cIsHealth> " + E6Modifier.Value * 100f + "%</style></style>\n";
			string text9 = "<mspace=0.5em>(7)</mspace> Enemy Cooldowns: <style=cIsHealth>-50% (AWU Shield only -30%)</style></style>\n";
			string text10 = "<mspace=0.5em>(8)</mspace> Allies recieve <style=cIsHealth>permanent damage</style></style>\n";
			string text11 = "You only celebrate in the light... because I allow it.\n";
			LanguageAPI.Add("ECLIPSE_1_DESCRIPTION", text + text2 + text3);
			LanguageAPI.Add("ECLIPSE_2_DESCRIPTION", text + text2 + text3 + text4);
			LanguageAPI.Add("ECLIPSE_3_DESCRIPTION", text + text2 + text3 + text4 + text5);
			LanguageAPI.Add("ECLIPSE_4_DESCRIPTION", text + text2 + text3 + text4 + text5 + text6);
			LanguageAPI.Add("ECLIPSE_5_DESCRIPTION", text + text2 + text3 + text4 + text5 + text6 + text7);
			LanguageAPI.Add("ECLIPSE_6_DESCRIPTION", text + text2 + text3 + text4 + text5 + text6 + text7 + text8);
			LanguageAPI.Add("ECLIPSE_7_DESCRIPTION", text + text2 + text3 + text4 + text5 + text6 + text7 + text8 + text9);
			LanguageAPI.Add("ECLIPSE_8_DESCRIPTION", text11 + text + text2 + text3 + text4 + text5 + text6 + text7 + text8 + text9 + text10);
		}
	}
}