Decompiled source of WolfoQoL Gameplay v1.1.0

WolfoQoL_Gameplay.dll

Decompiled 3 weeks ago
using System;
using System.Collections.Generic;
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.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Chef;
using EntityStates.Commando;
using EntityStates.Drone;
using EntityStates.FalseSon;
using EntityStates.Loader;
using EntityStates.LunarTeleporter;
using EntityStates.Mage;
using EntityStates.Merc;
using EntityStates.VoidSurvivor;
using IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates;
using On.EntityStates.Chef;
using On.EntityStates.Commando;
using On.EntityStates.Drone;
using On.EntityStates.FalseSon;
using On.EntityStates.Loader;
using On.EntityStates.LunarTeleporter;
using On.EntityStates.Mage;
using On.EntityStates.Merc;
using On.EntityStates.VoidSurvivor;
using On.RoR2;
using On.RoR2.UI;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Navigation;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("WolfoQoL_Gameplay")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+2f03293127b4e16fd4eb54608c354503fa695d05")]
[assembly: AssemblyProduct("WolfoQoL_Gameplay")]
[assembly: AssemblyTitle("WolfoQoL_Gameplay")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: UnverifiableCode]
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 WQoL_Gameplay
{
	public class Eclipse
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_OverrideRuleChoices <0>__AllowCertainEclipseArtifacts;

			public static Manipulator <1>__EclipseRun_DontRemoveArtifacts;
		}

		public static void Start()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			object obj = <>O.<0>__AllowCertainEclipseArtifacts;
			if (obj == null)
			{
				hook_OverrideRuleChoices val = AllowCertainEclipseArtifacts;
				<>O.<0>__AllowCertainEclipseArtifacts = val;
				obj = (object)val;
			}
			EclipseRun.OverrideRuleChoices += (hook_OverrideRuleChoices)obj;
			object obj2 = <>O.<1>__EclipseRun_DontRemoveArtifacts;
			if (obj2 == null)
			{
				Manipulator val2 = EclipseRun_DontRemoveArtifacts;
				<>O.<1>__EclipseRun_DontRemoveArtifacts = val2;
				obj2 = (object)val2;
			}
			EclipseRun.OverrideRuleChoices += (Manipulator)obj2;
		}

		public static void EclipseRun_DontRemoveArtifacts(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)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCall(x, "RoR2.ArtifactCatalog", "get_artifactCount")
			}))
			{
				val.EmitDelegate<Func<int, int>>((Func<int, int>)((int damageCoeff) => (WConfig.EclipseAllowArtifacts.Value != WConfig.EclipseArtifact.Blacklist) ? damageCoeff : 0));
			}
			else
			{
				Debug.LogWarning((object)"IL FAILED : EclipseRun_DontRemoveArtifacts");
			}
		}

		private static DifficultyIndex EclipseRun_GetEclipseDifficultyIndex(orig_GetEclipseDifficultyIndex orig, int eclipseLevel)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: 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_0035: Unknown result type (might be due to invalid IL or missing references)
			ManualLogSource log = WGQoLMain.log;
			DifficultyIndex val = orig.Invoke(eclipseLevel);
			log.LogMessage((object)("EclipseLevel" + ((object)(DifficultyIndex)(ref val)).ToString()));
			return orig.Invoke(eclipseLevel);
		}

		private static void AllowCertainEclipseArtifacts(orig_OverrideRuleChoices orig, EclipseRun self, RuleChoiceMask mustInclude, RuleChoiceMask mustExclude, ulong runSeed)
		{
			WGQoLMain.log.LogMessage((object)"EclipseRuleoverride");
			orig.Invoke(self, mustInclude, mustExclude, runSeed);
			if (WConfig.EclipseAllowArtifacts.Value == WConfig.EclipseArtifact.VanillaWhitelist)
			{
				ReverseForceChoice(Artifacts.EliteOnly, mustInclude, mustExclude);
				ReverseForceChoice(Artifacts.TeamDeath, mustInclude, mustExclude);
				ReverseForceChoice(Artifacts.MixEnemy, mustInclude, mustExclude);
				ReverseForceChoice(Artifacts.MonsterTeamGainsItems, mustInclude, mustExclude);
				ReverseForceChoice(Artifacts.ShadowClone, mustInclude, mustExclude);
				ReverseForceChoice(Artifacts.Bomb, mustInclude, mustExclude);
				ReverseForceChoice(Artifacts.Prestige, mustInclude, mustExclude);
			}
			if (WConfig.EclipseAllowArtifacts.Value == WConfig.EclipseArtifact.Blacklist)
			{
				ForceChoiceOff(Artifacts.Command, mustInclude, mustExclude);
				ForceChoiceOff(Artifacts.RandomSurvivorOnRespawn, mustInclude, mustExclude);
				ForceChoiceOff(Artifacts.Glass, mustInclude, mustExclude);
				ForceChoiceOff(Artifacts.Delusion, mustInclude, mustExclude);
				ForceChoiceOff(Artifacts.Devotion, mustInclude, mustExclude);
				ForceChoiceOff(Artifacts.Rebirth, mustInclude, mustExclude);
				ForceChoiceOff(ArtifactCatalog.FindArtifactDef("CLASSICITEMSRETURNS_ARTIFACT_CLOVER"), mustInclude, mustExclude);
				ForceChoiceOff(ArtifactCatalog.FindArtifactDef("ARTIFACT_SPOILS"), mustInclude, mustExclude);
				ForceChoiceOff(ArtifactCatalog.FindArtifactDef("ARTIFACT_ZETDROPIFACT"), mustInclude, mustExclude);
				ForceChoiceOff(ArtifactCatalog.FindArtifactDef("ZZT_CommandTrueCommand"), mustInclude, mustExclude);
			}
		}

		public static void ReverseForceChoice(ArtifactDef artifact, RuleChoiceMask mustInclude, RuleChoiceMask mustExclude)
		{
			if (!Object.op_Implicit((Object)(object)artifact))
			{
				return;
			}
			RuleDef val = RuleCatalog.FindRuleDef("Artifacts." + artifact.cachedName);
			if (val == null)
			{
				return;
			}
			foreach (RuleChoiceDef choice in val.choices)
			{
				((SerializableBitArray)mustInclude)[choice.globalIndex] = false;
				((SerializableBitArray)mustExclude)[choice.globalIndex] = false;
			}
		}

		public static void ForceChoiceOff(ArtifactDef artifact, RuleChoiceMask mustInclude, RuleChoiceMask mustExclude)
		{
			if (!Object.op_Implicit((Object)(object)artifact))
			{
				return;
			}
			RuleDef val = RuleCatalog.FindRuleDef("Artifacts." + artifact.cachedName);
			RuleChoiceDef val2 = val.FindChoice("Off");
			if (val2 == null)
			{
				return;
			}
			foreach (RuleChoiceDef choice in val2.ruleDef.choices)
			{
				((SerializableBitArray)mustInclude)[choice.globalIndex] = false;
				((SerializableBitArray)mustExclude)[choice.globalIndex] = true;
			}
			((SerializableBitArray)mustInclude)[val2.globalIndex] = true;
			((SerializableBitArray)mustExclude)[val2.globalIndex] = false;
		}
	}
	public class ItemOrbPhysicsChanger : MonoBehaviour
	{
		public Rigidbody body;

		public void Awake()
		{
			body = ((Component)this).GetComponent<Rigidbody>();
		}

		public void FixedUpdate()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)body) && body.velocity.y < -30f)
			{
				((Component)this).gameObject.layer = 8;
				Object.Destroy((Object)(object)this);
			}
		}
	}
	public class GameplayQualityOfLife
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_FixedUpdate <0>__LunarTeleporterBaseState_FixedUpdate;

			public static hook_TryZoneStart <1>__TeleportItems;

			public static hook_OnEnter <2>__TeleportBrokenDronesUp;

			public static Action<SceneDirector, DirectorCardCategorySelection> <3>__MORESCANNERS;

			public static Manipulator <4>__ConsistentLavaDamageForAllies;
		}

		public static void Start()
		{
			//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)
			//IL_0022: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: 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_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Expected O, but got Unknown
			//IL_00e9: 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_00f4: Expected O, but got Unknown
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Expected O, but got Unknown
			RedWhip.BetterRedWhipCheck();
			object obj = <>O.<0>__LunarTeleporterBaseState_FixedUpdate;
			if (obj == null)
			{
				hook_FixedUpdate val = LunarTeleporterBaseState_FixedUpdate;
				<>O.<0>__LunarTeleporterBaseState_FixedUpdate = val;
				obj = (object)val;
			}
			LunarTeleporterBaseState.FixedUpdate += (hook_FixedUpdate)obj;
			if (WConfig.ItemsTeleport.Value)
			{
				Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/PickupDroplet.prefab").WaitForCompletion().AddComponent<ItemOrbPhysicsChanger>();
				Addressables.LoadAssetAsync<GameObject>((object)"d9c642aeefb6c974da664933489071d4").WaitForCompletion().layer = LayerIndex.fakeActor.intVal;
				Addressables.LoadAssetAsync<GameObject>((object)"f8e3413a378bd7c44aa09bed0020eaf5").WaitForCompletion().layer = LayerIndex.fakeActor.intVal;
				Addressables.LoadAssetAsync<GameObject>((object)"cda6217a2c0775c42a3f456b3bb5e073").WaitForCompletion().layer = LayerIndex.fakeActor.intVal;
				object obj2 = <>O.<1>__TeleportItems;
				if (obj2 == null)
				{
					hook_TryZoneStart val2 = TeleportItems;
					<>O.<1>__TeleportItems = val2;
					obj2 = (object)val2;
				}
				MapZone.TryZoneStart += (hook_TryZoneStart)obj2;
				object obj3 = <>O.<2>__TeleportBrokenDronesUp;
				if (obj3 == null)
				{
					hook_OnEnter val3 = TeleportBrokenDronesUp;
					<>O.<2>__TeleportBrokenDronesUp = val3;
					obj3 = (object)val3;
				}
				DeathState.OnEnter += (hook_OnEnter)obj3;
			}
			SceneDirector.onGenerateInteractableCardSelection += MORESCANNERS;
			LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/LunarCauldron, RedToWhite Variant").GetComponent<ShopTerminalBehavior>().dropVelocity = new Vector3(5f, 10f, 5f);
			((Behaviour)Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC2/PM DestinationPortal.prefab").WaitForCompletion().GetComponent<ConvertPlayerMoneyToExperience>()).enabled = false;
			if (WConfig.cfgLava.Value)
			{
				object obj4 = <>O.<4>__ConsistentLavaDamageForAllies;
				if (obj4 == null)
				{
					Manipulator val4 = ConsistentLavaDamageForAllies;
					<>O.<4>__ConsistentLavaDamageForAllies = val4;
					obj4 = (object)val4;
				}
				CharacterBody.InflictLavaDamage += (Manipulator)obj4;
			}
		}

		private static void ConsistentLavaDamageForAllies(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "RoR2.TeamComponent", "get_teamIndex")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<TeamIndex, CharacterBody, TeamIndex>>((Func<TeamIndex, CharacterBody, TeamIndex>)((TeamIndex team, CharacterBody body) => ((int)team == 1 && !body.isPlayerControlled) ? ((TeamIndex)2) : team));
			}
			else
			{
				WGQoLMain.log.LogWarning((object)"IL Failed : ConsistentLavaDamageForAllies");
			}
		}

		public static void MORESCANNERS(SceneDirector scene, DirectorCardCategorySelection dccs)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			int num = dccs.FindCategoryIndexByName("Rare");
			if (num == -1)
			{
				return;
			}
			Category val = dccs.categories[num];
			for (int i = 0; i < val.cards.Length; i++)
			{
				if (Object.op_Implicit((Object)(object)val.cards[i].forbiddenUnlockableDef))
				{
					val.cards[i].selectionWeight = 50;
				}
			}
		}

		private static void TeleportBrokenDronesUp(orig_OnEnter orig, DeathState self)
		{
			orig.Invoke(self);
			((EntityState)self).gameObject.layer = LayerIndex.playerBody.intVal;
			self.deathDuration *= 4f;
		}

		public static bool IsItem(Collider collider)
		{
			if (Object.op_Implicit((Object)(object)((Component)collider).GetComponent<PickupDropletController>()))
			{
				return true;
			}
			if (Object.op_Implicit((Object)(object)((Component)collider).GetComponent<GenericPickupController>()))
			{
				return true;
			}
			if (Object.op_Implicit((Object)(object)((Component)collider).GetComponent<PickupPickerController>()))
			{
				return true;
			}
			return false;
		}

		public static void TeleportItems(orig_TryZoneStart orig, MapZone self, Collider collider)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Invalid comparison between Unknown and I4
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Expected O, but got Unknown
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Expected O, but got Unknown
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: 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)
			orig.Invoke(self, collider);
			if ((int)self.zoneType != 0 || !IsItem(collider))
			{
				return;
			}
			GameObject teleportEffectPrefab = Run.instance.GetTeleportEffectPrefab(((Component)collider).gameObject);
			InfiniteTowerRun component = ((Component)Run.instance).GetComponent<InfiniteTowerRun>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.safeWardController))
			{
				WGQoLMain.log.LogMessage((object)"it tp item back");
				TeleportHelper.TeleportGameObject(((Component)collider).gameObject, ((Component)component.safeWardController).transform.position);
				if (Object.op_Implicit((Object)(object)teleportEffectPrefab))
				{
					EffectManager.SimpleEffect(teleportEffectPrefab, ((Component)component.safeWardController).transform.position, Quaternion.identity, true);
				}
				return;
			}
			SpawnCard val = ScriptableObject.CreateInstance<SpawnCard>();
			val.hullSize = (HullClassification)0;
			val.nodeGraphType = (GraphType)0;
			val.prefab = LegacyResourcesAPI.Load<GameObject>("SpawnCards/HelperPrefab");
			DirectorPlacementRule val2 = new DirectorPlacementRule
			{
				placementMode = (PlacementMode)3,
				position = ((Component)collider).transform.position
			};
			GameObject val3 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, val2, RoR2Application.rng));
			if (Object.op_Implicit((Object)(object)val3))
			{
				TeleportHelper.TeleportGameObject(((Component)collider).gameObject, val3.transform.position);
				if (Object.op_Implicit((Object)(object)teleportEffectPrefab))
				{
					EffectManager.SimpleEffect(teleportEffectPrefab, val3.transform.position, Quaternion.identity, true);
				}
				Object.Destroy((Object)(object)val3);
			}
			Object.Destroy((Object)(object)val);
		}

		public static void LunarTeleporterBaseState_FixedUpdate(orig_FixedUpdate orig, LunarTeleporterBaseState self)
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)self).fixedAge = ((EntityState)self).fixedAge + ((EntityState)self).GetDeltaTime();
			if (NetworkServer.active && Object.op_Implicit((Object)(object)TeleporterInteraction.instance))
			{
				if (TeleporterInteraction.instance.isCharging || TeleporterInteraction.instance.isInFinalSequence)
				{
					self.genericInteraction.Networkinteractability = (Interactability)0;
				}
				else
				{
					self.genericInteraction.Networkinteractability = self.preferredInteractability;
				}
			}
		}
	}
	public class GeyserLock
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Manipulator <0>__TriggerJumpEventGlobally;

			public static hook_OnEnter <1>__DodgeState_OnEnter;

			public static hook_OnEnter <2>__SlideState_OnEnter;

			public static hook_OnEnter <3>__BaseChargeFist_OnEnter;

			public static hook_OnExit <4>__Assaulter2_OnExit;

			public static hook_OnExit <5>__FocusedAssaultDash_OnExit;

			public static hook_OnExit <6>__EvisDash_OnExit;

			public static hook_OnEnter <7>__FlyUpState_OnEnter;

			public static hook_OnEnter <8>__VoidBlinkBase_OnEnter;

			public static hook_OnEnter <9>__OilSpillBase_OnEnter;

			public static hook_OnEnter <10>__StepBrothers_OnEnter;

			public static hook_OnEnter <11>__GhostUtilitySkillState_OnEnter;
		}

		public static void Start()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_00b6: 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_00c1: Expected O, but got Unknown
			//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_00e2: Expected O, but got Unknown
			//IL_00f8: 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_0103: Expected O, but got Unknown
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Expected O, but got Unknown
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Expected O, but got Unknown
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Expected O, but got Unknown
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Expected O, but got Unknown
			object obj = <>O.<0>__TriggerJumpEventGlobally;
			if (obj == null)
			{
				Manipulator val = TriggerJumpEventGlobally;
				<>O.<0>__TriggerJumpEventGlobally = val;
				obj = (object)val;
			}
			CharacterBody.TriggerJumpEventGlobally += (Manipulator)obj;
			object obj2 = <>O.<1>__DodgeState_OnEnter;
			if (obj2 == null)
			{
				hook_OnEnter val2 = DodgeState_OnEnter;
				<>O.<1>__DodgeState_OnEnter = val2;
				obj2 = (object)val2;
			}
			DodgeState.OnEnter += (hook_OnEnter)obj2;
			object obj3 = <>O.<2>__SlideState_OnEnter;
			if (obj3 == null)
			{
				hook_OnEnter val3 = SlideState_OnEnter;
				<>O.<2>__SlideState_OnEnter = val3;
				obj3 = (object)val3;
			}
			SlideState.OnEnter += (hook_OnEnter)obj3;
			object obj4 = <>O.<3>__BaseChargeFist_OnEnter;
			if (obj4 == null)
			{
				hook_OnEnter val4 = BaseChargeFist_OnEnter;
				<>O.<3>__BaseChargeFist_OnEnter = val4;
				obj4 = (object)val4;
			}
			BaseChargeFist.OnEnter += (hook_OnEnter)obj4;
			object obj5 = <>O.<4>__Assaulter2_OnExit;
			if (obj5 == null)
			{
				hook_OnExit val5 = Assaulter2_OnExit;
				<>O.<4>__Assaulter2_OnExit = val5;
				obj5 = (object)val5;
			}
			Assaulter2.OnExit += (hook_OnExit)obj5;
			object obj6 = <>O.<5>__FocusedAssaultDash_OnExit;
			if (obj6 == null)
			{
				hook_OnExit val6 = FocusedAssaultDash_OnExit;
				<>O.<5>__FocusedAssaultDash_OnExit = val6;
				obj6 = (object)val6;
			}
			FocusedAssaultDash.OnExit += (hook_OnExit)obj6;
			object obj7 = <>O.<6>__EvisDash_OnExit;
			if (obj7 == null)
			{
				hook_OnExit val7 = EvisDash_OnExit;
				<>O.<6>__EvisDash_OnExit = val7;
				obj7 = (object)val7;
			}
			EvisDash.OnExit += (hook_OnExit)obj7;
			object obj8 = <>O.<7>__FlyUpState_OnEnter;
			if (obj8 == null)
			{
				hook_OnEnter val8 = FlyUpState_OnEnter;
				<>O.<7>__FlyUpState_OnEnter = val8;
				obj8 = (object)val8;
			}
			FlyUpState.OnEnter += (hook_OnEnter)obj8;
			object obj9 = <>O.<8>__VoidBlinkBase_OnEnter;
			if (obj9 == null)
			{
				hook_OnEnter val9 = VoidBlinkBase_OnEnter;
				<>O.<8>__VoidBlinkBase_OnEnter = val9;
				obj9 = (object)val9;
			}
			VoidBlinkBase.OnEnter += (hook_OnEnter)obj9;
			object obj10 = <>O.<9>__OilSpillBase_OnEnter;
			if (obj10 == null)
			{
				hook_OnEnter val10 = OilSpillBase_OnEnter;
				<>O.<9>__OilSpillBase_OnEnter = val10;
				obj10 = (object)val10;
			}
			OilSpillBase.OnEnter += (hook_OnEnter)obj10;
			object obj11 = <>O.<10>__StepBrothers_OnEnter;
			if (obj11 == null)
			{
				hook_OnEnter val11 = StepBrothers_OnEnter;
				<>O.<10>__StepBrothers_OnEnter = val11;
				obj11 = (object)val11;
			}
			StepBrothers.OnEnter += (hook_OnEnter)obj11;
			object obj12 = <>O.<11>__GhostUtilitySkillState_OnEnter;
			if (obj12 == null)
			{
				hook_OnEnter val12 = GhostUtilitySkillState_OnEnter;
				<>O.<11>__GhostUtilitySkillState_OnEnter = val12;
				obj12 = (object)val12;
			}
			GhostUtilitySkillState.OnEnter += (hook_OnEnter)obj12;
		}

		private static void EvisDash_OnExit(orig_OnExit orig, EvisDash self)
		{
			orig.Invoke(self);
			((EntityState)self).characterMotor.disableAirControlUntilCollision = false;
		}

		private static void Assaulter2_OnExit(orig_OnExit orig, Assaulter2 self)
		{
			orig.Invoke(self);
			((EntityState)self).characterMotor.disableAirControlUntilCollision = false;
		}

		private static void FocusedAssaultDash_OnExit(orig_OnExit orig, FocusedAssaultDash self)
		{
			orig.Invoke(self);
			((EntityState)self).characterMotor.disableAirControlUntilCollision = false;
		}

		private static void StepBrothers_OnEnter(orig_OnEnter orig, StepBrothers self)
		{
			orig.Invoke(self);
			((EntityState)self).characterMotor.disableAirControlUntilCollision = false;
		}

		private static void OilSpillBase_OnEnter(orig_OnEnter orig, OilSpillBase self)
		{
			orig.Invoke(self);
			((EntityState)self).characterMotor.disableAirControlUntilCollision = false;
		}

		private static void VoidBlinkBase_OnEnter(orig_OnEnter orig, VoidBlinkBase self)
		{
			orig.Invoke(self);
			((EntityState)self).characterMotor.disableAirControlUntilCollision = false;
		}

		private static void BaseChargeFist_OnEnter(orig_OnEnter orig, BaseChargeFist self)
		{
			orig.Invoke(self);
			((EntityState)self).characterMotor.disableAirControlUntilCollision = false;
		}

		private static void FlyUpState_OnEnter(orig_OnEnter orig, FlyUpState self)
		{
			orig.Invoke(self);
			((EntityState)self).characterMotor.disableAirControlUntilCollision = false;
		}

		private static void DodgeState_OnEnter(orig_OnEnter orig, DodgeState self)
		{
			orig.Invoke(self);
			((EntityState)self).characterMotor.disableAirControlUntilCollision = false;
		}

		private static void GhostUtilitySkillState_OnEnter(orig_OnEnter orig, GhostUtilitySkillState self)
		{
			orig.Invoke(self);
			((EntityState)self).characterMotor.disableAirControlUntilCollision = false;
		}

		private static void SlideState_OnEnter(orig_OnEnter orig, SlideState self)
		{
			orig.Invoke(self);
			((EntityState)self).characterMotor.disableAirControlUntilCollision = false;
		}

		private static void TriggerJumpEventGlobally(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(x, "RoR2.CharacterBody", "onJump")
			}))
			{
				val.EmitDelegate<Func<CharacterBody, CharacterBody>>((Func<CharacterBody, CharacterBody>)((CharacterBody body) => body));
			}
			else
			{
				WGQoLMain.log.LogWarning((object)"IL Failed: TriggerJumpEventGlobally");
			}
		}

		public static void AllUtilitiesRemoveGeyserLock(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill)
		{
			orig.Invoke(self, skill);
			if ((Object)(object)self.skillLocator.utility == (Object)(object)skill && Object.op_Implicit((Object)(object)self.characterMotor))
			{
				self.characterMotor.disableAirControlUntilCollision = false;
			}
		}
	}
	public class PrismaticTrial
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_OverrideRuleChoices <0>__WeeklyRun_OverrideRuleChoices;
		}

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

			public static hook_OnEnable <>9__0_0;

			public static hook_GetCurrentSeedCycle <>9__0_1;

			public static hook_ClientSubmitLeaderboardScore <>9__0_2;

			public static hook_OnEnable <>9__0_3;

			internal void <AllowPrismaticTrials>b__0_0(orig_OnEnable orig, WeeklyRunScreenController self)
			{
				Object.Destroy((Object)(object)((Component)((Component)self.leaderboard).gameObject.transform.parent.parent).gameObject);
				((Behaviour)self).enabled = false;
			}

			internal uint <AllowPrismaticTrials>b__0_1(orig_GetCurrentSeedCycle orig)
			{
				return (uint)WeeklyRun.now.Ticks;
			}

			internal void <AllowPrismaticTrials>b__0_2(orig_ClientSubmitLeaderboardScore orig, WeeklyRun self, RunReport runReport)
			{
			}

			internal void <AllowPrismaticTrials>b__0_3(orig_OnEnable orig, DisableIfGameModded self)
			{
			}
		}

		public static void AllowPrismaticTrials()
		{
			//IL_002c: 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_0037: Expected O, but got Unknown
			//IL_0051: 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: Expected O, but got Unknown
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Expected O, but got Unknown
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Expected O, but got Unknown
			if (!WConfig.cfgPrismatic.Value)
			{
				return;
			}
			object obj = <>c.<>9__0_0;
			if (obj == null)
			{
				hook_OnEnable val = delegate(orig_OnEnable orig, WeeklyRunScreenController self)
				{
					Object.Destroy((Object)(object)((Component)((Component)self.leaderboard).gameObject.transform.parent.parent).gameObject);
					((Behaviour)self).enabled = false;
				};
				<>c.<>9__0_0 = val;
				obj = (object)val;
			}
			WeeklyRunScreenController.OnEnable += (hook_OnEnable)obj;
			object obj2 = <>c.<>9__0_1;
			if (obj2 == null)
			{
				hook_GetCurrentSeedCycle val2 = (orig_GetCurrentSeedCycle orig) => (uint)WeeklyRun.now.Ticks;
				<>c.<>9__0_1 = val2;
				obj2 = (object)val2;
			}
			WeeklyRun.GetCurrentSeedCycle += (hook_GetCurrentSeedCycle)obj2;
			object obj3 = <>c.<>9__0_2;
			if (obj3 == null)
			{
				hook_ClientSubmitLeaderboardScore val3 = delegate
				{
				};
				<>c.<>9__0_2 = val3;
				obj3 = (object)val3;
			}
			WeeklyRun.ClientSubmitLeaderboardScore += (hook_ClientSubmitLeaderboardScore)obj3;
			object obj4 = <>c.<>9__0_3;
			if (obj4 == null)
			{
				hook_OnEnable val4 = delegate
				{
				};
				<>c.<>9__0_3 = val4;
				obj4 = (object)val4;
			}
			DisableIfGameModded.OnEnable += (hook_OnEnable)obj4;
			object obj5 = <>O.<0>__WeeklyRun_OverrideRuleChoices;
			if (obj5 == null)
			{
				hook_OverrideRuleChoices val5 = WeeklyRun_OverrideRuleChoices;
				<>O.<0>__WeeklyRun_OverrideRuleChoices = val5;
				obj5 = (object)val5;
			}
			WeeklyRun.OverrideRuleChoices += (hook_OverrideRuleChoices)obj5;
		}

		private static void WeeklyRun_OverrideRuleChoices(orig_OverrideRuleChoices orig, WeeklyRun self, RuleChoiceMask mustInclude, RuleChoiceMask mustExclude, ulong runSeed)
		{
			orig.Invoke(self, mustInclude, mustExclude, runSeed);
		}
	}
	public class RedWhip
	{
		public static void BetterRedWhipCheck()
		{
			//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_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			if (WConfig.cfgRedWhip.Value)
			{
				Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Engi/EngiBodyPlaceBubbleShield.asset").WaitForCompletion().isCombatSkill = false;
				Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Treebot/TreebotBodySonicBoom.asset").WaitForCompletion().isCombatSkill = false;
				Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Loader/FireHook.asset").WaitForCompletion().isCombatSkill = false;
				Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/DLC1/Railgunner/RailgunnerBodyScopeLight.asset").WaitForCompletion().isCombatSkill = false;
				Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/DLC1/Railgunner/RailgunnerBodyScopeHeavy.asset").WaitForCompletion().isCombatSkill = false;
			}
		}
	}
	public class WConfig
	{
		public enum EclipseArtifact
		{
			Off,
			VanillaWhitelist,
			Blacklist
		}

		public static ConfigFile ConfigFile_Client = new ConfigFile(Paths.ConfigPath + "\\Wolfo.WolfoQoL_Gameplay.cfg", true);

		public static ConfigEntry<bool> ItemsTeleport;

		public static ConfigEntry<bool> cfgLava;

		public static ConfigEntry<bool> cfgRedWhip;

		public static ConfigEntry<EclipseArtifact> EclipseAllowArtifacts;

		public static ConfigEntry<bool> cfgPrismatic;

		public static void Start()
		{
			WGQoLMain.log.LogMessage((object)"WQoL InitConfig");
			InitConfig();
		}

		public static void InitConfig()
		{
			ItemsTeleport = ConfigFile_Client.Bind<bool>("Main", "Items Teleport", true, "Items and Dead Drones will teleport if they fall of the map.");
			EclipseAllowArtifacts = ConfigFile_Client.Bind<EclipseArtifact>("Game", "Eclipse Artifacts", EclipseArtifact.VanillaWhitelist, "Allows some artifacts to be voted for in Eclipse.\nJust ones that are purely challenge or variety. (And are compatible with the mode).\n\nOption to enable most artifacts if desired.");
			cfgPrismatic = ConfigFile_Client.Bind<bool>("Game", "Prismatic Trials", true, "Allow Prismatic Trials during modded");
			cfgLava = ConfigFile_Client.Bind<bool>("Main", "Lava Consistency", true, "Makes damage for player-allies 2%, like enemies. Instead of 10%, which is intended for players only.\n\nLava can make things like Devotion borderline unplayable");
			cfgRedWhip = ConfigFile_Client.Bind<bool>("Main", "Red Whip Consistency", true, "More non damaging moves no longer put you into combat.\n\nREX Util\nLoader Secondary\nRailgunner Zoom");
		}

		public static void RiskConfig()
		{
			//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_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Expected O, but got Unknown
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Expected O, but got Unknown
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: 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
			ModSettingsManager.SetModIcon(Addressables.LoadAssetAsync<Sprite>((object)"0630116480f210e489cde8f7e69e28a9").WaitForCompletion());
			ModSettingsManager.SetModDescription("Random assortment of gameplay quality of life.");
			List<ConfigEntry<bool>> list = new List<ConfigEntry<bool>>();
			ConfigEntryBase[] configEntries = ConfigFile_Client.GetConfigEntries();
			ConfigEntryBase[] array = configEntries;
			foreach (ConfigEntryBase val in array)
			{
				if (val.SettingType == typeof(bool))
				{
					ConfigEntry<bool> val2 = (ConfigEntry<bool>)(object)val;
					ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(val2, true));
				}
				else if (val.SettingType == typeof(int))
				{
					ModSettingsManager.AddOption((BaseOption)new IntFieldOption((ConfigEntry<int>)(object)val, false));
				}
				else if (val.SettingType == typeof(float))
				{
					ModSettingsManager.AddOption((BaseOption)new FloatFieldOption((ConfigEntry<float>)(object)val, false));
				}
				else if (val.SettingType == typeof(EclipseArtifact))
				{
					ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)(ConfigEntry<EclipseArtifact>)(object)val, false));
				}
				else
				{
					WGQoLMain.log.LogWarning((object)("Could not add config " + val.Definition.Key + " of type : " + val.SettingType));
				}
			}
		}
	}
	[BepInPlugin("Wolfo.WolfoQoL_Gameplay", "WolfoQoL_Gameplay", "1.1.0")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class WGQoLMain : BaseUnityPlugin
	{
		public static ManualLogSource log;

		public void Awake()
		{
			log = ((BaseUnityPlugin)this).Logger;
			WConfig.Start();
			GameplayQualityOfLife.Start();
			PrismaticTrial.AllowPrismaticTrials();
			Eclipse.Start();
			((ResourceAvailability)(ref GameModeCatalog.availability)).CallWhenAvailable((Action)WConfig.RiskConfig);
		}
	}
}