Decompiled source of Masquerade Divinity v0.1.5

plugins/Masquerade Divinity/ProjectProphet.dll

Decompiled 7 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameConsole;
using HarmonyLib;
using ProjectProphet.Behaviours;
using ProjectProphet.Behaviours.Props;
using ProjectProphet.Behaviours.Wares;
using ProjectProphet.Behaviours.Weapons;
using ProjectProphet.Patching;
using ProjectProphet.Patching.GabrielPatches;
using ProjectProphet.StageAddons;
using ScriptableObjects;
using TMPro;
using ULTRAKILL.Cheats;
using ULTRAKILL.Portal;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.AddressableAssets;
using UnityEngine.AddressableAssets.ResourceLocators;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("ProjectProphet")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ProjectProphet")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("dfa813c9-c407-48f5-b20f-615a3c8fdbe3")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace ProjectProphet
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	public class LinkedMethod : Attribute
	{
		public string methodName;

		public bool runOriginal;

		public LinkedMethod(string methodName, bool runOriginal = false)
		{
			this.methodName = methodName;
			this.runOriginal = runOriginal;
		}
	}
	public class ModdedBehaviour : Attribute
	{
		private Type srcClass;

		private static Harmony harmonyInstance;

		private static Dictionary<MethodBase, MethodInfo[]> SrcToLink;

		private static List<MethodInfo> RunOriginal;

		private const string LINKED_NAMESPACE = "ProjectProphet.Behaviours";

		public ModdedBehaviour(Type srcClass)
		{
			this.srcClass = srcClass;
		}

		public static void Patch()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			harmonyInstance = new Harmony("maranara.projectprophet.linkedmonos");
			Dictionary<MethodBase, List<MethodInfo>> dictionary = new Dictionary<MethodBase, List<MethodInfo>>();
			HarmonyMethod val = new HarmonyMethod(typeof(ModdedBehaviour).GetMethod("PatchTransport", BindingFlags.Static | BindingFlags.NonPublic));
			RunOriginal = new List<MethodInfo>();
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			foreach (Type type in types)
			{
				if (type.Namespace == null || !type.Namespace.StartsWith("ProjectProphet.Behaviours"))
				{
					continue;
				}
				ModdedBehaviour customAttribute = type.GetCustomAttribute<ModdedBehaviour>();
				if (customAttribute == null)
				{
					continue;
				}
				Utils.Log("Found Modded Behaviour: " + type.Name);
				MethodInfo[] methods = type.GetMethods();
				foreach (MethodInfo methodInfo in methods)
				{
					LinkedMethod customAttribute2 = methodInfo.GetCustomAttribute<LinkedMethod>();
					if (customAttribute2 == null)
					{
						continue;
					}
					MethodBase method = customAttribute.srcClass.GetMethod(customAttribute2.methodName, (BindingFlags)(-1));
					if (!dictionary.TryGetValue(method, out var value))
					{
						value = new List<MethodInfo>();
						Utils.Log("- Linked Method " + type.Name + ": From " + customAttribute2.methodName + " to " + methodInfo.Name);
						if (customAttribute2.runOriginal)
						{
							RunOriginal.AddRange(value);
						}
						dictionary.Add(method, value);
					}
					value.Add(methodInfo);
					dictionary[method] = value;
					harmonyInstance.Patch(method, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				}
			}
			SrcToLink = new Dictionary<MethodBase, MethodInfo[]>();
			foreach (KeyValuePair<MethodBase, List<MethodInfo>> item in dictionary)
			{
				SrcToLink.Add(item.Key, item.Value.ToArray());
			}
		}

		public static void Unpatch()
		{
			harmonyInstance.UnpatchSelf();
			harmonyInstance = null;
		}

		private static bool PatchTransport(MonoBehaviour __instance, MethodBase __originalMethod, object[] __args)
		{
			MethodInfo[] array = SrcToLink[__originalMethod];
			foreach (MethodInfo methodInfo in array)
			{
				if (!(((object)__instance).GetType() == methodInfo.DeclaringType))
				{
					continue;
				}
				try
				{
					methodInfo.Invoke(__instance, __args);
					if (RunOriginal.Contains(methodInfo))
					{
						return true;
					}
				}
				catch (Exception ex)
				{
					Utils.LogError("[ModdedBehavior Exception]" + ex.InnerException.Message + "\n" + ex.InnerException.StackTrace);
				}
				return false;
			}
			return true;
		}
	}
	[Serializable]
	public class GabrielProgress
	{
		public int[] newEnemiesFound;

		public bool ware1Unlocked;

		public bool ware2Unlocked;

		public bool ware3Unlocked;

		public bool ware4Unlocked;

		public bool ware1Equipped;

		public bool ware2Equipped;

		public bool ware3Equipped;

		public bool ware4Equipped;

		private const string GABRIEL_PROGRESS = "gabriel.bepis";

		private static GabrielProgress inst;

		public GabrielProgress()
		{
			newEnemiesFound = new int[Enum.GetValues(typeof(CustomEnemyType)).Length];
		}

		public static bool WareStatus(int ware)
		{
			GabrielProgress gabrielProgress = Read();
			return ware switch
			{
				1 => gabrielProgress.ware1Equipped, 
				2 => gabrielProgress.ware2Equipped, 
				3 => gabrielProgress.ware3Equipped, 
				4 => gabrielProgress.ware4Equipped, 
				_ => false, 
			};
		}

		public static void ToggleWare(int ware, bool toggle)
		{
			GabrielProgress gabrielProgress = Read();
			switch (ware)
			{
			case 1:
				gabrielProgress.ware1Equipped = toggle;
				break;
			case 2:
				gabrielProgress.ware2Equipped = toggle;
				break;
			case 3:
				gabrielProgress.ware3Equipped = toggle;
				break;
			case 4:
				gabrielProgress.ware4Equipped = toggle;
				break;
			}
			Write(gabrielProgress);
			MonoSingleton<WaresControl>.Instance.RefreshWares();
		}

		public static void UnlockWare(int ware)
		{
			GabrielProgress gabrielProgress = Read();
			switch (ware)
			{
			case 1:
				gabrielProgress.ware1Unlocked = true;
				gabrielProgress.ware1Equipped = true;
				break;
			case 2:
				gabrielProgress.ware2Unlocked = true;
				gabrielProgress.ware2Equipped = true;
				break;
			case 3:
				gabrielProgress.ware3Unlocked = true;
				gabrielProgress.ware3Equipped = true;
				break;
			case 4:
				gabrielProgress.ware4Unlocked = true;
				gabrielProgress.ware4Equipped = true;
				break;
			}
			Write(gabrielProgress);
			MonoSingleton<WaresControl>.Instance.RefreshWares();
		}

		public static GabrielProgress Read()
		{
			inst = (GabrielProgress)GameProgressSaver.ReadFile(Path.Combine(GameProgressSaver.SavePath, "gabriel.bepis"));
			if (inst == null)
			{
				inst = new GabrielProgress();
			}
			return inst;
		}

		public static void Write(GabrielProgress progress)
		{
			GameProgressSaver.WriteFile(Path.Combine(GameProgressSaver.SavePath, "gabriel.bepis"), (object)progress);
		}
	}
	[Serializable]
	public class ProphetResources : MonoBehaviour
	{
		public Sprite lightningBoltSmall;

		public Sprite lightningBolt;

		public Sprite lightningBoltBig;

		public Sprite fistIcon1;

		public Sprite fistIcon2;

		public Sprite jumpIcon;

		public Sprite logo;

		public Sprite[] ranks;

		public AudioClip shopMusic;

		public AudioClip sfxJump;

		public AudioClip sfxRetroJump;

		public AudioClip sfxLand;

		public AudioClip sfxDodge;

		public AudioClip sfxSharpLand;

		public GameObject sfxStomp;

		public AudioClip sfxSlideLoop;

		public GameObject sfxSlideEnd;

		public AudioClip sfxWalljumpFatigue;

		public AudioClip mainMenuMusic;

		public AudioClip testamentMusic;

		public AudioClip[] sfxFootsteps;

		public GameObject dodgeParticle;

		public GameObject fallParticle;

		public SlideParticles[] slideParticles;

		public GameObject newWeaponCharges;

		public AssetReference[] justice;

		public AssetReference[] splendor;

		public AssetReference[] swordRed;

		public AssetReference[] crossbow;

		public AssetReference[] crossbowGreen;

		public AssetReference[] crossbowRed;

		public AssetReference[] daggerBlue;

		public AssetReference[] daggerGreen;

		public AssetReference[] daggerRed;

		public AssetReference blueFist;

		public AssetReference redFist;

		public AssetReference[] wares;

		public ScriptableObject[] enemyEntries;

		public GameObject kofiButton;

		public StyleInfo styleInfo;
	}
	[Serializable]
	public class Railsword : MonoBehaviour
	{
		public static Railsword inst;

		public LayerMask ignoreEnemyTrigger;

		public int variation;

		public float chargeAnti;

		public float chargeAntiRate;

		public float chargeAntiLimit;

		public Transform shootPoint;

		public GameObject sliceFX;

		public GameObject swingSound;

		public GameObject swingHitSound;

		public GameObject riposteExplosion;

		public GameObject riposteSound;

		public Image[] splendorChargeBar;

		public GameObject splendorBubble;

		public AudioClip splendorChargeSound;

		public GameObject bubblePopWarningSound;

		public MeshRenderer swordRenderer;

		public GameObject silenceThrownSword;

		public GameObject silenceThrowEffect;

		public GameObject silenceCatchEffect;

		public GameObject silenceReadySound;

		public GameObject silenceFailSound;

		public ParticleSystemRenderer silenceReadyFX;

		private ParticleSystem silenceReadyParticles;

		private Material silenceReadyMat;

		private InputManager inman;

		public WeaponIdentifier wid;

		private float gotWidDelay;

		private AudioSource aud;

		private CameraController cc;

		private StyleHUD shud;

		private Camera cam;

		private GunControl gc;

		private Animator anim;

		private SkinnedMeshRenderer smr;

		private WeaponCharges wc;

		private WeaponPos wpos;

		private WeaponIcon wicon;

		private bool zooming;

		private bool gotStuff;

		private CameraFrustumTargeter targeter;

		private LayerMask enemyMask;

		private LayerMask environmentMask;

		private TrailRenderer trail;

		private float chargeMag;

		public float maxSwingCooldown = 0.3f;

		public float swingDamage;

		public GameObject swingProjectile;

		public bool alt;

		private const string FILL = "_Fill";

		private float readyParticleSize;

		private bool couldThrowLastFrame;

		private Color ogColor;

		private const string SWORD_COLOR_KEY = "_Color";

		private const string SWORD_DISPLACEMENT_KEY = "_VertexNoiseAmplitude";

		private bool charging;

		private float chargeTime;

		private bool nowcblock;

		private bool alreadyRiposted;

		private Vector3 chargeFwd;

		private float chargeDashCost = 1.5f;

		private const string parryStyle = "justice.parry";

		private const string pierceStyle = "justice.pierce";

		private EnemyIdentifier lastChargeEid;

		[NonSerialized]
		public List<SplendorBubble> bubbles;

		[NonSerialized]
		public SplendorBubble curBubble;

		private float splendorChargeTime;

		private bool silenceThrown;

		[NonSerialized]
		public int silenceExhaustBuffer;

		private float silenceRecall;

		private const string RECALL_KEY = "SilenceRecall";

		private ThrownSilence silenceSword;

		private RaycastHit hit;

		private int swingCt;

		private float spread = 12f;

		public float swingLength = 5f;

		public const string hitter = "slice";

		private string quickdraw = "ultrakill.quickdraw";

		private List<EnemyIdentifier> targetsThisSwing = new List<EnemyIdentifier>();

		private void Awake()
		{
			//IL_0069: 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)
			if (!gotStuff)
			{
				wid = ((Component)this).GetComponent<WeaponIdentifier>();
				wicon = ((Component)this).GetComponent<WeaponIcon>();
				trail = ((Component)this).GetComponentInChildren<TrailRenderer>();
				if (variation == 2)
				{
					silenceReadyMat = ((Renderer)silenceReadyFX).material;
					silenceReadyParticles = ((Component)silenceReadyFX).GetComponent<ParticleSystem>();
					ogColor = ((Renderer)swordRenderer).material.GetColor("_Color");
				}
			}
		}

		private void Start()
		{
			if (!gotStuff)
			{
				gotStuff = true;
				GetStuff();
			}
		}

		private void OnEnable()
		{
			couldThrowLastFrame = true;
			NewWeaponCharges.swordMax = maxSwingCooldown;
			inst = this;
			if (variation != 1)
			{
				charging = false;
			}
			chargeTime = 0f;
			if (!gotStuff)
			{
				gotStuff = true;
				GetStuff();
			}
			nowcblock = false;
			if (silenceThrown && (Object)(object)silenceThrownSword != (Object)null)
			{
				anim.Play("Silence No Sword", -1, 0f);
			}
			if ((Object)(object)curBubble != (Object)null)
			{
				aud.clip = splendorChargeSound;
				aud.pitch = splendorChargeTime;
				aud.loop = true;
				aud.volume = splendorChargeTime;
				aud.Play();
				anim.Play("JusticeCharge", -1, 0f);
			}
		}

		private void OnDisable()
		{
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			if (charging)
			{
				if (variation == 0)
				{
					EndCharge();
				}
				if (variation == 1 && MonoSingleton<NewMovement>.Instance.dead)
				{
					charging = false;
					LightSwingAnim();
					aud.Stop();
					curBubble = null;
					bubbles = null;
					SplendorBubble.ClearEids();
				}
			}
			if ((Object)(object)wc == (Object)null)
			{
				wc = ((Component)this).GetComponentInParent<WeaponCharges>();
			}
			if ((Object)(object)wpos != (Object)null)
			{
				((Component)this).transform.localPosition = wpos.currentDefault;
			}
			if (variation != 1)
			{
				charging = false;
			}
			chargeTime = 0f;
			if (zooming)
			{
				zooming = false;
				cc.StopZoom();
				if (silenceThrown && (Object)(object)silenceSword != (Object)null)
				{
					silenceSword.EndRecalling();
				}
			}
		}

		private void Update()
		{
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_022f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
			PlayerInput inputSource = MonoSingleton<InputManager>.Instance.InputSource;
			bool flag = !(NewWeaponCharges.sword0Charge < NewWeaponCharges.swordMax);
			if (NoWeaponCooldown.NoCooldown)
			{
				flag = !nowcblock;
			}
			if (inputSource.Fire1.IsPressed && gc.activated && flag && (variation != 2 || !silenceThrown))
			{
				if (variation == 1 && charging)
				{
					EndJudgementCut();
					return;
				}
				if (charging)
				{
					EndCharge();
				}
				if (!Object.op_Implicit((Object)(object)wid) || wid.delay == 0f)
				{
					Swing();
				}
				else
				{
					((MonoBehaviour)this).Invoke("Swing", wid.delay);
				}
				if (NoWeaponCooldown.NoCooldown)
				{
					nowcblock = true;
					((MonoBehaviour)this).Invoke("RefreshNoWc", maxSwingCooldown);
				}
			}
			switch (variation)
			{
			case 0:
				if (charging)
				{
					if (inputSource.Jump.WasPerformedThisFrame || inputSource.Slide.WasPerformedThisFrame || inputSource.Dodge.IsPressed)
					{
						EndCharge();
						chargeTime = 0f;
					}
					else
					{
						ChargeChecks();
					}
				}
				if (inputSource.Fire2.WasPerformedThisFrame && gc.activated && !charging && !inputSource.Jump.WasPerformedThisFrame && !inputSource.Slide.WasPerformedThisFrame && !inputSource.Dodge.IsPressed)
				{
					targetsThisSwing = new List<EnemyIdentifier>();
					if (chargeTime <= 0f)
					{
						StartCharge();
					}
				}
				break;
			case 1:
				UpdateJudgementCut();
				break;
			case 2:
			{
				if (silenceThrown && (Object)(object)silenceSword == (Object)null)
				{
					anim.Play("SilenceCatch", -1);
				}
				bool flag2 = NewWeaponCharges.sword2SCharge > NewWeaponCharges.sword2SMax / 3f;
				if (inputSource.Fire2.WasPerformedThisFrame && gc.activated && !silenceThrown)
				{
					AnimatorStateInfo currentAnimatorStateInfo = anim.GetCurrentAnimatorStateInfo(0);
					if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("SilenceThrow"))
					{
						if (flag2)
						{
							anim.Play("SilenceThrow", -1, 0f);
						}
						else
						{
							Object.Instantiate<GameObject>(silenceFailSound);
						}
					}
				}
				Color val = MonoSingleton<ColorBlindSettings>.Instance.variationColors[variation];
				if (!flag2)
				{
					readyParticleSize = 0f;
				}
				else
				{
					readyParticleSize = Mathf.MoveTowards(readyParticleSize, 1f, Time.deltaTime * 2f);
				}
				if (!couldThrowLastFrame && flag2)
				{
					Object.Instantiate<GameObject>(silenceReadySound);
				}
				couldThrowLastFrame = flag2;
				SizeBySpeedModule sizeBySpeed = silenceReadyParticles.sizeBySpeed;
				((SizeBySpeedModule)(ref sizeBySpeed)).enabled = true;
				((SizeBySpeedModule)(ref sizeBySpeed)).size = new MinMaxCurve(readyParticleSize);
				silenceReadyMat.SetColor("_Color", val);
				float num = 0f - readyParticleSize + 1f;
				if (silenceThrown && (Object)(object)silenceSword != (Object)null)
				{
					if (inputSource.Fire2.IsPressed)
					{
						silenceRecall = Mathf.MoveTowards(silenceRecall, 1f, Time.deltaTime * 5f);
					}
					else
					{
						silenceRecall = Mathf.MoveTowards(silenceRecall, 0f, Time.deltaTime * 5f);
					}
					if (inputSource.Fire2.WasPerformedThisFrame)
					{
						silenceSword.StartRecalling();
					}
					if (inputSource.Fire2.WasCanceledThisFrame)
					{
						silenceSword.EndRecalling();
					}
				}
				else
				{
					Color val2 = Color.Lerp(val, ogColor, readyParticleSize);
					((Renderer)swordRenderer).material.SetColor("_Color", val2);
				}
				((Renderer)swordRenderer).material.SetFloat("_VertexNoiseAmplitude", num);
				anim.SetFloat("SilenceRecall", silenceRecall);
				break;
			}
			}
		}

		private void RefreshNoWc()
		{
			nowcblock = false;
		}

		private void AddFardDamage(float damage)
		{
			if (!MonoSingleton<NewMovement>.Instance.gc.onGround)
			{
				if (MonoSingleton<NewMovement>.Instance.antiHp + damage <= chargeAntiLimit)
				{
					MonoSingleton<NewMovement>.Instance.ForceAddAntiHP(damage, true, true, true, false);
				}
				else if (MonoSingleton<NewMovement>.Instance.antiHp <= chargeAntiLimit)
				{
					MonoSingleton<NewMovement>.Instance.ForceAntiHP(chargeAntiLimit, true, true, true, false);
				}
			}
		}

		private bool SwingCheck(bool chargeCheck = false)
		{
			//IL_0013: 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_0028: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: 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_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: 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_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			targetsThisSwing.Clear();
			bool result = false;
			if (Physics.CapsuleCast(cc.GetDefaultPos() - ((Component)cc).transform.right, cc.GetDefaultPos() + ((Component)cc).transform.right, 2f, Utils.Aim, ref hit, 3f, LayerMask.op_Implicit(ignoreEnemyTrigger), (QueryTriggerInteraction)2))
			{
				bool flag = false;
				RaycastHit val = default(RaycastHit);
				if (Physics.SphereCast(cc.GetDefaultPos(), 1f, Utils.Aim, ref val, 4f, LayerMask.op_Implicit(environmentMask)) && (double)Vector3.Distance(((Component)this).transform.position, ((RaycastHit)(ref hit)).point) > (double)Vector3.Distance(((Component)this).transform.position, ((RaycastHit)(ref val)).point))
				{
					flag = true;
				}
				if (!flag)
				{
					if (SwingSuccess(((RaycastHit)(ref hit)).point, ((RaycastHit)(ref hit)).transform, 1, 1f, chargeCheck))
					{
						result = true;
					}
					targetsThisSwing.Clear();
				}
			}
			return result;
		}

		private bool AltSwingCheck()
		{
			//IL_000c: 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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: 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_0073: 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)
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: 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_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: 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_0215: Unknown result type (might be due to invalid IL or missing references)
			List<EnemyIdentifier> list = new List<EnemyIdentifier>();
			RaycastHit[] array = Physics.CapsuleCastAll(cc.GetDefaultPos() - ((Component)cc).transform.right, cc.GetDefaultPos() + ((Component)cc).transform.right, 2f, Utils.Aim, 3f, LayerMask.op_Implicit(ignoreEnemyTrigger), (QueryTriggerInteraction)2);
			bool result = false;
			EnemyIdentifier eid = default(EnemyIdentifier);
			EnemyIdentifierIdentifier val = default(EnemyIdentifierIdentifier);
			MassSpear val2 = default(MassSpear);
			ParryReceiver val3 = default(ParryReceiver);
			for (int i = 0; i < array.Length; i++)
			{
				hit = array[i];
				if (false)
				{
					continue;
				}
				if (!((Component)((RaycastHit)(ref hit)).collider).TryGetComponent<EnemyIdentifier>(ref eid) && ((Component)((RaycastHit)(ref hit)).collider).TryGetComponent<EnemyIdentifierIdentifier>(ref val))
				{
					eid = val.eid;
				}
				if ((Object)(object)eid != (Object)null)
				{
					if (list.Contains(eid))
					{
						continue;
					}
					list.Add(eid);
					if (!alreadyRiposted)
					{
						alreadyRiposted = true;
						eid.hitter = "riposte";
						if (Object.op_Implicit((Object)(object)eid.zombie))
						{
							Enemy zombie = eid.zombie;
							if (zombie != null)
							{
								GameObject gameObject = ((Component)eid).gameObject;
								Vector3 zero = Vector3.zero;
								GameObject gameObject2 = ((Component)this).gameObject;
								zombie.GetHurt(gameObject, zero, 0f, 0f, default(Vector3), gameObject2, false);
							}
						}
						else if (Object.op_Implicit((Object)(object)eid.machine))
						{
							Enemy machine = eid.machine;
							if (machine != null)
							{
								GameObject gameObject3 = ((Component)eid).gameObject;
								Vector3 zero2 = Vector3.zero;
								GameObject gameObject2 = ((Component)this).gameObject;
								machine.GetHurt(gameObject3, zero2, 0f, 0f, default(Vector3), gameObject2, false);
							}
						}
						else if (Object.op_Implicit((Object)(object)eid.spider))
						{
							MaliciousFace spider = eid.spider;
							if (spider != null)
							{
								Enemy spider2 = spider.spider;
								GameObject gameObject4 = ((Component)eid).gameObject;
								Vector3 zero3 = Vector3.zero;
								GameObject gameObject2 = ((Component)this).gameObject;
								spider2.GetHurt(gameObject4, zero3, 0f, 0f, default(Vector3), gameObject2, false);
							}
						}
						else if (Object.op_Implicit((Object)(object)eid.drone) && eid.drone.crashing)
						{
							Drone drone = eid.drone;
							if (drone != null)
							{
								drone.GetHurt(Vector3.zero, 0f, ((Component)this).gameObject, false);
							}
						}
					}
				}
				if (!alreadyRiposted && ((Component)((RaycastHit)(ref hit)).collider).TryGetComponent<MassSpear>(ref val2))
				{
					val2.GetHurt(15f);
					anim.Play("Hook", -1, 0.065f);
					Object.Instantiate<GameObject>(riposteSound);
					Riposte();
					alreadyRiposted = true;
				}
				if (!alreadyRiposted && ((Component)((RaycastHit)(ref hit)).collider).TryGetComponent<ParryReceiver>(ref val3))
				{
					val3.Parry();
					anim.Play("Hook", -1, 0.065f);
					Object.Instantiate<GameObject>(riposteSound);
					Riposte();
					alreadyRiposted = true;
				}
				if (SwingSuccess(((RaycastHit)(ref hit)).point, ((RaycastHit)(ref hit)).transform, 1))
				{
					result = true;
				}
			}
			alreadyRiposted = false;
			return result;
		}

		private void LightSwingAnim()
		{
			if (MonoSingleton<PrefsManager>.Instance.GetInt("weaponHoldPosition", 0) == 1)
			{
				anim.Play("MiddleSwing", -1, 0f);
			}
			else
			{
				anim.Play("SwingLight1", -1, 0f);
			}
		}

		public void Riposte(EnemyIdentifier eid = null)
		{
			MonoSingleton<TimeController>.Instance.ParryFlash();
			MonoSingleton<StyleHUD>.Instance.AddPoints(100, "justice.parry", (GameObject)null, (EnemyIdentifier)null, -1, "", "");
			if ((Object)(object)eid != (Object)null && eid.dead)
			{
				MonoSingleton<StyleHUD>.Instance.AddPoints(45, "ultrakill.kill", ((Component)this).gameObject, eid, -1, "", "");
				MonoSingleton<GunControl>.Instance.AddKill();
			}
			anim.Play("Hook", -1, 0.065f);
			Object.Instantiate<GameObject>(riposteSound);
		}

		private void StartCharge()
		{
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			MonoSingleton<NewMovement>.Instance.jumping = true;
			charging = true;
			anim.Play("HeavySwing", -1, 0f);
			Object.Instantiate<GameObject>(swingSound);
			if (!NoWeaponCooldown.NoCooldown)
			{
				if (NewWeaponCharges.sword0Exhaust <= 0f)
				{
					NewWeaponCharges.sword0Exhaust += 1f;
				}
				else if (NewWeaponCharges.sword0Exhaust < 9.87f)
				{
					NewWeaponCharges.sword0Exhaust += 2f;
				}
			}
			AddFardDamage(chargeAnti);
			lastChargeEid = null;
			chargeTime = 0.8f;
			chargeFwd = ((Component)MonoSingleton<CameraController>.Instance).transform.forward;
			NewMovement instance = MonoSingleton<NewMovement>.Instance;
			Vector3 velocity = instance.rb.velocity;
			chargeMag = ((Vector3)(ref velocity)).magnitude * Time.fixedDeltaTime;
			if (chargeMag < 200f)
			{
				chargeMag = 200f;
			}
			Vector3 velocity2 = chargeFwd * chargeMag;
			velocity2.y -= 12f;
			instance.rb.velocity = velocity2;
		}

		private void ChargeChecks()
		{
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: 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_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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_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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: 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_00e5: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)wid) || wid.delay == 0f)
			{
				float num = Time.deltaTime;
				if (alt)
				{
					num *= 0.7f;
				}
				chargeTime -= num;
				if (chargeTime <= 0f)
				{
					EndCharge();
				}
				NewMovement instance = MonoSingleton<NewMovement>.Instance;
				if (alt)
				{
					chargeFwd = ((Component)MonoSingleton<CameraController>.Instance).transform.forward;
				}
				Vector3 val = chargeFwd * (chargeMag / 2f) * Mathf.Clamp(chargeTime, 0.2f, 2f);
				val.y -= 12f * Mathf.Clamp(NewWeaponCharges.sword0Exhaust, 0f, 999f);
				if (alt)
				{
					val *= 0.7f;
				}
				instance.rb.velocity = val;
				AddFardDamage(chargeAntiRate * Time.deltaTime);
			}
			SwingCheck(chargeCheck: true);
			if (Physics.Raycast(cc.GetDefaultPos(), Utils.Aim, ref hit, 4f, LayerMask.op_Implicit(environmentMask), (QueryTriggerInteraction)2) || Physics.SphereCast(cc.GetDefaultPos(), 1f, Utils.Aim, ref hit, 4f, LayerMask.op_Implicit(environmentMask), (QueryTriggerInteraction)2))
			{
				Glass component = ((Component)((RaycastHit)(ref hit)).transform).gameObject.GetComponent<Glass>();
				Breakable val2 = default(Breakable);
				if ((Object)(object)component != (Object)null)
				{
					component.Shatter();
				}
				else if (((Component)((RaycastHit)(ref hit)).transform).gameObject.TryGetComponent<Breakable>(ref val2) && !val2.precisionOnly)
				{
					val2.Break();
				}
			}
		}

		public void EndCharge()
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			MonoSingleton<NewMovement>.Instance.jumping = false;
			aud.Stop();
			chargeTime = 0f;
			charging = false;
			anim.CrossFade("Idle", 0.5f);
			MonoSingleton<NewMovement>.Instance.rb.velocity = Vector3.ClampMagnitude(MonoSingleton<NewMovement>.Instance.rb.velocity, 50f);
			if (NoWeaponCooldown.NoCooldown)
			{
				NewWeaponCharges.sword0Exhaust = -1f;
				NewWeaponCharges.sword0Charge = 0f;
			}
		}

		private void StartJudgementCut()
		{
			splendorChargeTime = 0f;
			aud.clip = splendorChargeSound;
			aud.pitch = splendorChargeTime;
			aud.loop = true;
			aud.volume = splendorChargeTime;
			aud.Play();
			anim.Play("JusticeCharge", -1, 0f);
			charging = true;
			bubbles = new List<SplendorBubble>();
			CreateBubble();
		}

		private void UpdateJudgementCut()
		{
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: 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_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: 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_00b4: Unknown result type (might be due to invalid IL or missing references)
			PlayerInput inputSource = MonoSingleton<InputManager>.Instance.InputSource;
			if (inputSource.Fire2.IsPressed && !charging && NewWeaponCharges.sword1SCharge >= NewWeaponCharges.sword1SMax / 2f)
			{
				StartJudgementCut();
			}
			if (inputSource.Fire2.WasCanceledThisFrame && charging)
			{
				EndJudgementCut();
			}
			for (int i = 0; i < splendorChargeBar.Length; i++)
			{
				Image val = splendorChargeBar[i];
				val.fillAmount = NewWeaponCharges.sword1SCharge / NewWeaponCharges.sword1SMax;
				Color val2 = MonoSingleton<ColorBlindSettings>.Instance.variationColors[variation];
				if (NewWeaponCharges.sword1SCharge >= NewWeaponCharges.sword1SMax / 2f || charging)
				{
					((Graphic)val).color = val2;
				}
				else
				{
					((Graphic)val).color = Color.Lerp(val2, Color.black, 0.8f);
				}
			}
			if (charging)
			{
				splendorChargeTime = Mathf.MoveTowards(splendorChargeTime, 1f, Time.deltaTime * 3f);
				aud.pitch = splendorChargeTime;
				aud.volume = splendorChargeTime;
				Vector3 val3 = Vector3.up * Random.value;
				((Component)this).transform.localPosition = wpos.currentDefault + val3 * splendorChargeTime * 0.1f;
			}
		}

		public void CreateBubble()
		{
			//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)
			SplendorBubble item = (curBubble = Object.Instantiate<GameObject>(splendorBubble, ((Component)MonoSingleton<NewMovement>.Instance).transform.position, Quaternion.identity).GetComponent<SplendorBubble>());
			curBubble.sword = this;
			curBubble.alt = alt;
			curBubble.sourceWeapon = ((Component)this).gameObject;
			bubbles.Add(item);
		}

		public void EndJudgementCut()
		{
			if (!NoWeaponCooldown.NoCooldown && NewWeaponCharges.sword1SCharge > 0f)
			{
				NewWeaponCharges.sword1SCharge -= NewWeaponCharges.sword1SMax / 2f;
				if (NewWeaponCharges.sword1SCharge < 0f)
				{
					NewWeaponCharges.sword1SCharge = 0f;
				}
			}
			aud.Stop();
			LightSwingAnim();
			charging = false;
			foreach (SplendorBubble bubble in bubbles)
			{
				if (!((Object)(object)bubble == (Object)null))
				{
					bubble.Kill();
				}
			}
			curBubble = null;
			bubbles = null;
			SplendorBubble.ClearEids();
		}

		public void SilenceThrow()
		{
			//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_001b: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(silenceThrownSword, ((Component)cc).transform.position, Quaternion.LookRotation(Utils.Aim));
			silenceSword = val.GetComponent<ThrownSilence>();
			if (alt)
			{
				silenceSword.SwitchToAlt();
			}
			silenceSword.origin = this;
			silenceSword.camera = ((Component)cc).transform;
			((Renderer)swordRenderer).enabled = false;
			((Component)silenceReadyFX).gameObject.SetActive(false);
			silenceThrown = true;
			Object.Instantiate<GameObject>(silenceThrowEffect);
		}

		public void SilenceReturned()
		{
			silenceSword = null;
		}

		public void SilenceCatch()
		{
			if (silenceExhaustBuffer > 0)
			{
				NewWeaponCharges.sword2SCharge -= 2f * (float)silenceExhaustBuffer;
				if (NewWeaponCharges.sword2SCharge < 0f)
				{
					NewWeaponCharges.sword2SCharge = 0f;
				}
				silenceExhaustBuffer = 0;
			}
			silenceThrown = false;
			((Renderer)swordRenderer).enabled = true;
			((Component)silenceReadyFX).gameObject.SetActive(true);
			Object.Instantiate<GameObject>(silenceCatchEffect);
		}

		private void Swing()
		{
			//IL_0046: 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_005d: 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_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: 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_0092: 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_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_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: 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_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00c4: 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_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			targetsThisSwing.Clear();
			NewWeaponCharges.sword0Charge = 0f;
			bool flag = false;
			flag = (alt ? AltSwingCheck() : SwingCheck());
			cc.CameraShake(0.3f);
			Vector3 defaultPos = cc.GetDefaultPos();
			defaultPos.y -= 0.4f;
			SpawnProjectile(defaultPos, Utils.Aim);
			Vector3 up = ((Component)cc).transform.up;
			if (!alt)
			{
				Vector3 aim = Utils.Aim;
				aim = Quaternion.AngleAxis(0f - spread, up) * aim;
				Vector3 aim2 = Utils.Aim;
				aim2 = Quaternion.AngleAxis(spread, up) * aim2;
				SpawnProjectile(defaultPos, aim, 1f, 1f, parriable: false);
				SpawnProjectile(defaultPos, aim2, 1f, 1f, parriable: false);
			}
			if (!flag)
			{
				Object.Instantiate<GameObject>(swingSound);
			}
			else if (alt && !MonoSingleton<NewMovement>.instance.gc.onGround)
			{
				MonoSingleton<NewMovement>.instance.rb.AddForce(((Component)cc).transform.forward * 25f, (ForceMode)2);
			}
			LightSwingAnim();
		}

		private GameObject SpawnProjectile(Vector3 pos, Vector3 dir, float mod = 1f, float speedMod = 1f, bool parriable = true)
		{
			//IL_0015: 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: 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_0026: 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_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			float num = (alt ? 3f : 0.8f);
			pos += Utils.Aim * num;
			GameObject obj = Object.Instantiate<GameObject>(swingProjectile, pos, Quaternion.identity);
			obj.transform.forward = dir;
			SwordBeam component = obj.GetComponent<SwordBeam>();
			if ((Object)(object)component != (Object)null)
			{
				((Projectile)component).sourceWeapon = ((Component)this).gameObject;
				((Projectile)component).weaponType = "swordprojectile" + variation;
				((Projectile)component).damage = swingDamage * mod;
				((Projectile)component).speed = ((Projectile)component).speed + speedMod;
				((Projectile)component).turnSpeed = ((Projectile)component).turnSpeed + speedMod * 10f;
				if (!parriable)
				{
					component.Unparry(reparry: true);
				}
			}
			return obj;
		}

		public bool SwingSuccess(Vector3 point, Transform target, int total, float dmgMult = 1f, bool checkLastEid = false)
		{
			//IL_00ff: 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_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			StakeSpinning stakeSpinning = default(StakeSpinning);
			if (((Component)target).gameObject.tag == "Enemy" || ((Component)target).gameObject.tag == "Head" || ((Component)target).gameObject.tag == "Body" || ((Component)target).gameObject.tag == "Limb" || ((Component)target).gameObject.tag == "EndLimb")
			{
				EnemyIdentifier val = null;
				EnemyIdentifierIdentifier val2 = default(EnemyIdentifierIdentifier);
				if (((Component)target).TryGetComponent<EnemyIdentifierIdentifier>(ref val2))
				{
					val = val2.eid;
				}
				else
				{
					((Component)target).TryGetComponent<EnemyIdentifier>(ref val);
				}
				if (Object.op_Implicit((Object)(object)val))
				{
					if (val.dead)
					{
						return false;
					}
					if (targetsThisSwing.Contains(val))
					{
						return false;
					}
					targetsThisSwing.Add(val);
					if (checkLastEid)
					{
						if ((Object)(object)lastChargeEid == (Object)(object)val)
						{
							return false;
						}
						lastChargeEid = val;
					}
					Object.Instantiate<GameObject>(swingHitSound);
					if (Object.op_Implicit((Object)(object)sliceFX))
					{
						Object.Instantiate<GameObject>(sliceFX, point, Quaternion.identity);
					}
					if (!val.hitterWeapons.Contains("swordmelee" + variation))
					{
						val.hitterWeapons.Add("swordmelee" + variation);
					}
					MonoSingleton<TimeController>.Instance.HitStop(0.05f);
					cc.CameraShake(0.5f);
					shud.AddPoints(1, "justice.pierce", ((Component)this).gameObject, (EnemyIdentifier)null, -1, "", "");
					val.hitter = "slice" + (alt ? "alt" : "");
					Vector3 val3 = Utils.Aim * -3000f;
					if (alt)
					{
						val3 *= -25f;
					}
					Utils.Log($"Delivering {swingDamage} to {((Object)((Component)target).gameObject).name}");
					if (!val.dead && !val.blessed)
					{
						AnimatorStateInfo currentAnimatorStateInfo = anim.GetCurrentAnimatorStateInfo(0);
						if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Equip"))
						{
							MonoSingleton<StyleHUD>.Instance.AddPoints(50, "ultrakill.quickdraw", gc.currentWeapon, val, -1, "", "");
						}
					}
					val.DeliverDamage(((Component)target).gameObject, val3, point, swingDamage / (float)total, alt, 1f, (GameObject)null, false, false);
					if (checkLastEid && val.dead && variation == 0)
					{
						NewWeaponCharges.sword0Exhaust = -1f;
					}
					return true;
				}
			}
			else if (((Component)target).gameObject.tag == "Coin")
			{
				Coin component = ((Component)target).GetComponent<Coin>();
				if (!Object.op_Implicit((Object)(object)component) || !component.doubled)
				{
					return false;
				}
				Coin component2 = ((Component)target).GetComponent<Coin>();
				if (component2 != null)
				{
					component2.DelayedPunchflection();
				}
			}
			else if (((Component)target).gameObject.layer == 14 && ((Component)target.root).TryGetComponent<StakeSpinning>(ref stakeSpinning))
			{
				if (((Cannonball)stakeSpinning).broken)
				{
					return false;
				}
				MonoSingleton<StyleHUD>.Instance.AddPoints(100, "gabriel.glittercut", ((Component)this).gameObject, (EnemyIdentifier)null, -1, "", "");
				((Cannonball)stakeSpinning).ghostCollider = false;
				stakeSpinning.NewBreak();
				return true;
			}
			return false;
		}

		private void GetStuff()
		{
			//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_0052: 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_005e: 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_0073: Unknown result type (might be due to invalid IL or missing references)
			environmentMask = LayerMask.op_Implicit(LayerMask.GetMask(new string[3] { "Environment", "Outdoors", "Item" }));
			ignoreEnemyTrigger = LayerMask.op_Implicit(LayerMask.GetMask(new string[3] { "Limb", "BigCorpse", "Projectile" }));
			enemyMask = LayerMask.op_Implicit(LayerMask.op_Implicit(enemyMask) | 0x400);
			shud = MonoSingleton<StyleHUD>.Instance;
			targeter = ((Component)Camera.main).GetComponent<CameraFrustumTargeter>();
			inman = MonoSingleton<InputManager>.Instance;
			wid = ((Component)this).GetComponent<WeaponIdentifier>();
			aud = ((Component)this).GetComponent<AudioSource>();
			cc = MonoSingleton<CameraController>.Instance;
			cam = ((Component)cc).GetComponent<Camera>();
			smr = ((Component)this).GetComponentInChildren<SkinnedMeshRenderer>();
			gc = ((Component)this).GetComponentInParent<GunControl>();
			anim = ((Component)this).GetComponentInChildren<Animator>();
			wpos = ((Component)this).GetComponent<WeaponPos>();
			wc = MonoSingleton<WeaponCharges>.Instance;
		}
	}
	public class SwordAnimationReceiver : MonoBehaviour
	{
		private Railsword sword;

		private void Start()
		{
			sword = ((Component)this).GetComponentInParent<Railsword>();
		}

		public void SilenceThrow()
		{
			sword.SilenceThrow();
		}

		public void SilenceCatch()
		{
			sword.SilenceCatch();
		}
	}
	public static class MetaDatabase
	{
		public static GameObject newShopPrefab;

		public static AssetReference blueArm;

		public static AssetReference redArm;

		public static ProphetResources resources;

		public static CustomTerminal terminal;

		private const string StageAddonsNamespace = "ProjectProphet.StageAddons";

		public static Dictionary<int, StageAddon> sceneToAddon;

		public static Dictionary<int, TipOfTheDay> levelNumberToTip;

		public static Dictionary<string, TipOfTheDay> levelNameToTip;

		public static List<KeyValuePair<string, string>> styleKVPs;

		public static List<KeyValuePair<string, float>> freshnessKVPs;

		public static SpawnableObject[] CustomEnemies;

		private static Dictionary<EnemyType, KeyValuePair<string, float>[]> enemyWeaknesses;

		public static void Init()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: 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)
			//IL_0047: Expected O, but got Unknown
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"ProjectProphet.Resources").WaitForCompletion();
			resources = val.GetComponent<ProphetResources>();
			ScriptableObject[] enemyEntries = resources.enemyEntries;
			List<SpawnableObject> list = new List<SpawnableObject>();
			ScriptableObject[] array = enemyEntries;
			foreach (ScriptableObject val2 in array)
			{
				list.Add((SpawnableObject)val2);
			}
			CustomEnemies = list.ToArray();
			terminal = val.GetComponent<CustomTerminal>();
			newShopPrefab = Addressables.LoadAssetAsync<GameObject>((object)"ProjectProphet.Resources.ShopDefault").WaitForCompletion();
			InitStyleKVPs();
		}

		public static void InitStageAddons()
		{
			sceneToAddon = new Dictionary<int, StageAddon>();
			levelNumberToTip = new Dictionary<int, TipOfTheDay>();
			levelNameToTip = new Dictionary<string, TipOfTheDay>();
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			foreach (Type type in types)
			{
				if (type.Namespace != "ProjectProphet.StageAddons")
				{
					continue;
				}
				MethodInfo[] methods = type.GetMethods();
				foreach (MethodInfo methodInfo in methods)
				{
					StageAddon customAttribute = methodInfo.GetCustomAttribute<StageAddon>();
					if (customAttribute != null)
					{
						Utils.Log($"Found method {methodInfo.Name} in class {methodInfo.DeclaringType.Name} with level name of {customAttribute.stage}");
						customAttribute.SetMethodInfo(methodInfo);
						sceneToAddon.Add(customAttribute.stage, customAttribute);
					}
				}
				FieldInfo[] fields = type.GetFields();
				foreach (FieldInfo fieldInfo in fields)
				{
					TipOfTheDay customAttribute2 = fieldInfo.GetCustomAttribute<TipOfTheDay>();
					if (customAttribute2 != null)
					{
						customAttribute2.SetMethodInfo(fieldInfo);
						Utils.Log($"Found field {fieldInfo.Name} in class {fieldInfo.DeclaringType.Name} with level name of {customAttribute2.stage}");
						if (string.IsNullOrEmpty(customAttribute2.sceneOverride))
						{
							levelNumberToTip.Add(customAttribute2.stage, customAttribute2);
						}
						else
						{
							levelNameToTip.Add(customAttribute2.sceneOverride, customAttribute2);
						}
					}
				}
			}
		}

		public static void InitStyleKVPs()
		{
			styleKVPs = new List<KeyValuePair<string, string>>();
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.icespike", "GLITTERFREEZE"));
			styleKVPs.Add(new KeyValuePair<string, string>("ultrakill.glitterballed", "GLITTERFREEZE"));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.glittercut", "<color=#00ff00ff>GLITTERSTRUCK</color>"));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.silencesplendorexplode", "<color=#00ffffff>CUT OFF</color>"));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.silenceparry", "<color=#00ff00ff>DO IT AGAIN</color>"));
			styleKVPs.Add(new KeyValuePair<string, string>("ultrakill.glitterboost", "<color=#00ff00ff>GLITTERBOOST</color>"));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.splendorkill", "<color=#00ffffff>SUSHI</color>"));
			styleKVPs.Add(new KeyValuePair<string, string>("justice.parry", "<color=green>RIPOSTE</color>"));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.blur", "<color=#00ff00ff>BLUR</color>"));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.blur.burn", "<color=#00ffffff>TENDER</color><color=#00ff00ff>BLUR</color>"));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.afterburn", "<color=#00ffffff>AFTERBURNER</color>"));
			styleKVPs.Add(new KeyValuePair<string, string>("justice.hit", string.Empty));
			styleKVPs.Add(new KeyValuePair<string, string>("crossbow.stake", string.Empty));
			styleKVPs.Add(new KeyValuePair<string, string>("justice.pierce", string.Empty));
			styleKVPs.Add(new KeyValuePair<string, string>("magicred.smoke", string.Empty));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.iceleech", string.Empty));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.splendor", string.Empty));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.ice", string.Empty));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.silence", string.Empty));
			styleKVPs.Add(new KeyValuePair<string, string>("ultrakill.glitterballedfrombounce", string.Empty));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.silencekill", "<color=#00ffffff>CHOP</color>"));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.daggertimed", "<color=#00ff00ff>MIRAGE</color>"));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.daggertimedparry", "<color=#00ffffff>FORCE</color> <color=#00ff00ff>MIRAGE</color>"));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.dagger.burn", "<color=#00ffffff>RED BIND</color>"));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.beamboost", "<color=#00ffffff>IMPLODED</color>"));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.daggerpierce", string.Empty));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.daggerside", "BLENDER"));
			styleKVPs.Add(new KeyValuePair<string, string>("gabriel.daggersidehit", string.Empty));
			freshnessKVPs = new List<KeyValuePair<string, float>>();
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.silencesplendorexplode", 0.25f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.glittercut", 0.25f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.beamboost", 0.5f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.silenceparry", 0.25f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("crossbow.stake", 0.35f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("justice.hit", 0.2f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("justice.pierce", 0.2f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.inlight", 1.4f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.splendor", 1.1f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.splendorkill", 1.3f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.silence", 0.13f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.silencekill", 0.6f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("justice.parry", 2f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("magicred.smoke", 0.5f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.blur.burn", 0.2f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.dagger.burn", 0.4f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.ice", 0.4f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.icespike", 0.7f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.iceleech", 0.25f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.daggertimed", 0.5f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.daggertimedparry", 0.3f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.daggerpierce", 0.1f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.daggerside", 0.8f));
			freshnessKVPs.Add(new KeyValuePair<string, float>("gabriel.daggersidehit", 0.15f));
			enemyWeaknesses = new Dictionary<EnemyType, KeyValuePair<string, float>[]>();
			enemyWeaknesses.Add((EnemyType)11, new KeyValuePair<string, float>[1]
			{
				new KeyValuePair<string, float>("magicred.smoke", 5f)
			});
		}
	}
	public enum CustomEnemyType
	{
		CancerousRodentPrime = 4200,
		SingularRodentPrime
	}
	[Serializable]
	public class ProphetProgress
	{
		public bool wrathSwitch1;

		public bool wrathSwitch2;

		public bool wrathSwitch3;
	}
	public static class Utils
	{
		[CompilerGenerated]
		private sealed class <Loading>d__35 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public string lvl;

			private AsyncOperationHandle<GameObject> <op>5__2;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <Loading>d__35(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				<op>5__2 = default(AsyncOperationHandle<GameObject>);
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//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_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_005b: Invalid comparison between Unknown and I4
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<op>5__2 = Addressables.LoadAssetAsync<GameObject>((object)("ProjectProphet.LevelAdd." + lvl));
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if ((int)<op>5__2.Status != 1)
				{
					<>2__current = (object)new WaitForEndOfFrame();
					<>1__state = 1;
					return true;
				}
				Object.Instantiate<GameObject>(<op>5__2.Result);
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public static bool notifLaunched;

		private static string _bundleProjectPath;

		private static string _packedPath;

		private static ManualLogSource logSource;

		private const string WRATH_PROGRESS = "prophet.bepis";

		private static Dictionary<AssetReference, AsyncOperationHandle<GameObject>> LoadedWeapons = new Dictionary<AssetReference, AsyncOperationHandle<GameObject>>();

		public static bool sanitizePreventer;

		public static bool versionMismatch;

		public const string ultrakillVersionName = "FRAUD Patch 17b2";

		private const string ultrakillVersionGUID = "0ab3618344e342558a9e2795284ddad1";

		private static CameraFrustumTargeter targeter;

		public static StyleHUD shud => MonoSingleton<StyleHUD>.Instance;

		public static GunControl gc => MonoSingleton<GunControl>.Instance;

		public static WeaponCharges wc => MonoSingleton<WeaponCharges>.Instance;

		public static TimeController timeController => MonoSingleton<TimeController>.Instance;

		public static string BundleProjectPath
		{
			get
			{
				if (string.IsNullOrEmpty(_bundleProjectPath))
				{
					_bundleProjectPath = Path.Combine("Assets", "Custom", "Maranara", "Code Mods", "Prophet");
				}
				return _bundleProjectPath;
			}
		}

		public static string PackedPath
		{
			get
			{
				if (string.IsNullOrEmpty(_packedPath))
				{
					_packedPath = Path.Combine(ModPath() ?? "", "bundles");
				}
				return _packedPath;
			}
		}

		public static AssetBundle curStageBundle { get; private set; }

		public static Vector3 Aim
		{
			get
			{
				//IL_0021: Unknown result type (might be due to invalid IL or missing references)
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: 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_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_0065: 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_006d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)targeter == (Object)null)
				{
					targeter = MonoSingleton<CameraFrustumTargeter>.Instance;
				}
				Vector3 result = ((Component)MonoSingleton<CameraController>.Instance).transform.forward;
				if (Object.op_Implicit((Object)(object)targeter.CurrentTarget) && targeter.IsAutoAimed)
				{
					Bounds bounds = targeter.CurrentTarget.bounds;
					Vector3 val = ((Bounds)(ref bounds)).center - MonoSingleton<CameraController>.Instance.GetDefaultPos();
					result = ((Vector3)(ref val)).normalized;
				}
				return result;
			}
		}

		private static string ModPath()
		{
			return Assembly.GetExecutingAssembly().Location.Substring(0, Assembly.GetExecutingAssembly().Location.LastIndexOf("\\"));
		}

		public static void Log(string log)
		{
		}

		public static void LogError(string log)
		{
			if (logSource == null)
			{
				logSource = Logger.CreateLogSource("md");
			}
			logSource.LogError((object)log);
		}

		public static void Log(object log)
		{
			Log(log.ToString());
		}

		public static Vector3 ClampMagnitude(this Vector3 v, float max, float min)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: 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_002f: Unknown result type (might be due to invalid IL or missing references)
			double num = ((Vector3)(ref v)).sqrMagnitude;
			if (num > (double)max * (double)max)
			{
				return ((Vector3)(ref v)).normalized * max;
			}
			if (num < (double)min * (double)min)
			{
				return ((Vector3)(ref v)).normalized * min;
			}
			return v;
		}

		public static ProphetProgress ReadWrathProgress()
		{
			ProphetProgress prophetProgress = (ProphetProgress)GameProgressSaver.ReadFile(Path.Combine(GameProgressSaver.SavePath, "prophet.bepis"));
			if (prophetProgress == null)
			{
				return new ProphetProgress();
			}
			return prophetProgress;
		}

		public static void WriteWrathProgress(ProphetProgress progress)
		{
			GameProgressSaver.WriteFile(Path.Combine(GameProgressSaver.SavePath, "prophet.bepis"), (object)progress);
		}

		public static void HurtButDontKill(int damage)
		{
			NewMovement instance = MonoSingleton<NewMovement>.Instance;
			int num = 0;
			if (instance.hp != 1)
			{
				num = ((instance.hp > damage) ? damage : (instance.hp - 1));
				instance.GetHurt(num, false, 1f, false, false, 0.35f, false);
			}
		}

		public static void PrintResources()
		{
		}

		public static bool CastLevelNameToInt(string name, out int result)
		{
			name = name.Substring(name.Length - 3);
			name = name.Remove(1, 1);
			return int.TryParse(name, out result);
		}

		public static GameObject GetWeaponFromRef(AssetReference asset)
		{
			//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_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			if (LoadedWeapons.TryGetValue(asset, out var value))
			{
				return value.Result;
			}
			AsyncOperationHandle<GameObject> value2 = Addressables.LoadAssetAsync<GameObject>((object)asset);
			value2.WaitForCompletion();
			if ((int)value2.Status == 1)
			{
				LoadedWeapons.Add(asset, value2);
				return value2.Result;
			}
			return null;
		}

		public static void SetAssRefField(AssetReference asset, Traverse field, int i = -1)
		{
			GameObject weaponFromRef = GetWeaponFromRef(asset);
			if ((Object)(object)weaponFromRef != (Object)null && field != null)
			{
				if (i == -1)
				{
					field.SetValue((object)weaponFromRef);
					return;
				}
				GameObject[] array = (GameObject[])field.GetValue();
				array[i] = weaponFromRef;
				field.SetValue((object)array);
			}
		}

		public static GameObject LoadAndInstantiateStage(string levelName)
		{
			//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)
			Log("Starting to load additive stage...");
			return Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)("ProjectProphet.LevelAdd." + levelName)).WaitForCompletion());
		}

		[IteratorStateMachine(typeof(<Loading>d__35))]
		private static IEnumerator Loading(string lvl)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <Loading>d__35(0)
			{
				lvl = lvl
			};
		}

		public static void LoadCustomScene(string levelName)
		{
			sanitizePreventer = true;
			SceneHelper.LoadScene(levelName, false);
			sanitizePreventer = false;
		}

		public static void CheckUltrakillVersion()
		{
			if (Application.buildGUID != "0ab3618344e342558a9e2795284ddad1")
			{
				Log("VERSION MISMATCH: <" + Application.buildGUID + "> != <0ab3618344e342558a9e2795284ddad1>");
				versionMismatch = true;
			}
		}

		public static void UnlockWare(int ware, string pPref)
		{
			if (pPref != "" && (GameProgressSaver.CheckGear(pPref) == 0 || MonoSingleton<PrefsManager>.Instance.GetInt("ware." + pPref, 0) == 0))
			{
				MonoSingleton<PrefsManager>.Instance.SetInt("weapon." + pPref, 1);
				if (!SceneHelper.IsPlayingCustom)
				{
					GameProgressSaver.AddGear(pPref);
				}
			}
		}

		public static void SetLayerRecursive(this GameObject _go, int _layer)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			_go.layer = _layer;
			foreach (Transform item in _go.transform)
			{
				Transform val = item;
				((Component)val).gameObject.layer = _layer;
				if ((Object)(object)((Component)val).GetComponentInChildren<Transform>() != (Object)null)
				{
					((Component)val).gameObject.SetLayerRecursive(_layer);
				}
			}
		}
	}
	[BepInPlugin("maranara_project_prophet", "Masquerade Divinity", "0.1.5")]
	public class ProjectProphet : BaseUnityPlugin
	{
		[CompilerGenerated]
		private sealed class <LoadContent>d__6 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			private AsyncOperationHandle<IResourceLocator> <res>5__2;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <LoadContent>d__6(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				<res>5__2 = default(AsyncOperationHandle<IResourceLocator>);
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//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)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<res>5__2 = Addressables.LoadContentCatalogAsync(Path.Combine(Utils.PackedPath ?? "", "projectprophet.json"), true, (string)null);
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (!<res>5__2.IsDone)
				{
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				MetaDatabase.Init();
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public const string VERSION_NUMBER = "0.1.5";

		public static bool gabeOn;

		public static Harmony harmony;

		private const string PATCHING_NAMESPACE = "ProjectProphet.Patching.GabrielPatches";

		private static ProjectProphet inst;

		public static ConfigEntry<bool> DidPopup;

		private void OnEnable()
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
			((Object)((Component)ThreadingHelper.Instance).gameObject).hideFlags = (HideFlags)61;
			inst = this;
			DidPopup = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "SawPopup", false, (ConfigDescription)null);
			Utils.CheckUltrakillVersion();
			harmony = new Harmony("maranara_project_prophet");
			((MonoBehaviour)this).StartCoroutine(LoadContent());
			MetaDatabase.InitStageAddons();
			new Harmony("maranara_project_prophet-save").PatchAll(typeof(UniversalPatches));
		}

		public static void SwitchGabe(bool enableGabriel)
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			if (enableGabriel == gabeOn)
			{
				return;
			}
			gabeOn = enableGabriel;
			if (enableGabriel)
			{
				Utils.notifLaunched = false;
				foreach (Type item in from t in Assembly.GetExecutingAssembly().GetTypes()
					where t.IsClass && t.Namespace == "ProjectProphet.Patching.GabrielPatches"
					select t)
				{
					harmony.PatchAll(item);
				}
				Scene activeScene = SceneManager.GetActiveScene();
				if (((Scene)(ref activeScene)).buildIndex != 1 && (Object)(object)MonoSingleton<OptionsManager>.Instance != (Object)null)
				{
					MonoSingleton<OptionsManager>.Instance.QuitMission();
				}
				if (MetaDatabase.CustomEnemies != null)
				{
					MonoSingleton<BestiaryData>.Instance.CheckSave();
				}
				ModdedBehaviour.Patch();
			}
			else
			{
				harmony.UnpatchSelf();
				MonoSingleton<OptionsManager>.Instance.QuitMission();
				Damned.Disable();
				PlayerPatches.ResetScrape();
				ModdedBehaviour.Unpatch();
			}
		}

		[IteratorStateMachine(typeof(<LoadContent>d__6))]
		private IEnumerator LoadContent()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <LoadContent>d__6(0);
		}

		public static void ToggleOffPopup()
		{
			inst.PopupOff();
		}

		private void PopupOff()
		{
			DidPopup.Value = true;
			((BaseUnityPlugin)this).Config.Save();
		}
	}
}
namespace ProjectProphet.StageAddons
{
	public static class G11
	{
		[StageAddon(11, true)]
		public static void HeartOfTheSunrise()
		{
			//IL_0452: Unknown result type (might be due to invalid IL or missing references)
			//IL_045d: 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_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Expected O, but got Unknown
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_0293: Expected O, but got Unknown
			//IL_0378: Unknown result type (might be due to invalid IL or missing references)
			//IL_0383: Unknown result type (might be due to invalid IL or missing references)
			//IL_038d: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Utils.LoadAndInstantiateStage("11");
			val.transform.Find("EasterEggSlab").SetParent((Transform)null, true);
			ArenaStatus[] array = Resources.FindObjectsOfTypeAll<ArenaStatus>();
			foreach (ArenaStatus val2 in array)
			{
				if (((Object)((Component)val2).gameObject).name == "1 - First Field")
				{
					CoinActivated[] componentsInChildren = ((Component)val2).gameObject.GetComponentsInChildren<CoinActivated>();
					for (int j = 0; j < componentsInChildren.Length; j++)
					{
						Object.Destroy((Object)(object)componentsInChildren[j]);
					}
				}
			}
			GoreZone[] array2 = Resources.FindObjectsOfTypeAll<GoreZone>();
			foreach (GoreZone val3 in array2)
			{
				if (((Object)((Component)val3).gameObject).name == "1 Stuff")
				{
					Transform obj = val.transform.Find("Cerberus");
					Transform val5 = (obj.parent = ((Component)val3).transform.Find("Fountain"));
					obj.localPosition = new Vector3(-0.45f, 0f, 0.54f);
					obj.localRotation = Quaternion.Euler(0f, 180f, 0f);
					obj.localScale = Vector3.one;
					obj.SetParent(val5.parent, true);
					ObjectActivator componentInChildren = ((Component)obj).gameObject.GetComponentInChildren<ObjectActivator>(true);
					List<GameObject> list = new List<GameObject>();
					list.AddRange(componentInChildren.events.toDisActivateObjects);
					list.Add(((Component)val5).gameObject);
					componentInChildren.events.toDisActivateObjects = list.ToArray();
				}
				else if (((Object)((Component)val3).gameObject).name == "6 Stuff")
				{
					Transform val6 = ((Component)val3).transform.parent.Find("6 Nonstuff");
					val.transform.SetParent(val6, false);
					val.transform.localPosition = Vector3.zero;
					val.transform.localRotation = Quaternion.identity;
					val.transform.localScale = Vector3.one;
					((Component)val6.Find("Ground").GetChild(0)).gameObject.SetActive(false);
					((Component)val6.Find("Decorations/Marble_Head_AnimTest")).gameObject.SetActive(false);
				}
				else if (((Object)((Component)val3).gameObject).name == "9 Stuff")
				{
					GameObject val7 = new GameObject("Malicious Face Delayer");
					val7.SetActive(false);
					val7.transform.SetParent(((Component)val3).transform);
					GameObject gameObject = ((Component)((Component)val3).transform.Find("Enemies/Spider")).gameObject;
					ObjectActivator val8 = val7.AddComponent<ObjectActivator>();
					val8.oneTime = true;
					val8.events = new UltrakillEvent();
					val8.events.toActivateObjects = (GameObject[])(object)new GameObject[1] { gameObject };
					val8.delay = 5.25f;
					((Component)((Component)val3).transform.Find("Enemies/EnemyTrigger")).gameObject.GetComponent<ActivateArena>().enemies = (GameObject[])(object)new GameObject[1] { val7 };
					WeaponPickUp component = ((Component)((Component)((Component)val3).transform.parent.Find("9 Nonstuff")).transform.Find("Weapon Pickup")).gameObject.GetComponent<WeaponPickUp>();
					component.weapon = null;
					component.inventorySlot = 1;
					component.gs = null;
					component.pPref = "arm1";
					component.arm = true;
					((Component)((Component)component).transform.Find("Nailgun New New")).gameObject.SetActive(false);
					Transform obj2 = val.transform.Find("Axe");
					obj2.SetParent(((Component)component).transform);
					obj2.localPosition = Vector3.zero;
					obj2.localRotation = Quaternion.identity;
					obj2.localScale = Vector3.one;
				}
				else if (((Object)((Component)val3).gameObject).name == "10 Stuff")
				{
					((Component)val3).transform.parent.Find("10 Nonstuff");
					HudMessage component2 = ((Component)((Component)val3).transform.Find("Magnet Tutorial")).gameObject.GetComponent<HudMessage>();
					component2.message = "<color=#00FFFF>SOMNIA</color>: Hold <color=orange>";
					component2.actionReference = InputActionReference.Create(MonoSingleton<InputManager>.Instance.defaultActions.FindAction("Fist/Punch", false));
					component2.message2 = "</color> to throw your <color=orange>AXE</color>. Can be hit to increase speed and damage.";
				}
			}
			Transform val9 = val.transform.Find("Switch Location");
			LimboSwitch obj3 = Resources.FindObjectsOfTypeAll<LimboSwitch>()[0];
			Transform parent = ((Component)obj3).transform.parent;
			parent.SetParent(val9, true);
			parent.localPosition = Vector3.zero;
			parent.localRotation = Quaternion.identity;
			((Component)parent).gameObject.layer = 8;
			((Component)obj3).gameObject.layer = 8;
		}
	}
	public static class G12
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__4_0;

			internal void <CancerousRodent>b__4_0()
			{
				Camera.main.useOcclusionCulling = false;
			}
		}

		[StageAddon(12, true)]
		public static void SigmaRat()
		{
			LimboSwitch lSwitch = Resources.FindObjectsOfTypeAll<LimboSwitch>()[0];
			GameObject obj = Utils.LoadAndInstantiateStage("12");
			DaggerPlacement(obj.transform.Find("DaggerGrp"), lSwitch);
			CancerousRodent(obj.transform.Find("RodentGrp"), lSwitch);
			NailgunRemover();
		}

		private static void NailgunRemover()
		{
			WeaponPickUp[] array = Resources.FindObjectsOfTypeAll<WeaponPickUp>();
			foreach (WeaponPickUp val in array)
			{
				if (Object.op_Implicit((Object)(object)((Component)val).transform.parent) && ((Object)((Component)((Component)val).transform.parent).gameObject).name == "1 - First Room")
				{
					Object.Destroy((Object)(object)((Component)val).gameObject);
				}
			}
		}

		private static void DaggerPlacement(Transform lvl, LimboSwitch lSwitch)
		{
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: 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_0127: 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)
			//IL_0045: 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)
			CheckPoint[] array = Resources.FindObjectsOfTypeAll<CheckPoint>();
			foreach (CheckPoint val in array)
			{
				if (Object.op_Implicit((Object)(object)val.toActivate) && ((Object)val.toActivate).name.StartsWith("7"))
				{
					Vector3 position = ((Component)val).transform.position;
					position.z = 406f;
					((Component)val).transform.position = position;
					((Renderer)((Component)((Component)val).transform.Find("Quad")).gameObject.GetComponent<MeshRenderer>()).enabled = false;
				}
			}
			Transform val2 = ((Component)lSwitch).transform.root.Find("7 Stuff");
			((Component)lvl).transform.SetParent(val2, false);
			((Component)lvl).transform.localPosition = Vector3.zero;
			((Component)lvl).transform.localRotation = Quaternion.identity;
			((Component)lvl).transform.localScale = Vector3.one;
			((Component)((Component)val2).transform.Find("CerberusStatue")).gameObject.SetActive(false);
			Transform val3 = ((Component)val2).transform.Find("StatueFake (1)");
			((Component)val3).transform.localRotation = Quaternion.Euler(0f, 180f, 0f);
			((Component)val3).gameObject.SetActive(true);
			Object.Destroy((Object)(object)((Component)val3.Find("BreakablePedestal")).gameObject);
			ActivateNextWave componentInChildren = ((Component)lvl).gameObject.GetComponentInChildren<ActivateNextWave>(true);
			val3.SetParent(((Component)componentInChildren).transform);
			componentInChildren.CountEnemies();
			componentInChildren.doors = ((Component)val2.Find("Enemies")).gameObject.GetComponent<ActivateNextWave>().doors;
			ObjectActivator component = ((Component)lvl.Find("Activate Enemy")).gameObject.GetComponent<ObjectActivator>();
			List<GameObject> list = new List<GameObject>();
			list.AddRange(component.events.toActivateObjects);
			list.Add(((Component)val3.Find("StatueActivator")).gameObject);
			component.events.toActivateObjects = list.ToArray();
			((Component)lvl).gameObject.GetComponentInChildren<ActivateArena>().doors = componentInChildren.doors;
			((Component)lvl.Find("Hud Message")).gameObject.GetComponent<HudMessage>().actionReference = InputActionReference.Create(MonoSingleton<InputManager>.Instance.defaultActions.FindAction("Weapon/Secondary Fire", false));
		}

		private static void PlaceTerminal(Transform shopLoc, string tip)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: 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_0030: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Levels/Shop.prefab").WaitForCompletion()).transform;
			transform.SetParent(shopLoc, true);
			transform.localPosition = Vector3.zero;
			transform.localRotation = Quaternion.identity;
			ShopZone component = ((Component)transform).gameObject.GetComponent<ShopZone>();
			TMP_Text tipOfTheDay = component.tipOfTheDay;
			component.tipOfTheDay = null;
			tipOfTheDay.text = tip;
		}

		private static void CancerousRodent(Transform lvl, LimboSwitch lSwitch)
		{
			//IL_009a: 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_00ba: 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_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: 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_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Expected O, but got Unknown
			Transform shopLoc = lvl.Find("Shop Placement");
			Transform shopLoc2 = lvl.Find("Ratroom/Dynamic/Deathloop Group/Shop Placement");
			Transform val = lvl.Find("Switch Location");
			Transform parent = ((Component)lSwitch).transform.parent.parent;
			((Component)parent.GetChild(7)).gameObject.SetActive(false);
			((Component)parent.Find("Arch (17)")).gameObject.SetActive(false);
			Transform val2 = parent.Find("GreenWater");
			val2.GetChild(0).SetParent(val2.parent, true);
			((Component)val2).gameObject.SetActive(false);
			((Component)lvl).transform.SetParent(parent, false);
			((Component)lvl).transform.localPosition = Vector3.zero;
			((Component)lvl).transform.localRotation = Quaternion.identity;
			((Component)lvl).transform.localScale = Vector3.one;
			PlaceTerminal(shopLoc, "What.");
			PlaceTerminal(shopLoc2, "<color=orange>Area denial attacks</color> are the greatest offense against fast, small moving targets.");
			Transform parent2 = ((Component)lSwitch).transform.parent;
			parent2.SetParent(val, true);
			parent2.localPosition = Vector3.zero;
			parent2.localRotation = Quaternion.identity;
			((Component)parent2).gameObject.layer = 8;
			((Component)lSwitch).gameObject.layer = 8;
			GameObject.Find("OutOfBounds").transform.Translate(Vector3.down * 200f);
			CancerousRodent[] array = Resources.FindObjectsOfTypeAll<CancerousRodent>();
			foreach (CancerousRodent val3 in array)
			{
				if ((Object)(object)((Component)val3).transform.parent == (Object)null || !(((Object)((Component)((Component)val3).transform.parent).gameObject).name == "VERY"))
				{
					continue;
				}
				GameObject gameObject = ((Component)((Component)lvl).transform.Find("BossDoorOpen")).gameObject;
				val3.activateOnDeath = CollectionExtensions.AddItem<GameObject>((IEnumerable<GameObject>)val3.activateOnDeath, gameObject).ToArray();
				ObjectActivator obj = gameObject.AddComponent<ObjectActivator>();
				obj.events = new UltrakillEvent();
				obj.events.onActivate = new UnityEvent();
				UnityEvent onActivate = obj.events.onActivate;
				object obj2 = <>c.<>9__4_0;
				if (obj2 == null)
				{
					UnityAction val4 = delegate
					{
						Camera.main.useOcclusionCulling = false;
					};
					<>c.<>9__4_0 = val4;
					obj2 = (object)val4;
				}
				onActivate.AddListener((UnityAction)obj2);
				break;
			}
		}
	}
	public static class G14
	{
		[StageAddon(14, true)]
		public static void PeopleBeLikeIHopeYouFightMichealInClaireDeLuneLIKEWHATAREYOUSERIOUS()
		{
			//IL_004c: 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_0062: 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_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0344: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			Utils.Log("Wings 1");
			GameObject val = Utils.LoadAndInstantiateStage("14");
			Utils.Log("Wings 2");
			Transform val2 = val.transform.Find("WingsIntro");
			Utils.Log("Wings 3");
			val2.SetParent(((Component)MonoSingleton<CameraController>.Instance).transform, true);
			val2.localPosition = Vector3.zero;
			val2.localRotation = Quaternion.identity;
			val2.localScale = Vector3.one;
			Utils.Log("Wings 4");
			WeaponPickUp[] array = Resources.FindObjectsOfTypeAll<WeaponPickUp>();
			for (int i = 0; i < array.Length; i++)
			{
				Utils.Log($"Wings 5: {i}//1");
				WeaponPickUp val3 = array[i];
				foreach (Transform item in ((Component)val3).transform)
				{
					((Component)item).gameObject.SetActive(false);
				}
				Utils.Log($"Wings 5: {i}//2");
				Transform transform = Object.Instantiate<GameObject>(((Component)val.transform.Find("Wing Pickup")).gameObject).transform;
				Utils.Log($"Wings 5: {i}//3");
				transform.SetParent(((Component)val3).transform);
				transform.localPosition = Vector3.zero;
				transform.localRotation = Quaternion.Euler(270f, 0f, 0f);
				transform.localScale = Vector3.one;
				Utils.Log($"Wings 5: {i}//4");
				WaresPickUp waresPickUp = ((Component)val3).gameObject.AddComponent<WaresPickUp>();
				Utils.Log($"Wings 5: {i}//5");
				waresPickUp.activateObj = ((Component)val2).gameObject;
				waresPickUp.activateObj2 = val3.activateOnPickup;
				waresPickUp.slot = 1;
				Utils.Log($"Wings 5: {i}//6");
				HudMessage componentInChildren = ((Component)((Component)val3).transform.parent).GetComponentInChildren<HudMessage>(true);
				Utils.Log($"Wings 5: {i}//7");
				componentInChildren.message = "Press and Hold <color=orange>";
				Utils.Log($"Wings 5: {i}//8");
				componentInChildren.message2 = "</color> while mid-air to <color=orange>FLY</color>.";
				Utils.Log($"Wings 5: {i}//9");
				componentInChildren.actionReference = InputActionReference.Create(MonoSingleton<InputManager>.Instance.defaultActions.FindAction("Movement/Jump", false));
				Utils.Log($"Wings 5: {i}//10");
				Object.DestroyImmediate((Object)(object)val3);
				Utils.Log($"Wings 5: {i}//11");
			}
			Utils.Log("Wings 6");
			AltPickUp val4 = Resources.FindObjectsOfTypeAll<AltPickUp>()[0];
			foreach (Transform item2 in ((Component)val4).transform)
			{
				Object.Destroy((Object)(object)((Component)item2).gameObject);
			}
			Transform obj = val.transform.Find("AltSword Pickup");
			obj.SetParent(((Component)val4).transform);
			obj.localPosition = new Vector3(-2.0473f, 3.8109f, -2.5236f);
			obj.localRotation = Quaternion.Euler(2.355f, 0.7873f, 206.0624f);
			obj.localScale = Vector3.one * 3f;
			obj.Find("Rock Pile").SetParent((Transform)null, true);
			HudMessage[] array2 = Resources.FindObjectsOfTypeAll<HudMessage>();
			foreach (HudMessage val5 in array2)
			{
				if (((Object)((Component)val5).gameObject).name == "Cube")
				{
					val5.message = "<color=orange>GREATSWORD</color>: Higher damage.$No projectiles. Can parry melee attacks.";
					break;
				}
			}
		}
	}
	public static class G1S
	{
		public static void NotYet()
		{
			Utils.LoadAndInstantiateStage("1s");
		}
	}
	public class GConstruct
	{
		public static void ILaunchedGarrysModAndInstalledAGabrielAvatarAndThisIsTheMostEuphoricExperienceIveHadInMyLife()
		{
		}
	}
	public static class GEA
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__1_0;

			public static UnityAction <>9__4_0;

			internal void <DoorLoader>b__1_0()
			{
				LoadEarlyAccess();
			}

			internal void <FinalizeEarlyAccess>b__4_0()
			{
				SceneHelper.LoadScene("Main Menu", false);
			}
		}

		[CompilerGenerated]
		private sealed class <WaitAndLoad>d__3 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <WaitAndLoad>d__3(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					break;
				case 1:
					<>1__state = -1;
					break;
				}
				if (!string.IsNullOrEmpty(SceneHelper.PendingScene))
				{
					<>2__current = (object)new WaitForEndOfFrame();
					<>1__state = 1;
					return true;
				}
				try
				{
					SceneHelper.LoadScene("ProjectProphet.Scenes.End", false);
				}
				catch
				{
					SceneManager.LoadScene("Main Menu");
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public static void EAAssurance()
		{
			DoorLoader();
			LoadEarlyAccess();
		}

		public static void DoorLoader()
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Expected O, but got Unknown
			try
			{
				UnityEvent onFullyOpened = ((Component)GameObject.Find("FirstRoom").transform.Find("Room").Find("FinalDoor")).GetComponent<FinalDoor>().doors[0].onFullyOpened;
				object obj = <>c.<>9__1_0;
				if (obj == null)
				{
					UnityAction val = delegate
					{
						LoadEarlyAccess();
					};
					<>c.<>9__1_0 = val;
					obj = (object)val;
				}
				onFullyOpened.AddListener((UnityAction)obj);
			}
			catch
			{
			}
		}

		public static void LoadEarlyAccess()
		{
			((MonoBehaviour)ThreadingHelper.Instance).StartCoroutine(WaitAndLoad());
		}

		[IteratorStateMachine(typeof(<WaitAndLoad>d__3))]
		private static IEnumerator WaitAndLoad()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <WaitAndLoad>d__3(0);
		}

		public static void FinalizeEarlyAccess()
		{
			//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_0033: Expected O, but got Unknown
			ButtonClickedEvent onClick = GameObject.Find("Quit Mission").GetComponent<Button>().onClick;
			object obj = <>c.<>9__4_0;
			if (obj == null)
			{
				UnityAction val = delegate
				{
					SceneHelper.LoadScene("Main Menu", false);
				};
				<>c.<>9__4_0 = val;
				obj = (object)val;
			}
			((UnityEvent)onClick).AddListener((UnityAction)obj);
		}
	}
	public static class G02
	{
		[StageAddon(2, true)]
		public static void WhoUpSwordsingTheyMachineRn()
		{
			Utils.Log("Swordsing they machine...");
			ConvertToCrossbow(Utils.LoadAndInstantiateStage("02").transform);
		}

		public static void ConvertToCrossbow(Transform inst)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			WeaponPickUp[] array = Resources.FindObjectsOfTypeAll<WeaponPickUp>();
			foreach (WeaponPickUp val in array)
			{
				foreach (Transform item in ((Component)val).transform)
				{
					Object.Destroy((Object)(object)((Component)item).gameObject);
				}
				((Component)val).gameObject.GetComponent<Rigidbody>().drag = 10f;
				Object.Destroy((Object)(object)((Component)val).gameObject.GetComponent<Animator>());
				Transform transform = Object.Instantiate<GameObject>(((Component)inst.Find("CrossbowPickup")).gameObject).transform;
				transform.SetParent(((Component)val).transform);
				transform.localPosition = Vector3.zero;
				transform.localRotation = Quaternion.identity;
				transform.localScale = new Vector3(6.6666665f, 6.6666665f, 5f);
				Traverse field = Traverse.Create((object)val).Field("weapon");
				Utils.SetAssRefField(MetaDatabase.resources.crossbow[0], field);
			}
			((Component)inst.Find("CrossbowPickup")).gameObject.SetActive(false);
		}
	}
	public static class G0S
	{
		private const string BalladI = "BALLAD I\r\n\r\nAs I sink deeper below\r\n\r\nKnowing there is no water to swallow,\r\n\r\nI feel each and all parts of me\r\n\r\nCalling your name";

		public static void SomethingWicked()
		{
			//IL_007d: 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_00e6: Unknown result type (might be due to invalid IL or missing references)
			ShopZone[] array = Resources.FindObjectsOfTypeAll<ShopZone>();
			foreach (ShopZone val in array)
			{
				if (((Object)((Component)val).gameObject).name == "Testament Shop (1)")
				{
					AudioSource component = ((Component)((Component)val).transform.GetChild(0)).GetComponent<AudioSource>();
					component.clip = MetaDatabase.resources.testamentMusic;
					component.dopplerLevel = 0f;
					component.Play();
					TextMeshProUGUI component2 = ((Component)((Component)val).gameObject.GetComponentInChildren<ScrollingText>(true)).gameObject.GetComponent<TextMeshProUGUI>();
					((TMP_Text)component2).text = "BALLAD I\r\n\r\nAs I sink deeper below\r\n\r\nKnowing there is no water to swallow,\r\n\r\nI feel each and all parts of me\r\n\r\nCalling your name";
					((Graphic)component2).color = Color.blue;
					((Component)((Component)val).transform.Find("Canvas/Border")).gameObject.SetActive(true);
					Transform obj = ((Component)val).transform.Find("Canvas/Border/TipBox");
					obj.localScale = new Vector3(1.1f, 1f, 1f);
					((Graphic)((Component)obj).GetComponent<Image>()).color = new Color(0f, 0f, 0f, 0.8f);
					((Component)obj.GetChild(0)).gameObject.SetActive(false);
				}
			}
			Object.Destroy((Object)(object)MonoSingleton<GunControl>.Instance.slot1[0]);
			MonoSingleton<GunControl>.Instance.slot1.Clear();
		}
	}
	public static class GTutorial
	{
		private const string IntroText = " STATUS UPDATE: \r\n\r\n MACHINE ID:            NOT FOUND         ½\r\n LOCATION:              UNKNOWN            ½\r\n CURRENT OBJECTIVE:     RECOVER         ½½½\r\n\r\n*THE BLOOD DRIPS_½½\r\n*FROM THIS METAL FRAME_½½\r\n*and½the½sound½is½½divine_½½&";

		private const string IntroFadeText = " <color=blue>THE BLOOD DRIPS\r\n FROM THIS METAL FRAME\r\n and the sound is  divine</color>";

		public static void CalibrateTutorial()
		{
			//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)
			if ((Object)(object)V62.heresyEndCanvas != (Object)null)
			{
				V62.heresyEndCanvas.SetActive(false);
				Object.DestroyImmediate((Object)(object)V62.heresyEndCanvas);
			}
			IntroText[] array = Resources.FindObjectsOfTypeAll<IntroText>();
			foreach (IntroText val in array)
			{
				if (!(((Object)((Component)val).gameObject).name == "Page 2"))
				{
					continue;
				}
				Scene scene = ((Component)val).gameObject.scene;
				if (!(((Scene)(ref scene)).name != "DontDestroyOnLoad") || !((Object)(object)((Component)val).transform.root != (Object)null))
				{
					continue;
				}
				val.fullString = " STATUS UPDATE: \r\n\r\n MACHINE ID:            NOT FOUND         ½\r\n LOCATION:              UNKNOWN            ½\r\n CURRENT OBJECTIVE:     RECOVER         ½½½\r\n\r\n*THE BLOOD DRIPS_½½\r\n*FROM THIS METAL FRAME_½½\r\n*and½the½sound½is½½divine_½½&";
				((TMP_Text)((Component)val).gameObject.GetComponent<TextMeshProUGUI>()).text = " STATUS UPDATE: \r\n\r\n MACHINE ID:            NOT FOUND         ½\r\n LOCATION:              UNKNOWN            ½\r\n CURRENT OBJECTIVE:     RECOVER         ½½½\r\n\r\n*THE BLOOD DRIPS_½½\r\n*FROM THIS METAL FRAME_½½\r\n*and½the½sound½is½½divine_½½&";
				Transform val2 = ((Component)val).transform.root.Find("Intro");
				if (Object.op_Implicit((Object)(object)((Component)val).transform.parent))
				{
					Transform val3 = ((Component)val).transform.parent.Find("Page 2 NoFade");
					if (Object.op_Implicit((Object)(object)val3))
					{
						((TMP_Text)((Component)val3).gameObject.GetComponent<TextMeshProUGUI>()).text = " <color=blue>THE BLOOD DRIPS\r\n FROM THIS METAL FRAME\r\n and the sound is  divine</color>";
					}
				}
				if ((Object)(object)val2 != (Object)null)
				{
					Transform val4 = val2.Find("Audio Source");
					if ((Object)(object)val4 != (Object)null)
					{
						((Component)val4).gameObject.GetComponent<AudioSource>().clip = MetaDatabase.resources.mainMenuMusic;
					}
				}
			}
		}
	}
	public static class G03
	{
		[StageAddon(3, true)]
		public static void WokeUltrakillBeLikeSwordstheychine()
		{
			//IL_01b